diff --git a/dev/App/Abstract.jsx b/dev/App/Abstract.jsx index e9ae5dc31..fd22b0553 100644 --- a/dev/App/Abstract.jsx +++ b/dev/App/Abstract.jsx @@ -330,7 +330,7 @@ class AbstractApp extends AbstractBoot { ssm.addState({ id: 'mobile', - maxWidth: 767, + query: '(max-width: 767px)', onEnter: () => { $html.addClass('ssm-state-mobile'); Events.pub('ssm.mobile-enter'); @@ -343,8 +343,7 @@ class AbstractApp extends AbstractBoot ssm.addState({ id: 'tablet', - minWidth: 768, - maxWidth: 999, + query: '(min-width: 768px) and (max-width: 999px)', onEnter: function() { $html.addClass('ssm-state-tablet'); }, @@ -355,8 +354,7 @@ class AbstractApp extends AbstractBoot ssm.addState({ id: 'desktop', - minWidth: 1000, - maxWidth: 1400, + query: '(min-width: 1000px) and (max-width: 1400px)', onEnter: () => { $html.addClass('ssm-state-desktop'); }, @@ -367,7 +365,7 @@ class AbstractApp extends AbstractBoot ssm.addState({ id: 'desktop-large', - minWidth: 1400, + query: '(min-width: 1401px)', onEnter: () => { $html.addClass('ssm-state-desktop-large'); }, @@ -394,8 +392,6 @@ class AbstractApp extends AbstractBoot leftPanelDisabled.valueHasMutated(); - ssm.ready(); - require('Stores/Language').populate(); require('Stores/Theme').populate(); require('Stores/Social').populate(); diff --git a/dev/Common/ClientStorageDriver/Cookie.jsx b/dev/Common/ClientStorageDriver/Cookie.jsx index b7e097ba4..8a7bd3070 100644 --- a/dev/Common/ClientStorageDriver/Cookie.jsx +++ b/dev/Common/ClientStorageDriver/Cookie.jsx @@ -1,7 +1,6 @@ import window from 'window'; -import $ from '$'; -import JSON from 'JSON'; +import Cookies from 'js-cookie'; import {isUnd} from 'Common/Utils'; import {CLIENT_SIDE_STORAGE_INDEX_NAME} from 'Common/Consts'; @@ -20,8 +19,7 @@ class CookieDriver try { - const storageValue = $.cookie(CLIENT_SIDE_STORAGE_INDEX_NAME); - storageResult = null === storageValue ? null : JSON.parse(storageValue); + storageResult = Cookies.getJSON(CLIENT_SIDE_STORAGE_INDEX_NAME); } catch (e) {} // eslint-disable-line no-empty @@ -29,7 +27,7 @@ class CookieDriver try { - $.cookie(CLIENT_SIDE_STORAGE_INDEX_NAME, JSON.stringify(storageResult), { + Cookies.set(CLIENT_SIDE_STORAGE_INDEX_NAME, storageResult, { expires: 30 }); @@ -50,10 +48,7 @@ class CookieDriver try { - const - storageValue = $.cookie(CLIENT_SIDE_STORAGE_INDEX_NAME), - storageResult = null === storageValue ? null : JSON.parse(storageValue); - + const storageResult = Cookies.getJSON(CLIENT_SIDE_STORAGE_INDEX_NAME); result = (storageResult && !isUnd(storageResult[key])) ? storageResult[key] : null; } catch (e) {} // eslint-disable-line no-empty diff --git a/dev/Common/Consts.jsx b/dev/Common/Consts.jsx index 47f558924..56b48b3b6 100644 --- a/dev/Common/Consts.jsx +++ b/dev/Common/Consts.jsx @@ -1,5 +1,4 @@ -/* eslint max-len: 0 */ export const MESSAGES_PER_PAGE = 20; export const MESSAGES_PER_PAGE_VALUES = [10, 20, 30, 50, 100]; @@ -38,6 +37,7 @@ export const TOKEN_ERROR_LIMIT = 10; export const RAINLOOP_TRIAL_KEY = 'RAINLOOP-TRIAL-KEY'; +/* eslint max-len: 0 */ export const DATA_IMAGE_USER_DOT_PIC = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAHHklEQVRoQ7VZW08bVxCeXRuwIbTGXIwNtBBaqjwgVUiR8lDlbza9qe1DpVZ9aNQ/0KpPeaJK07SpcuEeCEmUAObm21bfrL9lONjexSYrWfbunj37zXdmvpkz9oIgCKTD0Wg0xPd94TDP83Q0zvWa50vzklSrdanVanqf4/D84GBGr+F+Op3S8fqoJxLOdnZgTvsO/nYhenHA+UC7CWF1uXwkb9++ldPTUwVerVbVqFQqpR8YPjQ0JCMjI5LNDijoRgP3PQVu5+5Eor2XGLg7IV4GkIdHJ/LmzRs5ODiIwNbrdR0O0GCcq4Xz4eFhmZyclP7+tDQaIik/BG5XKQn4SwG3zJTLZXn9+rUclI8UHD5YVoDDN8bSzXhONwL48fFxGR4eilzFZT1uFRIB5yT8BqCdnR3Z3d0VP9Un6XRawYJpggVrZBv38ME4XKtUKnLt2jUplUoy1PR/l3U7T6sVSAQcgMAkj8PDQ9ne3pajoyMRL7zeKsYZWHgWYDGmv78/mmdwcFA+mJlSgziHDWrERrsjEXDXegTi1tZW+DLxI2bxIrqFNYTXyDyCFweMAHCwb8e4RnTNuOsqe3t7sra21pTD0Kct666E8XlcZyzw9/RUUXK5nK5oUinUQI6TQ3cynO/v78vq6qrKXCNwlTiJJpyNGc3nZHp6uqV2dwrQWOCtZBDAV1ZWwsQk7f0wiQn5kffbAu/0/KWBYzIC1+XukfGx0RGZmppKlC2tIV0Bh4aDcZW7HhkfH8urLLZL7T2pihvlkMNnz56FiadHxicL41IsFpN41bkxsYxbRdFo9jwB8KdPn14J8KnSpBQKhQs63nPmbCVRcBUAR2Lq1VVmpksyMTFxAXjcEsQybiegESionjx5osCZOeNe1O4+EhCAX7bQSgQcxRHTMgAgcz5+/Dis/hL4uHU3/B4YGNASGHIKxuEql0k+l05AeIAF1vPnz5VxFFmdDlaJrMtZITJeSsXCOTlMunKxjLtMYOKNjQ158eJFuAuKkUOb5sEwgff19SkJUBVkThZUbnXZrtCKBQ6gbnWIkjZpyne3ejAWoGnA7Icz6irvBLgbOMicCM6TkxPx/LAkbXfgWcsazuE2kFRsKD5Z+CiqDumKncpZvieWcS6dDVD8xiYCNflpJdwcdwJOf9airLmVQ7DPzMxIYWLsXGXoVqLt5k0M3K3JUVPDZdbWNzsCp48TPFdvdnZWUz32nDha7bJ63kgAJPzSdRks9/Kf9xMJAQ1gq2NpaUmy2Yz4zar4nQC3xb99AQwCcGzLAAwuhG8YiWvcOKts+r4GOe5nMhm5efOm9lUA3E3vSZJRrKvE0fnPv//Jy5cvo5cTHIPQbSjhOoqq69evS19f6lxDKK4+sVhigZPtKJqbrQeqxd5+WR4+fKgqgT0k2XX3nhiPgETWXFhYkFzuPZ2yVq1GTSOXpE47/VjgNnD4m4GG7/LhsTx69EiwD4Vr2MwIIxgbAH18fKx1yfz8vEogNvGtWnCuhLZa9UTAreVWFsHy/b/+Vrbdl7E5REMQD2jDoUbByty+/ZnU64GkU2HzyJLhktU1cLv8nARgkYS2d3ajAgwG8qU2oLmDZ92CMaOjo7K4uCiZgbDWaRWgnZhPxLhrMUCvr69riwKZk1LHF7XqrWAO9hJxH6ozNzcnCx/PqztZg9mf6SQMscCtm2C5ke4BGMlHWTUp36036AJajDVrFMzBrhhWslQsSrFYiOqVpMriNYIgqFRq2j3FAb/zffT6zuxFXxsNzs3NTXn16lW4gYiW96w1FyedF+83xG/2FNGCRpU4NjamMsn+OZ9xE5RXqdaDdPpib6RWCzuwKF9RxqI2AVNQBwQYJoK0wdBejnqtEikP3pfP51XjUTESl12FqJEKxsEorARYDD44ONTeID7YpsEnrRvQfWAI2e8WfDaTUSIwJ0iBCmFOtOUAHvVMPp/TPwvYFVYFIuP8l+DBgwdaa2Miqwa0GgYwfeMltovbDfh6c1vIgMYcliSsKv4IWFr6VDHxvldvBAH+1sA+cnl5WYOPmmr9ir+1l9I0Cgz0yjhXjfJJ0JROnmezWbl165ayr/5fqwcBNr7IfhjMqKcvESSM4eRcCasQ3bDNObmKPLdGUGpZsN24cUNLBm9zazu4d++e6qpNBFaTuUS26U5dpuR1CxyA7J9ddrMRqlz4pwLLYawymPd++/2PADt2ugcGwq9gCCdhQ96C6xWwa6j1ceuq+I0EhW0i8MAIVJfeL3d/DVD8EKi12P6/2S2jV/EccVB54O/ejz/9HGCpoBBMta5rXMXLu53D1XAwjhXwvvv+h4BAXVe4bOu3O3ChxF08LiZFG3fel199G9CH3fLyqv24NcB44MRhpdK788U3CpyKwsCw590xmfSpzsBt0Fqc3ud3vtZigxWcVZCklVpSiN0w3q5E/h9TGMIUuA3+EQAAAABJRU5ErkJggg=='; export const DATA_IMAGE_TRANSP_PIC = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII='; diff --git a/dev/Common/Momentor.jsx b/dev/Common/Momentor.jsx index 33665b3ff..61547ecb0 100644 --- a/dev/Common/Momentor.jsx +++ b/dev/Common/Momentor.jsx @@ -40,7 +40,7 @@ export function momentNowUnix() */ export function searchSubtractFormatDateHelper(date) { - return momentNow().clone().subtract('days', date).format('YYYY.MM.DD'); + return momentNow().clone().subtract(date, 'days').format('YYYY.MM.DD'); } /** @@ -60,7 +60,7 @@ function formatCustomShortDate(m) return i18n('MESSAGE_LIST/TODAY_AT', { TIME: m.format('LT') }); - case now.clone().subtract('days', 1).format('L') === m.format('L'): + case now.clone().subtract(1, 'days').format('L') === m.format('L'): return i18n('MESSAGE_LIST/YESTERDAY_AT', { TIME: m.format('LT') }); diff --git a/dev/Common/Utils.jsx b/dev/Common/Utils.jsx index 29564cf35..31a458ae3 100644 --- a/dev/Common/Utils.jsx +++ b/dev/Common/Utils.jsx @@ -7,7 +7,6 @@ import {$win, $div, dropdownVisibility, data as GlobalsData} from 'Common/Global import {ComposeType, EventKeyCode, SaveSettingsStep, FolderType} from 'Common/Enums'; import {Mime} from 'Common/Mime'; -import JSEncrypt from 'JSEncrypt'; import Autolinker from 'Autolinker'; const trim = $.trim; @@ -184,59 +183,6 @@ export function fakeMd5(len = 32) return result; } -let encryptObject = null; - -/** - * @param {constructor} JSEncryptClass - * @param {string} publicKey - * @returns {JSEncrypt|boolean} - */ -const rsaObject = (JSEncryptClass, publicKey) => { - - if (JSEncryptClass && publicKey && (null === encryptObject || (encryptObject && encryptObject.__publicKey !== publicKey)) && - window.crypto && window.crypto.getRandomValues) - { - encryptObject = new JSEncryptClass(); - encryptObject.setPublicKey(publicKey); - encryptObject.__publicKey = publicKey; - } - else - { - encryptObject = false; - } - - return encryptObject; -}; - -/** - * @param {string} value - * @param {string} publicKey - * @returns {string} - */ -const rsaEncode = (value, publicKey) => { - - if (window.crypto && window.crypto.getRandomValues && publicKey) - { - let resultValue = false; - const encrypt = rsaObject(JSEncrypt, publicKey); - - if (encrypt) - { - resultValue = encrypt.encrypt(fakeMd5() + ':' + value + ':' + fakeMd5()); - if (false !== resultValue && isNormal(resultValue)) - { - return 'rsa:xxx:' + resultValue; - } - } - } - - return value; -}; - -rsaEncode.supported = !!(window.crypto && window.crypto.getRandomValues && false && JSEncrypt); - -export {rsaEncode}; - /** * @param {string} text * @returns {string} @@ -248,7 +194,7 @@ export function encodeHtml(text) /** * @param {string} text - * @param {number=} iLen = 100 + * @param {number=} len = 100 * @returns {string} */ export function splitPlainText(text, len = 100) @@ -312,15 +258,18 @@ export {timeOutAction, timeOutActionSecond}; */ export function inFocus() { - if (window.document.activeElement) - { - if (isUnd(window.document.activeElement.__inFocusCache)) + try { + if (window.document.activeElement) { - window.document.activeElement.__inFocusCache = $(window.document.activeElement).is('input,textarea,iframe,.cke_editable'); - } + if (isUnd(window.document.activeElement.__inFocusCache)) + { + window.document.activeElement.__inFocusCache = $(window.document.activeElement).is('input,textarea,iframe,.cke_editable'); + } - return !!window.document.activeElement.__inFocusCache; + return !!window.document.activeElement.__inFocusCache; + } } + catch (e) {} // eslint-disable-line no-empty return false; } @@ -853,6 +802,8 @@ export function findEmailAndLinks(html) urls: true, email: true, twitter: false, + phone: false, + hashtag: false, replaceFn: function(autolinker, match) { return !(autolinker && match && 'url' === match.getType() && match.matchedText && 0 !== match.matchedText.indexOf('http')); } diff --git a/dev/External/ko.js b/dev/External/ko.js index 6135f8dcc..886c1c8c4 100644 --- a/dev/External/ko.js +++ b/dev/External/ko.js @@ -449,14 +449,16 @@ ko.bindingHandlers.modal = { Globals = require('Common/Globals'), Utils = require('Common/Utils'); - $(oElement).toggleClass('fade', !Globals.bMobileDevice).modal({ - 'keyboard': false, - 'show': ko.unwrap(fValueAccessor()) - }) - .on('shown.koModal', Utils.windowResizeCallback) - .find('.close').on('click.koModal', function() { - fValueAccessor()(false); - }); + $(oElement) + .toggleClass('fade', !Globals.bMobileDevice) + .modal({ + 'keyboard': false, + 'show': ko.unwrap(fValueAccessor()) + }) + .on('shown.koModal', Utils.windowResizeCallback) + .find('.close').on('click.koModal', function() { + fValueAccessor()(false); + }); ko.utils.domNodeDisposal.addDisposeCallback(oElement, function() { $(oElement) diff --git a/dev/Model/Email.jsx b/dev/Model/Email.jsx index 4ec893c18..2f30d363f 100644 --- a/dev/Model/Email.jsx +++ b/dev/Model/Email.jsx @@ -172,7 +172,7 @@ class EmailModel if (friendlyView && '' !== this.name) { result = wrapWithLink ? '') + - '" target="_blank" tabindex="-1">' + encodeHtml(this.name) + '' : (encodeHtml ? encodeHtml(this.name) : this.name); + '" target="_blank" tabindex="-1">' + encodeHtml(this.name) + '' : (useEncodeHtml ? encodeHtml(this.name) : this.name); } else { diff --git a/dev/Model/Folder.jsx b/dev/Model/Folder.jsx index 136da729c..069b9fd43 100644 --- a/dev/Model/Folder.jsx +++ b/dev/Model/Folder.jsx @@ -32,7 +32,6 @@ class FolderModel extends AbstractModel this.focused = ko.observable(false); this.selected = ko.observable(false); this.edited = ko.observable(false); - this.collapsed = ko.observable(true); this.subScribed = ko.observable(true); this.checkable = ko.observable(false); this.subFolders = ko.observableArray([]); diff --git a/dev/Promises/User/Populator.js b/dev/Promises/User/Populator.js index 787e5cdc1..5fbef1aa4 100644 --- a/dev/Promises/User/Populator.js +++ b/dev/Promises/User/Populator.js @@ -29,12 +29,12 @@ _.extend(PromisesUserPopulator.prototype, AbstractBasicPromises.prototype); /** * @param {string} sFullNameHash + * @param {Array?} expandedFolders * @returns {boolean} */ -PromisesUserPopulator.prototype.isFolderExpanded = function(sFullNameHash) +PromisesUserPopulator.prototype.isFolderExpanded = function(sFullNameHash, expandedFolders) { - var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders); - return Utils.isArray(aExpandedList) && -1 !== _.indexOf(aExpandedList, sFullNameHash); + return expandedFolders && Utils.isArray(expandedFolders) && -1 !== _.indexOf(expandedFolders, sFullNameHash); }; /** @@ -50,9 +50,10 @@ PromisesUserPopulator.prototype.normalizeFolder = function(sFolderFullNameRaw) /** * @param {string} sNamespace * @param {Array} aFolders + * @param {Array?} expandedFolders * @returns {Array} */ -PromisesUserPopulator.prototype.folderResponseParseRec = function(sNamespace, aFolders) +PromisesUserPopulator.prototype.folderResponseParseRec = function(sNamespace, aFolders, expandedFolders) { var self = this, @@ -60,6 +61,7 @@ PromisesUserPopulator.prototype.folderResponseParseRec = function(sNamespace, aF iLen = 0, oFolder = null, oCacheFolder = null, + bDisplaySpecSetting = FolderStore.displaySpecSetting(), sFolderFullNameRaw = '', aSubFolders = [], aList = []; @@ -84,16 +86,16 @@ PromisesUserPopulator.prototype.folderResponseParseRec = function(sNamespace, aF if (oCacheFolder) { - if (!FolderStore.displaySpecSetting()) - { - oCacheFolder.checkable(true); - } - else + if (bDisplaySpecSetting) { oCacheFolder.checkable(!!oFolder.Checkable); } + else + { + oCacheFolder.checkable(true); + } - oCacheFolder.collapsed(!self.isFolderExpanded(oCacheFolder.fullNameHash)); + oCacheFolder.collapsed(!self.isFolderExpanded(oCacheFolder.fullNameHash, expandedFolders)); if (oFolder.Extended) { @@ -118,7 +120,7 @@ PromisesUserPopulator.prototype.folderResponseParseRec = function(sNamespace, aF aSubFolders['@Collection'] && Utils.isArray(aSubFolders['@Collection'])) { oCacheFolder.subFolders( - this.folderResponseParseRec(sNamespace, aSubFolders['@Collection'])); + this.folderResponseParseRec(sNamespace, aSubFolders['@Collection'], expandedFolders)); } aList.push(oCacheFolder); @@ -135,14 +137,16 @@ PromisesUserPopulator.prototype.foldersList = function(oData) oData['@Collection'] && Utils.isArray(oData['@Collection'])) { var + folderList = [], + expandedFolders = Local.get(Enums.ClientSideKeyName.ExpandedFolders), iLimit = Utils.pInt(Settings.appSettingsGet('folderSpecLimit')), iC = Utils.pInt(oData.CountRec); iLimit = 100 < iLimit ? 100 : (10 > iLimit ? 10 : iLimit); FolderStore.displaySpecSetting(0 >= iC || iLimit < iC); - FolderStore.folderList(this.folderResponseParseRec( - Utils.isUnd(oData.Namespace) ? '' : oData.Namespace, oData['@Collection'])); + folderList = this.folderResponseParseRec(Utils.isUnd(oData.Namespace) ? '' : oData.Namespace, oData['@Collection'], expandedFolders); + FolderStore.folderList(folderList); // @todo optimization required } }; diff --git a/vendors/progress.js/minified/progressjs.rainloop.css b/dev/Styles/_progressjs.css similarity index 97% rename from vendors/progress.js/minified/progressjs.rainloop.css rename to dev/Styles/_progressjs.css index ddc78a941..a87c9ec5b 100644 --- a/vendors/progress.js/minified/progressjs.rainloop.css +++ b/dev/Styles/_progressjs.css @@ -1,62 +1,63 @@ -.progressjs-theme-rainloop { - z-index: 2000; -} - -.progressjs-theme-rainloop .progressjs-inner { - - background-color: #939595; - position: relative; - z-index: 2000; - height: 3px; - overflow: hidden; - - -webkit-transition: width .5s; - -moz-transition: width .5s; - -o-transition: width .5s; - transition: width .5s; -} - -.progressjs-theme-rainloop .progressjs-percent { - position: absolute; - top: 0; - left: 0; - right: -32px; - bottom: 0; - - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.3)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.3)), color-stop(0.75, rgba(255, 255, 255, 0.3)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); - -webkit-background-size: 32px 32px; - -moz-background-size: 32px 32px; - -o-background-size: 32px 32px; - background-size: 32px 32px; - - -webkit-animation: simple-pace-stripe-animation 500ms linear infinite; - -moz-animation: simple-pace-stripe-animation 500ms linear infinite; - -ms-animation: simple-pace-stripe-animation 500ms linear infinite; - -o-animation: simple-pace-stripe-animation 500ms linear infinite; - animation: simple-pace-stripe-animation 500ms linear infinite; -} - -@-webkit-keyframes simple-pace-stripe-animation { - 0% { -webkit-transform: none; transform: none; } - 100% { -webkit-transform: translate(-32px, 0); transform: translate(-32px, 0); } -} -@-moz-keyframes simple-pace-stripe-animation { - 0% { -moz-transform: none; transform: none; } - 100% { -moz-transform: translate(-32px, 0); transform: translate(-32px, 0); } -} -@-o-keyframes simple-pace-stripe-animation { - 0% { -o-transform: none; transform: none; } - 100% { -o-transform: translate(-32px, 0); transform: translate(-32px, 0); } -} -@-ms-keyframes simple-pace-stripe-animation { - 0% { -ms-transform: none; transform: none; } - 100% { -ms-transform: translate(-32px, 0); transform: translate(-32px, 0); } -} -@keyframes simple-pace-stripe-animation { - 0% { transform: none; transform: none; } - 100% { transform: translate(-32px, 0); transform: translate(-32px, 0); } -} \ No newline at end of file + +.progressjs-theme-rainloop { + z-index: 2000; +} + +.progressjs-theme-rainloop .progressjs-inner { + + background-color: #939595; + position: relative; + z-index: 2000; + height: 3px; + overflow: hidden; + + -webkit-transition: width .5s; + -moz-transition: width .5s; + -o-transition: width .5s; + transition: width .5s; +} + +.progressjs-theme-rainloop .progressjs-percent { + position: absolute; + top: 0; + left: 0; + right: -32px; + bottom: 0; + + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.3)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.3)), color-stop(0.75, rgba(255, 255, 255, 0.3)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); + -webkit-background-size: 32px 32px; + -moz-background-size: 32px 32px; + -o-background-size: 32px 32px; + background-size: 32px 32px; + + -webkit-animation: simple-pace-stripe-animation 500ms linear infinite; + -moz-animation: simple-pace-stripe-animation 500ms linear infinite; + -ms-animation: simple-pace-stripe-animation 500ms linear infinite; + -o-animation: simple-pace-stripe-animation 500ms linear infinite; + animation: simple-pace-stripe-animation 500ms linear infinite; +} + +@-webkit-keyframes simple-pace-stripe-animation { + 0% { -webkit-transform: none; transform: none; } + 100% { -webkit-transform: translate(-32px, 0); transform: translate(-32px, 0); } +} +@-moz-keyframes simple-pace-stripe-animation { + 0% { -moz-transform: none; transform: none; } + 100% { -moz-transform: translate(-32px, 0); transform: translate(-32px, 0); } +} +@-o-keyframes simple-pace-stripe-animation { + 0% { -o-transform: none; transform: none; } + 100% { -o-transform: translate(-32px, 0); transform: translate(-32px, 0); } +} +@-ms-keyframes simple-pace-stripe-animation { + 0% { -ms-transform: none; transform: none; } + 100% { -ms-transform: translate(-32px, 0); transform: translate(-32px, 0); } +} +@keyframes simple-pace-stripe-animation { + 0% { transform: none; transform: none; } + 100% { transform: translate(-32px, 0); transform: translate(-32px, 0); } +} diff --git a/dev/View/User/Login.js b/dev/View/User/Login.js index e187b7c52..9cf5f2baa 100644 --- a/dev/View/User/Login.js +++ b/dev/View/User/Login.js @@ -265,14 +265,7 @@ function LoginUserView() }, this); - if (Settings.appSettingsGet('rsaPublicKey') && Utils.rsaEncode.supported) - { - fLoginRequest(Utils.rsaEncode(sPassword, Settings.appSettingsGet('rsaPublicKey'))); - } - else - { - fLoginRequest(sPassword); - } + fLoginRequest(sPassword); return true; }, function() { diff --git a/dev/boot.jsx b/dev/boot.jsx index 5880021ec..fc2719a9f 100644 --- a/dev/boot.jsx +++ b/dev/boot.jsx @@ -2,7 +2,7 @@ import window from 'window'; import {Promise} from 'es6-promise-polyfill/promise.js'; -import {progressJs} from '../vendors/progress.js/src/progress.js'; +import {progressJs} from '../node_modules/Progress.js/src/progress.js'; import {jassl} from 'jassl'; window.jassl = jassl; @@ -13,14 +13,17 @@ window.progressJs.onbeforeend(() => { const _$ = window.$; if (_$) { - _$('.progressjs-container').hide(); - window.setTimeout(() => { - _$('.progressjs-container').remove(); - }, 200); // eslint-disable-line no-magic-numbers + try { + _$('.progressjs-container').hide(); + window.setTimeout(() => { + _$('.progressjs-container').remove(); + }, 200); // eslint-disable-line no-magic-numbers + } + catch (e) {} // eslint-disable-line no-empty } }); -require('../vendors/json2/json2.js'); +require('json3'); require('../vendors/modernizr/modernizr-custom.js'); require('Common/Booter.jsx'); diff --git a/gulpfile.js b/gulpfile.js index f4371deee..dd8a0ba3d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,723 +1,698 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */ -'use strict'; - -var - pkg = require('./package.json'), - head = { - rainloop: '/* RainLoop Webmail (c) RainLoop Team | Licensed under RainLoop Software License */', - agpl: '/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL v3 */' - }, - cfg = { - devVersion: '0.0.0', - releasesPath: 'build/dist/releases', - community: true, - watch: false, - watchInterval: 1000, - googleCompile: false, - - rainloopBuilded: false, - destPath: '', - cleanPath: '', - zipSrcPath: '', - zipFile: '', - - paths: {}, - uglify: { - mangle: true, - compress: true - } - }, - - _ = require('lodash'), - fs = require('node-fs'), - path = require('path'), - notifier = require('node-notifier'), - - gulp = require('gulp'), - concat = require('gulp-concat-util'), - header = require('gulp-header'), - stripbom = require('gulp-stripbom'), - rename = require('gulp-rename'), - replace = require('gulp-replace'), - uglify = require('gulp-uglify'), - notify = require("gulp-notify"), - plumber = require('gulp-plumber'), - gulpif = require('gulp-if'), - eol = require('gulp-eol'), - livereload = require('gulp-livereload'), - eslint = require('gulp-eslint'), - cache = require('gulp-cached'), - gutil = require('gulp-util') -; - -function getHead() -{ - return !cfg.community ? head.rainloop : head.agpl; -} - -function regOtherMinTask(sName, sPath, sInc, sOut, sHeader) -{ - gulp.task(sName, function() { - return gulp.src(sPath + sInc) - .pipe(uglify()) - .pipe(header(sHeader || '')) - .pipe(rename(sOut)) - .pipe(eol('\n', true)) - .pipe(gulp.dest(sPath)); - }); -} - -function zipDir(sSrcDir, sDestDir, sFileName) -{ - return gulp.src(sSrcDir + '**/*') - .pipe(require('gulp-zip')(sFileName)) - .pipe(gulp.dest(sDestDir)); -} - -function cleanDir(sDir) -{ - return gulp.src(sDir, {read: false}) - .pipe(require('gulp-rimraf')()); -} - -function renameFileWithMd5Hash(sFile, callback) -{ - var sHash = require('crypto').createHash('md5').update(fs.readFileSync(sFile)).digest('hex'); - cfg.lastMd5File = sFile.replace(/\.zip$/, '-' + sHash + '.zip'); - fs.renameSync(sFile, cfg.lastMd5File); - callback(); -} - -function copyFile(sFile, sNewFile, callback) -{ - fs.writeFileSync(sNewFile, fs.readFileSync(sFile)); - callback(); -} - -cfg.paths.globjs = 'dev/**/*.{js,jsx,html,css}'; -cfg.paths.globjsonly = 'dev/**/*.js'; -cfg.paths.globjsxonly = 'dev/**/*.jsx'; -cfg.paths.globjsall = 'dev/**/*.{js,jsx}'; -cfg.paths.globtsonly = 'dev/**/*.ts'; -cfg.paths.static = 'rainloop/v/' + cfg.devVersion + '/static/'; -cfg.paths.staticJS = 'rainloop/v/' + cfg.devVersion + '/static/js/'; -cfg.paths.staticMinJS = 'rainloop/v/' + cfg.devVersion + '/static/js/min/'; -cfg.paths.staticCSS = 'rainloop/v/' + cfg.devVersion + '/static/css/'; - -cfg.paths.less = { - main: { - name: 'less.css', - src: 'dev/Styles/@Main.less', - watch: ['dev/Styles/*.less'], - options: { - paths: [ - path.join(__dirname, 'dev', 'Styles'), - path.join(__dirname, 'vendors', 'bootstrap', 'less') - ] - } - } -}; - -cfg.paths.css = { - main: { - name: 'app.css', - src: [ - 'node_modules/normalize.css/normalize.css', - 'vendors/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.css', - 'vendors/fontastic/styles.css', - 'vendors/jquery-nanoscroller/nanoscroller.css', - 'vendors/jquery-letterfx/jquery-letterfx.min.css', - 'vendors/progress.js/minified/progressjs.min.css', - 'vendors/progress.js/minified/progressjs.rainloop.css', - 'vendors/inputosaurus/inputosaurus.css', - 'vendors/opentip/opentip.css', - 'vendors/flags/flags-fixed.css', - 'vendors/lightGallery/dist/css/lightgallery.min.css', - 'vendors/lightGallery/dist/css/lg-transitions-lg-lollipop.css', - 'node_modules/pikaday/css/pikaday.css', - cfg.paths.staticCSS + cfg.paths.less.main.name - ] - }, - social: { - name: 'social.css', - src: [ - 'vendors/fontastic/styles.css', - 'dev/Styles/_social.css' - ] - } -}; - -cfg.paths.js = { - openpgp: { - name: 'openpgp.min.js', - src: [ - 'node_modules/openpgp/dist/openpgp.min.js' - ] - }, - openpgpworker: { - name: 'openpgp.worker.min.js', - src: [ - 'node_modules/openpgp/dist/openpgp.worker.min.js' - ] - }, - encrypt: { - name: 'bundle.js', - header: '(function (window) {', - footer: '}(window));', - dest: 'vendors/jsbn/', - src: [ - 'vendors/jsbn/jsbn.js', - 'vendors/jsbn/prng4.js', - 'vendors/jsbn/rng.js', - 'vendors/jsbn/rsa.js', - 'vendors/jsbn/fix.js' - ] - }, - libs: { - name: 'libs.js', - src: [ - 'vendors/underscore/1.6.0/underscore-min.js', - 'vendors/jquery/jquery-2.2.4.min.js', -// 'vendors/jquery/jquery-3.0.0-rc1.min.js', - 'vendors/jquery-ui/js/jquery-ui-1.10.3.custom.min.js', - 'vendors/jquery-cookie/jquery.cookie-1.4.0.min.js', - 'vendors/jquery-finger/jquery.finger.min.js', - 'vendors/jquery-mousewheel/jquery.mousewheel-3.1.4.min.js', - 'vendors/jquery-scrollstop/jquery.scrollstop.min.js', - 'vendors/jquery-lazyload/jquery.lazyload.min.js', - 'vendors/jquery-nanoscroller/jquery.nanoscroller-0.7.min.js', - 'vendors/jquery-wakeup/jquery.wakeup.min.js', - 'vendors/jquery-letterfx/jquery-letterfx.min.js', - 'vendors/jquery-backstretch/jquery.backstretch.min.js', - 'vendors/inputosaurus/inputosaurus.min.js', - 'vendors/moment/min/moment.min.js ', - 'vendors/tinycon/tinycon.min.js ', - 'vendors/routes/signals.min.js', - 'vendors/routes/hasher.min.js', - 'vendors/routes/crossroads.min.js', - 'vendors/knockout/knockout-3.4.0.js', - 'vendors/knockout-projections/knockout-projections-1.1.0.min.js', - 'vendors/knockout-sortable/knockout-sortable.min.js', - 'vendors/ssm/ssm.min.js', - 'vendors/jua/jua.min.js', - 'vendors/opentip/opentip-jquery.min.js', - 'vendors/Autolinker/Autolinker.min.js', - 'vendors/lightGallery/dist/js/lightgallery.min.js', - 'vendors/lightGallery/dist/js/lg-fullscreen.min.js', - 'vendors/lightGallery/dist/js/lg-thumbnail.min.js', - 'vendors/lightGallery/dist/js/lg-zoom.min.js', - 'vendors/lightGallery/dist/js/lg-autoplay.min.js', - 'vendors/keymaster/keymaster.min.js', - 'vendors/ifvisible/ifvisible.min.js', - 'vendors/qr.js/qr.min.js', - 'vendors/bootstrap/js/bootstrap.min.js' - ] - }, - app: { - name: 'app.js' - }, - admin: { - name: 'admin.js' - } -}; - -// CSS -gulp.task('less:main', function() { - var less = require('gulp-less'); - - return gulp.src(cfg.paths.less.main.src) - .pipe(gulpif(cfg.watch, plumber({errorHandler: notify.onError("Error: <%= error.message %>")}))) - .pipe(less({ - 'paths': cfg.paths.less.main.options.paths - })) - .pipe(rename(cfg.paths.less.main.name)) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticCSS)) - .on('error', gutil.log); -}); - -gulp.task('css:social', function() { - var autoprefixer = require('gulp-autoprefixer'); - return gulp.src(cfg.paths.css.social.src) - .pipe(concat(cfg.paths.css.social.name)) - .pipe(autoprefixer('last 3 versions', '> 1%', 'ie 9', 'Firefox ESR', 'Opera 12.1')) - .pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/')) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticCSS)); -}); - -gulp.task('css:main-begin', ['less:main', 'css:social'], function() { - var autoprefixer = require('gulp-autoprefixer'); - return gulp.src(cfg.paths.css.main.src) - .pipe(concat(cfg.paths.css.main.name)) - .pipe(autoprefixer('last 3 versions', '> 1%', 'ie 9', 'Firefox ESR', 'Opera 12.1')) - .pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/')) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticCSS)) - .pipe(livereload()); -}); - -gulp.task('package:community-on', function() { - cfg.community = true; - return true; -}); - -gulp.task('package:community-off', function() { - cfg.community = false; - return true; -}); - -gulp.task('css:clear-less', ['css:main-begin'], function() { - return gulp.src(cfg.paths.staticCSS + cfg.paths.less.main.name, {read: false}) - .pipe(require('gulp-rimraf')()); -}); - -gulp.task('css:main', ['css:clear-less']); - -gulp.task('css:main:min', ['css:main'], function() { - var cleanCSS = require('gulp-clean-css'); - return gulp.src(cfg.paths.staticCSS + cfg.paths.css.main.name) - .pipe(cleanCSS()) - .pipe(rename({suffix: '.min'})) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticCSS)); -}); - -gulp.task('css:social:min', ['css:social'], function() { - var cleanCSS = require('gulp-clean-css'); - return gulp.src(cfg.paths.staticCSS + cfg.paths.css.social.name) - .pipe(cleanCSS()) - .pipe(rename({suffix: '.min'})) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticCSS)); -}); - -gulp.task('css:min', ['css:main:min', 'css:social:min']); - -// JS -gulp.task('js:encrypt', function() { - return gulp.src(cfg.paths.js.encrypt.src) - .pipe(concat(cfg.paths.js.encrypt.name)) - .pipe(concat.header(cfg.paths.js.encrypt.header || '')) - .pipe(concat.footer(cfg.paths.js.encrypt.footer || '')) - .pipe(uglify(cfg.uglify)) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.js.encrypt.dest)) - .on('error', gutil.log); -}); - -gulp.task('js:openpgp', function() { - return gulp.src(cfg.paths.js.openpgp.src) - .pipe(rename(cfg.paths.js.openpgp.name)) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticMinJS)); -}); - -gulp.task('js:openpgpworker', function() { - return gulp.src(cfg.paths.js.openpgpworker.src) - .pipe(rename(cfg.paths.js.openpgpworker.name)) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticMinJS)); -}); - -gulp.task('js:libs', function() { - return gulp.src(cfg.paths.js.libs.src) - .pipe(concat(cfg.paths.js.libs.name, {separator: '\n\n'})) - .pipe(eol('\n', true)) - .pipe(replace(/sourceMappingURL=[a-z0-9\.\-_]{1,20}\.map/ig, '')) - .pipe(gulp.dest(cfg.paths.staticMinJS)); -}); - -gulp.task('js:ckeditor:beautify', function() { - var beautify = require('gulp-beautify'); - return gulp.src(cfg.paths.static + 'ckeditor/ckeditor.js') - .pipe(beautify({ - 'indentSize': 2 - })) - .pipe(rename('ckeditor.beautify.js')) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.static + 'ckeditor/')); -}); - -gulp.task('js:webpack', [], function(callback) { - - var - webpack = require('webpack'), - webpackCfg = require('./webpack.config.js') - ; - - if (webpackCfg && webpackCfg.output) - { - webpackCfg.output.publicPath = cfg.paths.staticJS; - } - - if (webpackCfg && webpackCfg.plugins) - { - webpackCfg.plugins.push(new webpack.DefinePlugin({ - 'RL_COMMUNITY': !!cfg.community, - 'process.env': { - NODE_ENV: '"production"' - } - })); - } - - webpack(webpackCfg, function(err, stats) { - - var - fN = function (err) { - if (err) - { - gutil.log('[webpack]', '---'); - gutil.log('[webpack]', err.error ? err.error.toString() : ''); - gutil.log('[webpack]', err.message || ''); - gutil.log('[webpack]', '---'); - - notifier.notify({ - 'sound': true, - 'title': 'webpack', - 'message': err.error ? err.error.toString() : err.message - }); - } - } - ; - - if (err) - { - if (cfg.watch) - { - fN(err); - } - else - { - throw new gutil.PluginError('webpack', err); - } - } - else if (stats && stats.compilation && stats.compilation.errors && - stats.compilation.errors[0]) - { - if (cfg.watch) - { - _.each(stats.compilation.errors, function (err) { - fN(err); - }); - } - else - { - throw new gutil.PluginError('webpack', stats.compilation.errors[0]); - } - } - - callback(); - }); -}); - -gulp.task('js:app', ['js:webpack'], function() { - return gulp.src(cfg.paths.staticJS + cfg.paths.js.app.name) - .pipe(header(getHead() + '\n')) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticJS)) - .on('error', gutil.log); -}); - -gulp.task('js:admin', ['js:webpack'], function() { - return gulp.src(cfg.paths.staticJS + cfg.paths.js.admin.name) - .pipe(header(getHead() + '\n')) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticJS)) - .on('error', gutil.log); -}); - -// - min -gulp.task('js:min', ['js:app', 'js:admin', 'js:validate'], function() { - return gulp.src(cfg.paths.staticJS + '*.js') - .pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"')) - .pipe(uglify(cfg.uglify)) - .pipe(header(getHead() + '\n')) - .pipe(eol('\n', true)) - .pipe(gulp.dest(cfg.paths.staticMinJS)) - .on('error', gutil.log); -}); - -// lint -gulp.task('js:eslint', function() { - return gulp.src(cfg.paths.globjsall) - .pipe(cache('eslint')) - .pipe(eslint()) - .pipe(gulpif(cfg.watch, plumber({errorHandler: notify.onError("Error: <%= error.message %>")}))) - .pipe(eslint.format()) - .pipe(eslint.failAfterError()); -}); - -gulp.task('js:validate', ['js:eslint']); - -// OTHER -regOtherMinTask('other:cookie', 'vendors/jquery-cookie/', 'jquery.cookie.js', 'jquery.cookie-1.4.0.min.js', - '/*! jquery.cookie v1.4.0 (c) 2013 Klaus Hartl | MIT */\n'); - -regOtherMinTask('other:ifvisible', 'vendors/ifvisible/', 'src/ifvisible.js', 'ifvisible.min.js', - '/*!ifvisible.js v1.0.0 (c) 2013 Serkan Yersen | MIT */\n'); - -regOtherMinTask('other:keymaster', 'vendors/keymaster/', 'keymaster.js', 'keymaster.min.js', - '/*!keymaster.js (c) 2011-2013 Thomas Fuchs | MIT */\n'); - -regOtherMinTask('other:wakeup', 'vendors/jquery-wakeup/', 'jquery.wakeup.js', 'jquery.wakeup.min.js', - '/*! jQuery WakeUp plugin (c) 2013 Paul Okopny | MIT */\n'); - -regOtherMinTask('other:mousewheel', 'vendors/jquery-mousewheel/', 'jquery.mousewheel.js', 'jquery.mousewheel-3.1.4.min.js', - '/*! jquery.mousewheel v3.1.4 (c) 2013 Brandon Aaron (http://brandon.aaron.sh) | MIT */\n'); - -regOtherMinTask('other:nano', 'vendors/jquery-nanoscroller/', 'jquery.nanoscroller.js', 'jquery.nanoscroller-0.7.min.js', - '/*! nanoScrollerJS v0.7 (c) 2013 James Florentino; modified by RainLoop Team | MIT */\n'); - -regOtherMinTask('other:inputosaurus', 'vendors/inputosaurus/', 'inputosaurus.js', 'inputosaurus.min.js', - '/*! Inputosaurus Text v0.1.6 (c) 2013 Dan Kielp ; modified by RainLoop Team | MIT */\n'); - -regOtherMinTask('other:pace', 'vendors/simple-pace/', 'simple-pace.js', 'simple-pace-1.0.min.js', - '/*! RainLoop Simple Pace v1.0 (c) 2014 RainLoop Team; Licensed under MIT */\n'); - -regOtherMinTask('other:rl', 'vendors/rl/', 'rl.js', 'rl-1.5.min.js', - '/*! RainLoop Index Helper v1.5 (c) 2015 RainLoop Team; Licensed under MIT */\n'); - -gulp.task('fontastic-fonts:clear', function() { - return cleanDir('rainloop/v/' + cfg.devVersion + '/static/css/fonts/rainloop.*'); -}); - -gulp.task('fontastic-svg:clear', function() { - return cleanDir('rainloop/v/' + cfg.devVersion + '/static/css/svg/*.svg'); -}); - -gulp.task('fontastic-fonts:copy', ['fontastic-fonts:clear'], function() { - return gulp.src('vendors/fontastic/fonts/rainloop.*') - .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/css/fonts')); -}); - -gulp.task('fontastic-svg:copy', ['fontastic-svg:clear'], function() { - return gulp.src('vendors/fontastic/svg/*.svg') - .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/css/svg')); -}); - -gulp.task('fontastic', ['fontastic-fonts:copy', 'fontastic-svg:copy']); - -gulp.task('ckeditor:clear', function() { - return cleanDir('rainloop/v/' + cfg.devVersion + '/static/ckeditor'); -}); - -gulp.task('ckeditor:copy', ['ckeditor:clear'], function() { - return gulp.src(['vendors/ckeditor/**/*', 'vendors/ckeditor/.gitempty', '!vendors/ckeditor/samples{,/**}', '!vendors/ckeditor/adapters{,/**}', '!vendors/ckeditor/*.md']) - .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/ckeditor')); -}); - -gulp.task('ckeditor:copy-plugins', ['ckeditor:copy'], function() { - return gulp.src('vendors/ckeditor-plugins/**/*') - .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/ckeditor/plugins')); -}); - -gulp.task('ckeditor', ['ckeditor:copy-plugins'], function () { - return gulp.src('rainloop/v/' + cfg.devVersion + '/static/ckeditor/*.js') - .pipe(stripbom()) - .pipe(header("\uFEFF")) // BOM - .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/ckeditor')); -}); - -// BUILD (RainLoop) -gulp.task('rainloop:copy', ['default'], function() { - - var - versionFull = pkg.version + '.' + parseInt(pkg.release, 10), - dist = cfg.releasesPath + '/webmail/' + versionFull + '/src/' - ; - - fs.mkdirSync(dist, '0777', true); - fs.mkdirSync(dist + 'data'); - fs.mkdirSync(dist + 'rainloop/v/' + versionFull, '0777', true); - - return gulp.src('rainloop/v/' + cfg.devVersion + '/**/*', {base: 'rainloop/v/' + cfg.devVersion}) - .pipe(gulp.dest(dist + 'rainloop/v/' + versionFull)); -}); - -gulp.task('rainloop:setup', ['rainloop:copy'], function() { - - var - versionFull = pkg.version + '.' + parseInt(pkg.release, 10), - dist = cfg.releasesPath + '/webmail/' + versionFull + '/src/' - ; - - fs.writeFileSync(dist + 'data/VERSION', versionFull); - fs.writeFileSync(dist + 'data/EMPTY', versionFull); - - fs.writeFileSync(dist + 'index.php', - fs.readFileSync('index.php', 'utf8').replace('\'APP_VERSION\', \'0.0.0\'', '\'APP_VERSION\', \'' + versionFull + '\'')); - - fs.writeFileSync(dist + 'rainloop/v/' + versionFull + '/index.php.root', fs.readFileSync(dist + 'index.php')); - - if (cfg.community) - { - require('rimraf').sync(dist + 'rainloop/v/' + versionFull + '/app/libraries/RainLoop/Prem/'); - } - - cfg.destPath = cfg.releasesPath + '/webmail/' + versionFull + '/'; - cfg.cleanPath = dist; - cfg.zipSrcPath = dist; - cfg.zipFile = 'rainloop-' + (cfg.community ? 'community-' : '') + versionFull + '.zip'; - cfg.md5File = cfg.zipFile; - cfg.lastMd5File = ''; - - cfg.rainloopBuilded = true; -}); - -gulp.task('rainloop:zip', ['rainloop:copy', 'rainloop:setup'], function() { - return (cfg.destPath && cfg.zipSrcPath && cfg.zipFile) ? - zipDir(cfg.zipSrcPath, cfg.destPath, cfg.zipFile) : false; -}); - -gulp.task('rainloop:md5', ['rainloop:zip'], function(callback) { - renameFileWithMd5Hash(cfg.destPath + cfg.md5File, callback); -}); - -gulp.task('rainloop:clean', ['rainloop:copy', 'rainloop:setup', 'rainloop:zip'], function() { - return (cfg.cleanPath) ? cleanDir(cfg.cleanPath) : false; -}); - -gulp.task('rainloop:shortname', ['rainloop:md5'], function(callback) { - copyFile(cfg.lastMd5File, cfg.destPath + - 'rainloop' + (cfg.community ? '-community' : '') + '-latest.zip', callback); -}); - -// BUILD (OwnCloud) -gulp.task('rainloop:owncloud:copy', function() { - - var - versionFull = pkg.ownCloudPackageVersion, - dist = cfg.releasesPath + '/owncloud/' + versionFull + '/src/' - ; - - fs.mkdirSync(dist, '0777', true); - fs.mkdirSync(dist + 'rainloop', '0777', true); - - return gulp.src('build/owncloud/rainloop-app/**/*', {base: 'build/owncloud/rainloop-app/'}) - .pipe(gulp.dest(dist + 'rainloop')); -}); - -gulp.task('rainloop:owncloud:copy-rainloop', ['rainloop:start', 'rainloop:owncloud:copy'], function() { - - var - versionFull = pkg.ownCloudPackageVersion, - dist = cfg.releasesPath + '/owncloud/' + versionFull + '/src/rainloop/' - ; - - if (cfg.rainloopBuilded && cfg.destPath) - { - return gulp.src(cfg.destPath + '/src/**/*', {base: cfg.destPath + '/src/'}) - .pipe(gulp.dest(dist + 'app/')); - } - - return true; -}); - -gulp.task('rainloop:owncloud:copy-rainloop:clean', ['rainloop:owncloud:copy-rainloop'], function() { - return (cfg.cleanPath) ? cleanDir(cfg.cleanPath) : false; -}); - -gulp.task('rainloop:owncloud:setup', ['rainloop:owncloud:copy', - 'rainloop:owncloud:copy-rainloop'], function() { - - var - versionFull = pkg.ownCloudPackageVersion, - dist = cfg.releasesPath + '/owncloud/' + versionFull + '/src/' - ; - - fs.writeFileSync(dist + 'rainloop/appinfo/info.xml', - fs.readFileSync(dist + 'rainloop/appinfo/info.xml', 'utf8') - .replace('0.0', '' + versionFull + '') - .replace('', '' + (cfg.community ? 'AGPLv3' : 'RainLoop Software License') + '') - ); - - fs.writeFileSync(dist + 'rainloop/appinfo/version', versionFull); - fs.writeFileSync(dist + 'rainloop/VERSION', versionFull); - - cfg.destPath = cfg.releasesPath + '/owncloud/' + versionFull + '/'; - cfg.cleanPath = dist; - cfg.zipSrcPath = dist; - cfg.zipFile = 'rainloop-owncloud-app-' + (cfg.community ? '' : 'standard-') + versionFull + '.zip'; - cfg.md5File = cfg.zipFile; - -}); - -gulp.task('rainloop:owncloud:zip', ['rainloop:owncloud:copy', 'rainloop:owncloud:setup'], function() { - return (cfg.destPath && cfg.zipSrcPath && cfg.zipFile) ? - zipDir(cfg.zipSrcPath, cfg.destPath, cfg.zipFile) : false; -}); - -gulp.task('rainloop:owncloud:md5', ['rainloop:owncloud:zip'], function(callback) { - renameFileWithMd5Hash(cfg.destPath + cfg.md5File, callback); -}); - -gulp.task('rainloop:owncloud:clean', ['rainloop:owncloud:copy', 'rainloop:owncloud:setup', 'rainloop:owncloud:zip'], function() { - return (cfg.cleanPath) ? cleanDir(cfg.cleanPath) : false; -}); - -gulp.task('rainloop:owncloud:shortname', ['rainloop:owncloud:md5'], function(callback) { - copyFile(cfg.lastMd5File, cfg.destPath + - 'rainloop' + (cfg.community ? '' : '-standard') + '.zip', callback); -}); - -// MAIN -gulp.task('js:pgp', ['js:openpgp', 'js:openpgpworker']); - -gulp.task('default', ['js:libs', 'js:pgp', 'js:min', 'css:min', 'ckeditor', 'fontastic']); -gulp.task('default+', ['package:community-off', 'default']); -gulp.task('fast-', ['js:app', 'js:admin', 'css:main']); - -gulp.task('fast', ['package:community-on', 'fast-']); -gulp.task('fast+', ['package:community-off', 'fast-']); - -gulp.task('rainloop:start', ['rainloop:copy', 'rainloop:setup']); - -gulp.task('rainloop-', ['rainloop:start', 'rainloop:zip', 'rainloop:md5', 'rainloop:clean', 'rainloop:shortname']); - -gulp.task('rainloop', ['package:community-on', 'rainloop-']); -gulp.task('rainloop+', ['package:community-off', 'rainloop-']); - -gulp.task('owncloud-', ['rainloop:owncloud:copy', - 'rainloop:owncloud:copy-rainloop', 'rainloop:owncloud:copy-rainloop:clean', - 'rainloop:owncloud:setup', 'rainloop:owncloud:zip', 'rainloop:owncloud:md5', 'rainloop:owncloud:clean', 'rainloop:owncloud:shortname']); - -gulp.task('owncloud', ['package:community-on', 'owncloud-']); -gulp.task('owncloud+', ['package:community-off', 'owncloud-']); - -//WATCH -gulp.task('watch', ['fast'], function() { - cfg.watch = true; - livereload.listen(); - gulp.watch(cfg.paths.globjs, {interval: cfg.watchInterval}, ['js:app', 'js:admin']); - gulp.watch(cfg.paths.globjsall, {interval: cfg.watchInterval}, ['js:validate']); - gulp.watch(cfg.paths.less.main.watch, {interval: cfg.watchInterval}, ['css:main']); -}); - -gulp.task('watch+', ['fast+'], function() { - cfg.watch = true; - livereload.listen(); - gulp.watch(cfg.paths.globjs, {interval: cfg.watchInterval}, ['js:app', 'js:admin']); - gulp.watch(cfg.paths.globjsall, {interval: cfg.watchInterval}, ['js:validate']); - gulp.watch(cfg.paths.less.main.watch, {interval: cfg.watchInterval}, ['css:main']); -}); - -// ALIASES -gulp.task('build', ['rainloop']); -gulp.task('build+', ['rainloop+']); - -gulp.task('js:v', ['js:validate']); -gulp.task('v', ['js:v']); - -gulp.task('d', ['default']); -gulp.task('d+', ['default+']); -gulp.task('w', ['watch']); -gulp.task('w+', ['watch+']); -gulp.task('f', ['fast']); -gulp.task('f+', ['fast+']); - -gulp.task('b', ['build']); -gulp.task('b+', ['build+']); - -gulp.task('o', ['owncloud']); -gulp.task('o+', ['owncloud+']); +/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */ +'use strict'; + +var + pkg = require('./package.json'), + head = { + rainloop: '/* RainLoop Webmail (c) RainLoop Team | Licensed under RainLoop Software License */', + agpl: '/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL v3 */' + }, + cfg = { + devVersion: '0.0.0', + releasesPath: 'build/dist/releases', + community: true, + watch: false, + watchInterval: 1000, + googleCompile: false, + + rainloopBuilded: false, + destPath: '', + cleanPath: '', + zipSrcPath: '', + zipFile: '', + + paths: {}, + uglify: { + mangle: true, + compress: true + } + }, + + _ = require('lodash'), + fs = require('node-fs'), + path = require('path'), + notifier = require('node-notifier'), + + gulp = require('gulp'), + concat = require('gulp-concat-util'), + header = require('gulp-header'), + stripbom = require('gulp-stripbom'), + rename = require('gulp-rename'), + replace = require('gulp-replace'), + uglify = require('gulp-uglify'), + notify = require("gulp-notify"), + plumber = require('gulp-plumber'), + gulpif = require('gulp-if'), + eol = require('gulp-eol'), + livereload = require('gulp-livereload'), + eslint = require('gulp-eslint'), + cache = require('gulp-cached'), + gutil = require('gulp-util') +; + +function getHead() +{ + return !cfg.community ? head.rainloop : head.agpl; +} + +function regOtherMinTask(sName, sPath, sInc, sOut, sHeader) +{ + gulp.task(sName, function() { + return gulp.src(sPath + sInc) + .pipe(uglify()) + .pipe(header(sHeader || '')) + .pipe(rename(sOut)) + .pipe(eol('\n', true)) + .pipe(gulp.dest(sPath)); + }); +} + +function zipDir(sSrcDir, sDestDir, sFileName) +{ + return gulp.src(sSrcDir + '**/*') + .pipe(require('gulp-zip')(sFileName)) + .pipe(gulp.dest(sDestDir)); +} + +function cleanDir(sDir) +{ + return gulp.src(sDir, {read: false}) + .pipe(require('gulp-rimraf')()); +} + +function renameFileWithMd5Hash(sFile, callback) +{ + var sHash = require('crypto').createHash('md5').update(fs.readFileSync(sFile)).digest('hex'); + cfg.lastMd5File = sFile.replace(/\.zip$/, '-' + sHash + '.zip'); + fs.renameSync(sFile, cfg.lastMd5File); + callback(); +} + +function copyFile(sFile, sNewFile, callback) +{ + fs.writeFileSync(sNewFile, fs.readFileSync(sFile)); + callback(); +} + +cfg.paths.globjs = 'dev/**/*.{js,jsx,html,css}'; +cfg.paths.globjsonly = 'dev/**/*.js'; +cfg.paths.globjsxonly = 'dev/**/*.jsx'; +cfg.paths.globjsall = 'dev/**/*.{js,jsx}'; +cfg.paths.globtsonly = 'dev/**/*.ts'; +cfg.paths.static = 'rainloop/v/' + cfg.devVersion + '/static/'; +cfg.paths.staticJS = 'rainloop/v/' + cfg.devVersion + '/static/js/'; +cfg.paths.staticMinJS = 'rainloop/v/' + cfg.devVersion + '/static/js/min/'; +cfg.paths.staticCSS = 'rainloop/v/' + cfg.devVersion + '/static/css/'; +cfg.paths.momentLocales = 'rainloop/v/' + cfg.devVersion + '/app/localization/moment/'; + +cfg.paths.less = { + main: { + name: 'less.css', + src: 'dev/Styles/@Main.less', + watch: ['dev/Styles/*.less'], + options: { + paths: [ + path.join(__dirname, 'dev', 'Styles'), + path.join(__dirname, 'vendors', 'bootstrap', 'less') + ] + } + } +}; + +cfg.paths.css = { + main: { + name: 'app.css', + src: [ + 'node_modules/normalize.css/normalize.css', + 'vendors/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.css', + 'vendors/fontastic/styles.css', + 'vendors/jquery-nanoscroller/nanoscroller.css', + 'vendors/jquery-letterfx/jquery-letterfx.min.css', + 'vendors/inputosaurus/inputosaurus.css', + 'vendors/flags/flags-fixed.css', + 'node_modules/opentip/css/opentip.css', + 'node_modules/pikaday/css/pikaday.css', + 'node_modules/lightgallery/dist/css/lightgallery.min.css', + 'node_modules/lightgallery/dist/css/lg-transitions.min.css', + 'node_modules/Progress.js/minified/progressjs.min.css', + 'dev/Styles/_progressjs.css', + cfg.paths.staticCSS + cfg.paths.less.main.name + ] + }, + social: { + name: 'social.css', + src: [ + 'vendors/fontastic/styles.css', + 'dev/Styles/_social.css' + ] + } +}; + +cfg.paths.js = { + openpgp: { + name: 'openpgp.min.js', + src: [ + 'node_modules/openpgp/dist/openpgp.min.js' + ] + }, + openpgpworker: { + name: 'openpgp.worker.min.js', + src: [ + 'node_modules/openpgp/dist/openpgp.worker.min.js' + ] + }, + moment: { + locales: [ + 'node_modules/moment/locale/*.js' + ] + }, + libs: { + name: 'libs.js', + src: [ + 'node_modules/jquery/dist/jquery.min.js', + 'node_modules/jquery-mousewheel/jquery.mousewheel.js', + 'node_modules/jquery-scrollstop/jquery.scrollstop.js', + 'node_modules/jquery-lazyload/jquery.lazyload.js ', + 'node_modules/jquery.backstretch/jquery.backstretch.min.js', + 'vendors/jquery-ui/js/jquery-ui-1.10.3.custom.min.js', // custom + 'vendors/jquery-nanoscroller/jquery.nanoscroller.js', // custom (modified) + 'vendors/jquery-wakeup/jquery.wakeup.js', // no-npm + 'vendors/jquery-letterfx/jquery-letterfx.min.js', // no-npm + 'vendors/inputosaurus/inputosaurus.js', // custom (modified) + 'vendors/routes/signals.min.js', // fixed + 'vendors/routes/hasher.min.js', // fixed + 'vendors/routes/crossroads.min.js', // fixed + 'vendors/jua/jua.min.js', // custom + 'vendors/keymaster/keymaster.js', // custom (modified) + 'vendors/qr.js/qr.min.js', // fixed + 'vendors/bootstrap/js/bootstrap.min.js', // fixed + 'node_modules/underscore/underscore-min.js', + 'node_modules/moment/min/moment.min.js', + 'node_modules/tinycon/tinycon.min.js', + 'node_modules/knockout/build/output/knockout-latest.js', + 'node_modules/knockout-projections/dist/knockout-projections.min.js', + 'node_modules/knockout-sortable/build/knockout-sortable.min.js ', + 'node_modules/matchmedia-polyfill/matchMedia.js', + 'node_modules/matchmedia-polyfill/matchMedia.addListener.js', + 'node_modules/simplestatemanager/dist/ssm.min.js', + 'node_modules/autolinker/dist/Autolinker.min.js', + 'node_modules/opentip/lib/opentip.js', + 'node_modules/opentip/lib/adapter-jquery.js', + 'node_modules/lightgallery/dist/js/lightgallery.min.js', + 'node_modules/lightgallery/dist/js/lg-fullscreen.min.js', + 'node_modules/lightgallery/dist/js/lg-thumbnail.min.js', + 'node_modules/lightgallery/dist/js/lg-zoom.min.js', + 'node_modules/lightgallery/dist/js/lg-autoplay.min.js', + 'node_modules/ifvisible.js/src/ifvisible.min.js' + ] + }, + app: { + name: 'app.js' + }, + admin: { + name: 'admin.js' + } +}; + +// CSS +gulp.task('less:main', function() { + var less = require('gulp-less'); + + return gulp.src(cfg.paths.less.main.src) + .pipe(gulpif(cfg.watch, plumber({errorHandler: notify.onError("Error: <%= error.message %>")}))) + .pipe(less({ + 'paths': cfg.paths.less.main.options.paths + })) + .pipe(rename(cfg.paths.less.main.name)) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticCSS)) + .on('error', gutil.log); +}); + +gulp.task('css:social', function() { + var autoprefixer = require('gulp-autoprefixer'); + return gulp.src(cfg.paths.css.social.src) + .pipe(concat(cfg.paths.css.social.name)) + .pipe(autoprefixer('last 3 versions', '> 1%', 'ie 9', 'Firefox ESR', 'Opera 12.1')) + .pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/')) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticCSS)); +}); + +gulp.task('css:main-begin', ['less:main', 'css:social'], function() { + var autoprefixer = require('gulp-autoprefixer'); + return gulp.src(cfg.paths.css.main.src) + .pipe(concat(cfg.paths.css.main.name)) + .pipe(autoprefixer('last 3 versions', '> 1%', 'ie 9', 'Firefox ESR', 'Opera 12.1')) + .pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/')) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticCSS)) + .pipe(livereload()); +}); + +gulp.task('package:community-on', function() { + cfg.community = true; + return true; +}); + +gulp.task('package:community-off', function() { + cfg.community = false; + return true; +}); + +gulp.task('css:clear-less', ['css:main-begin'], function() { + return gulp.src(cfg.paths.staticCSS + cfg.paths.less.main.name, {read: false}) + .pipe(require('gulp-rimraf')()); +}); + +gulp.task('css:main', ['css:clear-less']); + +gulp.task('css:main:min', ['css:main'], function() { + var cleanCSS = require('gulp-clean-css'); + return gulp.src(cfg.paths.staticCSS + cfg.paths.css.main.name) + .pipe(cleanCSS()) + .pipe(rename({suffix: '.min'})) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticCSS)); +}); + +gulp.task('css:social:min', ['css:social'], function() { + var cleanCSS = require('gulp-clean-css'); + return gulp.src(cfg.paths.staticCSS + cfg.paths.css.social.name) + .pipe(cleanCSS()) + .pipe(rename({suffix: '.min'})) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticCSS)); +}); + +gulp.task('css:min', ['css:main:min', 'css:social:min']); + +// JS +gulp.task('js:openpgp', function() { + return gulp.src(cfg.paths.js.openpgp.src) + .pipe(rename(cfg.paths.js.openpgp.name)) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticMinJS)); +}); + +gulp.task('js:openpgpworker', function() { + return gulp.src(cfg.paths.js.openpgpworker.src) + .pipe(rename(cfg.paths.js.openpgpworker.name)) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticMinJS)); +}); + +gulp.task('js:moment:locales-clear', function() { + return cleanDir('rainloop/v/' + cfg.devVersion + '/app/localization/moment/*.js'); +}); + +gulp.task('js:moment:locales', ['js:moment:locales-clear'], function() { + return gulp.src(cfg.paths.js.moment.locales) + .pipe(gulp.dest(cfg.paths.momentLocales)); +}); + +gulp.task('js:libs', function() { + return gulp.src(cfg.paths.js.libs.src) + .pipe(concat(cfg.paths.js.libs.name, {separator: '\n\n'})) + .pipe(eol('\n', true)) + .pipe(replace(/sourceMappingURL=[a-z0-9\.\-_]{1,20}\.map/ig, '')) + .pipe(gulp.dest(cfg.paths.staticJS)); +}); + +gulp.task('js:ckeditor:beautify', function() { + var beautify = require('gulp-beautify'); + return gulp.src(cfg.paths.static + 'ckeditor/ckeditor.js') + .pipe(beautify({ + 'indentSize': 2 + })) + .pipe(rename('ckeditor.beautify.js')) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.static + 'ckeditor/')); +}); + +gulp.task('js:webpack', [], function(callback) { + + var + webpack = require('webpack'), + webpackCfg = require('./webpack.config.js') + ; + + if (webpackCfg && webpackCfg.output) + { + webpackCfg.output.publicPath = cfg.paths.staticJS; + } + + if (webpackCfg && webpackCfg.plugins) + { + webpackCfg.plugins.push(new webpack.DefinePlugin({ + 'RL_COMMUNITY': !!cfg.community, + 'process.env': { + NODE_ENV: '"production"' + } + })); + } + + webpack(webpackCfg, function(err, stats) { + + var + fN = function (err) { + if (err) + { + gutil.log('[webpack]', '---'); + gutil.log('[webpack]', err.error ? err.error.toString() : ''); + gutil.log('[webpack]', err.message || ''); + gutil.log('[webpack]', '---'); + + notifier.notify({ + 'sound': true, + 'title': 'webpack', + 'message': err.error ? err.error.toString() : err.message + }); + } + } + ; + + if (err) + { + if (cfg.watch) + { + fN(err); + } + else + { + throw new gutil.PluginError('webpack', err); + } + } + else if (stats && stats.compilation && stats.compilation.errors && + stats.compilation.errors[0]) + { + if (cfg.watch) + { + _.each(stats.compilation.errors, function (err) { + fN(err); + }); + } + else + { + throw new gutil.PluginError('webpack', stats.compilation.errors[0]); + } + } + + callback(); + }); +}); + +gulp.task('js:app', ['js:webpack'], function() { + return gulp.src(cfg.paths.staticJS + cfg.paths.js.app.name) + .pipe(header(getHead() + '\n')) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticJS)) + .on('error', gutil.log); +}); + +gulp.task('js:admin', ['js:webpack'], function() { + return gulp.src(cfg.paths.staticJS + cfg.paths.js.admin.name) + .pipe(header(getHead() + '\n')) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticJS)) + .on('error', gutil.log); +}); + +// - min +gulp.task('js:min', ['js:app', 'js:admin', 'js:validate'], function() { + return gulp.src(cfg.paths.staticJS + '*.js') + .pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"')) + .pipe(uglify(cfg.uglify)) + .pipe(header(getHead() + '\n')) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticMinJS)) + .on('error', gutil.log); +}); + +// lint +gulp.task('js:eslint', function() { + return gulp.src(cfg.paths.globjsall) + .pipe(cache('eslint')) + .pipe(eslint()) + .pipe(gulpif(cfg.watch, plumber({errorHandler: notify.onError("Error: <%= error.message %>")}))) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +}); + +gulp.task('js:validate', ['js:eslint']); + +// OTHER +gulp.task('lightgallery-fonts:clear', function() { + return cleanDir('rainloop/v/' + cfg.devVersion + '/static/css/fonts/lg.*'); +}); + +gulp.task('fontastic-fonts:clear', function() { + return cleanDir('rainloop/v/' + cfg.devVersion + '/static/css/fonts/rainloop.*'); +}); + +gulp.task('fontastic-svg:clear', function() { + return cleanDir('rainloop/v/' + cfg.devVersion + '/static/css/svg/*.svg'); +}); + +gulp.task('lightgallery-fonts:copy', ['lightgallery-fonts:clear'], function() { + return gulp.src('node_modules/lightgallery/dist/fonts/lg.*') + .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/css/fonts')); +}); + +gulp.task('fontastic-fonts:copy', ['fontastic-fonts:clear'], function() { + return gulp.src('vendors/fontastic/fonts/rainloop.*') + .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/css/fonts')); +}); + +gulp.task('fontastic-svg:copy', ['fontastic-svg:clear'], function() { + return gulp.src('vendors/fontastic/svg/*.svg') + .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/css/svg')); +}); + +gulp.task('lightgallery', ['lightgallery-fonts:copy']); +gulp.task('fontastic', ['fontastic-fonts:copy', 'fontastic-svg:copy']); + +gulp.task('ckeditor:clear', function() { + return cleanDir('rainloop/v/' + cfg.devVersion + '/static/ckeditor'); +}); + +gulp.task('ckeditor:copy', ['ckeditor:clear'], function() { + return gulp.src(['vendors/ckeditor/**/*', 'vendors/ckeditor/.gitempty', '!vendors/ckeditor/samples{,/**}', '!vendors/ckeditor/adapters{,/**}', '!vendors/ckeditor/*.md']) + .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/ckeditor')); +}); + +gulp.task('ckeditor:copy-plugins', ['ckeditor:copy'], function() { + return gulp.src('vendors/ckeditor-plugins/**/*') + .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/ckeditor/plugins')); +}); + +gulp.task('ckeditor', ['ckeditor:copy-plugins'], function () { + return gulp.src('rainloop/v/' + cfg.devVersion + '/static/ckeditor/*.js') + .pipe(stripbom()) + .pipe(header("\uFEFF")) // BOM + .pipe(gulp.dest('rainloop/v/' + cfg.devVersion + '/static/ckeditor')); +}); + +// BUILD (RainLoop) +gulp.task('rainloop:copy', ['default'], function() { + + var + versionFull = pkg.version + '.' + parseInt(pkg.release, 10), + dist = cfg.releasesPath + '/webmail/' + versionFull + '/src/' + ; + + fs.mkdirSync(dist, '0777', true); + fs.mkdirSync(dist + 'data'); + fs.mkdirSync(dist + 'rainloop/v/' + versionFull, '0777', true); + + return gulp.src('rainloop/v/' + cfg.devVersion + '/**/*', {base: 'rainloop/v/' + cfg.devVersion}) + .pipe(gulp.dest(dist + 'rainloop/v/' + versionFull)); +}); + +gulp.task('rainloop:setup', ['rainloop:copy'], function() { + + var + versionFull = pkg.version + '.' + parseInt(pkg.release, 10), + dist = cfg.releasesPath + '/webmail/' + versionFull + '/src/' + ; + + fs.writeFileSync(dist + 'data/VERSION', versionFull); + fs.writeFileSync(dist + 'data/EMPTY', versionFull); + + fs.writeFileSync(dist + 'index.php', + fs.readFileSync('index.php', 'utf8').replace('\'APP_VERSION\', \'0.0.0\'', '\'APP_VERSION\', \'' + versionFull + '\'')); + + fs.writeFileSync(dist + 'rainloop/v/' + versionFull + '/index.php.root', fs.readFileSync(dist + 'index.php')); + + if (cfg.community) + { + require('rimraf').sync(dist + 'rainloop/v/' + versionFull + '/app/libraries/RainLoop/Prem/'); + } + + cfg.destPath = cfg.releasesPath + '/webmail/' + versionFull + '/'; + cfg.cleanPath = dist; + cfg.zipSrcPath = dist; + cfg.zipFile = 'rainloop-' + (cfg.community ? 'community-' : '') + versionFull + '.zip'; + cfg.md5File = cfg.zipFile; + cfg.lastMd5File = ''; + + cfg.rainloopBuilded = true; +}); + +gulp.task('rainloop:zip', ['rainloop:copy', 'rainloop:setup'], function() { + return (cfg.destPath && cfg.zipSrcPath && cfg.zipFile) ? + zipDir(cfg.zipSrcPath, cfg.destPath, cfg.zipFile) : false; +}); + +gulp.task('rainloop:md5', ['rainloop:zip'], function(callback) { + renameFileWithMd5Hash(cfg.destPath + cfg.md5File, callback); +}); + +gulp.task('rainloop:clean', ['rainloop:copy', 'rainloop:setup', 'rainloop:zip'], function() { + return (cfg.cleanPath) ? cleanDir(cfg.cleanPath) : false; +}); + +gulp.task('rainloop:shortname', ['rainloop:md5'], function(callback) { + copyFile(cfg.lastMd5File, cfg.destPath + + 'rainloop' + (cfg.community ? '-community' : '') + '-latest.zip', callback); +}); + +// BUILD (OwnCloud) +gulp.task('rainloop:owncloud:copy', function() { + + var + versionFull = pkg.ownCloudPackageVersion, + dist = cfg.releasesPath + '/owncloud/' + versionFull + '/src/' + ; + + fs.mkdirSync(dist, '0777', true); + fs.mkdirSync(dist + 'rainloop', '0777', true); + + return gulp.src('build/owncloud/rainloop-app/**/*', {base: 'build/owncloud/rainloop-app/'}) + .pipe(gulp.dest(dist + 'rainloop')); +}); + +gulp.task('rainloop:owncloud:copy-rainloop', ['rainloop:start', 'rainloop:owncloud:copy'], function() { + + var + versionFull = pkg.ownCloudPackageVersion, + dist = cfg.releasesPath + '/owncloud/' + versionFull + '/src/rainloop/' + ; + + if (cfg.rainloopBuilded && cfg.destPath) + { + return gulp.src(cfg.destPath + '/src/**/*', {base: cfg.destPath + '/src/'}) + .pipe(gulp.dest(dist + 'app/')); + } + + return true; +}); + +gulp.task('rainloop:owncloud:copy-rainloop:clean', ['rainloop:owncloud:copy-rainloop'], function() { + return (cfg.cleanPath) ? cleanDir(cfg.cleanPath) : false; +}); + +gulp.task('rainloop:owncloud:setup', ['rainloop:owncloud:copy', + 'rainloop:owncloud:copy-rainloop'], function() { + + var + versionFull = pkg.ownCloudPackageVersion, + dist = cfg.releasesPath + '/owncloud/' + versionFull + '/src/' + ; + + fs.writeFileSync(dist + 'rainloop/appinfo/info.xml', + fs.readFileSync(dist + 'rainloop/appinfo/info.xml', 'utf8') + .replace('0.0', '' + versionFull + '') + .replace('', '' + (cfg.community ? 'AGPLv3' : 'RainLoop Software License') + '') + ); + + fs.writeFileSync(dist + 'rainloop/appinfo/version', versionFull); + fs.writeFileSync(dist + 'rainloop/VERSION', versionFull); + + cfg.destPath = cfg.releasesPath + '/owncloud/' + versionFull + '/'; + cfg.cleanPath = dist; + cfg.zipSrcPath = dist; + cfg.zipFile = 'rainloop-owncloud-app-' + (cfg.community ? '' : 'standard-') + versionFull + '.zip'; + cfg.md5File = cfg.zipFile; + +}); + +gulp.task('rainloop:owncloud:zip', ['rainloop:owncloud:copy', 'rainloop:owncloud:setup'], function() { + return (cfg.destPath && cfg.zipSrcPath && cfg.zipFile) ? + zipDir(cfg.zipSrcPath, cfg.destPath, cfg.zipFile) : false; +}); + +gulp.task('rainloop:owncloud:md5', ['rainloop:owncloud:zip'], function(callback) { + renameFileWithMd5Hash(cfg.destPath + cfg.md5File, callback); +}); + +gulp.task('rainloop:owncloud:clean', ['rainloop:owncloud:copy', 'rainloop:owncloud:setup', 'rainloop:owncloud:zip'], function() { + return (cfg.cleanPath) ? cleanDir(cfg.cleanPath) : false; +}); + +gulp.task('rainloop:owncloud:shortname', ['rainloop:owncloud:md5'], function(callback) { + copyFile(cfg.lastMd5File, cfg.destPath + + 'rainloop' + (cfg.community ? '' : '-standard') + '.zip', callback); +}); + +// MAIN +gulp.task('js:pgp', ['js:openpgp', 'js:openpgpworker']); +gulp.task('js:moment', ['js:moment:locales']); + +gulp.task('default', ['js:libs', 'js:pgp', 'js:moment', 'js:min', 'css:min', 'ckeditor', 'fontastic', 'lightgallery']); +gulp.task('default+', ['package:community-off', 'default']); +gulp.task('fast-', ['js:app', 'js:admin', 'css:main']); + +gulp.task('fast', ['package:community-on', 'fast-']); +gulp.task('fast+', ['package:community-off', 'fast-']); + +gulp.task('rainloop:start', ['rainloop:copy', 'rainloop:setup']); + +gulp.task('rainloop-', ['rainloop:start', 'rainloop:zip', 'rainloop:md5', 'rainloop:clean', 'rainloop:shortname']); + +gulp.task('rainloop', ['package:community-on', 'rainloop-']); +gulp.task('rainloop+', ['package:community-off', 'rainloop-']); + +gulp.task('owncloud-', ['rainloop:owncloud:copy', + 'rainloop:owncloud:copy-rainloop', 'rainloop:owncloud:copy-rainloop:clean', + 'rainloop:owncloud:setup', 'rainloop:owncloud:zip', 'rainloop:owncloud:md5', 'rainloop:owncloud:clean', 'rainloop:owncloud:shortname']); + +gulp.task('owncloud', ['package:community-on', 'owncloud-']); +gulp.task('owncloud+', ['package:community-off', 'owncloud-']); + +//WATCH +gulp.task('watch', ['fast'], function() { + cfg.watch = true; + livereload.listen(); + gulp.watch(cfg.paths.globjs, {interval: cfg.watchInterval}, ['js:app', 'js:admin']); + gulp.watch(cfg.paths.globjsall, {interval: cfg.watchInterval}, ['js:validate']); + gulp.watch(cfg.paths.less.main.watch, {interval: cfg.watchInterval}, ['css:main']); +}); + +gulp.task('watch+', ['fast+'], function() { + cfg.watch = true; + livereload.listen(); + gulp.watch(cfg.paths.globjs, {interval: cfg.watchInterval}, ['js:app', 'js:admin']); + gulp.watch(cfg.paths.globjsall, {interval: cfg.watchInterval}, ['js:validate']); + gulp.watch(cfg.paths.less.main.watch, {interval: cfg.watchInterval}, ['css:main']); +}); + +// ALIASES +gulp.task('build', ['rainloop']); +gulp.task('build+', ['rainloop+']); + +gulp.task('js:v', ['js:validate']); +gulp.task('v', ['js:v']); + +gulp.task('d', ['default']); +gulp.task('d+', ['default+']); +gulp.task('w', ['watch']); +gulp.task('w+', ['watch+']); +gulp.task('f', ['fast']); +gulp.task('f+', ['fast+']); + +gulp.task('b', ['build']); +gulp.task('b+', ['build+']); + +gulp.task('o', ['owncloud']); +gulp.task('o+', ['owncloud+']); diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json deleted file mode 100644 index fe0282fcf..000000000 --- a/npm-shrinkwrap.json +++ /dev/null @@ -1,3976 +0,0 @@ -{ - "name": "RainLoop", - "version": "1.10.2", - "dependencies": { - "abbrev": { - "version": "1.0.9", - "from": "abbrev@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz" - }, - "acorn": { - "version": "3.2.0", - "from": "acorn@>=3.2.0 <4.0.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.2.0.tgz" - }, - "acorn-jsx": { - "version": "3.0.1", - "from": "acorn-jsx@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz" - }, - "align-text": { - "version": "0.1.4", - "from": "align-text@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz" - }, - "amdefine": { - "version": "1.0.0", - "from": "amdefine@>=0.0.4", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz" - }, - "ansi-escapes": { - "version": "1.4.0", - "from": "ansi-escapes@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz" - }, - "ansi-regex": { - "version": "2.0.0", - "from": "ansi-regex@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" - }, - "ansi-styles": { - "version": "2.2.1", - "from": "ansi-styles@>=2.2.1 <3.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" - }, - "ansicolors": { - "version": "0.2.1", - "from": "ansicolors@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.2.1.tgz" - }, - "anymatch": { - "version": "1.3.0", - "from": "anymatch@>=1.3.0 <2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz" - }, - "archy": { - "version": "1.0.0", - "from": "archy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz" - }, - "argparse": { - "version": "1.0.7", - "from": "argparse@>=1.0.7 <2.0.0", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.7.tgz" - }, - "arr-diff": { - "version": "2.0.0", - "from": "arr-diff@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz" - }, - "arr-flatten": { - "version": "1.0.1", - "from": "arr-flatten@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz" - }, - "array-differ": { - "version": "1.0.0", - "from": "array-differ@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz" - }, - "array-find-index": { - "version": "1.0.1", - "from": "array-find-index@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.1.tgz" - }, - "array-union": { - "version": "1.0.2", - "from": "array-union@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz" - }, - "array-uniq": { - "version": "1.0.3", - "from": "array-uniq@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz" - }, - "array-unique": { - "version": "0.2.1", - "from": "array-unique@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz" - }, - "arrify": { - "version": "1.0.1", - "from": "arrify@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" - }, - "asn1": { - "version": "0.1.11", - "from": "asn1@0.1.11", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz" - }, - "asn1.js": { - "version": "4.6.2", - "from": "asn1.js@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.6.2.tgz" - }, - "assert": { - "version": "1.4.1", - "from": "assert@>=1.1.1 <2.0.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz" - }, - "assert-plus": { - "version": "0.1.5", - "from": "assert-plus@>=0.1.5 <0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz" - }, - "async": { - "version": "0.9.2", - "from": "async@>=0.9.0 <0.10.0", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz" - }, - "async-each": { - "version": "1.0.0", - "from": "async-each@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.0.tgz" - }, - "autoprefixer": { - "version": "6.3.6", - "from": "autoprefixer@>=6.0.0 <7.0.0", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.3.6.tgz" - }, - "aws-sign2": { - "version": "0.5.0", - "from": "aws-sign2@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz" - }, - "babel-code-frame": { - "version": "6.11.0", - "from": "babel-code-frame@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.11.0.tgz" - }, - "babel-core": { - "version": "6.10.4", - "from": "babel-core@>=6.1.4 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.10.4.tgz" - }, - "babel-generator": { - "version": "6.11.0", - "from": "babel-generator@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.11.0.tgz" - }, - "babel-helper-bindify-decorators": { - "version": "6.8.0", - "from": "babel-helper-bindify-decorators@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.8.0.tgz" - }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.8.0", - "from": "babel-helper-builder-binary-assignment-operator-visitor@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.8.0.tgz" - }, - "babel-helper-call-delegate": { - "version": "6.8.0", - "from": "babel-helper-call-delegate@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.8.0.tgz" - }, - "babel-helper-define-map": { - "version": "6.9.0", - "from": "babel-helper-define-map@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.9.0.tgz" - }, - "babel-helper-explode-assignable-expression": { - "version": "6.8.0", - "from": "babel-helper-explode-assignable-expression@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.8.0.tgz" - }, - "babel-helper-explode-class": { - "version": "6.8.0", - "from": "babel-helper-explode-class@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.8.0.tgz" - }, - "babel-helper-function-name": { - "version": "6.8.0", - "from": "babel-helper-function-name@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.8.0.tgz" - }, - "babel-helper-get-function-arity": { - "version": "6.8.0", - "from": "babel-helper-get-function-arity@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.8.0.tgz" - }, - "babel-helper-hoist-variables": { - "version": "6.8.0", - "from": "babel-helper-hoist-variables@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.8.0.tgz" - }, - "babel-helper-optimise-call-expression": { - "version": "6.8.0", - "from": "babel-helper-optimise-call-expression@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.8.0.tgz" - }, - "babel-helper-regex": { - "version": "6.9.0", - "from": "babel-helper-regex@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.9.0.tgz" - }, - "babel-helper-remap-async-to-generator": { - "version": "6.11.2", - "from": "babel-helper-remap-async-to-generator@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.11.2.tgz" - }, - "babel-helper-replace-supers": { - "version": "6.8.0", - "from": "babel-helper-replace-supers@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.8.0.tgz" - }, - "babel-helpers": { - "version": "6.8.0", - "from": "babel-helpers@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.8.0.tgz" - }, - "babel-loader": { - "version": "6.2.4", - "from": "babel-loader@>=6.1.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-6.2.4.tgz" - }, - "babel-messages": { - "version": "6.8.0", - "from": "babel-messages@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.8.0.tgz" - }, - "babel-plugin-check-es2015-constants": { - "version": "6.8.0", - "from": "babel-plugin-check-es2015-constants@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.8.0.tgz" - }, - "babel-plugin-syntax-async-functions": { - "version": "6.8.0", - "from": "babel-plugin-syntax-async-functions@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.8.0.tgz" - }, - "babel-plugin-syntax-class-constructor-call": { - "version": "6.8.0", - "from": "babel-plugin-syntax-class-constructor-call@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.8.0.tgz" - }, - "babel-plugin-syntax-class-properties": { - "version": "6.8.0", - "from": "babel-plugin-syntax-class-properties@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.8.0.tgz" - }, - "babel-plugin-syntax-decorators": { - "version": "6.8.0", - "from": "babel-plugin-syntax-decorators@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.8.0.tgz" - }, - "babel-plugin-syntax-do-expressions": { - "version": "6.8.0", - "from": "babel-plugin-syntax-do-expressions@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.8.0.tgz" - }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.8.0", - "from": "babel-plugin-syntax-exponentiation-operator@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.8.0.tgz" - }, - "babel-plugin-syntax-export-extensions": { - "version": "6.8.0", - "from": "babel-plugin-syntax-export-extensions@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.8.0.tgz" - }, - "babel-plugin-syntax-function-bind": { - "version": "6.8.0", - "from": "babel-plugin-syntax-function-bind@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.8.0.tgz" - }, - "babel-plugin-syntax-object-rest-spread": { - "version": "6.8.0", - "from": "babel-plugin-syntax-object-rest-spread@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.8.0.tgz" - }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.8.0", - "from": "babel-plugin-syntax-trailing-function-commas@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.8.0.tgz" - }, - "babel-plugin-transform-async-to-generator": { - "version": "6.8.0", - "from": "babel-plugin-transform-async-to-generator@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.8.0.tgz" - }, - "babel-plugin-transform-class-constructor-call": { - "version": "6.8.0", - "from": "babel-plugin-transform-class-constructor-call@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.8.0.tgz" - }, - "babel-plugin-transform-class-properties": { - "version": "6.10.2", - "from": "babel-plugin-transform-class-properties@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.10.2.tgz" - }, - "babel-plugin-transform-decorators": { - "version": "6.8.0", - "from": "babel-plugin-transform-decorators@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.8.0.tgz" - }, - "babel-plugin-transform-do-expressions": { - "version": "6.8.0", - "from": "babel-plugin-transform-do-expressions@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-arrow-functions@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-block-scoped-functions@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.10.1", - "from": "babel-plugin-transform-es2015-block-scoping@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.10.1.tgz" - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.9.0", - "from": "babel-plugin-transform-es2015-classes@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.9.0.tgz" - }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-computed-properties@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.9.0", - "from": "babel-plugin-transform-es2015-destructuring@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.9.0.tgz" - }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-duplicate-keys@>=6.6.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-for-of@>=6.6.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.9.0", - "from": "babel-plugin-transform-es2015-function-name@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.9.0.tgz" - }, - "babel-plugin-transform-es2015-literals": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-literals@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.10.3", - "from": "babel-plugin-transform-es2015-modules-commonjs@>=6.6.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.10.3.tgz" - }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-object-super@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.9.0", - "from": "babel-plugin-transform-es2015-parameters@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.9.0.tgz" - }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-shorthand-properties@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-spread@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-sticky-regex@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-template-literals@>=6.6.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.8.0", - "from": "babel-plugin-transform-es2015-typeof-symbol@>=6.6.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.8.0.tgz" - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.11.0", - "from": "babel-plugin-transform-es2015-unicode-regex@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.11.0.tgz" - }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.8.0", - "from": "babel-plugin-transform-exponentiation-operator@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.8.0.tgz" - }, - "babel-plugin-transform-export-extensions": { - "version": "6.8.0", - "from": "babel-plugin-transform-export-extensions@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.8.0.tgz" - }, - "babel-plugin-transform-function-bind": { - "version": "6.8.0", - "from": "babel-plugin-transform-function-bind@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.8.0.tgz" - }, - "babel-plugin-transform-object-rest-spread": { - "version": "6.8.0", - "from": "babel-plugin-transform-object-rest-spread@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.8.0.tgz" - }, - "babel-plugin-transform-regenerator": { - "version": "6.9.0", - "from": "babel-plugin-transform-regenerator@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.9.0.tgz" - }, - "babel-plugin-transform-runtime": { - "version": "6.9.0", - "from": "babel-plugin-transform-runtime@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.9.0.tgz" - }, - "babel-plugin-transform-strict-mode": { - "version": "6.8.0", - "from": "babel-plugin-transform-strict-mode@>=6.8.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.8.0.tgz" - }, - "babel-preset-es2015": { - "version": "6.9.0", - "from": "babel-preset-es2015@*", - "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.9.0.tgz" - }, - "babel-preset-es2015-loose": { - "version": "7.0.0", - "from": "babel-preset-es2015-loose@*", - "resolved": "https://registry.npmjs.org/babel-preset-es2015-loose/-/babel-preset-es2015-loose-7.0.0.tgz" - }, - "babel-preset-es2015-loose-native-modules": { - "version": "1.0.0", - "from": "babel-preset-es2015-loose-native-modules@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/babel-preset-es2015-loose-native-modules/-/babel-preset-es2015-loose-native-modules-1.0.0.tgz" - }, - "babel-preset-stage-0": { - "version": "6.5.0", - "from": "babel-preset-stage-0@>=6.5.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.5.0.tgz" - }, - "babel-preset-stage-1": { - "version": "6.5.0", - "from": "babel-preset-stage-1@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.5.0.tgz" - }, - "babel-preset-stage-2": { - "version": "6.11.0", - "from": "babel-preset-stage-2@>=6.3.13 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.11.0.tgz" - }, - "babel-preset-stage-3": { - "version": "6.11.0", - "from": "babel-preset-stage-3@>=6.11.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.11.0.tgz" - }, - "babel-register": { - "version": "6.9.0", - "from": "babel-register@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.9.0.tgz" - }, - "babel-runtime": { - "version": "6.9.2", - "from": "babel-runtime@>=6.1.18 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz" - }, - "babel-template": { - "version": "6.9.0", - "from": "babel-template@>=6.9.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.9.0.tgz" - }, - "babel-traverse": { - "version": "6.10.4", - "from": "babel-traverse@>=6.10.4 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.10.4.tgz" - }, - "babel-types": { - "version": "6.11.1", - "from": "babel-types@>=6.9.1 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.11.1.tgz" - }, - "babylon": { - "version": "6.8.2", - "from": "babylon@>=6.7.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.8.2.tgz" - }, - "balanced-match": { - "version": "0.4.1", - "from": "balanced-match@>=0.4.1 <0.5.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" - }, - "Base64": { - "version": "0.2.1", - "from": "Base64@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz" - }, - "base64-js": { - "version": "1.1.2", - "from": "base64-js@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.1.2.tgz" - }, - "beeper": { - "version": "1.1.0", - "from": "beeper@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.0.tgz" - }, - "big.js": { - "version": "3.1.3", - "from": "big.js@>=3.1.3 <4.0.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.1.3.tgz" - }, - "binary-extensions": { - "version": "1.5.0", - "from": "binary-extensions@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.5.0.tgz" - }, - "binaryextensions": { - "version": "1.0.1", - "from": "binaryextensions@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-1.0.1.tgz" - }, - "bluebird": { - "version": "3.4.1", - "from": "bluebird@>=3.1.1 <4.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.1.tgz" - }, - "bn.js": { - "version": "4.11.4", - "from": "bn.js@>=4.1.1 <5.0.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.4.tgz" - }, - "body-parser": { - "version": "1.14.2", - "from": "body-parser@>=1.14.0 <1.15.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.14.2.tgz", - "dependencies": { - "qs": { - "version": "5.2.0", - "from": "qs@5.2.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-5.2.0.tgz" - } - } - }, - "boom": { - "version": "0.4.2", - "from": "boom@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz" - }, - "brace-expansion": { - "version": "1.1.5", - "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz" - }, - "braces": { - "version": "1.8.5", - "from": "braces@>=1.8.2 <2.0.0", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz" - }, - "brorand": { - "version": "1.0.5", - "from": "brorand@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz" - }, - "browserify-aes": { - "version": "1.0.6", - "from": "browserify-aes@>=1.0.4 <2.0.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz" - }, - "browserify-cipher": { - "version": "1.0.0", - "from": "browserify-cipher@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz" - }, - "browserify-des": { - "version": "1.0.0", - "from": "browserify-des@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz" - }, - "browserify-rsa": { - "version": "4.0.1", - "from": "browserify-rsa@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz" - }, - "browserify-sign": { - "version": "4.0.0", - "from": "browserify-sign@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.0.tgz" - }, - "browserify-zlib": { - "version": "0.1.4", - "from": "browserify-zlib@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz" - }, - "browserslist": { - "version": "1.3.4", - "from": "browserslist@>=1.3.1 <1.4.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.3.4.tgz" - }, - "buffer": { - "version": "4.7.0", - "from": "buffer@>=4.3.0 <5.0.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.7.0.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - } - } - }, - "buffer-crc32": { - "version": "0.2.5", - "from": "buffer-crc32@>=0.2.3 <0.3.0", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.5.tgz" - }, - "buffer-shims": { - "version": "1.0.0", - "from": "buffer-shims@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz" - }, - "buffer-xor": { - "version": "1.0.3", - "from": "buffer-xor@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz" - }, - "bufferstreams": { - "version": "1.0.1", - "from": "bufferstreams@1.0.1", - "resolved": "https://registry.npmjs.org/bufferstreams/-/bufferstreams-1.0.1.tgz" - }, - "builtin-modules": { - "version": "1.1.1", - "from": "builtin-modules@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz" - }, - "bytes": { - "version": "2.2.0", - "from": "bytes@2.2.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.2.0.tgz" - }, - "caller-path": { - "version": "0.1.0", - "from": "caller-path@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz" - }, - "callsites": { - "version": "0.2.0", - "from": "callsites@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz" - }, - "camelcase": { - "version": "1.2.1", - "from": "camelcase@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz" - }, - "camelcase-keys": { - "version": "2.1.0", - "from": "camelcase-keys@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "dependencies": { - "camelcase": { - "version": "2.1.1", - "from": "camelcase@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz" - } - } - }, - "caniuse-db": { - "version": "1.0.30000488", - "from": "caniuse-db@>=1.0.30000444 <2.0.0", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000488.tgz" - }, - "cardinal": { - "version": "0.5.0", - "from": "cardinal@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-0.5.0.tgz" - }, - "center-align": { - "version": "0.1.3", - "from": "center-align@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz" - }, - "chalk": { - "version": "1.1.3", - "from": "chalk@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" - }, - "chokidar": { - "version": "1.6.0", - "from": "chokidar@>=1.4.3 <2.0.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.0.tgz" - }, - "cipher-base": { - "version": "1.0.2", - "from": "cipher-base@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.2.tgz" - }, - "clean-css": { - "version": "3.4.18", - "from": "clean-css@>=3.4.17 <4.0.0", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.18.tgz", - "dependencies": { - "source-map": { - "version": "0.4.4", - "from": "source-map@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz" - } - } - }, - "cli-cursor": { - "version": "1.0.2", - "from": "cli-cursor@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz" - }, - "cli-table": { - "version": "0.3.1", - "from": "cli-table@>=0.3.1 <0.4.0", - "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz" - }, - "cli-usage": { - "version": "0.1.2", - "from": "cli-usage@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/cli-usage/-/cli-usage-0.1.2.tgz", - "dependencies": { - "minimist": { - "version": "0.2.0", - "from": "minimist@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.0.tgz" - } - } - }, - "cli-width": { - "version": "2.1.0", - "from": "cli-width@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz" - }, - "cliui": { - "version": "2.1.0", - "from": "cliui@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "from": "wordwrap@0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" - } - } - }, - "clone": { - "version": "1.0.2", - "from": "clone@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz" - }, - "clone-stats": { - "version": "0.0.1", - "from": "clone-stats@>=0.0.1 <0.0.2", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz" - }, - "code-point-at": { - "version": "1.0.0", - "from": "code-point-at@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz" - }, - "colors": { - "version": "1.0.3", - "from": "colors@1.0.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz" - }, - "combined-stream": { - "version": "0.0.7", - "from": "combined-stream@>=0.0.4 <0.1.0", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz" - }, - "commander": { - "version": "2.8.1", - "from": "commander@>=2.8.0 <2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz" - }, - "concat-map": { - "version": "0.0.1", - "from": "concat-map@0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - }, - "concat-stream": { - "version": "1.5.1", - "from": "concat-stream@>=1.4.6 <2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.0.6", - "from": "readable-stream@>=2.0.0 <2.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" - } - } - }, - "concat-with-sourcemaps": { - "version": "1.0.4", - "from": "concat-with-sourcemaps@>=1.0.4 <2.0.0", - "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz" - }, - "config-chain": { - "version": "1.1.10", - "from": "config-chain@>=1.1.5 <1.2.0", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz" - }, - "console-browserify": { - "version": "1.1.0", - "from": "console-browserify@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz" - }, - "constants-browserify": { - "version": "1.0.0", - "from": "constants-browserify@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz" - }, - "content-type": { - "version": "1.0.2", - "from": "content-type@>=1.0.1 <1.1.0", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz" - }, - "convert-source-map": { - "version": "1.2.0", - "from": "convert-source-map@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.2.0.tgz" - }, - "core-js": { - "version": "2.4.0", - "from": "core-js@>=2.4.0 <3.0.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.0.tgz" - }, - "core-util-is": { - "version": "1.0.2", - "from": "core-util-is@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" - }, - "create-ecdh": { - "version": "4.0.0", - "from": "create-ecdh@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz" - }, - "create-hash": { - "version": "1.1.2", - "from": "create-hash@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz" - }, - "create-hmac": { - "version": "1.1.4", - "from": "create-hmac@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz" - }, - "cryptiles": { - "version": "0.2.2", - "from": "cryptiles@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz" - }, - "crypto-browserify": { - "version": "3.11.0", - "from": "crypto-browserify@>=3.11.0 <4.0.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.0.tgz" - }, - "ctype": { - "version": "0.5.3", - "from": "ctype@0.5.3", - "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz" - }, - "currently-unhandled": { - "version": "0.4.1", - "from": "currently-unhandled@>=0.4.1 <0.5.0", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz" - }, - "d": { - "version": "0.1.1", - "from": "d@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz" - }, - "date-now": { - "version": "0.1.4", - "from": "date-now@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz" - }, - "dateformat": { - "version": "1.0.12", - "from": "dateformat@>=1.0.11 <2.0.0", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz" - }, - "deap": { - "version": "1.0.0", - "from": "deap@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/deap/-/deap-1.0.0.tgz" - }, - "debug": { - "version": "2.2.0", - "from": "debug@>=2.1.1 <3.0.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz" - }, - "decamelize": { - "version": "1.2.0", - "from": "decamelize@>=1.1.2 <2.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" - }, - "deep-is": { - "version": "0.1.3", - "from": "deep-is@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz" - }, - "defaults": { - "version": "1.0.3", - "from": "defaults@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" - }, - "del": { - "version": "2.2.1", - "from": "del@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.1.tgz" - }, - "delayed-stream": { - "version": "0.0.5", - "from": "delayed-stream@0.0.5", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz" - }, - "depd": { - "version": "1.1.0", - "from": "depd@>=1.1.0 <1.2.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz" - }, - "deprecated": { - "version": "0.0.1", - "from": "deprecated@>=0.0.1 <0.0.2", - "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz" - }, - "des.js": { - "version": "1.0.0", - "from": "des.js@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz" - }, - "detect-indent": { - "version": "3.0.1", - "from": "detect-indent@>=3.0.1 <4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-3.0.1.tgz" - }, - "diffie-hellman": { - "version": "5.0.2", - "from": "diffie-hellman@>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz" - }, - "doctrine": { - "version": "1.2.2", - "from": "doctrine@>=1.2.2 <2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.2.2.tgz", - "dependencies": { - "esutils": { - "version": "1.1.6", - "from": "esutils@>=1.1.6 <2.0.0", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz" - }, - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - } - } - }, - "domain-browser": { - "version": "1.1.7", - "from": "domain-browser@>=1.1.1 <2.0.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz" - }, - "duplexer": { - "version": "0.1.1", - "from": "duplexer@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz" - }, - "duplexer2": { - "version": "0.0.2", - "from": "duplexer2@0.0.2", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz" - }, - "duplexify": { - "version": "3.4.3", - "from": "duplexify@>=3.4.2 <4.0.0", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.4.3.tgz", - "dependencies": { - "end-of-stream": { - "version": "1.0.0", - "from": "end-of-stream@1.0.0", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz" - }, - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "ee-first": { - "version": "1.1.1", - "from": "ee-first@1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" - }, - "elliptic": { - "version": "6.3.1", - "from": "elliptic@>=6.0.0 <7.0.0", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.1.tgz" - }, - "emojis-list": { - "version": "2.0.1", - "from": "emojis-list@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.0.1.tgz" - }, - "encoding": { - "version": "0.1.12", - "from": "encoding@>=0.1.11 <0.2.0", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz" - }, - "end-of-stream": { - "version": "0.1.5", - "from": "end-of-stream@>=0.1.5 <0.2.0", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz" - }, - "enhanced-resolve": { - "version": "2.2.2", - "from": "enhanced-resolve@>=2.2.0 <3.0.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-2.2.2.tgz" - }, - "errno": { - "version": "0.1.4", - "from": "errno@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz" - }, - "error-ex": { - "version": "1.3.0", - "from": "error-ex@>=1.2.0 <2.0.0", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.0.tgz" - }, - "es5-ext": { - "version": "0.10.11", - "from": "es5-ext@>=0.10.11 <0.11.0", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz", - "dependencies": { - "es6-symbol": { - "version": "3.0.2", - "from": "es6-symbol@>=3.0.2 <3.1.0", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz" - } - } - }, - "es6-iterator": { - "version": "2.0.0", - "from": "es6-iterator@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz" - }, - "es6-map": { - "version": "0.1.4", - "from": "es6-map@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.4.tgz" - }, - "es6-promise-polyfill": { - "version": "1.2.0", - "from": "es6-promise-polyfill@>=1.2.0 <2.0.0", - "resolved": "https://registry.npmjs.org/es6-promise-polyfill/-/es6-promise-polyfill-1.2.0.tgz" - }, - "es6-set": { - "version": "0.1.4", - "from": "es6-set@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.4.tgz" - }, - "es6-symbol": { - "version": "3.1.0", - "from": "es6-symbol@>=3.1.0 <3.2.0", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" - }, - "es6-weak-map": { - "version": "2.0.1", - "from": "es6-weak-map@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.1.tgz" - }, - "escape-string-regexp": { - "version": "1.0.5", - "from": "escape-string-regexp@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - }, - "escope": { - "version": "3.6.0", - "from": "escope@>=3.6.0 <4.0.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz" - }, - "eslint": { - "version": "2.13.1", - "from": "eslint@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-2.13.1.tgz", - "dependencies": { - "glob": { - "version": "7.0.5", - "from": "glob@>=7.0.3 <8.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz" - }, - "globals": { - "version": "9.8.0", - "from": "globals@>=9.2.0 <10.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.8.0.tgz" - }, - "user-home": { - "version": "2.0.0", - "from": "user-home@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz" - } - } - }, - "espree": { - "version": "3.1.6", - "from": "espree@>=3.1.6 <4.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.1.6.tgz" - }, - "esprima": { - "version": "2.7.2", - "from": "esprima@>=2.6.0 <3.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz" - }, - "esrecurse": { - "version": "4.1.0", - "from": "esrecurse@>=4.1.0 <5.0.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz", - "dependencies": { - "estraverse": { - "version": "4.1.1", - "from": "estraverse@>=4.1.0 <4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz" - } - } - }, - "estraverse": { - "version": "4.2.0", - "from": "estraverse@>=4.2.0 <5.0.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz" - }, - "esutils": { - "version": "2.0.2", - "from": "esutils@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz" - }, - "event-emitter": { - "version": "0.3.4", - "from": "event-emitter@>=0.3.4 <0.4.0", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz" - }, - "event-stream": { - "version": "3.3.3", - "from": "event-stream@>=3.1.7 <4.0.0", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.3.tgz" - }, - "events": { - "version": "1.1.1", - "from": "events@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz" - }, - "evp_bytestokey": { - "version": "1.0.0", - "from": "evp_bytestokey@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz" - }, - "exit-hook": { - "version": "1.1.1", - "from": "exit-hook@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz" - }, - "expand-brackets": { - "version": "0.1.5", - "from": "expand-brackets@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz" - }, - "expand-range": { - "version": "1.8.2", - "from": "expand-range@>=1.8.1 <2.0.0", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz" - }, - "extend": { - "version": "3.0.0", - "from": "extend@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" - }, - "extglob": { - "version": "0.3.2", - "from": "extglob@>=0.3.1 <0.4.0", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz" - }, - "fancy-log": { - "version": "1.2.0", - "from": "fancy-log@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.2.0.tgz" - }, - "fast-levenshtein": { - "version": "1.1.3", - "from": "fast-levenshtein@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.3.tgz" - }, - "faye-websocket": { - "version": "0.7.3", - "from": "faye-websocket@>=0.7.2 <0.8.0", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.3.tgz" - }, - "figures": { - "version": "1.7.0", - "from": "figures@>=1.3.5 <2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz" - }, - "file-entry-cache": { - "version": "1.2.4", - "from": "file-entry-cache@>=1.1.1 <2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.2.4.tgz" - }, - "filename-regex": { - "version": "2.0.0", - "from": "filename-regex@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz" - }, - "fill-range": { - "version": "2.2.3", - "from": "fill-range@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" - }, - "find-index": { - "version": "0.1.1", - "from": "find-index@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz" - }, - "find-up": { - "version": "1.1.2", - "from": "find-up@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "dependencies": { - "path-exists": { - "version": "2.1.0", - "from": "path-exists@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz" - } - } - }, - "findup-sync": { - "version": "0.3.0", - "from": "findup-sync@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz" - }, - "first-chunk-stream": { - "version": "1.0.0", - "from": "first-chunk-stream@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz" - }, - "flagged-respawn": { - "version": "0.3.2", - "from": "flagged-respawn@>=0.3.2 <0.4.0", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-0.3.2.tgz" - }, - "flat-cache": { - "version": "1.0.10", - "from": "flat-cache@>=1.0.9 <2.0.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.0.10.tgz" - }, - "for-in": { - "version": "0.1.5", - "from": "for-in@>=0.1.5 <0.2.0", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.5.tgz" - }, - "for-own": { - "version": "0.1.4", - "from": "for-own@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz" - }, - "forever-agent": { - "version": "0.5.2", - "from": "forever-agent@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz" - }, - "fork-stream": { - "version": "0.0.4", - "from": "fork-stream@>=0.0.4 <0.0.5", - "resolved": "https://registry.npmjs.org/fork-stream/-/fork-stream-0.0.4.tgz" - }, - "form-data": { - "version": "0.1.4", - "from": "form-data@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz" - }, - "from": { - "version": "0.1.3", - "from": "from@>=0.0.0 <1.0.0", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.3.tgz" - }, - "fs.realpath": { - "version": "1.0.0", - "from": "fs.realpath@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - }, - "gaze": { - "version": "0.5.2", - "from": "gaze@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz" - }, - "generate-function": { - "version": "2.0.0", - "from": "generate-function@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" - }, - "generate-object-property": { - "version": "1.2.0", - "from": "generate-object-property@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz" - }, - "get-stdin": { - "version": "4.0.1", - "from": "get-stdin@>=4.0.1 <5.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz" - }, - "glob": { - "version": "5.0.15", - "from": "glob@>=5.0.0 <5.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz" - }, - "glob-base": { - "version": "0.3.0", - "from": "glob-base@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz" - }, - "glob-parent": { - "version": "2.0.0", - "from": "glob-parent@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" - }, - "glob-stream": { - "version": "3.1.18", - "from": "glob-stream@>=3.1.5 <4.0.0", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", - "dependencies": { - "glob": { - "version": "4.5.3", - "from": "glob@>=4.3.1 <5.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz" - }, - "minimatch": { - "version": "2.0.10", - "from": "minimatch@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" - }, - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.33-1 <1.1.0-0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - }, - "through2": { - "version": "0.6.5", - "from": "through2@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz" - } - } - }, - "glob-watcher": { - "version": "0.0.6", - "from": "glob-watcher@>=0.0.6 <0.0.7", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz" - }, - "glob2base": { - "version": "0.0.12", - "from": "glob2base@>=0.0.12 <0.0.13", - "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz" - }, - "globals": { - "version": "8.18.0", - "from": "globals@>=8.3.0 <9.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-8.18.0.tgz" - }, - "globby": { - "version": "5.0.0", - "from": "globby@>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "dependencies": { - "glob": { - "version": "7.0.5", - "from": "glob@>=7.0.3 <8.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz" - } - } - }, - "globule": { - "version": "0.1.0", - "from": "globule@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", - "dependencies": { - "glob": { - "version": "3.1.21", - "from": "glob@>=3.1.21 <3.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz" - }, - "graceful-fs": { - "version": "1.2.3", - "from": "graceful-fs@>=1.2.0 <1.3.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz" - }, - "inherits": { - "version": "1.0.2", - "from": "inherits@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz" - }, - "lodash": { - "version": "1.0.2", - "from": "lodash@>=1.0.1 <1.1.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz" - }, - "minimatch": { - "version": "0.2.14", - "from": "minimatch@>=0.2.11 <0.3.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" - } - } - }, - "glogg": { - "version": "1.0.0", - "from": "glogg@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz" - }, - "graceful-fs": { - "version": "4.1.4", - "from": "graceful-fs@>=4.1.2 <5.0.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz" - }, - "graceful-readlink": { - "version": "1.0.1", - "from": "graceful-readlink@>=1.0.0", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" - }, - "growly": { - "version": "1.3.0", - "from": "growly@>=1.2.0 <2.0.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz" - }, - "gulp": { - "version": "3.9.1", - "from": "gulp@>=3.9.0 <3.10.0", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", - "dependencies": { - "semver": { - "version": "4.3.6", - "from": "semver@>=4.1.0 <5.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz" - } - } - }, - "gulp-autoprefixer": { - "version": "3.1.0", - "from": "gulp-autoprefixer@*", - "resolved": "https://registry.npmjs.org/gulp-autoprefixer/-/gulp-autoprefixer-3.1.0.tgz" - }, - "gulp-beautify": { - "version": "2.0.0", - "from": "gulp-beautify@*", - "resolved": "https://registry.npmjs.org/gulp-beautify/-/gulp-beautify-2.0.0.tgz" - }, - "gulp-cached": { - "version": "1.1.0", - "from": "gulp-cached@*", - "resolved": "https://registry.npmjs.org/gulp-cached/-/gulp-cached-1.1.0.tgz", - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.17 <1.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - }, - "through2": { - "version": "0.5.1", - "from": "through2@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz" - }, - "xtend": { - "version": "3.0.0", - "from": "xtend@>=3.0.0 <3.1.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" - } - } - }, - "gulp-clean-css": { - "version": "2.0.10", - "from": "gulp-clean-css@>=2.0.7 <3.0.0", - "resolved": "https://registry.npmjs.org/gulp-clean-css/-/gulp-clean-css-2.0.10.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.1.4 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "gulp-concat-util": { - "version": "0.5.5", - "from": "gulp-concat-util@*", - "resolved": "https://registry.npmjs.org/gulp-concat-util/-/gulp-concat-util-0.5.5.tgz", - "dependencies": { - "gulp-if": { - "version": "2.0.1", - "from": "gulp-if@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/gulp-if/-/gulp-if-2.0.1.tgz" - } - } - }, - "gulp-eol": { - "version": "0.1.2", - "from": "gulp-eol@*", - "resolved": "https://registry.npmjs.org/gulp-eol/-/gulp-eol-0.1.2.tgz", - "dependencies": { - "ansi-regex": { - "version": "0.2.1", - "from": "ansi-regex@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" - }, - "ansi-styles": { - "version": "1.1.0", - "from": "ansi-styles@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz" - }, - "chalk": { - "version": "0.5.1", - "from": "chalk@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz" - }, - "gulp-util": { - "version": "2.2.20", - "from": "gulp-util@>=2.2.0 <2.3.0", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-2.2.20.tgz", - "dependencies": { - "through2": { - "version": "0.5.1", - "from": "through2@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz" - } - } - }, - "has-ansi": { - "version": "0.1.0", - "from": "has-ansi@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz" - }, - "lodash._reinterpolate": { - "version": "2.4.1", - "from": "lodash._reinterpolate@>=2.4.1 <3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz" - }, - "lodash.escape": { - "version": "2.4.1", - "from": "lodash.escape@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-2.4.1.tgz" - }, - "lodash.keys": { - "version": "2.4.1", - "from": "lodash.keys@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz" - }, - "lodash.template": { - "version": "2.4.1", - "from": "lodash.template@>=2.4.1 <3.0.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-2.4.1.tgz" - }, - "lodash.templatesettings": { - "version": "2.4.1", - "from": "lodash.templatesettings@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz" - }, - "minimist": { - "version": "0.2.0", - "from": "minimist@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.0.tgz" - }, - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.17 <1.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - }, - "strip-ansi": { - "version": "0.3.0", - "from": "strip-ansi@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz" - }, - "supports-color": { - "version": "0.2.0", - "from": "supports-color@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz" - }, - "through2": { - "version": "0.4.2", - "from": "through2@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz", - "dependencies": { - "xtend": { - "version": "2.1.2", - "from": "xtend@>=2.1.1 <2.2.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz" - } - } - }, - "vinyl": { - "version": "0.2.3", - "from": "vinyl@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.2.3.tgz" - }, - "xtend": { - "version": "3.0.0", - "from": "xtend@>=3.0.0 <3.1.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" - } - } - }, - "gulp-eslint": { - "version": "2.0.0", - "from": "gulp-eslint@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/gulp-eslint/-/gulp-eslint-2.0.0.tgz", - "dependencies": { - "bufferstreams": { - "version": "1.1.1", - "from": "bufferstreams@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/bufferstreams/-/bufferstreams-1.1.1.tgz" - }, - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "gulp-header": { - "version": "1.8.7", - "from": "gulp-header@*", - "resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-1.8.7.tgz" - }, - "gulp-if": { - "version": "1.2.5", - "from": "gulp-if@>=1.2.5 <1.3.0", - "resolved": "https://registry.npmjs.org/gulp-if/-/gulp-if-1.2.5.tgz", - "dependencies": { - "gulp-match": { - "version": "0.2.1", - "from": "gulp-match@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/gulp-match/-/gulp-match-0.2.1.tgz" - }, - "merge-stream": { - "version": "0.1.8", - "from": "merge-stream@>=0.1.6 <0.2.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-0.1.8.tgz" - }, - "minimatch": { - "version": "1.0.0", - "from": "minimatch@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz" - }, - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.33-1 <1.1.0-0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - }, - "ternary-stream": { - "version": "1.2.3", - "from": "ternary-stream@>=1.2.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ternary-stream/-/ternary-stream-1.2.3.tgz" - }, - "through2": { - "version": "0.6.5", - "from": "through2@>=0.6.2 <0.7.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz" - } - } - }, - "gulp-less": { - "version": "1.3.6", - "from": "gulp-less@1.3.6", - "resolved": "https://registry.npmjs.org/gulp-less/-/gulp-less-1.3.6.tgz", - "dependencies": { - "convert-source-map": { - "version": "0.4.1", - "from": "convert-source-map@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.4.1.tgz" - }, - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.17 <1.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - }, - "source-map": { - "version": "0.1.43", - "from": "source-map@>=0.1.39 <0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" - }, - "through2": { - "version": "0.5.1", - "from": "through2@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz" - }, - "vinyl-sourcemaps-apply": { - "version": "0.1.4", - "from": "vinyl-sourcemaps-apply@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.1.4.tgz" - }, - "xtend": { - "version": "3.0.0", - "from": "xtend@>=3.0.0 <3.1.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" - } - } - }, - "gulp-livereload": { - "version": "3.8.1", - "from": "gulp-livereload@>=3.8.0 <3.9.0", - "resolved": "https://registry.npmjs.org/gulp-livereload/-/gulp-livereload-3.8.1.tgz", - "dependencies": { - "ansi-regex": { - "version": "0.2.1", - "from": "ansi-regex@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" - }, - "ansi-styles": { - "version": "1.1.0", - "from": "ansi-styles@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz" - }, - "chalk": { - "version": "0.5.1", - "from": "chalk@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz" - }, - "has-ansi": { - "version": "0.1.0", - "from": "has-ansi@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz" - }, - "strip-ansi": { - "version": "0.3.0", - "from": "strip-ansi@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz" - }, - "supports-color": { - "version": "0.2.0", - "from": "supports-color@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz" - } - } - }, - "gulp-match": { - "version": "1.0.2", - "from": "gulp-match@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/gulp-match/-/gulp-match-1.0.2.tgz" - }, - "gulp-notify": { - "version": "2.2.0", - "from": "gulp-notify@>=2.2.0 <2.3.0", - "resolved": "https://registry.npmjs.org/gulp-notify/-/gulp-notify-2.2.0.tgz", - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.33-1 <1.1.0-0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - }, - "through2": { - "version": "0.6.5", - "from": "through2@>=0.6.3 <0.7.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz" - } - } - }, - "gulp-plumber": { - "version": "1.1.0", - "from": "gulp-plumber@*", - "resolved": "https://registry.npmjs.org/gulp-plumber/-/gulp-plumber-1.1.0.tgz" - }, - "gulp-rename": { - "version": "1.2.2", - "from": "gulp-rename@*", - "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.2.tgz" - }, - "gulp-replace": { - "version": "0.5.4", - "from": "gulp-replace@*", - "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-0.5.4.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "gulp-rimraf": { - "version": "0.2.0", - "from": "gulp-rimraf@*", - "resolved": "https://registry.npmjs.org/gulp-rimraf/-/gulp-rimraf-0.2.0.tgz" - }, - "gulp-stripbom": { - "version": "1.0.4", - "from": "gulp-stripbom@*", - "resolved": "https://registry.npmjs.org/gulp-stripbom/-/gulp-stripbom-1.0.4.tgz", - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.17 <1.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - }, - "strip-bom": { - "version": "1.0.0", - "from": "strip-bom@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz" - }, - "through2": { - "version": "0.5.1", - "from": "through2@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz" - }, - "xtend": { - "version": "3.0.0", - "from": "xtend@>=3.0.0 <3.1.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" - } - } - }, - "gulp-through": { - "version": "0.3.2", - "from": "gulp-through@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/gulp-through/-/gulp-through-0.3.2.tgz", - "dependencies": { - "ansi-regex": { - "version": "0.2.1", - "from": "ansi-regex@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" - }, - "ansi-styles": { - "version": "1.1.0", - "from": "ansi-styles@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz" - }, - "bluebird": { - "version": "2.10.2", - "from": "bluebird@>=2.3.0 <3.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz" - }, - "chalk": { - "version": "0.5.1", - "from": "chalk@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz" - }, - "has-ansi": { - "version": "0.1.0", - "from": "has-ansi@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz" - }, - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.33-1 <1.1.0-0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - }, - "strip-ansi": { - "version": "0.3.0", - "from": "strip-ansi@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz" - }, - "supports-color": { - "version": "0.2.0", - "from": "supports-color@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz" - }, - "through2": { - "version": "0.6.5", - "from": "through2@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz" - } - } - }, - "gulp-uglify": { - "version": "1.5.4", - "from": "gulp-uglify@*", - "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-1.5.4.tgz" - }, - "gulp-util": { - "version": "3.0.7", - "from": "gulp-util@*", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.7.tgz", - "dependencies": { - "object-assign": { - "version": "3.0.0", - "from": "object-assign@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz" - } - } - }, - "gulp-zip": { - "version": "3.2.0", - "from": "gulp-zip@*", - "resolved": "https://registry.npmjs.org/gulp-zip/-/gulp-zip-3.2.0.tgz" - }, - "gulplog": { - "version": "1.0.0", - "from": "gulplog@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz" - }, - "has-ansi": { - "version": "2.0.0", - "from": "has-ansi@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" - }, - "has-flag": { - "version": "1.0.0", - "from": "has-flag@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz" - }, - "has-gulplog": { - "version": "0.1.0", - "from": "has-gulplog@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz" - }, - "hash.js": { - "version": "1.0.3", - "from": "hash.js@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz" - }, - "hawk": { - "version": "1.1.1", - "from": "hawk@1.1.1", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz" - }, - "hoek": { - "version": "0.9.1", - "from": "hoek@>=0.9.0 <0.10.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz" - }, - "home-or-tmp": { - "version": "1.0.0", - "from": "home-or-tmp@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-1.0.0.tgz" - }, - "hosted-git-info": { - "version": "2.1.5", - "from": "hosted-git-info@>=2.1.4 <3.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz" - }, - "http-browserify": { - "version": "1.7.0", - "from": "http-browserify@>=1.3.2 <2.0.0", - "resolved": "https://registry.npmjs.org/http-browserify/-/http-browserify-1.7.0.tgz" - }, - "http-errors": { - "version": "1.3.1", - "from": "http-errors@>=1.3.1 <1.4.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz" - }, - "http-signature": { - "version": "0.10.1", - "from": "http-signature@>=0.10.0 <0.11.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz" - }, - "https-browserify": { - "version": "0.0.1", - "from": "https-browserify@0.0.1", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz" - }, - "iconv-lite": { - "version": "0.4.13", - "from": "iconv-lite@0.4.13", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz" - }, - "ieee754": { - "version": "1.1.6", - "from": "ieee754@>=1.1.4 <2.0.0", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.6.tgz" - }, - "ignore": { - "version": "3.1.3", - "from": "ignore@>=3.1.2 <4.0.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.1.3.tgz" - }, - "imurmurhash": { - "version": "0.1.4", - "from": "imurmurhash@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" - }, - "indent-string": { - "version": "2.1.0", - "from": "indent-string@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "dependencies": { - "repeating": { - "version": "2.0.1", - "from": "repeating@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz" - } - } - }, - "indexof": { - "version": "0.0.1", - "from": "indexof@0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz" - }, - "inflight": { - "version": "1.0.5", - "from": "inflight@>=1.0.4 <2.0.0", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz" - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@>=2.0.1 <2.1.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "ini": { - "version": "1.3.4", - "from": "ini@>=1.3.4 <2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz" - }, - "inquirer": { - "version": "0.12.0", - "from": "inquirer@>=0.12.0 <0.13.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz" - }, - "interpret": { - "version": "1.0.1", - "from": "interpret@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.1.tgz" - }, - "invariant": { - "version": "2.2.1", - "from": "invariant@>=2.2.0 <3.0.0", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.1.tgz" - }, - "invert-kv": { - "version": "1.0.0", - "from": "invert-kv@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" - }, - "is": { - "version": "3.1.0", - "from": "is@>=3.0.1 <4.0.0", - "resolved": "https://registry.npmjs.org/is/-/is-3.1.0.tgz" - }, - "is-arrayish": { - "version": "0.2.1", - "from": "is-arrayish@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" - }, - "is-binary-path": { - "version": "1.0.1", - "from": "is-binary-path@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" - }, - "is-buffer": { - "version": "1.1.3", - "from": "is-buffer@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz" - }, - "is-builtin-module": { - "version": "1.0.0", - "from": "is-builtin-module@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz" - }, - "is-dotfile": { - "version": "1.0.2", - "from": "is-dotfile@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz" - }, - "is-equal-shallow": { - "version": "0.1.3", - "from": "is-equal-shallow@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz" - }, - "is-extendable": { - "version": "0.1.1", - "from": "is-extendable@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" - }, - "is-extglob": { - "version": "1.0.0", - "from": "is-extglob@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" - }, - "is-finite": { - "version": "1.0.1", - "from": "is-finite@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.1.tgz" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "from": "is-fullwidth-code-point@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" - }, - "is-glob": { - "version": "2.0.1", - "from": "is-glob@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" - }, - "is-my-json-valid": { - "version": "2.13.1", - "from": "is-my-json-valid@>=2.10.0 <3.0.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz" - }, - "is-number": { - "version": "2.1.0", - "from": "is-number@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz" - }, - "is-path-cwd": { - "version": "1.0.0", - "from": "is-path-cwd@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz" - }, - "is-path-in-cwd": { - "version": "1.0.0", - "from": "is-path-in-cwd@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz" - }, - "is-path-inside": { - "version": "1.0.0", - "from": "is-path-inside@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz" - }, - "is-posix-bracket": { - "version": "0.1.1", - "from": "is-posix-bracket@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" - }, - "is-primitive": { - "version": "2.0.0", - "from": "is-primitive@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" - }, - "is-property": { - "version": "1.0.2", - "from": "is-property@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" - }, - "is-resolvable": { - "version": "1.0.0", - "from": "is-resolvable@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz" - }, - "is-stream": { - "version": "1.1.0", - "from": "is-stream@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" - }, - "is-utf8": { - "version": "0.2.1", - "from": "is-utf8@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz" - }, - "isarray": { - "version": "0.0.1", - "from": "isarray@0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "isexe": { - "version": "1.1.2", - "from": "isexe@>=1.1.1 <2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz" - }, - "isobject": { - "version": "2.1.0", - "from": "isobject@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - } - } - }, - "istextorbinary": { - "version": "1.0.2", - "from": "istextorbinary@1.0.2", - "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-1.0.2.tgz" - }, - "jassl": { - "version": "1.2.0", - "from": "rainloop/jassl", - "resolved": "git://github.com/rainloop/jassl.git#8243909fc281c2310e7ae854629c62a171c943c3" - }, - "js-base64": { - "version": "2.1.9", - "from": "js-base64@>=2.1.9 <3.0.0", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.1.9.tgz" - }, - "js-beautify": { - "version": "1.6.3", - "from": "js-beautify@>=1.5.10 <2.0.0", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.6.3.tgz" - }, - "js-tokens": { - "version": "2.0.0", - "from": "js-tokens@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-2.0.0.tgz" - }, - "js-yaml": { - "version": "3.6.1", - "from": "js-yaml@>=3.5.1 <4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz" - }, - "jsesc": { - "version": "0.5.0", - "from": "jsesc@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" - }, - "json-loader": { - "version": "0.5.4", - "from": "json-loader@>=0.5.4 <0.6.0", - "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.4.tgz" - }, - "json-stable-stringify": { - "version": "1.0.1", - "from": "json-stable-stringify@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz" - }, - "json-stringify-safe": { - "version": "5.0.1", - "from": "json-stringify-safe@>=5.0.0 <5.1.0", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" - }, - "json5": { - "version": "0.4.0", - "from": "json5@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.4.0.tgz" - }, - "jsonify": { - "version": "0.0.0", - "from": "jsonify@>=0.0.0 <0.1.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" - }, - "jsonpointer": { - "version": "2.0.0", - "from": "jsonpointer@2.0.0", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" - }, - "kind-of": { - "version": "3.0.3", - "from": "kind-of@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz" - }, - "lazy-cache": { - "version": "1.0.4", - "from": "lazy-cache@>=1.0.3 <2.0.0", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz" - }, - "lcid": { - "version": "1.0.0", - "from": "lcid@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz" - }, - "less": { - "version": "1.7.5", - "from": "less@>=1.7.4 <2.0.0", - "resolved": "https://registry.npmjs.org/less/-/less-1.7.5.tgz", - "dependencies": { - "clean-css": { - "version": "2.2.23", - "from": "clean-css@>=2.2.0 <2.3.0", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-2.2.23.tgz" - }, - "commander": { - "version": "2.2.0", - "from": "commander@>=2.2.0 <2.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.2.0.tgz" - }, - "graceful-fs": { - "version": "3.0.8", - "from": "graceful-fs@>=3.0.2 <3.1.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz" - }, - "source-map": { - "version": "0.1.43", - "from": "source-map@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" - } - } - }, - "levn": { - "version": "0.3.0", - "from": "levn@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz" - }, - "liftoff": { - "version": "2.2.4", - "from": "liftoff@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.2.4.tgz" - }, - "livereload-js": { - "version": "2.2.2", - "from": "livereload-js@>=2.2.0 <3.0.0", - "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-2.2.2.tgz" - }, - "load-json-file": { - "version": "1.1.0", - "from": "load-json-file@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz" - }, - "loader-runner": { - "version": "2.1.1", - "from": "loader-runner@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.1.1.tgz" - }, - "loader-utils": { - "version": "0.2.15", - "from": "loader-utils@>=0.2.11 <0.3.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.15.tgz", - "dependencies": { - "json5": { - "version": "0.5.0", - "from": "json5@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.0.tgz" - } - } - }, - "lodash": { - "version": "4.13.1", - "from": "lodash@>=4.2.0 <5.0.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz" - }, - "lodash._arraycopy": { - "version": "3.0.0", - "from": "lodash._arraycopy@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz" - }, - "lodash._arrayeach": { - "version": "3.0.0", - "from": "lodash._arrayeach@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz" - }, - "lodash._baseassign": { - "version": "3.2.0", - "from": "lodash._baseassign@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz" - }, - "lodash._baseclone": { - "version": "4.5.7", - "from": "lodash._baseclone@>=4.5.0 <4.6.0", - "resolved": "https://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-4.5.7.tgz" - }, - "lodash._basecopy": { - "version": "3.0.1", - "from": "lodash._basecopy@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz" - }, - "lodash._basefor": { - "version": "3.0.3", - "from": "lodash._basefor@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._basefor/-/lodash._basefor-3.0.3.tgz" - }, - "lodash._basetostring": { - "version": "3.0.1", - "from": "lodash._basetostring@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz" - }, - "lodash._basevalues": { - "version": "3.0.0", - "from": "lodash._basevalues@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz" - }, - "lodash._bindcallback": { - "version": "3.0.1", - "from": "lodash._bindcallback@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz" - }, - "lodash._createassigner": { - "version": "3.1.1", - "from": "lodash._createassigner@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz" - }, - "lodash._escapehtmlchar": { - "version": "2.4.1", - "from": "lodash._escapehtmlchar@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.4.1.tgz" - }, - "lodash._escapestringchar": { - "version": "2.4.1", - "from": "lodash._escapestringchar@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash._escapestringchar/-/lodash._escapestringchar-2.4.1.tgz" - }, - "lodash._getnative": { - "version": "3.9.1", - "from": "lodash._getnative@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz" - }, - "lodash._htmlescapes": { - "version": "2.4.1", - "from": "lodash._htmlescapes@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash._htmlescapes/-/lodash._htmlescapes-2.4.1.tgz" - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "from": "lodash._isiterateecall@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz" - }, - "lodash._isnative": { - "version": "2.4.1", - "from": "lodash._isnative@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz" - }, - "lodash._objecttypes": { - "version": "2.4.1", - "from": "lodash._objecttypes@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz" - }, - "lodash._reescape": { - "version": "3.0.0", - "from": "lodash._reescape@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz" - }, - "lodash._reevaluate": { - "version": "3.0.0", - "from": "lodash._reevaluate@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz" - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "from": "lodash._reinterpolate@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz" - }, - "lodash._reunescapedhtml": { - "version": "2.4.1", - "from": "lodash._reunescapedhtml@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash._reunescapedhtml/-/lodash._reunescapedhtml-2.4.1.tgz", - "dependencies": { - "lodash.keys": { - "version": "2.4.1", - "from": "lodash.keys@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz" - } - } - }, - "lodash._root": { - "version": "3.0.1", - "from": "lodash._root@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz" - }, - "lodash._shimkeys": { - "version": "2.4.1", - "from": "lodash._shimkeys@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz" - }, - "lodash.assign": { - "version": "3.2.0", - "from": "lodash.assign@>=3.2.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz" - }, - "lodash.clonedeep": { - "version": "4.3.2", - "from": "lodash.clonedeep@>=4.3.2 <5.0.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz" - }, - "lodash.defaults": { - "version": "2.4.1", - "from": "lodash.defaults@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-2.4.1.tgz", - "dependencies": { - "lodash.keys": { - "version": "2.4.1", - "from": "lodash.keys@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz" - } - } - }, - "lodash.escape": { - "version": "3.2.0", - "from": "lodash.escape@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz" - }, - "lodash.isarguments": { - "version": "3.0.8", - "from": "lodash.isarguments@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.8.tgz" - }, - "lodash.isarray": { - "version": "3.0.4", - "from": "lodash.isarray@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz" - }, - "lodash.isobject": { - "version": "2.4.1", - "from": "lodash.isobject@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz" - }, - "lodash.keys": { - "version": "3.1.2", - "from": "lodash.keys@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz" - }, - "lodash.rest": { - "version": "4.0.3", - "from": "lodash.rest@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz" - }, - "lodash.restparam": { - "version": "3.6.1", - "from": "lodash.restparam@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz" - }, - "lodash.template": { - "version": "3.6.2", - "from": "lodash.template@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz" - }, - "lodash.templatesettings": { - "version": "3.1.1", - "from": "lodash.templatesettings@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz" - }, - "lodash.values": { - "version": "2.4.1", - "from": "lodash.values@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-2.4.1.tgz", - "dependencies": { - "lodash.keys": { - "version": "2.4.1", - "from": "lodash.keys@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz" - } - } - }, - "log-symbols": { - "version": "1.0.2", - "from": "log-symbols@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz" - }, - "longest": { - "version": "1.0.1", - "from": "longest@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz" - }, - "loose-envify": { - "version": "1.2.0", - "from": "loose-envify@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.2.0.tgz", - "dependencies": { - "js-tokens": { - "version": "1.0.3", - "from": "js-tokens@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz" - } - } - }, - "loud-rejection": { - "version": "1.5.0", - "from": "loud-rejection@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.5.0.tgz" - }, - "lru-cache": { - "version": "2.7.3", - "from": "lru-cache@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz" - }, - "map-obj": { - "version": "1.0.1", - "from": "map-obj@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" - }, - "map-stream": { - "version": "0.1.0", - "from": "map-stream@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz" - }, - "marked": { - "version": "0.3.5", - "from": "marked@>=0.3.2 <0.4.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.5.tgz" - }, - "marked-terminal": { - "version": "1.6.1", - "from": "marked-terminal@>=1.6.1 <2.0.0", - "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-1.6.1.tgz" - }, - "media-typer": { - "version": "0.3.0", - "from": "media-typer@0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" - }, - "memory-fs": { - "version": "0.3.0", - "from": "memory-fs@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "meow": { - "version": "3.7.0", - "from": "meow@>=3.3.0 <4.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz" - }, - "merge-stream": { - "version": "1.0.0", - "from": "merge-stream@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.0.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "micromatch": { - "version": "2.3.10", - "from": "micromatch@>=2.1.5 <3.0.0", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.10.tgz" - }, - "miller-rabin": { - "version": "4.0.0", - "from": "miller-rabin@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz" - }, - "mime": { - "version": "1.2.11", - "from": "mime@>=1.2.11 <1.3.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz" - }, - "mime-db": { - "version": "1.23.0", - "from": "mime-db@>=1.23.0 <1.24.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz" - }, - "mime-types": { - "version": "1.0.2", - "from": "mime-types@>=1.0.1 <1.1.0", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz" - }, - "mini-lr": { - "version": "0.1.9", - "from": "mini-lr@>=0.1.8 <0.2.0", - "resolved": "https://registry.npmjs.org/mini-lr/-/mini-lr-0.1.9.tgz", - "dependencies": { - "qs": { - "version": "2.2.5", - "from": "qs@>=2.2.3 <2.3.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-2.2.5.tgz" - } - } - }, - "minimalistic-assert": { - "version": "1.0.0", - "from": "minimalistic-assert@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz" - }, - "minimatch": { - "version": "3.0.2", - "from": "minimatch@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz" - }, - "minimist": { - "version": "1.2.0", - "from": "minimist@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz" - }, - "mkdirp": { - "version": "0.5.1", - "from": "mkdirp@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "dependencies": { - "minimist": { - "version": "0.0.8", - "from": "minimist@0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" - } - } - }, - "modify-babel-preset": { - "version": "1.2.0", - "from": "modify-babel-preset@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/modify-babel-preset/-/modify-babel-preset-1.2.0.tgz" - }, - "moment": { - "version": "2.13.0", - "from": "moment@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.13.0.tgz" - }, - "ms": { - "version": "0.7.1", - "from": "ms@0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" - }, - "multipipe": { - "version": "0.1.2", - "from": "multipipe@>=0.1.2 <0.2.0", - "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz" - }, - "mute-stream": { - "version": "0.0.5", - "from": "mute-stream@0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz" - }, - "node-emoji": { - "version": "0.1.0", - "from": "node-emoji@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-0.1.0.tgz" - }, - "node-fetch": { - "version": "1.5.3", - "from": "node-fetch@>=1.3.3 <2.0.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.5.3.tgz" - }, - "node-fs": { - "version": "0.1.7", - "from": "node-fs@*", - "resolved": "https://registry.npmjs.org/node-fs/-/node-fs-0.1.7.tgz" - }, - "node-libs-browser": { - "version": "1.0.0", - "from": "node-libs-browser@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-1.0.0.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.5 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "node-localstorage": { - "version": "1.1.2", - "from": "node-localstorage@>=1.1.2 <1.2.0", - "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-1.1.2.tgz" - }, - "node-notifier": { - "version": "4.2.3", - "from": "node-notifier@>=4.2.3 <4.3.0", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-4.2.3.tgz", - "dependencies": { - "lodash._baseclone": { - "version": "3.3.0", - "from": "lodash._baseclone@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-3.3.0.tgz" - }, - "lodash.clonedeep": { - "version": "3.0.2", - "from": "lodash.clonedeep@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-3.0.2.tgz" - }, - "semver": { - "version": "4.3.6", - "from": "semver@>=4.0.3 <5.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz" - } - } - }, - "node-uuid": { - "version": "1.4.7", - "from": "node-uuid@>=1.4.0 <1.5.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" - }, - "node.extend": { - "version": "1.1.5", - "from": "node.extend@>=1.1.3 <2.0.0", - "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.1.5.tgz" - }, - "nopt": { - "version": "3.0.6", - "from": "nopt@>=3.0.1 <3.1.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz" - }, - "normalize-package-data": { - "version": "2.3.5", - "from": "normalize-package-data@>=2.3.4 <3.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz" - }, - "normalize-path": { - "version": "2.0.1", - "from": "normalize-path@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz" - }, - "normalize-range": { - "version": "0.1.2", - "from": "normalize-range@>=0.1.2 <0.2.0", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz" - }, - "normalize.css": { - "version": "4.2.0", - "from": "normalize.css@*", - "resolved": "https://registry.npmjs.org/normalize.css/-/normalize.css-4.2.0.tgz" - }, - "num2fraction": { - "version": "1.2.2", - "from": "num2fraction@>=1.2.2 <2.0.0", - "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz" - }, - "number-is-nan": { - "version": "1.0.0", - "from": "number-is-nan@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" - }, - "oauth-sign": { - "version": "0.3.0", - "from": "oauth-sign@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz" - }, - "object-assign": { - "version": "4.1.0", - "from": "object-assign@>=4.0.1 <5.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz" - }, - "object-keys": { - "version": "0.4.0", - "from": "object-keys@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz" - }, - "object.omit": { - "version": "2.0.0", - "from": "object.omit@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.0.tgz" - }, - "on-finished": { - "version": "2.3.0", - "from": "on-finished@>=2.3.0 <2.4.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz" - }, - "once": { - "version": "1.3.3", - "from": "once@>=1.3.0 <2.0.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz" - }, - "onetime": { - "version": "1.1.0", - "from": "onetime@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz" - }, - "openpgp": { - "version": "2.3.2", - "from": "openpgp@*", - "resolved": "https://registry.npmjs.org/openpgp/-/openpgp-2.3.2.tgz" - }, - "optionator": { - "version": "0.8.1", - "from": "optionator@>=0.8.1 <0.9.0", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.1.tgz" - }, - "orchestrator": { - "version": "0.3.7", - "from": "orchestrator@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.7.tgz" - }, - "ordered-read-streams": { - "version": "0.1.0", - "from": "ordered-read-streams@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz" - }, - "os-browserify": { - "version": "0.2.1", - "from": "os-browserify@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz" - }, - "os-homedir": { - "version": "1.0.1", - "from": "os-homedir@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz" - }, - "os-locale": { - "version": "1.4.0", - "from": "os-locale@>=1.4.0 <2.0.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz" - }, - "os-tmpdir": { - "version": "1.0.1", - "from": "os-tmpdir@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz" - }, - "pako": { - "version": "0.2.8", - "from": "pako@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.8.tgz" - }, - "parse-asn1": { - "version": "5.0.0", - "from": "parse-asn1@>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.0.0.tgz" - }, - "parse-glob": { - "version": "3.0.4", - "from": "parse-glob@>=3.0.4 <4.0.0", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" - }, - "parse-json": { - "version": "2.2.0", - "from": "parse-json@>=2.2.0 <3.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz" - }, - "parseurl": { - "version": "1.3.1", - "from": "parseurl@>=1.3.0 <1.4.0", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz" - }, - "path-browserify": { - "version": "0.0.0", - "from": "path-browserify@0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz" - }, - "path-exists": { - "version": "1.0.0", - "from": "path-exists@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-1.0.0.tgz" - }, - "path-is-absolute": { - "version": "1.0.0", - "from": "path-is-absolute@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" - }, - "path-is-inside": { - "version": "1.0.1", - "from": "path-is-inside@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz" - }, - "path-type": { - "version": "1.1.0", - "from": "path-type@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz" - }, - "pause-stream": { - "version": "0.0.11", - "from": "pause-stream@0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz" - }, - "pbkdf2": { - "version": "3.0.4", - "from": "pbkdf2@>=3.0.3 <4.0.0", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.4.tgz" - }, - "pify": { - "version": "2.3.0", - "from": "pify@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" - }, - "pikaday": { - "version": "1.4.0", - "from": "pikaday@>=1.4.0 <2.0.0", - "resolved": "https://registry.npmjs.org/pikaday/-/pikaday-1.4.0.tgz" - }, - "pinkie": { - "version": "2.0.4", - "from": "pinkie@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" - }, - "pinkie-promise": { - "version": "2.0.1", - "from": "pinkie-promise@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" - }, - "pkg-conf": { - "version": "1.1.3", - "from": "pkg-conf@>=1.1.2 <2.0.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-1.1.3.tgz" - }, - "pluralize": { - "version": "1.2.1", - "from": "pluralize@>=1.2.1 <2.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz" - }, - "postcss": { - "version": "5.0.21", - "from": "postcss@>=5.0.4 <6.0.0", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.0.21.tgz", - "dependencies": { - "supports-color": { - "version": "3.1.2", - "from": "supports-color@>=3.1.2 <4.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz" - } - } - }, - "postcss-value-parser": { - "version": "3.3.0", - "from": "postcss-value-parser@>=3.2.3 <4.0.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz" - }, - "prelude-ls": { - "version": "1.1.2", - "from": "prelude-ls@>=1.1.2 <1.2.0", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" - }, - "preserve": { - "version": "0.2.0", - "from": "preserve@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz" - }, - "pretty-hrtime": { - "version": "1.0.2", - "from": "pretty-hrtime@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.2.tgz" - }, - "private": { - "version": "0.1.6", - "from": "private@>=0.1.6 <0.2.0", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.6.tgz" - }, - "process": { - "version": "0.11.5", - "from": "process@>=0.11.0 <0.12.0", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.5.tgz" - }, - "process-nextick-args": { - "version": "1.0.7", - "from": "process-nextick-args@>=1.0.6 <1.1.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" - }, - "progress": { - "version": "1.1.8", - "from": "progress@>=1.1.8 <2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz" - }, - "proto-list": { - "version": "1.2.4", - "from": "proto-list@>=1.2.1 <1.3.0", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" - }, - "prr": { - "version": "0.0.0", - "from": "prr@>=0.0.0 <0.1.0", - "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz" - }, - "public-encrypt": { - "version": "4.0.0", - "from": "public-encrypt@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz" - }, - "punycode": { - "version": "1.4.1", - "from": "punycode@>=1.2.4 <2.0.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" - }, - "qs": { - "version": "1.0.2", - "from": "qs@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-1.0.2.tgz" - }, - "querystring": { - "version": "0.2.0", - "from": "querystring@0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz" - }, - "querystring-es3": { - "version": "0.2.1", - "from": "querystring-es3@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz" - }, - "randomatic": { - "version": "1.1.5", - "from": "randomatic@>=1.1.3 <2.0.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.5.tgz" - }, - "randombytes": { - "version": "2.0.3", - "from": "randombytes@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz" - }, - "raw-body": { - "version": "2.1.7", - "from": "raw-body@>=2.1.5 <2.2.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.1.7.tgz", - "dependencies": { - "bytes": { - "version": "2.4.0", - "from": "bytes@2.4.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz" - } - } - }, - "raw-loader": { - "version": "0.5.1", - "from": "raw-loader@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz" - }, - "rcfinder": { - "version": "0.1.9", - "from": "rcfinder@>=0.1.6 <0.2.0", - "resolved": "https://registry.npmjs.org/rcfinder/-/rcfinder-0.1.9.tgz" - }, - "rcloader": { - "version": "0.1.4", - "from": "rcloader@>=0.1.2 <0.2.0", - "resolved": "https://registry.npmjs.org/rcloader/-/rcloader-0.1.4.tgz", - "dependencies": { - "lodash": { - "version": "3.10.1", - "from": "lodash@>=3.0.1 <4.0.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz" - } - } - }, - "read-json-sync": { - "version": "1.1.1", - "from": "read-json-sync@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/read-json-sync/-/read-json-sync-1.1.1.tgz" - }, - "read-pkg": { - "version": "1.1.0", - "from": "read-pkg@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz" - }, - "read-pkg-up": { - "version": "1.0.1", - "from": "read-pkg-up@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz" - }, - "readable-stream": { - "version": "1.1.14", - "from": "readable-stream@>=1.1.9 <1.2.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz" - }, - "readdirp": { - "version": "2.1.0", - "from": "readdirp@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "readline2": { - "version": "1.0.1", - "from": "readline2@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz" - }, - "rechoir": { - "version": "0.6.2", - "from": "rechoir@>=0.6.2 <0.7.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" - }, - "redent": { - "version": "1.0.0", - "from": "redent@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz" - }, - "redeyed": { - "version": "0.5.0", - "from": "redeyed@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-0.5.0.tgz", - "dependencies": { - "esprima-fb": { - "version": "12001.1.0-dev-harmony-fb", - "from": "esprima-fb@>=12001.1.0-dev-harmony-fb <12001.2.0", - "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-12001.1.0-dev-harmony-fb.tgz" - } - } - }, - "regenerate": { - "version": "1.3.1", - "from": "regenerate@>=1.2.1 <2.0.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.1.tgz" - }, - "regenerator-runtime": { - "version": "0.9.5", - "from": "regenerator-runtime@>=0.9.5 <0.10.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.9.5.tgz" - }, - "regex-cache": { - "version": "0.4.3", - "from": "regex-cache@>=0.4.2 <0.5.0", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz" - }, - "regexpu-core": { - "version": "2.0.0", - "from": "regexpu-core@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz" - }, - "regjsgen": { - "version": "0.2.0", - "from": "regjsgen@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz" - }, - "regjsparser": { - "version": "0.1.5", - "from": "regjsparser@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz" - }, - "repeat-element": { - "version": "1.1.2", - "from": "repeat-element@>=1.1.2 <2.0.0", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" - }, - "repeat-string": { - "version": "1.5.4", - "from": "repeat-string@>=1.5.2 <2.0.0", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz" - }, - "repeating": { - "version": "1.1.3", - "from": "repeating@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz" - }, - "replace-ext": { - "version": "0.0.1", - "from": "replace-ext@0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz" - }, - "replacestream": { - "version": "4.0.0", - "from": "replacestream@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.0.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "object-assign": { - "version": "3.0.0", - "from": "object-assign@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "request": { - "version": "2.40.0", - "from": "request@>=2.40.0 <2.41.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.40.0.tgz" - }, - "require-main-filename": { - "version": "1.0.1", - "from": "require-main-filename@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz" - }, - "require-relative": { - "version": "0.8.7", - "from": "require-relative@>=0.8.7 <0.9.0", - "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz" - }, - "require-uncached": { - "version": "1.0.2", - "from": "require-uncached@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.2.tgz" - }, - "resolve": { - "version": "1.1.7", - "from": "resolve@>=1.1.7 <2.0.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz" - }, - "resolve-from": { - "version": "1.0.1", - "from": "resolve-from@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz" - }, - "restore-cursor": { - "version": "1.0.1", - "from": "restore-cursor@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz" - }, - "right-align": { - "version": "0.1.3", - "from": "right-align@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz" - }, - "rimraf": { - "version": "2.5.2", - "from": "rimraf@*", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz", - "dependencies": { - "glob": { - "version": "7.0.5", - "from": "glob@>=7.0.0 <8.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz" - } - } - }, - "ripemd160": { - "version": "1.0.1", - "from": "ripemd160@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-1.0.1.tgz" - }, - "run-async": { - "version": "0.1.0", - "from": "run-async@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz" - }, - "rx-lite": { - "version": "3.1.2", - "from": "rx-lite@>=3.1.2 <4.0.0", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz" - }, - "semver": { - "version": "5.2.0", - "from": "semver@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0||>=4.0.0 <5.0.0||>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.2.0.tgz" - }, - "sequencify": { - "version": "0.0.7", - "from": "sequencify@>=0.0.7 <0.1.0", - "resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz" - }, - "set-blocking": { - "version": "1.0.0", - "from": "set-blocking@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-1.0.0.tgz" - }, - "set-immediate-shim": { - "version": "1.0.1", - "from": "set-immediate-shim@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz" - }, - "sha.js": { - "version": "2.4.5", - "from": "sha.js@>=2.3.6 <3.0.0", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.5.tgz" - }, - "shebang-regex": { - "version": "1.0.0", - "from": "shebang-regex@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz" - }, - "shelljs": { - "version": "0.6.0", - "from": "shelljs@>=0.6.0 <0.7.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.0.tgz" - }, - "shellwords": { - "version": "0.1.0", - "from": "shellwords@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.0.tgz" - }, - "sigmund": { - "version": "1.0.1", - "from": "sigmund@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz" - }, - "signal-exit": { - "version": "3.0.0", - "from": "signal-exit@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz" - }, - "slash": { - "version": "1.0.0", - "from": "slash@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz" - }, - "slice-ansi": { - "version": "0.0.4", - "from": "slice-ansi@0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz" - }, - "sntp": { - "version": "0.2.4", - "from": "sntp@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz" - }, - "source-list-map": { - "version": "0.1.6", - "from": "source-list-map@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.6.tgz" - }, - "source-map": { - "version": "0.5.6", - "from": "source-map@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" - }, - "source-map-support": { - "version": "0.2.10", - "from": "source-map-support@>=0.2.10 <0.3.0", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", - "dependencies": { - "source-map": { - "version": "0.1.32", - "from": "source-map@0.1.32", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz" - } - } - }, - "sparkles": { - "version": "1.0.0", - "from": "sparkles@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz" - }, - "spdx-correct": { - "version": "1.0.2", - "from": "spdx-correct@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz" - }, - "spdx-exceptions": { - "version": "1.0.4", - "from": "spdx-exceptions@>=1.0.4 <2.0.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.4.tgz" - }, - "spdx-expression-parse": { - "version": "1.0.2", - "from": "spdx-expression-parse@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz" - }, - "spdx-license-ids": { - "version": "1.2.1", - "from": "spdx-license-ids@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.1.tgz" - }, - "split": { - "version": "0.3.3", - "from": "split@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz" - }, - "sprintf-js": { - "version": "1.0.3", - "from": "sprintf-js@>=1.0.2 <1.1.0", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" - }, - "statuses": { - "version": "1.3.0", - "from": "statuses@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.0.tgz" - }, - "stream-browserify": { - "version": "2.0.1", - "from": "stream-browserify@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "stream-combiner": { - "version": "0.0.4", - "from": "stream-combiner@>=0.0.4 <0.1.0", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz" - }, - "stream-combiner2": { - "version": "1.1.1", - "from": "stream-combiner2@>=1.1.1 <2.0.0", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "dependencies": { - "duplexer2": { - "version": "0.1.4", - "from": "duplexer2@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz" - }, - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.1.4", - "from": "readable-stream@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" - } - } - }, - "stream-consume": { - "version": "0.1.0", - "from": "stream-consume@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.0.tgz" - }, - "string_decoder": { - "version": "0.10.31", - "from": "string_decoder@>=0.10.0 <0.11.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "string-width": { - "version": "1.0.1", - "from": "string-width@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz" - }, - "stringstream": { - "version": "0.0.5", - "from": "stringstream@>=0.0.4 <0.1.0", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" - }, - "strip-ansi": { - "version": "3.0.1", - "from": "strip-ansi@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" - }, - "strip-bom": { - "version": "2.0.0", - "from": "strip-bom@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" - }, - "strip-indent": { - "version": "1.0.1", - "from": "strip-indent@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz" - }, - "strip-json-comments": { - "version": "1.0.4", - "from": "strip-json-comments@>=1.0.1 <1.1.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz" - }, - "supports-color": { - "version": "2.0.0", - "from": "supports-color@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" - }, - "symbol": { - "version": "0.2.3", - "from": "symbol@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/symbol/-/symbol-0.2.3.tgz" - }, - "table": { - "version": "3.7.8", - "from": "table@>=3.7.8 <4.0.0", - "resolved": "https://registry.npmjs.org/table/-/table-3.7.8.tgz" - }, - "tapable": { - "version": "0.2.4", - "from": "tapable@>=0.2.3 <0.3.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.4.tgz" - }, - "ternary-stream": { - "version": "2.0.0", - "from": "ternary-stream@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/ternary-stream/-/ternary-stream-2.0.0.tgz" - }, - "text-table": { - "version": "0.2.0", - "from": "text-table@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" - }, - "textextensions": { - "version": "1.0.2", - "from": "textextensions@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-1.0.2.tgz" - }, - "through": { - "version": "2.3.8", - "from": "through@>=2.3.6 <3.0.0", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" - }, - "through2": { - "version": "2.0.1", - "from": "through2@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.1.tgz", - "dependencies": { - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "readable-stream": { - "version": "2.0.6", - "from": "readable-stream@>=2.0.0 <2.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" - } - } - }, - "tildify": { - "version": "1.2.0", - "from": "tildify@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz" - }, - "time-stamp": { - "version": "1.0.1", - "from": "time-stamp@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.0.1.tgz" - }, - "timers-browserify": { - "version": "1.4.2", - "from": "timers-browserify@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz" - }, - "to-fast-properties": { - "version": "1.0.2", - "from": "to-fast-properties@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.2.tgz" - }, - "tough-cookie": { - "version": "2.2.2", - "from": "tough-cookie@>=0.12.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz" - }, - "trim-newlines": { - "version": "1.0.0", - "from": "trim-newlines@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz" - }, - "tryit": { - "version": "1.0.2", - "from": "tryit@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.2.tgz" - }, - "tty-browserify": { - "version": "0.0.0", - "from": "tty-browserify@0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz" - }, - "tunnel-agent": { - "version": "0.4.3", - "from": "tunnel-agent@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz" - }, - "tv4": { - "version": "1.2.7", - "from": "tv4@>=1.2.7 <2.0.0", - "resolved": "https://registry.npmjs.org/tv4/-/tv4-1.2.7.tgz" - }, - "type-check": { - "version": "0.3.2", - "from": "type-check@>=0.3.2 <0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" - }, - "type-is": { - "version": "1.6.13", - "from": "type-is@>=1.6.10 <1.7.0", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.13.tgz", - "dependencies": { - "mime-types": { - "version": "2.1.11", - "from": "mime-types@>=2.1.11 <2.2.0", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz" - } - } - }, - "typedarray": { - "version": "0.0.6", - "from": "typedarray@>=0.0.5 <0.1.0", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" - }, - "uglify-js": { - "version": "2.6.4", - "from": "uglify-js@2.6.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.6.4.tgz", - "dependencies": { - "async": { - "version": "0.2.10", - "from": "async@>=0.2.6 <0.3.0", - "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz" - }, - "yargs": { - "version": "3.10.0", - "from": "yargs@>=3.10.0 <3.11.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz" - } - } - }, - "uglify-save-license": { - "version": "0.4.1", - "from": "uglify-save-license@>=0.4.1 <0.5.0", - "resolved": "https://registry.npmjs.org/uglify-save-license/-/uglify-save-license-0.4.1.tgz" - }, - "uglify-to-browserify": { - "version": "1.0.2", - "from": "uglify-to-browserify@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz" - }, - "unique-stream": { - "version": "1.0.0", - "from": "unique-stream@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz" - }, - "unpipe": { - "version": "1.0.0", - "from": "unpipe@1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" - }, - "url": { - "version": "0.11.0", - "from": "url@>=0.11.0 <0.12.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "dependencies": { - "punycode": { - "version": "1.3.2", - "from": "punycode@1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz" - } - } - }, - "user-home": { - "version": "1.1.1", - "from": "user-home@>=1.1.1 <2.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" - }, - "util": { - "version": "0.10.3", - "from": "util@>=0.10.3 <0.11.0", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz" - }, - "util-deprecate": { - "version": "1.0.2", - "from": "util-deprecate@>=1.0.1 <1.1.0", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - }, - "v8flags": { - "version": "2.0.11", - "from": "v8flags@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.0.11.tgz" - }, - "validate-npm-package-license": { - "version": "3.0.1", - "from": "validate-npm-package-license@>=3.0.1 <4.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz" - }, - "vinyl": { - "version": "0.5.3", - "from": "vinyl@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz" - }, - "vinyl-bufferstream": { - "version": "1.0.1", - "from": "vinyl-bufferstream@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/vinyl-bufferstream/-/vinyl-bufferstream-1.0.1.tgz" - }, - "vinyl-fs": { - "version": "0.3.14", - "from": "vinyl-fs@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", - "dependencies": { - "clone": { - "version": "0.2.0", - "from": "clone@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz" - }, - "graceful-fs": { - "version": "3.0.8", - "from": "graceful-fs@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz" - }, - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.33-1 <1.1.0-0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - }, - "strip-bom": { - "version": "1.0.0", - "from": "strip-bom@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz" - }, - "through2": { - "version": "0.6.5", - "from": "through2@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz" - }, - "vinyl": { - "version": "0.4.6", - "from": "vinyl@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz" - } - } - }, - "vinyl-sourcemaps-apply": { - "version": "0.2.1", - "from": "vinyl-sourcemaps-apply@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz" - }, - "vm-browserify": { - "version": "0.0.4", - "from": "vm-browserify@0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz" - }, - "watchpack": { - "version": "1.1.0", - "from": "watchpack@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.1.0.tgz", - "dependencies": { - "async": { - "version": "2.0.0-rc.4", - "from": "async@2.0.0-rc.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.0.0-rc.4.tgz" - } - } - }, - "webpack": { - "version": "2.1.0-beta.15", - "from": "webpack@2.1.0-beta.15", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-2.1.0-beta.15.tgz", - "dependencies": { - "async": { - "version": "1.5.2", - "from": "async@>=1.3.0 <2.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz" - }, - "supports-color": { - "version": "3.1.2", - "from": "supports-color@>=3.1.0 <4.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz" - } - } - }, - "webpack-sources": { - "version": "0.1.2", - "from": "webpack-sources@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-0.1.2.tgz" - }, - "websocket-driver": { - "version": "0.6.5", - "from": "websocket-driver@>=0.3.6", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz" - }, - "websocket-extensions": { - "version": "0.1.1", - "from": "websocket-extensions@>=0.1.1", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.1.tgz" - }, - "which": { - "version": "1.2.10", - "from": "which@>=1.0.5 <2.0.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.2.10.tgz" - }, - "window-size": { - "version": "0.1.0", - "from": "window-size@0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz" - }, - "wordwrap": { - "version": "1.0.0", - "from": "wordwrap@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" - }, - "wrap-ansi": { - "version": "2.0.0", - "from": "wrap-ansi@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.0.0.tgz" - }, - "wrappy": { - "version": "1.0.2", - "from": "wrappy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - }, - "write": { - "version": "0.2.1", - "from": "write@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz" - }, - "xregexp": { - "version": "3.1.1", - "from": "xregexp@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-3.1.1.tgz" - }, - "xtend": { - "version": "4.0.1", - "from": "xtend@>=4.0.0 <4.1.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" - }, - "y18n": { - "version": "3.2.1", - "from": "y18n@>=3.2.1 <4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz" - }, - "yargs": { - "version": "4.7.1", - "from": "yargs@>=4.7.1 <5.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.7.1.tgz", - "dependencies": { - "camelcase": { - "version": "3.0.0", - "from": "camelcase@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz" - }, - "cliui": { - "version": "3.2.0", - "from": "cliui@>=3.2.0 <4.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz" - }, - "lodash.assign": { - "version": "4.0.9", - "from": "lodash.assign@>=4.0.3 <5.0.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz" - }, - "lodash.keys": { - "version": "4.0.7", - "from": "lodash.keys@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.0.7.tgz" - }, - "window-size": { - "version": "0.2.0", - "from": "window-size@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz" - } - } - }, - "yargs-parser": { - "version": "2.4.0", - "from": "yargs-parser@>=2.4.0 <3.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.0.tgz", - "dependencies": { - "camelcase": { - "version": "2.1.1", - "from": "camelcase@>=2.1.1 <3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz" - }, - "lodash.assign": { - "version": "4.0.9", - "from": "lodash.assign@>=4.0.6 <5.0.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.0.9.tgz" - }, - "lodash.keys": { - "version": "4.0.7", - "from": "lodash.keys@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.0.7.tgz" - } - } - }, - "yazl": { - "version": "2.4.1", - "from": "yazl@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.4.1.tgz" - } - } -} diff --git a/package.json b/package.json index 8a2451be8..ae094ff6d 100644 --- a/package.json +++ b/package.json @@ -47,46 +47,67 @@ "node": ">= 4" }, "devDependencies": { + "Progress.js": "github:usablica/progress.js", + "autolinker": "^0.27.0", "babel-core": "^6.1.4", "babel-loader": "^6.1.0", "babel-plugin-transform-runtime": "^6.9.0", - "babel-preset-es2015": "*", - "babel-preset-es2015-loose": "*", + "babel-preset-es2015": "^6.9.0", + "babel-preset-es2015-loose": "^7.0.0", "babel-preset-es2015-loose-native-modules": "^1.0.0", "babel-preset-stage-0": "^6.5.0", "babel-runtime": "^6.1.18", "es6-promise-polyfill": "^1.2.0", "gulp": "~3.9.0", - "gulp-autoprefixer": "*", - "gulp-beautify": "*", + "gulp-autoprefixer": "^3.1.0", + "gulp-beautify": "^2.0.0", "gulp-cached": "^1.1.0", "gulp-clean-css": "^2.0.7", - "gulp-concat-util": "*", - "gulp-eol": "*", - "gulp-eslint": "^2.0.0", - "gulp-header": "*", - "gulp-if": "~1.2.5", + "gulp-concat-util": "^0.5.5", + "gulp-eol": "^0.1.2", + "gulp-eslint": "^3.0.1", + "gulp-header": "^1.8.7", + "gulp-if": "^2.0.1", "gulp-less": "1.3.6", "gulp-livereload": "~3.8.0", "gulp-notify": "~2.2.0", - "gulp-plumber": "*", - "gulp-rename": "*", - "gulp-replace": "*", - "gulp-rimraf": "*", - "gulp-stripbom": "*", - "gulp-through": "~0.3.0", - "gulp-uglify": "*", - "gulp-util": "*", - "gulp-zip": "*", + "gulp-plumber": "^1.1.0", + "gulp-rename": "^1.2.2", + "gulp-replace": "^0.5.4", + "gulp-rimraf": "^0.2.0", + "gulp-stripbom": "^1.0.4", + "gulp-through": "^0.4.0", + "gulp-uglify": "^1.5.4", + "gulp-util": "^3.0.7", + "gulp-zip": "^3.2.0", + "ifvisible.js": "^1.0.6", "jassl": "github:rainloop/jassl", + "jquery": "^2", + "jquery-lazyload": "^1.9.7", + "jquery-mousewheel": "^3.1.13", + "jquery-scrollstop": "^1.2.0", + "jquery.backstretch": "^2.1.13", + "js-cookie": "^2.1.2", "json-loader": "^0.5.4", - "node-fs": "*", - "node-notifier": "~4.2.3", + "json3": "^3.3.2", + "knockout": "^3.4.0", + "knockout-projections": "github:stevesanderson/knockout-projections", + "knockout-sortable": "^0.14.1", + "lightgallery": "^1.2.21", + "matchmedia-polyfill": "^0.3.0", + "moment": "^2.14.1", + "node-fs": "^0.1.7", + "node-notifier": "^4.6.0", "normalize.css": "^4.2.0", "openpgp": "^2.3.2", + "opentip": "^2.4.3", "pikaday": "^1.4.0", "raw-loader": "^0.5.1", - "rimraf": "*", - "webpack": "^2.1.0-beta.15" + "rifraf": "^2.0.2", + "rimraf": "^2.5.4", + "simplestatemanager": "^3.1.3", + "tinycon": "github:tommoor/tinycon", + "underscore": "^1.8.3", + "webpack": "^2.1.0-beta.20" } } diff --git a/plugins/snowfall-on-login-screen/js/snowfall.js b/plugins/snowfall-on-login-screen/js/snowfall.js index 7dfcfaed1..a60c80abf 100644 --- a/plugins/snowfall-on-login-screen/js/snowfall.js +++ b/plugins/snowfall-on-login-screen/js/snowfall.js @@ -1,275 +1,275 @@ -/* Snowfall pure js - ==================================================================== - LICENSE - ==================================================================== - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ==================================================================== - - 1.0 - Wanted to rewrite my snow plugin to use pure JS so you werent necessarily tied to using a framework. - Does not include a selector engine or anything, just pass elements to it using standard JS selectors. - - Does not clear snow currently. Collection portion removed just for ease of testing will add back in next version - - Theres a few ways to call the snow you could do it the following way by directly passing the selector, - - snowFall.snow(document.getElementsByTagName("body"), {options}); - - or you could save the selector results to a variable, and then call it - - var elements = document.getElementsByClassName('yourclass'); - snowFall.snow(elements, {options}); - - Options are all the same as the plugin except clear, and collection - - values for snow options are - - flakeCount, - flakeColor, - flakeIndex, - minSize, - maxSize, - minSpeed, - maxSpeed, - round, true or false, makes the snowflakes rounded if the browser supports it. - shadow true or false, gives the snowflakes a shadow if the browser supports it. - -*/ - -// Paul Irish requestAnimationFrame polyfill -(function() { - var lastTime = 0; - var vendors = ['webkit', 'moz']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; - window.cancelAnimationFrame = - window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) - window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - - if (!window.cancelAnimationFrame) - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; -}()); - -var snowFall = (function(){ - function jSnow(){ - // local methods - var defaults = { - flakeCount : 35, - flakeColor : '#ffffff', - flakeIndex: 999999, - minSize : 1, - maxSize : 2, - minSpeed : 1, - maxSpeed : 5, - round : false, - shadow : false, - collection : false, - image : false, - collectionHeight : 40 - }, - element = {}, - flakes = [], - flakeId = 0, - elHeight = 0, - elWidth = 0, - elTop = 0, - elLeft = 0, - widthOffset = 0, - snowTimeout = 0, - // For extending the default object with properties - extend = function(obj, extObj){ - for(var i in extObj){ - if(obj.hasOwnProperty(i)){ - obj[i] = extObj[i]; - } - } - }, - // random between range - random = function random(min, max){ - return Math.round(min + Math.random()*(max-min)); - }, - // Set multiple styles at once. - setStyle = function(element, props) - { - for (var property in props){ - element.style[property] = props[property] + ((property == 'width' || property == 'height') ? 'px' : ''); - } - }, - // snowflake - flake = function(_x, _y, _size, _speed, _id) - { - // Flake properties - this.id = _id; - this.x = _x + elLeft; - this.y = _y + elTop; - this.size = _size; - this.speed = _speed; - this.step = 0; - this.stepSize = random(1,10) / 100; - - if(defaults.collection){ - this.target = canvasCollection[random(0,canvasCollection.length-1)]; - } - - var flakeObj = null; - - if(defaults.image){ - flakeObj = new Image(); - flakeObj.src = defaults.image; - }else{ - flakeObj = document.createElement("div"); - setStyle(flakeObj, {'background' : defaults.flakeColor}); - } - - flakeObj.className = 'snowfall-flakes'; - flakeObj.setAttribute('id','flake-' + this.id); - setStyle(flakeObj, {'width' : this.size, 'height' : this.size, 'position' : 'absolute', 'top' : this.y, 'left' : this.x, 'fontSize' : 0, 'zIndex' : defaults.flakeIndex}); - - // This adds the style to make the snowflakes round via border radius property - if(defaults.round){ - setStyle(flakeObj,{'-moz-border-radius' : ~~(defaults.maxSize) + 'px', '-webkit-border-radius' : ~~(defaults.maxSize) + 'px', 'borderRadius' : ~~(defaults.maxSize) + 'px'}); - } - - // This adds shadows just below the snowflake so they pop a bit on lighter colored web pages - if(defaults.shadow){ - setStyle(flakeObj,{'-moz-box-shadow' : '1px 1px 1px #555', '-webkit-box-shadow' : '1px 1px 1px #555', 'boxShadow' : '1px 1px 1px #555'}); - } - - document.body.appendChild(flakeObj); - - this.element = flakeObj; - - // Update function, used to update the snow flakes, and checks current snowflake against bounds - this.update = function(){ - this.y += this.speed; - - if(this.y > (elTop + elHeight) - (this.size + 6)){ - this.reset(); - } - - this.element.style.top = this.y + 'px'; - this.element.style.left = ~~this.x + 'px'; - - this.step += this.stepSize; - this.x += Math.cos(this.step); - - if(this.x > (elLeft + elWidth) - widthOffset || this.x < widthOffset){ - this.reset(); - } - } - - // Resets the snowflake once it reaches one of the bounds set - this.reset = function(){ - this.y = elTop; - this.x = elLeft + random(widthOffset, elWidth - widthOffset); - this.stepSize = random(1,10) / 100; - this.size = random((defaults.minSize * 100), (defaults.maxSize * 100)) / 100; - this.speed = random(defaults.minSpeed, defaults.maxSpeed); - } - }, - // this controls flow of the updating snow - animateSnow = function(){ - for(var i = 0; i < flakes.length; i += 1){ - flakes[i].update(); - } - snowTimeout = requestAnimationFrame(function(){animateSnow()}); - } - return{ - snow : function(_element, _options){ - extend(defaults, _options); - - //init the element vars - element = _element; - elHeight = element.clientHeight, - elWidth = element.offsetWidth; - elTop = element.offsetTop; - elLeft = element.offsetLeft; - - element.snow = this; - - // if this is the body the offset is a little different - if(element.tagName.toLowerCase() === 'body'){ - widthOffset = 25; - } - - // Bind the window resize event so we can get the innerHeight again - window.onresize = function(){ - elHeight = element.clientHeight; - elWidth = element.offsetWidth; - elTop = element.offsetTop; - elLeft = element.offsetLeft; - } - - // initialize the flakes - for(i = 0; i < defaults.flakeCount; i+=1){ - flakeId = flakes.length; - flakes.push(new flake(random(widthOffset,elWidth - widthOffset), random(0, elHeight), random((defaults.minSize * 100), (defaults.maxSize * 100)) / 100, random(defaults.minSpeed, defaults.maxSpeed), flakeId)); - } - // start the snow - animateSnow(); - }, - clear : function(){ - var flakeChildren = null; - - if(!element.getElementsByClassName){ - flakeChildren = element.querySelectorAll('.snowfall-flakes'); - }else{ - flakeChildren = element.getElementsByClassName('snowfall-flakes'); - } - - var flakeChilLen = flakeChildren.length; - while(flakeChilLen--){ - element.removeChild(flakeChildren[flakeChilLen]); - } - - flakes = []; - cancelAnimationFrame(snowTimeout); - } - } - }; - return{ - snow : function(elements, options){ - if(typeof(options) == "string"){ - if(elements.length > 0){ - for(var i = 0; i < elements.length; i++){ - if(elements[i].snow){ - elements[i].snow.clear(); - } - } - }else{ - elements.snow.clear(); - } - }else{ - if(elements.length > 0){ - for(var i = 0; i < elements.length; i++){ - new jSnow().snow(elements[i], options); - } - }else{ - new jSnow().snow(elements, options); - } - } - } - } +/* Snowfall pure js + ==================================================================== + LICENSE + ==================================================================== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ==================================================================== + + 1.0 + Wanted to rewrite my snow plugin to use pure JS so you werent necessarily tied to using a framework. + Does not include a selector engine or anything, just pass elements to it using standard JS selectors. + + Does not clear snow currently. Collection portion removed just for ease of testing will add back in next version + + Theres a few ways to call the snow you could do it the following way by directly passing the selector, + + snowFall.snow(document.getElementsByTagName("body"), {options}); + + or you could save the selector results to a variable, and then call it + + var elements = document.getElementsByClassName('yourclass'); + snowFall.snow(elements, {options}); + + Options are all the same as the plugin except clear, and collection + + values for snow options are + + flakeCount, + flakeColor, + flakeIndex, + minSize, + maxSize, + minSpeed, + maxSpeed, + round, true or false, makes the snowflakes rounded if the browser supports it. + shadow true or false, gives the snowflakes a shadow if the browser supports it. + +*/ + +// Paul Irish requestAnimationFrame polyfill +(function(window) { + var lastTime = 0; + var vendors = ['webkit', 'moz']; + for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { + window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; + window.cancelAnimationFrame = + window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; + } + + if (!window.requestAnimationFrame) + window.requestAnimationFrame = function(callback, element) { + var currTime = new Date().getTime(); + var timeToCall = window.Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function() { callback(currTime + timeToCall); }, + timeToCall); + lastTime = currTime + timeToCall; + return id; + }; + + if (!window.cancelAnimationFrame) + window.cancelAnimationFrame = function(id) { + clearTimeout(id); + }; +}(window)); + +var snowFall = (function(){ + function jSnow(){ + // local methods + var defaults = { + flakeCount : 35, + flakeColor : '#ffffff', + flakeIndex: 999999, + minSize : 1, + maxSize : 2, + minSpeed : 1, + maxSpeed : 5, + round : false, + shadow : false, + collection : false, + image : false, + collectionHeight : 40 + }, + element = {}, + flakes = [], + flakeId = 0, + elHeight = 0, + elWidth = 0, + elTop = 0, + elLeft = 0, + widthOffset = 0, + snowTimeout = 0, + // For extending the default object with properties + extend = function(obj, extObj){ + for(var i in extObj){ + if(obj.hasOwnProperty(i)){ + obj[i] = extObj[i]; + } + } + }, + // random between range + random = function random(min, max){ + return window.Math.round(min + window.Math.random()*(max-min)); + }, + // Set multiple styles at once. + setStyle = function(element, props) + { + for (var property in props){ + element.style[property] = props[property] + ((property === 'width' || property === 'height') ? 'px' : ''); + } + }, + // snowflake + flake = function(_x, _y, _size, _speed, _id) + { + // Flake properties + this.id = _id; + this.x = _x + elLeft; + this.y = _y + elTop; + this.size = _size; + this.speed = _speed; + this.step = 0; + this.stepSize = random(1,10) / 100; + + if(defaults.collection){ + this.target = defaults.collection[random(0,defaults.collection.length-1)]; + } + + var flakeObj = null; + + if(defaults.image){ + flakeObj = new Image(); + flakeObj.src = defaults.image; + }else{ + flakeObj = window.document.createElement("div"); + setStyle(flakeObj, {'background' : defaults.flakeColor}); + } + + flakeObj.className = 'snowfall-flakes'; + flakeObj.setAttribute('id','flake-' + this.id); + setStyle(flakeObj, {'width' : this.size, 'height' : this.size, 'position' : 'absolute', 'top' : this.y, 'left' : this.x, 'fontSize' : 0, 'zIndex' : defaults.flakeIndex}); + + // This adds the style to make the snowflakes round via border radius property + if(defaults.round){ + setStyle(flakeObj,{'-moz-border-radius' : ~~(defaults.maxSize) + 'px', '-webkit-border-radius' : ~~(defaults.maxSize) + 'px', 'borderRadius' : ~~(defaults.maxSize) + 'px'}); + } + + // This adds shadows just below the snowflake so they pop a bit on lighter colored web pages + if(defaults.shadow){ + setStyle(flakeObj,{'-moz-box-shadow' : '1px 1px 1px #555', '-webkit-box-shadow' : '1px 1px 1px #555', 'boxShadow' : '1px 1px 1px #555'}); + } + + window.document.body.appendChild(flakeObj); + + this.element = flakeObj; + + // Update function, used to update the snow flakes, and checks current snowflake against bounds + this.update = function(){ + this.y += this.speed; + + if(this.y > (elTop + elHeight) - (this.size + 6)){ + this.reset(); + } + + this.element.style.top = this.y + 'px'; + this.element.style.left = ~~this.x + 'px'; + + this.step += this.stepSize; + this.x += window.Math.cos(this.step); + + if(this.x > (elLeft + elWidth) - widthOffset || this.x < widthOffset){ + this.reset(); + } + }; + + // Resets the snowflake once it reaches one of the bounds set + this.reset = function(){ + this.y = elTop; + this.x = elLeft + random(widthOffset, elWidth - widthOffset); + this.stepSize = random(1,10) / 100; + this.size = random((defaults.minSize * 100), (defaults.maxSize * 100)) / 100; + this.speed = random(defaults.minSpeed, defaults.maxSpeed); + }; + }, + // this controls flow of the updating snow + animateSnow = function(){ + for(var i = 0; i < flakes.length; i += 1){ + flakes[i].update(); + } + snowTimeout = requestAnimationFrame(function(){animateSnow();}); + }; + return{ + snow : function(_element, _options){ + extend(defaults, _options); + + //init the element vars + element = _element; + elHeight = element.clientHeight, + elWidth = element.offsetWidth; + elTop = element.offsetTop; + elLeft = element.offsetLeft; + + element.snow = this; + + // if this is the body the offset is a little different + if(element.tagName.toLowerCase() === 'body'){ + widthOffset = 25; + } + + // Bind the window resize event so we can get the innerHeight again + window.onresize = function(){ + elHeight = element.clientHeight; + elWidth = element.offsetWidth; + elTop = element.offsetTop; + elLeft = element.offsetLeft; + }; + + // initialize the flakes + for(var i = 0; i < defaults.flakeCount; i+=1){ + flakeId = flakes.length; + flakes.push(new flake(random(widthOffset,elWidth - widthOffset), random(0, elHeight), random((defaults.minSize * 100), (defaults.maxSize * 100)) / 100, random(defaults.minSpeed, defaults.maxSpeed), flakeId)); + } + // start the snow + animateSnow(); + }, + clear : function(){ + var flakeChildren = null; + + if(!element.getElementsByClassName){ + flakeChildren = element.querySelectorAll('.snowfall-flakes'); + }else{ + flakeChildren = element.getElementsByClassName('snowfall-flakes'); + } + + var flakeChilLen = flakeChildren.length; + while(flakeChilLen--){ + element.removeChild(flakeChildren[flakeChilLen]); + } + + flakes = []; + cancelAnimationFrame(snowTimeout); + } + }; + }; + return{ + snow : function(elements, options){ + if(typeof(options) === 'string'){ + if(elements.length > 0){ + for(var i = 0; i < elements.length; i++){ + if(elements[i].snow){ + elements[i].snow.clear(); + } + } + }else{ + elements.snow.clear(); + } + }else{ + if(elements.length > 0){ + for(var i = 0; i < elements.length; i++){ + new jSnow().snow(elements[i], options); + } + }else{ + new jSnow().snow(elements, options); + } + } + } + }; })(); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index f48bb8d27..c3f034c4a 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -1,10252 +1,10207 @@ -aCurrentActionParams = array(); - - $this->oHttp = null; - $this->oLogger = null; - $this->oPlugins = null; - $this->oMailClient = null; - $this->oSocial = null; - $this->oConfig = null; - $this->aCachers = array(); - - $this->oStorageProvider = null; - $this->oLocalStorageProvider = null; - $this->oSettingsProvider = null; - $this->oLocalSettingsProvider = null; - $this->oFilesProvider = null; - $this->oFiltersProvider = null; - $this->oDomainProvider = null; - $this->oAddressBookProvider = null; - $this->oSuggestionsProvider = null; - $this->oChangePasswordProvider = null; - $this->oTwoFactorAuthProvider = null; - $this->oPremProvider = null; - - $this->sSpecAuthToken = ''; - - $oConfig = $this->Config(); - $this->Plugins()->RunHook('filter.application-config', array(&$oConfig)); - - $this->Logger()->Ping(); - } - - /** - * @return \RainLoop\Actions - */ - public static function NewInstance() - { - return new self(); - } - - /** - * @param string $sSpecAuthToken - * - * @return \RainLoop\Application - */ - public function SetSpecAuthToken($sSpecAuthToken) - { - $this->sSpecAuthToken = $sSpecAuthToken; - - return $this; - } - - /** - * @return string - */ - public function GetSpecAuthToken() - { - return $this->sSpecAuthToken; - } - - /** - * @return string - */ - public function GetShortLifeSpecAuthToken($iLife = 60) - { - $aAccountHash = \RainLoop\Utils::DecodeKeyValues($this->getLocalAuthToken()); - if (!empty($aAccountHash[0]) && 'token' === $aAccountHash[0] && \is_array($aAccountHash)) - { - $aAccountHash[10] = \time() + $iLife; - return \RainLoop\Utils::EncodeKeyValues($aAccountHash); - } - - return ''; - } - - /** - * @return \RainLoop\Application - */ - public function Config() - { - if (null === $this->oConfig) - { - $this->oConfig = new \RainLoop\Config\Application(); - - $bSave = defined('APP_INSTALLED_START'); - - $bLoaded = $this->oConfig->Load(); - if (!$bLoaded && !$bSave) - { - usleep(10000); // TODO - $bLoaded = $this->oConfig->Load(); - } - - if (!$bLoaded && !$this->oConfig->IsFileExists()) - { - $bSave = true; - } - - if ($bLoaded && !$bSave) - { - $bSave = APP_VERSION !== $this->oConfig->Get('version', 'current'); - } - - if ($bSave) - { - $this->oConfig->Save(); - } - } - - return $this->oConfig; - } - - /** - * @param string $sName - * @param \RainLoop\Model\Account $oAccount = null - * - * @return mixed - */ - private function fabrica($sName, $oAccount = null) - { - $mResult = null; - $this->Plugins() - ->RunHook('main.fabrica', array($sName, &$mResult), false) - ->RunHook('main.fabrica[2]', array($sName, &$mResult, $oAccount), false) - ; - - if (null === $mResult) - { - switch ($sName) - { - case 'files': - // RainLoop\Providers\Files\IFiles - $mResult = new \RainLoop\Providers\Files\FileStorage(APP_PRIVATE_DATA.'storage/files'); - break; - case 'storage': - case 'storage-local': - // RainLoop\Providers\Storage\IStorage - $mResult = new \RainLoop\Providers\Storage\FileStorage( - APP_PRIVATE_DATA.'storage', 'storage-local' === $sName); - break; - case 'settings': - case 'settings-local': - // RainLoop\Providers\Settings\ISettings - $mResult = new \RainLoop\Providers\Settings\DefaultSettings( - $this->StorageProvider('settings-local' === $sName)); - break; - case 'login': - // \RainLoop\Providers\Login\LoginInterface - $mResult = new \RainLoop\Providers\Login\DefaultLogin(); - break; - case 'domain': - // \RainLoop\Providers\Domain\DomainAdminInterface - $mResult = new \RainLoop\Providers\Domain\DefaultDomain(APP_PRIVATE_DATA.'domains', $this->Cacher()); - break; - case 'filters': - // \RainLoop\Providers\Filters\FiltersInterface - $mResult = new \RainLoop\Providers\Filters\SieveStorage( - $this->Plugins(), $this->Config() - ); - break; - case 'address-book': - // \RainLoop\Providers\AddressBook\AddressBookInterface - - $sDsn = \trim($this->Config()->Get('contacts', 'pdo_dsn', '')); - $sUser = \trim($this->Config()->Get('contacts', 'pdo_user', '')); - $sPassword = (string) $this->Config()->Get('contacts', 'pdo_password', ''); - - $sDsnType = $this->ValidateContactPdoType(\trim($this->Config()->Get('contacts', 'type', 'sqlite'))); - if ('sqlite' === $sDsnType) - { - $mResult = new \RainLoop\Providers\AddressBook\PdoAddressBook( - 'sqlite:'.APP_PRIVATE_DATA.'AddressBook.sqlite', '', '', 'sqlite'); - } - else - { - $mResult = new \RainLoop\Providers\AddressBook\PdoAddressBook($sDsn, $sUser, $sPassword, $sDsnType); - } - break; - case 'suggestions': - - if (null === $mResult) - { - $mResult = array(); - } - - if (\is_array($mResult) && \RainLoop\Utils::IsOwnCloud() && $this->Config()->Get('labs', 'owncloud_suggestions', true)) - { - // \RainLoop\Providers\Suggestions\ISuggestions - $mResult[] = new \RainLoop\Providers\Suggestions\OwnCloudSuggestions(); - } - - break; - case 'change-password': - // \RainLoop\Providers\ChangePassword\ChangePasswordInterface - break; - case 'two-factor-auth': - // \RainLoop\Providers\TwoFactorAuth\TwoFactorAuthInterface - $mResult = new \RainLoop\Providers\TwoFactorAuth\GoogleTwoFactorAuth(); - break; - } - } - - foreach (\is_array($mResult) ? $mResult : array($mResult) as $oItem) - { - if ($oItem && \method_exists($oItem, 'SetLogger')) - { - $oItem->SetLogger($this->Logger()); - } - } - - $this->Plugins()->RunHook('filter.fabrica', array($sName, &$mResult, $oAccount), false); - - return $mResult; - } - - /** - * @return void - */ - public function BootStart() - { - if (defined('APP_INSTALLED_START') && defined('APP_INSTALLED_VERSION') && - APP_INSTALLED_START && !APP_INSTALLED_VERSION) - { - try - { - $this->KeenIO('Install'); - } - catch (\Exception $oException) { unset($oException); } - } - } - - /** - * @return void - */ - public function BootEnd() - { - try - { - if ($this->MailClient()->IsLoggined()) - { - $this->MailClient()->LogoutAndDisconnect(); - } - } - catch (\Exception $oException) { unset($oException); } - } - - /** - * @return string - */ - public function ParseQueryAuthString() - { - $sQuery = \trim($this->Http()->GetQueryString()); - - $iPos = \strpos($sQuery, '&'); - if (0 < $iPos) - { - $sQuery = \substr($sQuery, 0, $iPos); - } - - $sQuery = \trim(\trim($sQuery), ' /'); - - $aSubQuery = $this->Http()->GetQuery('q', null); - if (\is_array($aSubQuery)) - { - $aSubQuery = \array_map(function ($sS) { - return \trim(\trim($sS), ' /'); - }, $aSubQuery); - - if (0 < \count($aSubQuery)) - { - $sQuery .= '/'.\implode('/', $aSubQuery); - } - } - - if ('' === $this->GetSpecAuthToken()) - { - $aPaths = \explode('/', $sQuery); - if (!empty($aPaths[0]) && !empty($aPaths[1]) && '_' === substr($aPaths[1], 0, 1)) - { - $this->SetSpecAuthToken($aPaths[1]); - } - } - - return $sQuery; - } - - /** - * @param string $sLine - * @param \RainLoop\Model\Account $oAccount = null - * @param bool $bUrlEncode = false - * @param array $aAdditionalParams = array() - * - * @return string - */ - private function compileLogParams($sLine, $oAccount = null, $bUrlEncode = false, $aAdditionalParams = array()) - { - $aClear = array(); - - if (false !== \strpos($sLine, '{date:')) - { - $iTimeOffset = (int) $this->Config()->Get('logs', 'time_offset', 0); - $sLine = \preg_replace_callback('/\{date:([^}]+)\}/', function ($aMatch) use ($iTimeOffset, $bUrlEncode) { - return \RainLoop\Utils::UrlEncode(\MailSo\Log\Logger::DateHelper($aMatch[1], $iTimeOffset), $bUrlEncode); - }, $sLine); - - $aClear['/\{date:([^}]*)\}/'] = 'date'; - } - - if (false !== \strpos($sLine, '{imap:') || false !== \strpos($sLine, '{smtp:')) - { - if (!$oAccount) - { - $this->ParseQueryAuthString(); - $oAccount = $this->getAccountFromToken(false); - } - - if ($oAccount) - { - $sLine = \str_replace('{imap:login}', \RainLoop\Utils::UrlEncode($oAccount->IncLogin(), $bUrlEncode), $sLine); - $sLine = \str_replace('{imap:host}', \RainLoop\Utils::UrlEncode($oAccount->DomainIncHost(), $bUrlEncode), $sLine); - $sLine = \str_replace('{imap:port}', \RainLoop\Utils::UrlEncode($oAccount->DomainIncPort(), $bUrlEncode), $sLine); - - $sLine = \str_replace('{smtp:login}', \RainLoop\Utils::UrlEncode($oAccount->OutLogin(), $bUrlEncode), $sLine); - $sLine = \str_replace('{smtp:host}', \RainLoop\Utils::UrlEncode($oAccount->DomainOutHost(), $bUrlEncode), $sLine); - $sLine = \str_replace('{smtp:port}', \RainLoop\Utils::UrlEncode($oAccount->DomainOutPort(), $bUrlEncode), $sLine); - } - - $aClear['/\{imap:([^}]*)\}/i'] = 'imap'; - $aClear['/\{smtp:([^}]*)\}/i'] = 'smtp'; - } - - if (false !== \strpos($sLine, '{request:')) - { - if (false !== \strpos($sLine, '{request:ip}')) - { - $sLine = \str_replace('{request:ip}', \RainLoop\Utils::UrlEncode($this->Http()->GetClientIp( - $this->Config()->Get('labs', 'http_client_ip_check_proxy', false)), $bUrlEncode), $sLine); - } - - if (false !== \strpos($sLine, '{request:domain}')) - { - $sLine = \str_replace('{request:domain}', - \RainLoop\Utils::UrlEncode($this->Http()->GetHost(false, true, true), $bUrlEncode), $sLine); - } - - if (false !== \strpos($sLine, '{request:domain-clear}')) - { - $sLine = \str_replace('{request:domain-clear}', - \RainLoop\Utils::UrlEncode( - \MailSo\Base\Utils::GetClearDomainName($this->Http()->GetHost(false, true, true)), $bUrlEncode), $sLine); - } - - $aClear['/\{request:([^}]*)\}/i'] = 'request'; - } - - if (false !== \strpos($sLine, '{user:')) - { - if (false !== \strpos($sLine, '{user:uid}')) - { - $sLine = \str_replace('{user:uid}', - \RainLoop\Utils::UrlEncode(\base_convert(\sprintf('%u', - \crc32(\md5(\RainLoop\Utils::GetConnectionToken()))), 10, 32), $bUrlEncode), - $sLine - ); - } - - if (false !== \strpos($sLine, '{user:ip}')) - { - $sLine = \str_replace('{user:ip}', \RainLoop\Utils::UrlEncode($this->Http()->GetClientIp( - $this->Config()->Get('labs', 'http_client_ip_check_proxy', false)), $bUrlEncode), $sLine); - } - - if (\preg_match('/\{user:(email|login|domain)\}/i', $sLine)) - { - if (!$oAccount) - { - $this->ParseQueryAuthString(); - $oAccount = $this->getAccountFromToken(false); - } - - if ($oAccount) - { - $sEmail = $oAccount->Email(); - - $sLine = \str_replace('{user:email}', \RainLoop\Utils::UrlEncode($sEmail, $bUrlEncode), $sLine); - $sLine = \str_replace('{user:login}', \RainLoop\Utils::UrlEncode( - \MailSo\Base\Utils::GetAccountNameFromEmail($sEmail), $bUrlEncode), $sLine); - $sLine = \str_replace('{user:domain}', \RainLoop\Utils::UrlEncode( - \MailSo\Base\Utils::GetDomainFromEmail($sEmail), $bUrlEncode), $sLine); - $sLine = \str_replace('{user:domain-clear}', \RainLoop\Utils::UrlEncode( - \MailSo\Base\Utils::GetClearDomainName( - \MailSo\Base\Utils::GetDomainFromEmail($sEmail)), $bUrlEncode), $sLine); - } - } - - $aClear['/\{user:([^}]*)\}/i'] = 'unknown'; - } - - if (false !== \strpos($sLine, '{labs:')) - { - $sLine = \preg_replace_callback('/\{labs:rand:([1-9])\}/', function ($aMatch) { - return \rand(\pow(10, $aMatch[1] - 1), \pow(10, $aMatch[1]) - 1); - }, $sLine); - - $aClear['/\{labs:([^}]*)\}/'] = 'labs'; - } - - if (\is_array($aAdditionalParams) && 0 < \count($aAdditionalParams)) - { - foreach ($aAdditionalParams as $sKey => $sValue) - { - $sLine = \str_replace($sKey, $sValue, $sLine); - } - } - - if (0 < \count($aClear)) - { - foreach ($aClear as $sKey => $sValue) - { - $sLine = \preg_replace($sKey, $sValue, $sLine); - } - } - - return $sLine; - } - - /** - * @param string $sFileName - * - * @return string - */ - private function compileLogFileName($sFileName) - { - $sFileName = \trim($sFileName); - - if (0 !== \strlen($sFileName)) - { - $sFileName = $this->compileLogParams($sFileName); - - $sFileName = \preg_replace('/[\/]+/', '/', \preg_replace('/[.]+/', '.', $sFileName)); - $sFileName = \preg_replace('/[^a-zA-Z0-9@_+=\-\.\/!()\[\]]/', '', $sFileName); - } - - if (0 === \strlen($sFileName)) - { - $sFileName = 'rainloop-log.txt'; - } - - return $sFileName; - } - - /** - * @return void - */ - public function SetAuthLogoutToken() - { - @\header('X-RainLoop-Action: Logout'); - \RainLoop\Utils::SetCookie(self::AUTH_SPEC_LOGOUT_TOKEN_KEY, \md5(APP_START_TIME), 0); - } - - /** - * @param \RainLoop\Model\Account $oAccount - * - * @return void - */ - public function SetAuthToken($oAccount) - { - if ($oAccount) - { - $sSpecAuthToken = '_'.$oAccount->GetAuthTokenQ(); - - $this->SetSpecAuthToken($sSpecAuthToken); - \RainLoop\Utils::SetCookie(self::AUTH_SPEC_TOKEN_KEY, $sSpecAuthToken, 0); - - if ($oAccount->SignMe() && 0 < \strlen($oAccount->SignMeToken())) - { - \RainLoop\Utils::SetCookie(self::AUTH_SIGN_ME_TOKEN_KEY, - \RainLoop\Utils::EncodeKeyValuesQ(array( - 'e' => $oAccount->Email(), - 't' => $oAccount->SignMeToken() - )), - \time() + 60 * 60 * 24 * 30); - - $this->StorageProvider()->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'sign_me', - \RainLoop\Utils::EncodeKeyValuesQ(array( - 'Time' => \time(), - 'AuthToken' => $oAccount->GetAuthTokenQ(), - 'SignMetToken' => $oAccount->SignMeToken() - )) - ); - } - } - } - - /** - * @return string - */ - public function GetSpecAuthTokenWithDeletion() - { - $sResult = \RainLoop\Utils::GetCookie(self::AUTH_SPEC_TOKEN_KEY, ''); - if (0 < strlen($sResult)) - { - \RainLoop\Utils::ClearCookie(self::AUTH_SPEC_TOKEN_KEY); - } - - return $sResult; - } - - /** - * @return string - */ - public function GetSpecAuthLogoutTokenWithDeletion() - { - $sResult = \RainLoop\Utils::GetCookie(self::AUTH_SPEC_LOGOUT_TOKEN_KEY, ''); - if (0 < strlen($sResult)) - { - \RainLoop\Utils::ClearCookie(self::AUTH_SPEC_LOGOUT_TOKEN_KEY); - } - - return $sResult; - } - - /** - * @return string - */ - public function GetSpecLogoutCustomMgsWithDeletion() - { - $sResult = \RainLoop\Utils::GetCookie(self::AUTH_SPEC_LOGOUT_CUSTOM_MSG_KEY, ''); - if (0 < strlen($sResult)) - { - \RainLoop\Utils::ClearCookie(self::AUTH_SPEC_LOGOUT_CUSTOM_MSG_KEY); - } - - return $sResult; - } - - /** - * @return string - */ - public function SetSpecLogoutCustomMgsWithDeletion($sMessage) - { - \RainLoop\Utils::SetCookie(self::AUTH_SPEC_LOGOUT_CUSTOM_MSG_KEY, $sMessage, 0); - } - - /** - * @return void - */ - private function setAdminAuthToken($sToken) - { - \RainLoop\Utils::SetCookie(self::AUTH_ADMIN_TOKEN_KEY, $sToken, 0); - } - - /** - * @return string - */ - private function getLocalAuthToken() - { - $sToken = $this->GetSpecAuthToken(); - return !empty($sToken) && '_' === \substr($sToken, 0, 1) ? \substr($sToken, 1) : ''; - } - - /** - * @return string - */ - private function getAdminAuthToken() - { - return \RainLoop\Utils::GetCookie(self::AUTH_ADMIN_TOKEN_KEY, ''); - } - - /** - * @return void - */ - public function ClearAdminAuthToken() - { - $aAdminHash = \RainLoop\Utils::DecodeKeyValuesQ($this->getAdminAuthToken()); - if ( - !empty($aAdminHash[0]) && !empty($aAdminHash[1]) && !empty($aAdminHash[2]) && - 'token' === $aAdminHash[0] && \md5(APP_SALT) === $aAdminHash[1] - ) - { - $this->Cacher(null, true)->Delete(\RainLoop\KeyPathHelper::SessionAdminKey($aAdminHash[2])); - } - - \RainLoop\Utils::ClearCookie(self::AUTH_ADMIN_TOKEN_KEY); - } - - /** - * @param bool $bThrowExceptionOnFalse = false - * - * @return \RainLoop\Model\Account|bool - * @throws \RainLoop\Exceptions\ClientException - */ - public function GetAccount($bThrowExceptionOnFalse = false) - { - return $this->getAccountFromToken($bThrowExceptionOnFalse); - } - - /** - * @return \MailSo\Base\Http - */ - public function Http() - { - if (null === $this->oHttp) - { - $this->oHttp = \MailSo\Base\Http::SingletonInstance(); - } - - return $this->oHttp; - } - - /** - * @return \RainLoop\Social - */ - public function Social() - { - if (null === $this->oSocial) - { - $this->oSocial = new \RainLoop\Social($this->Http(), $this); - } - - return $this->oSocial; - } - - /** - * @return \MailSo\Mail\MailClient - */ - public function MailClient() - { - if (null === $this->oMailClient) - { - $this->oMailClient = \MailSo\Mail\MailClient::NewInstance(); - $this->oMailClient->SetLogger($this->Logger()); - } - - return $this->oMailClient; - } - - /** - * @return \RainLoop\Providers\Filters - */ - public function FiltersProvider() - { - if (null === $this->oFiltersProvider) - { - $this->oFiltersProvider = new \RainLoop\Providers\Filters( - $this->fabrica('filters')); - } - - return $this->oFiltersProvider; - } - - /** - * @return \RainLoop\Providers\ChangePassword - */ - public function ChangePasswordProvider() - { - if (null === $this->oChangePasswordProvider) - { - $this->oChangePasswordProvider = new \RainLoop\Providers\ChangePassword( - $this, $this->fabrica('change-password'), !!$this->Config()->Get('labs', 'check_new_password_strength', true) - ); - } - - return $this->oChangePasswordProvider; - } - - /** - * @return \RainLoop\Providers\TwoFactorAuth - */ - public function TwoFactorAuthProvider() - { - if (null === $this->oTwoFactorAuthProvider) - { - $this->oTwoFactorAuthProvider = new \RainLoop\Providers\TwoFactorAuth( - $this->Config()->Get('security', 'allow_two_factor_auth', false) ? $this->fabrica('two-factor-auth') : null - ); - } - - return $this->oTwoFactorAuthProvider; - } - - /** - * @return \RainLoop\Providers\Prem - */ - public function PremProvider() - { - if (null === $this->oPremProvider) - { - if (\file_exists(APP_VERSION_ROOT_PATH.'app/libraries/RainLoop/Prem/Provider.php')) - { - $this->oPremProvider = new \RainLoop\Prem\Provider( - $this->Config(), $this->Logger(), $this->Cacher(null, true) - ); - } - else - { - $this->oPremProvider = false; - } - } - - return $this->oPremProvider; - } - - /** - * @param bool $bLocal = false - * - * @return \RainLoop\Providers\Storage - */ - public function StorageProvider($bLocal = false) - { - if ($bLocal) - { - if (null === $this->oLocalStorageProvider) - { - $this->oLocalStorageProvider = new \RainLoop\Providers\Storage( - $this->fabrica('storage-local')); - } - - return $this->oLocalStorageProvider; - } - else - { - if (null === $this->oStorageProvider) - { - $this->oStorageProvider = new \RainLoop\Providers\Storage( - $this->fabrica('storage')); - } - - return $this->oStorageProvider; - } - - return null; - } - - /** - * @return \RainLoop\Providers\Settings - */ - public function SettingsProvider($bLocal = false) - { - if ($bLocal) - { - if (null === $this->oLocalSettingsProvider) - { - $this->oLocalSettingsProvider = new \RainLoop\Providers\Settings( - $this->fabrica('settings-local')); - } - - return $this->oLocalSettingsProvider; - } - else - { - if (null === $this->oSettingsProvider) - { - $this->oSettingsProvider = new \RainLoop\Providers\Settings( - $this->fabrica('settings')); - } - - return $this->oSettingsProvider; - } - - return null; - } - - /** - * @return \RainLoop\Providers\Files - */ - public function FilesProvider() - { - if (null === $this->oFilesProvider) - { - $this->oFilesProvider = new \RainLoop\Providers\Files( - $this->fabrica('files')); - } - - return $this->oFilesProvider; - } - - /** - * @return \RainLoop\Providers\Domain - */ - public function DomainProvider() - { - if (null === $this->oDomainProvider) - { - $this->oDomainProvider = new \RainLoop\Providers\Domain( - $this->fabrica('domain'), $this->Plugins()); - } - - return $this->oDomainProvider; - } - - /** - * @return \RainLoop\Providers\Suggestions - */ - public function SuggestionsProvider() - { - if (null === $this->oSuggestionsProvider) - { - $this->oSuggestionsProvider = new \RainLoop\Providers\Suggestions( - $this->fabrica('suggestions')); - } - - return $this->oSuggestionsProvider; - } - - /** - * @param \RainLoop\Model\Account $oAccount = null - * @param bool $bForceEnable = false - * - * @return \RainLoop\Providers\AddressBook - */ - public function AddressBookProvider($oAccount = null, $bForceEnable = false) - { - if (null === $this->oAddressBookProvider) - { - $oDriver = null; - if ($this->GetCapa(false, false, \RainLoop\Enumerations\Capa::CONTACTS, $oAccount)) - { - if ($this->Config()->Get('contacts', 'enable', false) || $bForceEnable) - { - $oDriver = $this->fabrica('address-book', $oAccount); - } - } - - $this->oAddressBookProvider = new \RainLoop\Providers\AddressBook($oDriver); - $this->oAddressBookProvider->SetLogger($this->Logger()); - } - - return $this->oAddressBookProvider; - } - - /** - * @param \RainLoop\Model\Account $oAccount = null - * @param bool $bForceFile = false - * - * @return \MailSo\Cache\CacheClient - */ - public function Cacher($oAccount = null, $bForceFile = false) - { - $sKey = ''; - if ($oAccount) - { - $sKey = $oAccount->ParentEmailHelper(); - } - - $sIndexKey = empty($sKey) ? '_default_' : $sKey; - if ($bForceFile) - { - $sIndexKey .= '/_files_'; - } - - if (!isset($this->aCachers[$sIndexKey])) - { - $this->aCachers[$sIndexKey] = \MailSo\Cache\CacheClient::NewInstance(); - - $oDriver = null; - $sDriver = \strtoupper(\trim($this->Config()->Get('cache', 'fast_cache_driver', 'files'))); - - switch (true) - { - default: - case $bForceFile: - $oDriver = \MailSo\Cache\Drivers\File::NewInstance(APP_PRIVATE_DATA.'cache', $sKey); - break; - - case ('APC' === $sDriver || 'APCU' === $sDriver) && - \MailSo\Base\Utils::FunctionExistsAndEnabled(array( - 'apc_store', 'apc_fetch', 'apc_delete', 'apc_clear_cache')): - - $oDriver = \MailSo\Cache\Drivers\APC::NewInstance($sKey); - break; - - case ('MEMCACHE' === $sDriver || 'MEMCACHED' === $sDriver) && - \MailSo\Base\Utils::FunctionExistsAndEnabled('memcache_connect'): - - $oDriver = \MailSo\Cache\Drivers\Memcache::NewInstance( - $this->Config()->Get('labs', 'fast_cache_memcache_host', '127.0.0.1'), - (int) $this->Config()->Get('labs', 'fast_cache_memcache_port', 11211), - 43200, - $sKey - ); - break; - - case 'REDIS' === $sDriver && \class_exists('Predis\Client'): - $oDriver = \MailSo\Cache\Drivers\Redis::NewInstance( - $this->Config()->Get('labs', 'fast_cache_redis_host', '127.0.0.1'), - (int) $this->Config()->Get('labs', 'fast_cache_redis_port', 6379), - 43200, - $sKey - ); - break; - } - - if ($oDriver) - { - $this->aCachers[$sIndexKey]->SetDriver($oDriver); - } - - $this->aCachers[$sIndexKey]->SetCacheIndex($this->Config()->Get('cache', 'fast_cache_index', '')); - } - - return $this->aCachers[$sIndexKey]; - } - - /** - * @return \RainLoop\Plugins\Manager - */ - public function Plugins() - { - if (null === $this->oPlugins) - { - $this->oPlugins = new \RainLoop\Plugins\Manager($this); - $this->oPlugins->SetLogger($this->Logger()); - } - - return $this->oPlugins; - } - - /** - * @return \MailSo\Log\Logger - */ - public function Logger() - { - if (null === $this->oLogger) - { - $this->oLogger = \MailSo\Log\Logger::SingletonInstance(); - - if (!!$this->Config()->Get('logs', 'enable', false)) - { - $sSessionFilter = (string) $this->Config()->Get('logs', 'session_filter', ''); - if (!empty($sSessionFilter)) - { - $aSessionParts = \explode(':', $sSessionFilter, 2); - - if (empty($aSessionParts[0]) || empty($aSessionParts[1]) || - (string) $aSessionParts[1] !== (string) \RainLoop\Utils::GetCookie($aSessionParts[0], '')) - { - return $this->oLogger; - } - } - - $iTimeOffset = (int) $this->Config()->Get('logs', 'time_offset', 0); - - $this->oLogger->SetShowSecter(!$this->Config()->Get('logs', 'hide_passwords', true)); - - $sLogFileName = $this->Config()->Get('logs', 'filename', ''); - - $oDriver = null; - if ('syslog' === $sLogFileName) - { - $oDriver = \MailSo\Log\Drivers\Syslog::NewInstance(); - } - else - { - $sLogFileFullPath = \APP_PRIVATE_DATA.'logs/'.$this->compileLogFileName($sLogFileName); - $sLogFileDir = \dirname($sLogFileFullPath); - - if (!@is_dir($sLogFileDir)) - { - @mkdir($sLogFileDir, 0755, true); - } - - $oDriver = \MailSo\Log\Drivers\File::NewInstance($sLogFileFullPath); - } - - $this->oLogger->Add($oDriver - ->WriteOnErrorOnly($this->Config()->Get('logs', 'write_on_error_only', false)) - ->WriteOnPhpErrorOnly($this->Config()->Get('logs', 'write_on_php_error_only', false)) - ->WriteOnTimeoutOnly($this->Config()->Get('logs', 'write_on_timeout_only', 0)) - ->SetTimeOffset($iTimeOffset) - ); - - if (!$this->Config()->Get('debug', 'enable', false)) - { - $this->oLogger->AddForbiddenType(\MailSo\Log\Enumerations\Type::TIME); - } - - $this->oLogger->WriteEmptyLine(); - - $oHttp = $this->Http(); - - $this->oLogger->Write('[DATE:'.\MailSo\Log\Logger::DateHelper('d.m.y', $iTimeOffset). - (0 !== $iTimeOffset ? '][OFFSET:'.(0 < $iTimeOffset ? '+' : '-'). - \str_pad((string) \abs($iTimeOffset), 2, '0', STR_PAD_LEFT) : ''). - '][RL:'.APP_VERSION.'][PHP:'.PHP_VERSION.'][IP:'. - $oHttp->GetClientIp($this->Config()->Get('labs', 'http_client_ip_check_proxy', false)).'][PID:'. - (\MailSo\Base\Utils::FunctionExistsAndEnabled('getmypid') ? \getmypid() : 'unknown').']['. - $oHttp->GetServer('SERVER_SOFTWARE', '~').']['. - (\MailSo\Base\Utils::FunctionExistsAndEnabled('php_sapi_name') ? \php_sapi_name() : '~' ).']' - ); - - $sPdo = (\class_exists('PDO') ? \implode(',', \PDO::getAvailableDrivers()) : 'off'); - $sPdo = empty($sPdo) ? '~' : $sPdo; - - $this->oLogger->Write('['. - 'Suhosin:'.(\extension_loaded('suhosin') || @\ini_get('suhosin.get.max_value_length') ? 'on' : 'off'). - '][APC:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('apc_fetch') ? 'on' : 'off'). - '][MB:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('mb_convert_encoding') ? 'on' : 'off'). - '][PDO:'.$sPdo. - (\RainLoop\Utils::IsOwnCloud() ? '][ownCloud:true' : ''). - '][Streams:'.\implode(',', \stream_get_transports()). - ']'); - - $this->oLogger->Write( - '['.$oHttp->GetMethod().'] '.$oHttp->GetScheme().'://'.$oHttp->GetHost(false, false).$oHttp->GetServer('REQUEST_URI', ''), - \MailSo\Log\Enumerations\Type::NOTE, 'REQUEST'); - } - } - - return $this->oLogger; - } - - /** - * @return \MailSo\Log\Logger - */ - public function LoggerAuth() - { - if (null === $this->oLoggerAuth) - { - $this->oLoggerAuth = \MailSo\Log\Logger::NewInstance(false); - - if (!!$this->Config()->Get('logs', 'auth_logging', false)) - { - $sAuthLogFileFullPath = \APP_PRIVATE_DATA.'logs/'.$this->compileLogFileName( - $this->Config()->Get('logs', 'auth_logging_filename', '')); - - $sLogFileDir = \dirname($sAuthLogFileFullPath); - - if (!@is_dir($sLogFileDir)) - { - @mkdir($sLogFileDir, 0755, true); - } - - $this->oLoggerAuth->AddForbiddenType(\MailSo\Log\Enumerations\Type::MEMORY); - $this->oLoggerAuth->AddForbiddenType(\MailSo\Log\Enumerations\Type::TIME); - $this->oLoggerAuth->AddForbiddenType(\MailSo\Log\Enumerations\Type::TIME_DELTA); - - $oDriver = \MailSo\Log\Drivers\File::NewInstance($sAuthLogFileFullPath); - - $oDriver->DisableTimePrefix(); - $oDriver->DisableGuidPrefix(); - $oDriver->DisableTypedPrefix(); - - $this->oLoggerAuth->Add($oDriver); - } - } - - return $this->oLoggerAuth; - } - - /** - * @param \RainLoop\Model\Account $oAccount = null - * @param array $aAdditionalParams = array() - */ - public function LoggerAuthHelper($oAccount = null, $aAdditionalParams = array()) - { - $sLine = $this->Config()->Get('logs', 'auth_logging_format', ''); - if (!empty($sLine)) - { - $this->LoggerAuth()->Write($this->compileLogParams($sLine, $oAccount, false, $aAdditionalParams)); - } - } - - /** - * @return string - */ - private function getAdminToken() - { - $sRand = \MailSo\Base\Utils::Md5Rand(); - if (!$this->Cacher(null, true)->Set(\RainLoop\KeyPathHelper::SessionAdminKey($sRand), \time())) - { - $this->oLogger->Write('Cannot store an admin token', - \MailSo\Log\Enumerations\Type::WARNING); - - $sRand = ''; - } - - return '' === $sRand ? '' : \RainLoop\Utils::EncodeKeyValuesQ(array('token', \md5(APP_SALT), $sRand)); - } - - /** - * @param bool $bThrowExceptionOnFalse = true - * - * @return bool - */ - public function IsAdminLoggined($bThrowExceptionOnFalse = true) - { - $bResult = false; - if ($this->Config()->Get('security', 'allow_admin_panel', true)) - { - $aAdminHash = \RainLoop\Utils::DecodeKeyValuesQ($this->getAdminAuthToken()); - if (!empty($aAdminHash[0]) && !empty($aAdminHash[1]) && !empty($aAdminHash[2]) && - 'token' === $aAdminHash[0] && \md5(APP_SALT) === $aAdminHash[1] && - '' !== $this->Cacher(null, true)->Get(\RainLoop\KeyPathHelper::SessionAdminKey($aAdminHash[2]), '') - ) - { - $bResult = true; - } - } - - if (!$bResult && $bThrowExceptionOnFalse) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); - } - - return $bResult; - } - - /** - * @param string $sTo - */ - public function SetMailtoRequest($sTo) - { - if (!empty($sTo)) - { - \RainLoop\Utils::SetCookie(self::AUTH_MAILTO_TOKEN_KEY, - \RainLoop\Utils::EncodeKeyValuesQ(array( - 'Time' => \microtime(true), - 'MailTo' => 'MailTo', - 'To' => $sTo - )), 0); - } - } - - /** - * @param string $sEmail - * @param string $sLogin - * @param string $sPassword - * @param string $sSignMeToken = '' - * @param bool $bThrowProvideException = false - * - * @return \RainLoop\Model\Account|null - */ - public function LoginProvide($sEmail, $sLogin, $sPassword, $sSignMeToken = '', $bThrowProvideException = false) - { - $oAccount = null; - if (0 < \strlen($sEmail) && 0 < \strlen($sLogin) && 0 < \strlen($sPassword)) - { - $oDomain = $this->DomainProvider()->Load(\MailSo\Base\Utils::GetDomainFromEmail($sEmail), true); - if ($oDomain instanceof \RainLoop\Model\Domain) - { - if ($oDomain->ValidateWhiteList($sEmail, $sLogin)) - { - $oAccount = \RainLoop\Model\Account::NewInstance($sEmail, $sLogin, $sPassword, $oDomain, $sSignMeToken); - $this->Plugins()->RunHook('filter.acount', array(&$oAccount)); - - if ($bThrowProvideException && !($oAccount instanceof \RainLoop\Model\Account)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); - } - } - else if ($bThrowProvideException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountNotAllowed); - } - } - else if ($bThrowProvideException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::DomainNotAllowed); - } - } - - return $oAccount; - } - - /** - * @param string $sToken - * @param bool $bThrowExceptionOnFalse = true - * @param bool $bValidateShortToken = true - * @param bool $bQ = false - * - * @return \RainLoop\Model\Account|bool - * @throws \RainLoop\Exceptions\ClientException - */ - public function GetAccountFromCustomToken($sToken, $bThrowExceptionOnFalse = true, $bValidateShortToken = true, $bQ = false) - { - $oResult = false; - if (!empty($sToken)) - { - $aAccountHash = $bQ ? \RainLoop\Utils::DecodeKeyValuesQ($sToken) : \RainLoop\Utils::DecodeKeyValues($sToken); - if (!empty($aAccountHash[0]) && 'token' === $aAccountHash[0] && // simple token validation - 8 <= \count($aAccountHash) && // length checking - !empty($aAccountHash[7]) && // does short token exist - (!$bValidateShortToken || \RainLoop\Utils::GetShortToken() === $aAccountHash[7] || // check short token if needed - (isset($aAccountHash[10]) && 0 < $aAccountHash[10] && \time() < $aAccountHash[10])) - ) - { - $oAccount = $this->LoginProvide($aAccountHash[1], $aAccountHash[2], $aAccountHash[3], - empty($aAccountHash[5]) ? '' : $aAccountHash[5], $bThrowExceptionOnFalse); - - if ($oAccount instanceof \RainLoop\Model\Account) - { - if (!empty($aAccountHash[8]) && !empty($aAccountHash[9])) // init proxy user/password - { - $oAccount->SetProxyAuthUser($aAccountHash[8]); - $oAccount->SetProxyAuthPassword($aAccountHash[9]); - } - - $this->Logger()->AddSecret($oAccount->Password()); - $this->Logger()->AddSecret($oAccount->ProxyAuthPassword()); - - $oAccount->SetParentEmail($aAccountHash[6]); - $oResult = $oAccount; - } - } - else if ($bThrowExceptionOnFalse) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); - } - } - - if ($bThrowExceptionOnFalse && !($oResult instanceof \RainLoop\Model\Account)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); - } - - return $oResult; - } - - /** - * @return \RainLoop\Model\Account|bool - */ - public function GetAccountFromSignMeToken() - { - $oAccount = false; - - $sSignMeToken = \RainLoop\Utils::GetCookie(\RainLoop\Actions::AUTH_SIGN_ME_TOKEN_KEY, ''); - if (!empty($sSignMeToken)) - { - $aTokenData = \RainLoop\Utils::DecodeKeyValuesQ($sSignMeToken); - if (\is_array($aTokenData) && !empty($aTokenData['e']) && !empty($aTokenData['t'])) - { - $sTokenSettings = $this->StorageProvider()->Get($aTokenData['e'], - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'sign_me' - ); - - if (!empty($sTokenSettings)) - { - $aSignMeData = \RainLoop\Utils::DecodeKeyValuesQ($sTokenSettings); - if (\is_array($aSignMeData) && - !empty($aSignMeData['AuthToken']) && - !empty($aSignMeData['SignMetToken']) && - $aSignMeData['SignMetToken'] === $aTokenData['t']) - { - $oAccount = $this->GetAccountFromCustomToken($aSignMeData['AuthToken'], false, false, true); - } - } - } - } - else - { - \RainLoop\Utils::ClearCookie(\RainLoop\Actions::AUTH_SIGN_ME_TOKEN_KEY); - } - - return $oAccount; - } - - /** - * @param bool $bThrowExceptionOnFalse = true - * - * @return \RainLoop\Model\Account|bool - * @throws \RainLoop\Exceptions\ClientException - */ - public function getAccountFromToken($bThrowExceptionOnFalse = true) - { - return $this->GetAccountFromCustomToken($this->getLocalAuthToken(), $bThrowExceptionOnFalse, true, true); - } - - /** - * @return bool - */ - public function IsOpen() - { - return !$this->PremProvider(); - } - - /** - * @param bool $bAdmin = false - * @param bool $bMobile = false - * @param bool $bMobileDevice = false - * - * @return array - */ - public function AppDataSystem($bAdmin = false, $bMobile = false, $bMobileDevice = false) - { - $oConfig = $this->Config(); - - $sRsaPublicKey = ''; - if ($oConfig->Get('security', 'use_rsa_encryption', false) && - \file_exists(APP_PRIVATE_DATA.'rsa/public') && \file_exists(APP_PRIVATE_DATA.'rsa/private')) - { - $sRsaPublicKey = @\file_get_contents(APP_PRIVATE_DATA.'rsa/public') || ''; - if (false === \strpos($sRsaPublicKey, 'PUBLIC KEY')) - { - $sRsaPublicKey = ''; - } - } - - $aAttachmentsActions = array(); - if ($this->GetCapa(false, $bMobile, \RainLoop\Enumerations\Capa::ATTACHMENTS_ACTIONS)) - { - if (!!\class_exists('ZipArchive')) - { - $aAttachmentsActions[] = 'zip'; - } - - if (\RainLoop\Utils::IsOwnCloudLoggedIn() && \class_exists('OCP\Files')) - { - $aAttachmentsActions[] = 'owncloud'; - } - - if ($oConfig->Get('social', 'dropbox_enable', false) && 0 < \strlen(\trim($oConfig->Get('social', 'dropbox_api_key', '')))) - { - $aAttachmentsActions[] = 'dropbox'; - } - } - - return \array_merge(array( - 'version' => APP_VERSION, - 'mobile' => $bMobile, - 'mobileDevice' => $bMobileDevice, - 'webPath' => \RainLoop\Utils::WebPath(), - 'webVersionPath' => \RainLoop\Utils::WebVersionPath(), - 'token' => $oConfig->Get('security', 'csrf_protection', false) ? \RainLoop\Utils::GetCsrfToken() : '', - 'inIframe' => (bool) $oConfig->Get('labs', 'in_iframe', false), - 'allowHtmlEditorSourceButton' => (bool) $oConfig->Get('labs', 'allow_html_editor_source_button', false), - 'allowHtmlEditorBitiButtons' => (bool) $oConfig->Get('labs', 'allow_html_editor_biti_buttons', false), - 'allowCtrlEnterOnCompose' => (bool) $oConfig->Get('labs', 'allow_ctrl_enter_on_compose', false), - 'customLoginLink' => $oConfig->Get('labs', 'custom_login_link', ''), - 'customLogoutLink' => $oConfig->Get('labs', 'custom_logout_link', ''), - 'forgotPasswordLinkUrl' => \trim($oConfig->Get('login', 'forgot_password_link_url', '')), - 'registrationLinkUrl' => \trim($oConfig->Get('login', 'registration_link_url', '')), - 'jsHash' => \md5(\RainLoop\Utils::GetConnectionToken()), - 'useImapThread' => (bool) $oConfig->Get('labs', 'use_imap_thread', false), - 'useImapSubscribe' => (bool) $oConfig->Get('labs', 'use_imap_list_subscribe', true), - 'allowAppendMessage' => (bool) $oConfig->Get('labs', 'allow_message_append', false), - 'materialDesign' => (bool) $oConfig->Get('labs', 'use_material_design', true), - 'folderSpecLimit' => (int) $oConfig->Get('labs', 'folders_spec_limit', 50), - 'faviconStatus' => (bool) $oConfig->Get('labs', 'favicon_status', true), - 'useNativeScrollbars' => (bool) $oConfig->Get('interface', 'use_native_scrollbars', false), - 'listPermanentFiltered' => '' !== \trim(\RainLoop\Api::Config()->Get('labs', 'imap_message_list_permanent_filter', '')), - 'themes' => $this->GetThemes($bMobile, false), - 'languages' => $this->GetLanguages(false), - 'languagesAdmin' => $this->GetLanguages(true), - 'attachmentsActions' => $aAttachmentsActions, - 'rsaPublicKey' => $sRsaPublicKey, - 'openpgpPublicKeyServer' => $oConfig->Get('security', 'openpgp_public_key_server', '') - ), $bAdmin ? array( - 'adminHostUse' => '' !== $oConfig->Get('security', 'admin_panel_host', ''), - 'adminPath' => \strtolower($oConfig->Get('security', 'admin_panel_key', 'admin')), - 'allowAdminPanel' => (bool) $oConfig->Get('security', 'allow_admin_panel', true), - ) : array()); - } - - /** - * @param bool $bAdmin - * @param bool $bMobile = false - * @param string $sAuthAccountHash = '' - * - * @return array - */ - public function AppData($bAdmin, $bMobile = false, $bMobileDevice = false, $sAuthAccountHash = '') - { - if (0 < \strlen($sAuthAccountHash) && \preg_match('/[^_\-\.a-zA-Z0-9]/', $sAuthAccountHash)) - { - $sAuthAccountHash = ''; - } - - $oAccount = null; - $oConfig = $this->Config(); - -/* -required by Index.html and rl.js: -NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBackground PluginsLink AuthAccountHash -*/ - - $aResult = array( - 'Auth' => false, - 'AccountHash' => '', - 'AccountSignMe' => false, - 'AuthAccountHash' => '', - 'MailToEmail' => '', - 'Email' => '', - 'DevEmail' => '', - 'DevPassword' => '', - 'Title' => $oConfig->Get('webmail', 'title', 'RainLoop Webmail'), - 'LoadingDescription' => $oConfig->Get('webmail', 'loading_description', 'RainLoop'), - 'LoadingDescriptionEsc' => 'RainLoop', - 'FaviconUrl' => $oConfig->Get('webmail', 'favicon_url', ''), - 'LoginDescription' => '', - 'LoginPowered' => true, - 'LoginLogo' => '', - 'LoginBackground' => '', - 'LoginCss' => '', - 'UserLogo' => '', - 'UserLogoTitle' => '', - 'UserLogoMessage' => '', - 'UserCss' => '', - 'WelcomePageUrl' => '', - 'WelcomePageDisplay' => 'none', - 'IncludeCss' => '', - 'IncludeBackground' => '', - 'LoginDefaultDomain' => $oConfig->Get('login', 'default_domain', ''), - 'DetermineUserLanguage' => (bool) $oConfig->Get('login', 'determine_user_language', true), - 'DetermineUserDomain' => (bool) $oConfig->Get('login', 'determine_user_domain', false), - 'UseLoginWelcomePage' => (bool) $oConfig->Get('login', 'welcome_page', false), - 'StartupUrl' => \trim(\ltrim(\trim($oConfig->Get('labs', 'startup_url', '')), '#/')), - 'ContactsIsAllowed' => false, - 'ChangePasswordIsAllowed' => false, - 'RequireTwoFactor' => false, - 'Community' => true, - 'PremType' => false, - 'Admin' => array(), - 'Capa' => array(), - 'Plugins' => array(), - 'System' => $this->AppDataSystem($bAdmin, $bMobile, $bMobileDevice) - ); - - if (0 < \strlen($sAuthAccountHash)) - { - $aResult['AuthAccountHash'] = $sAuthAccountHash; - } - - $oPremProvider = $this->PremProvider(); - if ($oPremProvider) - { - $oPremProvider->PopulateAppData($aResult); - } - - if ('' !== $aResult['LoadingDescription'] && 'RainLoop' !== $aResult['LoadingDescription']) - { - $aResult['LoadingDescriptionEsc'] = @\htmlspecialchars($aResult['LoadingDescription'], ENT_QUOTES|ENT_IGNORE, 'UTF-8'); - } - - $oSettings = null; - - if (!$bAdmin) - { - $oAccount = $this->getAccountFromToken(false); - if ($oAccount instanceof \RainLoop\Model\Account) - { - $aResult['IncludeCss'] = $aResult['UserCss']; - - $oAddressBookProvider = $this->AddressBookProvider($oAccount); - - $aResult['Auth'] = true; - $aResult['Email'] = $oAccount->Email(); - $aResult['IncLogin'] = $oAccount->IncLogin(); - $aResult['OutLogin'] = $oAccount->OutLogin(); - $aResult['AccountHash'] = $oAccount->Hash(); - $aResult['AccountSignMe'] = $oAccount->SignMe(); - $aResult['ChangePasswordIsAllowed'] = $this->ChangePasswordProvider()->PasswordChangePossibility($oAccount); - $aResult['ContactsIsAllowed'] = $oAddressBookProvider->IsActive(); - $aResult['ContactsSharingIsAllowed'] = $oAddressBookProvider->IsSharingAllowed(); - $aResult['ContactsSyncIsAllowed'] = (bool) $oConfig->Get('contacts', 'allow_sync', false); - $aResult['ContactsSyncInterval'] = (int) $oConfig->Get('contacts', 'sync_interval', 20); - - $aResult['EnableContactsSync'] = false; - $aResult['ContactsSyncUrl'] = ''; - $aResult['ContactsSyncUser'] = ''; - $aResult['ContactsSyncPassword'] = ''; - - if ($aResult['ContactsIsAllowed'] && $aResult['ContactsSyncIsAllowed']) - { - $mData = $this->getContactsSyncData($oAccount); - if (\is_array($mData)) - { - $aResult['EnableContactsSync'] = isset($mData['Enable']) ? !!$mData['Enable'] : false; - $aResult['ContactsSyncUrl'] = isset($mData['Url']) ? \trim($mData['Url']) : ''; - $aResult['ContactsSyncUser'] = isset($mData['User']) ? \trim($mData['User']) : ''; - $aResult['ContactsSyncPassword'] = APP_DUMMY; - } - } - - if ($aResult['AccountSignMe']) - { - $sToken = \RainLoop\Utils::GetCookie(self::AUTH_MAILTO_TOKEN_KEY, null); - if (null !== $sToken) - { - \RainLoop\Utils::ClearCookie(self::AUTH_MAILTO_TOKEN_KEY); - - $mMailToData = \RainLoop\Utils::DecodeKeyValuesQ($sToken); - if (\is_array($mMailToData) && !empty($mMailToData['MailTo']) && - 'MailTo' === $mMailToData['MailTo'] && !empty($mMailToData['To'])) - { - $aResult['MailToEmail'] = $mMailToData['To']; - } - } - } - - $oSettings = $this->SettingsProvider()->Load($oAccount); - - if (!$oAccount->IsAdditionalAccount() && !empty($aResult['WelcomePageUrl']) && - ('once' === $aResult['WelcomePageDisplay'] || 'always' === $aResult['WelcomePageDisplay'])) - { - if ('once' === $aResult['WelcomePageDisplay']) - { - if ($aResult['WelcomePageUrl'] === $oSettings->GetConf('LastWelcomePage', '')) - { - $aResult['WelcomePageUrl'] = ''; - $aResult['WelcomePageDisplay'] = ''; - } - } - } - else - { - $aResult['WelcomePageUrl'] = ''; - $aResult['WelcomePageDisplay'] = ''; - } - - if (!empty($aResult['StartupUrl'])) - { - $aResult['StartupUrl'] = $this->compileLogParams($aResult['StartupUrl'], $oAccount, true); - } - - if (!empty($aResult['UserIframeMessage'])) - { - $aResult['UserIframeMessage'] = $this->compileLogParams($aResult['UserIframeMessage'], $oAccount, true); - } - } - else - { - $oAccount = null; - - $aResult['IncludeBackground'] = $aResult['LoginBackground']; - $aResult['IncludeCss'] = $aResult['LoginCss']; - - $aResult['DevEmail'] = $oConfig->Get('labs', 'dev_email', ''); - $aResult['DevPassword'] = $oConfig->Get('labs', 'dev_password', ''); - - $aResult['WelcomePageUrl'] = ''; - $aResult['WelcomePageDisplay'] = ''; - - $aResult['StartupUrl'] = ''; - - if (empty($aResult['AdditionalLoginError'])) - { - $aResult['AdditionalLoginError'] = $this->GetSpecLogoutCustomMgsWithDeletion(); - } - } - - $aResult['AllowGoogleSocial'] = (bool) $oConfig->Get('social', 'google_enable', false); - $aResult['AllowGoogleSocialAuth'] = (bool) $oConfig->Get('social', 'google_enable_auth', true); - $aResult['AllowGoogleSocialAuthFast'] = (bool) $oConfig->Get('social', 'google_enable_auth_fast', true); - $aResult['AllowGoogleSocialDrive'] = (bool) $oConfig->Get('social', 'google_enable_drive', true); - $aResult['AllowGoogleSocialPreview'] = (bool) $oConfig->Get('social', 'google_enable_preview', true); - - $aResult['GoogleClientID'] = \trim($oConfig->Get('social', 'google_client_id', '')); - $aResult['GoogleApiKey'] = \trim($oConfig->Get('social', 'google_api_key', '')); - - if (!$aResult['AllowGoogleSocial'] || ($aResult['AllowGoogleSocial'] && ( - '' === \trim($oConfig->Get('social', 'google_client_id', '')) || '' === \trim($oConfig->Get('social', 'google_client_secret', ''))))) - { - $aResult['AllowGoogleSocialAuth'] = false; - $aResult['AllowGoogleSocialAuthFast'] = false; - $aResult['AllowGoogleSocialDrive'] = false; - $aResult['GoogleClientID'] = ''; - $aResult['GoogleApiKey'] = ''; - } - - if (!$aResult['AllowGoogleSocial']) - { - $aResult['AllowGoogleSocialPreview'] = false; - } - - if ($aResult['AllowGoogleSocial'] && - !$aResult['AllowGoogleSocialAuth'] && !$aResult['AllowGoogleSocialAuthFast'] && - !$aResult['AllowGoogleSocialDrive'] && !$aResult['AllowGoogleSocialPreview']) - { - $aResult['AllowGoogleSocial'] = false; - } - - $aResult['AllowFacebookSocial'] = (bool) $oConfig->Get('social', 'fb_enable', false); - if ($aResult['AllowFacebookSocial'] && ( - '' === \trim($oConfig->Get('social', 'fb_app_id', '')) || '' === \trim($oConfig->Get('social', 'fb_app_secret', '')))) - { - $aResult['AllowFacebookSocial'] = false; - } - - $aResult['AllowTwitterSocial'] = (bool) $oConfig->Get('social', 'twitter_enable', false); - if ($aResult['AllowTwitterSocial'] && ( - '' === \trim($oConfig->Get('social', 'twitter_consumer_key', '')) || '' === \trim($oConfig->Get('social', 'twitter_consumer_secret', '')))) - { - $aResult['AllowTwitterSocial'] = false; - } - - $aResult['AllowDropboxSocial'] = (bool) $oConfig->Get('social', 'dropbox_enable', false); - $aResult['DropboxApiKey'] = \trim($oConfig->Get('social', 'dropbox_api_key', '')); - - if (!$aResult['AllowDropboxSocial']) - { - $aResult['DropboxApiKey'] = ''; - } - else if (0 === strlen($aResult['DropboxApiKey'])) - { - $aResult['AllowDropboxSocial'] = false; - } - - $aResult['Capa'] = $this->Capa(false, $bMobile, $oAccount); - - if ($aResult['Auth'] && !$aResult['RequireTwoFactor']) - { - if ($this->GetCapa(false, $bMobile, \RainLoop\Enumerations\Capa::TWO_FACTOR, $oAccount) && - $this->GetCapa(false, $bMobile, \RainLoop\Enumerations\Capa::TWO_FACTOR_FORCE, $oAccount) && - $this->TwoFactorAuthProvider()->IsActive()) - { - $aData = $this->getTwoFactorInfo($oAccount, true); - - $aResult['RequireTwoFactor'] = !$aData || - !isset($aData['User'], $aData['IsSet'], $aData['Enable']) || - !($aData['IsSet'] && $aData['Enable']); - } - } - } - else - { - $aResult['Auth'] = $this->IsAdminLoggined(false); - if ($aResult['Auth']) - { - $aResult['AdminDomain'] = APP_SITE; - $aResult['AdminLogin'] = (string) $oConfig->Get('security', 'admin_login', ''); - $aResult['UseTokenProtection'] = (bool) $oConfig->Get('security', 'csrf_protection', true); - $aResult['EnabledPlugins'] = (bool) $oConfig->Get('plugins', 'enable', false); - - $aResult['VerifySslCertificate'] = (bool) $oConfig->Get('ssl', 'verify_certificate', false); - $aResult['AllowSelfSigned'] = (bool) $oConfig->Get('ssl', 'allow_self_signed', true); - - $aDrivers = \class_exists('PDO') ? \PDO::getAvailableDrivers() : null; - $aResult['MySqlIsSupported'] = \is_array($aDrivers) ? \in_array('mysql', $aDrivers) : false; - $aResult['SQLiteIsSupported'] = \is_array($aDrivers) ? \in_array('sqlite', $aDrivers) : false; - $aResult['PostgreSqlIsSupported'] = \is_array($aDrivers) ? \in_array('pgsql', $aDrivers) : false; - - $aResult['ContactsEnable'] = (bool) $oConfig->Get('contacts', 'enable', false); - $aResult['ContactsSharing'] = (bool) $oConfig->Get('contacts', 'allow_sharing', false); - $aResult['ContactsSync'] = (bool) $oConfig->Get('contacts', 'allow_sync', false); - $aResult['ContactsPdoType'] = (string) $this->ValidateContactPdoType(\trim($this->Config()->Get('contacts', 'type', 'sqlite'))); - $aResult['ContactsPdoDsn'] = (string) $oConfig->Get('contacts', 'pdo_dsn', ''); - $aResult['ContactsPdoType'] = (string) $oConfig->Get('contacts', 'type', ''); - $aResult['ContactsPdoUser'] = (string) $oConfig->Get('contacts', 'pdo_user', ''); - $aResult['ContactsPdoPassword'] = (string) APP_DUMMY; - - $aResult['AllowGoogleSocial'] = (bool) $oConfig->Get('social', 'google_enable', false); - $aResult['AllowGoogleSocialAuth'] = (bool) $oConfig->Get('social', 'google_enable_auth', true); - $aResult['AllowGoogleSocialAuthFast'] = (bool) $oConfig->Get('social', 'google_enable_auth_fast', true); - $aResult['AllowGoogleSocialDrive'] = (bool) $oConfig->Get('social', 'google_enable_drive', true); - $aResult['AllowGoogleSocialPreview'] = (bool) $oConfig->Get('social', 'google_enable_preview', true); - - $aResult['GoogleClientID'] = (string) $oConfig->Get('social', 'google_client_id', ''); - $aResult['GoogleClientSecret'] = (string) $oConfig->Get('social', 'google_client_secret', ''); - $aResult['GoogleApiKey'] = (string) $oConfig->Get('social', 'google_api_key', ''); - - $aResult['AllowFacebookSocial'] = (bool) $oConfig->Get('social', 'fb_enable', false); - $aResult['FacebookAppID'] = (string) $oConfig->Get('social', 'fb_app_id', ''); - $aResult['FacebookAppSecret'] = (string) $oConfig->Get('social', 'fb_app_secret', ''); - - $aResult['AllowTwitterSocial'] = (bool) $oConfig->Get('social', 'twitter_enable', false); - $aResult['TwitterConsumerKey'] = (string) $oConfig->Get('social', 'twitter_consumer_key', ''); - $aResult['TwitterConsumerSecret'] = (string) $oConfig->Get('social', 'twitter_consumer_secret', ''); - - $aResult['AllowDropboxSocial'] = (bool) $oConfig->Get('social', 'dropbox_enable', false); - $aResult['DropboxApiKey'] = (string) $oConfig->Get('social', 'dropbox_api_key', ''); - - $aResult['SubscriptionEnabled'] = (bool) \MailSo\Base\Utils::ValidateDomain($aResult['AdminDomain']); -// || \MailSo\Base\Utils::ValidateIP($aResult['AdminDomain']); - - $aResult['WeakPassword'] = (bool) $oConfig->ValidatePassword('12345'); - $aResult['CoreAccess'] = (bool) $this->rainLoopCoreAccess(); - - $aResult['PhpUploadSizes'] = array( - 'upload_max_filesize' => \ini_get('upload_max_filesize'), - 'post_max_size' => \ini_get('post_max_size') - ); - } - - $aResult['Capa'] = $this->Capa(true, $bMobile); - } - - $aResult['SupportedFacebookSocial'] = (bool) \version_compare(PHP_VERSION, '5.4.0', '>='); - if (!$aResult['SupportedFacebookSocial']) - { - $aResult['AllowFacebookSocial'] = false; - $aResult['FacebookAppID'] = ''; - $aResult['FacebookAppSecret'] = ''; - } - - $aResult['ProjectHash'] = \md5($aResult['AccountHash'].APP_VERSION.$this->Plugins()->Hash()); - - $sLanguage = $oConfig->Get('webmail', 'language', 'en'); - $sLanguageAdmin = $oConfig->Get('webmail', 'language_admin', 'en'); - $sTheme = $oConfig->Get('webmail', 'theme', 'Default'); - - $aResult['AllowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', true); - $aResult['AllowLanguagesOnLogin'] = (bool) $oConfig->Get('login', 'allow_languages_on_login', true); - $aResult['AttachmentLimit'] = ((int) $oConfig->Get('webmail', 'attachment_size_limit', 10)) * 1024 * 1024; - $aResult['SignMe'] = (string) $oConfig->Get('login', 'sign_me_auto', \RainLoop\Enumerations\SignMeType::DEFAILT_OFF); - $aResult['UseLocalProxyForExternalImages'] = (bool) $oConfig->Get('labs', 'use_local_proxy_for_external_images', false); - - // user - $aResult['ShowImages'] = (bool) $oConfig->Get('defaults', 'show_images', false); - $aResult['MPP'] = (int) $oConfig->Get('webmail', 'messages_per_page', 25); - $aResult['SoundNotification'] = false; - $aResult['DesktopNotifications'] = false; - $aResult['Layout'] = (int) $oConfig->Get('defaults', 'view_layout', \RainLoop\Enumerations\Layout::SIDE_PREVIEW); - $aResult['EditorDefaultType'] = (string) $oConfig->Get('defaults', 'view_editor_type', ''); - $aResult['UseCheckboxesInList'] = (bool) $oConfig->Get('defaults', 'view_use_checkboxes', true); - $aResult['AutoLogout'] = (int) $oConfig->Get('defaults', 'autologout', 30); - $aResult['UseThreads'] = (bool) $oConfig->Get('defaults', 'mail_use_threads', false); - $aResult['ReplySameFolder'] = (bool) $oConfig->Get('defaults', 'mail_reply_same_folder', false); - $aResult['ContactsAutosave'] = (bool) $oConfig->Get('defaults', 'contacts_autosave', true); - $aResult['EnableTwoFactor'] = false; - $aResult['ParentEmail'] = ''; - $aResult['InterfaceAnimation'] = true; - $aResult['UserBackgroundName'] = ''; - $aResult['UserBackgroundHash'] = ''; - - if (!$bAdmin && $oAccount instanceof \RainLoop\Model\Account) - { - $aResult['ParentEmail'] = $oAccount->ParentEmail(); - - $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); - - if ($oSettingsLocal instanceof \RainLoop\Settings) - { -// if ($this->GetCapa(false, $bMobile, \RainLoop\Enumerations\Capa::FOLDERS, $oAccount)) - - $aResult['SentFolder'] = (string) $oSettingsLocal->GetConf('SentFolder', ''); - $aResult['DraftFolder'] = (string) $oSettingsLocal->GetConf('DraftFolder', ''); - $aResult['SpamFolder'] = (string) $oSettingsLocal->GetConf('SpamFolder', ''); - $aResult['TrashFolder'] = (string) $oSettingsLocal->GetConf('TrashFolder', ''); - $aResult['ArchiveFolder'] = (string) $oSettingsLocal->GetConf('ArchiveFolder', ''); - $aResult['NullFolder'] = (string) $oSettingsLocal->GetConf('NullFolder', ''); - } - - if ($this->GetCapa(false, $bMobile, \RainLoop\Enumerations\Capa::SETTINGS, $oAccount)) - { - if ($oSettings instanceof \RainLoop\Settings) - { - if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) - { - $sLanguage = (string) $oSettings->GetConf('Language', $sLanguage); - } - - $aResult['EditorDefaultType'] = (string) $oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']); - $aResult['ShowImages'] = (bool) $oSettings->GetConf('ShowImages', $aResult['ShowImages']); - $aResult['ContactsAutosave'] = (bool) $oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']); - $aResult['MPP'] = (int) $oSettings->GetConf('MPP', $aResult['MPP']); - $aResult['SoundNotification'] = (bool) $oSettings->GetConf('SoundNotification', $aResult['SoundNotification']); - $aResult['DesktopNotifications'] = (bool) $oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']); - $aResult['UseCheckboxesInList'] = (bool) $oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']); - $aResult['AutoLogout'] = (int) $oSettings->GetConf('AutoLogout', $aResult['AutoLogout']); - $aResult['Layout'] = (int) $oSettings->GetConf('Layout', $aResult['Layout']); - - if (!$this->GetCapa(false, $bMobile, \RainLoop\Enumerations\Capa::AUTOLOGOUT, $oAccount)) - { - $aResult['AutoLogout'] = 0; - } - - if ($this->GetCapa(false, $bMobile, \RainLoop\Enumerations\Capa::USER_BACKGROUND, $oAccount)) - { - $aResult['UserBackgroundName'] = (string) $oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); - $aResult['UserBackgroundHash'] = (string) $oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']); -// if (!empty($aResult['UserBackgroundName']) && !empty($aResult['UserBackgroundHash'])) -// { -// $aResult['IncludeBackground'] = './?/Raw/&q[]=/{{USER}}/UserBackground/&q[]=/'. -// $aResult['UserBackgroundHash'].'/'; -// } - } - - $aResult['EnableTwoFactor'] = (bool) $oSettings->GetConf('EnableTwoFactor', $aResult['EnableTwoFactor']); - } - - if ($oSettingsLocal instanceof \RainLoop\Settings) - { - $aResult['UseThreads'] = (bool) $oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']); - $aResult['ReplySameFolder'] = (bool) $oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']); - - if ($this->GetCapa(false, $bMobile, \RainLoop\Enumerations\Capa::THEMES, $oAccount)) - { - $sTheme = (string) $oSettingsLocal->GetConf('Theme', $sTheme); - } - } - } - } - - if (!$aResult['Auth']) - { - if (!$bAdmin) - { - if ($oConfig->Get('login', 'allow_languages_on_login', true) && - $oConfig->Get('login', 'determine_user_language', true)) - { - $sLanguage = $this->ValidateLanguage( - $this->detectUserLanguage($bAdmin), $sLanguage, false); - } - } - } - - $sTheme = $this->ValidateTheme($sTheme, $bMobile); - $sStaticCache = $this->StaticCache(); - - $aResult['Theme'] = $sTheme; - $aResult['NewThemeLink'] = $this->ThemeLink($sTheme, $bAdmin); - - $aResult['Language'] = $this->ValidateLanguage($sLanguage, '', false); - $aResult['LanguageAdmin'] = $this->ValidateLanguage($sLanguageAdmin, '', true); - - $aResult['UserLanguageRaw'] = $this->detectUserLanguage($bAdmin); - - $aResult['UserLanguage'] = $this->ValidateLanguage($aResult['UserLanguageRaw'], '', false, true); - $aResult['UserLanguageAdmin'] = $this->ValidateLanguage($aResult['UserLanguageRaw'], '', true, true); - - $aResult['PluginsLink'] = ''; - if (0 < $this->Plugins()->Count() && $this->Plugins()->HaveJs($bAdmin)) - { - $aResult['PluginsLink'] = './?/Plugins/0/'.($bAdmin ? 'Admin' : 'User').'/'.$sStaticCache.'/'; - } - - $aResult['LangLink'] = './?/Lang/0/'.($bAdmin ? 'Admin' : 'App').'/'. - ($bAdmin ? $aResult['LanguageAdmin'] : $aResult['Language']).'/'.$sStaticCache.'/'; - - $aResult['TemplatesLink'] = './?/Templates/0/'.($bAdmin ? 'Admin' : 'App').'/'.$sStaticCache.'/'; - - $bAppJsDebug = !!$this->Config()->Get('labs', 'use_app_debug_js', false); - - $aResult['StaticLibJsLink'] = $this->StaticPath('js/min/libs.js'); - $aResult['StaticAppJsLink'] = $this->StaticPath('js/'.($bAppJsDebug ? '' : 'min/').($bAdmin ? 'admin' : 'app').'.js'); - $aResult['StaticEditorJsLink'] = $this->StaticPath('ckeditor/ckeditor.js'); - - $aResult['EditorDefaultType'] = \in_array($aResult['EditorDefaultType'], array('Plain', 'Html', 'HtmlForced', 'PlainForced')) ? - $aResult['EditorDefaultType'] : 'Plain'; - - // IDN - $aResult['Email'] = \MailSo\Base\Utils::IdnToUtf8($aResult['Email']); - $aResult['ParentEmail'] = \MailSo\Base\Utils::IdnToUtf8($aResult['ParentEmail']); - $aResult['MailToEmail'] = \MailSo\Base\Utils::IdnToUtf8($aResult['MailToEmail']); - $aResult['DevEmail'] = \MailSo\Base\Utils::IdnToUtf8($aResult['DevEmail']); - - // Mobile override - if ($bMobile) - { - $aResult['Layout'] = \RainLoop\Enumerations\Layout::NO_PREVIW; - - $aResult['SoundNotification'] = false; - $aResult['DesktopNotifications'] = false; - $aResult['UseCheckboxesInList'] = true; - - $aResult['UserBackgroundName'] = ''; - $aResult['UserBackgroundHash'] = ''; - } - - $this->Plugins()->InitAppData($bAdmin, $aResult, $oAccount); - - return $aResult; - } - - /** - * @return array - */ - private function getUserLanguagesFromHeader() - { - $aResult = $aList = array(); - $sAcceptLang = \strtolower($this->Http()->GetServer('HTTP_ACCEPT_LANGUAGE', 'en')); - if (!empty($sAcceptLang) && \preg_match_all('/([a-z]{1,8}(?:-[a-z]{1,8})?)(?:;q=([0-9.]+))?/', $sAcceptLang, $aList)) - { - $aResult = \array_combine($aList[1], $aList[2]); - foreach ($aResult as $n => $v) - { - $aResult[$n] = $v ? $v : 1; - } - - \arsort($aResult, SORT_NUMERIC); - } - - return $aResult; - } - - /** - * @return string - */ - public function detectUserLanguage($bAdmin = false) - { - $sResult = ''; - $aLangs = $this->getUserLanguagesFromHeader(); - - foreach (\array_keys($aLangs) as $sLang) - { - $sLang = $this->ValidateLanguage($sLang, '', $bAdmin, true); - if (!empty($sLang)) - { - $sResult = $sLang; - break; - } - } - - return $sResult; - } - - /** - * @param int $iWait = 1 - * @param int $iDelay = 1 - */ - private function requestSleep($iWait = 1, $iDelay = 1) - { - if (0 < $iDelay && 0 < $iWait) - { - if ($iWait > \time() - APP_START_TIME) - { - \sleep($iDelay); - } - } - } - - private function loginErrorDelay() - { - $iDelay = (int) $this->Config()->Get('labs', 'login_fault_delay', 0); - if (0 < $iDelay) - { - $this->requestSleep(1, $iDelay); - } - } - - /** - * @param \RainLoop\Model\Account $oAccount - */ - public function AuthToken($oAccount) - { - if ($oAccount instanceof \RainLoop\Model\Account) - { - $this->SetAuthToken($oAccount); - - $aAccounts = $this->GetAccounts($oAccount); - if (\is_array($aAccounts) && isset($aAccounts[$oAccount->Email()])) - { - $aAccounts[$oAccount->Email()] = $oAccount->GetAuthToken(); - $this->SetAccounts($oAccount, $aAccounts); - } - } - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param bool $bAuthLog = false - * - * @throws \RainLoop\Exceptions\ClientException - */ - public function CheckMailConnection($oAccount, $bAuthLog = false) - { - try - { - $oAccount->IncConnectAndLoginHelper($this->Plugins(), $this->MailClient(), $this->Config()); - } - catch (\RainLoop\Exceptions\ClientException $oException) - { - throw $oException; - } - catch (\MailSo\Net\Exceptions\ConnectionException $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ConnectionError, $oException); - } - catch (\MailSo\Imap\Exceptions\LoginBadCredentialsException $oException) - { - if ($bAuthLog) - { - $this->LoggerAuthHelper($oAccount); - } - - if ($this->Config()->Get('labs', 'imap_show_login_alert', true)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, - $oException, $oException->getAlertFromStatus()); - } - else - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException); - } - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException); - } - } - - /** - * @param string $sLogin - * @param bool $bAdmin = false - * @return array - */ - private function getAdditionalLogParamsByUserLogin($sLogin, $bAdmin = false) - { - $sHost = $bAdmin ? $this->Http()->GetHost(false, true, true) : \MailSo\Base\Utils::GetDomainFromEmail($sLogin); - return array( - '{imap:login}' => $sLogin, - '{imap:host}' => $sHost, - '{smtp:login}' => $sLogin, - '{smtp:host}' => $sHost, - '{user:email}' => $sLogin, - '{user:login}' => \MailSo\Base\Utils::GetAccountNameFromEmail($sLogin), - '{user:domain}' => $sHost, - ); - } - - /** - * @param string $sEmail - * @param string $sPassword - * @param string $sSignMeToken = '' - * @param string $sAdditionalCode = '' - * @param string $bAdditionalCodeSignMe = false - * - * @return \RainLoop\Model\Account - * @throws \RainLoop\Exceptions\ClientException - */ - public function LoginProcess(&$sEmail, &$sPassword, $sSignMeToken = '', - $sAdditionalCode = '', $bAdditionalCodeSignMe = false) - { - $sInputEmail = $sEmail; - - $this->Plugins()->RunHook('filter.login-credentials.step-1', array(&$sEmail, &$sPassword)); - - $sEmail = \MailSo\Base\Utils::StrToLowerIfAscii(\MailSo\Base\Utils::Trim($sEmail)); - - if (false === \strpos($sEmail, '@')) - { - $this->Logger()->Write('The email address "'.$sEmail.'" is not complete', \MailSo\Log\Enumerations\Type::INFO, 'LOGIN'); - - if (false === \strpos($sEmail, '@') && !!$this->Config()->Get('login', 'determine_user_domain', false)) - { - $sUserHost = \trim($this->Http()->GetHost(false, true, true)); - $this->Logger()->Write('Determined user domain: '.$sUserHost, \MailSo\Log\Enumerations\Type::INFO, 'LOGIN'); - - $bAdded = false; - - $iLimit = 14; - $aDomainParts = \explode('.', $sUserHost); - - $oDomainProvider = $this->DomainProvider(); - while (0 < \count($aDomainParts) && 0 < $iLimit) - { - $sLine = \trim(\implode('.', $aDomainParts), '. '); - - $oDomain = $oDomainProvider->Load($sLine, false); - if ($oDomain && $oDomain instanceof \RainLoop\Model\Domain) - { - $bAdded = true; - $this->Logger()->Write('Check "'.$sLine.'": OK ('.$sEmail.' > '.$sEmail.'@'.$sLine.')', - \MailSo\Log\Enumerations\Type::INFO, 'LOGIN'); - - $sEmail = $sEmail.'@'.$sLine; - break; - } - else - { - $this->Logger()->Write('Check "'.$sLine.'": NO', \MailSo\Log\Enumerations\Type::INFO, 'LOGIN'); - } - - \array_shift($aDomainParts); - $iLimit--; - } - - if (!$bAdded) - { - $sLine = $sUserHost; - $oDomain = $oDomainProvider->Load($sLine, true); - if ($oDomain && $oDomain instanceof \RainLoop\Model\Domain) - { - $bAdded = true; - $this->Logger()->Write('Check "'.$sLine.'" with wildcard: OK ('.$sEmail.' > '.$sEmail.'@'.$sLine.')', - \MailSo\Log\Enumerations\Type::INFO, 'LOGIN'); - - $sEmail = $sEmail.'@'.$sLine; - } - else - { - $this->Logger()->Write('Check "'.$sLine.'" with wildcard: NO', \MailSo\Log\Enumerations\Type::INFO, 'LOGIN'); - } - } - - if (!$bAdded) - { - $this->Logger()->Write('Domain was not found!', \MailSo\Log\Enumerations\Type::INFO, 'LOGIN'); - } - } - - $sDefDomain = \trim($this->Config()->Get('login', 'default_domain', '')); - if (false === \strpos($sEmail, '@') && 0 < \strlen($sDefDomain)) - { - $this->Logger()->Write('Default domain "'.$sDefDomain.'" was used. ('.$sEmail.' > '.$sEmail.'@'.$sDefDomain.')', - \MailSo\Log\Enumerations\Type::INFO, 'LOGIN'); - - $sEmail = $sEmail.'@'.$sDefDomain; - } - } - - $this->Plugins()->RunHook('filter.login-credentials.step-2', array(&$sEmail, &$sPassword)); - - if (false === \strpos($sEmail, '@') || 0 === \strlen($sPassword)) - { - $this->loginErrorDelay(); - - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::InvalidInputArgument); - } - - $this->Logger()->AddSecret($sPassword); - - $sLogin = $sEmail; - $this->Plugins()->RunHook('filter.login-credentials', array(&$sEmail, &$sLogin, &$sPassword)); - - $this->Logger()->AddSecret($sPassword); - - $this->Plugins()->RunHook('event.login-pre-login-provide', array()); - - $oAccount = null; - - try - { - $oAccount = $this->LoginProvide($sEmail, $sLogin, $sPassword, $sSignMeToken, true); - - if (!($oAccount instanceof \RainLoop\Model\Account)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); - } - - $this->Plugins()->RunHook('event.login-post-login-provide', array(&$oAccount)); - - if (!($oAccount instanceof \RainLoop\Model\Account)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); - } - } - catch (\Exception $oException) - { - $this->loginErrorDelay(); - $this->LoggerAuthHelper($oAccount, $this->getAdditionalLogParamsByUserLogin($sInputEmail)); - throw $oException; - } - - // Two factor auth - if ($this->TwoFactorAuthProvider()->IsActive()) - { - $aData = $this->getTwoFactorInfo($oAccount); - if ($aData && isset($aData['IsSet'], $aData['Enable']) && !empty($aData['Secret']) && $aData['IsSet'] && $aData['Enable']) - { - $sSecretHash = \md5(APP_SALT.$aData['Secret'].\RainLoop\Utils::Fingerprint()); - $sSecretCookieHash = \RainLoop\Utils::GetCookie(self::AUTH_TFA_SIGN_ME_TOKEN_KEY, ''); - - if (empty($sSecretCookieHash) || $sSecretHash !== $sSecretCookieHash) - { - $sAdditionalCode = \trim($sAdditionalCode); - if (empty($sAdditionalCode)) - { - $this->Logger()->Write('TFA: Required Code for '.$oAccount->ParentEmailHelper().' account.'); - - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountTwoFactorAuthRequired); - } - else - { - $this->Logger()->Write('TFA: Verify Code for '.$oAccount->ParentEmailHelper().' account.'); - - $bGood = false; - if (6 < \strlen($sAdditionalCode) && !empty($aData['BackupCodes'])) - { - $aBackupCodes = \explode(' ', \trim(\preg_replace('/[^\d]+/', ' ', $aData['BackupCodes']))); - $bGood = \in_array($sAdditionalCode, $aBackupCodes); - - if ($bGood) - { - $this->removeBackupCodeFromTwoFactorInfo($oAccount->ParentEmailHelper(), $sAdditionalCode); - } - } - - if ($bAdditionalCodeSignMe) - { - \RainLoop\Utils::SetCookie(self::AUTH_TFA_SIGN_ME_TOKEN_KEY, $sSecretHash, - \time() + 60 * 60 * 24 * 14); - } - - if (!$bGood && !$this->TwoFactorAuthProvider()->VerifyCode($aData['Secret'], $sAdditionalCode)) - { - $this->loginErrorDelay(); - - $this->LoggerAuthHelper($oAccount); - - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountTwoFactorAuthError); - } - } - } - } - } - - try - { - $this->CheckMailConnection($oAccount, true); - } - catch (\Exception $oException) - { - $this->loginErrorDelay(); - - throw $oException; - } - - return $oAccount; - } - - /** - * @param string $sEncryptedData - * - * @return string - */ - private function clientRsaDecryptHelper($sEncryptedData) - { -// $aMatch = array(); -// if ('rsa:xxx:' === \substr($sEncryptedData, 0, 8) && $this->Config()->Get('security', 'use_rsa_encryption', false)) -// { -// $oLogger = $this->Logger(); -// $oLogger->Write('Trying to decode encrypted data', \MailSo\Log\Enumerations\Type::INFO, 'RSA'); -// $oLogger->HideErrorNotices(true); -// -// $sData = \trim(\substr($sEncryptedData, 8)); -// $sData = \RainLoop\Utils::DecryptStringRSA(\base64_decode($sData)); -// -// if (false !== $sData && \preg_match('/^[a-z0-9]{32}:(.+):[a-z0-9]{32}$/', $sData, $aMatch) && isset($aMatch[1])) -// { -// $sEncryptedData = $aMatch[1]; -// } -// else -// { -// $oLogger->Write('Invalid decrypted data', \MailSo\Log\Enumerations\Type::WARNING, 'RSA'); -// } -// -// $oLogger->HideErrorNotices(false); -// } - - return $sEncryptedData; - } - - /** - * @param string $sEmail - * - * @return string - */ - private function generateSignMeToken($sEmail) - { - return \MailSo\Base\Utils::Md5Rand(APP_SALT.$sEmail); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoLogin() - { - $sEmail = \MailSo\Base\Utils::Trim($this->GetActionParam('Email', '')); - $sPassword = $this->GetActionParam('Password', ''); - $sLanguage = $this->GetActionParam('Language', ''); - $bSignMe = '1' === (string) $this->GetActionParam('SignMe', '0'); - - $sAdditionalCode = $this->GetActionParam('AdditionalCode', ''); - $bAdditionalCodeSignMe = '1' === (string) $this->GetActionParam('AdditionalCodeSignMe', '0'); - - $oAccount = null; - - $sPassword = $this->clientRsaDecryptHelper($sPassword); - $this->Logger()->AddSecret($sPassword); - - if ('sleep@sleep.dev' === $sEmail && 0 < \strlen($sPassword) && - \is_numeric($sPassword) && $this->Config()->Get('debug', 'enable', false) - ) - { - \sleep((int) $sPassword); - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); - } - - try - { - $oAccount = $this->LoginProcess($sEmail, $sPassword, - $bSignMe ? $this->generateSignMeToken($sEmail) : '', - $sAdditionalCode, $bAdditionalCodeSignMe); - } - catch (\RainLoop\Exceptions\ClientException $oException) - { - if ($oException && - \RainLoop\Notifications::AccountTwoFactorAuthRequired === $oException->getCode()) - { - return $this->DefaultResponse(__FUNCTION__, true, array( - 'TwoFactorAuth' => true - )); - } - else - { - throw $oException; - } - } - - $this->AuthToken($oAccount); - - if ($oAccount && 0 < \strlen($sLanguage)) - { - $oSettings = $this->SettingsProvider()->Load($oAccount); - if ($oSettings) - { - $sLanguage = $this->ValidateLanguage($sLanguage); - $sCurrentLanguage = $oSettings->GetConf('Language', ''); - - if ($sCurrentLanguage !== $sLanguage) - { - $oSettings->SetConf('Language', $sLanguage); - $this->SettingsProvider()->Save($oAccount, $oSettings); - } - } - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @param \RainLoop\Model\Account $oAccount - * - * @return array - */ - public function GetAccounts($oAccount) - { - if ($this->GetCapa(false, false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount)) - { - $sAccounts = $this->StorageProvider()->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'accounts' - ); - - $aAccounts = array(); - if ('' !== $sAccounts && '{' === \substr($sAccounts, 0, 1)) - { - $aAccounts = @\json_decode($sAccounts, true); - } - - if (\is_array($aAccounts) && 0 < \count($aAccounts)) - { - if (1 === \count($aAccounts)) - { - $this->SetAccounts($oAccount, array()); - - } - else if (1 < \count($aAccounts)) - { - $sOrder = $this->StorageProvider()->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'accounts_identities_order' - ); - - $aOrder = empty($sOrder) ? array() : @\json_decode($sOrder, true); - if (isset($aOrder['Accounts']) && \is_array($aOrder['Accounts']) && - 1 < \count($aOrder['Accounts'])) - { - $aAccounts = \array_merge(\array_flip($aOrder['Accounts']), $aAccounts); - - $aAccounts = \array_filter($aAccounts, function ($sHash) { - return 5 < \strlen($sHash); - }); - } - } - - return $aAccounts; - } - } - - $aAccounts = array(); - if (!$oAccount->IsAdditionalAccount()) - { - $aAccounts[$oAccount->Email()] = $oAccount->GetAuthToken(); - } - - return $aAccounts; - } - - /** - * @param \RainLoop\Model\Account $oAccount - * - * @return array - */ - public function GetTemplates($oAccount) - { - $aTemplates = array(); - if ($oAccount) - { - $aData = array(); - - $sData = $this->StorageProvider(true)->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'templates' - ); - - if ('' !== $sData && '[' === \substr($sData, 0, 1)) - { - $aData = @\json_decode($sData, true); - } - - if (\is_array($aData) && 0 < \count($aData)) - { - foreach ($aData as $aItem) - { - $oItem = \RainLoop\Model\Template::NewInstance(); - $oItem->FromJSON($aItem); - - if ($oItem && $oItem->Validate()) - { - \array_push($aTemplates, $oItem); - } - } - } - - if (1 < \count($aTemplates)) - { - $sOrder = $this->StorageProvider()->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'templates_order' - ); - - $aOrder = empty($sOrder) ? array() : @\json_decode($sOrder, true); - if (\is_array($aOrder) && 1 < \count($aOrder)) - { - \usort($aTemplates, function ($a, $b) use ($aOrder) { - return \array_search($a->Id(), $aOrder) < \array_search($b->Id(), $aOrder) ? -1 : 1; - }); - } - } - } - - return $aTemplates; - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param string $sID - * - * @return \RainLoop\Model\Identity - */ - public function GetTemplateByID($oAccount, $sID) - { - $aTemplates = $this->GetTemplates($oAccount); - if (\is_array($aTemplates)) - { - foreach ($aTemplates as $oIdentity) - { - if ($oIdentity && $sID === $oIdentity->Id()) - { - return $oIdentity; - } - } - } - - return isset($aTemplates[0]) ? $aTemplates[0] : null; - } - - /** - * @param \RainLoop\Model\Account $oAccount - * - * @return array - */ - public function GetIdentities($oAccount) - { - $bAllowIdentities = $this->GetCapa(false, false, - \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount); - - $aIdentities = array(); - if ($oAccount) - { - $aSubIdentities = array(); - - $sData = $this->StorageProvider(true)->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'identities' - ); - - if ('' !== $sData && '[' === \substr($sData, 0, 1)) - { - $aSubIdentities = @\json_decode($sData, true); - } - - $bHasAccountIdentity = false; - - if (\is_array($aSubIdentities) && 0 < \count($aSubIdentities)) - { - foreach ($aSubIdentities as $aItem) - { - $oItem = \RainLoop\Model\Identity::NewInstance(); - $oItem->FromJSON($aItem); - - if ($oItem && $oItem->Validate()) - { - if ($oItem->IsAccountIdentities()) - { - $oItem->SetEmail($oAccount->Email()); - $bHasAccountIdentity = true; - - \array_push($aIdentities, $oItem); - } - else if ($bAllowIdentities) - { - \array_push($aIdentities, $oItem); - } - } - } - } - - if (!$bHasAccountIdentity) - { - \array_unshift($aIdentities, - \RainLoop\Model\Identity::NewInstanceFromAccount($oAccount)); - } - - if (1 < \count($aIdentities) && $bAllowIdentities) - { - $sOrder = $this->StorageProvider()->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'accounts_identities_order' - ); - - $aOrder = empty($sOrder) ? array() : @\json_decode($sOrder, true); - if (isset($aOrder['Identities']) && \is_array($aOrder['Identities']) && - 1 < \count($aOrder['Identities'])) - { - $aList = $aOrder['Identities']; - foreach ($aList as $iIndex => $sItem) - { - if ('' === $sItem) - { - $aList[$iIndex] = '---'; - } - } - - \usort($aIdentities, function ($a, $b) use ($aList) { - return \array_search($a->Id(true), $aList) < \array_search($b->Id(true), $aList) ? -1 : 1; - }); - } - } - } - - return $aIdentities; - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param string $sID - * @param bool $bFirstOnEmpty = false - * - * @return \RainLoop\Model\Identity - */ - public function GetIdentityByID($oAccount, $sID, $bFirstOnEmpty = false) - { - $aIdentities = $this->GetIdentities($oAccount); - - if (\is_array($aIdentities)) - { - foreach ($aIdentities as $oIdentity) - { - if ($oIdentity && $sID === $oIdentity->Id()) - { - return $oIdentity; - } - } - } - - return $bFirstOnEmpty && \is_array($aIdentities) && isset($aIdentities[0]) ? $aIdentities[0] : null; - } - /** - * @param \RainLoop\Model\Account $oAccount - * - * @return \RainLoop\Model\Identity - */ - public function GetAccountIdentity($oAccount) - { - return $this->GetIdentityByID($oAccount, '', true); - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param array $aAccounts = array() - * - * @return array - */ - public function SetAccounts($oAccount, $aAccounts = array()) - { - $sParentEmail = $oAccount->ParentEmailHelper(); - if (!\is_array($aAccounts) || 0 >= \count($aAccounts) || - (1 === \count($aAccounts) && !empty($aAccounts[$sParentEmail]))) - { - $this->StorageProvider()->Clear($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'accounts' - ); - } - else - { - $this->StorageProvider()->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'accounts', - @\json_encode($aAccounts) - ); - } - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param array $aIdentities = array() - * - * @return array - */ - public function SetIdentities($oAccount, $aIdentities = array()) - { - $bAllowIdentities = $this->GetCapa(false, false, \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount); - - $aResult = array(); - foreach ($aIdentities as $oItem) - { - if (!$bAllowIdentities && $oItem && !$oItem->IsAccountIdentities()) - { - continue; - } - - $aResult[] = $oItem->ToSimpleJSON(false); - } - - return $this->StorageProvider(true)->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'identities', - @\json_encode($aResult) - ); - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param array $aTemplates = array() - * - * @return array - */ - public function SetTemplates($oAccount, $aTemplates = array()) - { - $aResult = array(); - foreach ($aTemplates as $oItem) - { - $aResult[] = $oItem->ToSimpleJSON(false); - } - - return $this->StorageProvider(true)->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'templates', - @\json_encode($aResult) - ); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoFilters() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::FILTERS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $aFakeFilters = null; - - $this->Plugins() - ->RunHook('filter.filters-fake', array($oAccount, &$aFakeFilters)) - ; - - if ($aFakeFilters) - { - return $this->DefaultResponse(__FUNCTION__, $aFakeFilters); - } - - return $this->DefaultResponse(__FUNCTION__, - $this->FiltersProvider()->Load($oAccount, $oAccount->DomainSieveAllowRaw())); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoFiltersSave() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::FILTERS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $aIncFilters = $this->GetActionParam('Filters', array()); - - $sRaw = $this->GetActionParam('Raw', ''); - $bRawIsActive = '1' === (string) $this->GetActionParam('RawIsActive', '0'); - - $aFilters = array(); - foreach ($aIncFilters as $aFilter) - { - if ($aFilter) - { - $oFilter = new \RainLoop\Providers\Filters\Classes\Filter(); - if ($oFilter->FromJSON($aFilter)) - { - $aFilters[] = $oFilter; - } - } - } - - $this->Plugins() - ->RunHook('filter.filters-save', array($oAccount, &$aFilters, &$sRaw, &$bRawIsActive)) - ; - - return $this->DefaultResponse(__FUNCTION__, $this->FiltersProvider()->Save($oAccount, - $aFilters, $sRaw, $bRawIsActive)); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoAccountSetup() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sParentEmail = $oAccount->ParentEmailHelper(); - - $aAccounts = $this->GetAccounts($oAccount); - if (!\is_array($aAccounts)) - { - $aAccounts = array(); - } - - $sEmail = \trim($this->GetActionParam('Email', '')); - $sPassword = $this->GetActionParam('Password', ''); - $bNew = '1' === (string) $this->GetActionParam('New', '1'); - - $sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail, true); - if ($bNew && ($oAccount->Email() === $sEmail || $sParentEmail === $sEmail || isset($aAccounts[$sEmail]))) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountAlreadyExists); - } - else if (!$bNew && !isset($aAccounts[$sEmail])) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountDoesNotExist); - } - - $oNewAccount = $this->LoginProcess($sEmail, $sPassword); - $oNewAccount->SetParentEmail($sParentEmail); - - $aAccounts[$oNewAccount->Email()] = $oNewAccount->GetAuthToken(); - if (!$oAccount->IsAdditionalAccount()) - { - $aAccounts[$oAccount->Email()] = $oAccount->GetAuthToken(); - } - - $this->SetAccounts($oAccount, $aAccounts); - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoAccountDelete() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sParentEmail = $oAccount->ParentEmailHelper(); - $sEmailToDelete = \trim($this->GetActionParam('EmailToDelete', '')); - $sEmailToDelete = \MailSo\Base\Utils::IdnToAscii($sEmailToDelete, true); - - $aAccounts = $this->GetAccounts($oAccount); - - if (0 < \strlen($sEmailToDelete) && $sEmailToDelete !== $sParentEmail && \is_array($aAccounts) && isset($aAccounts[$sEmailToDelete])) - { - unset($aAccounts[$sEmailToDelete]); - - $oAccountToChange = null; - if ($oAccount->Email() === $sEmailToDelete && !empty($aAccounts[$sParentEmail])) - { - $oAccountToChange = $this->GetAccountFromCustomToken($aAccounts[$sParentEmail], false, false); - if ($oAccountToChange) - { - $this->AuthToken($oAccountToChange); - } - } - - $this->SetAccounts($oAccount, $aAccounts); - return $this->TrueResponse(__FUNCTION__, array('Reload' => !!$oAccountToChange)); - } - - return $this->FalseResponse(__FUNCTION__); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoAttachmentsActions() - { - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::ATTACHMENTS_ACTIONS)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $oAccount = $this->initMailClientConnection(); - - $sAction = $this->GetActionParam('Do', ''); - $aHashes = $this->GetActionParam('Hashes', null); - - $mResult = false; - $bError = false; - $aData = false; - - if (\is_array($aHashes) && 0 < \count($aHashes)) - { - $aData = array(); - foreach ($aHashes as $sZipHash) - { - $aResult = $this->getMimeFileByHash($oAccount, $sZipHash); - if (\is_array($aResult) && !empty($aResult['FileHash'])) - { - $aData[] = $aResult; - } - else - { - $bError = true; - break; - } - } - } - - $oFilesProvider = $this->FilesProvider(); - if (!empty($sAction) && !$bError && \is_array($aData) && 0 < \count($aData) && - $oFilesProvider && $oFilesProvider->IsActive()) - { - - $bError = false; - switch (\strtolower($sAction)) - { - case 'zip': - - if (\class_exists('ZipArchive')) - { - $sZipHash = \MailSo\Base\Utils::Md5Rand(); - $sZipFileName = $oFilesProvider->GenerateLocalFullFileName($oAccount, $sZipHash); - - if (!empty($sZipFileName)) - { - $oZip = new \ZipArchive(); - $oZip->open($sZipFileName, \ZIPARCHIVE::CREATE | \ZIPARCHIVE::OVERWRITE); - $oZip->setArchiveComment('RainLoop/'.APP_VERSION); - - foreach ($aData as $aItem) - { - $sFileName = (string) (isset($aItem['FileName']) ? $aItem['FileName'] : 'file.dat'); - $sFileHash = (string) (isset($aItem['FileHash']) ? $aItem['FileHash'] : ''); - - if (!empty($sFileHash)) - { - $sFullFileNameHash = $oFilesProvider->GetFileName($oAccount, $sFileHash); - if (!$oZip->addFile($sFullFileNameHash, $sFileName)) - { - $bError = true; - } - } - } - - if (!$bError) - { - $bError = !$oZip->close(); - } - else - { - $oZip->close(); - } - } - - foreach ($aData as $aItem) - { - $sFileHash = (string) (isset($aItem['FileHash']) ? $aItem['FileHash'] : ''); - if (!empty($sFileHash)) - { - $oFilesProvider->Clear($oAccount, $sFileHash); - } - } - - if (!$bError) - { - $mResult = array( - 'Files' => array(array( - 'FileName' => 'attachments.zip', - 'Hash' => \RainLoop\Utils::EncodeKeyValuesQ(array( - 'V' => APP_VERSION, - 'Account' => $oAccount ? \md5($oAccount->Hash()) : '', - 'FileName' => 'attachments.zip', - 'MimeType' => 'application/zip', - 'FileHash' => $sZipHash - )) - )) - ); - } - } - break; - - case 'owncloud': - - $mResult = false; - - if (\RainLoop\Utils::IsOwnCloudLoggedIn() && \class_exists('OCP\Files')) - { - $sSaveFolder = $this->Config()->Get('labs', 'owncloud_save_folder', ''); - if (empty($sSaveFolder)) - { - $sSaveFolder = 'Attachments'; - } - - $oFiles = \OCP\Files::getStorage('files'); - - if ($oFilesProvider && $oFiles && $oFilesProvider->IsActive() && - \method_exists($oFiles, 'file_put_contents')) - { - if (!$oFiles->is_dir($sSaveFolder)) - { - $oFiles->mkdir($sSaveFolder); - } - - $mResult = true; - foreach ($aData as $aItem) - { - $sSavedFileName = isset($aItem['FileName']) ? $aItem['FileName'] : 'file.dat'; - $sSavedFileHash = !empty($aItem['FileHash']) ? $aItem['FileHash'] : ''; - - if (!empty($sSavedFileHash)) - { - $fFile = $oFilesProvider->GetFile($oAccount, $sSavedFileHash, 'rb'); - if (\is_resource($fFile)) - { - $sSavedFileNameFull = \MailSo\Base\Utils::SmartFileExists($sSaveFolder.'/'.$sSavedFileName, function ($sPath) use ($oFiles) { - return $oFiles->file_exists($sPath); - }); - - if (!$oFiles->file_put_contents($sSavedFileNameFull, $fFile)) - { - $mResult = false; - } - - if (\is_resource($fFile)) - { - @\fclose($fFile); - } - } - } - } - } - } - - foreach ($aData as $aItem) - { - $sFileHash = (string) (isset($aItem['FileHash']) ? $aItem['FileHash'] : ''); - if (!empty($sFileHash)) - { - $oFilesProvider->Clear($oAccount, $sFileHash); - } - } - - break; - - case 'dropbox': - - $mResult = array( - 'ShortLife' => '_'.$this->GetShortLifeSpecAuthToken(), - 'Url' => \preg_replace('/\?(.*)$/', '', $this->Http()->GetFullUrl()), - 'Files' => array() - ); - - foreach ($aData as $aItem) - { - $mResult['Files'][] = array( - 'FileName' => isset($aItem['FileName']) ? $aItem['FileName'] : 'file.dat', - 'Hash' => \RainLoop\Utils::EncodeKeyValuesQ($aItem) - ); - } - - break; - } - } - else - { - $bError = true; - } - - $this->requestSleep(); - return $this->DefaultResponse(__FUNCTION__, $bError ? false : $mResult); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoIdentityUpdate() - { - $oAccount = $this->getAccountFromToken(); - - $oIdentity = \RainLoop\Model\Identity::NewInstance(); - if (!$oIdentity->FromJSON($this->GetActionParams(), true)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::InvalidInputArgument); - } - - $aIdentities = $this->GetIdentities($oAccount); - - $bAdded = false; - $aIdentitiesForSave = array(); - foreach ($aIdentities as $oItem) - { - if ($oItem) - { - if ($oItem->Id() === $oIdentity->Id()) - { - $aIdentitiesForSave[] = $oIdentity; - $bAdded = true; - } - else - { - $aIdentitiesForSave[] = $oItem; - } - } - } - - if (!$bAdded) - { - $aIdentitiesForSave[] = $oIdentity; - } - - return $this->DefaultResponse(__FUNCTION__, $this->SetIdentities($oAccount, $aIdentitiesForSave)); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoIdentityDelete() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::IDENTITIES, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sId = \trim($this->GetActionParam('IdToDelete', '')); - if (empty($sId)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError); - } - - $aNew = array(); - $aIdentities = $this->GetIdentities($oAccount); - - foreach ($aIdentities as $oItem) - { - if ($oItem && $sId !== $oItem->Id()) - { - $aNew[] = $oItem; - } - } - - return $this->DefaultResponse(__FUNCTION__, $this->SetIdentities($oAccount, $aNew)); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoTemplateSetup() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TEMPLATES, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $oTemplate = \RainLoop\Model\Template::NewInstance(); - if (!$oTemplate->FromJSON($this->GetActionParams(), true)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::InvalidInputArgument); - } - - if ('' === $oTemplate->Id()) - { - $oTemplate->GenerateID(); - } - - $aTemplatesForSave = array(); - $aTemplates = $this->GetTemplates($oAccount); - - - foreach ($aTemplates as $oItem) - { - if ($oItem && $oItem->Id() !== $oTemplate->Id()) - { - $aTemplatesForSave[] = $oItem; - } - } - - $aTemplatesForSave[] = $oTemplate; - - return $this->DefaultResponse(__FUNCTION__, $this->SetTemplates($oAccount, $aTemplatesForSave)); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoTemplateDelete() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TEMPLATES, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sId = \trim($this->GetActionParam('IdToDelete', '')); - if (empty($sId)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError); - } - - $aNew = array(); - $aTemplates = $this->GetTemplates($oAccount); - foreach ($aTemplates as $oItem) - { - if ($oItem && $sId !== $oItem->Id()) - { - $aNew[] = $oItem; - } - } - - return $this->DefaultResponse(__FUNCTION__, $this->SetTemplates($oAccount, $aNew)); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoTemplateGetByID() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TEMPLATES, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sId = \trim($this->GetActionParam('ID', '')); - if (empty($sId)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError); - } - - $oTemplate = false; - $aTemplates = $this->GetTemplates($oAccount); - - foreach ($aTemplates as $oItem) - { - if ($oItem && $sId === $oItem->Id()) - { - $oTemplate = $oItem; - break; - } - } - - $oTemplate->SetPopulateAlways(true); - return $this->DefaultResponse(__FUNCTION__, $oTemplate); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoAccountsAndIdentitiesSortOrder() - { - $oAccount = $this->getAccountFromToken(); - - $aAccounts = $this->GetActionParam('Accounts', null); - $aIdentities = $this->GetActionParam('Identities', null); - - if (!\is_array($aAccounts) && !\is_array($aIdentities)) - { - return $this->FalseResponse(__FUNCTION__); - } - - return $this->DefaultResponse(__FUNCTION__, $this->StorageProvider()->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, 'accounts_identities_order', - \json_encode(array( - 'Accounts' => \is_array($aAccounts) ? $aAccounts : array(), - 'Identities' => \is_array($aIdentities) ? $aIdentities : array() - )) - )); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoAccountsAndIdentities() - { - $oAccount = $this->getAccountFromToken(); - - $mAccounts = false; - - if ($this->GetCapa(false, false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount)) - { - $mAccounts = $this->GetAccounts($oAccount); - $mAccounts = \array_keys($mAccounts); - - foreach ($mAccounts as $iIndex => $sName) - { - $mAccounts[$iIndex] = \MailSo\Base\Utils::IdnToUtf8($sName); - } - } - - return $this->DefaultResponse(__FUNCTION__, array( - 'Accounts' => $mAccounts, - 'Identities' => $this->GetIdentities($oAccount) - )); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoTemplates() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TEMPLATES, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - return $this->DefaultResponse(__FUNCTION__, array( - 'Templates' => $this->GetTemplates($oAccount) - )); - } - - /** - * @param string $sHash - * - * @return int - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function getAccountUnredCountFromHash($sHash) - { - $iResult = 0; - - $oAccount = $this->GetAccountFromCustomToken($sHash, false); - if ($oAccount) - { - try - { - $oMailClient = \MailSo\Mail\MailClient::NewInstance(); - $oMailClient->SetLogger($this->Logger()); - - $oAccount->IncConnectAndLoginHelper($this->Plugins(),$oMailClient, $this->Config()); - - $iResult = $oMailClient->InboxUnreadCount(); - - $oMailClient->LogoutAndDisconnect(); - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException); - } - } - - return $iResult; - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoAccountsCounts() - { - $oAccount = $this->getAccountFromToken(); - - $bComplete = true; - $aCounts = array(); - - if ($this->GetCapa(false, false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount)) - { - $iLimit = 7; - $mAccounts = $this->GetAccounts($oAccount); - if (\is_array($mAccounts) && 0 < \count($mAccounts)) - { - if ($iLimit > \count($mAccounts)) - { - $mAccounts = \array_slice($mAccounts, 0, $iLimit); - } - else - { - $bComplete = false; - } - - if (0 < \count($mAccounts)) - { - foreach ($mAccounts as $sEmail => $sHash) - { - $aCounts[] = array(\MailSo\Base\Utils::IdnToUtf8($sEmail), - $oAccount->Email() === $sEmail ? 0 : $this->getAccountUnredCountFromHash($sHash)); - } - } - } - } - else - { - $aCounts[] = array(\MailSo\Base\Utils::IdnToUtf8($oAccount->Email()), 0); - } - - return $this->DefaultResponse(__FUNCTION__, array( - 'Complete' => $bComplete, - 'Counts' => $aCounts - )); - } - - /** - * @param \RainLoop\Model\Account $oAccount - */ - public function ClearSignMeData($oAccount) - { - if ($oAccount) - { - \RainLoop\Utils::ClearCookie(\RainLoop\Actions::AUTH_SIGN_ME_TOKEN_KEY); - - $this->StorageProvider()->Clear($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'sign_me' - ); - } - } - - /** - * @return array - */ - public function DoLogout() - { - $oAccount = $this->getAccountFromToken(false); - if ($oAccount) - { - if ($oAccount->SignMe()) - { - $this->ClearSignMeData($oAccount); - } - - if (!$oAccount->IsAdditionalAccount()) - { - \RainLoop\Utils::ClearCookie(\RainLoop\Actions::AUTH_SPEC_TOKEN_KEY); - } - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoAppDelayStart() - { - $this->Plugins()->RunHook('service.app-delay-start-begin'); - - \RainLoop\Utils::UpdateConnectionToken(); - - $bMainCache = false; - $bFilesCache = false; - $bVersionsCache = false; - - $iOneDay1 = 60 * 60 * 23; - $iOneDay2 = 60 * 60 * 25; - $iOneDay3 = 60 * 60 * 30; - - $sTimers = $this->StorageProvider()->Get(null, - \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, 'Cache/Timers', ''); - - $aTimers = \explode(',', $sTimers); - - $iMainCacheTime = !empty($aTimers[0]) && \is_numeric($aTimers[0]) ? (int) $aTimers[0] : 0; - $iFilesCacheTime = !empty($aTimers[1]) && \is_numeric($aTimers[1]) ? (int) $aTimers[1] : 0; - $iVersionsCacheTime = !empty($aTimers[2]) && \is_numeric($aTimers[2]) ? (int) $aTimers[2] : 0; - - if (0 === $iMainCacheTime || $iMainCacheTime + $iOneDay1 < \time()) - { - $bMainCache = true; - $iMainCacheTime = \time(); - } - - if (0 === $iFilesCacheTime || $iFilesCacheTime + $iOneDay2 < \time()) - { - $bFilesCache = true; - $iFilesCacheTime = \time(); - } - - if (0 === $iVersionsCacheTime || $iVersionsCacheTime + $iOneDay3 < \time()) - { - $bVersionsCache = true; - $iVersionsCacheTime = \time(); - } - - if ($bMainCache || $bFilesCache || $bVersionsCache) - { - if (!$this->StorageProvider()->Put(null, - \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, 'Cache/Timers', - \implode(',', array($iMainCacheTime, $iFilesCacheTime, $iVersionsCacheTime)))) - { - $bMainCache = $bFilesCache = $bVersionsCache = false; - } - } - - if ($bMainCache) - { - $this->Logger()->Write('Cacher GC: Begin'); - $this->Cacher()->GC(48); - $this->Logger()->Write('Cacher GC: End'); - } - else if ($bFilesCache) - { - $this->Logger()->Write('Files GC: Begin'); - $this->FilesProvider()->GC(48); - $this->Logger()->Write('Files GC: End'); - } - else if ($bVersionsCache) - { - $oPremProvider = $this->PremProvider(); - if ($oPremProvider) - { - $oPremProvider->ClearOldVersion(); - } - } - - $this->Plugins()->RunHook('service.app-delay-start-end'); - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoSystemFoldersUpdate() - { - $oAccount = $this->getAccountFromToken(); - - $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); - - $oSettingsLocal->SetConf('SentFolder', $this->GetActionParam('SentFolder', '')); - $oSettingsLocal->SetConf('DraftFolder', $this->GetActionParam('DraftFolder', '')); - $oSettingsLocal->SetConf('SpamFolder', $this->GetActionParam('SpamFolder', '')); - $oSettingsLocal->SetConf('TrashFolder', $this->GetActionParam('TrashFolder', '')); - $oSettingsLocal->SetConf('ArchiveFolder', $this->GetActionParam('ArchiveFolder', '')); - $oSettingsLocal->SetConf('NullFolder', $this->GetActionParam('NullFolder', '')); - - return $this->DefaultResponse(__FUNCTION__, - $this->SettingsProvider(true)->Save($oAccount, $oSettingsLocal)); - } - - /** - * @param \RainLoop\Config\Application $oConfig - * @param string $sParamName - * @param string $sConfigSector - * @param string $sConfigName - * @param string $sType = 'string' - * @param callable|null $mStringCallback = null - */ - public function setConfigFromParams(&$oConfig, $sParamName, $sConfigSector, $sConfigName, $sType = 'string', $mStringCallback = null) - { - $sValue = $this->GetActionParam($sParamName, ''); - if ($this->HasActionParam($sParamName)) - { - switch ($sType) - { - default: - case 'string': - $sValue = (string) $sValue; - if ($mStringCallback && is_callable($mStringCallback)) - { - $sValue = call_user_func($mStringCallback, $sValue); - } - - $oConfig->Set($sConfigSector, $sConfigName, (string) $sValue); - break; - - case 'dummy': - $sValue = (string) $this->GetActionParam('ContactsPdoPassword', APP_DUMMY); - if (APP_DUMMY !== $sValue) - { - $oConfig->Set($sConfigSector, $sConfigName, (string) $sValue); - } - break; - - case 'int': - $iValue = (int) $sValue; - $oConfig->Set($sConfigSector, $sConfigName, $iValue); - break; - - case 'bool': - $oConfig->Set($sConfigSector, $sConfigName, '1' === (string) $sValue); - break; - } - } - } - - /** - * @param \RainLoop\Config\Application $oConfig - * @param string $sParamName - * @param string $sCapa - */ - private function setCapaFromParams(&$oConfig, $sParamName, $sCapa) - { - switch ($sCapa) - { - case \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS: - $this->setConfigFromParams($oConfig, $sParamName, 'webmail', 'allow_additional_accounts', 'bool'); - break; - case \RainLoop\Enumerations\Capa::IDENTITIES: - $this->setConfigFromParams($oConfig, $sParamName, 'webmail', 'allow_additional_identities', 'bool'); - break; - case \RainLoop\Enumerations\Capa::TEMPLATES: - $this->setConfigFromParams($oConfig, $sParamName, 'capa', 'x-templates', 'bool'); - break; - case \RainLoop\Enumerations\Capa::TWO_FACTOR: - $this->setConfigFromParams($oConfig, $sParamName, 'security', 'allow_two_factor_auth', 'bool'); - break; - case \RainLoop\Enumerations\Capa::TWO_FACTOR_FORCE: - $this->setConfigFromParams($oConfig, $sParamName, 'security', 'force_two_factor_auth', 'bool'); - break; - case \RainLoop\Enumerations\Capa::GRAVATAR: - $this->setConfigFromParams($oConfig, $sParamName, 'labs', 'allow_gravatar', 'bool'); - break; - case \RainLoop\Enumerations\Capa::ATTACHMENT_THUMBNAILS: - $this->setConfigFromParams($oConfig, $sParamName, 'interface', 'show_attachment_thumbnail', 'bool'); - break; - case \RainLoop\Enumerations\Capa::THEMES: - $this->setConfigFromParams($oConfig, $sParamName, 'webmail', 'allow_themes', 'bool'); - break; - case \RainLoop\Enumerations\Capa::USER_BACKGROUND: - $this->setConfigFromParams($oConfig, $sParamName, 'webmail', 'allow_user_background', 'bool'); - break; - case \RainLoop\Enumerations\Capa::OPEN_PGP: - $this->setConfigFromParams($oConfig, $sParamName, 'security', 'openpgp', 'bool'); - break; - } - } - - /** - * @param \RainLoop\Settings $oSettings - * @param string $sConfigName - * @param string $sType = 'string' - * @param callable|null $mStringCallback = null - */ - private function setSettingsFromParams(&$oSettings, $sConfigName, $sType = 'string', $mStringCallback = null) - { - if ($this->HasActionParam($sConfigName)) - { - $sValue = $this->GetActionParam($sConfigName, ''); - switch ($sType) - { - default: - case 'string': - $sValue = (string) $sValue; - if ($mStringCallback && is_callable($mStringCallback)) - { - $sValue = call_user_func($mStringCallback, $sValue); - } - - $oSettings->SetConf($sConfigName, (string) $sValue); - break; - - case 'int': - $iValue = (int) $sValue; - $oSettings->SetConf($sConfigName, $iValue); - break; - - case 'bool': - $oSettings->SetConf($sConfigName, '1' === (string) $sValue); - break; - } - } - } - - /** - * @return array - */ - public function DoAdminSettingsUpdate() - { -// sleep(3); -// return $this->DefaultResponse(__FUNCTION__, false); - - $this->IsAdminLoggined(); - - $oConfig = $this->Config(); - - $self = $this; - - $this->setConfigFromParams($oConfig, 'Language', 'webmail', 'language', 'string', function ($sLanguage) use ($self) { - return $self->ValidateLanguage($sLanguage, '', false); - }); - - $this->setConfigFromParams($oConfig, 'LanguageAdmin', 'webmail', 'language_admin', 'string', function ($sLanguage) use ($self) { - return $self->ValidateLanguage($sLanguage, '', true); - }); - - $this->setConfigFromParams($oConfig, 'Theme', 'webmail', 'theme', 'string', function ($sTheme) use ($self) { - return $self->ValidateTheme($sTheme); - }); - - $this->setConfigFromParams($oConfig, 'VerifySslCertificate', 'ssl', 'verify_certificate', 'bool'); - $this->setConfigFromParams($oConfig, 'AllowSelfSigned', 'ssl', 'allow_self_signed', 'bool'); - - $this->setConfigFromParams($oConfig, 'UseLocalProxyForExternalImages', 'labs', 'use_local_proxy_for_external_images', 'bool'); - - $this->setConfigFromParams($oConfig, 'AllowLanguagesOnSettings', 'webmail', 'allow_languages_on_settings', 'bool'); - $this->setConfigFromParams($oConfig, 'AllowLanguagesOnLogin', 'login', 'allow_languages_on_login', 'bool'); - $this->setConfigFromParams($oConfig, 'AttachmentLimit', 'webmail', 'attachment_size_limit', 'int'); - - $this->setConfigFromParams($oConfig, 'LoginDefaultDomain', 'login', 'default_domain', 'string'); - - $this->setConfigFromParams($oConfig, 'ContactsEnable', 'contacts', 'enable', 'bool'); - $this->setConfigFromParams($oConfig, 'ContactsSharing', 'contacts', 'allow_sharing', 'bool'); - $this->setConfigFromParams($oConfig, 'ContactsSync', 'contacts', 'allow_sync', 'bool'); - $this->setConfigFromParams($oConfig, 'ContactsPdoDsn', 'contacts', 'pdo_dsn', 'string'); - $this->setConfigFromParams($oConfig, 'ContactsPdoUser', 'contacts', 'pdo_user', 'string'); - $this->setConfigFromParams($oConfig, 'ContactsPdoPassword', 'contacts', 'pdo_password', 'dummy'); - - $this->setConfigFromParams($oConfig, 'ContactsPdoType', 'contacts', 'type', 'string', function ($sType) use ($self) { - return $self->ValidateContactPdoType($sType); - }); - - $this->setCapaFromParams($oConfig, 'CapaAdditionalAccounts', \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS); - $this->setCapaFromParams($oConfig, 'CapaIdentities', \RainLoop\Enumerations\Capa::IDENTITIES); - $this->setCapaFromParams($oConfig, 'CapaTemplates', \RainLoop\Enumerations\Capa::TEMPLATES); - $this->setCapaFromParams($oConfig, 'CapaTwoFactorAuth', \RainLoop\Enumerations\Capa::TWO_FACTOR); - $this->setCapaFromParams($oConfig, 'CapaTwoFactorAuthForce', \RainLoop\Enumerations\Capa::TWO_FACTOR_FORCE); - $this->setCapaFromParams($oConfig, 'CapaOpenPGP', \RainLoop\Enumerations\Capa::OPEN_PGP); - $this->setCapaFromParams($oConfig, 'CapaGravatar', \RainLoop\Enumerations\Capa::GRAVATAR); - $this->setCapaFromParams($oConfig, 'CapaThemes', \RainLoop\Enumerations\Capa::THEMES); - $this->setCapaFromParams($oConfig, 'CapaUserBackground', \RainLoop\Enumerations\Capa::USER_BACKGROUND); - $this->setCapaFromParams($oConfig, 'CapaAttachmentThumbnails', \RainLoop\Enumerations\Capa::ATTACHMENT_THUMBNAILS); - - $this->setConfigFromParams($oConfig, 'DetermineUserLanguage', 'login', 'determine_user_language', 'bool'); - $this->setConfigFromParams($oConfig, 'DetermineUserDomain', 'login', 'determine_user_domain', 'bool'); - - $this->setConfigFromParams($oConfig, 'Title', 'webmail', 'title', 'string'); - $this->setConfigFromParams($oConfig, 'LoadingDescription', 'webmail', 'loading_description', 'string'); - $this->setConfigFromParams($oConfig, 'FaviconUrl', 'webmail', 'favicon_url', 'string'); - - $this->setConfigFromParams($oConfig, 'TokenProtection', 'security', 'csrf_protection', 'bool'); - $this->setConfigFromParams($oConfig, 'EnabledPlugins', 'plugins', 'enable', 'bool'); - - $this->setConfigFromParams($oConfig, 'GoogleEnable', 'social', 'google_enable', 'bool'); - $this->setConfigFromParams($oConfig, 'GoogleEnableAuth', 'social', 'google_enable_auth', 'bool'); - $this->setConfigFromParams($oConfig, 'GoogleEnableAuthFast', 'social', 'google_enable_auth_fast', 'bool'); - $this->setConfigFromParams($oConfig, 'GoogleEnableDrive', 'social', 'google_enable_drive', 'bool'); - $this->setConfigFromParams($oConfig, 'GoogleEnablePreview', 'social', 'google_enable_preview', 'bool'); - $this->setConfigFromParams($oConfig, 'GoogleClientID', 'social', 'google_client_id', 'string'); - $this->setConfigFromParams($oConfig, 'GoogleClientSecret', 'social', 'google_client_secret', 'string'); - $this->setConfigFromParams($oConfig, 'GoogleApiKey', 'social', 'google_api_key', 'string'); - - $this->setConfigFromParams($oConfig, 'FacebookEnable', 'social', 'fb_enable', 'bool'); - $this->setConfigFromParams($oConfig, 'FacebookAppID', 'social', 'fb_app_id', 'string'); - $this->setConfigFromParams($oConfig, 'FacebookAppSecret', 'social', 'fb_app_secret', 'string'); - - $this->setConfigFromParams($oConfig, 'TwitterEnable', 'social', 'twitter_enable', 'bool'); - $this->setConfigFromParams($oConfig, 'TwitterConsumerKey', 'social', 'twitter_consumer_key', 'string'); - $this->setConfigFromParams($oConfig, 'TwitterConsumerSecret', 'social', 'twitter_consumer_secret', 'string'); - - $this->setConfigFromParams($oConfig, 'DropboxEnable', 'social', 'dropbox_enable', 'bool'); - $this->setConfigFromParams($oConfig, 'DropboxApiKey', 'social', 'dropbox_api_key', 'string'); - - $oPremProvider = $this->PremProvider(); - if ($oPremProvider) - { - $oPremProvider->PremSection($this, $oConfig); - } - - return $this->DefaultResponse(__FUNCTION__, $oConfig->Save()); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoAdminLogin() - { - $sLogin = trim($this->GetActionParam('Login', '')); - $sPassword = $this->GetActionParam('Password', ''); - - $this->Logger()->AddSecret($sPassword); - - if (0 === strlen($sLogin) || 0 === strlen($sPassword) || - !$this->Config()->Get('security', 'allow_admin_panel', true) || - $sLogin !== $this->Config()->Get('security', 'admin_login', '') || - !$this->Config()->ValidatePassword($sPassword)) - { - $this->loginErrorDelay(); - $this->LoggerAuthHelper(null, $this->getAdditionalLogParamsByUserLogin($sLogin, true)); - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError); - } - - $sToken = $this->getAdminToken(); - $this->setAdminAuthToken($sToken); - - return $this->DefaultResponse(__FUNCTION__, $sToken ? true : false); - } - - /** - * @return array - */ - public function DoAdminLogout() - { - $this->ClearAdminAuthToken(); - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoAdminPing() - { - $this->IsAdminLoggined(); - - return $this->DefaultResponse(__FUNCTION__, true); - } - - /** - * @return array - */ - public function DoAdminContactsTest() - { - $this->IsAdminLoggined(); - - $oConfig = $this->Config(); - - $this->setConfigFromParams($oConfig, 'ContactsPdoDsn', 'contacts', 'pdo_dsn', 'string'); - $this->setConfigFromParams($oConfig, 'ContactsPdoUser', 'contacts', 'pdo_user', 'string'); - $this->setConfigFromParams($oConfig, 'ContactsPdoPassword', 'contacts', 'pdo_password', 'dummy'); - - $self = $this; - $this->setConfigFromParams($oConfig, 'ContactsPdoType', 'contacts', 'type', 'string', function ($sType) use ($self) { - return $self->ValidateContactPdoType($sType); - }); - - $sTestMessage = $this->AddressBookProvider(null, true)->Test(); - return $this->DefaultResponse(__FUNCTION__, array( - 'Result' => '' === $sTestMessage, - 'Message' => \MailSo\Base\Utils::Utf8Clear($sTestMessage, '?') - )); - } - - /** - * @return array - */ - public function DoAdminLicensing() - { - $this->IsAdminLoggined(); - - $bForce = '1' === (string) $this->GetActionParam('Force', '0'); - - $mResult = false; - $iErrorCode = -1; - - $oPremProvider = $this->PremProvider(); - - if ($oPremProvider && 2 < \strlen(APP_SITE)) - { - $sValue = $oPremProvider->Fetcher($bForce); - - $this->requestSleep(); - - $iExpired = 0; - if ($oPremProvider->Parser($sValue, $iExpired)) - { - $mResult = array( - 'Banned' => false, - 'Expired' => $iExpired, - ); - } - else if ($sValue === 'NO' || \preg_match('/^EXPIRED:[\d]+$/', $sValue)) - { - $iErrorCode = -1; - } - else if ($sValue === 'TOO_MANY_CONNECTIONS') - { - $iErrorCode = -1; - } - else - { - $iErrorCode = \RainLoop\Notifications::LicensingServerIsUnavailable; - } - } - - if (0 < $iErrorCode && !$mResult) - { - throw new \RainLoop\Exceptions\ClientException($iErrorCode); - } - - return $this->DefaultResponse(__FUNCTION__, $mResult); - } - - /** - * @return array - */ - public function DoAdminLicensingActivate() - { - $this->IsAdminLoggined(); - - $sDomain = (string) $this->GetActionParam('Domain', ''); - $sKey = (string) $this->GetActionParam('Key', ''); - - $mResult = false; - $iErrorCode = -1; - - $oPrem = $this->PremProvider(); - - if ($oPrem && 2 < \strlen($sDomain) && 2 < \strlen($sKey) && $sDomain === APP_SITE) - { - $iCode = 0; - $sValue = $oPrem->Activate($sDomain, $sKey, $iCode); - - $this->requestSleep(); - - $aMatch = array(); - if ('OK' === $sValue) - { - $mResult = true; - } - else if ('TOO_MANY_CONNECTIONS' === $sValue) - { - $mResult = 'Too many connections. Please try again later.'; - } - else if (\preg_match('/^ERROR:(.+)$/', $sValue, $aMatch) && !empty($aMatch[1])) - { - $mResult = trim($aMatch[1]); - - $this->Logger()->Write('Activation error for: '.$sKey.' ('.$sDomain.')', \MailSo\Log\Enumerations\Type::ERROR); - $this->Logger()->Write($mResult, \MailSo\Log\Enumerations\Type::ERROR); - } - else - { - $iErrorCode = \RainLoop\Notifications::LicensingServerIsUnavailable; - } - } - - if (0 < $iErrorCode && !$mResult) - { - throw new \RainLoop\Exceptions\ClientException($iErrorCode); - } - - return $this->DefaultResponse(__FUNCTION__, $mResult); - } - - /** - * @return array - */ - public function DoAdminPasswordUpdate() - { - $this->IsAdminLoggined(); - - $bResult = false; - $oConfig = $this->Config(); - - $sLogin = \trim($this->GetActionParam('Login', '')); - $sPassword = $this->GetActionParam('Password', ''); - $this->Logger()->AddSecret($sPassword); - - $sNewPassword = $this->GetActionParam('NewPassword', ''); - if (0 < \strlen(\trim($sNewPassword))) - { - $this->Logger()->AddSecret($sNewPassword); - } - - if ($oConfig->ValidatePassword($sPassword)) - { - if (0 < \strlen($sLogin)) - { - $oConfig->Set('security', 'admin_login', $sLogin); - } - - if (0 < \strlen(\trim($sNewPassword))) - { - $oConfig->SetPassword($sNewPassword); - } - - $bResult = true; - } - - return $this->DefaultResponse(__FUNCTION__, $bResult ? - ($oConfig->Save() ? array('Weak' => $oConfig->ValidatePassword('12345')) : false) : false); - } - - /** - * @return array - */ - public function DoAdminDomainLoad() - { - $this->IsAdminLoggined(); - - return $this->DefaultResponse(__FUNCTION__, - $this->DomainProvider()->Load($this->GetActionParam('Name', ''), false, false)); - } - - /** - * @return array - */ - public function DoAdminDomainList() - { - $this->IsAdminLoggined(); - - $iOffset = (int) $this->GetActionParam('Offset', 0); - $iLimit = (int) $this->GetActionParam('Limit', 20); - $sSearch = (string) $this->GetActionParam('Search', ''); - $bIncludeAliases = '1' === (string) $this->GetActionParam('IncludeAliases', '1'); - - $iOffset = 0; - $sSearch = ''; - $iLimit = $this->Config()->Get('labs', 'domain_list_limit', 99); - - return $this->DefaultResponse(__FUNCTION__, - $this->DomainProvider()->GetList($iOffset, $iLimit, $sSearch, $bIncludeAliases)); - } - - /** - * @return array - */ - public function DoAdminDomainDelete() - { - $this->IsAdminLoggined(); - - return $this->DefaultResponse(__FUNCTION__, - $this->DomainProvider()->Delete((string) $this->GetActionParam('Name', ''))); - } - - /** - * @return array - */ - public function DoAdminDomainDisable() - { - $this->IsAdminLoggined(); - - return $this->DefaultResponse(__FUNCTION__, $this->DomainProvider()->Disable( - (string) $this->GetActionParam('Name', ''), - '1' === (string) $this->GetActionParam('Disabled', '0') - )); - } - - /** - * @return array - */ - public function DoAdminDomainSave() - { - $this->IsAdminLoggined(); - - $oDomain = $this->DomainProvider()->LoadOrCreateNewFromAction($this); - - return $this->DefaultResponse(__FUNCTION__, - $oDomain instanceof \RainLoop\Model\Domain ? $this->DomainProvider()->Save($oDomain) : false); - } - - /** - * @return array - */ - public function DoAdminDomainAliasSave() - { - $this->IsAdminLoggined(); - - return $this->DefaultResponse(__FUNCTION__, $this->DomainProvider()->SaveAlias( - (string) $this->GetActionParam('Name', ''), - (string) $this->GetActionParam('Alias', '') - )); - } - - /** - * @return array - */ - public function DoAdminDomainTest() - { - $this->IsAdminLoggined(); - - $bImapResult = false; - $sImapErrorDesc = ''; - $bSmtpResult = false; - $sSmtpErrorDesc = ''; - $bSieveResult = false; - $sSieveErrorDesc = ''; - - $iImapTime = 0; - $iSmtpTime = 0; - $iSieveTime = 0; - - $iConnectionTimeout = 5; - - $oDomain = $this->DomainProvider()->LoadOrCreateNewFromAction($this, 'domain-test-connection.de'); - if ($oDomain) - { - try - { - $oImapClient = \MailSo\Imap\ImapClient::NewInstance()->SetLogger($this->Logger()); - $oImapClient->SetTimeOuts($iConnectionTimeout); - - $iTime = \microtime(true); - $oImapClient->Connect($oDomain->IncHost(), $oDomain->IncPort(), $oDomain->IncSecure(), - !!$this->Config()->Get('ssl', 'verify_certificate', false), - !!$this->Config()->Get('ssl', 'allow_self_signed', true) - ); - - $iImapTime = \microtime(true) - $iTime; - $oImapClient->Disconnect(); - $bImapResult = true; - } - catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException) - { - $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); - $sImapErrorDesc = $oException->getSocketMessage(); - if (empty($sImapErrorDesc)) - { - $sImapErrorDesc = $oException->getMessage(); - } - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); - $sImapErrorDesc = $oException->getMessage(); - } - - if ($oDomain->OutUsePhpMail()) - { - $bSmtpResult = \MailSo\Base\Utils::FunctionExistsAndEnabled('mail'); - if (!$bSmtpResult) - { - $sSmtpErrorDesc = 'PHP: mail() function is undefined'; - } - } - else - { - try - { - $oSmtpClient = \MailSo\Smtp\SmtpClient::NewInstance()->SetLogger($this->Logger()); - $oSmtpClient->SetTimeOuts($iConnectionTimeout); - - $iTime = \microtime(true); - $oSmtpClient->Connect($oDomain->OutHost(), $oDomain->OutPort(), - \MailSo\Smtp\SmtpClient::EhloHelper(), $oDomain->OutSecure(), - !!$this->Config()->Get('ssl', 'verify_certificate', false), - !!$this->Config()->Get('ssl', 'allow_self_signed', true) - ); - - $iSmtpTime = \microtime(true) - $iTime; - $oSmtpClient->Disconnect(); - $bSmtpResult = true; - } - catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException) - { - $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); - $sSmtpErrorDesc = $oException->getSocketMessage(); - if (empty($sSmtpErrorDesc)) - { - $sSmtpErrorDesc = $oException->getMessage(); - } - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); - $sSmtpErrorDesc = $oException->getMessage(); - } - } - - if ($oDomain->UseSieve()) - { - try - { - $oSieveClient = \MailSo\Sieve\ManageSieveClient::NewInstance()->SetLogger($this->Logger()); - $oSieveClient->SetTimeOuts($iConnectionTimeout); - - $iTime = \microtime(true); - $oSieveClient->Connect($oDomain->SieveHost(), $oDomain->SievePort(), $oDomain->SieveSecure(), - !!$this->Config()->Get('ssl', 'verify_certificate', false), - !!$this->Config()->Get('ssl', 'allow_self_signed', true) - ); - - $iSieveTime = \microtime(true) - $iTime; - $oSieveClient->Disconnect(); - $bSieveResult = true; - } - catch (\MailSo\Net\Exceptions\SocketCanNotConnectToHostException $oException) - { - $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); - $sSieveErrorDesc = $oException->getSocketMessage(); - if (empty($sSieveErrorDesc)) - { - $sSieveErrorDesc = $oException->getMessage(); - } - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); - $sSieveErrorDesc = $oException->getMessage(); - } - } - else - { - $bSieveResult = true; - } - } - - return $this->DefaultResponse(__FUNCTION__, array( - 'Imap' => $bImapResult ? true : $sImapErrorDesc, - 'Smtp' => $bSmtpResult ? true : $sSmtpErrorDesc, - 'Sieve' => $bSieveResult ? true : $sSieveErrorDesc - )); - } - - /** - * @return string - */ - private function rainLoopRepo() - { - $sUrl = APP_REPOSITORY_PATH; - if ('' !== $sUrl) - { - $sUrl = rtrim($sUrl, '\\/').'/'; - } - - return $sUrl; - } - - private function rainLoopUpdatable() - { - return @file_exists(APP_INDEX_ROOT_PATH.'index.php') && - @is_writable(APP_INDEX_ROOT_PATH.'index.php') && - @is_writable(APP_INDEX_ROOT_PATH.'rainloop/') && - APP_VERSION !== APP_DEV_VERSION - ; - } - - private function rainLoopCoreAccess() - { - $sCoreAccess = \strtolower(\preg_replace('/[\s,;]+/', ' ', - $this->Config()->Get('security', 'core_install_access_domain', ''))); - - return '' === $sCoreAccess || '*' === $sCoreAccess || APP_SITE === $sCoreAccess; - } - - /** - * @param string $sRepo - * @param bool $bReal = false - * - * @return array - */ - private function getRepositoryDataByUrl($sRepo, &$bReal = false) - { - $bReal = false; - $aRep = null; - - $sRep = ''; - $sRepoFile = 'repository.json'; - $iRepTime = 0; - - $oHttp = \MailSo\Base\Http::SingletonInstance(); - - $sCacheKey = \RainLoop\KeyPathHelper::RepositoryCacheFile($sRepo, $sRepoFile); - $sRep = $this->Cacher()->Get($sCacheKey); - if ('' !== $sRep) - { - $iRepTime = $this->Cacher()->GetTimer($sCacheKey); - } - - if ('' === $sRep || 0 === $iRepTime || time() - 3600 > $iRepTime) - { - $iCode = 0; - $sContentType = ''; - - $sRepPath = $sRepo.$sRepoFile; - $sRep = '' !== $sRepo ? $oHttp->GetUrlAsString($sRepPath, 'RainLoop', $sContentType, $iCode, $this->Logger(), 10, - $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', '')) : false; - - if (false !== $sRep) - { - $aRep = @\json_decode($sRep); - $bReal = \is_array($aRep) && 0 < \count($aRep); - - if ($bReal) - { - $this->Cacher()->Set($sCacheKey, $sRep); - $this->Cacher()->SetTimer($sCacheKey); - } - } - else - { - $this->Logger()->Write('Cannot read remote repository file: '.$sRepPath, \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER'); - } - } - else if ('' !== $sRep) - { - $aRep = @\json_decode($sRep, false, 10); - $bReal = \is_array($aRep) && 0 < \count($aRep); - } - - $aResult = array(); - if (\is_array($aRep)) - { - foreach ($aRep as $oItem) - { - if ($oItem && isset($oItem->type, $oItem->id, $oItem->name, - $oItem->version, $oItem->release, $oItem->file, $oItem->description)) - { - if (!empty($oItem->required) && APP_DEV_VERSION !== APP_VERSION && version_compare(APP_VERSION, $oItem->required, '<')) - { - continue; - } - - if (!empty($oItem->depricated) && APP_DEV_VERSION !== APP_VERSION && version_compare(APP_VERSION, $oItem->depricated, '>=')) - { - continue; - } - - if ('plugin' === $oItem->type) - { - $aResult[] = array( - 'type' => $oItem->type, - 'id' => $oItem->id, - 'name' => $oItem->name, - 'installed' => '', - 'version' => $oItem->version, - 'file' => $oItem->file, - 'release' => $oItem->release, - 'desc' => $oItem->description - ); - } - } - } - } - - return $aResult; - } - - /** - * @return string - */ - private function getCoreChannel() - { - $sChannel = \trim(\strtolower($this->Config()->Get('labs', 'update_channel', 'stable'))); - if (empty($sChannel) || !\in_array($sChannel, array('stable', 'beta'))) - { - $sChannel = 'stable'; - } - - return $sChannel; - } - - private function getCoreData(&$bReal) - { - $bReal = false; - - $sChannel = $this->getCoreChannel(); - - $sRepo = \str_replace('{{channel}}', $sChannel, APP_REPO_CORE_FILE); - - $oHttp = \MailSo\Base\Http::SingletonInstance(); - - $sCacheKey = \RainLoop\KeyPathHelper::RepositoryCacheCore($sRepo); - $sRep = $this->Cacher()->Get($sCacheKey); - if ('' !== $sRep) - { - $iRepTime = $this->Cacher()->GetTimer($sCacheKey); - } - - if ('' === $sRep || 0 === $iRepTime || time() - 3600 > $iRepTime) - { - $iCode = 0; - $sContentType = ''; - - $sRep = '' !== $sRepo ? $oHttp->GetUrlAsString($sRepo, 'RainLoop', $sContentType, $iCode, $this->Logger(), 10, - $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', '')) : false; - - if (false !== $sRep) - { - $aRep = @\json_decode($sRep, true, 10); - $bReal = \is_array($aRep) && 0 < \count($aRep) && isset($aRep['id']) && 'rainloop' === $aRep['id']; - - if ($bReal) - { - $this->Cacher()->Set($sCacheKey, $sRep); - $this->Cacher()->SetTimer($sCacheKey); - } - } - else - { - $this->Logger()->Write('Cannot read remote repository file: '.$sRepo, \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER'); - } - } - else if ('' !== $sRep) - { - $aRep = @\json_decode($sRep, true, 10); - $bReal = \is_array($aRep) && 0 < \count($aRep) && isset($aRep['id']) && 'rainloop' === $aRep['id']; - } - - return $bReal ? $aRep : false; - } - - private function getRepositoryData(&$bReal, &$bRainLoopUpdatable) - { - $bRainLoopUpdatable = $this->rainLoopUpdatable(); - - $aResult = $this->getRepositoryDataByUrl($this->rainLoopRepo(), $bReal); - - $aSub = array(); - if (\is_array($aResult)) - { - foreach ($aResult as $aItem) - { - if ('plugin' === $aItem['type']) - { - $aSub[] = $aItem; - } - } - - $aResult = $aSub; - unset($aSub); - } - - $aInstalled = $this->Plugins()->InstalledPlugins(); - if (\is_array($aInstalled)) - { - foreach ($aResult as &$aItem) - { - if ('plugin' === $aItem['type']) - { - foreach ($aInstalled as &$aSubItem) - { - if (\is_array($aSubItem) && isset($aSubItem[0]) && $aSubItem[0] === $aItem['id']) - { - $aSubItem[2] = true; - $aItem['installed'] = $aSubItem[1]; - } - } - } - } - - foreach ($aInstalled as $aSubItemSec) - { - if ($aSubItemSec && !isset($aSubItemSec[2])) - { - \array_push($aResult, array( - 'type' => 'plugin', - 'id' => $aSubItemSec[0], - 'name' => $aSubItemSec[0], - 'installed' => $aSubItemSec[1], - 'version' => '', - 'file' => '', - 'release' => '', - 'desc' => '' - )); - } - } - } - - foreach ($aResult as &$aItem) - { - $aItem['compare'] = \version_compare($aItem['installed'], $aItem['version'], '<'); - $aItem['canBeDeleted'] = '' !== $aItem['installed'] && 'plugin' === $aItem['type']; - $aItem['canBeUpdated'] = $aItem['compare']; - $aItem['canBeInstalled'] = true; - } - - return $aResult; - } - - /** - * @return array - */ - public function DoAdminPackagesList() - { - $this->IsAdminLoggined(); - - $bReal = false; - $bRainLoopUpdatable = false; - $aList = $this->getRepositoryData($bReal, $bRainLoopUpdatable); - - return $this->DefaultResponse(__FUNCTION__, array( - 'Real' => $bReal, - 'MainUpdatable' => $bRainLoopUpdatable, - 'List' => $aList - )); - } - - /** - * @return array - */ - public function DoAdminCoreData() - { - $this->IsAdminLoggined(); - - $bReal = false; - $aData = array(); - - $bRainLoopUpdatable = $this->rainLoopUpdatable(); - $bRainLoopAccess = $this->rainLoopCoreAccess(); - - if ($bRainLoopAccess) - { - $aData = $this->getCoreData($bReal); - } - - $sVersion = empty($aData['version']) ? '' : $aData['version']; - $sType = empty($aData['channel']) ? 'stable' : $aData['channel']; - - $sWarnings = empty($aData['warnings']) ? '' : $aData['warnings']; - $aWarnings = $sWarnings ? explode('|', $sWarnings) : array(); - - $sCurrentVersion = APP_VERSION; - - $bShowWarning = false; - if ($sCurrentVersion !== APP_DEV_VERSION) - { - foreach ($aWarnings as $sWarningVersion) - { - $sWarningVersion = \trim($sWarningVersion); - - if (\version_compare($sCurrentVersion, $sWarningVersion, '<') && - \version_compare($sVersion, $sWarningVersion, '>=')) - { - $bShowWarning = true; - break; - } - } - } - - return $this->DefaultResponse(__FUNCTION__, array( - 'Real' => $bReal, - 'Access' => $bRainLoopAccess, - 'Updatable' => $bRainLoopUpdatable, - 'Warning' => $bShowWarning, - 'Channel' => $this->getCoreChannel(), - 'Type' => $sType, - 'Version' => $sCurrentVersion, - 'RemoteVersion' => $sVersion, - 'RemoteRelease' => empty($aData['release']) ? '' : $aData['release'], - 'VersionCompare' => \version_compare($sCurrentVersion, $sVersion) - )); - } - - /** - * @return array - */ - public function DoAdminUpdateCoreData() - { - $this->IsAdminLoggined(); - - $bReal = false; - - $bRainLoopUpdatable = $this->rainLoopUpdatable(); - $bRainLoopAccess = $this->rainLoopCoreAccess(); - $oPremProvider = $this->PremProvider(); - - $aData = array(); - if ($bRainLoopUpdatable && $bRainLoopAccess) - { - $aData = $this->getCoreData($bReal); - } - - $bResult = false; - if ($bReal && $oPremProvider && !empty($aData['file'])) - { - $bResult = $oPremProvider->UpdateCore($this, $aData['file']); - } - - return $this->DefaultResponse(__FUNCTION__, $bResult); - } - - /** - * @return array - */ - public function DoAdminPackageDelete() - { - $this->IsAdminLoggined(); - - $sId = $this->GetActionParam('Id', ''); - - $bReal = false; - $bRainLoopUpdatable = false; - $aList = $this->getRepositoryData($bReal, $bRainLoopUpdatable); - - $sResultId = ''; - foreach ($aList as $oItem) - { - if ($oItem && 'plugin' === $oItem['type'] && $sId === $oItem['id']) - { - $sResultId = $sId; - break; - } - } - - $bResult = false; - if ('' !== $sResultId) - { - $bResult = \MailSo\Base\Utils::RecRmDir(APP_PLUGINS_PATH.$sResultId); - if ($bResult) - { - $this->pluginEnable($sResultId, false); - } - } - - return $this->DefaultResponse(__FUNCTION__, $bResult); - } - - /** - * @param string $sUrl - * - * @return string - */ - public function downloadRemotePackageByUrl($sUrl) - { - $bResult = false; - $sTmp = APP_PRIVATE_DATA.\md5(\microtime(true).$sUrl).'.zip'; - $pDest = @\fopen($sTmp, 'w+b'); - if ($pDest) - { - $iCode = 0; - $sContentType = ''; - - @\set_time_limit(120); - - $oHttp = \MailSo\Base\Http::SingletonInstance(); - $bResult = $oHttp->SaveUrlToFile($sUrl, $pDest, $sTmp, $sContentType, $iCode, $this->Logger(), 60, - $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', '')); - - if (!$bResult) - { - $this->Logger()->Write('Cannot save url to temp file: ', \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER'); - $this->Logger()->Write($sUrl.' -> '.$sTmp, \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER'); - } - - @\fclose($pDest); - } - else - { - $this->Logger()->Write('Cannot create temp file: '.$sTmp, \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER'); - } - - return $bResult ? $sTmp : ''; - } - - /** - * @return array - */ - public function DoAdminPackageInstall() - { - $this->IsAdminLoggined(); - - $sType = $this->GetActionParam('Type', ''); - $sId = $this->GetActionParam('Id', ''); - $sFile = $this->GetActionParam('File', ''); - - $this->Logger()->Write('Start package install: '.$sFile.' ('.$sType.')', \MailSo\Log\Enumerations\Type::INFO, 'INSTALLER'); - - $sRealFile = ''; - - $bReal = false; - $bRainLoopUpdatable = false; - $aList = $this->getRepositoryData($bReal, $bRainLoopUpdatable); - - if ('plugin' === $sType) - { - foreach ($aList as $oItem) - { - if ($oItem && $sFile === $oItem['file'] && $sId === $oItem['id']) - { - $sRealFile = $sFile; - break; - } - } - } - - $sTmp = ''; - $bResult = false; - if ('' !== $sRealFile) - { - $sUrl = $this->rainLoopRepo().$sRealFile; - $sTmp = $this->downloadRemotePackageByUrl($sUrl); - } - - if ('' !== $sTmp) - { - include_once APP_VERSION_ROOT_PATH.'app/libraries/pclzip/pclzip.lib.php'; - - $oArchive = new \PclZip($sTmp); - if ('plugin' === $sType) - { - $bResult = true; - if (\is_dir(APP_PLUGINS_PATH.$sId)) - { - $bResult = \MailSo\Base\Utils::RecRmDir(APP_PLUGINS_PATH.$sId); - if (!$bResult) - { - $this->Logger()->Write('Cannot remove previous plugin folder: '.$sId, \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER'); - } - } - - if ($bResult) - { - $bResult = 0 !== $oArchive->extract(PCLZIP_OPT_PATH, APP_PLUGINS_PATH); - if (!$bResult) - { - $this->Logger()->Write('Cannot extract package files: '.$oArchive->errorInfo(), \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER'); - } - } - } - - @\unlink($sTmp); - } - - return $this->DefaultResponse(__FUNCTION__, $bResult ? - ('plugin' !== $sType ? array('Reload' => true) : true) : false); - } - - /** - * @return array - */ - public function DoAdminPluginList() - { - $this->IsAdminLoggined(); - - $aResult = array(); - - $sEnabledPlugins = $this->Config()->Get('plugins', 'enabled_list', ''); - $aEnabledPlugins = \explode(',', \strtolower($sEnabledPlugins)); - $aEnabledPlugins = \array_map('trim', $aEnabledPlugins); - - $aList = $this->Plugins()->InstalledPlugins(); - foreach ($aList as $aItem) - { - $aResult[] = array( - 'Name' => $aItem[0], - 'Enabled' => \in_array(\strtolower($aItem[0]), $aEnabledPlugins), - 'Configured' => false - ); - } - - return $this->DefaultResponse(__FUNCTION__, $aResult); - } - - /** - * @param string $sName - * @param bool $bEnable = true - * @return bool - */ - private function pluginEnable($sName, $bEnable = true) - { - if (0 === \strlen($sName)) - { - return false; - } - - $oConfig = $this->Config(); - - $sEnabledPlugins = $oConfig->Get('plugins', 'enabled_list', ''); - $aEnabledPlugins = \explode(',', \strtolower($sEnabledPlugins)); - $aEnabledPlugins = \array_map('trim', $aEnabledPlugins); - - $aNewEnabledPlugins = array(); - if ($bEnable) - { - $aNewEnabledPlugins = $aEnabledPlugins; - $aNewEnabledPlugins[] = $sName; - } - else - { - foreach ($aEnabledPlugins as $sPlugin) - { - if ($sName !== $sPlugin && 0 < \strlen($sPlugin)) - { - $aNewEnabledPlugins[] = $sPlugin; - } - } - } - - $aNewEnabledPlugins = \array_unique($aNewEnabledPlugins); - $oConfig->Set('plugins', 'enabled_list', \trim(\implode(',', $aNewEnabledPlugins), ' ,')); - - return $oConfig->Save(); - } - - /** - * @return array - */ - public function DoAdminPluginDisable() - { - $this->IsAdminLoggined(); - - $sName = (string) $this->GetActionParam('Name', ''); - $bDisable = '1' === (string) $this->GetActionParam('Disabled', '1'); - - if (!$bDisable) - { - $oPlugin = $this->Plugins()->CreatePluginByName($sName); - if ($oPlugin && ($oPlugin instanceof \RainLoop\Plugins\AbstractPlugin)) - { - $sValue = $oPlugin->Supported(); - if (0 < \strlen($sValue)) - { - return $this->FalseResponse(__FUNCTION__, \RainLoop\Notifications::UnsupportedPluginPackage, $sValue); - } - } - else - { - return $this->FalseResponse(__FUNCTION__, \RainLoop\Notifications::InvalidPluginPackage); - } - } - - return $this->DefaultResponse(__FUNCTION__, $this->pluginEnable($sName, !$bDisable)); - } - - /** - * @return array - */ - public function DoAdminPluginLoad() - { - $this->IsAdminLoggined(); - - $mResult = false; - $sName = (string) $this->GetActionParam('Name', ''); - - if (!empty($sName)) - { - $oPlugin = $this->Plugins()->CreatePluginByName($sName); - if ($oPlugin) - { - $mResult = array( - 'Name' => $sName, - 'Readme' => file_exists($oPlugin->Path().'/README') ? file_get_contents($oPlugin->Path().'/README') : '', - 'Config' => array() - ); - - $aMap = $oPlugin->ConfigMap(); - $oConfig = $oPlugin->Config(); - if (is_array($aMap) && 0 < count($aMap)) - { - foreach ($aMap as $oItem) - { - if ($oItem && ($oItem instanceof \RainLoop\Plugins\Property)) - { - $aItem = $oItem->ToArray(); - $aItem[0] = $oConfig->Get('plugin', $oItem->Name(), ''); - if (\RainLoop\Enumerations\PluginPropertyType::PASSWORD === $oItem->Type()) - { - $aItem[0] = APP_DUMMY; - } - - $mResult['Config'][] = $aItem; - } - } - } - } - } - - return $this->DefaultResponse(__FUNCTION__, $mResult); - } - - /** - * @return array - */ - public function DoAdminPluginSettingsUpdate() - { - $this->IsAdminLoggined(); - - $mResult = false; - $sName = (string) $this->GetActionParam('Name', ''); - - if (!empty($sName)) - { - $oPlugin = $this->Plugins()->CreatePluginByName($sName); - if ($oPlugin) - { - $oConfig = $oPlugin->Config(); - $aMap = $oPlugin->ConfigMap(); - if (is_array($aMap) && 0 < count($aMap)) - { - foreach ($aMap as $oItem) - { - $sValue = $this->GetActionParam('_'.$oItem->Name(), $oConfig->Get('plugin', $oItem->Name())); - if (\RainLoop\Enumerations\PluginPropertyType::PASSWORD !== $oItem->Type() || APP_DUMMY !== $sValue) - { - $mResultValue = null; - switch ($oItem->Type()) { - case \RainLoop\Enumerations\PluginPropertyType::INT: - $mResultValue = (int) $sValue; - break; - case \RainLoop\Enumerations\PluginPropertyType::BOOL: - $mResultValue = '1' === (string) $sValue; - break; - case \RainLoop\Enumerations\PluginPropertyType::SELECTION: - if (is_array($oItem->DefaultValue()) && in_array($sValue, $oItem->DefaultValue())) - { - $mResultValue = (string) $sValue; - } - break; - case \RainLoop\Enumerations\PluginPropertyType::PASSWORD: - case \RainLoop\Enumerations\PluginPropertyType::STRING: - case \RainLoop\Enumerations\PluginPropertyType::STRING_TEXT: - $mResultValue = (string) $sValue; - break; - } - - if (null !== $mResultValue) - { - $oConfig->Set('plugin', $oItem->Name(), $mResultValue); - } - } - } - } - - $mResult = $oConfig->Save(); - } - } - - if (!$mResult) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSavePluginSettings); - } - - return $this->DefaultResponse(__FUNCTION__, true); - } - - /** - * @return array - */ - public function DoSettingsUpdate() - { - $oAccount = $this->getAccountFromToken(); - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::SETTINGS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $self = $this; - $oConfig = $this->Config(); - - $oSettings = $this->SettingsProvider()->Load($oAccount); - $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); - - if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) - { - $this->setSettingsFromParams($oSettings, 'Language', 'string', function ($sLanguage) use ($self) { - return $self->ValidateLanguage($sLanguage); - }); - } - else - { - $oSettings->SetConf('Language', $this->ValidateLanguage($oConfig->Get('webmail', 'language', 'en'))); - } - - if ($this->GetCapa(false, false, \RainLoop\Enumerations\Capa::THEMES, $oAccount)) - { - $this->setSettingsFromParams($oSettingsLocal, 'Theme', 'string', function ($sTheme) use ($self) { - return $self->ValidateTheme($sTheme); - }); - } - else - { - $oSettingsLocal->SetConf('Theme', $this->ValidateTheme($oConfig->Get('webmail', 'theme', 'Default'))); - } - - $this->setSettingsFromParams($oSettings, 'MPP', 'int', function ($iValue) { - return (int) (\in_array($iValue, array(10, 20, 30, 50, 100, 150, 200, 300)) ? $iValue : 20); - }); - - $this->setSettingsFromParams($oSettings, 'Layout', 'int', function ($iValue) { - return (int) (\in_array((int) $iValue, array(\RainLoop\Enumerations\Layout::NO_PREVIW, - \RainLoop\Enumerations\Layout::SIDE_PREVIEW, \RainLoop\Enumerations\Layout::BOTTOM_PREVIEW)) ? - $iValue : \RainLoop\Enumerations\Layout::SIDE_PREVIEW); - }); - - $this->setSettingsFromParams($oSettings, 'EditorDefaultType', 'string'); - $this->setSettingsFromParams($oSettings, 'ShowImages', 'bool'); - $this->setSettingsFromParams($oSettings, 'ContactsAutosave', 'bool'); - $this->setSettingsFromParams($oSettings, 'DesktopNotifications', 'bool'); - $this->setSettingsFromParams($oSettings, 'SoundNotification', 'bool'); - $this->setSettingsFromParams($oSettings, 'UseCheckboxesInList', 'bool'); - $this->setSettingsFromParams($oSettings, 'AutoLogout', 'int'); - - $this->setSettingsFromParams($oSettings, 'EnableTwoFactor', 'bool'); - - $this->setSettingsFromParams($oSettingsLocal, 'UseThreads', 'bool'); - $this->setSettingsFromParams($oSettingsLocal, 'ReplySameFolder', 'bool'); - - return $this->DefaultResponse(__FUNCTION__, - $this->SettingsProvider()->Save($oAccount, $oSettings) && - $this->SettingsProvider(true)->Save($oAccount, $oSettingsLocal)); - } - - /** - * @return array - */ - public function DoNoop() - { - $this->initMailClientConnection(); - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoPing() - { - return $this->DefaultResponse(__FUNCTION__, 'Pong'); - } - - /** - * @return array - */ - public function DoChangePassword() - { - $mResult = false; - - $oAccount = $this->getAccountFromToken(); - if ($oAccount) - { - try - { - $mResult = $this->ChangePasswordProvider()->ChangePassword( - $oAccount, - $this->GetActionParam('PrevPassword', ''), - $this->GetActionParam('NewPassword', '') - ); - } - catch (\Exception $oException) - { - $this->loginErrorDelay(); - $this->Logger()->Write('Error: Can\'t change password for '.$oAccount->Email().' account.', \MailSo\Log\Enumerations\Type::NOTICE); - - throw $oException; - } - } - - return $this->DefaultResponse(__FUNCTION__, $mResult); - } - - /** - * @return array - */ - public function DoJsInfo() - { - $bIsError = '1' === (string) $this->GetActionParam('IsError', '0'); - $mData = $this->GetActionParam('Data', null); - - $this->Logger()->WriteDump(is_array($mData) ? $mData : array(), - $bIsError ? \MailSo\Log\Enumerations\Type::ERROR : \MailSo\Log\Enumerations\Type::INFO, 'JS-INFO'); - - return $this->DefaultResponse(__FUNCTION__, true); - } - - /** - * @return array - */ - public function DoWelcomeClose() - { - $oAccount = $this->getAccountFromToken(); - if ($oAccount && !$oAccount->IsAdditionalAccount()) - { - $oSettings = $this->SettingsProvider()->Load($oAccount); - $oSettings->SetConf('LastWelcomePage', - $this->Config()->Get('branding', 'welcome_page_url', '')); - - return $this->DefaultResponse(__FUNCTION__, - $this->SettingsProvider()->Save($oAccount, $oSettings)); - } - - return $this->FalseResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoVersion() - { - return $this->DefaultResponse(__FUNCTION__, - APP_VERSION === (string) $this->GetActionParam('Version', '')); - } - - /** - * @return array - */ - public function DoJsError() - { - $sMessage = $this->GetActionParam('Message', ''); - if (0 < strlen($sMessage)) - { - $sFileName = $this->GetActionParam('FileName', ''); - $sLineNo = $this->GetActionParam('LineNo', ''); - $sLocation = $this->GetActionParam('Location', ''); - $sHtmlCapa = $this->GetActionParam('HtmlCapa', ''); - $sTimeOnPage = $this->GetActionParam('TimeOnPage', ''); - - $oHttp = $this->Http(); - - $this->Logger()->Write($sMessage.' ('.$sFileName.' ~ '.$sLineNo.')', \MailSo\Log\Enumerations\Type::ERROR, 'JS'); - $this->Logger()->WriteDump(array( - 'Location' => $sLocation, - 'Capability' => $sHtmlCapa, - 'TimeOnPage' => $sTimeOnPage, - 'HTTP_USER_AGENT' => $oHttp->GetServer('HTTP_USER_AGENT', ''), - 'HTTP_ACCEPT_ENCODING' => $oHttp->GetServer('HTTP_ACCEPT_ENCODING', ''), - 'HTTP_ACCEPT_LANGUAGE' => $oHttp->GetServer('HTTP_ACCEPT_LANGUAGE', '') - )); - } - - return $this->DefaultResponse(__FUNCTION__, true); - } - - /** - * @param \MailSo\Mail\FolderCollection $oFolders - * @return array - */ - private function recFoldersNames($oFolders) - { - $aResult = array(); - if ($oFolders) - { - $aFolders =& $oFolders->GetAsArray(); - - foreach ($aFolders as $oFolder) - { - $aResult[] = $oFolder->FullNameRaw()."|". - implode("|", $oFolder->Flags()).($oFolder->IsSubscribed() ? '1' : '0'); - - $oSub = $oFolder->SubFolders(); - if ($oSub && 0 < $oSub->Count()) - { - $aResult = \array_merge($aResult, $this->recFoldersNames($oSub)); - } - } - } - - return $aResult; - } - - /** - * @staticvar array $aCache - * @param \RainLoop\Model\Account $oAccount - * - * @return array - */ - private function systemFoldersNames($oAccount) - { - static $aCache = null; - if (null === $aCache) - { - $aCache = array( - - 'Sent' => \MailSo\Imap\Enumerations\FolderType::SENT, - - 'Send' => \MailSo\Imap\Enumerations\FolderType::SENT, - 'Sent Item' => \MailSo\Imap\Enumerations\FolderType::SENT, - 'Sent Items' => \MailSo\Imap\Enumerations\FolderType::SENT, - 'Send Item' => \MailSo\Imap\Enumerations\FolderType::SENT, - 'Send Items' => \MailSo\Imap\Enumerations\FolderType::SENT, - 'Sent Mail' => \MailSo\Imap\Enumerations\FolderType::SENT, - 'Sent Mails' => \MailSo\Imap\Enumerations\FolderType::SENT, - 'Send Mail' => \MailSo\Imap\Enumerations\FolderType::SENT, - 'Send Mails' => \MailSo\Imap\Enumerations\FolderType::SENT, - - 'Drafts' => \MailSo\Imap\Enumerations\FolderType::DRAFTS, - - 'Draft' => \MailSo\Imap\Enumerations\FolderType::DRAFTS, - 'Draft Mail' => \MailSo\Imap\Enumerations\FolderType::DRAFTS, - 'Draft Mails' => \MailSo\Imap\Enumerations\FolderType::DRAFTS, - 'Drafts Mail' => \MailSo\Imap\Enumerations\FolderType::DRAFTS, - 'Drafts Mails' => \MailSo\Imap\Enumerations\FolderType::DRAFTS, - - 'Spam' => \MailSo\Imap\Enumerations\FolderType::JUNK, - - 'Junk' => \MailSo\Imap\Enumerations\FolderType::JUNK, - 'Bulk Mail' => \MailSo\Imap\Enumerations\FolderType::JUNK, - 'Bulk Mails' => \MailSo\Imap\Enumerations\FolderType::JUNK, - - 'Trash' => \MailSo\Imap\Enumerations\FolderType::TRASH, - 'Deleted' => \MailSo\Imap\Enumerations\FolderType::TRASH, - 'Bin' => \MailSo\Imap\Enumerations\FolderType::TRASH, - - 'Archive' => \MailSo\Imap\Enumerations\FolderType::ALL, - - 'All' => \MailSo\Imap\Enumerations\FolderType::ALL, - 'All Mail' => \MailSo\Imap\Enumerations\FolderType::ALL, - 'All Mails' => \MailSo\Imap\Enumerations\FolderType::ALL, - 'AllMail' => \MailSo\Imap\Enumerations\FolderType::ALL, - 'AllMails' => \MailSo\Imap\Enumerations\FolderType::ALL, - ); - - $this->Plugins()->RunHook('filter.system-folders-names', array($oAccount, &$aCache)); - } - - return $aCache; - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param \MailSo\Mail\FolderCollection $oFolders - * @param array $aResult - * @param bool $bListFolderTypes = true - */ - private function recFoldersTypes($oAccount, $oFolders, &$aResult, $bListFolderTypes = true) - { - if ($oFolders) - { - $aFolders =& $oFolders->GetAsArray(); - if (\is_array($aFolders) && 0 < \count($aFolders)) - { - if ($bListFolderTypes) - { - foreach ($aFolders as $oFolder) - { - $iFolderListType = $oFolder->GetFolderListType(); - if (!isset($aResult[$iFolderListType]) && \in_array($iFolderListType, array( - \MailSo\Imap\Enumerations\FolderType::SENT, - \MailSo\Imap\Enumerations\FolderType::DRAFTS, - \MailSo\Imap\Enumerations\FolderType::JUNK, - \MailSo\Imap\Enumerations\FolderType::TRASH, - \MailSo\Imap\Enumerations\FolderType::ALL - ))) - { - $aResult[$iFolderListType] = $oFolder->FullNameRaw(); - } - } - - foreach ($aFolders as $oFolder) - { - $oSub = $oFolder->SubFolders(); - if ($oSub && 0 < $oSub->Count()) - { - $this->recFoldersTypes($oAccount, $oSub, $aResult, true); - } - } - } - - $aMap = $this->systemFoldersNames($oAccount); - foreach ($aFolders as $oFolder) - { - $sName = $oFolder->Name(); - $sFullName = $oFolder->FullName(); - - if (isset($aMap[$sName]) || isset($aMap[$sFullName])) - { - $iFolderType = isset($aMap[$sName]) ? $aMap[$sName] : $aMap[$sFullName]; - if (!isset($aResult[$iFolderType]) && \in_array($iFolderType, array( - \MailSo\Imap\Enumerations\FolderType::SENT, - \MailSo\Imap\Enumerations\FolderType::DRAFTS, - \MailSo\Imap\Enumerations\FolderType::JUNK, - \MailSo\Imap\Enumerations\FolderType::TRASH, - \MailSo\Imap\Enumerations\FolderType::ALL - ))) - { - $aResult[$iFolderType] = $oFolder->FullNameRaw(); - } - } - } - - foreach ($aFolders as $oFolder) - { - $oSub = $oFolder->SubFolders(); - if ($oSub && 0 < $oSub->Count()) - { - $this->recFoldersTypes($oAccount, $oSub, $aResult, false); - } - } - } - } - } - - /** - * @return array - */ - public function DoFolders() - { - $oAccount = $this->initMailClientConnection(); - - $oFolderCollection = null; - $this->Plugins()->RunHook('filter.folders-before', array($oAccount, &$oFolderCollection)); - - $bUseFolders = $this->GetCapa(false, false, \RainLoop\Enumerations\Capa::FOLDERS, $oAccount); - - if (null === $oFolderCollection) - { - $oFolderCollection = $this->MailClient()->Folders('', - $bUseFolders ? '*' : 'INBOX', - !!$this->Config()->Get('labs', 'use_imap_list_subscribe', true), - (int) $this->Config()->Get('labs', 'imap_folder_list_limit', 200) - ); - } - - $this->Plugins()->RunHook('filter.folders-post', array($oAccount, &$oFolderCollection)); - - if ($oFolderCollection instanceof \MailSo\Mail\FolderCollection) - { - $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); - - $aSystemFolders = array(); - $this->recFoldersTypes($oAccount, $oFolderCollection, $aSystemFolders); - $oFolderCollection->SystemFolders = $aSystemFolders; - - if ($bUseFolders && $this->Config()->Get('labs', 'autocreate_system_folders', true)) - { - $bDoItAgain = false; - - $sNamespace = $oFolderCollection->GetNamespace(); - $sParent = empty($sNamespace) ? '' : \substr($sNamespace, 0, -1); - - $sDelimiter = $oFolderCollection->FindDelimiter(); - - $aList = array(); - $aMap = $this->systemFoldersNames($oAccount); - - if ('' === $oSettingsLocal->GetConf('SentFolder', '')) - { - $aList[] = \MailSo\Imap\Enumerations\FolderType::SENT; - } - - if ('' === $oSettingsLocal->GetConf('DraftFolder', '')) - { - $aList[] = \MailSo\Imap\Enumerations\FolderType::DRAFTS; - } - - if ('' === $oSettingsLocal->GetConf('SpamFolder', '')) - { - $aList[] = \MailSo\Imap\Enumerations\FolderType::JUNK; - } - - if ('' === $oSettingsLocal->GetConf('TrashFolder', '')) - { - $aList[] = \MailSo\Imap\Enumerations\FolderType::TRASH; - } - - if ('' === $oSettingsLocal->GetConf('ArchiveFolder', '')) - { - $aList[] = \MailSo\Imap\Enumerations\FolderType::ALL; - } - - $this->Plugins()->RunHook('filter.folders-system-types', array($oAccount, &$aList)); - - foreach ($aList as $iType) - { - if (!isset($aSystemFolders[$iType])) - { - $mFolderNameToCreate = \array_search($iType, $aMap); - if (!empty($mFolderNameToCreate)) - { - $iPos = \strrpos($mFolderNameToCreate, $sDelimiter); - if (false !== $iPos) - { - $mNewParent = \substr($mFolderNameToCreate, 0, $iPos); - $mNewFolderNameToCreate = \substr($mFolderNameToCreate, $iPos + 1); - if (0 < \strlen($mNewFolderNameToCreate)) - { - $mFolderNameToCreate = $mNewFolderNameToCreate; - } - - if (0 < \strlen($mNewParent)) - { - $sParent = 0 < \strlen($sParent) ? $sParent.$sDelimiter.$mNewParent : $mNewParent; - } - } - - $sFullNameToCheck = \MailSo\Base\Utils::ConvertEncoding($mFolderNameToCreate, - \MailSo\Base\Enumerations\Charset::UTF_8, \MailSo\Base\Enumerations\Charset::UTF_7_IMAP); - - if (0 < \strlen(\trim($sParent))) - { - $sFullNameToCheck = $sParent.$sDelimiter.$sFullNameToCheck; - } - - if (!$oFolderCollection->GetByFullNameRaw($sFullNameToCheck)) - { - try - { - if ($this->MailClient()->FolderCreate($mFolderNameToCreate, $sParent, true, $sDelimiter)) - { - $bDoItAgain = true; - } - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException); - } - } - } - } - } - - if ($bDoItAgain) - { - $oFolderCollection = $this->MailClient()->Folders('', '*', - !!$this->Config()->Get('labs', 'use_imap_list_subscribe', true), - (int) $this->Config()->Get('labs', 'imap_folder_list_limit', 200) - ); - - if ($oFolderCollection) - { - $aSystemFolders = array(); - $this->recFoldersTypes($oAccount, $oFolderCollection, $aSystemFolders); - $oFolderCollection->SystemFolders = $aSystemFolders; - } - } - } - - if ($oFolderCollection) - { - $oFolderCollection->FoldersHash = \md5(\implode("\x0", $this->recFoldersNames($oFolderCollection))); - } - } - - $this->Plugins()->RunHook('filter.folders-complete', array($oAccount, &$oFolderCollection)); - - return $this->DefaultResponse(__FUNCTION__, $oFolderCollection); - } - - /** - * @return array - */ - public function DoFolderCreate() - { - $oAccount = $this->initMailClientConnection(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::FOLDERS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - try - { - $sFolderNameInUtf = $this->GetActionParam('Folder', ''); - $sFolderParentFullNameRaw = $this->GetActionParam('Parent', ''); - - $this->MailClient()->FolderCreate($sFolderNameInUtf, $sFolderParentFullNameRaw, - !!$this->Config()->Get('labs', 'use_imap_list_subscribe', true)); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantCreateFolder, $oException); - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoFolderSubscribe() - { - $oAccount = $this->initMailClientConnection(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::FOLDERS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sFolderFullNameRaw = $this->GetActionParam('Folder', ''); - $bSubscribe = '1' === (string) $this->GetActionParam('Subscribe', '0'); - - try - { - $this->MailClient()->FolderSubscribe($sFolderFullNameRaw, !!$bSubscribe); - } - catch (\Exception $oException) - { - if ($bSubscribe) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSubscribeFolder, $oException); - } - else - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantUnsubscribeFolder, $oException); - } - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoFolderCheckable() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::FOLDERS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sFolderFullNameRaw = $this->GetActionParam('Folder', ''); - $bCheckable = '1' === (string) $this->GetActionParam('Checkable', '0'); - - $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); - - $sCheckableFolder = $oSettingsLocal->GetConf('CheckableFolder', '[]'); - $aCheckableFolder = @\json_decode($sCheckableFolder); - - if (!\is_array($aCheckableFolder)) - { - $aCheckableFolder = array(); - } - - if ($bCheckable) - { - $aCheckableFolder[] = $sFolderFullNameRaw; - } - else - { - $aCheckableFolderNew = array(); - foreach ($aCheckableFolder as $sFolder) - { - if ($sFolder !== $sFolderFullNameRaw) - { - $aCheckableFolderNew[] = $sFolder; - } - } - $aCheckableFolder = $aCheckableFolderNew; - } - - $aCheckableFolder = \array_unique($aCheckableFolder); - - $oSettingsLocal->SetConf('CheckableFolder', @\json_encode($aCheckableFolder)); - - return $this->DefaultResponse(__FUNCTION__, - $this->SettingsProvider(true)->Save($oAccount, $oSettingsLocal)); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoFolderRename() - { - $oAccount = $this->initMailClientConnection(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::FOLDERS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sPrevFolderFullNameRaw = $this->GetActionParam('Folder', ''); - $sNewTopFolderNameInUtf = $this->GetActionParam('NewFolderName', ''); - - try - { - $this->MailClient()->FolderRename($sPrevFolderFullNameRaw, $sNewTopFolderNameInUtf, - !!$this->Config()->Get('labs', 'use_imap_list_subscribe', true)); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantRenameFolder, $oException); - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoFolderDelete() - { - $oAccount = $this->initMailClientConnection(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::FOLDERS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sFolderFullNameRaw = $this->GetActionParam('Folder', ''); - - try - { - $this->MailClient()->FolderDelete($sFolderFullNameRaw, - !!$this->Config()->Get('labs', 'use_imap_list_subscribe', true)); - } - catch (\MailSo\Mail\Exceptions\NonEmptyFolder $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantDeleteNonEmptyFolder, $oException); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantDeleteFolder, $oException); - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoFolderClear() - { - $this->initMailClientConnection(); - - $sFolderFullNameRaw = $this->GetActionParam('Folder', ''); - - try - { - $this->MailClient()->FolderClear($sFolderFullNameRaw); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::MailServerError, $oException); - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoFolderInformation() - { - $sFolder = $this->GetActionParam('Folder', ''); - $sPrevUidNext = $this->GetActionParam('UidNext', ''); - $aFlagsUids = array(); - $sFlagsUids = (string) $this->GetActionParam('FlagsUids', ''); - - $aFlagsFilteredUids = array(); - if (0 < strlen($sFlagsUids)) - { - $aFlagsUids = explode(',', $sFlagsUids); - $aFlagsFilteredUids = array_filter($aFlagsUids, function (&$sUid) { - $sUid = (int) trim($sUid); - return 0 < (int) trim($sUid); - }); - } - - $this->initMailClientConnection(); - - $sForwardedFlag = $this->Config()->Get('labs', 'imap_forwarded_flag', ''); - $sReadReceiptFlag = $this->Config()->Get('labs', 'imap_read_receipt_flag', ''); - try - { - $aInboxInformation = $this->MailClient()->FolderInformation( - $sFolder, $sPrevUidNext, $aFlagsFilteredUids - ); - - if (\is_array($aInboxInformation) && isset($aInboxInformation['Flags']) && \is_array($aInboxInformation['Flags'])) - { - foreach ($aInboxInformation['Flags'] as $iUid => $aFlags) - { - $aLowerFlags = array_map('strtolower', $aFlags); - $aInboxInformation['Flags'][$iUid] = array( - 'IsSeen' => in_array('\\seen', $aLowerFlags), - 'IsFlagged' => in_array('\\flagged', $aLowerFlags), - 'IsAnswered' => in_array('\\answered', $aLowerFlags), - 'IsDeleted' => in_array('\\deleted', $aLowerFlags), - 'IsForwarded' => 0 < strlen($sForwardedFlag) && in_array(strtolower($sForwardedFlag), $aLowerFlags), - 'IsReadReceipt' => 0 < strlen($sReadReceiptFlag) && in_array(strtolower($sReadReceiptFlag), $aLowerFlags) - ); - } - } - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::MailServerError, $oException); - } - - if (\is_array($aInboxInformation)) - { - $aInboxInformation['Version'] = APP_VERSION; - } - - return $this->DefaultResponse(__FUNCTION__, $aInboxInformation); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoFolderInformationMultiply() - { - $aResult = array( - 'List' => array(), - 'Version' => APP_VERSION - ); - - $aFolders = $this->GetActionParam('Folders', null); - if (\is_array($aFolders)) - { - $this->initMailClientConnection(); - - $aFolders = \array_unique($aFolders); - foreach ($aFolders as $sFolder) - { - if (0 < \strlen(\trim($sFolder)) && 'INBOX' !== \strtoupper($sFolder)) - { - try - { - $aInboxInformation = $this->MailClient()->FolderInformation($sFolder, '', array()); - if (\is_array($aInboxInformation) && isset($aInboxInformation['Folder'])) - { - $aResult['List'][] = $aInboxInformation; - } - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException); - } - } - } - } - - return $this->DefaultResponse(__FUNCTION__, $aResult); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoMessageList() - { -// \sleep(1); -// throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantGetMessageList); - - $sFolder = ''; - $iOffset = 0; - $iLimit = 20; - $sSearch = ''; - $sUidNext = ''; - $bUseThreads = false; - $sThreadUid = ''; - - $sRawKey = $this->GetActionParam('RawKey', ''); - $aValues = $this->getDecodedClientRawKeyValue($sRawKey, 9); - - if (\is_array($aValues) && 7 < \count($aValues)) - { - $sFolder =(string) $aValues[0]; - $iOffset = (int) $aValues[1]; - $iLimit = (int) $aValues[2]; - $sSearch = (string) $aValues[3]; - $sUidNext = (string) $aValues[6]; - $bUseThreads = (bool) $aValues[7]; - - if ($bUseThreads) - { - $sThreadUid = isset($aValues[8]) ? (string) $aValues[8] : ''; - } - - $this->verifyCacheByKey($sRawKey); - } - else - { - $sFolder = $this->GetActionParam('Folder', ''); - $iOffset = (int) $this->GetActionParam('Offset', 0); - $iLimit = (int) $this->GetActionParam('Limit', 10); - $sSearch = $this->GetActionParam('Search', ''); - $sUidNext = $this->GetActionParam('UidNext', ''); - $bUseThreads = '1' === (string) $this->GetActionParam('UseThreads', '0'); - - if ($bUseThreads) - { - $sThreadUid = (string) $this->GetActionParam('ThreadUid', ''); - } - } - - if (0 === strlen($sFolder)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantGetMessageList); - } - - $this->initMailClientConnection(); - - try - { - if (!$this->Config()->Get('labs', 'use_imap_thread', false)) - { - $bUseThreads = false; - } - - $oMessageList = $this->MailClient()->MessageList( - $sFolder, $iOffset, $iLimit, $sSearch, $sUidNext, - $this->cacherForUids(), - !!$this->Config()->Get('labs', 'use_imap_sort', false), - $bUseThreads, - $sThreadUid, - '' - ); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantGetMessageList, $oException); - } - - if ($oMessageList instanceof \MailSo\Mail\MessageCollection) - { - $this->cacheByKey($sRawKey); - } - - return $this->DefaultResponse(__FUNCTION__, $oMessageList); - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param bool $bWithDraftInfo = true - * - * @return \MailSo\Mime\Message - */ - private function buildMessage($oAccount, $bWithDraftInfo = true) - { - $sIdentityID = $this->GetActionParam('IdentityID', ''); - $sTo = $this->GetActionParam('To', ''); - $sCc = $this->GetActionParam('Cc', ''); - $sBcc = $this->GetActionParam('Bcc', ''); - $sReplyTo = $this->GetActionParam('ReplyTo', ''); - $sSubject = $this->GetActionParam('Subject', ''); - $bTextIsHtml = '1' === $this->GetActionParam('TextIsHtml', '0'); - $bReadReceiptRequest = '1' === $this->GetActionParam('ReadReceiptRequest', '0'); - $bMarkAsImportant = '1' === $this->GetActionParam('MarkAsImportant', '0'); - $sText = $this->GetActionParam('Text', ''); - $aAttachments = $this->GetActionParam('Attachments', null); - - $aDraftInfo = $this->GetActionParam('DraftInfo', null); - $sInReplyTo = $this->GetActionParam('InReplyTo', ''); - $sReferences = $this->GetActionParam('References', ''); - - $oMessage = \MailSo\Mime\Message::NewInstance(); - $oMessage->RegenerateMessageId(); - - $oMessage->SetXMailer('RainLoop/'.APP_VERSION); - - $oFromIdentity = $this->GetIdentityByID($oAccount, $sIdentityID); - if ($oFromIdentity) - { - $oMessage->SetFrom(\MailSo\Mime\Email::NewInstance( - $oFromIdentity->Email(), $oFromIdentity->Name())); - } - else - { - $oMessage->SetFrom(\MailSo\Mime\Email::Parse($oAccount->Email())); - } - - if (!empty($sReplyTo)) - { - $oReplyTo = \MailSo\Mime\EmailCollection::NewInstance($sReplyTo); - if ($oReplyTo && 0 < $oReplyTo->Count()) - { - $oMessage->SetReplyTo($oReplyTo); - } - } - - if ($bReadReceiptRequest) - { - $oMessage->SetReadReceipt($oAccount->Email()); - } - - if ($bMarkAsImportant) - { - $oMessage->SetPriority(\MailSo\Mime\Enumerations\MessagePriority::HIGH); - } - - $oMessage->SetSubject($sSubject); - - $oToEmails = \MailSo\Mime\EmailCollection::NewInstance($sTo); - if ($oToEmails && $oToEmails->Count()) - { - $oMessage->SetTo($oToEmails); - } - - $oCcEmails = \MailSo\Mime\EmailCollection::NewInstance($sCc); - if ($oCcEmails && $oCcEmails->Count()) - { - $oMessage->SetCc($oCcEmails); - } - - $oBccEmails = \MailSo\Mime\EmailCollection::NewInstance($sBcc); - if ($oBccEmails && $oBccEmails->Count()) - { - $oMessage->SetBcc($oBccEmails); - } - - if ($bWithDraftInfo && \is_array($aDraftInfo) && !empty($aDraftInfo[0]) && !empty($aDraftInfo[1]) && !empty($aDraftInfo[2])) - { - $oMessage->SetDraftInfo($aDraftInfo[0], $aDraftInfo[1], $aDraftInfo[2]); - } - - if (0 < \strlen($sInReplyTo)) - { - $oMessage->SetInReplyTo($sInReplyTo); - } - - if (0 < \strlen($sReferences)) - { - $oMessage->SetReferences($sReferences); - } - - $aFoundedCids = array(); - $mFoundDataURL = array(); - $aFoundedContentLocationUrls = array(); - - $sTextToAdd = $bTextIsHtml ? - \MailSo\Base\HtmlUtils::BuildHtml($sText, $aFoundedCids, $mFoundDataURL, $aFoundedContentLocationUrls) : $sText; - - $this->Plugins()->RunHook($bTextIsHtml ? 'filter.message-html' : 'filter.message-plain', - array($oAccount, &$oMessage, &$sTextToAdd)); - - if ($bTextIsHtml && 0 < \strlen($sTextToAdd)) - { - $sTextConverted = \MailSo\Base\HtmlUtils::ConvertHtmlToPlain($sTextToAdd); - $this->Plugins()->RunHook('filter.message-plain', array($oAccount, &$oMessage, &$sTextConverted)); - $oMessage->AddText($sTextConverted, false); - } - - $oMessage->AddText($sTextToAdd, $bTextIsHtml); - - if (\is_array($aAttachments)) - { - foreach ($aAttachments as $sTempName => $aData) - { - $sFileName = (string) $aData[0]; - $bIsInline = (bool) $aData[1]; - $sCID = (string) $aData[2]; - $sContentLocation = isset($aData[3]) ? (string) $aData[3] : ''; - - $rResource = $this->FilesProvider()->GetFile($oAccount, $sTempName); - if (\is_resource($rResource)) - { - $iFileSize = $this->FilesProvider()->FileSize($oAccount, $sTempName); - - $oMessage->Attachments()->Add( - \MailSo\Mime\Attachment::NewInstance($rResource, $sFileName, $iFileSize, $bIsInline, - \in_array(trim(trim($sCID), '<>'), $aFoundedCids), - $sCID, array(), $sContentLocation - ) - ); - } - } - } - - if ($mFoundDataURL && \is_array($mFoundDataURL) && 0 < \count($mFoundDataURL)) - { - foreach ($mFoundDataURL as $sCidHash => $sDataUrlString) - { - $aMatch = array(); - $sCID = '<'.$sCidHash.'>'; - if (\preg_match('/^data:(image\/[a-zA-Z0-9]+);base64,(.+)$/i', $sDataUrlString, $aMatch) && - !empty($aMatch[1]) && !empty($aMatch[2])) - { - $sRaw = \MailSo\Base\Utils::Base64Decode($aMatch[2]); - $iFileSize = \strlen($sRaw); - if (0 < $iFileSize) - { - $sFileName = \preg_replace('/[^a-z0-9]+/i', '.', $aMatch[1]); - $rResource = \MailSo\Base\ResourceRegistry::CreateMemoryResourceFromString($sRaw); - - $sRaw = ''; - unset($sRaw); - unset($aMatch); - - $oMessage->Attachments()->Add( - \MailSo\Mime\Attachment::NewInstance($rResource, $sFileName, $iFileSize, true, true, $sCID) - ); - } - } - } - } - - $this->Plugins()->RunHook('filter.build-message', array(&$oMessage)); - $this->Plugins()->RunHook('filter.build-message[2]', array(&$oMessage, $oAccount)); - - return $oMessage; - } - - /** - * @param \RainLoop\Model\Account $oAccount - * - * @return void - */ - private function deleteMessageAttachmnets($oAccount) - { - $aAttachments = $this->GetActionParam('Attachments', null); - - if (\is_array($aAttachments)) - { - foreach (\array_keys($aAttachments) as $sTempName) - { - if ($this->FilesProvider()->FileExists($oAccount, $sTempName)) - { - $this->FilesProvider()->Clear($oAccount, $sTempName); - } - } - } - } - - /** - * @param \RainLoop\Model\Account $oAccount - * - * @return \MailSo\Mime\Message - */ - private function buildReadReceiptMessage($oAccount) - { - $sReadReceipt = $this->GetActionParam('ReadReceipt', ''); - $sSubject = $this->GetActionParam('Subject', ''); - $sText = $this->GetActionParam('Text', ''); - - $oIdentity = $this->GetAccountIdentity($oAccount); - - if (empty($sReadReceipt) || empty($sSubject) || empty($sText) || !$oIdentity) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError); - } - - $oMessage = \MailSo\Mime\Message::NewInstance(); - $oMessage->RegenerateMessageId(); - - $oMessage->SetXMailer('RainLoop/'.APP_VERSION); - - $oMessage->SetFrom(\MailSo\Mime\Email::NewInstance($oIdentity->Email(), $oIdentity->Name())); - - $sReplyTo = $oIdentity->ReplyTo(); - if (!empty($sReplyTo)) - { - $oReplyTo = \MailSo\Mime\EmailCollection::NewInstance($sReplyTo); - if ($oReplyTo && $oReplyTo->Count()) - { - $oMessage->SetReplyTo($oReplyTo); - } - } - - $oMessage->SetSubject($sSubject); - - $oToEmails = \MailSo\Mime\EmailCollection::NewInstance($sReadReceipt); - if ($oToEmails && $oToEmails->Count()) - { - $oMessage->SetTo($oToEmails); - } - - $this->Plugins()->RunHook('filter.read-receipt-message-plain', array($oAccount, &$oMessage, &$sText)); - - $oMessage->AddText($sText, false); - - $this->Plugins()->RunHook('filter.build-read-receipt-message', array(&$oMessage, $oAccount)); - - return $oMessage; - } - - /** - * @return array - */ - public function DoSaveMessage() - { - $oAccount = $this->initMailClientConnection(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::COMPOSER, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sMessageFolder = $this->GetActionParam('MessageFolder', ''); - $sMessageUid = $this->GetActionParam('MessageUid', ''); - - $sDraftFolder = $this->GetActionParam('DraftFolder', ''); - if (0 === strlen($sDraftFolder)) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError); - } - - $oMessage = $this->buildMessage($oAccount, true); - - $this->Plugins() - ->RunHook('filter.save-message', array(&$oMessage)) - ->RunHook('filter.save-message[2]', array(&$oMessage, $oAccount)) - ; - - $mResult = false; - if ($oMessage) - { - $rMessageStream = \MailSo\Base\ResourceRegistry::CreateMemoryResource(); - - $iMessageStreamSize = \MailSo\Base\Utils::MultipleStreamWriter( - $oMessage->ToStream(false), array($rMessageStream), 8192, true, true); - - if (false !== $iMessageStreamSize) - { - $sMessageId = $oMessage->MessageId(); - - \rewind($rMessageStream); - - $iNewUid = 0; - $this->MailClient()->MessageAppendStream( - $rMessageStream, $iMessageStreamSize, $sDraftFolder, array( - \MailSo\Imap\Enumerations\MessageFlag::SEEN - ), $iNewUid); - - if (!empty($sMessageId) && (null === $iNewUid || 0 === $iNewUid)) - { - $iNewUid = $this->MailClient()->FindMessageUidByMessageId($sDraftFolder, $sMessageId); - } - - $mResult = true; - - if (0 < strlen($sMessageFolder) && 0 < strlen($sMessageUid)) - { - $this->MailClient()->MessageDelete($sMessageFolder, array($sMessageUid), true, true); - } - - if (null !== $iNewUid && 0 < $iNewUid) - { - $mResult = array( - 'NewFolder' => $sDraftFolder, - 'NewUid' => $iNewUid - ); - } - } - } - - return $this->DefaultResponse(__FUNCTION__, $mResult); - } - - /** - * - * @param \RainLoop\Model\Account $oAccount - * @param \MailSo\Mime\Message $oMessage - * @param resource $rMessageStream - * @param bool $bDsn = false - * @param bool $bAddHiddenRcpt = true - * - * @throws \RainLoop\Exceptions\ClientException - * @throws \MailSo\Net\Exceptions\ConnectionException - */ - private function smtpSendMessage($oAccount, $oMessage, - &$rMessageStream, &$iMessageStreamSize, $bDsn = false, $bAddHiddenRcpt = true) - { - $oRcpt = $oMessage->GetRcpt(); - if ($oRcpt && 0 < $oRcpt->Count()) - { - $this->Plugins()->RunHook('filter.smtp-message-stream', - array($oAccount, &$rMessageStream, &$iMessageStreamSize)); - - $this->Plugins()->RunHook('filter.message-rcpt', array($oAccount, &$oRcpt)); - - try - { - $oFrom = $oMessage->GetFrom(); - $sFrom = $oFrom instanceof \MailSo\Mime\Email ? $oFrom->GetEmail() : ''; - $sFrom = empty($sFrom) ? $oAccount->Email() : $sFrom; - - $this->Plugins()->RunHook('filter.smtp-from', array($oAccount, $oMessage, &$sFrom)); - - $aHiddenRcpt = array(); - if ($bAddHiddenRcpt) - { - $this->Plugins()->RunHook('filter.smtp-hidden-rcpt', array($oAccount, $oMessage, &$aHiddenRcpt)); - } - - $bUsePhpMail = $oAccount->Domain()->OutUsePhpMail(); - - $oSmtpClient = \MailSo\Smtp\SmtpClient::NewInstance()->SetLogger($this->Logger()); - $oSmtpClient->SetTimeOuts(10, (int) \RainLoop\Api::Config()->Get('labs', 'smtp_timeout', 60)); - - $bLoggined = $oAccount->OutConnectAndLoginHelper($this->Plugins(), $oSmtpClient, $this->Config(), $bUsePhpMail); - - if ($bUsePhpMail) - { - if (\MailSo\Base\Utils::FunctionExistsAndEnabled('mail')) - { - $aToCollection = $oMessage->GetTo(); - if ($aToCollection && $oFrom) - { - $sRawBody = @\stream_get_contents($rMessageStream); - if (!empty($sRawBody)) - { - $sMailTo = \trim($aToCollection->ToString(true)); - $sMailSubject = \trim($oMessage->GetSubject()); - $sMailSubject = 0 === \strlen($sMailSubject) ? '' : \MailSo\Base\Utils::EncodeUnencodedValue( - \MailSo\Base\Enumerations\Encoding::BASE64_SHORT, $sMailSubject); - - $sMailHeaders = $sMailBody = ''; - list($sMailHeaders, $sMailBody) = \explode("\r\n\r\n", $sRawBody, 2); - unset($sRawBody); - - if ($this->Config()->Get('labs', 'mail_func_clear_headers', true)) - { - $sMailHeaders = \MailSo\Base\Utils::RemoveHeaderFromHeaders($sMailHeaders, array( - \MailSo\Mime\Enumerations\Header::TO_, - \MailSo\Mime\Enumerations\Header::SUBJECT - )); - } - - if ($this->Config()->Get('debug', 'enable', false)) - { - $this->Logger()->WriteDump(array( - $sMailTo, $sMailSubject, $sMailBody, $sMailHeaders - )); - } - - $bR = $this->Config()->Get('labs', 'mail_func_additional_parameters', false) ? - \mail($sMailTo, $sMailSubject, $sMailBody, $sMailHeaders, '-f'.$oFrom->GetEmail()) : - \mail($sMailTo, $sMailSubject, $sMailBody, $sMailHeaders); - - if (!$bR) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSendMessage); - } - } - } - } - else - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSendMessage); - } - } - else if ($oSmtpClient->IsConnected()) - { - if (!empty($sFrom)) - { - $oSmtpClient->MailFrom($sFrom, '', $bDsn); - } - - $aRcpt =& $oRcpt->GetAsArray(); - foreach ($aRcpt as /* @var $oEmail \MailSo\Mime\Email */ $oEmail) - { - $oSmtpClient->Rcpt($oEmail->GetEmail(), $bDsn); - } - - if ($bAddHiddenRcpt && \is_array($aHiddenRcpt) && 0 < \count($aHiddenRcpt)) - { - foreach ($aHiddenRcpt as $sEmail) - { - if (\preg_match('/^[^@\s]+@[^@\s]+$/', $sEmail)) - { - $oSmtpClient->Rcpt($sEmail); - } - } - } - - $oSmtpClient->DataWithStream($rMessageStream); - - if ($bLoggined) - { - $oSmtpClient->Logout(); - } - - $oSmtpClient->Disconnect(); - } - } - catch (\MailSo\Net\Exceptions\ConnectionException $oException) - { - if ($this->Config()->Get('labs', 'smtp_show_server_errors')) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ClientViewError, $oException); - } - else - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ConnectionError, $oException); - } - } - catch (\MailSo\Smtp\Exceptions\LoginException $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException); - } - catch (\Exception $oException) - { - if ($this->Config()->Get('labs', 'smtp_show_server_errors')) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ClientViewError, $oException); - } - else - { - throw $oException; - } - } - } - else - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::InvalidRecipients); - } - } - - /** - * @return array - */ - public function DoSendMessage() - { - $oAccount = $this->initMailClientConnection(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::COMPOSER, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $oConfig = $this->Config(); - - $sDraftFolder = $this->GetActionParam('MessageFolder', ''); - $sDraftUid = $this->GetActionParam('MessageUid', ''); - $sSentFolder = $this->GetActionParam('SentFolder', ''); - $aDraftInfo = $this->GetActionParam('DraftInfo', null); - $bDsn = '1' === (string) $this->GetActionParam('Dsn', '0'); - - $oMessage = $this->buildMessage($oAccount, false); - - $this->Plugins() - ->RunHook('filter.send-message', array(&$oMessage)) - ->RunHook('filter.send-message[2]', array(&$oMessage, $oAccount)) - ; - - $mResult = false; - try - { - if ($oMessage) - { - $rMessageStream = \MailSo\Base\ResourceRegistry::CreateMemoryResource(); - - $iMessageStreamSize = \MailSo\Base\Utils::MultipleStreamWriter( - $oMessage->ToStream(true), array($rMessageStream), 8192, true, true, true); - - if (false !== $iMessageStreamSize) - { - $this->smtpSendMessage($oAccount, $oMessage, $rMessageStream, $iMessageStreamSize, $bDsn, true); - - if (\is_array($aDraftInfo) && 3 === \count($aDraftInfo)) - { - $sDraftInfoType = $aDraftInfo[0]; - $sDraftInfoUid = $aDraftInfo[1]; - $sDraftInfoFolder = $aDraftInfo[2]; - - try - { - switch (\strtolower($sDraftInfoType)) - { - case 'reply': - case 'reply-all': - $this->MailClient()->MessageSetFlag($sDraftInfoFolder, array($sDraftInfoUid), true, - \MailSo\Imap\Enumerations\MessageFlag::ANSWERED, true); - break; - case 'forward': - $sForwardedFlag = $this->Config()->Get('labs', 'imap_forwarded_flag', ''); - if (0 < strlen($sForwardedFlag)) - { - $this->MailClient()->MessageSetFlag($sDraftInfoFolder, array($sDraftInfoUid), true, - $sForwardedFlag, true); - } - break; - } - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); - } - } - - if (0 < \strlen($sSentFolder)) - { - try - { - if (!$oMessage->GetBcc()) - { - if (\is_resource($rMessageStream)) - { - \rewind($rMessageStream); - } - - $this->Plugins()->RunHook('filter.sent-message-stream', - array($oAccount, &$rMessageStream, &$iMessageStreamSize)); - - $this->MailClient()->MessageAppendStream( - $rMessageStream, $iMessageStreamSize, $sSentFolder, array( - \MailSo\Imap\Enumerations\MessageFlag::SEEN - ) - ); - } - else - { - $rAppendMessageStream = \MailSo\Base\ResourceRegistry::CreateMemoryResource(); - - $iAppendMessageStreamSize = \MailSo\Base\Utils::MultipleStreamWriter( - $oMessage->ToStream(false), array($rAppendMessageStream), 8192, true, true, true); - - $this->Plugins()->RunHook('filter.sent-message-stream', - array($oAccount, &$rAppendMessageStream, &$iAppendMessageStreamSize)); - - $this->MailClient()->MessageAppendStream( - $rAppendMessageStream, $iAppendMessageStreamSize, $sSentFolder, array( - \MailSo\Imap\Enumerations\MessageFlag::SEEN - )); - - if (\is_resource($rAppendMessageStream)) - { - @fclose($rAppendMessageStream); - } - } - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSaveMessage, $oException); - } - } - - if (\is_resource($rMessageStream)) - { - @\fclose($rMessageStream); - } - - $this->deleteMessageAttachmnets($oAccount); - - if (0 < \strlen($sDraftFolder) && 0 < \strlen($sDraftUid)) - { - try - { - $this->MailClient()->MessageDelete($sDraftFolder, array($sDraftUid), true, true); - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); - } - } - - $mResult = true; - } - } - } - catch (\RainLoop\Exceptions\ClientException $oException) - { - throw $oException; - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSendMessage, $oException); - } - - if (false === $mResult) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSendMessage); - } - - try - { - if ($oMessage && $this->AddressBookProvider($oAccount)->IsActive()) - { - $aArrayToFrec = array(); - $oToCollection = $oMessage->GetTo(); - if ($oToCollection) - { - $aTo =& $oToCollection->GetAsArray(); - foreach ($aTo as /* @var $oEmail \MailSo\Mime\Email */ $oEmail) - { - $aArrayToFrec[$oEmail->GetEmail(true)] = $oEmail->ToString(false, true); - } - } - - if (0 < \count($aArrayToFrec)) - { - $oSettings = $this->SettingsProvider()->Load($oAccount); - - $this->AddressBookProvider($oAccount)->IncFrec( - $oAccount->ParentEmailHelper(), \array_values($aArrayToFrec), - !!$oSettings->GetConf('ContactsAutosave', - !!$oConfig->Get('defaults', 'contacts_autosave', true))); - } - } - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException); - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoSendReadReceiptMessage() - { - $oAccount = $this->initMailClientConnection(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::COMPOSER, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $oMessage = $this->buildReadReceiptMessage($oAccount); - - $this->Plugins()->RunHook('filter.send-read-receipt-message', array(&$oMessage, $oAccount)); - - $mResult = false; - try - { - if ($oMessage) - { - $rMessageStream = \MailSo\Base\ResourceRegistry::CreateMemoryResource(); - - $iMessageStreamSize = \MailSo\Base\Utils::MultipleStreamWriter( - $oMessage->ToStream(true), array($rMessageStream), 8192, true, true, true); - - if (false !== $iMessageStreamSize) - { - $this->smtpSendMessage($oAccount, $oMessage, $rMessageStream, $iMessageStreamSize, false, false); - - if (\is_resource($rMessageStream)) - { - @\fclose($rMessageStream); - } - - $mResult = true; - - $sReadReceiptFlag = $this->Config()->Get('labs', 'imap_read_receipt_flag', ''); - if (!empty($sReadReceiptFlag)) - { - $sFolderFullName = $this->GetActionParam('MessageFolder', ''); - $sUid = $this->GetActionParam('MessageUid', ''); - - $this->Cacher($oAccount)->Set(\RainLoop\KeyPathHelper::ReadReceiptCache($oAccount->Email(), $sFolderFullName, $sUid), '1'); - - if (0 < \strlen($sFolderFullName) && 0 < \strlen($sUid)) - { - try - { - $this->MailClient()->MessageSetFlag($sFolderFullName, array($sUid), true, $sReadReceiptFlag, true, true); - } - catch (\Exception $oException) {} - } - } - } - } - } - catch (\RainLoop\Exceptions\ClientException $oException) - { - throw $oException; - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSendMessage, $oException); - } - - if (false === $mResult) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantSendMessage); - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoQuota() - { - $oAccount = $this->initMailClientConnection(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::QUOTA, $oAccount)) - { - return $this->DefaultResponse(__FUNCTION__, array(0, 0, 0, 0)); - } - - try - { - $aQuota = $this->MailClient()->Quota(); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::MailServerError, $oException); - } - - return $this->DefaultResponse(__FUNCTION__, $aQuota); - } - - private function getContactsSyncData($oAccount) - { - $mResult = null; - - $sData = $this->StorageProvider()->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'contacts_sync' - ); - - if (!empty($sData)) - { - $mData = \RainLoop\Utils::DecodeKeyValues($sData); - if (\is_array($mData)) - { - $mResult = array( - 'Enable' => isset($mData['Enable']) ? !!$mData['Enable'] : false, - 'Url' => isset($mData['Url']) ? \trim($mData['Url']) : '', - 'User' => isset($mData['User']) ? \trim($mData['User']) : '', - 'Password' => isset($mData['Password']) ? $mData['Password'] : '' - ); - } - } - - return $mResult; - } - - /** - * @return array - */ - public function DoSaveContactsSyncData() - { - $oAccount = $this->getAccountFromToken(); - - $oAddressBookProvider = $this->AddressBookProvider($oAccount); - if (!$oAddressBookProvider || !$oAddressBookProvider->IsActive()) - { - return $this->FalseResponse(__FUNCTION__); - } - - $bEnabled = '1' === (string) $this->GetActionParam('Enable', '0'); - $sUrl = $this->GetActionParam('Url', ''); - $sUser = $this->GetActionParam('User', ''); - $sPassword = $this->GetActionParam('Password', ''); - - $mData = $this->getContactsSyncData($oAccount); - - $bResult = $this->StorageProvider()->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'contacts_sync', - \RainLoop\Utils::EncodeKeyValues(array( - 'Enable' => $bEnabled, - 'User' => $sUser, - 'Password' => APP_DUMMY === $sPassword && isset($mData['Password']) ? - $mData['Password'] : (APP_DUMMY === $sPassword ? '' : $sPassword), - 'Url' => $sUrl - )) - ); - - return $this->DefaultResponse(__FUNCTION__, $bResult); - } - - /** - * @return array - */ - public function DoContactsSync() - { - $bResult = false; - $oAccount = $this->getAccountFromToken(); - - $oAddressBookProvider = $this->AddressBookProvider($oAccount); - if ($oAddressBookProvider && $oAddressBookProvider->IsActive()) - { - $mData = $this->getContactsSyncData($oAccount); - if (\is_array($mData) && isset($mData['Enable'], $mData['User'], $mData['Password'], $mData['Url']) && $mData['Enable']) - { - $bResult = $oAddressBookProvider->Sync( - $oAccount->ParentEmailHelper(), - $mData['Url'], $mData['User'], $mData['Password']); - } - } - - if (!$bResult) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ContactsSyncError); - } - - return $this->TrueResponse(__FUNCTION__); - } - - private function getTwoFactorInfo($oAccount, $bRemoveSecret = false) - { - $sEmail = $oAccount->ParentEmailHelper(); - - $mData = null; - - $aResult = array( - 'User' => '', - 'IsSet' => false, - 'Enable' => false, - 'Secret' => '', - 'UrlTitle' => '', - 'BackupCodes' => '' - ); - - if (!empty($sEmail)) - { - $aResult['User'] = $sEmail; - - $sData = $this->StorageProvider()->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'two_factor' - ); - - if ($sData) - { - $mData = \RainLoop\Utils::DecodeKeyValues($sData); - } - } - - if (\is_array($mData) && !empty($aResult['User']) && - !empty($mData['User']) && !empty($mData['Secret']) && - !empty($mData['BackupCodes']) && $sEmail === $mData['User']) - { - $aResult['IsSet'] = true; - $aResult['Enable'] = isset($mData['Enable']) ? !!$mData['Enable'] : false; - $aResult['Secret'] = $mData['Secret']; - $aResult['BackupCodes'] = $mData['BackupCodes']; - $aResult['UrlTitle'] = $this->Config()->Get('webmail', 'title', ''); - } - - if ($bRemoveSecret) - { - if (isset($aResult['Secret'])) - { - unset($aResult['Secret']); - } - - if (isset($aResult['UrlTitle'])) - { - unset($aResult['UrlTitle']); - } - - if (isset($aResult['BackupCodes'])) - { - unset($aResult['BackupCodes']); - } - } - - return $aResult; - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param string $sCode - * - * @return bool - */ - private function removeBackupCodeFromTwoFactorInfo($oAccount, $sCode) - { - if (!$oAccount || empty($sCode)) - { - return false; - } - - $sData = $this->StorageProvider()->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'two_factor' - ); - - if ($sData) - { - $mData = \RainLoop\Utils::DecodeKeyValues($sData); - - if (!empty($mData['BackupCodes'])) - { - $sBackupCodes = \preg_replace('/[^\d]+/', ' ', ' '.$mData['BackupCodes'].' '); - $sBackupCodes = \str_replace(' '.$sCode.' ', '', $sBackupCodes); - - $mData['BackupCodes'] = \trim(\preg_replace('/[^\d]+/', ' ', $sBackupCodes)); - - return $this->StorageProvider()->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'two_factor', - \RainLoop\Utils::EncodeKeyValues($mData) - ); - } - } - - return false; - } - - /** - * @return array - */ - public function DoGetTwoFactorInfo() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->TwoFactorAuthProvider()->IsActive() || - !$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TWO_FACTOR, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - return $this->DefaultResponse(__FUNCTION__, - $this->getTwoFactorInfo($oAccount, true)); - } - - /** - * @return array - */ - public function DoCreateTwoFactorSecret() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->TwoFactorAuthProvider()->IsActive() || - !$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TWO_FACTOR, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sEmail = $oAccount->ParentEmailHelper(); - - $sSecret = $this->TwoFactorAuthProvider()->CreateSecret(); - - $aCodes = array(); - for ($iIndex = 9; $iIndex > 0; $iIndex--) - { - $aCodes[] = \rand(100000000, 900000000); - } - - $this->StorageProvider()->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'two_factor', - \RainLoop\Utils::EncodeKeyValues(array( - 'User' => $sEmail, - 'Enable' => false, - 'Secret' => $sSecret, - 'BackupCodes' => \implode(' ', $aCodes) - )) - ); - - $this->requestSleep(); - - return $this->DefaultResponse(__FUNCTION__, - $this->getTwoFactorInfo($oAccount)); - } - - /** - * @return array - */ - public function DoShowTwoFactorSecret() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->TwoFactorAuthProvider()->IsActive() || - !$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TWO_FACTOR, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $aResult = $this->getTwoFactorInfo($oAccount); - if (\is_array($aResult)) - { - unset($aResult['BackupCodes']); - } - - return $this->DefaultResponse(__FUNCTION__, $aResult); - } - - /** - * @return array - */ - public function DoEnableTwoFactor() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->TwoFactorAuthProvider()->IsActive() || - !$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TWO_FACTOR, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sEmail = $oAccount->ParentEmailHelper(); - - $bResult = false; - $mData = $this->getTwoFactorInfo($oAccount); - if (isset($mData['Secret'], $mData['BackupCodes'])) - { - $bResult = $this->StorageProvider()->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'two_factor', - \RainLoop\Utils::EncodeKeyValues(array( - 'User' => $sEmail, - 'Enable' => '1' === \trim($this->GetActionParam('Enable', '0')), - 'Secret' => $mData['Secret'], - 'BackupCodes' => $mData['BackupCodes'] - )) - ); - } - - return $this->DefaultResponse(__FUNCTION__, $bResult); - } - - /** - * @return array - */ - public function DoTestTwoFactorInfo() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->TwoFactorAuthProvider()->IsActive() || - !$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TWO_FACTOR, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sCode = \trim($this->GetActionParam('Code', '')); - - $aData = $this->getTwoFactorInfo($oAccount); - $sSecret = !empty($aData['Secret']) ? $aData['Secret'] : ''; - -// $this->Logger()->WriteDump(array( -// $sCode, $sSecret, $aData, -// $this->TwoFactorAuthProvider()->VerifyCode($sSecret, $sCode) -// )); - - $this->requestSleep(); - - return $this->DefaultResponse(__FUNCTION__, - $this->TwoFactorAuthProvider()->VerifyCode($sSecret, $sCode)); - } - - /** - * @return array - */ - public function DoClearTwoFactorInfo() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->TwoFactorAuthProvider()->IsActive() || - !$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::TWO_FACTOR, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $this->StorageProvider()->Clear($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'two_factor' - ); - - return $this->DefaultResponse(__FUNCTION__, - $this->getTwoFactorInfo($oAccount, true)); - } - - /** - * @return array - */ - public function DoContacts() - { - $oAccount = $this->getAccountFromToken(); - - $sSearch = \trim($this->GetActionParam('Search', '')); - $iOffset = (int) $this->GetActionParam('Offset', 0); - $iLimit = (int) $this->GetActionParam('Limit', 20); - $iOffset = 0 > $iOffset ? 0 : $iOffset; - $iLimit = 0 > $iLimit ? 20 : $iLimit; - - $iResultCount = 0; - $mResult = array(); - - $oAbp = $this->AddressBookProvider($oAccount); - if ($oAbp->IsActive()) - { - $iResultCount = 0; - $mResult = $oAbp->GetContacts($oAccount->ParentEmailHelper(), - $iOffset, $iLimit, $sSearch, $iResultCount); - } - - return $this->DefaultResponse(__FUNCTION__, array( - 'Offset' => $iOffset, - 'Limit' => $iLimit, - 'Count' => $iResultCount, - 'Search' => $sSearch, - 'List' => $mResult - )); - } - - /** - * @return array - */ - public function DoContactsDelete() - { - $oAccount = $this->getAccountFromToken(); - $aUids = \explode(',', (string) $this->GetActionParam('Uids', '')); - - $aFilteredUids = \array_filter($aUids, function (&$mUid) { - $mUid = (int) \trim($mUid); - return 0 < $mUid; - }); - - $bResult = false; - if (0 < \count($aFilteredUids) && $this->AddressBookProvider($oAccount)->IsActive()) - { - $bResult = $this->AddressBookProvider($oAccount)->DeleteContacts($oAccount->ParentEmailHelper(), $aFilteredUids); - } - - return $this->DefaultResponse(__FUNCTION__, $bResult); - } - - /** - * @return array - */ - public function DoContactSave() - { - $oAccount = $this->getAccountFromToken(); - - $bResult = false; - - $oAddressBookProvider = $this->AddressBookProvider($oAccount); - $sRequestUid = \trim($this->GetActionParam('RequestUid', '')); - if ($oAddressBookProvider && $oAddressBookProvider->IsActive() && 0 < \strlen($sRequestUid)) - { - $sUid = \trim($this->GetActionParam('Uid', '')); - - $oContact = null; - if (0 < \strlen($sUid)) - { - $oContact = $oAddressBookProvider->GetContactByID($oAccount->ParentEmailHelper(), $sUid); - } - - if (!$oContact) - { - $oContact = new \RainLoop\Providers\AddressBook\Classes\Contact(); - if (0 < \strlen($sUid)) - { - $oContact->IdContact = $sUid; - } - } - - $oContact->Properties = array(); - $aProperties = $this->GetActionParam('Properties', array()); - if (\is_array($aProperties)) - { - foreach ($aProperties as $aItem) - { - if ($aItem && isset($aItem[0], $aItem[1]) && \is_numeric($aItem[0])) - { - $oProp = new \RainLoop\Providers\AddressBook\Classes\Property(); - $oProp->Type = (int) $aItem[0]; - $oProp->Value = $aItem[1]; - $oProp->TypeStr = empty($aItem[2]) ? '': $aItem[2]; - - $oContact->Properties[] = $oProp; - } - } - } - - if (!empty($oContact->Etag)) - { - $oContact->Etag = \md5($oContact->ToVCard()); - } - - $oContact->PopulateDisplayAndFullNameValue(true); - - $bResult = $oAddressBookProvider->ContactSave($oAccount->ParentEmailHelper(), $oContact); - } - - return $this->DefaultResponse(__FUNCTION__, array( - 'RequestUid' => $sRequestUid, - 'ResultID' => $bResult ? $oContact->IdContact : '', - 'Result' => $bResult - )); - } - - /** - * @return array - */ - public function DoSuggestions() - { - $oAccount = $this->getAccountFromToken(); - - $sQuery = \trim($this->GetActionParam('Query', '')); - $iLimit = (int) $this->Config()->Get('contacts', 'suggestions_limit', 20); - - $aResult = array(); - - $this->Plugins()->RunHook('ajax.suggestions-input-parameters', array(&$sQuery, &$iLimit, $oAccount)); - - $iLimit = (int) $iLimit; - if (5 > $iLimit) - { - $iLimit = 5; - } - - $this->Plugins()->RunHook('ajax.suggestions-pre', array(&$aResult, $sQuery, $oAccount, $iLimit)); - - if ($iLimit > \count($aResult) && 0 < \strlen($sQuery)) - { - try - { - // Address Book - $oAddressBookProvider = $this->AddressBookProvider($oAccount); - if ($oAddressBookProvider && $oAddressBookProvider->IsActive()) - { - $aSuggestions = $oAddressBookProvider->GetSuggestions($oAccount->ParentEmailHelper(), $sQuery, $iLimit); - if (0 === \count($aResult)) - { - $aResult = $aSuggestions; - } - else - { - $aResult = \array_merge($aResult, $aSuggestions); - } - } - } - catch (\Exception $oException) - { - $this->Logger()->WriteException($oException); - } - } - - if ($iLimit > \count($aResult) && 0 < \strlen($sQuery)) - { - $oSuggestionsProvider = $this->SuggestionsProvider(); - if ($oSuggestionsProvider && $oSuggestionsProvider->IsActive()) - { - $aSuggestionsProviderResult = $oSuggestionsProvider->Process($oAccount, $sQuery, $iLimit); - if (\is_array($aSuggestionsProviderResult) && 0 < \count($aSuggestionsProviderResult)) - { - $aResult = \array_merge($aResult, $aSuggestionsProviderResult); - } - } - - } - - $aResult = \RainLoop\Utils::RemoveSuggestionDuplicates($aResult); - if ($iLimit < \count($aResult)) - { - $aResult = \array_slice($aResult, 0, $iLimit); - } - - $this->Plugins()->RunHook('ajax.suggestions-post', array(&$aResult, $sQuery, $oAccount, $iLimit)); - - $aResult = \RainLoop\Utils::RemoveSuggestionDuplicates($aResult); - if ($iLimit < \count($aResult)) - { - $aResult = \array_slice($aResult, 0, $iLimit); - } - - return $this->DefaultResponse(__FUNCTION__, $aResult); - } - - /** - * @return array - */ - private function messageSetFlag($sActionFunction, $sResponseFunction) - { - $this->initMailClientConnection(); - - $sFolder = $this->GetActionParam('Folder', ''); - $bSetAction = '1' === (string) $this->GetActionParam('SetAction', '0'); - $aUids = \explode(',', (string) $this->GetActionParam('Uids', '')); - $aFilteredUids = \array_filter($aUids, function (&$sUid) { - $sUid = (int) \trim($sUid); - return 0 < $sUid; - }); - - try - { - $this->MailClient()->{$sActionFunction}($sFolder, $aFilteredUids, true, $bSetAction, true); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::MailServerError, $oException); - } - - return $this->TrueResponse($sResponseFunction); - } - - /** - * @return array - */ - public function DoMessageSetSeen() - { - return $this->messageSetFlag('MessageSetSeen', __FUNCTION__); - } - - /** - * @return array - */ - public function DoMessageSetSeenToAll() - { - $this->initMailClientConnection(); - - $sFolder = $this->GetActionParam('Folder', ''); - $bSetAction = '1' === (string) $this->GetActionParam('SetAction', '0'); - - try - { - $this->MailClient()->MessageSetSeenToAll($sFolder, $bSetAction); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::MailServerError, $oException); - } - - return $this->TrueResponse(__FUNCTION__); - } - - /** - * @return array - */ - public function DoMessageSetFlagged() - { - return $this->messageSetFlag('MessageSetFlagged', __FUNCTION__); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoMessage() - { - $sRawKey = (string) $this->GetActionParam('RawKey', ''); - - $sFolder = ''; - $iUid = 0; - - $aValues = $this->getDecodedClientRawKeyValue($sRawKey, 4); - if (is_array($aValues) && 4 === count($aValues)) - { - $sFolder = (string) $aValues[0]; - $iUid = (int) $aValues[1]; - - $this->verifyCacheByKey($sRawKey); - } - else - { - $sFolder = $this->GetActionParam('Folder', ''); - $iUid = (int) $this->GetActionParam('Uid', 0); - } - - $oAccount = $this->initMailClientConnection(); - - try - { - $oMessage = $this->MailClient()->Message($sFolder, $iUid, true, - $this->cacherForThreads(), - (int) $this->Config()->Get('labs', 'imap_body_text_limit', 0) - ); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantGetMessage, $oException); - } - - if ($oMessage instanceof \MailSo\Mail\Message) - { - $this->Plugins() - ->RunHook('filter.result-message', array(&$oMessage)) - ->RunHook('filter.result-message[2]', array(&$oMessage, $oAccount)) - ; - - $this->cacheByKey($sRawKey); - } - - return $this->DefaultResponse(__FUNCTION__, $oMessage); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoMessageDelete() - { - $this->initMailClientConnection(); - - $sFolder = $this->GetActionParam('Folder', ''); - $aUids = \explode(',', (string) $this->GetActionParam('Uids', '')); - - $aFilteredUids = \array_filter($aUids, function (&$sUid) { - $sUid = (int) \trim($sUid); - return 0 < $sUid; - }); - - try - { - $this->MailClient()->MessageDelete($sFolder, $aFilteredUids, true, true, - !!$this->Config()->Get('labs', 'use_imap_expunge_all_on_delete', false)); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantDeleteMessage, $oException); - } - - if ($this->Config()->Get('labs', 'use_imap_unselect', true)) - { - try - { - $this->MailClient()->FolderUnSelect(); - } - catch (\Exception $oException) - { - unset($oException); - } - } - - $sHash = ''; - - try - { - $sHash = $this->MailClient()->FolderHash($sFolder); - } - catch (\Exception $oException) - { - unset($oException); - } - - return $this->DefaultResponse(__FUNCTION__, '' === $sHash ? false : array($sFolder, $sHash)); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoMessageMove() - { - $this->initMailClientConnection(); - - $sFromFolder = $this->GetActionParam('FromFolder', ''); - $sToFolder = $this->GetActionParam('ToFolder', ''); - $aUids = \explode(',', (string) $this->GetActionParam('Uids', '')); - $bMarkAsRead = '1' === (string) $this->GetActionParam('MarkAsRead', '0'); - - $aFilteredUids = \array_filter($aUids, function (&$mUid) { - $mUid = (int) \trim($mUid); - return 0 < $mUid; - }); - - if ($bMarkAsRead) - { - try - { - $this->MailClient()->MessageSetSeen($sFromFolder, $aFilteredUids, true, true); - } - catch (\Exception $oException) - { - unset($oException); - } - } - - try - { - $this->MailClient()->MessageMove($sFromFolder, $sToFolder, $aFilteredUids, true, - !!$this->Config()->Get('labs', 'use_imap_move', true), - !!$this->Config()->Get('labs', 'use_imap_expunge_all_on_delete', false) - ); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantMoveMessage, $oException); - } - - if ($this->Config()->Get('labs', 'use_imap_unselect', true)) - { - try - { - $this->MailClient()->FolderUnSelect(); - } - catch (\Exception $oException) - { - unset($oException); - } - } - - $sHash = ''; - - try - { - $sHash = $this->MailClient()->FolderHash($sFromFolder); - } - catch (\Exception $oException) - { - unset($oException); - } - - return $this->DefaultResponse(__FUNCTION__, '' === $sHash ? false : array($sFromFolder, $sHash)); - } - - /** - * @return array - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function DoMessageCopy() - { - $this->initMailClientConnection(); - - $sFromFolder = $this->GetActionParam('FromFolder', ''); - $sToFolder = $this->GetActionParam('ToFolder', ''); - $aUids = \explode(',', (string) $this->GetActionParam('Uids', '')); - - $aFilteredUids = \array_filter($aUids, function (&$mUid) { - $mUid = (int) \trim($mUid); - return 0 < $mUid; - }); - - try - { - $this->MailClient()->MessageCopy($sFromFolder, $sToFolder, - $aFilteredUids, true); - - $sHash = $this->MailClient()->FolderHash($sFromFolder); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantCopyMessage, $oException); - } - - return $this->DefaultResponse(__FUNCTION__, - '' === $sHash ? false : array($sFromFolder, $sHash)); - } - - /** - * @param string $sFileName - * @param string $sContentType - * @param string $sMimeIndex - * @param int $iMaxLength = 250 - * - * @return string - */ - public function MainClearFileName($sFileName, $sContentType, $sMimeIndex, $iMaxLength = 250) - { - $sFileName = 0 === \strlen($sFileName) ? \preg_replace('/[^a-zA-Z0-9]/', '.', (empty($sMimeIndex) ? '' : $sMimeIndex.'.').$sContentType) : $sFileName; - $sClearedFileName = \MailSo\Base\Utils::StripSpaces(\preg_replace('/[\.]+/', '.', $sFileName)); - $sExt = \MailSo\Base\Utils::GetFileExtension($sClearedFileName); - - if (10 < $iMaxLength && $iMaxLength < \strlen($sClearedFileName) - \strlen($sExt)) - { - $sClearedFileName = \substr($sClearedFileName, 0, $iMaxLength).(empty($sExt) ? '' : '.'.$sExt); - } - - return \MailSo\Base\Utils::ClearFileName(\MailSo\Base\Utils::Utf8Clear($sClearedFileName)); - } - - /** - * @return array - */ - public function DoMessageUploadAttachments() - { - $oAccount = $this->initMailClientConnection(); - - $mResult = false; - $self = $this; - - try - { - $aAttachments = $this->GetActionParam('Attachments', array()); - if (\is_array($aAttachments) && 0 < \count($aAttachments)) - { - $mResult = array(); - foreach ($aAttachments as $sAttachment) - { - $aValues = \RainLoop\Utils::DecodeKeyValuesQ($sAttachment); - if (\is_array($aValues)) - { - $sFolder = isset($aValues['Folder']) ? $aValues['Folder'] : ''; - $iUid = (int) isset($aValues['Uid']) ? $aValues['Uid'] : 0; - $sMimeIndex = (string) isset($aValues['MimeIndex']) ? $aValues['MimeIndex'] : ''; - - $sTempName = \md5($sAttachment); - if (!$this->FilesProvider()->FileExists($oAccount, $sTempName)) - { - $this->MailClient()->MessageMimeStream( - function($rResource, $sContentType, $sFileName, $sMimeIndex = '') use ($oAccount, &$mResult, $sTempName, $sAttachment, $self) { - if (is_resource($rResource)) - { - $sContentType = (empty($sFileName)) ? 'text/plain' : \MailSo\Base\Utils::MimeContentType($sFileName); - $sFileName = $self->MainClearFileName($sFileName, $sContentType, $sMimeIndex); - - if ($self->FilesProvider()->PutFile($oAccount, $sTempName, $rResource)) - { - $mResult[$sTempName] = $sAttachment; - } - } - }, $sFolder, $iUid, true, $sMimeIndex); - } - else - { - $mResult[$sTempName] = $sAttachment; - } - } - } - } - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::MailServerError, $oException); - } - - return $this->DefaultResponse(__FUNCTION__, $mResult); - } - - /** - * @return array - */ - public function DoComposeUploadExternals() - { - $oAccount = $this->getAccountFromToken(); - - $mResult = false; - $aExternals = $this->GetActionParam('Externals', array()); - if (\is_array($aExternals) && 0 < \count($aExternals)) - { - $oHttp = \MailSo\Base\Http::SingletonInstance(); - - $mResult = array(); - foreach ($aExternals as $sUrl) - { - $mResult[$sUrl] = ''; - - $sTempName = \md5($sUrl); - - $iCode = 0; - $sContentType = ''; - - $rFile = $this->FilesProvider()->GetFile($oAccount, $sTempName, 'wb+'); - if ($rFile && $oHttp->SaveUrlToFile($sUrl, $rFile, '', $sContentType, $iCode, $this->Logger(), 60, - $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''))) - { - $mResult[$sUrl] = $sTempName; - } - - if (\is_resource($rFile)) - { - @\fclose($rFile); - } - } - } - - return $this->DefaultResponse(__FUNCTION__, $mResult); - } - - /** - * @return array - */ - public function DoComposeUploadDrive() - { - $oAccount = $this->getAccountFromToken(); - - $mResult = false; - - $sUrl = $this->GetActionParam('Url', ''); - $sAccessToken = $this->GetActionParam('AccessToken', ''); - $sGoogleApiKey = (string) $this->Config()->Get('social', 'google_api_key', ''); - - if (0 < \strlen($sUrl) && 0 < \strlen($sAccessToken) && 0 < \strlen($sGoogleApiKey)) - { - $oHttp = \MailSo\Base\Http::SingletonInstance(); - - $mResult[$sUrl] = false; - - $sTempName = \md5($sUrl); - - $iCode = 0; - $sContentType = ''; - - $rFile = $this->FilesProvider()->GetFile($oAccount, $sTempName, 'wb+'); - if ($rFile && $oHttp->SaveUrlToFile($sUrl.'&key='.$sGoogleApiKey, $rFile, '', $sContentType, $iCode, $this->Logger(), 60, - $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''), - array('Authorization: Bearer '.$sAccessToken))) - { - $mResult[$sUrl] = array($sTempName, 0); - } - - if (\is_resource($rFile)) - { - @\fclose($rFile); - } - - if (isset($mResult[$sUrl][1])) - { - $mResult[$sUrl][1] = $rFile = $this->FilesProvider()->FileSize($oAccount, $sTempName); - } - } - - return $this->DefaultResponse(__FUNCTION__, $mResult); - } - - /** - * @return array - */ - public function DoSocialUsers() - { - $oAccount = $this->getAccountFromToken(); - - $oSettings = $this->SettingsProvider()->Load($oAccount); - - $aData = array( - 'Google' => '', - 'Facebook' => '', - 'Twitter' => '' - ); - - if ($oSettings) - { - $aData['Google'] = $oSettings->GetConf('GoogleSocialName', ''); - $aData['Facebook'] = $oSettings->GetConf('FacebookSocialName', ''); - $aData['Twitter'] = $oSettings->GetConf('TwitterSocialName', ''); - } - - return $this->DefaultResponse(__FUNCTION__, $aData); - } - - /** - * @return array - */ - public function DoSocialGoogleDisconnect() - { - $oAccount = $this->getAccountFromToken(); - return $this->DefaultResponse(__FUNCTION__, $this->Social()->GoogleDisconnect($oAccount)); - } - - /** - * @return array - */ - public function DoSocialTwitterDisconnect() - { - $oAccount = $this->getAccountFromToken(); - return $this->DefaultResponse(__FUNCTION__, $this->Social()->TwitterDisconnect($oAccount)); - } - - /** - * @return array - */ - public function DoSocialFacebookDisconnect() - { - $oAccount = $this->getAccountFromToken(); - return $this->DefaultResponse(__FUNCTION__, $this->Social()->FacebookDisconnect($oAccount)); - } - - /** - * @param int $iError - * @param int $iClientError - * - * @return string - */ - private function getUploadErrorMessageByCode($iError, &$iClientError) - { - $sError = ''; - $iClientError = UploadClientError::NORMAL; - switch($iError) - { - case UPLOAD_ERR_OK: - break; - case UPLOAD_ERR_INI_SIZE: - case UPLOAD_ERR_FORM_SIZE: - case UploadError::CONFIG_SIZE: - case UploadError::EMPTY_FILES_DATA: - $sError = 'File is too big'; - $iClientError = UploadClientError::FILE_IS_TOO_BIG; - break; - case UPLOAD_ERR_PARTIAL: - $sError = 'File partially uploaded'; - $iClientError = UploadClientError::FILE_PARTIALLY_UPLOADED; - break; - case UPLOAD_ERR_NO_FILE: - $sError = 'No file uploaded'; - $iClientError = UploadClientError::FILE_NO_UPLOADED; - break; - case UPLOAD_ERR_NO_TMP_DIR: - case UPLOAD_ERR_CANT_WRITE: - case UPLOAD_ERR_EXTENSION: - $sError = 'Missing temp folder'; - $iClientError = UploadClientError::MISSING_TEMP_FOLDER; - break; - case UploadError::ON_SAVING: - $sError = 'Error on saving file'; - $iClientError = UploadClientError::FILE_ON_SAVING_ERROR; - break; - case UploadError::FILE_TYPE: - $sError = 'Invalid file type'; - $iClientError = UploadClientError::FILE_TYPE; - break; - case UploadError::UNKNOWN: - default: - $sError = 'Unknown error'; - $iClientError = UploadClientError::UNKNOWN; - break; - } - - return $sError; - } - - /** - * @return array - */ - public function Upload() - { - $oAccount = $this->getAccountFromToken(); - - $aResponse = array(); - - $aFile = $this->GetActionParam('File', null); - $iError = $this->GetActionParam('Error', \RainLoop\Enumerations\UploadError::UNKNOWN); - - if ($oAccount && UPLOAD_ERR_OK === $iError && \is_array($aFile)) - { - $sSavedName = 'upload-post-'.\md5($aFile['name'].$aFile['tmp_name']); - if (!$this->FilesProvider()->MoveUploadedFile($oAccount, $sSavedName, $aFile['tmp_name'])) - { - $iError = \RainLoop\Enumerations\UploadError::ON_SAVING; - } - else - { - $sUploadName = $aFile['name']; - $iSize = $aFile['size']; - $sMimeType = $aFile['type']; - - $aResponse['Attachment'] = array( - 'Name' => $sUploadName, - 'TempName' => $sSavedName, - 'MimeType' => $sMimeType, - 'Size' => (int) $iSize - ); - } - } - - if (UPLOAD_ERR_OK !== $iError) - { - $iClientError = \RainLoop\Enumerations\UploadClientError::NORMAL; - $sError = $this->getUploadErrorMessageByCode($iError, $iClientError); - - if (!empty($sError)) - { - $aResponse['ErrorCode'] = $iClientError; - $aResponse['Error'] = $sError; - } - } - - return $this->DefaultResponse(__FUNCTION__, $aResponse); - } - - /** - * @return array - */ - public function DoClearUserBackground() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::USER_BACKGROUND, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $oSettings = $this->SettingsProvider()->Load($oAccount); - if ($oAccount && $oSettings) - { - $this->StorageProvider()->Clear($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'background' - ); - - $oSettings->SetConf('UserBackgroundName', ''); - $oSettings->SetConf('UserBackgroundHash', ''); - } - - return $this->DefaultResponse(__FUNCTION__, $oAccount && $oSettings ? - $this->SettingsProvider()->Save($oAccount, $oSettings) : false); - } - - /** - * @return array - */ - public function UploadBackground() - { - $oAccount = $this->getAccountFromToken(); - - if (!$this->GetCapa(false, false, \RainLoop\Enumerations\Capa::USER_BACKGROUND, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } - - $sName = ''; - $sHash = ''; - - $aFile = $this->GetActionParam('File', null); - $iError = $this->GetActionParam('Error', \RainLoop\Enumerations\UploadError::UNKNOWN); - - if ($oAccount && UPLOAD_ERR_OK === $iError && \is_array($aFile)) - { - $sMimeType = \strtolower(\MailSo\Base\Utils::MimeContentType($aFile['name'])); - if (\in_array($sMimeType, array('image/png', 'image/jpg', 'image/jpeg'))) - { - $sSavedName = 'upload-post-'.\md5($aFile['name'].$aFile['tmp_name']); - if (!$this->FilesProvider()->MoveUploadedFile($oAccount, $sSavedName, $aFile['tmp_name'])) - { - $iError = \RainLoop\Enumerations\UploadError::ON_SAVING; - } - else - { - $rData = $this->FilesProvider()->GetFile($oAccount, $sSavedName); - if (@\is_resource($rData)) - { - $sData = @\stream_get_contents($rData); - if (!empty($sData) && 0 < \strlen($sData)) - { - $sName = $aFile['name']; - if (empty($sName)) - { - $sName = '_'; - } - - if ($this->StorageProvider()->Put($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'background', - \json_encode(array( - 'Name' => $aFile['name'], - 'ContentType' => $sMimeType, - 'Raw' => \base64_encode($sData) - )) - )) - { - $oSettings = $this->SettingsProvider()->Load($oAccount); - if ($oSettings) - { - $sHash = \MailSo\Base\Utils::Md5Rand($sName.APP_VERSION.APP_SALT); - - $oSettings->SetConf('UserBackgroundName', $sName); - $oSettings->SetConf('UserBackgroundHash', $sHash); - $this->SettingsProvider()->Save($oAccount, $oSettings); - } - } - } - - unset($sData); - } - - if (@\is_resource($rData)) - { - @\fclose($rData); - } - - unset($rData); - } - - $this->FilesProvider()->Clear($oAccount, $sSavedName); - } - else - { - $iError = \RainLoop\Enumerations\UploadError::FILE_TYPE; - } - } - - if (UPLOAD_ERR_OK !== $iError) - { - $iClientError = \RainLoop\Enumerations\UploadClientError::NORMAL; - $sError = $this->getUploadErrorMessageByCode($iError, $iClientError); - - if (!empty($sError)) - { - return $this->FalseResponse(__FUNCTION__, $iClientError, $sError); - } - } - - return $this->DefaultResponse(__FUNCTION__, !empty($sName) && !empty($sHash) ? array( - 'Name' => $sName, - 'Hash' => $sHash - ) : false); - } - - /** - * @return array - */ - public function UploadContacts() - { - $oAccount = $this->getAccountFromToken(); - - $mResponse = false; - - $aFile = $this->GetActionParam('File', null); - $iError = $this->GetActionParam('Error', \RainLoop\Enumerations\UploadError::UNKNOWN); - - if ($oAccount && UPLOAD_ERR_OK === $iError && \is_array($aFile)) - { - $sSavedName = 'upload-post-'.\md5($aFile['name'].$aFile['tmp_name']); - if (!$this->FilesProvider()->MoveUploadedFile($oAccount, $sSavedName, $aFile['tmp_name'])) - { - $iError = \RainLoop\Enumerations\UploadError::ON_SAVING; - } - else - { - @\ini_set('auto_detect_line_endings', true); - $mData = $this->FilesProvider()->GetFile($oAccount, $sSavedName); - if ($mData) - { - $sFileStart = @\fread($mData, 20); - \rewind($mData); - - if (false !== $sFileStart) - { - $sFileStart = \trim($sFileStart); - if (false !== \strpos($sFileStart, 'BEGIN:VCARD')) - { - $mResponse = $this->importContactsFromVcfFile($oAccount, $mData); - } - else if (false !== \strpos($sFileStart, ',') || false !== \strpos($sFileStart, ';')) - { - $mResponse = $this->importContactsFromCsvFile($oAccount, $mData, $sFileStart); - } - } - } - - if (\is_resource($mData)) - { - @\fclose($mData); - } - - unset($mData); - $this->FilesProvider()->Clear($oAccount, $sSavedName); - - @\ini_set('auto_detect_line_endings', false); - } - } - - if (UPLOAD_ERR_OK !== $iError) - { - $iClientError = \RainLoop\Enumerations\UploadClientError::NORMAL; - $sError = $this->getUploadErrorMessageByCode($iError, $iClientError); - - if (!empty($sError)) - { - return $this->FalseResponse(__FUNCTION__, $iClientError, $sError); - } - } - - return $this->DefaultResponse(__FUNCTION__, $mResponse); - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param resource $rFile - * @param string $sFileStart - * - * @return int - */ - private function importContactsFromCsvFile($oAccount, $rFile, $sFileStart) - { - $iCount = 0; - $aHeaders = null; - $aData = array(); - - if ($oAccount && \is_resource($rFile)) - { - $oAddressBookProvider = $this->AddressBookProvider($oAccount); - if ($oAddressBookProvider && $oAddressBookProvider->IsActive()) - { - $sDelimiter = ((int) \strpos($sFileStart, ',') > (int) \strpos($sFileStart, ';')) ? ',' : ';'; - - @\setlocale(LC_CTYPE, 'en_US.UTF-8'); - while (false !== ($mRow = \fgetcsv($rFile, 5000, $sDelimiter, '"'))) - { - if (null === $aHeaders) - { - if (3 >= \count($mRow)) - { - return 0; - } - - $aHeaders = $mRow; - - foreach ($aHeaders as $iIndex => $sHeaderValue) - { - $aHeaders[$iIndex] = \MailSo\Base\Utils::Utf8Clear($sHeaderValue); - } - } - else - { - $aNewItem = array(); - foreach ($aHeaders as $iIndex => $sHeaderValue) - { - $aNewItem[$sHeaderValue] = isset($mRow[$iIndex]) ? $mRow[$iIndex] : ''; - } - - $aData[] = $aNewItem; - } - } - - if (\is_array($aData) && 0 < \count($aData)) - { - $this->Logger()->Write('Import contacts from csv'); - $iCount = $oAddressBookProvider->ImportCsvArray($oAccount->ParentEmailHelper(), $aData); - } - } - } - - return $iCount; - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param resource $rFile - * - * @return int - */ - private function importContactsFromVcfFile($oAccount, $rFile) - { - $iCount = 0; - if ($oAccount && \is_resource($rFile)) - { - $oAddressBookProvider = $this->AddressBookProvider($oAccount); - if ($oAddressBookProvider && $oAddressBookProvider->IsActive()) - { - $sFile = \stream_get_contents($rFile); - if (\is_resource($rFile)) - { - \fclose($rFile); - } - - if (is_string($sFile) && 5 < \strlen($sFile)) - { - $this->Logger()->Write('Import contacts from vcf'); - $iCount = $oAddressBookProvider->ImportVcfFile($oAccount->ParentEmailHelper(), $sFile); - } - } - } - - return $iCount; - } - - /** - * @return bool - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function RawViewAsPlain() - { - $this->initMailClientConnection(); - - $sRawKey = (string) $this->GetActionParam('RawKey', ''); - $aValues = $this->getDecodedRawKeyValue($sRawKey); - - $sFolder = isset($aValues['Folder']) ? $aValues['Folder'] : ''; - $iUid = (int) (isset($aValues['Uid']) ? $aValues['Uid'] : 0); - $sMimeIndex = (string) (isset($aValues['MimeIndex']) ? $aValues['MimeIndex'] : ''); - - \header('Content-Type: text/plain', true); - - return $this->MailClient()->MessageMimeStream(function ($rResource) { - if (\is_resource($rResource)) - { - \MailSo\Base\Utils::FpassthruWithTimeLimitReset($rResource); - } - }, $sFolder, $iUid, true, $sMimeIndex); - } - - /** - * @return string - */ - public function RawFramedView() - { - $oAccount = $this->getAccountFromToken(false); - if ($oAccount) - { - $sRawKey = (string) $this->GetActionParam('RawKey', ''); - $aParams = $this->GetActionParam('Params', null); - $this->Http()->ServerNoCache(); - - $aData = \RainLoop\Utils::DecodeKeyValuesQ($sRawKey); - if (isset($aParams[0], $aParams[1], $aParams[2]) && - 'Raw' === $aParams[0] && 'FramedView' === $aParams[2] && isset($aData['Framed']) && $aData['Framed'] && $aData['FileName']) - { - if ($this->isFileHasFramedPreview($aData['FileName'])) - { - $sNewSpecAuthToken = $this->GetShortLifeSpecAuthToken(); - if (!empty($sNewSpecAuthToken)) - { - $aParams[1] = '_'.$sNewSpecAuthToken; - $aParams[2] = 'View'; - - \array_shift($aParams); - $sLast = \array_pop($aParams); - - $sUrl = $this->Http()->GetFullUrl().'?/Raw/&q[]=/'.\implode('/', $aParams).'/&q[]=/'.$sLast; - $sFullUrl = 'https://docs.google.com/viewer?embedded=true&url='.\urlencode($sUrl); - - @\header('Content-Type: text/html; charset=utf-8'); - echo ''. - ''. - ''. - ''; - } - } - } - } - - - return true; - - } - - /** - * @return bool - * - * @throws \MailSo\Base\Exceptions\Exception - */ - public function Append() - { - $oAccount = $this->initMailClientConnection(); - - $sFolderFullNameRaw = $this->GetActionParam('Folder', ''); - - $_FILES = isset($_FILES) ? $_FILES : null; - if ($oAccount instanceof \RainLoop\Model\Account && - $this->Config()->Get('labs', 'allow_message_append', false) && - isset($_FILES, $_FILES['AppendFile'], $_FILES['AppendFile']['name'], - $_FILES['AppendFile']['tmp_name'], $_FILES['AppendFile']['size'])) - { - if (is_string($_FILES['AppendFile']['tmp_name']) && 0 < strlen($_FILES['AppendFile']['tmp_name'])) - { - if (\UPLOAD_ERR_OK === (int) $_FILES['AppendFile']['error'] && !empty($sFolderFullNameRaw)) - { - $sSavedName = 'append-post-'.md5($sFolderFullNameRaw.$_FILES['AppendFile']['name'].$_FILES['AppendFile']['tmp_name']); - - if ($this->FilesProvider()->MoveUploadedFile($oAccount, - $sSavedName, $_FILES['AppendFile']['tmp_name'])) - { - $iMessageStreamSize = $this->FilesProvider()->FileSize($oAccount, $sSavedName); - $rMessageStream = $this->FilesProvider()->GetFile($oAccount, $sSavedName); - - $this->MailClient()->MessageAppendStream($rMessageStream, $iMessageStreamSize, $sFolderFullNameRaw); - - $this->FilesProvider()->Clear($oAccount, $sSavedName); - } - } - } - } - - return $this->DefaultResponse(__FUNCTION__, true); - } - - /** - * @param bool $bAdmin - * @param bool $bMobile = false - * @param \RainLoop\Model\Account $oAccount = null - * - * @return array - */ - public function Capa($bAdmin, $bMobile = false, $oAccount = null) - { - $oConfig = $this->Config(); - - $aResult = array(); - - if ($oConfig->Get('capa', 'folders', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::FOLDERS; - - if ($oConfig->Get('capa', 'messagelist_actions', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::MESSAGELIST_ACTIONS; - - if ($oConfig->Get('capa', 'dangerous_actions', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::DANGEROUS_ACTIONS; - } - } - } - - if ($oConfig->Get('capa', 'reload', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::RELOAD; - } - - if ($oConfig->Get('capa', 'quota', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::QUOTA; - } - - if ($oConfig->Get('capa', 'settings', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::SETTINGS; - - if ($oConfig->Get('webmail', 'allow_additional_accounts', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS; - } - - if ($oConfig->Get('webmail', 'allow_additional_identities', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::IDENTITIES; - } - - if ($oConfig->Get('capa', 'x-templates', true) && !$bMobile) - { - $aResult[] = \RainLoop\Enumerations\Capa::TEMPLATES; - } - - if ($oConfig->Get('webmail', 'allow_themes', false) && !$bMobile) - { - $aResult[] = \RainLoop\Enumerations\Capa::THEMES; - } - - if ($oConfig->Get('webmail', 'allow_user_background', false) && !$bMobile) - { - $aResult[] = \RainLoop\Enumerations\Capa::USER_BACKGROUND; - } - - if ($oConfig->Get('security', 'openpgp', false) && !$bMobile) - { - $aResult[] = \RainLoop\Enumerations\Capa::OPEN_PGP; - } - - if ($oConfig->Get('capa', 'filters', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::FILTERS; - if ($bAdmin || ($oAccount && $oAccount->Domain()->UseSieve())) - { - $aResult[] = \RainLoop\Enumerations\Capa::SIEVE; - } - } - } - - if ($oConfig->Get('security', 'allow_two_factor_auth', false) && - ($bAdmin || ($oAccount && !$oAccount->IsAdditionalAccount()))) - { - $aResult[] = \RainLoop\Enumerations\Capa::TWO_FACTOR; - - if ($oConfig->Get('security', 'force_two_factor_auth', false) && - ($bAdmin || ($oAccount && !$oAccount->IsAdditionalAccount()))) - { - $aResult[] = \RainLoop\Enumerations\Capa::TWO_FACTOR_FORCE; - } - } - - if ($oConfig->Get('capa', 'help', true) && !$bMobile) - { - $aResult[] = \RainLoop\Enumerations\Capa::HELP; - } - - if ($oConfig->Get('capa', 'attachments_actions', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::ATTACHMENTS_ACTIONS; - } - - if ($oConfig->Get('capa', 'message_actions', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::MESSAGE_ACTIONS; - } - - if ($oConfig->Get('capa', 'composer', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::COMPOSER; - - if ($oConfig->Get('capa', 'contacts', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::CONTACTS; - } - } - - if ($oConfig->Get('capa', 'search', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::SEARCH; - - if ($oConfig->Get('capa', 'search_adv', true) && !$bMobile) - { - $aResult[] = \RainLoop\Enumerations\Capa::SEARCH_ADV; - } - } - - if ($oConfig->Get('labs', 'allow_gravatar', false)) - { - $aResult[] = \RainLoop\Enumerations\Capa::GRAVATAR; - } - - if ($oConfig->Get('interface', 'show_attachment_thumbnail', true)) - { - $aResult[] = \RainLoop\Enumerations\Capa::ATTACHMENT_THUMBNAILS; - } - - if ($oConfig->Get('labs', 'allow_prefetch', false) && !$bMobile) - { - $aResult[] = \RainLoop\Enumerations\Capa::PREFETCH; - } - - if (!\RainLoop\Utils::IsOwnCloud()) - { - $aResult[] = \RainLoop\Enumerations\Capa::AUTOLOGOUT; - } - - return $aResult; - } - - /** - * @param bool $bAdmin - * @param bool $bMobile - * @param string $sName - * @param \RainLoop\Model\Account $oAccount = null - * - * @return bool - */ - public function GetCapa($bAdmin, $bMobile, $sName, $oAccount = null) - { - return \in_array($sName, $this->Capa($bAdmin, $bMobile, $oAccount)); - } - - /** - * @param string $sKey - * @param bool $bForce = false - * - * @return bool - */ - public function cacheByKey($sKey, $bForce = false) - { - $bResult = false; - if (!empty($sKey) && ($bForce || $this->Config()->Get('cache', 'enable', true) && $this->Config()->Get('cache', 'http', true))) - { - $this->oHttp->ServerUseCache( - \md5('Etag:'.\md5($sKey.\md5($this->Config()->Get('cache', 'index', '')))), - 1382478804, 2002478804); - - $bResult = true; - } - - return $bResult; - } - - /** - * @param string $sKey - * @param bool $bForce = false - * - * @return void - */ - public function verifyCacheByKey($sKey, $bForce = false) - { - if (!empty($sKey) && ($bForce || $this->Config()->Get('cache', 'enable', true) && $this->Config()->Get('cache', 'http', true))) - { - $sIfModifiedSince = $this->Http()->GetHeader('If-Modified-Since', ''); - $sIfNoneMatch = $this->Http()->GetHeader('If-None-Match', ''); - - if (!empty($sIfModifiedSince) || !empty($sIfNoneMatch)) - { - $this->Http()->StatusHeader(304); - $this->cacheByKey($sKey); - exit(0); - } - } - } - - /** - * @param \RainLoop\Model\Account $oAccount - * @param string $sHash - * - * @return array - */ - private function getMimeFileByHash($oAccount, $sHash) - { - $aValues = $this->getDecodedRawKeyValue($sHash); - - $sFolder = isset($aValues['Folder']) ? $aValues['Folder'] : ''; - $iUid = (int) isset($aValues['Uid']) ? $aValues['Uid'] : 0; - $sMimeIndex = (string) isset($aValues['MimeIndex']) ? $aValues['MimeIndex'] : ''; - - $sContentTypeIn = (string) isset($aValues['MimeType']) ? $aValues['MimeType'] : ''; - $sFileNameIn = (string) isset($aValues['FileName']) ? $aValues['FileName'] : ''; - - $oFileProvider = $this->FilesProvider(); - - $sResultHash = ''; - - $mResult = $this->MailClient()->MessageMimeStream(function($rResource, $sContentType, $sFileName, $sMimeIndex = '') - use ($oAccount, $oFileProvider, $sFileNameIn, $sContentTypeIn, &$sResultHash) { - - unset($sContentType, $sFileName, $sMimeIndex); - - if ($oAccount && \is_resource($rResource)) - { - $sHash = \MailSo\Base\Utils::Md5Rand($sFileNameIn.'~'.$sContentTypeIn); - $rTempResource = $oFileProvider->GetFile($oAccount, $sHash, 'wb+'); - - if (@\is_resource($rTempResource)) - { - if (false !== \MailSo\Base\Utils::MultipleStreamWriter($rResource, array($rTempResource))) - { - $sResultHash = $sHash; - } - - @\fclose($rTempResource); - } - } - - }, $sFolder, $iUid, true, $sMimeIndex); - - $aValues['FileHash'] = ''; - if ($mResult) - { - $aValues['FileHash'] = $sResultHash; - } - - return $aValues; - } - - /** - * @param \Imagine\Image\AbstractImage $oImage - * @param int $iOrientation - */ - private function rotateImageByOrientation(&$oImage, $iOrientation) - { - if (0 < $iOrientation) - { - switch ($iOrientation) - { - default: - case 1: - break; - - case 2: // horizontal flip - $oImage->flipHorizontally(); - break; - - case 3: // 180 rotate left - $oImage->rotate(180); - break; - - case 4: // vertical flip - $oImage->flipVertically(); - break; - - case 5: // vertical flip + 90 rotate right - $oImage->flipVertically(); - $oImage->rotate(-90); - break; - - case 6: // 90 rotate right - $oImage->rotate(-90); - break; - - case 7: // horizontal flip + 90 rotate right - $oImage->flipHorizontally(); - $oImage->rotate(-90); - break; - - case 8: // 90 rotate left - $oImage->rotate(90); - break; - } - } - } - - /** - * @param \Imagine\Image\AbstractImage $oImage - */ - private function correctImageOrientation($oImage, $bDetectImageOrientation = true, $iThumbnailBoxSize = null) - { - $iOrientation = 1; - if ($bDetectImageOrientation && \MailSo\Base\Utils::FunctionExistsAndEnabled('exif_read_data') && - \MailSo\Base\Utils::FunctionExistsAndEnabled('gd_info')) - { - $oMetadata = $oImage->metadata(new \Imagine\Image\Metadata\ExifMetadataReader()); - $iOrientation = isset($oMetadata['ifd0.Orientation']) && - is_numeric($oMetadata['ifd0.Orientation']) ? (int) $oMetadata['ifd0.Orientation'] : 1; - } - - if ($iThumbnailBoxSize && 0 < $iThumbnailBoxSize) - { - $oImage = $oImage->thumbnail( - new \Imagine\Image\Box($iThumbnailBoxSize, $iThumbnailBoxSize), - \Imagine\Image\ImageInterface::THUMBNAIL_OUTBOUND); - - $this->rotateImageByOrientation($oImage, $iOrientation); - } - else - { - $this->rotateImageByOrientation($oImage, $iOrientation); - } - - return $oImage; - } - - /** - * @param bool $bDownload - * @param bool $bThumbnail = false - * - * @return bool - */ - private function rawSmart($bDownload, $bThumbnail = false) - { - $sRawKey = (string) $this->GetActionParam('RawKey', ''); - $aValues = $this->getDecodedRawKeyValue($sRawKey); - - $sRange = $this->Http()->GetHeader('Range'); - - $aMatch = array(); - $sRangeStart = $sRangeEnd = ''; - $bIsRangeRequest = false; - - if (!empty($sRange) && 'bytes=0-' !== \strtolower($sRange) && \preg_match('/^bytes=([0-9]+)-([0-9]*)/i', \trim($sRange), $aMatch)) - { - $sRangeStart = $aMatch[1]; - $sRangeEnd = $aMatch[2]; - - $bIsRangeRequest = true; - } - - $sFolder = isset($aValues['Folder']) ? $aValues['Folder'] : ''; - $iUid = isset($aValues['Uid']) ? (int) $aValues['Uid'] : 0; - $sMimeIndex = isset($aValues['MimeIndex']) ? (string) $aValues['MimeIndex'] : ''; - - $sContentTypeIn = isset($aValues['MimeType']) ? (string) $aValues['MimeType'] : ''; - $sFileNameIn = isset($aValues['FileName']) ? (string) $aValues['FileName'] : ''; - $sFileHashIn = isset($aValues['FileHash']) ? (string) $aValues['FileHash'] : ''; - - $bDetectImageOrientation = !!$this->Config()->Get('labs', 'detect_image_exif_orientation', true); - - if (!empty($sFileHashIn)) - { - $this->verifyCacheByKey($sRawKey); - - $oAccount = $this->getAccountFromToken(); - - $sContentTypeOut = empty($sContentTypeIn) ? - \MailSo\Base\Utils::MimeContentType($sFileNameIn) : $sContentTypeIn; - - $sFileNameOut = $this->MainClearFileName($sFileNameIn, $sContentTypeIn, $sMimeIndex); - - $rResource = $this->FilesProvider()->GetFile($oAccount, $sFileHashIn); - if (\is_resource($rResource)) - { - $sFileNameOut = \MailSo\Base\Utils::ConvertEncoding( - $sFileNameOut, \MailSo\Base\Enumerations\Charset::UTF_8, - \MailSo\Base\Enumerations\Charset::CP858); - - \header('Content-Type: '.$sContentTypeOut); - \header('Content-Disposition: attachment; '. - \trim(\MailSo\Base\Utils::EncodeHeaderUtf8AttributeValue('filename', $sFileNameOut)), true); - - \header('Accept-Ranges: none', true); - \header('Content-Transfer-Encoding: binary'); - - \MailSo\Base\Utils::FpassthruWithTimeLimitReset($rResource); - return true; - } - - return false; - } - else - { - if (!empty($sFolder) && 0 < $iUid) - { - $this->verifyCacheByKey($sRawKey); - } - } - - $oAccount = $this->initMailClientConnection(); - - $self = $this; - return $this->MailClient()->MessageMimeStream( - function($rResource, $sContentType, $sFileName, $sMimeIndex = '') use ( - $self, $oAccount, $sRawKey, $sContentTypeIn, $sFileNameIn, $bDownload, $bThumbnail, $bDetectImageOrientation, - $bIsRangeRequest, $sRangeStart, $sRangeEnd - ) { - if ($oAccount && \is_resource($rResource)) - { - \MailSo\Base\Utils::ResetTimeLimit(); - - $sContentTypeOut = $sContentTypeIn; - if (empty($sContentTypeOut)) - { - $sContentTypeOut = $sContentType; - if (empty($sContentTypeOut)) - { - $sContentTypeOut = (empty($sFileName)) ? 'text/plain' : \MailSo\Base\Utils::MimeContentType($sFileName); - } - } - - $sFileNameOut = $sFileNameIn; - if (empty($sFileNameOut)) - { - $sFileNameOut = $sFileName; - } - - $sFileNameOut = $self->MainClearFileName($sFileNameOut, $sContentTypeOut, $sMimeIndex); - - $self->cacheByKey($sRawKey); - - $sLoadedData = null; - $bDetectImageOrientation = false; - - if (!$bDownload) - { - if ($bThumbnail) - { - try - { - $oImagine = new \Imagine\Gd\Imagine(); - - $oImage = $oImagine->load(\stream_get_contents($rResource)); - - $oImage = $self->correctImageOrientation($oImage, $bDetectImageOrientation, 60); - - \header('Content-Disposition: inline; '. - \trim(\MailSo\Base\Utils::EncodeHeaderUtf8AttributeValue('filename', $sFileNameOut.'_thumb60x60.png')), true); - - $oImage->show('png'); - } - catch (\Exception $oException) - { - $self->Logger()->WriteExceptionShort($oException); - } - } - else if ($bDetectImageOrientation && - \in_array($sContentTypeOut, array('image/png', 'image/jpeg', 'image/jpg')) && - \MailSo\Base\Utils::FunctionExistsAndEnabled('gd_info')) - { - try - { - $oImagine = new \Imagine\Gd\Imagine(); - - $sLoadedData = \stream_get_contents($rResource); - - $oImage = $oImagine->load($sLoadedData); - - $oImage = $self->correctImageOrientation($oImage, $bDetectImageOrientation); - - \header('Content-Disposition: inline; '. - \trim(\MailSo\Base\Utils::EncodeHeaderUtf8AttributeValue('filename', $sFileNameOut)), true); - - $oImage->show($sContentTypeOut === 'image/png' ? 'png' : 'jpg'); - } - catch (\Exception $oException) - { - $self->Logger()->WriteExceptionShort($oException); - } - } - else - { - $sLoadedData = \stream_get_contents($rResource); - } - } - - if ($bDownload || $sLoadedData) - { - \header('Content-Type: '.$sContentTypeOut); - \header('Content-Disposition: '.($bDownload ? 'attachment' : 'inline').'; '. - \trim(\MailSo\Base\Utils::EncodeHeaderUtf8AttributeValue('filename', $sFileNameOut)), true); - - \header('Accept-Ranges: bytes'); - \header('Content-Transfer-Encoding: binary'); - - if ($bIsRangeRequest && !$sLoadedData) - { - $sLoadedData = \stream_get_contents($rResource); - } - - \MailSo\Base\Utils::ResetTimeLimit(); - - if ($sLoadedData) - { - if ($bIsRangeRequest && (0 < \strlen($sRangeStart) || 0 < \strlen($sRangeEnd))) - { - $iFullContentLength = \strlen($sLoadedData); - - $self->Http()->StatusHeader(206); - - $iRangeStart = (int) $sRangeStart; - $iRangeEnd = (int) $sRangeEnd; - - if ('' === $sRangeEnd) - { - $sLoadedData = 0 < $iRangeStart ? \substr($sLoadedData, $iRangeStart) : $sLoadedData; - } - else - { - if ($iRangeStart < $iRangeEnd) - { - $sLoadedData = \substr($sLoadedData, $iRangeStart, $iRangeEnd - $iRangeStart); - } - else - { - $sLoadedData = 0 < $iRangeStart ? \substr($sLoadedData, $iRangeStart) : $sLoadedData; - } - } - - $iContentLength = \strlen($sLoadedData); - - if (0 < $iContentLength) - { - \header('Content-Length: '.$iContentLength, true); - \header('Content-Range: bytes '.$sRangeStart.'-'.(0 < $iRangeEnd ? $iRangeEnd : $iFullContentLength - 1).'/'.$iFullContentLength); - } - - echo $sLoadedData; - } - else - { - echo $sLoadedData; - } - - unset($sLoadedData); - } - else - { - \MailSo\Base\Utils::FpassthruWithTimeLimitReset($rResource); - } - } - } - }, $sFolder, $iUid, true, $sMimeIndex); - } - - /** - * @return bool - */ - public function RawDownload() - { - return $this->rawSmart(true); - } - - /** - * @return bool - */ - public function RawView() - { - return $this->rawSmart(false); - } - - /** - * @return bool - */ - public function RawViewThumbnail() - { - return $this->rawSmart(false, true); - } - - /** - * @return bool - */ - public function RawUserBackground() - { - $sRawKey = (string) $this->GetActionParam('RawKey', ''); - $this->verifyCacheByKey($sRawKey); - - $oAccount = $this->getAccountFromToken(); - - $sData = $this->StorageProvider()->Get($oAccount, - \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, - 'background' - ); - - if (!empty($sData)) - { - $aData = \json_decode($sData, true); - unset($sData); - - if (!empty($aData['ContentType']) && !empty($aData['Raw']) && - \in_array($aData['ContentType'], array('image/png', 'image/jpg', 'image/jpeg'))) - { - $this->cacheByKey($sRawKey); - - @\header('Content-Type: '.$aData['ContentType']); - echo \base64_decode($aData['Raw']); - unset($aData); - - return true; - } - } - - return false; - } - - /** - * @return bool - */ - public function RawPublic() - { - $sRawKey = (string) $this->GetActionParam('RawKey', ''); - $this->verifyCacheByKey($sRawKey); - - $sHash = $sRawKey; - $sData = ''; - - if (!empty($sHash)) - { - $sData = $this->StorageProvider()->Get(null, - \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, - \RainLoop\KeyPathHelper::PublicFile($sHash) - ); - } - - $aMatch = array(); - if (!empty($sData) && 0 === \strpos($sData, 'data:') && - \preg_match('/^data:([^:]+):/', $sData, $aMatch) && !empty($aMatch[1])) - { - $sContentType = \trim($aMatch[1]); - if (\in_array($sContentType, array('image/png', 'image/jpg', 'image/jpeg'))) - { - $this->cacheByKey($sRawKey); - - @\header('Content-Type: '.$sContentType); - echo \preg_replace('/^data:[^:]+:/', '', $sData); - unset($sData); - - return true; - } - } - - return false; - } - - /** - * @param string $sFileName - * - * @return bool - */ - public function isFileHasFramedPreview($sFileName) - { - $sExt = \MailSo\Base\Utils::GetFileExtension($sFileName); - return \in_array($sExt, array('doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx')); - } - - /** - * @param string $sFileName - * - * @return bool - */ - public function isFileHasThumbnail($sFileName) - { - static $aCache = array(); - - $sExt = \MailSo\Base\Utils::GetFileExtension($sFileName); - if (isset($aCache[$sExt])) - { - return $aCache[$sExt]; - } - - $bResult = \function_exists('gd_info'); - if ($bResult) - { - $bResult = false; - switch ($sExt) - { - case 'png': - $bResult = \function_exists('imagecreatefrompng'); - break; - case 'gif': - $bResult = \function_exists('imagecreatefromgif'); - break; - case 'jpg': - case 'jpeg': - $bResult = \function_exists('imagecreatefromjpeg'); - break; - } - } - - $aCache[$sExt] = $bResult; - - return $bResult; - } - - /** - * @return bool - */ - public function RawAvatar() - { - $sData = ''; - - $sRawKey = (string) $this->GetActionParam('RawKey', ''); - $sRawKey = \urldecode($sRawKey); - - $this->verifyCacheByKey($sRawKey); - - if (0 < \strlen($sRawKey) && \preg_match('/^[^@]+@([^@]+)$/', $sRawKey)) - { - $sEmail = \MailSo\Base\Utils::IdnToAscii($sRawKey, true); - - $iCode = 0; - $sContentType = ''; - - $sGravatarUrl = 'http://gravatar.com/avatar/'.\md5($sEmail).'.jpg?s=80&d=404'; - - $this->Logger()->Write('gravatar: '.$sGravatarUrl); - - $sData = $this->Http()->GetUrlAsString($sGravatarUrl, null, $sContentType, $iCode, null, 5, - $this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', '')); - - $sContentType = \strtolower(\trim($sContentType)); - if (200 !== $iCode || empty($sData) || !\in_array($sContentType, array('image/jpeg', 'image/jpg', 'image/png'))) - { - $this->Logger()->Write('gravatar: code: '.$iCode.', content-type: '.$sContentType); - - $sData = ''; - - $aMatch = array(); - if (\preg_match('/^[^@]+@([a-z0-9\-\.]+)$/', $sEmail, $aMatch) && !empty($aMatch[1])) - { - $sDomain = $aMatch[1]; - if (\file_exists(APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png')) - { - $sContentType = 'image/png'; - $sData = \file_get_contents(APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png'); - } - } - } - } - - if (empty($sData) || empty($sContentType)) - { - $sContentType = 'image/png'; - $sData = \file_get_contents(APP_VERSION_ROOT_PATH.'app/resources/images/empty-contact.png'); - } - - $this->cacheByKey($sRawKey); - \header('Content-Type: '.$sContentType); - echo $sData; - return true; - } - - /** - * @return bool - */ - public function RawContactsVcf() - { - $oAccount = $this->getAccountFromToken(); - - \header('Content-Type: text/x-vcard; charset=UTF-8'); - \header('Content-Disposition: attachment; filename="contacts.vcf"', true); - \header('Accept-Ranges: none', true); - \header('Content-Transfer-Encoding: binary'); - - $this->oHttp->ServerNoCache(); - - return $this->AddressBookProvider($oAccount)->IsActive() ? - $this->AddressBookProvider($oAccount)->Export($oAccount->ParentEmailHelper(), 'vcf') : false; - } - - /** - * @return bool - */ - public function RawContactsCsv() - { - $oAccount = $this->getAccountFromToken(); - - \header('Content-Type: text/csv; charset=UTF-8'); - \header('Content-Disposition: attachment; filename="contacts.csv"', true); - \header('Accept-Ranges: none', true); - \header('Content-Transfer-Encoding: binary'); - - $this->oHttp->ServerNoCache(); - - return $this->AddressBookProvider($oAccount)->IsActive() ? - $this->AddressBookProvider($oAccount)->Export($oAccount->ParentEmailHelper(), 'csv') : false; - } - - /** - * @return \RainLoop\Model\Account|bool - */ - private function initMailClientConnection() - { - $oAccount = null; - - if (!$this->MailClient()->IsLoggined()) - { - $oAccount = $this->getAccountFromToken(); - - try - { - $oAccount->IncConnectAndLoginHelper($this->Plugins(), $this->MailClient(), $this->Config()); - } - catch (\MailSo\Net\Exceptions\ConnectionException $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ConnectionError, $oException); - } - catch (\Exception $oException) - { - throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException); - } - - $this->MailClient()->ImapClient()->__FORCE_SELECT_ON_EXAMINE__ = !!$this->Config()->Get('labs', 'use_imap_force_selection'); - } - - return $oAccount; - } - - /** - * @param string $sRawKey - * - * @return array | false - */ - private function getDecodedRawKeyValue($sRawKey) - { - $bResult = false; - if (!empty($sRawKey)) - { - $aValues = \RainLoop\Utils::DecodeKeyValuesQ($sRawKey); - if (is_array($aValues)) - { - $bResult = $aValues; - } - } - - return $bResult; - } - - /** - * @param string $sRawKey - * @param int | null $iLenCache - * @return array | bool - */ - private function getDecodedClientRawKeyValue($sRawKey, $iLenCache = null) - { - $mResult = false; - if (!empty($sRawKey)) - { - $sRawKey = \MailSo\Base\Utils::UrlSafeBase64Decode($sRawKey); - $aValues = explode("\x0", $sRawKey); - - if (is_array($aValues) && (null === $iLenCache || $iLenCache === count($aValues))) - { - $mResult = $aValues; - } - } - - return $mResult; - } - - /** - * @return string - */ - public function StaticCache() - { - static $sCache = null; - if (!$sCache) - { - $sCache = \md5(APP_VERSION.$this->Plugins()->Hash()); - } - return $sCache; - } - - /** - * @param string $sTheme - * - * @return string - */ - public function ThemeLink($sTheme, $bAdmin) - { - return './?/Css/0/'.($bAdmin ? 'Admin' : 'User').'/-/'.$sTheme.'/-/'.$this->StaticCache().'/Hash/-/'; - } - - /** - * @param string $sTheme - * - * @return string - */ - public function ValidateTheme($sTheme, $bMobile = false) - { - if ($bMobile) - { - return 'Mobile'; - } - - return \in_array($sTheme, $this->GetThemes($bMobile)) ? - $sTheme : $this->Config()->Get('themes', 'default', $bMobile ? 'Mobile' : 'Default'); - } - - /** - * @param string $sLanguage - * @param string $sDefault = '' - * @param bool $bAdmin = false - * @param bool $bAllowEmptyResult = false - * - * @return string - */ - public function ValidateLanguage($sLanguage, $sDefault = '', $bAdmin = false, $bAllowEmptyResult = false) - { - $sResult = ''; - $aLang = $this->GetLanguages($bAdmin); - - if (\is_array($aLang)) - { - $aHelper = array('en' => 'en_us', 'ar' => 'ar_sa', 'cs' => 'cs_cz', 'no' => 'nb_no', 'ua' => 'uk_ua', - 'cn' => 'zh_cn', 'zh' => 'zh_cn', 'tw' => 'zh_tw'); - - $sLanguage = isset($aHelper[$sLanguage]) ? $aHelper[$sLanguage] : $sLanguage; - $sDefault = isset($aHelper[$sDefault]) ? $aHelper[$sDefault] : $sDefault; - - $sLanguage = \strtolower(\str_replace('-', '_', $sLanguage)); - if (2 === strlen($sLanguage)) - { - $sLanguage = $sLanguage.'_'.$sLanguage; - } - - $sDefault = \strtolower(\str_replace('-', '_', $sDefault)); - if (2 === strlen($sDefault)) - { - $sDefault = $sDefault.'_'.$sDefault; - } - - $sLanguage = \preg_replace_callback('/_([a-zA-Z0-9]{2})$/', function ($aData) { - return \strtoupper($aData[0]); - }, $sLanguage); - - $sDefault = \preg_replace_callback('/_([a-zA-Z0-9]{2})$/', function ($aData) { - return \strtoupper($aData[0]); - }, $sDefault); - - if (\in_array($sLanguage, $aLang)) - { - $sResult = $sLanguage; - } - - if (empty($sResult) && !empty($sDefault) && \in_array($sDefault, $aLang)) - { - $sResult = $sDefault; - } - - if (empty($sResult) && !$bAllowEmptyResult) - { - $sResult = $this->Config()->Get('webmail', $bAdmin ? 'language_admin' : 'language', 'en_US'); - $sResult = \in_array($sResult, $aLang) ? $sResult : 'en_US'; - } - } - - return $sResult; - } - - /** - * @param string $sType - * - * @return string - */ - public function ValidateContactPdoType($sType) - { - return \in_array($sType, array('mysql', 'pgsql', 'sqlite')) ? $sType : 'sqlite'; - } - - /** - * @staticvar array $aCache - * - * @return array - */ - public function GetThemes($bMobile = false, $bIncludeMobile = true) - { - if ($bMobile) - { - return array('Mobile'); - } - - static $aCache = array('full' => null, 'mobile' => null); - if ($bIncludeMobile && \is_array($aCache['full'])) - { - return $aCache['full']; - } - else if ($bIncludeMobile && \is_array($aCache['mobile'])) - { - return $aCache['mobile']; - } - - $bClear = false; - $bDefault = false; - $sList = array(); - $sDir = APP_VERSION_ROOT_PATH.'themes'; - if (@\is_dir($sDir)) - { - $rDirH = \opendir($sDir); - if ($rDirH) - { - while (($sFile = \readdir($rDirH)) !== false) - { - if ('.' !== $sFile{0} && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less')) - { - if ('Default' === $sFile) - { - $bDefault = true; - } - else if ('Clear' === $sFile) - { - $bClear = true; - } - else if ($bIncludeMobile || 'Mobile' !== $sFile) - { - $sList[] = $sFile; - } - } - } - @closedir($rDirH); - } - } - - $sDir = APP_INDEX_ROOT_PATH.'themes'; // custom user themes - if (@\is_dir($sDir)) - { - $rDirH = \opendir($sDir); - if ($rDirH) - { - while (($sFile = \readdir($rDirH)) !== false) - { - if ('.' !== $sFile{0} && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less')) - { - $sList[] = $sFile.'@custom'; - } - } - - @\closedir($rDirH); - } - } - - $sList = \array_unique($sList); - \sort($sList); - - if ($bDefault) - { - \array_unshift($sList, 'Default'); - } - - if ($bClear) - { - \array_push($sList, 'Clear'); - } - - $aCache[$bIncludeMobile ? 'full' : 'mobile'] = $sList; - return $sList; - } - - /** - * @staticvar array $aCache - * @param bool $bAdmin = false - * - * @return array - */ - public function GetLanguages($bAdmin = false) - { - static $aCache = array(); - $sDir = APP_VERSION_ROOT_PATH.'app/localization/'.($bAdmin ? 'admin' : 'webmail').'/'; - - if (isset($aCache[$sDir])) - { - return $aCache[$sDir]; - } - - $aTop = array(); - $aList = array(); - - if (@\is_dir($sDir)) - { - $rDirH = \opendir($sDir); - if ($rDirH) - { - while (($sFile = \readdir($rDirH)) !== false) - { - if ('.' !== $sFile{0} && \is_file($sDir.'/'.$sFile) && '.yml' === \substr($sFile, -4)) - { - $sLang = \substr($sFile, 0, -4); - if (0 < \strlen($sLang) && 'always' !== $sLang && '_source.en' !== $sLang) - { - \array_push($aList, $sLang); - } - } - } - - @\closedir($rDirH); - } - } - - \sort($aTop); - \sort($aList); - - $aCache[$sDir] = \array_merge($aTop, $aList); - return $aCache[$sDir]; - } - - /** - * @param string $sName - * @param string $sHtml - * - * @return string - */ - public function ProcessTemplate($sName, $sHtml) - { - $sHtml = $this->Plugins()->ProcessTemplate($sName, $sHtml); - $sHtml = \preg_replace('/\{\{INCLUDE\/([a-zA-Z]+)\/PLACE\}\}/', '', $sHtml); - - $sHtml = \preg_replace('/'; - } - - unset($aTemplates); - - return $bJsOutput ? 'window.rainloopTEMPLATES='.\MailSo\Base\Utils::Php2js(array($sHtml), $this->Logger()).';' : $sHtml; - } - - /** - * @param string $sLanguage - * - * @return string - */ - private function convertLanguageNameToMomentLanguageName($sLanguage) - { - $aHelper = array('en_gb' => 'en-gb', 'fr_ca' => 'fr-ca', 'pt_br' => 'pt-br', - 'uk_ua' => 'ua', 'zh_cn' => 'zh-cn', 'zh_tw' => 'zh-tw'); - - return isset($aHelper[$sLanguage]) ? $aHelper[$sLanguage] : \substr($sLanguage, 0, 2); - } - - /** - * @param string $sLanguage - * @param bool $bAdmin = false - * @param bool $bWrapByScriptTag = true - * - * @return string - */ - private function compileLanguage($sLanguage, $bAdmin = false, $bWrapByScriptTag = true) - { - $aResultLang = array(); - - $sMoment = 'window.moment && window.moment.lang && window.moment.lang(\'en\');'; - $sMomentFileName = APP_VERSION_ROOT_PATH.'app/localization/moment/'. - $this->convertLanguageNameToMomentLanguageName($sLanguage).'.js'; - - if (\file_exists($sMomentFileName)) - { - $sMoment = \file_get_contents($sMomentFileName); - $sMoment = \preg_replace('/\/\/[^\n]+\n/', '', $sMoment); - } - - \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/langs.yml', $aResultLang); - \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/'. - ($bAdmin ? 'admin' : 'webmail').'/_source.en.yml', $aResultLang); - \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/'. - ($bAdmin ? 'admin' : 'webmail').'/'.$sLanguage.'.yml', $aResultLang); - - $this->Plugins()->ReadLang($sLanguage, $aResultLang); - - $sLangJs = ''; - $aLangKeys = \array_keys($aResultLang); - foreach ($aLangKeys as $sKey) - { - $sString = isset($aResultLang[$sKey]) ? $aResultLang[$sKey] : $sKey; - if (\is_array($sString)) - { - $sString = \implode("\n", $sString); - } - - $sLangJs .= '"'.\str_replace('"', '\\"', \str_replace('\\', '\\\\', $sKey)).'":' - .'"'.\str_replace(array("\r", "\n", "\t"), array('\r', '\n', '\t'), - \str_replace('"', '\\"', \str_replace('\\', '\\\\', $sString))).'",'; - } - - $sResult = empty($sLangJs) ? 'null' : '{'.\substr($sLangJs, 0, -1).'}'; - - return - ($bWrapByScriptTag ? '' : '') - ; - } - - /** - * @param array $aAppData - * @param bool $bWrapByScriptTag = true - * - * @return string - */ - private function compileAppData($aAppData, $bWrapByScriptTag = true) - { - return - ($bWrapByScriptTag ? '' : '') - ; - } -} +oHttp = $oHttp; + $this->oActions = $oActions; + $this->aPaths = array(); + $this->sQuery = ''; + } + + /** + * @return \MailSo\Log\Logger + */ + public function Logger() + { + return $this->oActions->Logger(); + } + + /** + * @return \RainLoop\Plugins\Manager + */ + public function Plugins() + { + return $this->oActions->Plugins(); + } + + /** + * @return \RainLoop\Application + */ + public function Config() + { + return $this->oActions->Config(); + } + + /** + * @return \MailSo\Cache\CacheClient + */ + public function Cacher() + { + return $this->oActions->Cacher(); + } + + /** + * @return \RainLoop\Providers\Storage + */ + public function StorageProvider() + { + return $this->oActions->StorageProvider(); + } + + /** + * @return \RainLoop\Providers\Settings + */ + public function SettingsProvider() + { + return $this->oActions->SettingsProvider(); + } + + /** + * @param array $aPaths + * + * @return \RainLoop\ServiceActions + */ + public function SetPaths($aPaths) + { + $this->aPaths = \is_array($aPaths) ? $aPaths : array(); + return $this; + } + + /** + * @param string $sQuery + * + * @return \RainLoop\ServiceActions + */ + public function SetQuery($sQuery) + { + $this->sQuery = $sQuery; + return $this; + } + + /** + * @return string + */ + public function ServiceAjax() + { + @\ob_start(); + + $aResponseItem = null; + $oException = null; + + $sAction = $this->oHttp->GetPost('Action', null); + if (empty($sAction) && $this->oHttp->IsGet() && !empty($this->aPaths[2])) + { + $sAction = $this->aPaths[2]; + } + + try + { + if ($this->oHttp->IsPost() && !in_array($sAction, array('JsInfo', 'JsError')) && + $this->Config()->Get('security', 'csrf_protection', false) && + $this->oHttp->GetPost('XToken', '') !== \RainLoop\Utils::GetCsrfToken()) + { + throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::InvalidToken); + } + else if (!empty($sAction)) + { + $sMethodName = 'Do'.$sAction; + + $this->Logger()->Write('Action: '.$sMethodName, \MailSo\Log\Enumerations\Type::NOTE, 'AJAX'); + + $aPost = $this->oHttp->GetPostAsArray(); + if (\is_array($aPost) && 0 < \count($aPost)) + { + $this->oActions->SetActionParams($aPost, $sMethodName); + switch ($sMethodName) + { + case 'DoLogin': + case 'DoAdminLogin': + case 'DoAccountAdd': + $this->Logger()->AddSecret($this->oActions->GetActionParam('Password', '')); + break; + case 'DoChangePassword': + $this->Logger()->AddSecret($this->oActions->GetActionParam('PrevPassword', '')); + $this->Logger()->AddSecret($this->oActions->GetActionParam('NewPassword', '')); + break; + } + + $this->Logger()->Write(\MailSo\Base\Utils::Php2js($aPost, $this->Logger()), + \MailSo\Log\Enumerations\Type::INFO, 'POST', true); + } + else if (3 < \count($this->aPaths) && $this->oHttp->IsGet()) + { + $this->oActions->SetActionParams(array( + 'RawKey' => empty($this->aPaths[3]) ? '' : $this->aPaths[3] + ), $sMethodName); + } + + if (\method_exists($this->oActions, $sMethodName) && + \is_callable(array($this->oActions, $sMethodName))) + { + $this->Plugins()->RunHook('ajax.action-pre-call', array($sAction)); + $aResponseItem = \call_user_func(array($this->oActions, $sMethodName)); + $this->Plugins()->RunHook('ajax.action-post-call', array($sAction, &$aResponseItem)); + } + else if ($this->Plugins()->HasAdditionalAjax($sMethodName)) + { + $this->Plugins()->RunHook('ajax.action-pre-call', array($sAction)); + $aResponseItem = $this->Plugins()->RunAdditionalAjax($sMethodName); + $this->Plugins()->RunHook('ajax.action-post-call', array($sAction, &$aResponseItem)); + } + } + + if (!\is_array($aResponseItem)) + { + throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError); + } + } + catch (\Exception $oException) + { + $aResponseItem = $this->oActions->ExceptionResponse( + empty($sAction) ? 'Unknown' : $sAction, $oException); + + if (\is_array($aResponseItem) && $oException instanceof \RainLoop\Exceptions\ClientException) + { + if ('Folders' === $sAction) + { + $aResponseItem['ClearAuth'] = true; + } + + if ($oException->getLogoutOnException()) + { + $aResponseItem['Logout'] = true; + if ($oException->getAdditionalMessage()) + { + $this->oActions->SetSpecLogoutCustomMgsWithDeletion($oException->getAdditionalMessage()); + } + } + } + } + + if (\is_array($aResponseItem)) + { + $aResponseItem['Time'] = (int) ((\microtime(true) - APP_START) * 1000); + } + + $this->Plugins()->RunHook('filter.ajax-response', array($sAction, &$aResponseItem)); + + @\header('Content-Type: application/json; charset=utf-8'); + + $sResult = \MailSo\Base\Utils::Php2js($aResponseItem, $this->Logger()); + + $sObResult = @\ob_get_clean(); + + if ($this->Logger()->IsEnabled()) + { + if (0 < \strlen($sObResult)) + { + $this->Logger()->Write($sObResult, \MailSo\Log\Enumerations\Type::ERROR, 'OB-DATA'); + } + + if ($oException) + { + $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); + } + + $iLimit = (int) $this->Config()->Get('labs', 'log_ajax_response_write_limit', 0); + $this->Logger()->Write(0 < $iLimit && $iLimit < \strlen($sResult) + ? \substr($sResult, 0, $iLimit).'...' : $sResult, \MailSo\Log\Enumerations\Type::INFO, 'AJAX'); + } + + return $sResult; + } + + /** + * @return string + */ + public function ServiceOwnCloudAuth() + { + $this->oHttp->ServerNoCache(); + + if (!\RainLoop\Utils::IsOwnCloud() || + !isset($_ENV['___rainloop_owncloud_email']) || + !isset($_ENV['___rainloop_owncloud_password']) || + empty($_ENV['___rainloop_owncloud_email']) + ) + { + $this->oActions->SetAuthLogoutToken(); + $this->oActions->Location('./'); + return ''; + } + + $bLogout = true; + + $sEmail = $_ENV['___rainloop_owncloud_email']; + $sPassword = $_ENV['___rainloop_owncloud_password']; + + try + { + $oAccount = $this->oActions->LoginProcess($sEmail, $sPassword); + $this->oActions->AuthToken($oAccount); + + $bLogout = !($oAccount instanceof \RainLoop\Model\Account); + } + catch (\Exception $oException) + { + $this->oActions->Logger()->WriteException($oException); + } + + if ($bLogout) + { + $this->oActions->SetAuthLogoutToken(); + } + + $this->oActions->Location('./'); + return ''; + } + + /** + * @return string + */ + public function ServiceAppend() + { + @\ob_start(); + $bResponse = false; + $oException = null; + try + { + if (\method_exists($this->oActions, 'Append') && + \is_callable(array($this->oActions, 'Append'))) + { + $this->oActions->SetActionParams($this->oHttp->GetPostAsArray(), 'Append'); + $bResponse = \call_user_func(array($this->oActions, 'Append')); + } + } + catch (\Exception $oException) + { + $bResponse = false; + } + + @\header('Content-Type: text/plain; charset=utf-8'); + $sResult = true === $bResponse ? '1' : '0'; + + $sObResult = @\ob_get_clean(); + if (0 < \strlen($sObResult)) + { + $this->Logger()->Write($sObResult, \MailSo\Log\Enumerations\Type::ERROR, 'OB-DATA'); + } + + if ($oException) + { + $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); + } + + $this->Logger()->Write($sResult, \MailSo\Log\Enumerations\Type::INFO, 'APPEND'); + + return $sResult; + } + + /** + * @param string $sAction + * @param int $iSizeLimit = 0 + * + * @return string + */ + private function privateUpload($sAction, $iSizeLimit = 0) + { + $oConfig = $this->Config(); + + @\ob_start(); + $aResponseItem = null; + try + { + $aFile = null; + $sInputName = 'uploader'; + $iError = \RainLoop\Enumerations\UploadError::UNKNOWN; + $iSizeLimit = (0 < $iSizeLimit ? $iSizeLimit : ((int) $oConfig->Get('webmail', 'attachment_size_limit', 0))) * 1024 * 1024; + + $iError = UPLOAD_ERR_OK; + $_FILES = isset($_FILES) ? $_FILES : null; + if (isset($_FILES, $_FILES[$sInputName], $_FILES[$sInputName]['name'], $_FILES[$sInputName]['tmp_name'], $_FILES[$sInputName]['size'])) + { + $iError = (isset($_FILES[$sInputName]['error'])) ? (int) $_FILES[$sInputName]['error'] : UPLOAD_ERR_OK; + + if (UPLOAD_ERR_OK === $iError && 0 < $iSizeLimit && $iSizeLimit < (int) $_FILES[$sInputName]['size']) + { + $iError = \RainLoop\Enumerations\UploadError::CONFIG_SIZE; + } + + if (UPLOAD_ERR_OK === $iError) + { + $aFile = $_FILES[$sInputName]; + } + } + else if (!isset($_FILES) || !is_array($_FILES) || 0 === count($_FILES)) + { + $iError = UPLOAD_ERR_INI_SIZE; + } + else + { + $iError = \RainLoop\Enumerations\UploadError::EMPTY_FILES_DATA; + } + + if (\method_exists($this->oActions, $sAction) && + \is_callable(array($this->oActions, $sAction))) + { + $aActionParams = $this->oHttp->GetQueryAsArray(); + + $aActionParams['File'] = $aFile; + $aActionParams['Error'] = $iError; + + $this->oActions->SetActionParams($aActionParams, $sAction); + + $aResponseItem = \call_user_func(array($this->oActions, $sAction)); + } + + if (!is_array($aResponseItem)) + { + throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError); + } + } + catch (\Exception $oException) + { + $aResponseItem = $this->oActions->ExceptionResponse($sAction, $oException); + } + + if ('iframe' === $this->oHttp->GetPost('jua-post-type', '')) + { + @\header('Content-Type: text/html; charset=utf-8'); + } + else + { + @\header('Content-Type: application/json; charset=utf-8'); + } + + $this->Plugins()->RunHook('filter.upload-response', array(&$aResponseItem)); + $sResult = \MailSo\Base\Utils::Php2js($aResponseItem, $this->Logger()); + + $sObResult = @\ob_get_clean(); + if (0 < \strlen($sObResult)) + { + $this->Logger()->Write($sObResult, \MailSo\Log\Enumerations\Type::ERROR, 'OB-DATA'); + } + + $this->Logger()->Write($sResult, \MailSo\Log\Enumerations\Type::INFO, 'UPLOAD'); + + return $sResult; + } + + /** + * @return string + */ + public function ServiceUpload() + { + return $this->privateUpload('Upload'); + } + + /** + * @return string + */ + public function ServiceUploadContacts() + { + return $this->privateUpload('UploadContacts', 5); + } + + /** + * @return string + */ + public function ServiceUploadBackground() + { + return $this->privateUpload('UploadBackground', 1); + } + + /** + * @return string + */ + public function ServiceProxyExternal() + { + $bResult = false; + $sData = empty($this->aPaths[1]) ? '' : $this->aPaths[1]; + if (!empty($sData) && $this->oActions->Config()->Get('labs', 'use_local_proxy_for_external_images', false)) + { + $this->oActions->verifyCacheByKey($sData); + + $aData = \RainLoop\Utils::DecodeKeyValuesQ($sData); + if (\is_array($aData) && !empty($aData['Token']) && !empty($aData['Url']) && $aData['Token'] === \RainLoop\Utils::GetConnectionToken()) + { + $iCode = 404; + $sContentType = ''; + $mResult = $this->oHttp->GetUrlAsString($aData['Url'], 'RainLoop External Proxy', $sContentType, $iCode); + + if (false !== $mResult && 200 === $iCode && + \in_array($sContentType, array('image/png', 'image/jpeg', 'image/jpg', 'image/bmp', 'image/gif'))) + { + $bResult = true; + + $this->oActions->cacheByKey($sData); + + \header('Content-Type: '.$sContentType); + echo $mResult; + } + } + } + + if (!$bResult) + { + $this->oHttp->StatusHeader(404); + } + + return ''; + } + + /** + * @return string + */ + public function ServiceRaw() + { + $sResult = ''; + $sRawError = ''; + $sAction = empty($this->aPaths[2]) ? '' : $this->aPaths[2]; + $oException = null; + + try + { + $sRawError = 'Invalid action'; + if (0 !== \strlen($sAction)) + { + $sMethodName = 'Raw'.$sAction; + if (\method_exists($this->oActions, $sMethodName)) + { + @\header('X-Raw-Action: '.$sMethodName, true); + + $sRawError = ''; + $this->oActions->SetActionParams(array( + 'RawKey' => empty($this->aPaths[3]) ? '' : $this->aPaths[3], + 'Params' => $this->aPaths + ), $sMethodName); + + if (!\call_user_func(array($this->oActions, $sMethodName))) + { + $sRawError = 'False result'; + } + else + { + $sRawError = ''; + } + } + else + { + $sRawError = 'Unknown action "'.$sAction.'"'; + } + } + else + { + $sRawError = 'Empty action'; + } + } + catch (\RainLoop\Exceptions\ClientException $oException) + { + $sRawError = 'Exception as result'; + switch ($oException->getCode()) + { + case \RainLoop\Notifications::AuthError: + $sRawError = 'Authentication failed'; + break; + } + } + catch (\Exception $oException) + { + $sRawError = 'Exception as result'; + } + + if (0 < \strlen($sRawError)) + { + $this->oActions->Logger()->Write($sRawError, \MailSo\Log\Enumerations\Type::ERROR); + $this->oActions->Logger()->WriteDump($this->aPaths, \MailSo\Log\Enumerations\Type::ERROR, 'PATHS'); + } + + if ($oException) + { + $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR, 'RAW'); + } + + return $sResult; + } + + /** + * @return string + */ + public function ServiceLang() + { +// sleep(2); + $sResult = ''; + @\header('Content-Type: application/javascript; charset=utf-8'); + + if (!empty($this->aPaths[3])) + { + $bAdmim = 'Admin' === (isset($this->aPaths[2]) ? (string) $this->aPaths[2] : 'App'); + $sLanguage = $this->oActions->ValidateLanguage($this->aPaths[3], '', $bAdmim); + + $bCacheEnabled = $this->Config()->Get('labs', 'cache_system_data', true); + if (!empty($sLanguage) && $bCacheEnabled) + { + $this->oActions->verifyCacheByKey($this->sQuery); + } + + $sCacheFileName = ''; + if ($bCacheEnabled) + { + $sCacheFileName = \RainLoop\KeyPathHelper::LangCache( + $sLanguage, $bAdmim, $this->oActions->Plugins()->Hash()); + + $sResult = $this->Cacher()->Get($sCacheFileName); + } + + if (0 === \strlen($sResult)) + { + $sResult = $this->compileLanguage($sLanguage, $bAdmim, false); + if ($bCacheEnabled && 0 < \strlen($sCacheFileName)) + { + $this->Cacher()->Set($sCacheFileName, $sResult); + } + } + + if ($bCacheEnabled) + { + $this->oActions->cacheByKey($this->sQuery); + } + } + + return $sResult; + } + + /** + * @return string + */ + public function ServiceTemplates() + { + $sResult = ''; + @\header('Content-Type: application/javascript; charset=utf-8'); + + $bCacheEnabled = $this->Config()->Get('labs', 'cache_system_data', true); + if ($bCacheEnabled) + { + $this->oActions->verifyCacheByKey($this->sQuery); + } + + $bAdmin = false !== \strpos($this->sQuery, 'Admin'); + + $sCacheFileName = ''; + if ($bCacheEnabled) + { + $sCacheFileName = \RainLoop\KeyPathHelper::TemplatesCache($bAdmin, $this->oActions->Plugins()->Hash()); + $sResult = $this->Cacher()->Get($sCacheFileName); + } + + if (0 === \strlen($sResult)) + { + $sResult = $this->compileTemplates($bAdmin); + if ($bCacheEnabled && 0 < \strlen($sCacheFileName)) + { + $this->Cacher()->Set($sCacheFileName, $sResult); + } + } + + if ($bCacheEnabled) + { + $this->oActions->cacheByKey($this->sQuery); + } + + return $sResult; + } + + /** + * @return string + */ + public function ServicePlugins() + { + $sResult = ''; + $bAdmin = !empty($this->aPaths[2]) && 'Admin' === $this->aPaths[2]; + + @\header('Content-Type: application/javascript; charset=utf-8'); + + $bCacheEnabled = $this->Config()->Get('labs', 'cache_system_data', true); + if ($bCacheEnabled) + { + $this->oActions->verifyCacheByKey($this->sQuery); + } + + $sCacheFileName = ''; + if ($bCacheEnabled) + { + $sCacheFileName = \RainLoop\KeyPathHelper::PluginsJsCache($this->oActions->Plugins()->Hash()); + $sResult = $this->Cacher()->Get($sCacheFileName); + } + + if (0 === strlen($sResult)) + { + $sResult = $this->Plugins()->CompileJs($bAdmin); + if ($bCacheEnabled && 0 < \strlen($sCacheFileName)) + { + $this->Cacher()->Set($sCacheFileName, $sResult); + } + } + + if ($bCacheEnabled) + { + $this->oActions->cacheByKey($this->sQuery); + } + + return $sResult; + } + + /** + * @return string + */ + public function ServiceCss() + { + $sResult = ''; + + $bAdmin = !empty($this->aPaths[2]) && 'Admin' === $this->aPaths[2]; + $bJson = !empty($this->aPaths[9]) && 'Json' === $this->aPaths[9]; + + if ($bJson) + { + @\header('Content-Type: application/json; charset=utf-8'); + } + else + { + @\header('Content-Type: text/css; charset=utf-8'); + } + + $sTheme = ''; + if (!empty($this->aPaths[4])) + { + $sTheme = $this->oActions->ValidateTheme($this->aPaths[4]); + $sRealTheme = $sTheme; + + $bCustomTheme = '@custom' === \substr($sTheme, -7); + if ($bCustomTheme) + { + $sRealTheme = \substr($sTheme, 0, -7); + } + + $bCacheEnabled = $this->Config()->Get('labs', 'cache_system_data', true); + if ($bCacheEnabled) + { + $this->oActions->verifyCacheByKey($this->sQuery); + } + + $sCacheFileName = ''; + if ($bCacheEnabled) + { + $sCacheFileName = \RainLoop\KeyPathHelper::CssCache($sTheme, $this->oActions->Plugins()->Hash()); + $sResult = $this->Cacher()->Get($sCacheFileName); + } + + if (0 === \strlen($sResult)) + { + try + { + include_once APP_VERSION_ROOT_PATH.'app/libraries/lessphp/ctype.php'; + include_once APP_VERSION_ROOT_PATH.'app/libraries/lessphp/lessc.inc.php'; + + $oLess = new \RainLoopVendor\lessc(); + $oLess->setFormatter('compressed'); + + $aResult = array(); + + $sThemeFile = ($bCustomTheme ? APP_INDEX_ROOT_PATH : APP_VERSION_ROOT_PATH).'themes/'.$sRealTheme.'/styles.less'; + $sThemeExtFile = ($bCustomTheme ? APP_INDEX_ROOT_PATH : APP_VERSION_ROOT_PATH).'themes/'.$sRealTheme.'/ext.less'; + + $sThemeValuesFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/values.less'; + $sThemeTemplateFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/template.less'; + + if (\file_exists($sThemeFile) && \file_exists($sThemeTemplateFile) && \file_exists($sThemeValuesFile)) + { + $aResult[] = '@base: "'. + ($bCustomTheme ? \RainLoop\Utils::WebPath() : \RainLoop\Utils::WebVersionPath()). + 'themes/'.$sRealTheme.'/";'; + + $aResult[] = \file_get_contents($sThemeValuesFile); + $aResult[] = \file_get_contents($sThemeFile); + $aResult[] = \file_get_contents($sThemeTemplateFile); + + if (\file_exists($sThemeExtFile)) + { + $aResult[] = \file_get_contents($sThemeExtFile); + } + } + + $aResult[] = $this->Plugins()->CompileCss($bAdmin); + + $sResult = $oLess->compile(\implode("\n", $aResult)); + + if ($bCacheEnabled) + { + if (0 < \strlen($sCacheFileName)) + { + $this->Cacher()->Set($sCacheFileName, $sResult); + } + } + } + catch (\Exception $oException) + { + $this->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR, 'LESS'); + } + } + + if ($bCacheEnabled) + { + $this->oActions->cacheByKey($this->sQuery); + } + } + + return $bJson ? \MailSo\Base\Utils::Php2js(array($sTheme, $sResult), $this->Logger()) : $sResult; + } + + /** + * @return string + */ + public function ServiceSocialGoogle() + { + $bXAuth = '1' === (string) $this->oHttp->GetQuery('xauth', '0'); + return $this->oActions->Social()->GooglePopupService($bXAuth); + } + + /** + * @return string + */ + public function ServiceSocialFacebook() + { + return $this->oActions->Social()->FacebookPopupService(); + } + + /** + * @return string + */ + public function ServiceSocialTwitter() + { + return $this->oActions->Social()->TwitterPopupService(); + } + + /** + * @return string + */ + public function ServiceAppData($sAdd = '') + { + return $this->localAppData(false, $sAdd); + } + + /** + * @return string + */ + public function ServiceAdminAppData($sAdd = '') + { + return $this->localAppData(true, $sAdd); + } + + /** + * @return string + */ + public function ServiceSkipMobile() + { + \RainLoop\Utils::SetCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY, 1); + $this->oActions->Location('./'); + return ''; + } + + /** + * @return string + */ + public function ServiceClearSkipMobile() + { + \RainLoop\Utils::ClearCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY); + $this->oActions->Location('./'); + return ''; + } + + /** + * @return string + */ + public function ServiceNoScript() + { + return $this->localError($this->oActions->StaticI18N('STATIC/NO_SCRIPT_TITLE'), $this->oActions->StaticI18N('STATIC/NO_SCRIPT_DESC')); + } + + /** + * @return string + */ + public function ServiceNoCookie() + { + return $this->localError($this->oActions->StaticI18N('STATIC/NO_COOKIE_TITLE'), $this->oActions->StaticI18N('STATIC/NO_COOKIE_DESC')); + } + + /** + * @return string + */ + public function ServiceBadBrowser() + { + $sTitle = $this->oActions->StaticI18N('STATIC/BAD_BROWSER_TITLE'); + $sDesc = \nl2br($this->oActions->StaticI18N('STATIC/BAD_BROWSER_DESC')); + + @\header('Content-Type: text/html; charset=utf-8'); + return \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/BadBrowser.html'), array( + '{{BaseWebStaticPath}}' => \RainLoop\Utils::WebStaticPath(), + '{{ErrorTitle}}' => $sTitle, + '{{ErrorHeader}}' => $sTitle, + '{{ErrorDesc}}' => $sDesc + )); + } + + /** + * @return string + */ + public function ServiceMailto() + { + $this->oHttp->ServerNoCache(); + + $sTo = \trim($this->oHttp->GetQuery('to', '')); + if (!empty($sTo) && \preg_match('/^mailto:/i', $sTo)) + { + $oAccount = $this->oActions->GetAccountFromSignMeToken(); + if ($oAccount) + { + $this->oActions->SetMailtoRequest($sTo); + } + } + + $this->oActions->Location('./'); + return ''; + } + + /** + * @return string + */ + public function ServicePing() + { + $this->oHttp->ServerNoCache(); + + @\header('Content-Type: text/plain; charset=utf-8'); + $this->oActions->Logger()->Write('Pong', \MailSo\Log\Enumerations\Type::INFO, 'PING'); + return 'Pong'; + } + + /** + * @return string + */ + public function ServiceInfo() + { + $this->oHttp->ServerNoCache(); + + if ($this->oActions->IsAdminLoggined(false)) + { + @\header('Content-Type: text/html; charset=utf-8'); + \phpinfo(); + } + } + + /** + * @return string + */ + public function ServiceSso() + { + $this->oHttp->ServerNoCache(); + + $oException = null; + $oAccount = null; + $bLogout = true; + + $sSsoHash = $this->oHttp->GetRequest('hash', ''); + if (!empty($sSsoHash)) + { + $mData = null; + + $sSsoSubData = $this->Cacher()->Get(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash)); + if (!empty($sSsoSubData)) + { + $mData = \RainLoop\Utils::DecodeKeyValuesQ($sSsoSubData); + $this->Cacher()->Delete(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash)); + + if (\is_array($mData) && !empty($mData['Email']) && isset($mData['Password'], $mData['Time']) && + (0 === $mData['Time'] || \time() - 10 < $mData['Time'])) + { + $sEmail = \trim($mData['Email']); + $sPassword = $mData['Password']; + + $aAdditionalOptions = isset($mData['AdditionalOptions']) && \is_array($mData['AdditionalOptions']) && + 0 < \count($mData['AdditionalOptions']) ? $mData['AdditionalOptions'] : null; + + try + { + $oAccount = $this->oActions->LoginProcess($sEmail, $sPassword); + + if ($oAccount instanceof \RainLoop\Model\Account && $aAdditionalOptions) + { + $bNeedToSettings = false; + + $oSettings = $this->SettingsProvider()->Load($oAccount); + if ($oSettings) + { + $sLanguage = isset($aAdditionalOptions['Language']) ? + $aAdditionalOptions['Language'] : ''; + + if ($sLanguage) + { + $sLanguage = $this->oActions->ValidateLanguage($sLanguage); + if ($sLanguage !== $oSettings->GetConf('Language', '')) + { + $bNeedToSettings = true; + $oSettings->SetConf('Language', $sLanguage); + } + } + } + + if ($bNeedToSettings) + { + $this->SettingsProvider()->Save($oAccount, $oSettings); + } + } + + $this->oActions->AuthToken($oAccount); + + $bLogout = !($oAccount instanceof \RainLoop\Model\Account); + } + catch (\Exception $oException) + { + $this->oActions->Logger()->WriteException($oException); + } + } + } + } + + if ($bLogout) + { + $this->oActions->SetAuthLogoutToken(); + } + + $this->oActions->Location('./'); + return ''; + } + + /** + * @return string + */ + public function ServiceRemoteAutoLogin() + { + $oException = null; + $oAccount = null; + $bLogout = true; + + $sEmail = $this->oHttp->GetEnv('REMOTE_USER', ''); + $sPassword = $this->oHttp->GetEnv('REMOTE_PASSWORD', ''); + + if (0 < \strlen($sEmail) && 0 < \strlen(\trim($sPassword))) + { + try + { + $oAccount = $this->oActions->LoginProcess($sEmail, $sPassword); + $this->oActions->AuthToken($oAccount); + $bLogout = !($oAccount instanceof \RainLoop\Model\Account); + } + catch (\Exception $oException) + { + $this->oActions->Logger()->WriteException($oException); + } + } + + if ($bLogout) + { + $this->oActions->SetAuthLogoutToken(); + } + + $this->oActions->Location('./'); + return ''; + } + + /** + * @return string + */ + public function ServiceExternalLogin() + { + $this->oHttp->ServerNoCache(); + + $oException = null; + $oAccount = null; + $bLogout = true; + + if ($this->oActions->Config()->Get('labs', 'allow_external_login', false)) + { + $sEmail = \trim($this->oHttp->GetRequest('Email', '')); + $sPassword = $this->oHttp->GetRequest('Password', ''); + + try + { + $oAccount = $this->oActions->LoginProcess($sEmail, $sPassword); + $this->oActions->AuthToken($oAccount); + $bLogout = !($oAccount instanceof \RainLoop\Model\Account); + } + catch (\Exception $oException) + { + $this->oActions->Logger()->WriteException($oException); + } + + if ($bLogout) + { + $this->oActions->SetAuthLogoutToken(); + } + } + + switch (\strtolower($this->oHttp->GetRequest('Output', 'Redirect'))) + { + case 'json': + + @\header('Content-Type: application/json; charset=utf-8'); + + $aResult = array( + 'Action' => 'ExternalLogin', + 'Result' => $oAccount instanceof \RainLoop\Model\Account ? true : false, + 'ErrorCode' => 0 + ); + + if (!$aResult['Result']) + { + if ($oException instanceof \RainLoop\Exceptions\ClientException) + { + $aResult['ErrorCode'] = $oException->getCode(); + } + else + { + $aResult['ErrorCode'] = \RainLoop\Notifications::AuthError; + } + } + + return \MailSo\Base\Utils::Php2js($aResult, $this->Logger()); + + case 'redirect': + default: + $this->oActions->Location('./'); + break; + } + + return ''; + } + + /** + * @return string + */ + public function ServiceExternalSso() + { + $this->oHttp->ServerNoCache(); + + $sResult = ''; + $bLogout = true; + $sKey = $this->oActions->Config()->Get('labs', 'external_sso_key', ''); + if ($this->oActions->Config()->Get('labs', 'allow_external_sso', false) && + !empty($sKey) && $sKey === \trim($this->oHttp->GetRequest('SsoKey', ''))) + { + $sEmail = \trim($this->oHttp->GetRequest('Email', '')); + $sPassword = $this->oHttp->GetRequest('Password', ''); + + $sResult = \RainLoop\Api::GetUserSsoHash($sEmail, $sPassword); + $bLogout = 0 === \strlen($sResult); + + switch (\strtolower($this->oHttp->GetRequest('Output', 'Plain'))) + { + case 'plain': + @\header('Content-Type: text/plain'); + break; + + case 'json': + @\header('Content-Type: application/json; charset=utf-8'); + $sResult = \MailSo\Base\Utils::Php2js(array( + 'Action' => 'ExternalSso', + 'Result' => $sResult + ), $this->Logger()); + break; + } + } + + if ($bLogout) + { + $this->oActions->SetAuthLogoutToken(); + } + + return $sResult; + } + + private function changeAction() + { + $this->oHttp->ServerNoCache(); + + $oAccount = $this->oActions->GetAccount(); + + if ($oAccount && $this->oActions->GetCapa(false, false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount)) + { + $oAccountToLogin = null; + $sEmail = empty($this->aPaths[2]) ? '' : \urldecode(\trim($this->aPaths[2])); + if (!empty($sEmail)) + { + $sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail); + + $aAccounts = $this->oActions->GetAccounts($oAccount); + if (isset($aAccounts[$sEmail])) + { + $oAccountToLogin = $this->oActions->GetAccountFromCustomToken($aAccounts[$sEmail], false, false); + } + } + + if ($oAccountToLogin) + { + $this->oActions->AuthToken($oAccountToLogin); + } + } + } + + /** + * @return string + */ + public function ServiceChangeMobile() + { + $this->changeAction(); + $this->oActions->Location('./?/Mobile/'); + return ''; + } + + /** + * @return string + */ + public function ServiceChange() + { + $this->changeAction(); + $this->oActions->Location('./'); + return ''; + } + + /** + * @param string $sTitle + * @param string $sDesc + * + * @return mixed + */ + public function ErrorTemplates($sTitle, $sDesc, $bShowBackLink = true) + { + return strtr(file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Error.html'), array( + '{{BaseWebStaticPath}}' => \RainLoop\Utils::WebStaticPath(), + '{{ErrorTitle}}' => $sTitle, + '{{ErrorHeader}}' => $sTitle, + '{{ErrorDesc}}' => $sDesc, + '{{BackLinkVisibilityStyle}}' => $bShowBackLink ? 'display:inline-block' : 'display:none', + '{{BackLink}}' => $this->oActions->StaticI18N('STATIC/BACK_LINK'), + '{{BackHref}}' => './' + )); + } + + /** + * @param string $sTitle + * @param string $sDesc + * + * @return string + */ + private function localError($sTitle, $sDesc) + { + @header('Content-Type: text/html; charset=utf-8'); + return $this->ErrorTemplates($sTitle, \nl2br($sDesc)); + } + + /** + * @param bool $bAdmin = true + * @param string $sAdd = '' + * + * @return string + */ + private function localAppData($bAdmin = false, $sAdd = '') + { + @\header('Content-Type: application/javascript; charset=utf-8'); + $this->oHttp->ServerNoCache(); + + $sAuthAccountHash = ''; + if (!$bAdmin && 0 === \strlen($this->oActions->GetSpecAuthLogoutTokenWithDeletion())) + { + $sAuthAccountHash = $this->oActions->GetSpecAuthTokenWithDeletion(); + if (empty($sAuthAccountHash)) + { + $sAuthAccountHash = $this->oActions->GetSpecAuthToken(); + } + + if (empty($sAuthAccountHash)) + { + $oAccount = $this->oActions->GetAccountFromSignMeToken(); + if ($oAccount) + { + try + { + $this->oActions->CheckMailConnection($oAccount); + + $this->oActions->AuthToken($oAccount); + + $sAuthAccountHash = $this->oActions->GetSpecAuthToken(); + } + catch (\Exception $oException) + { + $oException = null; + $this->oActions->ClearSignMeData($oAccount); + } + } + } + + $this->oActions->SetSpecAuthToken($sAuthAccountHash); + } + + $sResult = $this->compileAppData($this->oActions->AppData($bAdmin, + 0 === \strpos($sAdd, 'mobile'), '1' === \substr($sAdd, -1), + $sAuthAccountHash), false); + + $this->Logger()->Write($sResult, \MailSo\Log\Enumerations\Type::INFO, 'APPDATA'); + + return $sResult; + } + + /** + * @param bool $bAdmin = false + * @param bool $bJsOutput = true + * + * @return string + */ + public function compileTemplates($bAdmin = false, $bJsOutput = true) + { + $aTemplates = array(); + + \RainLoop\Utils::CompileTemplates($aTemplates, APP_VERSION_ROOT_PATH.'app/templates/Views/Components', 'Component'); + \RainLoop\Utils::CompileTemplates($aTemplates, APP_VERSION_ROOT_PATH.'app/templates/Views/'.($bAdmin ? 'Admin' : 'User')); + \RainLoop\Utils::CompileTemplates($aTemplates, APP_VERSION_ROOT_PATH.'app/templates/Views/Common'); + + $this->oActions->Plugins()->CompileTemplate($aTemplates, $bAdmin); + + $sHtml = ''; + foreach ($aTemplates as $sName => $sFile) + { + $sName = \preg_replace('/[^a-zA-Z0-9]/', '', $sName); + $sHtml .= ''; + } + + unset($aTemplates); + + return $bJsOutput ? 'window.rainloopTEMPLATES='.\MailSo\Base\Utils::Php2js(array($sHtml), $this->Logger()).';' : $sHtml; + } + + /** + * @param string $sLanguage + * + * @return string + */ + private function convertLanguageNameToMomentLanguageName($sLanguage) + { + $aHelper = array('en_gb' => 'en-gb', 'fr_ca' => 'fr-ca', 'pt_br' => 'pt-br', + 'uk_ua' => 'ua', 'zh_cn' => 'zh-cn', 'zh_tw' => 'zh-tw'); + + return isset($aHelper[$sLanguage]) ? $aHelper[$sLanguage] : \substr($sLanguage, 0, 2); + } + + /** + * @param string $sLanguage + * @param bool $bAdmin = false + * @param bool $bWrapByScriptTag = true + * + * @return string + */ + private function compileLanguage($sLanguage, $bAdmin = false, $bWrapByScriptTag = true) + { + $aResultLang = array(); + + $sMoment = 'window.moment && window.moment.locale && window.moment.locale(\'en\');'; + $sMomentFileName = APP_VERSION_ROOT_PATH.'app/localization/moment/'. + $this->convertLanguageNameToMomentLanguageName($sLanguage).'.js'; + + if (\file_exists($sMomentFileName)) + { + $sMoment = \file_get_contents($sMomentFileName); + $sMoment = \preg_replace('/\/\/[^\n]+\n/', '', $sMoment); + } + + \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/langs.yml', $aResultLang); + \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/'. + ($bAdmin ? 'admin' : 'webmail').'/_source.en.yml', $aResultLang); + \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/'. + ($bAdmin ? 'admin' : 'webmail').'/'.$sLanguage.'.yml', $aResultLang); + + $this->Plugins()->ReadLang($sLanguage, $aResultLang); + + $sLangJs = ''; + $aLangKeys = \array_keys($aResultLang); + foreach ($aLangKeys as $sKey) + { + $sString = isset($aResultLang[$sKey]) ? $aResultLang[$sKey] : $sKey; + if (\is_array($sString)) + { + $sString = \implode("\n", $sString); + } + + $sLangJs .= '"'.\str_replace('"', '\\"', \str_replace('\\', '\\\\', $sKey)).'":' + .'"'.\str_replace(array("\r", "\n", "\t"), array('\r', '\n', '\t'), + \str_replace('"', '\\"', \str_replace('\\', '\\\\', $sString))).'",'; + } + + $sResult = empty($sLangJs) ? 'null' : '{'.\substr($sLangJs, 0, -1).'}'; + + return + ($bWrapByScriptTag ? '' : '') + ; + } + + /** + * @param array $aAppData + * @param bool $bWrapByScriptTag = true + * + * @return string + */ + private function compileAppData($aAppData, $bWrapByScriptTag = true) + { + return + ($bWrapByScriptTag ? '' : '') + ; + } +} diff --git a/rainloop/v/0.0.0/app/localization/.gitignore b/rainloop/v/0.0.0/app/localization/.gitignore new file mode 100644 index 000000000..c4098032d --- /dev/null +++ b/rainloop/v/0.0.0/app/localization/.gitignore @@ -0,0 +1 @@ +/moment/** \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ar-ma.js b/rainloop/v/0.0.0/app/localization/moment/ar-ma.js index 1c159f102..b12a7b167 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ar-ma.js +++ b/rainloop/v/0.0.0/app/localization/moment/ar-ma.js @@ -1,32 +1,33 @@ -// moment.js language configuration -// language : Moroccan Arabic (ar-ma) -// author : ElFadili Yassine : https://github.com/ElFadiliY -// author : Abdel Said : https://github.com/abdelsaid +//! moment.js locale configuration +//! locale : Arabic (Morocco) [ar-ma] +//! author : ElFadili Yassine : https://github.com/ElFadiliY +//! author : Abdel Said : https://github.com/abdelsaid -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ar-ma', { - months : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), - monthsShort : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), - weekdays : "الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysShort : "احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"), - weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var ar_ma = moment.defineLocale('ar-ma', { + months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), + monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), + weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), + weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' }, calendar : { - sameDay: "[اليوم على الساعة] LT", + sameDay: '[اليوم على الساعة] LT', nextDay: '[غدا على الساعة] LT', nextWeek: 'dddd [على الساعة] LT', lastDay: '[أمس على الساعة] LT', @@ -34,23 +35,26 @@ sameElse: 'L' }, relativeTime : { - future : "في %s", - past : "منذ %s", - s : "ثوان", - m : "دقيقة", - mm : "%d دقائق", - h : "ساعة", - hh : "%d ساعات", - d : "يوم", - dd : "%d أيام", - M : "شهر", - MM : "%d أشهر", - y : "سنة", - yy : "%d سنوات" + future : 'في %s', + past : 'منذ %s', + s : 'ثوان', + m : 'دقيقة', + mm : '%d دقائق', + h : 'ساعة', + hh : '%d ساعات', + d : 'يوم', + dd : '%d أيام', + M : 'شهر', + MM : '%d أشهر', + y : 'سنة', + yy : '%d سنوات' }, week : { dow : 6, // Saturday is the first day of the week. doy : 12 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return ar_ma; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ar.js b/rainloop/v/0.0.0/app/localization/moment/ar.js index dd01a42cf..6e727729f 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ar.js +++ b/rainloop/v/0.0.0/app/localization/moment/ar.js @@ -1,17 +1,17 @@ -// moment.js language configuration -// language : Arabic (ar) -// author : Abdel Said : https://github.com/abdelsaid -// changes in months, weekdays : Ahmed Elkhatib +//! moment.js locale configuration +//! locale : Arabic [ar] +//! author : Abdel Said: https://github.com/abdelsaid +//! changes in months, weekdays: Ahmed Elkhatib +//! Native plural forms: forabi https://github.com/forabi + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var symbolMap = { '1': '١', '2': '٢', @@ -34,53 +34,90 @@ '٨': '8', '٩': '9', '٠': '0' - }; + }, pluralForm = function (n) { + return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5; + }, plurals = { + s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'], + m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'], + h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'], + d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'], + M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'], + y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام'] + }, pluralize = function (u) { + return function (number, withoutSuffix, string, isFuture) { + var f = pluralForm(number), + str = plurals[u][pluralForm(number)]; + if (f === 2) { + str = str[withoutSuffix ? 0 : 1]; + } + return str.replace(/%d/i, number); + }; + }, months = [ + 'كانون الثاني يناير', + 'شباط فبراير', + 'آذار مارس', + 'نيسان أبريل', + 'أيار مايو', + 'حزيران يونيو', + 'تموز يوليو', + 'آب أغسطس', + 'أيلول سبتمبر', + 'تشرين الأول أكتوبر', + 'تشرين الثاني نوفمبر', + 'كانون الأول ديسمبر' + ]; - return moment.lang('ar', { - months : "يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"), - monthsShort : "يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"), - weekdays : "الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysShort : "أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"), - weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"), + var ar = moment.defineLocale('ar', { + months : months, + monthsShort : months, + weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), + weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'D/\u200FM/\u200FYYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' + }, + meridiemParse: /ص|م/, + isPM : function (input) { + return 'م' === input; }, meridiem : function (hour, minute, isLower) { if (hour < 12) { - return "ص"; + return 'ص'; } else { - return "م"; + return 'م'; } }, calendar : { - sameDay: "[اليوم على الساعة] LT", - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', + sameDay: '[اليوم عند الساعة] LT', + nextDay: '[غدًا عند الساعة] LT', + nextWeek: 'dddd [عند الساعة] LT', + lastDay: '[أمس عند الساعة] LT', + lastWeek: 'dddd [عند الساعة] LT', sameElse: 'L' }, relativeTime : { - future : "في %s", - past : "منذ %s", - s : "ثوان", - m : "دقيقة", - mm : "%d دقائق", - h : "ساعة", - hh : "%d ساعات", - d : "يوم", - dd : "%d أيام", - M : "شهر", - MM : "%d أشهر", - y : "سنة", - yy : "%d سنوات" + future : 'بعد %s', + past : 'منذ %s', + s : pluralize('s'), + m : pluralize('m'), + mm : pluralize('m'), + h : pluralize('h'), + hh : pluralize('h'), + d : pluralize('d'), + dd : pluralize('d'), + M : pluralize('M'), + MM : pluralize('M'), + y : pluralize('y'), + yy : pluralize('y') }, preparse: function (string) { - return string.replace(/[۰-۹]/g, function (match) { + return string.replace(/\u200f/g, '').replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { return numberMap[match]; }).replace(/،/g, ','); }, @@ -94,4 +131,7 @@ doy : 12 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return ar; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/bg.js b/rainloop/v/0.0.0/app/localization/moment/bg.js index f47ed65a9..deedab8cd 100644 --- a/rainloop/v/0.0.0/app/localization/moment/bg.js +++ b/rainloop/v/0.0.0/app/localization/moment/bg.js @@ -1,28 +1,28 @@ -// moment.js language configuration -// language : bulgarian (bg) -// author : Krasen Borisov : https://github.com/kraz +//! moment.js locale configuration +//! locale : Bulgarian [bg] +//! author : Krasen Borisov : https://github.com/kraz -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('bg', { - months : "януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"), - monthsShort : "янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"), - weekdays : "неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"), - weekdaysShort : "нед_пон_вто_сря_чет_пет_съб".split("_"), - weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var bg = moment.defineLocale('bg', { + months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'), + monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'), + weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'), + weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'), + weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), longDateFormat : { - LT : "H:mm", - L : "D.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'D.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY H:mm', + LLLL : 'dddd, D MMMM YYYY H:mm' }, calendar : { sameDay : '[Днес в] LT', @@ -31,34 +31,35 @@ lastDay : '[Вчера в] LT', lastWeek : function () { switch (this.day()) { - case 0: - case 3: - case 6: - return '[В изминалата] dddd [в] LT'; - case 1: - case 2: - case 4: - case 5: - return '[В изминалия] dddd [в] LT'; + case 0: + case 3: + case 6: + return '[В изминалата] dddd [в] LT'; + case 1: + case 2: + case 4: + case 5: + return '[В изминалия] dddd [в] LT'; } }, sameElse : 'L' }, relativeTime : { - future : "след %s", - past : "преди %s", - s : "няколко секунди", - m : "минута", - mm : "%d минути", - h : "час", - hh : "%d часа", - d : "ден", - dd : "%d дни", - M : "месец", - MM : "%d месеца", - y : "година", - yy : "%d години" + future : 'след %s', + past : 'преди %s', + s : 'няколко секунди', + m : 'минута', + mm : '%d минути', + h : 'час', + hh : '%d часа', + d : 'ден', + dd : '%d дни', + M : 'месец', + MM : '%d месеца', + y : 'година', + yy : '%d години' }, + ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, ordinal : function (number) { var lastDigit = number % 10, last2Digits = number % 100; @@ -83,4 +84,7 @@ doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return bg; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/br.js b/rainloop/v/0.0.0/app/localization/moment/br.js index 39c60df07..ca290f3c8 100644 --- a/rainloop/v/0.0.0/app/localization/moment/br.js +++ b/rainloop/v/0.0.0/app/localization/moment/br.js @@ -1,52 +1,47 @@ -// moment.js language configuration -// language : breton (br) -// author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou +//! moment.js locale configuration +//! locale : Breton [br] +//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function relativeTimeWithMutation(number, withoutSuffix, key) { var format = { - 'mm': "munutenn", - 'MM': "miz", - 'dd': "devezh" + 'mm': 'munutenn', + 'MM': 'miz', + 'dd': 'devezh' }; return number + ' ' + mutation(format[key], number); } - function specialMutationForYears(number) { switch (lastNumber(number)) { - case 1: - case 3: - case 4: - case 5: - case 9: - return number + ' bloaz'; - default: - return number + ' vloaz'; + case 1: + case 3: + case 4: + case 5: + case 9: + return number + ' bloaz'; + default: + return number + ' vloaz'; } } - function lastNumber(number) { if (number > 9) { return lastNumber(number % 10); } return number; } - function mutation(text, number) { if (number === 2) { return softMutation(text); } return text; } - function softMutation(text) { var mutationTable = { 'm': 'v', @@ -59,18 +54,20 @@ return mutationTable[text.charAt(0)] + text.substring(1); } - return moment.lang('br', { - months : "Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"), - monthsShort : "Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"), - weekdays : "Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"), - weekdaysShort : "Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"), - weekdaysMin : "Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"), + var br = moment.defineLocale('br', { + months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'), + monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'), + weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'), + weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'), + weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "h[e]mm A", - L : "DD/MM/YYYY", - LL : "D [a viz] MMMM YYYY", - LLL : "D [a viz] MMMM YYYY LT", - LLLL : "dddd, D [a viz] MMMM YYYY LT" + LT : 'h[e]mm A', + LTS : 'h[e]mm:ss A', + L : 'DD/MM/YYYY', + LL : 'D [a viz] MMMM YYYY', + LLL : 'D [a viz] MMMM YYYY h[e]mm A', + LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A' }, calendar : { sameDay : '[Hiziv da] LT', @@ -81,20 +78,21 @@ sameElse : 'L' }, relativeTime : { - future : "a-benn %s", - past : "%s 'zo", - s : "un nebeud segondennoù", - m : "ur vunutenn", + future : 'a-benn %s', + past : '%s \'zo', + s : 'un nebeud segondennoù', + m : 'ur vunutenn', mm : relativeTimeWithMutation, - h : "un eur", - hh : "%d eur", - d : "un devezh", + h : 'un eur', + hh : '%d eur', + d : 'un devezh', dd : relativeTimeWithMutation, - M : "ur miz", + M : 'ur miz', MM : relativeTimeWithMutation, - y : "ur bloaz", + y : 'ur bloaz', yy : specialMutationForYears }, + ordinalParse: /\d{1,2}(añ|vet)/, ordinal : function (number) { var output = (number === 1) ? 'añ' : 'vet'; return number + output; @@ -104,4 +102,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return br; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/bs.js b/rainloop/v/0.0.0/app/localization/moment/bs.js index 83a9b4c07..5bf3e60e0 100644 --- a/rainloop/v/0.0.0/app/localization/moment/bs.js +++ b/rainloop/v/0.0.0/app/localization/moment/bs.js @@ -1,139 +1,143 @@ -// moment.js language configuration -// language : bosnian (bs) -// author : Nedim Cholich : https://github.com/frontyard -// based on (hr) translation by Bojan Marković +//! moment.js locale configuration +//! locale : Bosnian [bs] +//! author : Nedim Cholich : https://github.com/frontyard +//! based on (hr) translation by Bojan Marković + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function translate(number, withoutSuffix, key) { - var result = number + " "; + var result = number + ' '; switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; + case 'm': + return withoutSuffix ? 'jedna minuta' : 'jedne minute'; + case 'mm': + if (number === 1) { + result += 'minuta'; + } else if (number === 2 || number === 3 || number === 4) { + result += 'minute'; + } else { + result += 'minuta'; + } + return result; + case 'h': + return withoutSuffix ? 'jedan sat' : 'jednog sata'; + case 'hh': + if (number === 1) { + result += 'sat'; + } else if (number === 2 || number === 3 || number === 4) { + result += 'sata'; + } else { + result += 'sati'; + } + return result; + case 'dd': + if (number === 1) { + result += 'dan'; + } else { + result += 'dana'; + } + return result; + case 'MM': + if (number === 1) { + result += 'mjesec'; + } else if (number === 2 || number === 3 || number === 4) { + result += 'mjeseca'; + } else { + result += 'mjeseci'; + } + return result; + case 'yy': + if (number === 1) { + result += 'godina'; + } else if (number === 2 || number === 3 || number === 4) { + result += 'godine'; + } else { + result += 'godina'; + } + return result; } } - return moment.lang('bs', { - months : "januar_februar_mart_april_maj_juni_juli_avgust_septembar_oktobar_novembar_decembar".split("_"), - monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"), - weekdays : "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), - weekdaysShort : "ned._pon._uto._sri._čet._pet._sub.".split("_"), - weekdaysMin : "ne_po_ut_sr_če_pe_su".split("_"), + var bs = moment.defineLocale('bs', { + months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'), + monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'), + monthsParseExact: true, + weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), + weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), + weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'DD. MM. YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY H:mm', + LLLL : 'dddd, D. MMMM YYYY H:mm' }, calendar : { sameDay : '[danas u] LT', nextDay : '[sutra u] LT', - nextWeek : function () { switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; + case 0: + return '[u] [nedjelju] [u] LT'; + case 3: + return '[u] [srijedu] [u] LT'; + case 6: + return '[u] [subotu] [u] LT'; + case 1: + case 2: + case 4: + case 5: + return '[u] dddd [u] LT'; } }, lastDay : '[jučer u] LT', lastWeek : function () { switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; + case 0: + case 3: + return '[prošlu] dddd [u] LT'; + case 6: + return '[prošle] [subote] [u] LT'; + case 1: + case 2: + case 4: + case 5: + return '[prošli] dddd [u] LT'; } }, sameElse : 'L' }, relativeTime : { - future : "za %s", - past : "prije %s", - s : "par sekundi", + future : 'za %s', + past : 'prije %s', + s : 'par sekundi', m : translate, mm : translate, h : translate, hh : translate, - d : "dan", + d : 'dan', dd : translate, - M : "mjesec", + M : 'mjesec', MM : translate, - y : "godinu", + y : 'godinu', yy : translate }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return bs; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ca.js b/rainloop/v/0.0.0/app/localization/moment/ca.js index cf471130d..7882800a2 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ca.js +++ b/rainloop/v/0.0.0/app/localization/moment/ca.js @@ -1,28 +1,30 @@ -// moment.js language configuration -// language : catalan (ca) -// author : Juan G. Hurtado : https://github.com/juanghurtado +//! moment.js locale configuration +//! locale : Catalan [ca] +//! author : Juan G. Hurtado : https://github.com/juanghurtado -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ca', { - months : "gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"), - monthsShort : "gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"), - weekdays : "diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"), - weekdaysShort : "dg._dl._dt._dc._dj._dv._ds.".split("_"), - weekdaysMin : "Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var ca = moment.defineLocale('ca', { + months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'), + monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'), + monthsParseExact : true, + weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'), + weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'), + weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY H:mm', + LLLL : 'dddd D MMMM YYYY H:mm' }, calendar : { sameDay : function () { @@ -43,24 +45,37 @@ sameElse : 'L' }, relativeTime : { - future : "en %s", - past : "fa %s", - s : "uns segons", - m : "un minut", - mm : "%d minuts", - h : "una hora", - hh : "%d hores", - d : "un dia", - dd : "%d dies", - M : "un mes", - MM : "%d mesos", - y : "un any", - yy : "%d anys" + future : 'en %s', + past : 'fa %s', + s : 'uns segons', + m : 'un minut', + mm : '%d minuts', + h : 'una hora', + hh : '%d hores', + d : 'un dia', + dd : '%d dies', + M : 'un mes', + MM : '%d mesos', + y : 'un any', + yy : '%d anys' + }, + ordinalParse: /\d{1,2}(r|n|t|è|a)/, + ordinal : function (number, period) { + var output = (number === 1) ? 'r' : + (number === 2) ? 'n' : + (number === 3) ? 'r' : + (number === 4) ? 't' : 'è'; + if (period === 'w' || period === 'W') { + output = 'a'; + } + return number + output; }, - ordinal : '%dº', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return ca; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/cs.js b/rainloop/v/0.0.0/app/localization/moment/cs.js index cb79c9b3c..129e936b1 100644 --- a/rainloop/v/0.0.0/app/localization/moment/cs.js +++ b/rainloop/v/0.0.0/app/localization/moment/cs.js @@ -1,77 +1,74 @@ -// moment.js language configuration -// language : czech (cs) -// author : petrbela : https://github.com/petrbela +//! moment.js locale configuration +//! locale : Czech [cs] +//! author : petrbela : https://github.com/petrbela -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var months = "leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"), - monthsShort = "led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'), + monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'); function plural(n) { return (n > 1) && (n < 5) && (~~(n / 10) !== 1); } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; + var result = number + ' '; switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minuty' : 'minut'); - } else { - return result + 'minutami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodin'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'den' : 'dnem'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dny' : 'dní'); - } else { - return result + 'dny'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'měsíce' : 'měsíců'); - } else { - return result + 'měsíci'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokem'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'let'); - } else { - return result + 'lety'; - } - break; + case 's': // a few seconds / in a few seconds / a few seconds ago + return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami'; + case 'm': // a minute / in a minute / a minute ago + return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou'); + case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'minuty' : 'minut'); + } else { + return result + 'minutami'; + } + break; + case 'h': // an hour / in an hour / an hour ago + return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); + case 'hh': // 9 hours / in 9 hours / 9 hours ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'hodiny' : 'hodin'); + } else { + return result + 'hodinami'; + } + break; + case 'd': // a day / in a day / a day ago + return (withoutSuffix || isFuture) ? 'den' : 'dnem'; + case 'dd': // 9 days / in 9 days / 9 days ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'dny' : 'dní'); + } else { + return result + 'dny'; + } + break; + case 'M': // a month / in a month / a month ago + return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem'; + case 'MM': // 9 months / in 9 months / 9 months ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'měsíce' : 'měsíců'); + } else { + return result + 'měsíci'; + } + break; + case 'y': // a year / in a year / a year ago + return (withoutSuffix || isFuture) ? 'rok' : 'rokem'; + case 'yy': // 9 years / in 9 years / 9 years ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'roky' : 'let'); + } else { + return result + 'lety'; + } + break; } } - return moment.lang('cs', { + var cs = moment.defineLocale('cs', { months : months, monthsShort : monthsShort, monthsParse : (function (months, monthsShort) { @@ -82,58 +79,74 @@ } return _monthsParse; }(months, monthsShort)), - weekdays : "neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"), - weekdaysShort : "ne_po_út_st_čt_pá_so".split("_"), - weekdaysMin : "ne_po_út_st_čt_pá_so".split("_"), + shortMonthsParse : (function (monthsShort) { + var i, _shortMonthsParse = []; + for (i = 0; i < 12; i++) { + _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i'); + } + return _shortMonthsParse; + }(monthsShort)), + longMonthsParse : (function (months) { + var i, _longMonthsParse = []; + for (i = 0; i < 12; i++) { + _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i'); + } + return _longMonthsParse; + }(months)), + weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'), + weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'), + weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'), longDateFormat : { - LT: "H.mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd D. MMMM YYYY LT" + LT: 'H:mm', + LTS : 'H:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY H:mm', + LLLL : 'dddd D. MMMM YYYY H:mm', + l : 'D. M. YYYY' }, calendar : { - sameDay: "[dnes v] LT", + sameDay: '[dnes v] LT', nextDay: '[zítra v] LT', nextWeek: function () { switch (this.day()) { - case 0: - return '[v neděli v] LT'; - case 1: - case 2: - return '[v] dddd [v] LT'; - case 3: - return '[ve středu v] LT'; - case 4: - return '[ve čtvrtek v] LT'; - case 5: - return '[v pátek v] LT'; - case 6: - return '[v sobotu v] LT'; + case 0: + return '[v neděli v] LT'; + case 1: + case 2: + return '[v] dddd [v] LT'; + case 3: + return '[ve středu v] LT'; + case 4: + return '[ve čtvrtek v] LT'; + case 5: + return '[v pátek v] LT'; + case 6: + return '[v sobotu v] LT'; } }, lastDay: '[včera v] LT', lastWeek: function () { switch (this.day()) { - case 0: - return '[minulou neděli v] LT'; - case 1: - case 2: - return '[minulé] dddd [v] LT'; - case 3: - return '[minulou středu v] LT'; - case 4: - case 5: - return '[minulý] dddd [v] LT'; - case 6: - return '[minulou sobotu v] LT'; + case 0: + return '[minulou neděli v] LT'; + case 1: + case 2: + return '[minulé] dddd [v] LT'; + case 3: + return '[minulou středu v] LT'; + case 4: + case 5: + return '[minulý] dddd [v] LT'; + case 6: + return '[minulou sobotu v] LT'; } }, - sameElse: "L" + sameElse: 'L' }, relativeTime : { - future : "za %s", - past : "před %s", + future : 'za %s', + past : 'před %s', s : translate, m : translate, mm : translate, @@ -146,10 +159,14 @@ y : translate, yy : translate }, + ordinalParse : /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return cs; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/cv.js b/rainloop/v/0.0.0/app/localization/moment/cv.js index a5812deba..60bf21389 100644 --- a/rainloop/v/0.0.0/app/localization/moment/cv.js +++ b/rainloop/v/0.0.0/app/localization/moment/cv.js @@ -1,59 +1,63 @@ -// moment.js language configuration -// language : chuvash (cv) -// author : Anatoly Mironov : https://github.com/mirontoli +//! moment.js locale configuration +//! locale : Chuvash [cv] +//! author : Anatoly Mironov : https://github.com/mirontoli -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('cv', { - months : "кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"), - monthsShort : "кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"), - weekdays : "вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"), - weekdaysShort : "выр_тун_ытл_юн_кĕç_эрн_шăм".split("_"), - weekdaysMin : "вр_тн_ыт_юн_кç_эр_шм".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var cv = moment.defineLocale('cv', { + months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'), + monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'), + weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'), + weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'), + weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD-MM-YYYY", - LL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]", - LLL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT", - LLLL : "dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD-MM-YYYY', + LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]', + LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', + LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm' }, calendar : { sameDay: '[Паян] LT [сехетре]', nextDay: '[Ыран] LT [сехетре]', - lastDay: '[Ĕнер] LT [сехетре]', - nextWeek: '[Çитес] dddd LT [сехетре]', - lastWeek: '[Иртнĕ] dddd LT [сехетре]', + lastDay: '[Ӗнер] LT [сехетре]', + nextWeek: '[Ҫитес] dddd LT [сехетре]', + lastWeek: '[Иртнӗ] dddd LT [сехетре]', sameElse: 'L' }, relativeTime : { future : function (output) { - var affix = /сехет$/i.exec(output) ? "рен" : /çул$/i.exec(output) ? "тан" : "ран"; + var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран'; return output + affix; }, - past : "%s каялла", - s : "пĕр-ик çеккунт", - m : "пĕр минут", - mm : "%d минут", - h : "пĕр сехет", - hh : "%d сехет", - d : "пĕр кун", - dd : "%d кун", - M : "пĕр уйăх", - MM : "%d уйăх", - y : "пĕр çул", - yy : "%d çул" + past : '%s каялла', + s : 'пӗр-ик ҫеккунт', + m : 'пӗр минут', + mm : '%d минут', + h : 'пӗр сехет', + hh : '%d сехет', + d : 'пӗр кун', + dd : '%d кун', + M : 'пӗр уйӑх', + MM : '%d уйӑх', + y : 'пӗр ҫул', + yy : '%d ҫул' }, - ordinal : '%d-мĕш', + ordinalParse: /\d{1,2}-мӗш/, + ordinal : '%d-мӗш', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return cv; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/cy.js b/rainloop/v/0.0.0/app/localization/moment/cy.js index b47d7c275..9a43529cb 100644 --- a/rainloop/v/0.0.0/app/localization/moment/cy.js +++ b/rainloop/v/0.0.0/app/localization/moment/cy.js @@ -1,29 +1,30 @@ -// moment.js language configuration -// language : Welsh (cy) -// author : Robert Allen +//! moment.js locale configuration +//! locale : Welsh [cy] +//! author : Robert Allen -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang("cy", { - months: "Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"), - monthsShort: "Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"), - weekdays: "Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"), - weekdaysShort: "Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"), - weekdaysMin: "Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var cy = moment.defineLocale('cy', { + months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'), + monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'), + weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'), + weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'), + weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'), + weekdaysParseExact : true, // time formats are the same as en-gb longDateFormat: { - LT: "HH:mm", - L: "DD/MM/YYYY", - LL: "D MMMM YYYY", - LLL: "D MMMM YYYY LT", - LLLL: "dddd, D MMMM YYYY LT" + LT: 'HH:mm', + LTS : 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' }, calendar: { sameDay: '[Heddiw am] LT', @@ -34,20 +35,21 @@ sameElse: 'L' }, relativeTime: { - future: "mewn %s", - past: "%s yn àl", - s: "ychydig eiliadau", - m: "munud", - mm: "%d munud", - h: "awr", - hh: "%d awr", - d: "diwrnod", - dd: "%d diwrnod", - M: "mis", - MM: "%d mis", - y: "blwyddyn", - yy: "%d flynedd" + future: 'mewn %s', + past: '%s yn ôl', + s: 'ychydig eiliadau', + m: 'munud', + mm: '%d munud', + h: 'awr', + hh: '%d awr', + d: 'diwrnod', + dd: '%d diwrnod', + M: 'mis', + MM: '%d mis', + y: 'blwyddyn', + yy: '%d flynedd' }, + ordinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/, // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh ordinal: function (number) { var b = number, @@ -56,7 +58,6 @@ '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed ]; - if (b > 20) { if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) { output = 'fed'; // not 30ain, 70ain or 90ain @@ -66,7 +67,6 @@ } else if (b > 0) { output = lookup[b]; } - return number + output; }, week : { @@ -74,4 +74,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return cy; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/da.js b/rainloop/v/0.0.0/app/localization/moment/da.js index 2fa8244c0..d5cbbdb34 100644 --- a/rainloop/v/0.0.0/app/localization/moment/da.js +++ b/rainloop/v/0.0.0/app/localization/moment/da.js @@ -1,28 +1,28 @@ -// moment.js language configuration -// language : danish (da) -// author : Ulrik Nielsen : https://github.com/mrbase +//! moment.js locale configuration +//! locale : Danish [da] +//! author : Ulrik Nielsen : https://github.com/mrbase -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('da', { - months : "januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), - weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), - weekdaysShort : "søn_man_tir_ons_tor_fre_lør".split("_"), - weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var da = moment.defineLocale('da', { + months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'), + monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), + weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), + weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'), + weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D. MMMM, YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY HH:mm', + LLLL : 'dddd [d.] D. MMMM YYYY HH:mm' }, calendar : { sameDay : '[I dag kl.] LT', @@ -33,24 +33,28 @@ sameElse : 'L' }, relativeTime : { - future : "om %s", - past : "%s siden", - s : "få sekunder", - m : "et minut", - mm : "%d minutter", - h : "en time", - hh : "%d timer", - d : "en dag", - dd : "%d dage", - M : "en måned", - MM : "%d måneder", - y : "et år", - yy : "%d år" + future : 'om %s', + past : '%s siden', + s : 'få sekunder', + m : 'et minut', + mm : '%d minutter', + h : 'en time', + hh : '%d timer', + d : 'en dag', + dd : '%d dage', + M : 'en måned', + MM : '%d måneder', + y : 'et år', + yy : '%d år' }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return da; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/de.js b/rainloop/v/0.0.0/app/localization/moment/de.js index 86cd26877..203dac910 100644 --- a/rainloop/v/0.0.0/app/localization/moment/de.js +++ b/rainloop/v/0.0.0/app/localization/moment/de.js @@ -1,17 +1,17 @@ -// moment.js language configuration -// language : german (de) -// author : lluchs : https://github.com/lluchs -// author: Menelion Elensúle: https://github.com/Oire +//! moment.js locale configuration +//! locale : German [de] +//! author : lluchs : https://github.com/lluchs +//! author: Menelion Elensúle: https://github.com/Oire +//! author : Mikolaj Dadela : https://github.com/mik01aj + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { 'm': ['eine Minute', 'einer Minute'], @@ -26,35 +26,38 @@ return withoutSuffix ? format[key][0] : format[key][1]; } - return moment.lang('de', { - months : "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), - monthsShort : "Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), - weekdays : "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), - weekdaysShort : "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), - weekdaysMin : "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), + var de = moment.defineLocale('de', { + months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), + monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), + monthsParseExact : true, + weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), + weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), + weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT: "HH:mm [Uhr]", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY HH:mm', + LLLL : 'dddd, D. MMMM YYYY HH:mm' }, calendar : { - sameDay: "[Heute um] LT", - sameElse: "L", - nextDay: '[Morgen um] LT', - nextWeek: 'dddd [um] LT', - lastDay: '[Gestern um] LT', - lastWeek: '[letzten] dddd [um] LT' + sameDay: '[heute um] LT [Uhr]', + sameElse: 'L', + nextDay: '[morgen um] LT [Uhr]', + nextWeek: 'dddd [um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', + lastWeek: '[letzten] dddd [um] LT [Uhr]' }, relativeTime : { - future : "in %s", - past : "vor %s", - s : "ein paar Sekunden", + future : 'in %s', + past : 'vor %s', + s : 'ein paar Sekunden', m : processRelativeTime, - mm : "%d Minuten", + mm : '%d Minuten', h : processRelativeTime, - hh : "%d Stunden", + hh : '%d Stunden', d : processRelativeTime, dd : processRelativeTime, M : processRelativeTime, @@ -62,10 +65,14 @@ y : processRelativeTime, yy : processRelativeTime }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return de; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/el.js b/rainloop/v/0.0.0/app/localization/moment/el.js index e2a38cdb5..588cb235c 100644 --- a/rainloop/v/0.0.0/app/localization/moment/el.js +++ b/rainloop/v/0.0.0/app/localization/moment/el.js @@ -1,30 +1,33 @@ -// moment.js language configuration -// language : modern greek (el) -// author : Aggelos Karalias : https://github.com/mehiel +//! moment.js locale configuration +//! locale : Greek [el] +//! author : Aggelos Karalias : https://github.com/mehiel -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; } -}(function (moment) { - return moment.lang('el', { - monthsNominativeEl : "Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"), - monthsGenitiveEl : "Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"), + + + var el = moment.defineLocale('el', { + monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'), + monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'), months : function (momentToFormat, format) { - if (/D/.test(format.substring(0, format.indexOf("MMMM")))) { // if there is a day number before 'MMMM' + if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM' return this._monthsGenitiveEl[momentToFormat.month()]; } else { return this._monthsNominativeEl[momentToFormat.month()]; } }, - monthsShort : "Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"), - weekdays : "Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"), - weekdaysShort : "Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"), - weekdaysMin : "Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"), + monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'), + weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'), + weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'), + weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'), meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'μμ' : 'ΜΜ'; @@ -32,19 +35,24 @@ return isLower ? 'πμ' : 'ΠΜ'; } }, + isPM : function (input) { + return ((input + '').toLowerCase()[0] === 'μ'); + }, + meridiemParse : /[ΠΜ]\.?Μ?\.?/i, longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'h:mm A', + LTS : 'h:mm:ss A', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY h:mm A', + LLLL : 'dddd, D MMMM YYYY h:mm A' }, calendarEl : { sameDay : '[Σήμερα {}] LT', nextDay : '[Αύριο {}] LT', nextWeek : 'dddd [{}] LT', lastDay : '[Χθες {}] LT', - lastWeek : function() { + lastWeek : function () { switch (this.day()) { case 6: return '[το προηγούμενο] dddd [{}] LT'; @@ -57,34 +65,34 @@ calendar : function (key, mom) { var output = this._calendarEl[key], hours = mom && mom.hours(); - - if (typeof output === 'function') { + if (isFunction(output)) { output = output.apply(mom); } - - return output.replace("{}", (hours % 12 === 1 ? "στη" : "στις")); + return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις')); }, relativeTime : { - future : "σε %s", - past : "%s πριν", - s : "δευτερόλεπτα", - m : "ένα λεπτό", - mm : "%d λεπτά", - h : "μία ώρα", - hh : "%d ώρες", - d : "μία μέρα", - dd : "%d μέρες", - M : "ένας μήνας", - MM : "%d μήνες", - y : "ένας χρόνος", - yy : "%d χρόνια" - }, - ordinal : function (number) { - return number + 'η'; + future : 'σε %s', + past : '%s πριν', + s : 'λίγα δευτερόλεπτα', + m : 'ένα λεπτό', + mm : '%d λεπτά', + h : 'μία ώρα', + hh : '%d ώρες', + d : 'μία μέρα', + dd : '%d μέρες', + M : 'ένας μήνας', + MM : '%d μήνες', + y : 'ένας χρόνος', + yy : '%d χρόνια' }, + ordinalParse: /\d{1,2}η/, + ordinal: '%dη', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4st is the first week of the year. } }); -})); + + return el; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/en-au.js b/rainloop/v/0.0.0/app/localization/moment/en-au.js index 4d91e2569..92a2a636a 100644 --- a/rainloop/v/0.0.0/app/localization/moment/en-au.js +++ b/rainloop/v/0.0.0/app/localization/moment/en-au.js @@ -1,27 +1,27 @@ -// moment.js language configuration -// language : australian english (en-au) +//! moment.js locale configuration +//! locale : English (Australia) [en-au] -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('en-au', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var en_au = moment.defineLocale('en-au', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'h:mm A', + LTS : 'h:mm:ss A', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY h:mm A', + LLLL : 'dddd, D MMMM YYYY h:mm A' }, calendar : { sameDay : '[Today at] LT', @@ -32,23 +32,24 @@ sameElse : 'L' }, relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal : function (number) { var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : + output = (~~(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; @@ -59,4 +60,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return en_au; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/en-ca.js b/rainloop/v/0.0.0/app/localization/moment/en-ca.js index a97e9f396..9ac521f9e 100644 --- a/rainloop/v/0.0.0/app/localization/moment/en-ca.js +++ b/rainloop/v/0.0.0/app/localization/moment/en-ca.js @@ -1,28 +1,28 @@ -// moment.js language configuration -// language : canadian english (en-ca) -// author : Jonathan Abourbih : https://github.com/jonbca +//! moment.js locale configuration +//! locale : English (Canada) [en-ca] +//! author : Jonathan Abourbih : https://github.com/jonbca -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('en-ca', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var en_ca = moment.defineLocale('en-ca', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat : { - LT : "h:mm A", - L : "YYYY-MM-DD", - LL : "D MMMM, YYYY", - LLL : "D MMMM, YYYY LT", - LLLL : "dddd, D MMMM, YYYY LT" + LT : 'h:mm A', + LTS : 'h:mm:ss A', + L : 'YYYY-MM-DD', + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY h:mm A', + LLLL : 'dddd, MMMM D, YYYY h:mm A' }, calendar : { sameDay : '[Today at] LT', @@ -33,27 +33,31 @@ sameElse : 'L' }, relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal : function (number) { var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : + output = (~~(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; return number + output; } }); -})); + + return en_ca; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/en-gb.js b/rainloop/v/0.0.0/app/localization/moment/en-gb.js index 3a7907be5..843d2e585 100644 --- a/rainloop/v/0.0.0/app/localization/moment/en-gb.js +++ b/rainloop/v/0.0.0/app/localization/moment/en-gb.js @@ -1,28 +1,28 @@ -// moment.js language configuration -// language : great britain english (en-gb) -// author : Chris Gedrim : https://github.com/chrisgedrim +//! moment.js locale configuration +//! locale : English (United Kingdom) [en-gb] +//! author : Chris Gedrim : https://github.com/chrisgedrim -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('en-gb', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var en_gb = moment.defineLocale('en-gb', { + months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' }, calendar : { sameDay : '[Today at] LT', @@ -33,23 +33,24 @@ sameElse : 'L' }, relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' }, + ordinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal : function (number) { var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : + output = (~~(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; @@ -60,4 +61,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return en_gb; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/eo.js b/rainloop/v/0.0.0/app/localization/moment/eo.js index 03b1abff1..5b21f8242 100644 --- a/rainloop/v/0.0.0/app/localization/moment/eo.js +++ b/rainloop/v/0.0.0/app/localization/moment/eo.js @@ -1,30 +1,34 @@ -// moment.js language configuration -// language : esperanto (eo) -// author : Colin Dean : https://github.com/colindean -// komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko. -// Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! +//! moment.js locale configuration +//! locale : Esperanto [eo] +//! author : Colin Dean : https://github.com/colindean +//! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko. +//! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('eo', { - months : "januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"), - weekdays : "Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"), - weekdaysShort : "Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var eo = moment.defineLocale('eo', { + months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'), + monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'), + weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'), + weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'), + weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D[-an de] MMMM, YYYY", - LLL : "D[-an de] MMMM, YYYY LT", - LLLL : "dddd, [la] D[-an de] MMMM, YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'YYYY-MM-DD', + LL : 'D[-an de] MMMM, YYYY', + LLL : 'D[-an de] MMMM, YYYY HH:mm', + LLLL : 'dddd, [la] D[-an de] MMMM, YYYY HH:mm' + }, + meridiemParse: /[ap]\.t\.m/i, + isPM: function (input) { + return input.charAt(0).toLowerCase() === 'p'; }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { @@ -42,24 +46,28 @@ sameElse : 'L' }, relativeTime : { - future : "je %s", - past : "antaŭ %s", - s : "sekundoj", - m : "minuto", - mm : "%d minutoj", - h : "horo", - hh : "%d horoj", - d : "tago",//ne 'diurno', ĉar estas uzita por proksimumo - dd : "%d tagoj", - M : "monato", - MM : "%d monatoj", - y : "jaro", - yy : "%d jaroj" + future : 'je %s', + past : 'antaŭ %s', + s : 'sekundoj', + m : 'minuto', + mm : '%d minutoj', + h : 'horo', + hh : '%d horoj', + d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo + dd : '%d tagoj', + M : 'monato', + MM : '%d monatoj', + y : 'jaro', + yy : '%d jaroj' }, - ordinal : "%da", + ordinalParse: /\d{1,2}a/, + ordinal : '%da', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return eo; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/es.js b/rainloop/v/0.0.0/app/localization/moment/es.js index 67432ca3e..cd819056e 100644 --- a/rainloop/v/0.0.0/app/localization/moment/es.js +++ b/rainloop/v/0.0.0/app/localization/moment/es.js @@ -1,21 +1,20 @@ -// moment.js language configuration -// language : spanish (es) -// author : Julio Napurí : https://github.com/julionc +//! moment.js locale configuration +//! locale : Spanish [es] +//! author : Julio Napurí : https://github.com/julionc -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var monthsShortDot = "ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"), - monthsShort = "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; - return moment.lang('es', { - months : "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), + + var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), + monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); + + var es = moment.defineLocale('es', { + months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), monthsShort : function (m, format) { if (/-MMM-/.test(format)) { return monthsShort[m.month()]; @@ -23,15 +22,18 @@ return monthsShortDot[m.month()]; } }, - weekdays : "domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"), - weekdaysShort : "dom._lun._mar._mié._jue._vie._sáb.".split("_"), - weekdaysMin : "Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"), + monthsParseExact : true, + weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [del] YYYY", - LLL : "D [de] MMMM [del] YYYY LT", - LLLL : "dddd, D [de] MMMM [del] YYYY LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D [de] MMMM [de] YYYY', + LLL : 'D [de] MMMM [de] YYYY H:mm', + LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm' }, calendar : { sameDay : function () { @@ -52,24 +54,28 @@ sameElse : 'L' }, relativeTime : { - future : "en %s", - past : "hace %s", - s : "unos segundos", - m : "un minuto", - mm : "%d minutos", - h : "una hora", - hh : "%d horas", - d : "un día", - dd : "%d días", - M : "un mes", - MM : "%d meses", - y : "un año", - yy : "%d años" + future : 'en %s', + past : 'hace %s', + s : 'unos segundos', + m : 'un minuto', + mm : '%d minutos', + h : 'una hora', + hh : '%d horas', + d : 'un día', + dd : '%d días', + M : 'un mes', + MM : '%d meses', + y : 'un año', + yy : '%d años' }, + ordinalParse : /\d{1,2}º/, ordinal : '%dº', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return es; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/et.js b/rainloop/v/0.0.0/app/localization/moment/et.js index fb410ef44..97fd945ad 100644 --- a/rainloop/v/0.0.0/app/localization/moment/et.js +++ b/rainloop/v/0.0.0/app/localization/moment/et.js @@ -1,17 +1,16 @@ -// moment.js language configuration -// language : estonian (et) -// author : Henry Kehlmann : https://github.com/madhenry -// improvements : Illimar Tambek : https://github.com/ragulka +//! moment.js locale configuration +//! locale : Estonian [et] +//! author : Henry Kehlmann : https://github.com/madhenry +//! improvements : Illimar Tambek : https://github.com/ragulka + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'], @@ -31,18 +30,19 @@ return isFuture ? format[key][0] : format[key][1]; } - return moment.lang('et', { - months : "jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"), - monthsShort : "jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"), - weekdays : "pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"), - weekdaysShort : "P_E_T_K_N_R_L".split("_"), - weekdaysMin : "P_E_T_K_N_R_L".split("_"), + var et = moment.defineLocale('et', { + months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'), + monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'), + weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'), + weekdaysShort : 'P_E_T_K_N_R_L'.split('_'), + weekdaysMin : 'P_E_T_K_N_R_L'.split('_'), longDateFormat : { - LT : "H:mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY H:mm', + LLLL : 'dddd, D. MMMM YYYY H:mm' }, calendar : { sameDay : '[Täna,] LT', @@ -53,8 +53,8 @@ sameElse : 'L' }, relativeTime : { - future : "%s pärast", - past : "%s tagasi", + future : '%s pärast', + past : '%s tagasi', s : processRelativeTime, m : processRelativeTime, mm : processRelativeTime, @@ -67,10 +67,14 @@ y : processRelativeTime, yy : processRelativeTime }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return et; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/eu.js b/rainloop/v/0.0.0/app/localization/moment/eu.js index 659b739bf..15d7dd3e6 100644 --- a/rainloop/v/0.0.0/app/localization/moment/eu.js +++ b/rainloop/v/0.0.0/app/localization/moment/eu.js @@ -1,32 +1,34 @@ -// moment.js language configuration -// language : euskara (eu) -// author : Eneko Illarramendi : https://github.com/eillarra +//! moment.js locale configuration +//! locale : Basque [eu] +//! author : Eneko Illarramendi : https://github.com/eillarra -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('eu', { - months : "urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"), - monthsShort : "urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"), - weekdays : "igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"), - weekdaysShort : "ig._al._ar._az._og._ol._lr.".split("_"), - weekdaysMin : "ig_al_ar_az_og_ol_lr".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var eu = moment.defineLocale('eu', { + months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'), + monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'), + monthsParseExact : true, + weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'), + weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'), + weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "YYYY[ko] MMMM[ren] D[a]", - LLL : "YYYY[ko] MMMM[ren] D[a] LT", - LLLL : "dddd, YYYY[ko] MMMM[ren] D[a] LT", - l : "YYYY-M-D", - ll : "YYYY[ko] MMM D[a]", - lll : "YYYY[ko] MMM D[a] LT", - llll : "ddd, YYYY[ko] MMM D[a] LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'YYYY-MM-DD', + LL : 'YYYY[ko] MMMM[ren] D[a]', + LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm', + LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', + l : 'YYYY-M-D', + ll : 'YYYY[ko] MMM D[a]', + lll : 'YYYY[ko] MMM D[a] HH:mm', + llll : 'ddd, YYYY[ko] MMM D[a] HH:mm' }, calendar : { sameDay : '[gaur] LT[etan]', @@ -37,24 +39,28 @@ sameElse : 'L' }, relativeTime : { - future : "%s barru", - past : "duela %s", - s : "segundo batzuk", - m : "minutu bat", - mm : "%d minutu", - h : "ordu bat", - hh : "%d ordu", - d : "egun bat", - dd : "%d egun", - M : "hilabete bat", - MM : "%d hilabete", - y : "urte bat", - yy : "%d urte" + future : '%s barru', + past : 'duela %s', + s : 'segundo batzuk', + m : 'minutu bat', + mm : '%d minutu', + h : 'ordu bat', + hh : '%d ordu', + d : 'egun bat', + dd : '%d egun', + M : 'hilabete bat', + MM : '%d hilabete', + y : 'urte bat', + yy : '%d urte' }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return eu; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/fa.js b/rainloop/v/0.0.0/app/localization/moment/fa.js index 4a690c407..535174beb 100644 --- a/rainloop/v/0.0.0/app/localization/moment/fa.js +++ b/rainloop/v/0.0.0/app/localization/moment/fa.js @@ -1,16 +1,15 @@ -// moment.js language configuration -// language : Persian Language -// author : Ebrahim Byagowi : https://github.com/ebraminio +//! moment.js locale configuration +//! locale : Persian [fa] +//! author : Ebrahim Byagowi : https://github.com/ebraminio + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var symbolMap = { '1': '۱', '2': '۲', @@ -35,24 +34,30 @@ '۰': '0' }; - return moment.lang('fa', { + var fa = moment.defineLocale('fa', { months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'), + weekdaysParseExact : true, longDateFormat : { LT : 'HH:mm', + LTS : 'HH:mm:ss', L : 'DD/MM/YYYY', LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY LT', - LLLL : 'dddd, D MMMM YYYY LT' + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' + }, + meridiemParse: /قبل از ظهر|بعد از ظهر/, + isPM: function (input) { + return /بعد از ظهر/.test(input); }, meridiem : function (hour, minute, isLower) { if (hour < 12) { - return "قبل از ظهر"; + return 'قبل از ظهر'; } else { - return "بعد از ظهر"; + return 'بعد از ظهر'; } }, calendar : { @@ -88,10 +93,14 @@ return symbolMap[match]; }).replace(/,/g, '،'); }, + ordinalParse: /\d{1,2}م/, ordinal : '%dم', week : { dow : 6, // Saturday is the first day of the week. doy : 12 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return fa; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/fi.js b/rainloop/v/0.0.0/app/localization/moment/fi.js index 49f477c08..ee93848c7 100644 --- a/rainloop/v/0.0.0/app/localization/moment/fi.js +++ b/rainloop/v/0.0.0/app/localization/moment/fi.js @@ -1,75 +1,75 @@ -// moment.js language configuration -// language : finnish (fi) -// author : Tarmo Aidantausta : https://github.com/bleadof +//! moment.js locale configuration +//! locale : Finnish [fi] +//! author : Tarmo Aidantausta : https://github.com/bleadof + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '), - numbersFuture = ['nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden', - numbersPast[7], numbersPast[8], numbersPast[9]]; - + numbersFuture = [ + 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden', + numbersPast[7], numbersPast[8], numbersPast[9] + ]; function translate(number, withoutSuffix, key, isFuture) { - var result = ""; + var result = ''; switch (key) { - case 's': - return isFuture ? 'muutaman sekunnin' : 'muutama sekunti'; - case 'm': - return isFuture ? 'minuutin' : 'minuutti'; - case 'mm': - result = isFuture ? 'minuutin' : 'minuuttia'; - break; - case 'h': - return isFuture ? 'tunnin' : 'tunti'; - case 'hh': - result = isFuture ? 'tunnin' : 'tuntia'; - break; - case 'd': - return isFuture ? 'päivän' : 'päivä'; - case 'dd': - result = isFuture ? 'päivän' : 'päivää'; - break; - case 'M': - return isFuture ? 'kuukauden' : 'kuukausi'; - case 'MM': - result = isFuture ? 'kuukauden' : 'kuukautta'; - break; - case 'y': - return isFuture ? 'vuoden' : 'vuosi'; - case 'yy': - result = isFuture ? 'vuoden' : 'vuotta'; - break; + case 's': + return isFuture ? 'muutaman sekunnin' : 'muutama sekunti'; + case 'm': + return isFuture ? 'minuutin' : 'minuutti'; + case 'mm': + result = isFuture ? 'minuutin' : 'minuuttia'; + break; + case 'h': + return isFuture ? 'tunnin' : 'tunti'; + case 'hh': + result = isFuture ? 'tunnin' : 'tuntia'; + break; + case 'd': + return isFuture ? 'päivän' : 'päivä'; + case 'dd': + result = isFuture ? 'päivän' : 'päivää'; + break; + case 'M': + return isFuture ? 'kuukauden' : 'kuukausi'; + case 'MM': + result = isFuture ? 'kuukauden' : 'kuukautta'; + break; + case 'y': + return isFuture ? 'vuoden' : 'vuosi'; + case 'yy': + result = isFuture ? 'vuoden' : 'vuotta'; + break; } - result = verbalNumber(number, isFuture) + " " + result; + result = verbalNumber(number, isFuture) + ' ' + result; return result; } - function verbalNumber(number, isFuture) { return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number; } - return moment.lang('fi', { - months : "tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"), - monthsShort : "tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"), - weekdays : "sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"), - weekdaysShort : "su_ma_ti_ke_to_pe_la".split("_"), - weekdaysMin : "su_ma_ti_ke_to_pe_la".split("_"), + var fi = moment.defineLocale('fi', { + months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'), + monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'), + weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'), + weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'), + weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'), longDateFormat : { - LT : "HH.mm", - L : "DD.MM.YYYY", - LL : "Do MMMM[ta] YYYY", - LLL : "Do MMMM[ta] YYYY, [klo] LT", - LLLL : "dddd, Do MMMM[ta] YYYY, [klo] LT", - l : "D.M.YYYY", - ll : "Do MMM YYYY", - lll : "Do MMM YYYY, [klo] LT", - llll : "ddd, Do MMM YYYY, [klo] LT" + LT : 'HH.mm', + LTS : 'HH.mm.ss', + L : 'DD.MM.YYYY', + LL : 'Do MMMM[ta] YYYY', + LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm', + LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm', + l : 'D.M.YYYY', + ll : 'Do MMM YYYY', + lll : 'Do MMM YYYY, [klo] HH.mm', + llll : 'ddd, Do MMM YYYY, [klo] HH.mm' }, calendar : { sameDay : '[tänään] [klo] LT', @@ -80,8 +80,8 @@ sameElse : 'L' }, relativeTime : { - future : "%s päästä", - past : "%s sitten", + future : '%s päästä', + past : '%s sitten', s : translate, m : translate, mm : translate, @@ -94,10 +94,14 @@ y : translate, yy : translate }, - ordinal : "%d.", + ordinalParse: /\d{1,2}\./, + ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return fi; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/fo.js b/rainloop/v/0.0.0/app/localization/moment/fo.js index 2f1cbb815..93567e447 100644 --- a/rainloop/v/0.0.0/app/localization/moment/fo.js +++ b/rainloop/v/0.0.0/app/localization/moment/fo.js @@ -1,28 +1,28 @@ -// moment.js language configuration -// language : faroese (fo) -// author : Ragnar Johannesen : https://github.com/ragnar123 +//! moment.js locale configuration +//! locale : Faroese [fo] +//! author : Ragnar Johannesen : https://github.com/ragnar123 -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('fo', { - months : "januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), - weekdays : "sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"), - weekdaysShort : "sun_mán_týs_mik_hós_frí_ley".split("_"), - weekdaysMin : "su_má_tý_mi_hó_fr_le".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var fo = moment.defineLocale('fo', { + months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'), + monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), + weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'), + weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'), + weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D. MMMM, YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D. MMMM, YYYY HH:mm' }, calendar : { sameDay : '[Í dag kl.] LT', @@ -33,24 +33,28 @@ sameElse : 'L' }, relativeTime : { - future : "um %s", - past : "%s síðani", - s : "fá sekund", - m : "ein minutt", - mm : "%d minuttir", - h : "ein tími", - hh : "%d tímar", - d : "ein dagur", - dd : "%d dagar", - M : "ein mánaði", - MM : "%d mánaðir", - y : "eitt ár", - yy : "%d ár" + future : 'um %s', + past : '%s síðani', + s : 'fá sekund', + m : 'ein minutt', + mm : '%d minuttir', + h : 'ein tími', + hh : '%d tímar', + d : 'ein dagur', + dd : '%d dagar', + M : 'ein mánaði', + MM : '%d mánaðir', + y : 'eitt ár', + yy : '%d ár' }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return fo; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/fr-ca.js b/rainloop/v/0.0.0/app/localization/moment/fr-ca.js index 3280d7945..6ec487bd4 100644 --- a/rainloop/v/0.0.0/app/localization/moment/fr-ca.js +++ b/rainloop/v/0.0.0/app/localization/moment/fr-ca.js @@ -1,31 +1,33 @@ -// moment.js language configuration -// language : canadian french (fr-ca) -// author : Jonathan Abourbih : https://github.com/jonbca +//! moment.js locale configuration +//! locale : French (Canada) [fr-ca] +//! author : Jonathan Abourbih : https://github.com/jonbca -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('fr-ca', { - months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), - monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), - weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), - weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var fr_ca = moment.defineLocale('fr-ca', { + months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + monthsParseExact : true, + weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'YYYY-MM-DD', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' }, calendar : { - sameDay: "[Aujourd'hui à] LT", + sameDay: '[Aujourd\'hui à] LT', nextDay: '[Demain à] LT', nextWeek: 'dddd [à] LT', lastDay: '[Hier à] LT', @@ -33,22 +35,26 @@ sameElse: 'L' }, relativeTime : { - future : "dans %s", - past : "il y a %s", - s : "quelques secondes", - m : "une minute", - mm : "%d minutes", - h : "une heure", - hh : "%d heures", - d : "un jour", - dd : "%d jours", - M : "un mois", - MM : "%d mois", - y : "un an", - yy : "%d ans" + future : 'dans %s', + past : 'il y a %s', + s : 'quelques secondes', + m : 'une minute', + mm : '%d minutes', + h : 'une heure', + hh : '%d heures', + d : 'un jour', + dd : '%d jours', + M : 'un mois', + MM : '%d mois', + y : 'un an', + yy : '%d ans' }, + ordinalParse: /\d{1,2}(er|e)/, ordinal : function (number) { - return number + (number === 1 ? 'er' : ''); + return number + (number === 1 ? 'er' : 'e'); } }); -})); + + return fr_ca; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/fr.js b/rainloop/v/0.0.0/app/localization/moment/fr.js index 6b3dc526e..90662e2cc 100644 --- a/rainloop/v/0.0.0/app/localization/moment/fr.js +++ b/rainloop/v/0.0.0/app/localization/moment/fr.js @@ -1,31 +1,33 @@ -// moment.js language configuration -// language : french (fr) -// author : John Fischer : https://github.com/jfroffice +//! moment.js locale configuration +//! locale : French [fr] +//! author : John Fischer : https://github.com/jfroffice -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('fr', { - months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), - monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), - weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), - weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var fr = moment.defineLocale('fr', { + months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + monthsParseExact : true, + weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' }, calendar : { - sameDay: "[Aujourd'hui à] LT", + sameDay: '[Aujourd\'hui à] LT', nextDay: '[Demain à] LT', nextWeek: 'dddd [à] LT', lastDay: '[Hier à] LT', @@ -33,20 +35,21 @@ sameElse: 'L' }, relativeTime : { - future : "dans %s", - past : "il y a %s", - s : "quelques secondes", - m : "une minute", - mm : "%d minutes", - h : "une heure", - hh : "%d heures", - d : "un jour", - dd : "%d jours", - M : "un mois", - MM : "%d mois", - y : "un an", - yy : "%d ans" + future : 'dans %s', + past : 'il y a %s', + s : 'quelques secondes', + m : 'une minute', + mm : '%d minutes', + h : 'une heure', + hh : '%d heures', + d : 'un jour', + dd : '%d jours', + M : 'un mois', + MM : '%d mois', + y : 'un an', + yy : '%d ans' }, + ordinalParse: /\d{1,2}(er|)/, ordinal : function (number) { return number + (number === 1 ? 'er' : ''); }, @@ -55,4 +58,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return fr; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/gl.js b/rainloop/v/0.0.0/app/localization/moment/gl.js index 8b141278e..9fdc236ae 100644 --- a/rainloop/v/0.0.0/app/localization/moment/gl.js +++ b/rainloop/v/0.0.0/app/localization/moment/gl.js @@ -1,28 +1,30 @@ -// moment.js language configuration -// language : galician (gl) -// author : Juan G. Hurtado : https://github.com/juanghurtado +//! moment.js locale configuration +//! locale : Galician [gl] +//! author : Juan G. Hurtado : https://github.com/juanghurtado -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('gl', { - months : "Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"), - monthsShort : "Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"), - weekdays : "Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"), - weekdaysShort : "Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"), - weekdaysMin : "Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var gl = moment.defineLocale('gl', { + months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'), + monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'), + monthsParseExact: true, + weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'), + weekdaysShort : 'Dom._Lun._Mar._Mér._Xov._Ven._Sáb.'.split('_'), + weekdaysMin : 'Do_Lu_Ma_Mé_Xo_Ve_Sá'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY H:mm', + LLLL : 'dddd D MMMM YYYY H:mm' }, calendar : { sameDay : function () { @@ -44,28 +46,32 @@ }, relativeTime : { future : function (str) { - if (str === "uns segundos") { - return "nuns segundos"; + if (str === 'uns segundos') { + return 'nuns segundos'; } - return "en " + str; + return 'en ' + str; }, - past : "hai %s", - s : "uns segundos", - m : "un minuto", - mm : "%d minutos", - h : "unha hora", - hh : "%d horas", - d : "un día", - dd : "%d días", - M : "un mes", - MM : "%d meses", - y : "un ano", - yy : "%d anos" + past : 'hai %s', + s : 'uns segundos', + m : 'un minuto', + mm : '%d minutos', + h : 'unha hora', + hh : '%d horas', + d : 'un día', + dd : '%d días', + M : 'un mes', + MM : '%d meses', + y : 'un ano', + yy : '%d anos' }, + ordinalParse : /\d{1,2}º/, ordinal : '%dº', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return gl; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/he.js b/rainloop/v/0.0.0/app/localization/moment/he.js index b85dbe858..6e55a7a24 100644 --- a/rainloop/v/0.0.0/app/localization/moment/he.js +++ b/rainloop/v/0.0.0/app/localization/moment/he.js @@ -1,34 +1,34 @@ -// moment.js language configuration -// language : Hebrew (he) -// author : Tomer Cohen : https://github.com/tomer -// author : Moshe Simantov : https://github.com/DevelopmentIL -// author : Tal Ater : https://github.com/TalAter +//! moment.js locale configuration +//! locale : Hebrew [he] +//! author : Tomer Cohen : https://github.com/tomer +//! author : Moshe Simantov : https://github.com/DevelopmentIL +//! author : Tal Ater : https://github.com/TalAter -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('he', { - months : "ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"), - monthsShort : "ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"), - weekdays : "ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"), - weekdaysShort : "א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"), - weekdaysMin : "א_ב_ג_ד_ה_ו_ש".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var he = moment.defineLocale('he', { + months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'), + monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'), + weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'), + weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'), + weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [ב]MMMM YYYY", - LLL : "D [ב]MMMM YYYY LT", - LLLL : "dddd, D [ב]MMMM YYYY LT", - l : "D/M/YYYY", - ll : "D MMM YYYY", - lll : "D MMM YYYY LT", - llll : "ddd, D MMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D [ב]MMMM YYYY', + LLL : 'D [ב]MMMM YYYY HH:mm', + LLLL : 'dddd, D [ב]MMMM YYYY HH:mm', + l : 'D/M/YYYY', + ll : 'D MMM YYYY', + lll : 'D MMM YYYY HH:mm', + llll : 'ddd, D MMM YYYY HH:mm' }, calendar : { sameDay : '[היום ב־]LT', @@ -39,39 +39,61 @@ sameElse : 'L' }, relativeTime : { - future : "בעוד %s", - past : "לפני %s", - s : "מספר שניות", - m : "דקה", - mm : "%d דקות", - h : "שעה", + future : 'בעוד %s', + past : 'לפני %s', + s : 'מספר שניות', + m : 'דקה', + mm : '%d דקות', + h : 'שעה', hh : function (number) { if (number === 2) { - return "שעתיים"; + return 'שעתיים'; } - return number + " שעות"; + return number + ' שעות'; }, - d : "יום", + d : 'יום', dd : function (number) { if (number === 2) { - return "יומיים"; + return 'יומיים'; } - return number + " ימים"; + return number + ' ימים'; }, - M : "חודש", + M : 'חודש', MM : function (number) { if (number === 2) { - return "חודשיים"; + return 'חודשיים'; } - return number + " חודשים"; + return number + ' חודשים'; }, - y : "שנה", + y : 'שנה', yy : function (number) { if (number === 2) { - return "שנתיים"; + return 'שנתיים'; + } else if (number % 10 === 0 && number !== 10) { + return number + ' שנה'; } - return number + " שנים"; + return number + ' שנים'; + } + }, + meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i, + isPM : function (input) { + return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input); + }, + meridiem : function (hour, minute, isLower) { + if (hour < 5) { + return 'לפנות בוקר'; + } else if (hour < 10) { + return 'בבוקר'; + } else if (hour < 12) { + return isLower ? 'לפנה"צ' : 'לפני הצהריים'; + } else if (hour < 18) { + return isLower ? 'אחה"צ' : 'אחרי הצהריים'; + } else { + return 'בערב'; } } }); -})); + + return he; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/hi.js b/rainloop/v/0.0.0/app/localization/moment/hi.js index 8e6e99c19..fc597712e 100644 --- a/rainloop/v/0.0.0/app/localization/moment/hi.js +++ b/rainloop/v/0.0.0/app/localization/moment/hi.js @@ -1,16 +1,15 @@ -// moment.js language configuration -// language : hindi (hi) -// author : Mayank Singhal : https://github.com/mayanksinghal +//! moment.js locale configuration +//! locale : Hindi [hi] +//! author : Mayank Singhal : https://github.com/mayanksinghal + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var symbolMap = { '1': '१', '2': '२', @@ -36,18 +35,20 @@ '०': '0' }; - return moment.lang('hi', { - months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split("_"), - monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split("_"), - weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split("_"), - weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split("_"), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split("_"), + var hi = moment.defineLocale('hi', { + months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'), + monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'), + monthsParseExact: true, + weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), + weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'), + weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'), longDateFormat : { - LT : "A h:mm बजे", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" + LT : 'A h:mm बजे', + LTS : 'A h:mm:ss बजे', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm बजे', + LLLL : 'dddd, D MMMM YYYY, A h:mm बजे' }, calendar : { sameDay : '[आज] LT', @@ -58,19 +59,19 @@ sameElse : 'L' }, relativeTime : { - future : "%s में", - past : "%s पहले", - s : "कुछ ही क्षण", - m : "एक मिनट", - mm : "%d मिनट", - h : "एक घंटा", - hh : "%d घंटे", - d : "एक दिन", - dd : "%d दिन", - M : "एक महीने", - MM : "%d महीने", - y : "एक वर्ष", - yy : "%d वर्ष" + future : '%s में', + past : '%s पहले', + s : 'कुछ ही क्षण', + m : 'एक मिनट', + mm : '%d मिनट', + h : 'एक घंटा', + hh : '%d घंटे', + d : 'एक दिन', + dd : '%d दिन', + M : 'एक महीने', + MM : '%d महीने', + y : 'एक वर्ष', + yy : '%d वर्ष' }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { @@ -84,17 +85,32 @@ }, // Hindi notation for meridiems are quite fuzzy in practice. While there exists // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi. + meridiemParse: /रात|सुबह|दोपहर|शाम/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'रात') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'सुबह') { + return hour; + } else if (meridiem === 'दोपहर') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'शाम') { + return hour + 12; + } + }, meridiem : function (hour, minute, isLower) { if (hour < 4) { - return "रात"; + return 'रात'; } else if (hour < 10) { - return "सुबह"; + return 'सुबह'; } else if (hour < 17) { - return "दोपहर"; + return 'दोपहर'; } else if (hour < 20) { - return "शाम"; + return 'शाम'; } else { - return "रात"; + return 'रात'; } }, week : { @@ -102,4 +118,7 @@ doy : 6 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return hi; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/hr.js b/rainloop/v/0.0.0/app/localization/moment/hr.js index 2e3bf1128..70fdf5177 100644 --- a/rainloop/v/0.0.0/app/localization/moment/hr.js +++ b/rainloop/v/0.0.0/app/localization/moment/hr.js @@ -1,140 +1,145 @@ -// moment.js language configuration -// language : hrvatski (hr) -// author : Bojan Marković : https://github.com/bmarkovic +//! moment.js locale configuration +//! locale : Croatian [hr] +//! author : Bojan Marković : https://github.com/bmarkovic -// based on (sl) translation by Robert Sedovšek +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function translate(number, withoutSuffix, key) { - var result = number + " "; + var result = number + ' '; switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; + case 'm': + return withoutSuffix ? 'jedna minuta' : 'jedne minute'; + case 'mm': + if (number === 1) { + result += 'minuta'; + } else if (number === 2 || number === 3 || number === 4) { + result += 'minute'; + } else { + result += 'minuta'; + } + return result; + case 'h': + return withoutSuffix ? 'jedan sat' : 'jednog sata'; + case 'hh': + if (number === 1) { + result += 'sat'; + } else if (number === 2 || number === 3 || number === 4) { + result += 'sata'; + } else { + result += 'sati'; + } + return result; + case 'dd': + if (number === 1) { + result += 'dan'; + } else { + result += 'dana'; + } + return result; + case 'MM': + if (number === 1) { + result += 'mjesec'; + } else if (number === 2 || number === 3 || number === 4) { + result += 'mjeseca'; + } else { + result += 'mjeseci'; + } + return result; + case 'yy': + if (number === 1) { + result += 'godina'; + } else if (number === 2 || number === 3 || number === 4) { + result += 'godine'; + } else { + result += 'godina'; + } + return result; } } - return moment.lang('hr', { - months : "sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"), - monthsShort : "sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"), - weekdays : "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), - weekdaysShort : "ned._pon._uto._sri._čet._pet._sub.".split("_"), - weekdaysMin : "ne_po_ut_sr_če_pe_su".split("_"), + var hr = moment.defineLocale('hr', { + months : { + format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'), + standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_') + }, + monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'), + monthsParseExact: true, + weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), + weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), + weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'DD. MM. YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY H:mm', + LLLL : 'dddd, D. MMMM YYYY H:mm' }, calendar : { sameDay : '[danas u] LT', nextDay : '[sutra u] LT', - nextWeek : function () { switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; + case 0: + return '[u] [nedjelju] [u] LT'; + case 3: + return '[u] [srijedu] [u] LT'; + case 6: + return '[u] [subotu] [u] LT'; + case 1: + case 2: + case 4: + case 5: + return '[u] dddd [u] LT'; } }, lastDay : '[jučer u] LT', lastWeek : function () { switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; + case 0: + case 3: + return '[prošlu] dddd [u] LT'; + case 6: + return '[prošle] [subote] [u] LT'; + case 1: + case 2: + case 4: + case 5: + return '[prošli] dddd [u] LT'; } }, sameElse : 'L' }, relativeTime : { - future : "za %s", - past : "prije %s", - s : "par sekundi", + future : 'za %s', + past : 'prije %s', + s : 'par sekundi', m : translate, mm : translate, h : translate, hh : translate, - d : "dan", + d : 'dan', dd : translate, - M : "mjesec", + M : 'mjesec', MM : translate, - y : "godinu", + y : 'godinu', yy : translate }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return hr; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/hu.js b/rainloop/v/0.0.0/app/localization/moment/hu.js index 9833024cd..af5c73155 100644 --- a/rainloop/v/0.0.0/app/localization/moment/hu.js +++ b/rainloop/v/0.0.0/app/localization/moment/hu.js @@ -1,66 +1,66 @@ -// moment.js language configuration -// language : hungarian (hu) -// author : Adam Brunner : https://github.com/adambrunner +//! moment.js locale configuration +//! locale : Hungarian [hu] +//! author : Adam Brunner : https://github.com/adambrunner + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' '); - function translate(number, withoutSuffix, key, isFuture) { var num = number, suffix; - switch (key) { - case 's': - return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce'; - case 'm': - return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'mm': - return num + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'h': - return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'hh': - return num + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'd': - return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'dd': - return num + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'M': - return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'MM': - return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'y': - return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve'); - case 'yy': - return num + (isFuture || withoutSuffix ? ' év' : ' éve'); + case 's': + return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce'; + case 'm': + return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce'); + case 'mm': + return num + (isFuture || withoutSuffix ? ' perc' : ' perce'); + case 'h': + return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája'); + case 'hh': + return num + (isFuture || withoutSuffix ? ' óra' : ' órája'); + case 'd': + return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja'); + case 'dd': + return num + (isFuture || withoutSuffix ? ' nap' : ' napja'); + case 'M': + return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); + case 'MM': + return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); + case 'y': + return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve'); + case 'yy': + return num + (isFuture || withoutSuffix ? ' év' : ' éve'); } - return ''; } - function week(isFuture) { return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]'; } - return moment.lang('hu', { - months : "január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"), - monthsShort : "jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"), - weekdays : "vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"), - weekdaysShort : "vas_hét_kedd_sze_csüt_pén_szo".split("_"), - weekdaysMin : "v_h_k_sze_cs_p_szo".split("_"), + var hu = moment.defineLocale('hu', { + months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'), + monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'), + weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), + weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), + weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'), longDateFormat : { - LT : "H:mm", - L : "YYYY.MM.DD.", - LL : "YYYY. MMMM D.", - LLL : "YYYY. MMMM D., LT", - LLLL : "YYYY. MMMM D., dddd LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'YYYY.MM.DD.', + LL : 'YYYY. MMMM D.', + LLL : 'YYYY. MMMM D. H:mm', + LLLL : 'YYYY. MMMM D., dddd H:mm' + }, + meridiemParse: /de|du/i, + isPM: function (input) { + return input.charAt(1).toLowerCase() === 'u'; }, meridiem : function (hours, minutes, isLower) { if (hours < 12) { @@ -82,8 +82,8 @@ sameElse : 'L' }, relativeTime : { - future : "%s múlva", - past : "%s", + future : '%s múlva', + past : '%s', s : translate, m : translate, mm : translate, @@ -96,10 +96,14 @@ y : translate, yy : translate }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return hu; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/hy-am.js b/rainloop/v/0.0.0/app/localization/moment/hy-am.js index 951655bc2..8b262005f 100644 --- a/rainloop/v/0.0.0/app/localization/moment/hy-am.js +++ b/rainloop/v/0.0.0/app/localization/moment/hy-am.js @@ -1,54 +1,31 @@ -// moment.js language configuration -// language : Armenian (hy-am) -// author : Armendarabyan : https://github.com/armendarabyan +//! moment.js locale configuration +//! locale : Armenian [hy-am] +//! author : Armendarabyan : https://github.com/armendarabyan -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') + + var hy_am = moment.defineLocale('hy-am', { + months : { + format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'), + standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_') }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function monthsShortCaseReplace(m, format) { - var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'); - - return monthsShort[m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'); - - return weekdays[m.day()]; - } - - return moment.lang('hy-am', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), - weekdaysMin : "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), + monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), + weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'), + weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), + weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY թ.", - LLL : "D MMMM YYYY թ., LT", - LLLL : "dddd, D MMMM YYYY թ., LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY թ.', + LLL : 'D MMMM YYYY թ., HH:mm', + LLLL : 'dddd, D MMMM YYYY թ., HH:mm' }, calendar : { sameDay: '[այսօր] LT', @@ -63,51 +40,56 @@ sameElse: 'L' }, relativeTime : { - future : "%s հետո", - past : "%s առաջ", - s : "մի քանի վայրկյան", - m : "րոպե", - mm : "%d րոպե", - h : "ժամ", - hh : "%d ժամ", - d : "օր", - dd : "%d օր", - M : "ամիս", - MM : "%d ամիս", - y : "տարի", - yy : "%d տարի" + future : '%s հետո', + past : '%s առաջ', + s : 'մի քանի վայրկյան', + m : 'րոպե', + mm : '%d րոպե', + h : 'ժամ', + hh : '%d ժամ', + d : 'օր', + dd : '%d օր', + M : 'ամիս', + MM : '%d ամիս', + y : 'տարի', + yy : '%d տարի' + }, + meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/, + isPM: function (input) { + return /^(ցերեկվա|երեկոյան)$/.test(input); }, - meridiem : function (hour) { if (hour < 4) { - return "գիշերվա"; + return 'գիշերվա'; } else if (hour < 12) { - return "առավոտվա"; + return 'առավոտվա'; } else if (hour < 17) { - return "ցերեկվա"; + return 'ցերեկվա'; } else { - return "երեկոյան"; + return 'երեկոյան'; } }, - + ordinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/, ordinal: function (number, period) { switch (period) { - case 'DDD': - case 'w': - case 'W': - case 'DDDo': - if (number === 1) { - return number + '-ին'; - } - return number + '-րդ'; - default: - return number; + case 'DDD': + case 'w': + case 'W': + case 'DDDo': + if (number === 1) { + return number + '-ին'; + } + return number + '-րդ'; + default: + return number; } }, - week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return hy_am; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/id.js b/rainloop/v/0.0.0/app/localization/moment/id.js index f186280d8..16dff2f1b 100644 --- a/rainloop/v/0.0.0/app/localization/moment/id.js +++ b/rainloop/v/0.0.0/app/localization/moment/id.js @@ -1,29 +1,42 @@ -// moment.js language configuration -// language : Bahasa Indonesia (id) -// author : Mohammad Satrio Utomo : https://github.com/tyok -// reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan +//! moment.js locale configuration +//! locale : Indonesian [id] +//! author : Mohammad Satrio Utomo : https://github.com/tyok +//! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('id', { - months : "Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"), - weekdays : "Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"), - weekdaysShort : "Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"), - weekdaysMin : "Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var id = moment.defineLocale('id', { + months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'), + monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'), + weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'), + weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'), + weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'), longDateFormat : { - LT : "HH.mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY [pukul] LT", - LLLL : "dddd, D MMMM YYYY [pukul] LT" + LT : 'HH.mm', + LTS : 'HH.mm.ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY [pukul] HH.mm', + LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' + }, + meridiemParse: /pagi|siang|sore|malam/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'pagi') { + return hour; + } else if (meridiem === 'siang') { + return hour >= 11 ? hour : hour + 12; + } else if (meridiem === 'sore' || meridiem === 'malam') { + return hour + 12; + } }, meridiem : function (hours, minutes, isLower) { if (hours < 11) { @@ -45,23 +58,26 @@ sameElse : 'L' }, relativeTime : { - future : "dalam %s", - past : "%s yang lalu", - s : "beberapa detik", - m : "semenit", - mm : "%d menit", - h : "sejam", - hh : "%d jam", - d : "sehari", - dd : "%d hari", - M : "sebulan", - MM : "%d bulan", - y : "setahun", - yy : "%d tahun" + future : 'dalam %s', + past : '%s yang lalu', + s : 'beberapa detik', + m : 'semenit', + mm : '%d menit', + h : 'sejam', + hh : '%d jam', + d : 'sehari', + dd : '%d hari', + M : 'sebulan', + MM : '%d bulan', + y : 'setahun', + yy : '%d tahun' }, week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return id; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/is.js b/rainloop/v/0.0.0/app/localization/moment/is.js index 5b6b2a821..810fee617 100644 --- a/rainloop/v/0.0.0/app/localization/moment/is.js +++ b/rainloop/v/0.0.0/app/localization/moment/is.js @@ -1,16 +1,15 @@ -// moment.js language configuration -// language : icelandic (is) -// author : Hinrik Örn Sigurðsson : https://github.com/hinrik +//! moment.js locale configuration +//! locale : Icelandic [is] +//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function plural(n) { if (n % 100 === 11) { return true; @@ -19,78 +18,78 @@ } return true; } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; + var result = number + ' '; switch (key) { - case 's': - return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum'; - case 'm': - return withoutSuffix ? 'mínúta' : 'mínútu'; - case 'mm': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum'); - } else if (withoutSuffix) { - return result + 'mínúta'; - } - return result + 'mínútu'; - case 'hh': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum'); - } - return result + 'klukkustund'; - case 'd': - if (withoutSuffix) { - return 'dagur'; - } - return isFuture ? 'dag' : 'degi'; - case 'dd': - if (plural(number)) { - if (withoutSuffix) { - return result + 'dagar'; + case 's': + return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum'; + case 'm': + return withoutSuffix ? 'mínúta' : 'mínútu'; + case 'mm': + if (plural(number)) { + return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum'); + } else if (withoutSuffix) { + return result + 'mínúta'; } - return result + (isFuture ? 'daga' : 'dögum'); - } else if (withoutSuffix) { - return result + 'dagur'; - } - return result + (isFuture ? 'dag' : 'degi'); - case 'M': - if (withoutSuffix) { - return 'mánuður'; - } - return isFuture ? 'mánuð' : 'mánuði'; - case 'MM': - if (plural(number)) { - if (withoutSuffix) { - return result + 'mánuðir'; + return result + 'mínútu'; + case 'hh': + if (plural(number)) { + return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum'); } - return result + (isFuture ? 'mánuði' : 'mánuðum'); - } else if (withoutSuffix) { - return result + 'mánuður'; - } - return result + (isFuture ? 'mánuð' : 'mánuði'); - case 'y': - return withoutSuffix || isFuture ? 'ár' : 'ári'; - case 'yy': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); - } - return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); + return result + 'klukkustund'; + case 'd': + if (withoutSuffix) { + return 'dagur'; + } + return isFuture ? 'dag' : 'degi'; + case 'dd': + if (plural(number)) { + if (withoutSuffix) { + return result + 'dagar'; + } + return result + (isFuture ? 'daga' : 'dögum'); + } else if (withoutSuffix) { + return result + 'dagur'; + } + return result + (isFuture ? 'dag' : 'degi'); + case 'M': + if (withoutSuffix) { + return 'mánuður'; + } + return isFuture ? 'mánuð' : 'mánuði'; + case 'MM': + if (plural(number)) { + if (withoutSuffix) { + return result + 'mánuðir'; + } + return result + (isFuture ? 'mánuði' : 'mánuðum'); + } else if (withoutSuffix) { + return result + 'mánuður'; + } + return result + (isFuture ? 'mánuð' : 'mánuði'); + case 'y': + return withoutSuffix || isFuture ? 'ár' : 'ári'; + case 'yy': + if (plural(number)) { + return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); + } + return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); } } - return moment.lang('is', { - months : "janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"), - monthsShort : "jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"), - weekdays : "sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"), - weekdaysShort : "sun_mán_þri_mið_fim_fös_lau".split("_"), - weekdaysMin : "Su_Má_Þr_Mi_Fi_Fö_La".split("_"), + var is = moment.defineLocale('is', { + months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'), + monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'), + weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'), + weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'), + weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'), longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY [kl.] LT", - LLLL : "dddd, D. MMMM YYYY [kl.] LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY [kl.] H:mm', + LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm' }, calendar : { sameDay : '[í dag kl.] LT', @@ -101,12 +100,12 @@ sameElse : 'L' }, relativeTime : { - future : "eftir %s", - past : "fyrir %s síðan", + future : 'eftir %s', + past : 'fyrir %s síðan', s : translate, m : translate, mm : translate, - h : "klukkustund", + h : 'klukkustund', hh : translate, d : translate, dd : translate, @@ -115,10 +114,14 @@ y : translate, yy : translate }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return is; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/it.js b/rainloop/v/0.0.0/app/localization/moment/it.js index 84b7698be..35d44ccac 100644 --- a/rainloop/v/0.0.0/app/localization/moment/it.js +++ b/rainloop/v/0.0.0/app/localization/moment/it.js @@ -1,59 +1,70 @@ -// moment.js language configuration -// language : italian (it) -// author : Lorenzo : https://github.com/aliem -// author: Mattia Larentis: https://github.com/nostalgiaz +//! moment.js locale configuration +//! locale : Italian [it] +//! author : Lorenzo : https://github.com/aliem +//! author: Mattia Larentis: https://github.com/nostalgiaz -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('it', { - months : "Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre".split("_"), - monthsShort : "Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"), - weekdays : "Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"), - weekdaysShort : "Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"), - weekdaysMin : "D_L_Ma_Me_G_V_S".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var it = moment.defineLocale('it', { + months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), + monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), + weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'), + weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'), + weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' }, calendar : { sameDay: '[Oggi alle] LT', nextDay: '[Domani alle] LT', nextWeek: 'dddd [alle] LT', lastDay: '[Ieri alle] LT', - lastWeek: '[lo scorso] dddd [alle] LT', + lastWeek: function () { + switch (this.day()) { + case 0: + return '[la scorsa] dddd [alle] LT'; + default: + return '[lo scorso] dddd [alle] LT'; + } + }, sameElse: 'L' }, relativeTime : { future : function (s) { - return ((/^[0-9].+$/).test(s) ? "tra" : "in") + " " + s; + return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s; }, - past : "%s fa", - s : "alcuni secondi", - m : "un minuto", - mm : "%d minuti", - h : "un'ora", - hh : "%d ore", - d : "un giorno", - dd : "%d giorni", - M : "un mese", - MM : "%d mesi", - y : "un anno", - yy : "%d anni" + past : '%s fa', + s : 'alcuni secondi', + m : 'un minuto', + mm : '%d minuti', + h : 'un\'ora', + hh : '%d ore', + d : 'un giorno', + dd : '%d giorni', + M : 'un mese', + MM : '%d mesi', + y : 'un anno', + yy : '%d anni' }, + ordinalParse : /\d{1,2}º/, ordinal: '%dº', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return it; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ja.js b/rainloop/v/0.0.0/app/localization/moment/ja.js index 9cd7e9e98..adea3597c 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ja.js +++ b/rainloop/v/0.0.0/app/localization/moment/ja.js @@ -1,34 +1,38 @@ -// moment.js language configuration -// language : japanese (ja) -// author : LI Long : https://github.com/baryon +//! moment.js locale configuration +//! locale : Japanese [ja] +//! author : LI Long : https://github.com/baryon -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ja', { - months : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"), - weekdaysShort : "日_月_火_水_木_金_土".split("_"), - weekdaysMin : "日_月_火_水_木_金_土".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var ja = moment.defineLocale('ja', { + months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'), + weekdaysShort : '日_月_火_水_木_金_土'.split('_'), + weekdaysMin : '日_月_火_水_木_金_土'.split('_'), longDateFormat : { - LT : "Ah時m分", - L : "YYYY/MM/DD", - LL : "YYYY年M月D日", - LLL : "YYYY年M月D日LT", - LLLL : "YYYY年M月D日LT dddd" + LT : 'Ah時m分', + LTS : 'Ah時m分s秒', + L : 'YYYY/MM/DD', + LL : 'YYYY年M月D日', + LLL : 'YYYY年M月D日Ah時m分', + LLLL : 'YYYY年M月D日Ah時m分 dddd' + }, + meridiemParse: /午前|午後/i, + isPM : function (input) { + return input === '午後'; }, meridiem : function (hour, minute, isLower) { if (hour < 12) { - return "午前"; + return '午前'; } else { - return "午後"; + return '午後'; } }, calendar : { @@ -39,20 +43,34 @@ lastWeek : '[前週]dddd LT', sameElse : 'L' }, + ordinalParse : /\d{1,2}日/, + ordinal : function (number, period) { + switch (period) { + case 'd': + case 'D': + case 'DDD': + return number + '日'; + default: + return number; + } + }, relativeTime : { - future : "%s後", - past : "%s前", - s : "数秒", - m : "1分", - mm : "%d分", - h : "1時間", - hh : "%d時間", - d : "1日", - dd : "%d日", - M : "1ヶ月", - MM : "%dヶ月", - y : "1年", - yy : "%d年" + future : '%s後', + past : '%s前', + s : '数秒', + m : '1分', + mm : '%d分', + h : '1時間', + hh : '%d時間', + d : '1日', + dd : '%d日', + M : '1ヶ月', + MM : '%dヶ月', + y : '1年', + yy : '%d年' } }); -})); + + return ja; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ka.js b/rainloop/v/0.0.0/app/localization/moment/ka.js index 0cebdaae2..b9faf6834 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ka.js +++ b/rainloop/v/0.0.0/app/localization/moment/ka.js @@ -1,55 +1,35 @@ -// moment.js language configuration -// language : Georgian (ka) -// author : Irakli Janiashvili : https://github.com/irakli-janiashvili +//! moment.js locale configuration +//! locale : Georgian [ka] +//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') + + var ka = moment.defineLocale('ka', { + months : { + standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), + format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') }, - - nounCase = (/D[oD] *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - 'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_') + monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'), + weekdays : { + standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), + format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'), + isFormat: /(წინა|შემდეგ)/ }, - - nounCase = (/(წინა|შემდეგ)/).test(format) ? - 'accusative' : - 'nominative'; - - return weekdays[nounCase][m.day()]; - } - - return moment.lang('ka', { - months : monthsCaseReplace, - monthsShort : "იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"), - weekdays : weekdaysCaseReplace, - weekdaysShort : "კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"), - weekdaysMin : "კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"), + weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'), + weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'), longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'h:mm A', + LTS : 'h:mm:ss A', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY h:mm A', + LLLL : 'dddd, D MMMM YYYY h:mm A' }, calendar : { sameDay : '[დღეს] LT[-ზე]', @@ -62,47 +42,48 @@ relativeTime : { future : function (s) { return (/(წამი|წუთი|საათი|წელი)/).test(s) ? - s.replace(/ი$/, "ში") : - s + "ში"; + s.replace(/ი$/, 'ში') : + s + 'ში'; }, past : function (s) { if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) { - return s.replace(/(ი|ე)$/, "ის წინ"); + return s.replace(/(ი|ე)$/, 'ის წინ'); } if ((/წელი/).test(s)) { - return s.replace(/წელი$/, "წლის წინ"); + return s.replace(/წელი$/, 'წლის წინ'); } }, - s : "რამდენიმე წამი", - m : "წუთი", - mm : "%d წუთი", - h : "საათი", - hh : "%d საათი", - d : "დღე", - dd : "%d დღე", - M : "თვე", - MM : "%d თვე", - y : "წელი", - yy : "%d წელი" + s : 'რამდენიმე წამი', + m : 'წუთი', + mm : '%d წუთი', + h : 'საათი', + hh : '%d საათი', + d : 'დღე', + dd : '%d დღე', + M : 'თვე', + MM : '%d თვე', + y : 'წელი', + yy : '%d წელი' }, + ordinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/, ordinal : function (number) { if (number === 0) { return number; } - if (number === 1) { - return number + "-ლი"; + return number + '-ლი'; } - if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) { - return "მე-" + number; + return 'მე-' + number; } - - return number + "-ე"; + return number + '-ე'; }, week : { dow : 1, doy : 7 } }); -})); + + return ka; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/km.js b/rainloop/v/0.0.0/app/localization/moment/km.js index 0759c8f1d..cbfe31df7 100644 --- a/rainloop/v/0.0.0/app/localization/moment/km.js +++ b/rainloop/v/0.0.0/app/localization/moment/km.js @@ -1,31 +1,31 @@ -// moment.js language configuration -// language : khmer (km) -// author : Kruy Vanna : https://github.com/kruyvanna +//! moment.js locale configuration +//! locale : Cambodian [km] +//! author : Kruy Vanna : https://github.com/kruyvanna -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('km', { - months: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), - monthsShort: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), - weekdays: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - weekdaysShort: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - weekdaysMin: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var km = moment.defineLocale('km', { + months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'), + monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'), + weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), + weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), + weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), longDateFormat: { - LT: "HH:mm", - L: "DD/MM/YYYY", - LL: "D MMMM YYYY", - LLL: "D MMMM YYYY LT", - LLLL: "dddd, D MMMM YYYY LT" + LT: 'HH:mm', + LTS : 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' }, calendar: { - sameDay: '[ថ្ងៃនៈ ម៉ោង] LT', + sameDay: '[ថ្ងៃនេះ ម៉ោង] LT', nextDay: '[ស្អែក ម៉ោង] LT', nextWeek: 'dddd [ម៉ោង] LT', lastDay: '[ម្សិលមិញ ម៉ោង] LT', @@ -33,23 +33,26 @@ sameElse: 'L' }, relativeTime: { - future: "%sទៀត", - past: "%sមុន", - s: "ប៉ុន្មានវិនាទី", - m: "មួយនាទី", - mm: "%d នាទី", - h: "មួយម៉ោង", - hh: "%d ម៉ោង", - d: "មួយថ្ងៃ", - dd: "%d ថ្ងៃ", - M: "មួយខែ", - MM: "%d ខែ", - y: "មួយឆ្នាំ", - yy: "%d ឆ្នាំ" + future: '%sទៀត', + past: '%sមុន', + s: 'ប៉ុន្មានវិនាទី', + m: 'មួយនាទី', + mm: '%d នាទី', + h: 'មួយម៉ោង', + hh: '%d ម៉ោង', + d: 'មួយថ្ងៃ', + dd: '%d ថ្ងៃ', + M: 'មួយខែ', + MM: '%d ខែ', + y: 'មួយឆ្នាំ', + yy: '%d ឆ្នាំ' }, week: { dow: 1, // Monday is the first day of the week. doy: 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return km; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ko.js b/rainloop/v/0.0.0/app/localization/moment/ko.js index 3b469df33..248b6bae7 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ko.js +++ b/rainloop/v/0.0.0/app/localization/moment/ko.js @@ -1,34 +1,32 @@ -// moment.js language configuration -// language : korean (ko) -// -// authors -// -// - Kyungwook, Park : https://github.com/kyungw00k -// - Jeeeyul Lee -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ko', { - months : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), - monthsShort : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), - weekdays : "일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"), - weekdaysShort : "일_월_화_수_목_금_토".split("_"), - weekdaysMin : "일_월_화_수_목_금_토".split("_"), +//! moment.js locale configuration +//! locale : Korean [ko] +//! +//! authors +//! +//! - Kyungwook, Park : https://github.com/kyungw00k +//! - Jeeeyul Lee + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var ko = moment.defineLocale('ko', { + months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), + monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), + weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'), + weekdaysShort : '일_월_화_수_목_금_토'.split('_'), + weekdaysMin : '일_월_화_수_목_금_토'.split('_'), longDateFormat : { - LT : "A h시 mm분", - L : "YYYY.MM.DD", - LL : "YYYY년 MMMM D일", - LLL : "YYYY년 MMMM D일 LT", - LLLL : "YYYY년 MMMM D일 dddd LT" - }, - meridiem : function (hour, minute, isUpper) { - return hour < 12 ? '오전' : '오후'; + LT : 'A h시 m분', + LTS : 'A h시 m분 s초', + L : 'YYYY.MM.DD', + LL : 'YYYY년 MMMM D일', + LLL : 'YYYY년 MMMM D일 A h시 m분', + LLLL : 'YYYY년 MMMM D일 dddd A h시 m분' }, calendar : { sameDay : '오늘 LT', @@ -39,25 +37,32 @@ sameElse : 'L' }, relativeTime : { - future : "%s 후", - past : "%s 전", - s : "몇초", - ss : "%d초", - m : "일분", - mm : "%d분", - h : "한시간", - hh : "%d시간", - d : "하루", - dd : "%d일", - M : "한달", - MM : "%d달", - y : "일년", - yy : "%d년" + future : '%s 후', + past : '%s 전', + s : '몇 초', + ss : '%d초', + m : '일분', + mm : '%d분', + h : '한 시간', + hh : '%d시간', + d : '하루', + dd : '%d일', + M : '한 달', + MM : '%d달', + y : '일 년', + yy : '%d년' }, + ordinalParse : /\d{1,2}일/, ordinal : '%d일', - meridiemParse : /(오전|오후)/, + meridiemParse : /오전|오후/, isPM : function (token) { - return token === "오후"; + return token === '오후'; + }, + meridiem : function (hour, minute, isUpper) { + return hour < 12 ? '오전' : '오후'; } }); -})); + + return ko; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/lb.js b/rainloop/v/0.0.0/app/localization/moment/lb.js index 946ba13c2..2f4298320 100644 --- a/rainloop/v/0.0.0/app/localization/moment/lb.js +++ b/rainloop/v/0.0.0/app/localization/moment/lb.js @@ -1,82 +1,42 @@ -// moment.js language configuration -// language : Luxembourgish (lb) -// author : mweimerskirch : https://github.com/mweimerskirch +//! moment.js locale configuration +//! locale : Luxembourgish [lb] +//! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; -// Note: Luxembourgish has a very particular phonological rule ("Eifeler Regel") that causes the -// deletion of the final "n" in certain contexts. That's what the "eifelerRegelAppliesToWeekday" -// and "eifelerRegelAppliesToNumber" methods are meant for -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { 'm': ['eng Minutt', 'enger Minutt'], 'h': ['eng Stonn', 'enger Stonn'], 'd': ['een Dag', 'engem Dag'], - 'dd': [number + ' Deeg', number + ' Deeg'], 'M': ['ee Mount', 'engem Mount'], - 'MM': [number + ' Méint', number + ' Méint'], - 'y': ['ee Joer', 'engem Joer'], - 'yy': [number + ' Joer', number + ' Joer'] + 'y': ['ee Joer', 'engem Joer'] }; return withoutSuffix ? format[key][0] : format[key][1]; } - function processFutureTime(string) { var number = string.substr(0, string.indexOf(' ')); if (eifelerRegelAppliesToNumber(number)) { - return "a " + string; + return 'a ' + string; } - return "an " + string; + return 'an ' + string; } - function processPastTime(string) { var number = string.substr(0, string.indexOf(' ')); if (eifelerRegelAppliesToNumber(number)) { - return "viru " + string; + return 'viru ' + string; } - return "virun " + string; + return 'virun ' + string; } - - function processLastWeek(string1) { - var weekday = this.format('d'); - if (eifelerRegelAppliesToWeekday(weekday)) { - return '[Leschte] dddd [um] LT'; - } - return '[Leschten] dddd [um] LT'; - } - /** - * Returns true if the word before the given week day loses the "-n" ending. - * e.g. "Leschten Dënschdeg" but "Leschte Méindeg" - * - * @param weekday {integer} - * @returns {boolean} - */ - function eifelerRegelAppliesToWeekday(weekday) { - weekday = parseInt(weekday, 10); - switch (weekday) { - case 0: // Sonndeg - case 1: // Méindeg - case 3: // Mëttwoch - case 5: // Freideg - case 6: // Samschdeg - return true; - default: // 2 Dënschdeg, 4 Donneschdeg - return false; - } - } - - /** - * Returns true if the word before the given number loses the "-n" ending. - * e.g. "an 10 Deeg" but "a 5 Deeg" + * Returns true if the word before the given number loses the '-n' ending. + * e.g. 'an 10 Deeg' but 'a 5 Deeg' * * @param number {integer} * @returns {boolean} @@ -115,46 +75,62 @@ } } - return moment.lang('lb', { - months: "Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), - monthsShort: "Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), - weekdays: "Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"), - weekdaysShort: "So._Mé._Dë._Më._Do._Fr._Sa.".split("_"), - weekdaysMin: "So_Mé_Dë_Më_Do_Fr_Sa".split("_"), + var lb = moment.defineLocale('lb', { + months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), + monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), + monthsParseExact : true, + weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'), + weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'), + weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'), + weekdaysParseExact : true, longDateFormat: { - LT: "H:mm [Auer]", - L: "DD.MM.YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" + LT: 'H:mm [Auer]', + LTS: 'H:mm:ss [Auer]', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm [Auer]', + LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]' }, calendar: { - sameDay: "[Haut um] LT", - sameElse: "L", + sameDay: '[Haut um] LT', + sameElse: 'L', nextDay: '[Muer um] LT', nextWeek: 'dddd [um] LT', lastDay: '[Gëschter um] LT', - lastWeek: processLastWeek + lastWeek: function () { + // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule + switch (this.day()) { + case 2: + case 4: + return '[Leschten] dddd [um] LT'; + default: + return '[Leschte] dddd [um] LT'; + } + } }, - relativeTime: { - future: processFutureTime, - past: processPastTime, - s: "e puer Sekonnen", - m: processRelativeTime, - mm: "%d Minutten", - h: processRelativeTime, - hh: "%d Stonnen", - d: processRelativeTime, - dd: processRelativeTime, - M: processRelativeTime, - MM: processRelativeTime, - y: processRelativeTime, - yy: processRelativeTime + relativeTime : { + future : processFutureTime, + past : processPastTime, + s : 'e puer Sekonnen', + m : processRelativeTime, + mm : '%d Minutten', + h : processRelativeTime, + hh : '%d Stonnen', + d : processRelativeTime, + dd : '%d Deeg', + M : processRelativeTime, + MM : '%d Méint', + y : processRelativeTime, + yy : '%d Joer' }, + ordinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return lb; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/lt.js b/rainloop/v/0.0.0/app/localization/moment/lt.js index 3377375cd..2bb9a36d8 100644 --- a/rainloop/v/0.0.0/app/localization/moment/lt.js +++ b/rainloop/v/0.0.0/app/localization/moment/lt.js @@ -1,52 +1,45 @@ -// moment.js language configuration -// language : Lithuanian (lt) -// author : Mindaugas Mozūras : https://github.com/mmozuras +//! moment.js locale configuration +//! locale : Lithuanian [lt] +//! author : Mindaugas Mozūras : https://github.com/mmozuras + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var units = { - "m" : "minutė_minutės_minutę", - "mm": "minutės_minučių_minutes", - "h" : "valanda_valandos_valandą", - "hh": "valandos_valandų_valandas", - "d" : "diena_dienos_dieną", - "dd": "dienos_dienų_dienas", - "M" : "mėnuo_mėnesio_mėnesį", - "MM": "mėnesiai_mėnesių_mėnesius", - "y" : "metai_metų_metus", - "yy": "metai_metų_metus" - }, - weekDays = "pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis_sekmadienis".split("_"); - + 'm' : 'minutė_minutės_minutę', + 'mm': 'minutės_minučių_minutes', + 'h' : 'valanda_valandos_valandą', + 'hh': 'valandos_valandų_valandas', + 'd' : 'diena_dienos_dieną', + 'dd': 'dienos_dienų_dienas', + 'M' : 'mėnuo_mėnesio_mėnesį', + 'MM': 'mėnesiai_mėnesių_mėnesius', + 'y' : 'metai_metų_metus', + 'yy': 'metai_metų_metus' + }; function translateSeconds(number, withoutSuffix, key, isFuture) { if (withoutSuffix) { - return "kelios sekundės"; + return 'kelios sekundės'; } else { - return isFuture ? "kelių sekundžių" : "kelias sekundes"; + return isFuture ? 'kelių sekundžių' : 'kelias sekundes'; } } - function translateSingular(number, withoutSuffix, key, isFuture) { return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); } - function special(number) { return number % 10 === 0 || (number > 10 && number < 20); } - function forms(key) { - return units[key].split("_"); + return units[key].split('_'); } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; + var result = number + ' '; if (number === 1) { return result + translateSingular(number, withoutSuffix, key[0], isFuture); } else if (withoutSuffix) { @@ -59,42 +52,44 @@ } } } - - function relativeWeekDay(moment, format) { - var nominative = format.indexOf('dddd HH:mm') === -1, - weekDay = weekDays[moment.weekday()]; - - return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + "į"; - } - - return moment.lang("lt", { - months : "sausio_vasario_kovo_balandžio_gegužės_biržėlio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"), - monthsShort : "sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"), - weekdays : relativeWeekDay, - weekdaysShort : "Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"), - weekdaysMin : "S_P_A_T_K_Pn_Š".split("_"), + var lt = moment.defineLocale('lt', { + months : { + format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'), + standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'), + isFormat: /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?|MMMM?(\[[^\[\]]*\]|\s+)+D[oD]?/ + }, + monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'), + weekdays : { + format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'), + standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'), + isFormat: /dddd HH:mm/ + }, + weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'), + weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "YYYY [m.] MMMM D [d.]", - LLL : "YYYY [m.] MMMM D [d.], LT [val.]", - LLLL : "YYYY [m.] MMMM D [d.], dddd, LT [val.]", - l : "YYYY-MM-DD", - ll : "YYYY [m.] MMMM D [d.]", - lll : "YYYY [m.] MMMM D [d.], LT [val.]", - llll : "YYYY [m.] MMMM D [d.], ddd, LT [val.]" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'YYYY-MM-DD', + LL : 'YYYY [m.] MMMM D [d.]', + LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]', + LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]', + l : 'YYYY-MM-DD', + ll : 'YYYY [m.] MMMM D [d.]', + lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]', + llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]' }, calendar : { - sameDay : "[Šiandien] LT", - nextDay : "[Rytoj] LT", - nextWeek : "dddd LT", - lastDay : "[Vakar] LT", - lastWeek : "[Praėjusį] dddd LT", - sameElse : "L" + sameDay : '[Šiandien] LT', + nextDay : '[Rytoj] LT', + nextWeek : 'dddd LT', + lastDay : '[Vakar] LT', + lastWeek : '[Praėjusį] dddd LT', + sameElse : 'L' }, relativeTime : { - future : "po %s", - past : "prieš %s", + future : 'po %s', + past : 'prieš %s', s : translateSeconds, m : translateSingular, mm : translate, @@ -107,6 +102,7 @@ y : translateSingular, yy : translate }, + ordinalParse: /\d{1,2}-oji/, ordinal : function (number) { return number + '-oji'; }, @@ -115,4 +111,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return lt; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/lv.js b/rainloop/v/0.0.0/app/localization/moment/lv.js index ffe25cfe4..780be1398 100644 --- a/rainloop/v/0.0.0/app/localization/moment/lv.js +++ b/rainloop/v/0.0.0/app/localization/moment/lv.js @@ -1,49 +1,65 @@ -// moment.js language configuration -// language : latvian (lv) -// author : Kristaps Karlsons : https://github.com/skakri +//! moment.js locale configuration +//! locale : Latvian [lv] +//! author : Kristaps Karlsons : https://github.com/skakri +//! author : Jānis Elmeris : https://github.com/JanisE + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var units = { - 'mm': 'minūti_minūtes_minūte_minūtes', - 'hh': 'stundu_stundas_stunda_stundas', - 'dd': 'dienu_dienas_diena_dienas', - 'MM': 'mēnesi_mēnešus_mēnesis_mēneši', - 'yy': 'gadu_gadus_gads_gadi' + 'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'), + 'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'), + 'h': 'stundas_stundām_stunda_stundas'.split('_'), + 'hh': 'stundas_stundām_stunda_stundas'.split('_'), + 'd': 'dienas_dienām_diena_dienas'.split('_'), + 'dd': 'dienas_dienām_diena_dienas'.split('_'), + 'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), + 'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), + 'y': 'gada_gadiem_gads_gadi'.split('_'), + 'yy': 'gada_gadiem_gads_gadi'.split('_') }; - - function format(word, number, withoutSuffix) { - var forms = word.split('_'); + /** + * @param withoutSuffix boolean true = a length of time; false = before/after a period of time. + */ + function format(forms, number, withoutSuffix) { if (withoutSuffix) { - return number % 10 === 1 && number !== 11 ? forms[2] : forms[3]; + // E.g. "21 minūte", "3 minūtes". + return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3]; } else { - return number % 10 === 1 && number !== 11 ? forms[0] : forms[1]; + // E.g. "21 minūtes" as in "pēc 21 minūtes". + // E.g. "3 minūtēm" as in "pēc 3 minūtēm". + return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1]; } } - function relativeTimeWithPlural(number, withoutSuffix, key) { return number + ' ' + format(units[key], number, withoutSuffix); } + function relativeTimeWithSingular(number, withoutSuffix, key) { + return format(units[key], number, withoutSuffix); + } + function relativeSeconds(number, withoutSuffix) { + return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm'; + } - return moment.lang('lv', { - months : "janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"), - weekdays : "svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"), - weekdaysShort : "Sv_P_O_T_C_Pk_S".split("_"), - weekdaysMin : "Sv_P_O_T_C_Pk_S".split("_"), + var lv = moment.defineLocale('lv', { + months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'), + monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'), + weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'), + weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'), + weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "YYYY. [gada] D. MMMM", - LLL : "YYYY. [gada] D. MMMM, LT", - LLLL : "YYYY. [gada] D. MMMM, dddd, LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY.', + LL : 'YYYY. [gada] D. MMMM', + LLL : 'YYYY. [gada] D. MMMM, HH:mm', + LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm' }, calendar : { sameDay : '[Šodien pulksten] LT', @@ -54,24 +70,28 @@ sameElse : 'L' }, relativeTime : { - future : "%s vēlāk", - past : "%s agrāk", - s : "dažas sekundes", - m : "minūti", + future : 'pēc %s', + past : 'pirms %s', + s : relativeSeconds, + m : relativeTimeWithSingular, mm : relativeTimeWithPlural, - h : "stundu", + h : relativeTimeWithSingular, hh : relativeTimeWithPlural, - d : "dienu", + d : relativeTimeWithSingular, dd : relativeTimeWithPlural, - M : "mēnesi", + M : relativeTimeWithSingular, MM : relativeTimeWithPlural, - y : "gadu", + y : relativeTimeWithSingular, yy : relativeTimeWithPlural }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return lv; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/mk.js b/rainloop/v/0.0.0/app/localization/moment/mk.js index 5f272fa2d..88413ace2 100644 --- a/rainloop/v/0.0.0/app/localization/moment/mk.js +++ b/rainloop/v/0.0.0/app/localization/moment/mk.js @@ -1,64 +1,65 @@ -// moment.js language configuration -// language : macedonian (mk) -// author : Borislav Mickov : https://github.com/B0k0 +//! moment.js locale configuration +//! locale : Macedonian [mk] +//! author : Borislav Mickov : https://github.com/B0k0 -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('mk', { - months : "јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"), - monthsShort : "јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"), - weekdays : "недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"), - weekdaysShort : "нед_пон_вто_сре_чет_пет_саб".split("_"), - weekdaysMin : "нe_пo_вт_ср_че_пе_сa".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var mk = moment.defineLocale('mk', { + months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'), + monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'), + weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'), + weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'), + weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'), longDateFormat : { - LT : "H:mm", - L : "D.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'D.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY H:mm', + LLLL : 'dddd, D MMMM YYYY H:mm' }, calendar : { sameDay : '[Денес во] LT', nextDay : '[Утре во] LT', - nextWeek : 'dddd [во] LT', + nextWeek : '[Во] dddd [во] LT', lastDay : '[Вчера во] LT', lastWeek : function () { switch (this.day()) { - case 0: - case 3: - case 6: - return '[Во изминатата] dddd [во] LT'; - case 1: - case 2: - case 4: - case 5: - return '[Во изминатиот] dddd [во] LT'; + case 0: + case 3: + case 6: + return '[Изминатата] dddd [во] LT'; + case 1: + case 2: + case 4: + case 5: + return '[Изминатиот] dddd [во] LT'; } }, sameElse : 'L' }, relativeTime : { - future : "после %s", - past : "пред %s", - s : "неколку секунди", - m : "минута", - mm : "%d минути", - h : "час", - hh : "%d часа", - d : "ден", - dd : "%d дена", - M : "месец", - MM : "%d месеци", - y : "година", - yy : "%d години" + future : 'после %s', + past : 'пред %s', + s : 'неколку секунди', + m : 'минута', + mm : '%d минути', + h : 'час', + hh : '%d часа', + d : 'ден', + dd : '%d дена', + M : 'месец', + MM : '%d месеци', + y : 'година', + yy : '%d години' }, + ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, ordinal : function (number) { var lastDigit = number % 10, last2Digits = number % 100; @@ -83,4 +84,7 @@ doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return mk; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ml.js b/rainloop/v/0.0.0/app/localization/moment/ml.js index cc7db9a30..487b37a63 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ml.js +++ b/rainloop/v/0.0.0/app/localization/moment/ml.js @@ -1,28 +1,29 @@ -// moment.js language configuration -// language : malayalam (ml) -// author : Floyd Pink : https://github.com/floydpink +//! moment.js locale configuration +//! locale : Malayalam [ml] +//! author : Floyd Pink : https://github.com/floydpink -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ml', { - months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split("_"), - monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split("_"), - weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split("_"), - weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split("_"), - weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var ml = moment.defineLocale('ml', { + months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'), + monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'), + monthsParseExact : true, + weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'), + weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'), + weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'), longDateFormat : { - LT : "A h:mm -നു", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" + LT : 'A h:mm -നു', + LTS : 'A h:mm:ss -നു', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm -നു', + LLLL : 'dddd, D MMMM YYYY, A h:mm -നു' }, calendar : { sameDay : '[ഇന്ന്] LT', @@ -33,32 +34,48 @@ sameElse : 'L' }, relativeTime : { - future : "%s കഴിഞ്ഞ്", - past : "%s മുൻപ്", - s : "അൽപ നിമിഷങ്ങൾ", - m : "ഒരു മിനിറ്റ്", - mm : "%d മിനിറ്റ്", - h : "ഒരു മണിക്കൂർ", - hh : "%d മണിക്കൂർ", - d : "ഒരു ദിവസം", - dd : "%d ദിവസം", - M : "ഒരു മാസം", - MM : "%d മാസം", - y : "ഒരു വർഷം", - yy : "%d വർഷം" + future : '%s കഴിഞ്ഞ്', + past : '%s മുൻപ്', + s : 'അൽപ നിമിഷങ്ങൾ', + m : 'ഒരു മിനിറ്റ്', + mm : '%d മിനിറ്റ്', + h : 'ഒരു മണിക്കൂർ', + hh : '%d മണിക്കൂർ', + d : 'ഒരു ദിവസം', + dd : '%d ദിവസം', + M : 'ഒരു മാസം', + MM : '%d മാസം', + y : 'ഒരു വർഷം', + yy : '%d വർഷം' + }, + meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'രാത്രി' && hour >= 4) || + meridiem === 'ഉച്ച കഴിഞ്ഞ്' || + meridiem === 'വൈകുന്നേരം') { + return hour + 12; + } else { + return hour; + } }, meridiem : function (hour, minute, isLower) { if (hour < 4) { - return "രാത്രി"; + return 'രാത്രി'; } else if (hour < 12) { - return "രാവിലെ"; + return 'രാവിലെ'; } else if (hour < 17) { - return "ഉച്ച കഴിഞ്ഞ്"; + return 'ഉച്ച കഴിഞ്ഞ്'; } else if (hour < 20) { - return "വൈകുന്നേരം"; + return 'വൈകുന്നേരം'; } else { - return "രാത്രി"; + return 'രാത്രി'; } } }); -})); + + return ml; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/mr.js b/rainloop/v/0.0.0/app/localization/moment/mr.js index 0d1adfd64..fc388b013 100644 --- a/rainloop/v/0.0.0/app/localization/moment/mr.js +++ b/rainloop/v/0.0.0/app/localization/moment/mr.js @@ -1,16 +1,16 @@ -// moment.js language configuration -// language : Marathi (mr) -// author : Harshad Kale : https://github.com/kalehv +//! moment.js locale configuration +//! locale : Marathi [mr] +//! author : Harshad Kale : https://github.com/kalehv +//! author : Vivek Athalye : https://github.com/vnathalye + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var symbolMap = { '1': '१', '2': '२', @@ -36,18 +36,56 @@ '०': '0' }; - return moment.lang('mr', { - months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split("_"), - monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split("_"), - weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split("_"), - weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split("_"), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split("_"), + function relativeTimeMr(number, withoutSuffix, string, isFuture) + { + var output = ''; + if (withoutSuffix) { + switch (string) { + case 's': output = 'काही सेकंद'; break; + case 'm': output = 'एक मिनिट'; break; + case 'mm': output = '%d मिनिटे'; break; + case 'h': output = 'एक तास'; break; + case 'hh': output = '%d तास'; break; + case 'd': output = 'एक दिवस'; break; + case 'dd': output = '%d दिवस'; break; + case 'M': output = 'एक महिना'; break; + case 'MM': output = '%d महिने'; break; + case 'y': output = 'एक वर्ष'; break; + case 'yy': output = '%d वर्षे'; break; + } + } + else { + switch (string) { + case 's': output = 'काही सेकंदां'; break; + case 'm': output = 'एका मिनिटा'; break; + case 'mm': output = '%d मिनिटां'; break; + case 'h': output = 'एका तासा'; break; + case 'hh': output = '%d तासां'; break; + case 'd': output = 'एका दिवसा'; break; + case 'dd': output = '%d दिवसां'; break; + case 'M': output = 'एका महिन्या'; break; + case 'MM': output = '%d महिन्यां'; break; + case 'y': output = 'एका वर्षा'; break; + case 'yy': output = '%d वर्षां'; break; + } + } + return output.replace(/%d/i, number); + } + + var mr = moment.defineLocale('mr', { + months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'), + monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'), + monthsParseExact : true, + weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), + weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'), + weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'), longDateFormat : { - LT : "A h:mm वाजता", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" + LT : 'A h:mm वाजता', + LTS : 'A h:mm:ss वाजता', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm वाजता', + LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता' }, calendar : { sameDay : '[आज] LT', @@ -58,19 +96,19 @@ sameElse : 'L' }, relativeTime : { - future : "%s नंतर", - past : "%s पूर्वी", - s : "सेकंद", - m: "एक मिनिट", - mm: "%d मिनिटे", - h : "एक तास", - hh : "%d तास", - d : "एक दिवस", - dd : "%d दिवस", - M : "एक महिना", - MM : "%d महिने", - y : "एक वर्ष", - yy : "%d वर्षे" + future: '%sमध्ये', + past: '%sपूर्वी', + s: relativeTimeMr, + m: relativeTimeMr, + mm: relativeTimeMr, + h: relativeTimeMr, + hh: relativeTimeMr, + d: relativeTimeMr, + dd: relativeTimeMr, + M: relativeTimeMr, + MM: relativeTimeMr, + y: relativeTimeMr, + yy: relativeTimeMr }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { @@ -82,18 +120,32 @@ return symbolMap[match]; }); }, - meridiem: function (hour, minute, isLower) - { + meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'रात्री') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'सकाळी') { + return hour; + } else if (meridiem === 'दुपारी') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'सायंकाळी') { + return hour + 12; + } + }, + meridiem: function (hour, minute, isLower) { if (hour < 4) { - return "रात्री"; + return 'रात्री'; } else if (hour < 10) { - return "सकाळी"; + return 'सकाळी'; } else if (hour < 17) { - return "दुपारी"; + return 'दुपारी'; } else if (hour < 20) { - return "सायंकाळी"; + return 'सायंकाळी'; } else { - return "रात्री"; + return 'रात्री'; } }, week : { @@ -101,4 +153,7 @@ doy : 6 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return mr; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ms-my.js b/rainloop/v/0.0.0/app/localization/moment/ms-my.js index 501d5aaa0..e353173a9 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ms-my.js +++ b/rainloop/v/0.0.0/app/localization/moment/ms-my.js @@ -1,28 +1,42 @@ -// moment.js language configuration -// language : Bahasa Malaysia (ms-MY) -// author : Weldan Jamili : https://github.com/weldan +//! moment.js locale configuration +//! locale : Malay [ms-my] +//! note : DEPRECATED, the correct one is [ms] +//! author : Weldan Jamili : https://github.com/weldan -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ms-my', { - months : "Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"), - monthsShort : "Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"), - weekdays : "Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"), - weekdaysShort : "Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"), - weekdaysMin : "Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var ms_my = moment.defineLocale('ms-my', { + months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), + monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), + weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), + weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), + weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), longDateFormat : { - LT : "HH.mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY [pukul] LT", - LLLL : "dddd, D MMMM YYYY [pukul] LT" + LT : 'HH.mm', + LTS : 'HH.mm.ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY [pukul] HH.mm', + LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' + }, + meridiemParse: /pagi|tengahari|petang|malam/, + meridiemHour: function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'pagi') { + return hour; + } else if (meridiem === 'tengahari') { + return hour >= 11 ? hour : hour + 12; + } else if (meridiem === 'petang' || meridiem === 'malam') { + return hour + 12; + } }, meridiem : function (hours, minutes, isLower) { if (hours < 11) { @@ -44,23 +58,26 @@ sameElse : 'L' }, relativeTime : { - future : "dalam %s", - past : "%s yang lepas", - s : "beberapa saat", - m : "seminit", - mm : "%d minit", - h : "sejam", - hh : "%d jam", - d : "sehari", - dd : "%d hari", - M : "sebulan", - MM : "%d bulan", - y : "setahun", - yy : "%d tahun" + future : 'dalam %s', + past : '%s yang lepas', + s : 'beberapa saat', + m : 'seminit', + mm : '%d minit', + h : 'sejam', + hh : '%d jam', + d : 'sehari', + dd : '%d hari', + M : 'sebulan', + MM : '%d bulan', + y : 'setahun', + yy : '%d tahun' }, week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return ms_my; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/nb.js b/rainloop/v/0.0.0/app/localization/moment/nb.js index 2f652efd1..592734d6c 100644 --- a/rainloop/v/0.0.0/app/localization/moment/nb.js +++ b/rainloop/v/0.0.0/app/localization/moment/nb.js @@ -1,29 +1,31 @@ -// moment.js language configuration -// language : norwegian bokmål (nb) -// authors : Espen Hovlandsdal : https://github.com/rexxars -// Sigurd Gartmann : https://github.com/sigurdga +//! moment.js locale configuration +//! locale : Norwegian Bokmål [nb] +//! authors : Espen Hovlandsdal : https://github.com/rexxars +//! Sigurd Gartmann : https://github.com/sigurdga -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('nb', { - months : "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"), - weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), - weekdaysShort : "sø._ma._ti._on._to._fr._lø.".split("_"), - weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var nb = moment.defineLocale('nb', { + months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), + monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), + monthsParseExact : true, + weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), + weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'), + weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "H.mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY [kl.] LT", - LLLL : "dddd D. MMMM YYYY [kl.] LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY [kl.] HH:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[i dag kl.] LT', @@ -34,24 +36,28 @@ sameElse: 'L' }, relativeTime : { - future : "om %s", - past : "for %s siden", - s : "noen sekunder", - m : "ett minutt", - mm : "%d minutter", - h : "en time", - hh : "%d timer", - d : "en dag", - dd : "%d dager", - M : "en måned", - MM : "%d måneder", - y : "ett år", - yy : "%d år" + future : 'om %s', + past : '%s siden', + s : 'noen sekunder', + m : 'ett minutt', + mm : '%d minutter', + h : 'en time', + hh : '%d timer', + d : 'en dag', + dd : '%d dager', + M : 'en måned', + MM : '%d måneder', + y : 'ett år', + yy : '%d år' }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return nb; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ne.js b/rainloop/v/0.0.0/app/localization/moment/ne.js index 1d57b8cbf..85de195ea 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ne.js +++ b/rainloop/v/0.0.0/app/localization/moment/ne.js @@ -1,16 +1,15 @@ -// moment.js language configuration -// language : nepali/nepalese -// author : suvash : https://github.com/suvash +//! moment.js locale configuration +//! locale : Nepalese [ne] +//! author : suvash : https://github.com/suvash + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var symbolMap = { '1': '१', '2': '२', @@ -36,18 +35,21 @@ '०': '0' }; - return moment.lang('ne', { - months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split("_"), - monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split("_"), - weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split("_"), - weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split("_"), - weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split("_"), + var ne = moment.defineLocale('ne', { + months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'), + monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'), + monthsParseExact : true, + weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), + weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'), + weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "Aको h:mm बजे", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" + LT : 'Aको h:mm बजे', + LTS : 'Aको h:mm:ss बजे', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, Aको h:mm बजे', + LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे' }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { @@ -59,47 +61,63 @@ return symbolMap[match]; }); }, + meridiemParse: /राति|बिहान|दिउँसो|साँझ/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'राति') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'बिहान') { + return hour; + } else if (meridiem === 'दिउँसो') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'साँझ') { + return hour + 12; + } + }, meridiem : function (hour, minute, isLower) { if (hour < 3) { - return "राती"; - } else if (hour < 10) { - return "बिहान"; - } else if (hour < 15) { - return "दिउँसो"; - } else if (hour < 18) { - return "बेलुका"; + return 'राति'; + } else if (hour < 12) { + return 'बिहान'; + } else if (hour < 16) { + return 'दिउँसो'; } else if (hour < 20) { - return "साँझ"; + return 'साँझ'; } else { - return "राती"; + return 'राति'; } }, calendar : { sameDay : '[आज] LT', - nextDay : '[भोली] LT', + nextDay : '[भोलि] LT', nextWeek : '[आउँदो] dddd[,] LT', lastDay : '[हिजो] LT', lastWeek : '[गएको] dddd[,] LT', sameElse : 'L' }, relativeTime : { - future : "%sमा", - past : "%s अगाडी", - s : "केही समय", - m : "एक मिनेट", - mm : "%d मिनेट", - h : "एक घण्टा", - hh : "%d घण्टा", - d : "एक दिन", - dd : "%d दिन", - M : "एक महिना", - MM : "%d महिना", - y : "एक बर्ष", - yy : "%d बर्ष" + future : '%sमा', + past : '%s अगाडि', + s : 'केही क्षण', + m : 'एक मिनेट', + mm : '%d मिनेट', + h : 'एक घण्टा', + hh : '%d घण्टा', + d : 'एक दिन', + dd : '%d दिन', + M : 'एक महिना', + MM : '%d महिना', + y : 'एक बर्ष', + yy : '%d बर्ष' }, week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return ne; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/nl.js b/rainloop/v/0.0.0/app/localization/moment/nl.js index ffd454faf..724930a76 100644 --- a/rainloop/v/0.0.0/app/localization/moment/nl.js +++ b/rainloop/v/0.0.0/app/localization/moment/nl.js @@ -1,21 +1,20 @@ -// moment.js language configuration -// language : dutch (nl) -// author : Joris Röling : https://github.com/jjupiter +//! moment.js locale configuration +//! locale : Dutch [nl] +//! author : Joris Röling : https://github.com/jjupiter -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var monthsShortWithDots = "jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"), - monthsShortWithoutDots = "jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; - return moment.lang('nl', { - months : "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"), + + var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), + monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'); + + var nl = moment.defineLocale('nl', { + months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), monthsShort : function (m, format) { if (/-MMM-/.test(format)) { return monthsShortWithoutDots[m.month()]; @@ -23,15 +22,18 @@ return monthsShortWithDots[m.month()]; } }, - weekdays : "zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"), - weekdaysShort : "zo._ma._di._wo._do._vr._za.".split("_"), - weekdaysMin : "Zo_Ma_Di_Wo_Do_Vr_Za".split("_"), + monthsParseExact : true, + weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), + weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'), + weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "DD-MM-YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD-MM-YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' }, calendar : { sameDay: '[vandaag om] LT', @@ -42,20 +44,21 @@ sameElse: 'L' }, relativeTime : { - future : "over %s", - past : "%s geleden", - s : "een paar seconden", - m : "één minuut", - mm : "%d minuten", - h : "één uur", - hh : "%d uur", - d : "één dag", - dd : "%d dagen", - M : "één maand", - MM : "%d maanden", - y : "één jaar", - yy : "%d jaar" + future : 'over %s', + past : '%s geleden', + s : 'een paar seconden', + m : 'één minuut', + mm : '%d minuten', + h : 'één uur', + hh : '%d uur', + d : 'één dag', + dd : '%d dagen', + M : 'één maand', + MM : '%d maanden', + y : 'één jaar', + yy : '%d jaar' }, + ordinalParse: /\d{1,2}(ste|de)/, ordinal : function (number) { return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); }, @@ -64,4 +67,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return nl; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/nn.js b/rainloop/v/0.0.0/app/localization/moment/nn.js index 8c1510855..cb3307d3d 100644 --- a/rainloop/v/0.0.0/app/localization/moment/nn.js +++ b/rainloop/v/0.0.0/app/localization/moment/nn.js @@ -1,28 +1,28 @@ -// moment.js language configuration -// language : norwegian nynorsk (nn) -// author : https://github.com/mechuwind +//! moment.js locale configuration +//! locale : Nynorsk [nn] +//! author : https://github.com/mechuwind -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('nn', { - months : "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), - weekdays : "sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"), - weekdaysShort : "sun_mån_tys_ons_tor_fre_lau".split("_"), - weekdaysMin : "su_må_ty_on_to_fr_lø".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var nn = moment.defineLocale('nn', { + months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), + monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), + weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'), + weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'), + weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY [kl.] H:mm', + LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' }, calendar : { sameDay: '[I dag klokka] LT', @@ -33,24 +33,28 @@ sameElse: 'L' }, relativeTime : { - future : "om %s", - past : "for %s sidan", - s : "nokre sekund", - m : "eit minutt", - mm : "%d minutt", - h : "ein time", - hh : "%d timar", - d : "ein dag", - dd : "%d dagar", - M : "ein månad", - MM : "%d månader", - y : "eit år", - yy : "%d år" + future : 'om %s', + past : '%s sidan', + s : 'nokre sekund', + m : 'eit minutt', + mm : '%d minutt', + h : 'ein time', + hh : '%d timar', + d : 'ein dag', + dd : '%d dagar', + M : 'ein månad', + MM : '%d månader', + y : 'eit år', + yy : '%d år' }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return nn; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/pl.js b/rainloop/v/0.0.0/app/localization/moment/pl.js index 97770d2ad..0a861d1d6 100644 --- a/rainloop/v/0.0.0/app/localization/moment/pl.js +++ b/rainloop/v/0.0.0/app/localization/moment/pl.js @@ -1,59 +1,62 @@ -// moment.js language configuration -// language : polish (pl) -// author : Rafal Hirsz : https://github.com/evoL +//! moment.js locale configuration +//! locale : Polish [pl] +//! author : Rafal Hirsz : https://github.com/evoL -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var monthsNominative = "styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"), - monthsSubjective = "stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'), + monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_'); function plural(n) { return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1); } - function translate(number, withoutSuffix, key) { - var result = number + " "; + var result = number + ' '; switch (key) { - case 'm': - return withoutSuffix ? 'minuta' : 'minutę'; - case 'mm': - return result + (plural(number) ? 'minuty' : 'minut'); - case 'h': - return withoutSuffix ? 'godzina' : 'godzinę'; - case 'hh': - return result + (plural(number) ? 'godziny' : 'godzin'); - case 'MM': - return result + (plural(number) ? 'miesiące' : 'miesięcy'); - case 'yy': - return result + (plural(number) ? 'lata' : 'lat'); + case 'm': + return withoutSuffix ? 'minuta' : 'minutę'; + case 'mm': + return result + (plural(number) ? 'minuty' : 'minut'); + case 'h': + return withoutSuffix ? 'godzina' : 'godzinę'; + case 'hh': + return result + (plural(number) ? 'godziny' : 'godzin'); + case 'MM': + return result + (plural(number) ? 'miesiące' : 'miesięcy'); + case 'yy': + return result + (plural(number) ? 'lata' : 'lat'); } } - return moment.lang('pl', { + var pl = moment.defineLocale('pl', { months : function (momentToFormat, format) { - if (/D MMMM/.test(format)) { + if (format === '') { + // Hack: if format empty we know this is used to generate + // RegExp by moment. Give then back both valid forms of months + // in RegExp ready format. + return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')'; + } else if (/D MMMM/.test(format)) { return monthsSubjective[momentToFormat.month()]; } else { return monthsNominative[momentToFormat.month()]; } }, - monthsShort : "sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"), - weekdays : "niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"), - weekdaysShort : "nie_pon_wt_śr_czw_pt_sb".split("_"), - weekdaysMin : "N_Pn_Wt_Śr_Cz_Pt_So".split("_"), + monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), + weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'), + weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'), + weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' }, calendar : { sameDay: '[Dziś o] LT', @@ -62,37 +65,41 @@ lastDay: '[Wczoraj o] LT', lastWeek: function () { switch (this.day()) { - case 0: - return '[W zeszłą niedzielę o] LT'; - case 3: - return '[W zeszłą środę o] LT'; - case 6: - return '[W zeszłą sobotę o] LT'; - default: - return '[W zeszły] dddd [o] LT'; + case 0: + return '[W zeszłą niedzielę o] LT'; + case 3: + return '[W zeszłą środę o] LT'; + case 6: + return '[W zeszłą sobotę o] LT'; + default: + return '[W zeszły] dddd [o] LT'; } }, sameElse: 'L' }, relativeTime : { - future : "za %s", - past : "%s temu", - s : "kilka sekund", + future : 'za %s', + past : '%s temu', + s : 'kilka sekund', m : translate, mm : translate, h : translate, hh : translate, - d : "1 dzień", + d : '1 dzień', dd : '%d dni', - M : "miesiąc", + M : 'miesiąc', MM : translate, - y : "rok", + y : 'rok', yy : translate }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return pl; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/pt-br.js b/rainloop/v/0.0.0/app/localization/moment/pt-br.js index 8f142d19e..32272050c 100644 --- a/rainloop/v/0.0.0/app/localization/moment/pt-br.js +++ b/rainloop/v/0.0.0/app/localization/moment/pt-br.js @@ -1,28 +1,29 @@ -// moment.js language configuration -// language : brazilian portuguese (pt-br) -// author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira +//! moment.js locale configuration +//! locale : Portuguese (Brazil) [pt-br] +//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('pt-br', { - months : "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), - monthsShort : "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), - weekdays : "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), - weekdaysShort : "dom_seg_ter_qua_qui_sex_sáb".split("_"), - weekdaysMin : "dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var pt_br = moment.defineLocale('pt-br', { + months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), + monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), + weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'), + weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), + weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [de] YYYY", - LLL : "D [de] MMMM [de] YYYY [às] LT", - LLLL : "dddd, D [de] MMMM [de] YYYY [às] LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D [de] MMMM [de] YYYY', + LLL : 'D [de] MMMM [de] YYYY [às] HH:mm', + LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm' }, calendar : { sameDay: '[Hoje às] LT', @@ -37,20 +38,24 @@ sameElse: 'L' }, relativeTime : { - future : "em %s", - past : "%s atrás", - s : "segundos", - m : "um minuto", - mm : "%d minutos", - h : "uma hora", - hh : "%d horas", - d : "um dia", - dd : "%d dias", - M : "um mês", - MM : "%d meses", - y : "um ano", - yy : "%d anos" + future : 'em %s', + past : '%s atrás', + s : 'poucos segundos', + m : 'um minuto', + mm : '%d minutos', + h : 'uma hora', + hh : '%d horas', + d : 'um dia', + dd : '%d dias', + M : 'um mês', + MM : '%d meses', + y : 'um ano', + yy : '%d anos' }, + ordinalParse: /\d{1,2}º/, ordinal : '%dº' }); -})); + + return pt_br; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/pt.js b/rainloop/v/0.0.0/app/localization/moment/pt.js index a96297e4d..72c2a1bdb 100644 --- a/rainloop/v/0.0.0/app/localization/moment/pt.js +++ b/rainloop/v/0.0.0/app/localization/moment/pt.js @@ -1,28 +1,29 @@ -// moment.js language configuration -// language : portuguese (pt) -// author : Jefferson : https://github.com/jalex79 +//! moment.js locale configuration +//! locale : Portuguese [pt] +//! author : Jefferson : https://github.com/jalex79 -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('pt', { - months : "Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"), - monthsShort : "Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"), - weekdays : "Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"), - weekdaysShort : "Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"), - weekdaysMin : "Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var pt = moment.defineLocale('pt', { + months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), + monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), + weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'), + weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), + weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [de] YYYY", - LLL : "D [de] MMMM [de] YYYY [às] LT", - LLLL : "dddd, D [de] MMMM [de] YYYY [às] LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D [de] MMMM [de] YYYY', + LLL : 'D [de] MMMM [de] YYYY HH:mm', + LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm' }, calendar : { sameDay: '[Hoje às] LT', @@ -37,24 +38,28 @@ sameElse: 'L' }, relativeTime : { - future : "daqui a %s", - past : "%s atrás", - s : "segundos", - m : "um minuto", - mm : "%d minutos", - h : "uma hora", - hh : "%d horas", - d : "um dia", - dd : "%d dias", - M : "um mês", - MM : "%d meses", - y : "um ano", - yy : "%d anos" + future : 'em %s', + past : 'há %s', + s : 'segundos', + m : 'um minuto', + mm : '%d minutos', + h : 'uma hora', + hh : '%d horas', + d : 'um dia', + dd : '%d dias', + M : 'um mês', + MM : '%d meses', + y : 'um ano', + yy : '%d anos' }, + ordinalParse: /\d{1,2}º/, ordinal : '%dº', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return pt; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ro.js b/rainloop/v/0.0.0/app/localization/moment/ro.js index fc2750990..78b325ac3 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ro.js +++ b/rainloop/v/0.0.0/app/localization/moment/ro.js @@ -1,48 +1,48 @@ -// moment.js language configuration -// language : romanian (ro) -// author : Vlad Gurdiga : https://github.com/gurdiga -// author : Valentin Agachi : https://github.com/avaly +//! moment.js locale configuration +//! locale : Romanian [ro] +//! author : Vlad Gurdiga : https://github.com/gurdiga +//! author : Valentin Agachi : https://github.com/avaly + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { - 'mm': 'minute', - 'hh': 'ore', - 'dd': 'zile', - 'MM': 'luni', - 'yy': 'ani' - }, + 'mm': 'minute', + 'hh': 'ore', + 'dd': 'zile', + 'MM': 'luni', + 'yy': 'ani' + }, separator = ' '; if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) { separator = ' de '; } - return number + separator + format[key]; } - return moment.lang('ro', { - months : "ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"), - monthsShort : "ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"), - weekdays : "duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"), - weekdaysShort : "Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"), - weekdaysMin : "Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"), + var ro = moment.defineLocale('ro', { + months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'), + monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'), + monthsParseExact: true, + weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'), + weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'), + weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'), longDateFormat : { - LT : "H:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY H:mm", - LLLL : "dddd, D MMMM YYYY H:mm" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY H:mm', + LLLL : 'dddd, D MMMM YYYY H:mm' }, calendar : { - sameDay: "[azi la] LT", + sameDay: '[azi la] LT', nextDay: '[mâine la] LT', nextWeek: 'dddd [la] LT', lastDay: '[ieri la] LT', @@ -50,18 +50,18 @@ sameElse: 'L' }, relativeTime : { - future : "peste %s", - past : "%s în urmă", - s : "câteva secunde", - m : "un minut", + future : 'peste %s', + past : '%s în urmă', + s : 'câteva secunde', + m : 'un minut', mm : relativeTimeWithPlural, - h : "o oră", + h : 'o oră', hh : relativeTimeWithPlural, - d : "o zi", + d : 'o zi', dd : relativeTimeWithPlural, - M : "o lună", + M : 'o lună', MM : relativeTimeWithPlural, - y : "un an", + y : 'un an', yy : relativeTimeWithPlural }, week : { @@ -69,4 +69,7 @@ doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return ro; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ru.js b/rainloop/v/0.0.0/app/localization/moment/ru.js index ac5400da8..faa3cc2e3 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ru.js +++ b/rainloop/v/0.0.0/app/localization/moment/ru.js @@ -1,22 +1,21 @@ -// moment.js language configuration -// language : russian (ru) -// author : Viktorminator : https://github.com/Viktorminator -// Author : Menelion Elensúle : https://github.com/Oire +//! moment.js locale configuration +//! locale : Russian [ru] +//! author : Viktorminator : https://github.com/Viktorminator +//! Author : Menelion Elensúle : https://github.com/Oire +//! author : Коренберг Марк : https://github.com/socketpair + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function plural(word, num) { var forms = word.split('_'); return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); } - function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', @@ -32,132 +31,153 @@ return number + ' ' + plural(format[key], +number); } } + var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') + // http://new.gramota.ru/spravka/rules/139-prop : § 103 + // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637 + // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753 + var ru = moment.defineLocale('ru', { + months : { + format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'), + standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_') }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function monthsShortCaseReplace(m, format) { - var monthsShort = { - 'nominative': 'янв_фев_мар_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') + monthsShort : { + // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ? + format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'), + standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_') }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return monthsShort[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_') + weekdays : { + standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), + format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'), + isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ }, + weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), + weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), + monthsParse : monthsParse, + longMonthsParse : monthsParse, + shortMonthsParse : monthsParse, - nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; + // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки + monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, - return weekdays[nounCase][m.day()]; - } + // копия предыдущего + monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, - return moment.lang('ru', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : "вс_пн_вт_ср_чт_пт_сб".split("_"), - weekdaysMin : "вс_пн_вт_ср_чт_пт_сб".split("_"), - monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i], + // полные названия с падежами + monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i, + + // Выражение, которое соотвествует только сокращённым формам + monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i, longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY г.", - LLL : "D MMMM YYYY г., LT", - LLLL : "dddd, D MMMM YYYY г., LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY г.', + LLL : 'D MMMM YYYY г., HH:mm', + LLLL : 'dddd, D MMMM YYYY г., HH:mm' }, calendar : { sameDay: '[Сегодня в] LT', nextDay: '[Завтра в] LT', lastDay: '[Вчера в] LT', - nextWeek: function () { - return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; + nextWeek: function (now) { + if (now.week() !== this.week()) { + switch (this.day()) { + case 0: + return '[В следующее] dddd [в] LT'; + case 1: + case 2: + case 4: + return '[В следующий] dddd [в] LT'; + case 3: + case 5: + case 6: + return '[В следующую] dddd [в] LT'; + } + } else { + if (this.day() === 2) { + return '[Во] dddd [в] LT'; + } else { + return '[В] dddd [в] LT'; + } + } }, - lastWeek: function () { - switch (this.day()) { - case 0: - return '[В прошлое] dddd [в] LT'; - case 1: - case 2: - case 4: - return '[В прошлый] dddd [в] LT'; - case 3: - case 5: - case 6: - return '[В прошлую] dddd [в] LT'; + lastWeek: function (now) { + if (now.week() !== this.week()) { + switch (this.day()) { + case 0: + return '[В прошлое] dddd [в] LT'; + case 1: + case 2: + case 4: + return '[В прошлый] dddd [в] LT'; + case 3: + case 5: + case 6: + return '[В прошлую] dddd [в] LT'; + } + } else { + if (this.day() === 2) { + return '[Во] dddd [в] LT'; + } else { + return '[В] dddd [в] LT'; + } } }, sameElse: 'L' }, relativeTime : { - future : "через %s", - past : "%s назад", - s : "несколько секунд", + future : 'через %s', + past : '%s назад', + s : 'несколько секунд', m : relativeTimeWithPlural, mm : relativeTimeWithPlural, - h : "час", + h : 'час', hh : relativeTimeWithPlural, - d : "день", + d : 'день', dd : relativeTimeWithPlural, - M : "месяц", + M : 'месяц', MM : relativeTimeWithPlural, - y : "год", + y : 'год', yy : relativeTimeWithPlural }, - - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - + meridiemParse: /ночи|утра|дня|вечера/i, + isPM : function (input) { + return /^(дня|вечера)$/.test(input); + }, meridiem : function (hour, minute, isLower) { if (hour < 4) { - return "ночи"; + return 'ночи'; } else if (hour < 12) { - return "утра"; + return 'утра'; } else if (hour < 17) { - return "дня"; + return 'дня'; } else { - return "вечера"; + return 'вечера'; } }, - + ordinalParse: /\d{1,2}-(й|го|я)/, ordinal: function (number, period) { switch (period) { - case 'M': - case 'd': - case 'DDD': - return number + '-й'; - case 'D': - return number + '-го'; - case 'w': - case 'W': - return number + '-я'; - default: - return number; + case 'M': + case 'd': + case 'DDD': + return number + '-й'; + case 'D': + return number + '-го'; + case 'w': + case 'W': + return number + '-я'; + default: + return number; } }, - week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return ru; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/sk.js b/rainloop/v/0.0.0/app/localization/moment/sk.js index ed8a41d48..582ae7ee6 100644 --- a/rainloop/v/0.0.0/app/localization/moment/sk.js +++ b/rainloop/v/0.0.0/app/localization/moment/sk.js @@ -1,140 +1,130 @@ -// moment.js language configuration -// language : slovak (sk) -// author : Martin Minka : https://github.com/k2s -// based on work of petrbela : https://github.com/petrbela +//! moment.js locale configuration +//! locale : Slovak [sk] +//! author : Martin Minka : https://github.com/k2s +//! based on work of petrbela : https://github.com/petrbela -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var months = "január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"), - monthsShort = "jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'), + monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'); function plural(n) { return (n > 1) && (n < 5); } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; + var result = number + ' '; switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minúty' : 'minút'); - } else { - return result + 'minútami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodín'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'deň' : 'dňom'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dni' : 'dní'); - } else { - return result + 'dňami'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'mesiace' : 'mesiacov'); - } else { - return result + 'mesiacmi'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokom'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'rokov'); - } else { - return result + 'rokmi'; - } - break; + case 's': // a few seconds / in a few seconds / a few seconds ago + return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami'; + case 'm': // a minute / in a minute / a minute ago + return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou'); + case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'minúty' : 'minút'); + } else { + return result + 'minútami'; + } + break; + case 'h': // an hour / in an hour / an hour ago + return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); + case 'hh': // 9 hours / in 9 hours / 9 hours ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'hodiny' : 'hodín'); + } else { + return result + 'hodinami'; + } + break; + case 'd': // a day / in a day / a day ago + return (withoutSuffix || isFuture) ? 'deň' : 'dňom'; + case 'dd': // 9 days / in 9 days / 9 days ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'dni' : 'dní'); + } else { + return result + 'dňami'; + } + break; + case 'M': // a month / in a month / a month ago + return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom'; + case 'MM': // 9 months / in 9 months / 9 months ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'mesiace' : 'mesiacov'); + } else { + return result + 'mesiacmi'; + } + break; + case 'y': // a year / in a year / a year ago + return (withoutSuffix || isFuture) ? 'rok' : 'rokom'; + case 'yy': // 9 years / in 9 years / 9 years ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'roky' : 'rokov'); + } else { + return result + 'rokmi'; + } + break; } } - return moment.lang('sk', { + var sk = moment.defineLocale('sk', { months : months, monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), - weekdays : "nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"), - weekdaysShort : "ne_po_ut_st_št_pi_so".split("_"), - weekdaysMin : "ne_po_ut_st_št_pi_so".split("_"), + weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), + weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'), + weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'), longDateFormat : { - LT: "H:mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd D. MMMM YYYY LT" + LT: 'H:mm', + LTS : 'H:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY H:mm', + LLLL : 'dddd D. MMMM YYYY H:mm' }, calendar : { - sameDay: "[dnes o] LT", + sameDay: '[dnes o] LT', nextDay: '[zajtra o] LT', nextWeek: function () { switch (this.day()) { - case 0: - return '[v nedeľu o] LT'; - case 1: - case 2: - return '[v] dddd [o] LT'; - case 3: - return '[v stredu o] LT'; - case 4: - return '[vo štvrtok o] LT'; - case 5: - return '[v piatok o] LT'; - case 6: - return '[v sobotu o] LT'; + case 0: + return '[v nedeľu o] LT'; + case 1: + case 2: + return '[v] dddd [o] LT'; + case 3: + return '[v stredu o] LT'; + case 4: + return '[vo štvrtok o] LT'; + case 5: + return '[v piatok o] LT'; + case 6: + return '[v sobotu o] LT'; } }, lastDay: '[včera o] LT', lastWeek: function () { switch (this.day()) { - case 0: - return '[minulú nedeľu o] LT'; - case 1: - case 2: - return '[minulý] dddd [o] LT'; - case 3: - return '[minulú stredu o] LT'; - case 4: - case 5: - return '[minulý] dddd [o] LT'; - case 6: - return '[minulú sobotu o] LT'; + case 0: + return '[minulú nedeľu o] LT'; + case 1: + case 2: + return '[minulý] dddd [o] LT'; + case 3: + return '[minulú stredu o] LT'; + case 4: + case 5: + return '[minulý] dddd [o] LT'; + case 6: + return '[minulú sobotu o] LT'; } }, - sameElse: "L" + sameElse: 'L' }, relativeTime : { - future : "za %s", - past : "pred %s", + future : 'za %s', + past : 'pred %s', s : translate, m : translate, mm : translate, @@ -147,10 +137,14 @@ y : translate, yy : translate }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return sk; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/sl.js b/rainloop/v/0.0.0/app/localization/moment/sl.js index d260f80d9..9015e9198 100644 --- a/rainloop/v/0.0.0/app/localization/moment/sl.js +++ b/rainloop/v/0.0.0/app/localization/moment/sl.js @@ -1,89 +1,101 @@ -// moment.js language configuration -// language : slovenian (sl) -// author : Robert Sedovšek : https://github.com/sedovsek +//! moment.js locale configuration +//! locale : Slovenian [sl] +//! author : Robert Sedovšek : https://github.com/sedovsek -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function translate(number, withoutSuffix, key) { - var result = number + " "; +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + function processRelativeTime(number, withoutSuffix, key, isFuture) { + var result = number + ' '; switch (key) { - case 'm': - return withoutSuffix ? 'ena minuta' : 'eno minuto'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2) { - result += 'minuti'; - } else if (number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minut'; - } - return result; - case 'h': - return withoutSuffix ? 'ena ura' : 'eno uro'; - case 'hh': - if (number === 1) { - result += 'ura'; - } else if (number === 2) { - result += 'uri'; - } else if (number === 3 || number === 4) { - result += 'ure'; - } else { - result += 'ur'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dni'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mesec'; - } else if (number === 2) { - result += 'meseca'; - } else if (number === 3 || number === 4) { - result += 'mesece'; - } else { - result += 'mesecev'; - } - return result; - case 'yy': - if (number === 1) { - result += 'leto'; - } else if (number === 2) { - result += 'leti'; - } else if (number === 3 || number === 4) { - result += 'leta'; - } else { - result += 'let'; - } - return result; + case 's': + return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami'; + case 'm': + return withoutSuffix ? 'ena minuta' : 'eno minuto'; + case 'mm': + if (number === 1) { + result += withoutSuffix ? 'minuta' : 'minuto'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'minuti' : 'minutama'; + } else if (number < 5) { + result += withoutSuffix || isFuture ? 'minute' : 'minutami'; + } else { + result += withoutSuffix || isFuture ? 'minut' : 'minutami'; + } + return result; + case 'h': + return withoutSuffix ? 'ena ura' : 'eno uro'; + case 'hh': + if (number === 1) { + result += withoutSuffix ? 'ura' : 'uro'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'uri' : 'urama'; + } else if (number < 5) { + result += withoutSuffix || isFuture ? 'ure' : 'urami'; + } else { + result += withoutSuffix || isFuture ? 'ur' : 'urami'; + } + return result; + case 'd': + return withoutSuffix || isFuture ? 'en dan' : 'enim dnem'; + case 'dd': + if (number === 1) { + result += withoutSuffix || isFuture ? 'dan' : 'dnem'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'dni' : 'dnevoma'; + } else { + result += withoutSuffix || isFuture ? 'dni' : 'dnevi'; + } + return result; + case 'M': + return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem'; + case 'MM': + if (number === 1) { + result += withoutSuffix || isFuture ? 'mesec' : 'mesecem'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'meseca' : 'mesecema'; + } else if (number < 5) { + result += withoutSuffix || isFuture ? 'mesece' : 'meseci'; + } else { + result += withoutSuffix || isFuture ? 'mesecev' : 'meseci'; + } + return result; + case 'y': + return withoutSuffix || isFuture ? 'eno leto' : 'enim letom'; + case 'yy': + if (number === 1) { + result += withoutSuffix || isFuture ? 'leto' : 'letom'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'leti' : 'letoma'; + } else if (number < 5) { + result += withoutSuffix || isFuture ? 'leta' : 'leti'; + } else { + result += withoutSuffix || isFuture ? 'let' : 'leti'; + } + return result; } } - return moment.lang('sl', { - months : "januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"), - monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"), - weekdays : "nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"), - weekdaysShort : "ned._pon._tor._sre._čet._pet._sob.".split("_"), - weekdaysMin : "ne_po_to_sr_če_pe_so".split("_"), + var sl = moment.defineLocale('sl', { + months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'), + monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'), + monthsParseExact: true, + weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'), + weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'), + weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" + LT : 'H:mm', + LTS : 'H:mm:ss', + L : 'DD. MM. YYYY', + LL : 'D. MMMM YYYY', + LLL : 'D. MMMM YYYY H:mm', + LLLL : 'dddd, D. MMMM YYYY H:mm' }, calendar : { sameDay : '[danes ob] LT', @@ -91,54 +103,60 @@ nextWeek : function () { switch (this.day()) { - case 0: - return '[v] [nedeljo] [ob] LT'; - case 3: - return '[v] [sredo] [ob] LT'; - case 6: - return '[v] [soboto] [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[v] dddd [ob] LT'; + case 0: + return '[v] [nedeljo] [ob] LT'; + case 3: + return '[v] [sredo] [ob] LT'; + case 6: + return '[v] [soboto] [ob] LT'; + case 1: + case 2: + case 4: + case 5: + return '[v] dddd [ob] LT'; } }, lastDay : '[včeraj ob] LT', lastWeek : function () { switch (this.day()) { - case 0: - case 3: - case 6: - return '[prejšnja] dddd [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prejšnji] dddd [ob] LT'; + case 0: + return '[prejšnjo] [nedeljo] [ob] LT'; + case 3: + return '[prejšnjo] [sredo] [ob] LT'; + case 6: + return '[prejšnjo] [soboto] [ob] LT'; + case 1: + case 2: + case 4: + case 5: + return '[prejšnji] dddd [ob] LT'; } }, sameElse : 'L' }, relativeTime : { - future : "čez %s", - past : "%s nazaj", - s : "nekaj sekund", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "en dan", - dd : translate, - M : "en mesec", - MM : translate, - y : "eno leto", - yy : translate + future : 'čez %s', + past : 'pred %s', + s : processRelativeTime, + m : processRelativeTime, + mm : processRelativeTime, + h : processRelativeTime, + hh : processRelativeTime, + d : processRelativeTime, + dd : processRelativeTime, + M : processRelativeTime, + MM : processRelativeTime, + y : processRelativeTime, + yy : processRelativeTime }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return sl; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/sq.js b/rainloop/v/0.0.0/app/localization/moment/sq.js index 0d3cdcf7c..6fa245519 100644 --- a/rainloop/v/0.0.0/app/localization/moment/sq.js +++ b/rainloop/v/0.0.0/app/localization/moment/sq.js @@ -1,33 +1,38 @@ -// moment.js language configuration -// language : Albanian (sq) -// author : Flakërim Ismani : https://github.com/flakerimi -// author: Menelion Elensúle: https://github.com/Oire (tests) -// author : Oerd Cukalla : https://github.com/oerd (fixes) +//! moment.js locale configuration +//! locale : Albanian [sq] +//! author : Flakërim Ismani : https://github.com/flakerimi +//! author: Menelion Elensúle: https://github.com/Oire (tests) +//! author : Oerd Cukalla : https://github.com/oerd (fixes) -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('sq', { - months : "Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"), - monthsShort : "Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"), - weekdays : "E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"), - weekdaysShort : "Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"), - weekdaysMin : "D_H_Ma_Më_E_P_Sh".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var sq = moment.defineLocale('sq', { + months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'), + monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'), + weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'), + weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'), + weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'), + weekdaysParseExact : true, + meridiemParse: /PD|MD/, + isPM: function (input) { + return input.charAt(0) === 'M'; + }, meridiem : function (hours, minutes, isLower) { return hours < 12 ? 'PD' : 'MD'; }, longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' }, calendar : { sameDay : '[Sot në] LT', @@ -38,24 +43,28 @@ sameElse : 'L' }, relativeTime : { - future : "në %s", - past : "%s më parë", - s : "disa sekonda", - m : "një minutë", - mm : "%d minuta", - h : "një orë", - hh : "%d orë", - d : "një ditë", - dd : "%d ditë", - M : "një muaj", - MM : "%d muaj", - y : "një vit", - yy : "%d vite" + future : 'në %s', + past : '%s më parë', + s : 'disa sekonda', + m : 'një minutë', + mm : '%d minuta', + h : 'një orë', + hh : '%d orë', + d : 'një ditë', + dd : '%d ditë', + M : 'një muaj', + MM : '%d muaj', + y : 'një vit', + yy : '%d vite' }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return sq; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/sr-cyrl.js b/rainloop/v/0.0.0/app/localization/moment/sr-cyrl.js index ae1754b34..943d57c42 100644 --- a/rainloop/v/0.0.0/app/localization/moment/sr-cyrl.js +++ b/rainloop/v/0.0.0/app/localization/moment/sr-cyrl.js @@ -1,16 +1,14 @@ -// moment.js language configuration -// language : Serbian-cyrillic (sr-cyrl) -// author : Milan Janačković : https://github.com/milan-j +//! moment.js locale configuration +//! locale : Serbian Cyrillic [sr-cyrl] +//! author : Milan Janačković : https://github.com/milan-j + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var translator = { words: { //Different grammatical cases @@ -35,36 +33,38 @@ } }; - return moment.lang('sr-cyrl', { - months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], - monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], - weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], - weekdaysShort: ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], - weekdaysMin: ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], + var sr_cyrl = moment.defineLocale('sr-cyrl', { + months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'), + monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'), + monthsParseExact: true, + weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'), + weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'), + weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'), + weekdaysParseExact : true, longDateFormat: { - LT: "H:mm", - L: "DD. MM. YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" + LT: 'H:mm', + LTS : 'H:mm:ss', + L: 'DD. MM. YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd, D. MMMM YYYY H:mm' }, calendar: { sameDay: '[данас у] LT', nextDay: '[сутра у] LT', - nextWeek: function () { switch (this.day()) { - case 0: - return '[у] [недељу] [у] LT'; - case 3: - return '[у] [среду] [у] LT'; - case 6: - return '[у] [суботу] [у] LT'; - case 1: - case 2: - case 4: - case 5: - return '[у] dddd [у] LT'; + case 0: + return '[у] [недељу] [у] LT'; + case 3: + return '[у] [среду] [у] LT'; + case 6: + return '[у] [суботу] [у] LT'; + case 1: + case 2: + case 4: + case 5: + return '[у] dddd [у] LT'; } }, lastDay : '[јуче у] LT', @@ -83,24 +83,28 @@ sameElse : 'L' }, relativeTime : { - future : "за %s", - past : "пре %s", - s : "неколико секунди", + future : 'за %s', + past : 'пре %s', + s : 'неколико секунди', m : translator.translate, mm : translator.translate, h : translator.translate, hh : translator.translate, - d : "дан", + d : 'дан', dd : translator.translate, - M : "месец", + M : 'месец', MM : translator.translate, - y : "годину", + y : 'годину', yy : translator.translate }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return sr_cyrl; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/sr.js b/rainloop/v/0.0.0/app/localization/moment/sr.js index 54a5f4f6e..a1f0ccb77 100644 --- a/rainloop/v/0.0.0/app/localization/moment/sr.js +++ b/rainloop/v/0.0.0/app/localization/moment/sr.js @@ -1,16 +1,14 @@ -// moment.js language configuration -// language : Serbian-latin (sr) -// author : Milan Janačković : https://github.com/milan-j +//! moment.js locale configuration +//! locale : Serbian [sr] +//! author : Milan Janačković : https://github.com/milan-j + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var translator = { words: { //Different grammatical cases @@ -35,36 +33,38 @@ } }; - return moment.lang('sr', { - months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], - monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], - weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], - weekdaysShort: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], - weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], + var sr = moment.defineLocale('sr', { + months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'), + monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'), + monthsParseExact: true, + weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'), + weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'), + weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), + weekdaysParseExact : true, longDateFormat: { - LT: "H:mm", - L: "DD. MM. YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" + LT: 'H:mm', + LTS : 'H:mm:ss', + L: 'DD. MM. YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd, D. MMMM YYYY H:mm' }, calendar: { sameDay: '[danas u] LT', nextDay: '[sutra u] LT', - nextWeek: function () { switch (this.day()) { - case 0: - return '[u] [nedelju] [u] LT'; - case 3: - return '[u] [sredu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; + case 0: + return '[u] [nedelju] [u] LT'; + case 3: + return '[u] [sredu] [u] LT'; + case 6: + return '[u] [subotu] [u] LT'; + case 1: + case 2: + case 4: + case 5: + return '[u] dddd [u] LT'; } }, lastDay : '[juče u] LT', @@ -83,24 +83,28 @@ sameElse : 'L' }, relativeTime : { - future : "za %s", - past : "pre %s", - s : "nekoliko sekundi", + future : 'za %s', + past : 'pre %s', + s : 'nekoliko sekundi', m : translator.translate, mm : translator.translate, h : translator.translate, hh : translator.translate, - d : "dan", + d : 'dan', dd : translator.translate, - M : "mesec", + M : 'mesec', MM : translator.translate, - y : "godinu", + y : 'godinu', yy : translator.translate }, + ordinalParse: /\d{1,2}\./, ordinal : '%d.', week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return sr; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/sv.js b/rainloop/v/0.0.0/app/localization/moment/sv.js index 0de8c40ba..a77c3e107 100644 --- a/rainloop/v/0.0.0/app/localization/moment/sv.js +++ b/rainloop/v/0.0.0/app/localization/moment/sv.js @@ -1,55 +1,58 @@ -// moment.js language configuration -// language : swedish (sv) -// author : Jens Alm : https://github.com/ulmus +//! moment.js locale configuration +//! locale : Swedish [sv] +//! author : Jens Alm : https://github.com/ulmus -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('sv', { - months : "januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), - weekdays : "söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"), - weekdaysShort : "sön_mån_tis_ons_tor_fre_lör".split("_"), - weekdaysMin : "sö_må_ti_on_to_fr_lö".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var sv = moment.defineLocale('sv', { + months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'), + monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), + weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'), + weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'), + weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'YYYY-MM-DD', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY [kl.] HH:mm', + LLLL : 'dddd D MMMM YYYY [kl.] HH:mm', + lll : 'D MMM YYYY HH:mm', + llll : 'ddd D MMM YYYY HH:mm' }, calendar : { sameDay: '[Idag] LT', nextDay: '[Imorgon] LT', lastDay: '[Igår] LT', - nextWeek: 'dddd LT', - lastWeek: '[Förra] dddd[en] LT', + nextWeek: '[På] dddd LT', + lastWeek: '[I] dddd[s] LT', sameElse: 'L' }, relativeTime : { - future : "om %s", - past : "för %s sedan", - s : "några sekunder", - m : "en minut", - mm : "%d minuter", - h : "en timme", - hh : "%d timmar", - d : "en dag", - dd : "%d dagar", - M : "en månad", - MM : "%d månader", - y : "ett år", - yy : "%d år" + future : 'om %s', + past : 'för %s sedan', + s : 'några sekunder', + m : 'en minut', + mm : '%d minuter', + h : 'en timme', + hh : '%d timmar', + d : 'en dag', + dd : '%d dagar', + M : 'en månad', + MM : '%d månader', + y : 'ett år', + yy : '%d år' }, + ordinalParse: /\d{1,2}(e|a)/, ordinal : function (number) { var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'e' : + output = (~~(number % 100 / 10) === 1) ? 'e' : (b === 1) ? 'a' : (b === 2) ? 'a' : (b === 3) ? 'e' : 'e'; @@ -60,4 +63,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return sv; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ta.js b/rainloop/v/0.0.0/app/localization/moment/ta.js index cc742c989..c04fa587b 100644 --- a/rainloop/v/0.0.0/app/localization/moment/ta.js +++ b/rainloop/v/0.0.0/app/localization/moment/ta.js @@ -1,53 +1,52 @@ -// moment.js language configuration -// language : tamil (ta) -// author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 +//! moment.js locale configuration +//! locale : Tamil [ta] +//! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - /*var symbolMap = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦' - }, - numberMap = { - '௧': '1', - '௨': '2', - '௩': '3', - '௪': '4', - '௫': '5', - '௬': '6', - '௭': '7', - '௮': '8', - '௯': '9', - '௦': '0' - }; */ +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; - return moment.lang('ta', { - months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split("_"), - monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split("_"), - weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split("_"), - weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split("_"), - weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split("_"), + + var symbolMap = { + '1': '௧', + '2': '௨', + '3': '௩', + '4': '௪', + '5': '௫', + '6': '௬', + '7': '௭', + '8': '௮', + '9': '௯', + '0': '௦' + }, numberMap = { + '௧': '1', + '௨': '2', + '௩': '3', + '௪': '4', + '௫': '5', + '௬': '6', + '௭': '7', + '௮': '8', + '௯': '9', + '௦': '0' + }; + + var ta = moment.defineLocale('ta', { + months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), + monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), + weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'), + weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'), + weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, HH:mm', + LLLL : 'dddd, D MMMM YYYY, HH:mm' }, calendar : { sameDay : '[இன்று] LT', @@ -58,21 +57,25 @@ sameElse : 'L' }, relativeTime : { - future : "%s இல்", - past : "%s முன்", - s : "ஒரு சில விநாடிகள்", - m : "ஒரு நிமிடம்", - mm : "%d நிமிடங்கள்", - h : "ஒரு மணி நேரம்", - hh : "%d மணி நேரம்", - d : "ஒரு நாள்", - dd : "%d நாட்கள்", - M : "ஒரு மாதம்", - MM : "%d மாதங்கள்", - y : "ஒரு வருடம்", - yy : "%d ஆண்டுகள்" + future : '%s இல்', + past : '%s முன்', + s : 'ஒரு சில விநாடிகள்', + m : 'ஒரு நிமிடம்', + mm : '%d நிமிடங்கள்', + h : 'ஒரு மணி நேரம்', + hh : '%d மணி நேரம்', + d : 'ஒரு நாள்', + dd : '%d நாட்கள்', + M : 'ஒரு மாதம்', + MM : '%d மாதங்கள்', + y : 'ஒரு வருடம்', + yy : '%d ஆண்டுகள்' }, -/* preparse: function (string) { + ordinalParse: /\d{1,2}வது/, + ordinal : function (number) { + return number + 'வது'; + }, + preparse: function (string) { return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { return numberMap[match]; }); @@ -81,27 +84,38 @@ return string.replace(/\d/g, function (match) { return symbolMap[match]; }); - },*/ - ordinal : function (number) { - return number + 'வது'; }, - - -// refer http://ta.wikipedia.org/s/1er1 - + // refer http://ta.wikipedia.org/s/1er1 + meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, meridiem : function (hour, minute, isLower) { - if (hour >= 6 && hour <= 10) { - return " காலை"; - } else if (hour >= 10 && hour <= 14) { - return " நண்பகல்"; - } else if (hour >= 14 && hour <= 18) { - return " எற்பாடு"; - } else if (hour >= 18 && hour <= 20) { - return " மாலை"; - } else if (hour >= 20 && hour <= 24) { - return " இரவு"; - } else if (hour >= 0 && hour <= 6) { - return " வைகறை"; + if (hour < 2) { + return ' யாமம்'; + } else if (hour < 6) { + return ' வைகறை'; // வைகறை + } else if (hour < 10) { + return ' காலை'; // காலை + } else if (hour < 14) { + return ' நண்பகல்'; // நண்பகல் + } else if (hour < 18) { + return ' எற்பாடு'; // எற்பாடு + } else if (hour < 22) { + return ' மாலை'; // மாலை + } else { + return ' யாமம்'; + } + }, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'யாமம்') { + return hour < 2 ? hour : hour + 12; + } else if (meridiem === 'வைகறை' || meridiem === 'காலை') { + return hour; + } else if (meridiem === 'நண்பகல்') { + return hour >= 10 ? hour : hour + 12; + } else { + return hour + 12; } }, week : { @@ -109,4 +123,7 @@ doy : 6 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return ta; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/th.js b/rainloop/v/0.0.0/app/localization/moment/th.js index 70336c87e..4d3c2784c 100644 --- a/rainloop/v/0.0.0/app/localization/moment/th.js +++ b/rainloop/v/0.0.0/app/localization/moment/th.js @@ -1,34 +1,40 @@ -// moment.js language configuration -// language : thai (th) -// author : Kridsada Thanabulpong : https://github.com/sirn +//! moment.js locale configuration +//! locale : Thai [th] +//! author : Kridsada Thanabulpong : https://github.com/sirn -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('th', { - months : "มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"), - monthsShort : "มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"), - weekdays : "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"), - weekdaysShort : "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"), // yes, three characters difference - weekdaysMin : "อา._จ._อ._พ._พฤ._ศ._ส.".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var th = moment.defineLocale('th', { + months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'), + monthsShort : 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'), + monthsParseExact: true, + weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'), + weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference + weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'), + weekdaysParseExact : true, longDateFormat : { - LT : "H นาฬิกา m นาที", - L : "YYYY/MM/DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY เวลา LT", - LLLL : "วันddddที่ D MMMM YYYY เวลา LT" + LT : 'H นาฬิกา m นาที', + LTS : 'H นาฬิกา m นาที s วินาที', + L : 'YYYY/MM/DD', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY เวลา H นาฬิกา m นาที', + LLLL : 'วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที' + }, + meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/, + isPM: function (input) { + return input === 'หลังเที่ยง'; }, meridiem : function (hour, minute, isLower) { if (hour < 12) { - return "ก่อนเที่ยง"; + return 'ก่อนเที่ยง'; } else { - return "หลังเที่ยง"; + return 'หลังเที่ยง'; } }, calendar : { @@ -40,19 +46,22 @@ sameElse : 'L' }, relativeTime : { - future : "อีก %s", - past : "%sที่แล้ว", - s : "ไม่กี่วินาที", - m : "1 นาที", - mm : "%d นาที", - h : "1 ชั่วโมง", - hh : "%d ชั่วโมง", - d : "1 วัน", - dd : "%d วัน", - M : "1 เดือน", - MM : "%d เดือน", - y : "1 ปี", - yy : "%d ปี" + future : 'อีก %s', + past : '%sที่แล้ว', + s : 'ไม่กี่วินาที', + m : '1 นาที', + mm : '%d นาที', + h : '1 ชั่วโมง', + hh : '%d ชั่วโมง', + d : '1 วัน', + dd : '%d วัน', + M : '1 เดือน', + MM : '%d เดือน', + y : '1 ปี', + yy : '%d ปี' } }); -})); + + return th; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/tl-ph.js b/rainloop/v/0.0.0/app/localization/moment/tl-ph.js index 804448306..48d2dc869 100644 --- a/rainloop/v/0.0.0/app/localization/moment/tl-ph.js +++ b/rainloop/v/0.0.0/app/localization/moment/tl-ph.js @@ -1,31 +1,31 @@ -// moment.js language configuration -// language : Tagalog/Filipino (tl-ph) -// author : Dan Hagman +//! moment.js locale configuration +//! locale : Tagalog (Philippines) [tl-ph] +//! author : Dan Hagman -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('tl-ph', { - months : "Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"), - monthsShort : "Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"), - weekdays : "Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"), - weekdaysShort : "Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"), - weekdaysMin : "Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var tl_ph = moment.defineLocale('tl-ph', { + months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'), + monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'), + weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'), + weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'), + weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "MM/D/YYYY", - LL : "MMMM D, YYYY", - LLL : "MMMM D, YYYY LT", - LLLL : "dddd, MMMM DD, YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'MM/D/YYYY', + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY HH:mm', + LLLL : 'dddd, MMMM DD, YYYY HH:mm' }, calendar : { - sameDay: "[Ngayon sa] LT", + sameDay: '[Ngayon sa] LT', nextDay: '[Bukas sa] LT', nextWeek: 'dddd [sa] LT', lastDay: '[Kahapon sa] LT', @@ -33,20 +33,21 @@ sameElse: 'L' }, relativeTime : { - future : "sa loob ng %s", - past : "%s ang nakalipas", - s : "ilang segundo", - m : "isang minuto", - mm : "%d minuto", - h : "isang oras", - hh : "%d oras", - d : "isang araw", - dd : "%d araw", - M : "isang buwan", - MM : "%d buwan", - y : "isang taon", - yy : "%d taon" + future : 'sa loob ng %s', + past : '%s ang nakalipas', + s : 'ilang segundo', + m : 'isang minuto', + mm : '%d minuto', + h : 'isang oras', + hh : '%d oras', + d : 'isang araw', + dd : '%d araw', + M : 'isang buwan', + MM : '%d buwan', + y : 'isang taon', + yy : '%d taon' }, + ordinalParse: /\d{1,2}/, ordinal : function (number) { return number; }, @@ -55,4 +56,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return tl_ph; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/tr.js b/rainloop/v/0.0.0/app/localization/moment/tr.js index e90f250e5..c88ed7eed 100644 --- a/rainloop/v/0.0.0/app/localization/moment/tr.js +++ b/rainloop/v/0.0.0/app/localization/moment/tr.js @@ -1,56 +1,50 @@ -// moment.js language configuration -// language : turkish (tr) -// authors : Erhan Gundogan : https://github.com/erhangundogan, -// Burak Yiğit Kaya: https://github.com/BYK +//! moment.js locale configuration +//! locale : Turkish [tr] +//! authors : Erhan Gundogan : https://github.com/erhangundogan, +//! Burak Yiğit Kaya: https://github.com/BYK + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { var suffixes = { - 1: "'inci", - 5: "'inci", - 8: "'inci", - 70: "'inci", - 80: "'inci", - - 2: "'nci", - 7: "'nci", - 20: "'nci", - 50: "'nci", - - 3: "'üncü", - 4: "'üncü", - 100: "'üncü", - - 6: "'ncı", - - 9: "'uncu", - 10: "'uncu", - 30: "'uncu", - - 60: "'ıncı", - 90: "'ıncı" + 1: '\'inci', + 5: '\'inci', + 8: '\'inci', + 70: '\'inci', + 80: '\'inci', + 2: '\'nci', + 7: '\'nci', + 20: '\'nci', + 50: '\'nci', + 3: '\'üncü', + 4: '\'üncü', + 100: '\'üncü', + 6: '\'ncı', + 9: '\'uncu', + 10: '\'uncu', + 30: '\'uncu', + 60: '\'ıncı', + 90: '\'ıncı' }; - return moment.lang('tr', { - months : "Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"), - monthsShort : "Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"), - weekdays : "Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"), - weekdaysShort : "Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"), - weekdaysMin : "Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"), + var tr = moment.defineLocale('tr', { + months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'), + monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'), + weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'), + weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'), + weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd, D MMMM YYYY HH:mm' }, calendar : { sameDay : '[bugün saat] LT', @@ -61,28 +55,28 @@ sameElse : 'L' }, relativeTime : { - future : "%s sonra", - past : "%s önce", - s : "birkaç saniye", - m : "bir dakika", - mm : "%d dakika", - h : "bir saat", - hh : "%d saat", - d : "bir gün", - dd : "%d gün", - M : "bir ay", - MM : "%d ay", - y : "bir yıl", - yy : "%d yıl" + future : '%s sonra', + past : '%s önce', + s : 'birkaç saniye', + m : 'bir dakika', + mm : '%d dakika', + h : 'bir saat', + hh : '%d saat', + d : 'bir gün', + dd : '%d gün', + M : 'bir ay', + MM : '%d ay', + y : 'bir yıl', + yy : '%d yıl' }, + ordinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/, ordinal : function (number) { if (number === 0) { // special case for zero - return number + "'ıncı"; + return number + '\'ıncı'; } var a = number % 10, b = number % 100 - a, c = number >= 100 ? 100 : null; - return number + (suffixes[a] || suffixes[b] || suffixes[c]); }, week : { @@ -90,4 +84,7 @@ doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return tr; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/tzm-latn.js b/rainloop/v/0.0.0/app/localization/moment/tzm-latn.js index f7e908977..ccf96b992 100644 --- a/rainloop/v/0.0.0/app/localization/moment/tzm-latn.js +++ b/rainloop/v/0.0.0/app/localization/moment/tzm-latn.js @@ -1,31 +1,31 @@ -// moment.js language configuration -// language : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn) -// author : Abdel Said : https://github.com/abdelsaid +//! moment.js locale configuration +//! locale : Central Atlas Tamazight Latin [tzm-latn] +//! author : Abdel Said : https://github.com/abdelsaid -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('tzm-latn', { - months : "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), - monthsShort : "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), - weekdays : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - weekdaysShort : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - weekdaysMin : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var tzm_latn = moment.defineLocale('tzm-latn', { + months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), + monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), + weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), + weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), + weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' }, calendar : { - sameDay: "[asdkh g] LT", + sameDay: '[asdkh g] LT', nextDay: '[aska g] LT', nextWeek: 'dddd [g] LT', lastDay: '[assant g] LT', @@ -33,23 +33,26 @@ sameElse: 'L' }, relativeTime : { - future : "dadkh s yan %s", - past : "yan %s", - s : "imik", - m : "minuḍ", - mm : "%d minuḍ", - h : "saɛa", - hh : "%d tassaɛin", - d : "ass", - dd : "%d ossan", - M : "ayowr", - MM : "%d iyyirn", - y : "asgas", - yy : "%d isgasn" + future : 'dadkh s yan %s', + past : 'yan %s', + s : 'imik', + m : 'minuḍ', + mm : '%d minuḍ', + h : 'saɛa', + hh : '%d tassaɛin', + d : 'ass', + dd : '%d ossan', + M : 'ayowr', + MM : '%d iyyirn', + y : 'asgas', + yy : '%d isgasn' }, week : { dow : 6, // Saturday is the first day of the week. doy : 12 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return tzm_latn; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/tzm.js b/rainloop/v/0.0.0/app/localization/moment/tzm.js index c7c76bdc6..71fb076ae 100644 --- a/rainloop/v/0.0.0/app/localization/moment/tzm.js +++ b/rainloop/v/0.0.0/app/localization/moment/tzm.js @@ -1,31 +1,31 @@ -// moment.js language configuration -// language : Morocco Central Atlas Tamaziɣt (tzm) -// author : Abdel Said : https://github.com/abdelsaid +//! moment.js locale configuration +//! locale : Central Atlas Tamazight [tzm] +//! author : Abdel Said : https://github.com/abdelsaid -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('tzm', { - months : "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), - monthsShort : "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), - weekdays : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - weekdaysShort : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - weekdaysMin : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var tzm = moment.defineLocale('tzm', { + months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), + monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), + weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), + weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), + weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" + LT : 'HH:mm', + LTS: 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'dddd D MMMM YYYY HH:mm' }, calendar : { - sameDay: "[ⴰⵙⴷⵅ ⴴ] LT", + sameDay: '[ⴰⵙⴷⵅ ⴴ] LT', nextDay: '[ⴰⵙⴽⴰ ⴴ] LT', nextWeek: 'dddd [ⴴ] LT', lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT', @@ -33,23 +33,26 @@ sameElse: 'L' }, relativeTime : { - future : "ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s", - past : "ⵢⴰⵏ %s", - s : "ⵉⵎⵉⴽ", - m : "ⵎⵉⵏⵓⴺ", - mm : "%d ⵎⵉⵏⵓⴺ", - h : "ⵙⴰⵄⴰ", - hh : "%d ⵜⴰⵙⵙⴰⵄⵉⵏ", - d : "ⴰⵙⵙ", - dd : "%d oⵙⵙⴰⵏ", - M : "ⴰⵢoⵓⵔ", - MM : "%d ⵉⵢⵢⵉⵔⵏ", - y : "ⴰⵙⴳⴰⵙ", - yy : "%d ⵉⵙⴳⴰⵙⵏ" + future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s', + past : 'ⵢⴰⵏ %s', + s : 'ⵉⵎⵉⴽ', + m : 'ⵎⵉⵏⵓⴺ', + mm : '%d ⵎⵉⵏⵓⴺ', + h : 'ⵙⴰⵄⴰ', + hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ', + d : 'ⴰⵙⵙ', + dd : '%d oⵙⵙⴰⵏ', + M : 'ⴰⵢoⵓⵔ', + MM : '%d ⵉⵢⵢⵉⵔⵏ', + y : 'ⴰⵙⴳⴰⵙ', + yy : '%d ⵉⵙⴳⴰⵙⵏ' }, week : { dow : 6, // Saturday is the first day of the week. doy : 12 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return tzm; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/ua.js b/rainloop/v/0.0.0/app/localization/moment/ua.js deleted file mode 100644 index 92536c9d2..000000000 --- a/rainloop/v/0.0.0/app/localization/moment/ua.js +++ /dev/null @@ -1,162 +0,0 @@ -// moment.js language configuration -// language : ukrainian (ua) -// author : Olexandr Loskutov : https://github.com/alex-connor - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': withoutSuffix ? 'хвилине_хвилини_хвилин' : 'хвилину_хвилини_хвилин', - 'hh': 'годину_години_годин', - 'dd': 'день_дня_днів', - 'MM': 'місяць_місяці_місяців', - 'yy': 'рік_року_років' - }; - if (key === 'm') { - return withoutSuffix ? 'хвилина' : 'хвилин'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листовад_грудень'.split('_'), - 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function monthsShortCaseReplace(m, format) { - var monthsShort = { - 'nominative': 'січ_лют_бер_кві_тра_чер_лип_сер_вер_жов_лис_гру'.split('_'), - 'accusative': 'січ_лют_бер_кві_тра_чер_лип_сер_вер_жов_лис_гру'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return monthsShort[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п\'ятниця_субота'.split('_'), - 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п\'ятницю_суботу'.split('_') - }, - - nounCase = (/\[ ?[Вв] ?(?:попередню|наступну)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - - return weekdays[nounCase][m.day()]; - } - - return moment.lang('ua', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : "нд_пн_вт_ср_чт_пт_сб".split("_"), - weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"), - monthsParse : [/^січ/i, /^лют/i, /^бер/i, /^кві/i, /^тра/i, /^чер/i, /^лип/i, /^сер/i, /^вер/i, /^жов/i, /^лис/i, /^гру/i], - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY г.", - LLL : "D MMMM YYYY г., LT", - LLLL : "dddd, D MMMM YYYY г., LT" - }, - calendar : { - sameDay: '[Сьогодні в] LT', - nextDay: '[Завтра в] LT', - lastDay: '[Вчора в] LT', - nextWeek: function () { - return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; - }, - lastWeek: function () { - switch (this.day()) { - case 0: - return '[В минуле] dddd [в] LT'; - case 1: - case 2: - case 4: - return '[В минулий] dddd [в] LT'; - case 3: - case 5: - case 6: - return '[В минулу] dddd [в] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "через %s", - past : "%s назад", - s : "кілька секунд", - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : "година", - hh : relativeTimeWithPlural, - d : "день", - dd : relativeTimeWithPlural, - M : "місяць", - MM : relativeTimeWithPlural, - y : "рік", - yy : relativeTimeWithPlural - }, - - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "ночі"; - } else if (hour < 12) { - return "ранку"; - } else if (hour < 17) { - return "дня"; - } else { - return "вечора"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - return number + '-й'; - case 'D': - return number + '-го'; - case 'w': - case 'W': - return number + '-я'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/rainloop/v/0.0.0/app/localization/moment/uk.js b/rainloop/v/0.0.0/app/localization/moment/uk.js index 47056cb64..91ec18bf7 100644 --- a/rainloop/v/0.0.0/app/localization/moment/uk.js +++ b/rainloop/v/0.0.0/app/localization/moment/uk.js @@ -1,26 +1,24 @@ -// moment.js language configuration -// language : ukrainian (uk) -// author : zemlanin : https://github.com/zemlanin -// Author : Menelion Elensúle : https://github.com/Oire +//! moment.js locale configuration +//! locale : Ukrainian [uk] +//! author : zemlanin : https://github.com/zemlanin +//! Author : Menelion Elensúle : https://github.com/Oire + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { function plural(word, num) { var forms = word.split('_'); return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); } - function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { - 'mm': 'хвилина_хвилини_хвилин', - 'hh': 'година_години_годин', + 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', + 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин', 'dd': 'день_дні_днів', 'MM': 'місяць_місяці_місяців', 'yy': 'рік_роки_років' @@ -35,54 +33,41 @@ return number + ' ' + plural(format[key], +number); } } - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'), - 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') - }, - - nounCase = (/D[oD]? *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - function weekdaysCaseReplace(m, format) { var weekdays = { 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'), 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_') }, - nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ? 'accusative' : ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ? 'genitive' : 'nominative'); - return weekdays[nounCase][m.day()]; } - function processHoursFunction(str) { return function () { return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; }; } - return moment.lang('uk', { - months : monthsCaseReplace, - monthsShort : "січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"), + var uk = moment.defineLocale('uk', { + months : { + 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'), + 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_') + }, + monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'), weekdays : weekdaysCaseReplace, - weekdaysShort : "нд_пн_вт_ср_чт_пт_сб".split("_"), - weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"), + weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), + weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY р.", - LLL : "D MMMM YYYY р., LT", - LLLL : "dddd, D MMMM YYYY р., LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD.MM.YYYY', + LL : 'D MMMM YYYY р.', + LLL : 'D MMMM YYYY р., HH:mm', + LLLL : 'dddd, D MMMM YYYY р., HH:mm' }, calendar : { sameDay: processHoursFunction('[Сьогодні '), @@ -91,67 +76,71 @@ nextWeek: processHoursFunction('[У] dddd ['), lastWeek: function () { switch (this.day()) { - case 0: - case 3: - case 5: - case 6: - return processHoursFunction('[Минулої] dddd [').call(this); - case 1: - case 2: - case 4: - return processHoursFunction('[Минулого] dddd [').call(this); + case 0: + case 3: + case 5: + case 6: + return processHoursFunction('[Минулої] dddd [').call(this); + case 1: + case 2: + case 4: + return processHoursFunction('[Минулого] dddd [').call(this); } }, sameElse: 'L' }, relativeTime : { - future : "за %s", - past : "%s тому", - s : "декілька секунд", + future : 'за %s', + past : '%s тому', + s : 'декілька секунд', m : relativeTimeWithPlural, mm : relativeTimeWithPlural, - h : "годину", + h : 'годину', hh : relativeTimeWithPlural, - d : "день", + d : 'день', dd : relativeTimeWithPlural, - M : "місяць", + M : 'місяць', MM : relativeTimeWithPlural, - y : "рік", + y : 'рік', yy : relativeTimeWithPlural }, - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - + meridiemParse: /ночі|ранку|дня|вечора/, + isPM: function (input) { + return /^(дня|вечора)$/.test(input); + }, meridiem : function (hour, minute, isLower) { if (hour < 4) { - return "ночі"; + return 'ночі'; } else if (hour < 12) { - return "ранку"; + return 'ранку'; } else if (hour < 17) { - return "дня"; + return 'дня'; } else { - return "вечора"; + return 'вечора'; } }, - + ordinalParse: /\d{1,2}-(й|го)/, ordinal: function (number, period) { switch (period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return number + '-й'; - case 'D': - return number + '-го'; - default: - return number; + case 'M': + case 'd': + case 'DDD': + case 'w': + case 'W': + return number + '-й'; + case 'D': + return number + '-го'; + default: + return number; } }, - week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); -})); + + return uk; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/uz.js b/rainloop/v/0.0.0/app/localization/moment/uz.js index a5b06fa9f..3fccde184 100644 --- a/rainloop/v/0.0.0/app/localization/moment/uz.js +++ b/rainloop/v/0.0.0/app/localization/moment/uz.js @@ -1,28 +1,28 @@ -// moment.js language configuration -// language : uzbek -// author : Sardor Muminov : https://github.com/muminoff +//! moment.js locale configuration +//! locale : Uzbek [uz] +//! author : Sardor Muminov : https://github.com/muminoff -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('uz', { - months : "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), - monthsShort : "янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"), - weekdays : "Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"), - weekdaysShort : "Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"), - weekdaysMin : "Як_Ду_Се_Чо_Па_Жу_Ша".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var uz = moment.defineLocale('uz', { + months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), + monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), + weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'), + weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'), + weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'), longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "D MMMM YYYY, dddd LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY HH:mm', + LLLL : 'D MMMM YYYY, dddd HH:mm' }, calendar : { sameDay : '[Бугун соат] LT [да]', @@ -33,23 +33,26 @@ sameElse : 'L' }, relativeTime : { - future : "Якин %s ичида", - past : "Бир неча %s олдин", - s : "фурсат", - m : "бир дакика", - mm : "%d дакика", - h : "бир соат", - hh : "%d соат", - d : "бир кун", - dd : "%d кун", - M : "бир ой", - MM : "%d ой", - y : "бир йил", - yy : "%d йил" + future : 'Якин %s ичида', + past : 'Бир неча %s олдин', + s : 'фурсат', + m : 'бир дакика', + mm : '%d дакика', + h : 'бир соат', + hh : '%d соат', + d : 'бир кун', + dd : '%d кун', + M : 'бир ой', + MM : '%d ой', + y : 'бир йил', + yy : '%d йил' }, week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return uz; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/vi.js b/rainloop/v/0.0.0/app/localization/moment/vi.js index 94890b03d..ba207e93e 100644 --- a/rainloop/v/0.0.0/app/localization/moment/vi.js +++ b/rainloop/v/0.0.0/app/localization/moment/vi.js @@ -1,35 +1,48 @@ -// moment.js language configuration -// language : vietnamese (vi) -// author : Bang Nguyen : https://github.com/bangnk +//! moment.js locale configuration +//! locale : Vietnamese [vi] +//! author : Bang Nguyen : https://github.com/bangnk -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('vi', { - months : "tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"), - monthsShort : "Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"), - weekdays : "chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"), - weekdaysShort : "CN_T2_T3_T4_T5_T6_T7".split("_"), - weekdaysMin : "CN_T2_T3_T4_T5_T6_T7".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var vi = moment.defineLocale('vi', { + months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'), + monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'), + monthsParseExact : true, + weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), + weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), + weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), + weekdaysParseExact : true, + meridiemParse: /sa|ch/i, + isPM : function (input) { + return /^ch$/i.test(input); + }, + meridiem : function (hours, minutes, isLower) { + if (hours < 12) { + return isLower ? 'sa' : 'SA'; + } else { + return isLower ? 'ch' : 'CH'; + } + }, longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM [năm] YYYY", - LLL : "D MMMM [năm] YYYY LT", - LLLL : "dddd, D MMMM [năm] YYYY LT", - l : "DD/M/YYYY", - ll : "D MMM YYYY", - lll : "D MMM YYYY LT", - llll : "ddd, D MMM YYYY LT" + LT : 'HH:mm', + LTS : 'HH:mm:ss', + L : 'DD/MM/YYYY', + LL : 'D MMMM [năm] YYYY', + LLL : 'D MMMM [năm] YYYY HH:mm', + LLLL : 'dddd, D MMMM [năm] YYYY HH:mm', + l : 'DD/M/YYYY', + ll : 'D MMM YYYY', + lll : 'D MMM YYYY HH:mm', + llll : 'ddd, D MMM YYYY HH:mm' }, calendar : { - sameDay: "[Hôm nay lúc] LT", + sameDay: '[Hôm nay lúc] LT', nextDay: '[Ngày mai lúc] LT', nextWeek: 'dddd [tuần tới lúc] LT', lastDay: '[Hôm qua lúc] LT', @@ -37,20 +50,21 @@ sameElse: 'L' }, relativeTime : { - future : "%s tới", - past : "%s trước", - s : "vài giây", - m : "một phút", - mm : "%d phút", - h : "một giờ", - hh : "%d giờ", - d : "một ngày", - dd : "%d ngày", - M : "một tháng", - MM : "%d tháng", - y : "một năm", - yy : "%d năm" + future : '%s tới', + past : '%s trước', + s : 'vài giây', + m : 'một phút', + mm : '%d phút', + h : 'một giờ', + hh : '%d giờ', + d : 'một ngày', + dd : '%d ngày', + M : 'một tháng', + MM : '%d tháng', + y : 'một năm', + yy : '%d năm' }, + ordinalParse: /\d{1,2}/, ordinal : function (number) { return number; }, @@ -59,4 +73,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return vi; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/zh-cn.js b/rainloop/v/0.0.0/app/localization/moment/zh-cn.js index 50a3ed93f..cee6160fb 100644 --- a/rainloop/v/0.0.0/app/localization/moment/zh-cn.js +++ b/rainloop/v/0.0.0/app/localization/moment/zh-cn.js @@ -1,103 +1,119 @@ -// moment.js language configuration -// language : chinese -// author : suupic : https://github.com/suupic -// author : Zeno Zeng : https://github.com/zenozeng +//! moment.js locale configuration +//! locale : Chinese (China) [zh-cn] +//! author : suupic : https://github.com/suupic +//! author : Zeno Zeng : https://github.com/zenozeng -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('zh-cn', { - months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), - weekdaysShort : "周日_周一_周二_周三_周四_周五_周六".split("_"), - weekdaysMin : "日_一_二_三_四_五_六".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var zh_cn = moment.defineLocale('zh-cn', { + months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), + monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), + weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'), + weekdaysMin : '日_一_二_三_四_五_六'.split('_'), longDateFormat : { - LT : "Ah点mm", - L : "YYYY-MM-DD", - LL : "YYYY年MMMD日", - LLL : "YYYY年MMMD日LT", - LLLL : "YYYY年MMMD日ddddLT", - l : "YYYY-MM-DD", - ll : "YYYY年MMMD日", - lll : "YYYY年MMMD日LT", - llll : "YYYY年MMMD日ddddLT" + LT : 'Ah点mm分', + LTS : 'Ah点m分s秒', + L : 'YYYY-MM-DD', + LL : 'YYYY年MMMD日', + LLL : 'YYYY年MMMD日Ah点mm分', + LLLL : 'YYYY年MMMD日ddddAh点mm分', + l : 'YYYY-MM-DD', + ll : 'YYYY年MMMD日', + lll : 'YYYY年MMMD日Ah点mm分', + llll : 'YYYY年MMMD日ddddAh点mm分' + }, + meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, + meridiemHour: function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === '凌晨' || meridiem === '早上' || + meridiem === '上午') { + return hour; + } else if (meridiem === '下午' || meridiem === '晚上') { + return hour + 12; + } else { + // '中午' + return hour >= 11 ? hour : hour + 12; + } }, meridiem : function (hour, minute, isLower) { var hm = hour * 100 + minute; if (hm < 600) { - return "凌晨"; + return '凌晨'; } else if (hm < 900) { - return "早上"; + return '早上'; } else if (hm < 1130) { - return "上午"; + return '上午'; } else if (hm < 1230) { - return "中午"; + return '中午'; } else if (hm < 1800) { - return "下午"; + return '下午'; } else { - return "晚上"; + return '晚上'; } }, calendar : { sameDay : function () { - return this.minutes() === 0 ? "[今天]Ah[点整]" : "[今天]LT"; + return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT'; }, nextDay : function () { - return this.minutes() === 0 ? "[明天]Ah[点整]" : "[明天]LT"; + return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT'; }, lastDay : function () { - return this.minutes() === 0 ? "[昨天]Ah[点整]" : "[昨天]LT"; + return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT'; }, nextWeek : function () { var startOfWeek, prefix; startOfWeek = moment().startOf('week'); - prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]'; - return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm"; + prefix = this.diff(startOfWeek, 'days') >= 7 ? '[下]' : '[本]'; + return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; }, lastWeek : function () { var startOfWeek, prefix; startOfWeek = moment().startOf('week'); prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; - return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm"; + return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; }, sameElse : 'LL' }, + ordinalParse: /\d{1,2}(日|月|周)/, ordinal : function (number, period) { switch (period) { - case "d": - case "D": - case "DDD": - return number + "日"; - case "M": - return number + "月"; - case "w": - case "W": - return number + "周"; - default: - return number; + case 'd': + case 'D': + case 'DDD': + return number + '日'; + case 'M': + return number + '月'; + case 'w': + case 'W': + return number + '周'; + default: + return number; } }, relativeTime : { - future : "%s内", - past : "%s前", - s : "几秒", - m : "1分钟", - mm : "%d分钟", - h : "1小时", - hh : "%d小时", - d : "1天", - dd : "%d天", - M : "1个月", - MM : "%d个月", - y : "1年", - yy : "%d年" + future : '%s内', + past : '%s前', + s : '几秒', + m : '1 分钟', + mm : '%d 分钟', + h : '1 小时', + hh : '%d 小时', + d : '1 天', + dd : '%d 天', + M : '1 个月', + MM : '%d 个月', + y : '1 年', + yy : '%d 年' }, week : { // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 @@ -105,4 +121,7 @@ doy : 4 // The week that contains Jan 4th is the first week of the year. } }); -})); + + return zh_cn; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/localization/moment/zh-tw.js b/rainloop/v/0.0.0/app/localization/moment/zh-tw.js index bbb07376e..c6766c8b6 100644 --- a/rainloop/v/0.0.0/app/localization/moment/zh-tw.js +++ b/rainloop/v/0.0.0/app/localization/moment/zh-tw.js @@ -1,45 +1,61 @@ -// moment.js language configuration -// language : traditional chinese (zh-tw) -// author : Ben : https://github.com/ben-lin +//! moment.js locale configuration +//! locale : Chinese (Taiwan) [zh-tw] +//! author : Ben : https://github.com/ben-lin +//! author : Chris Lam : https://github.com/hehachris -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('zh-tw', { - months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), - weekdaysShort : "週日_週一_週二_週三_週四_週五_週六".split("_"), - weekdaysMin : "日_一_二_三_四_五_六".split("_"), +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var zh_tw = moment.defineLocale('zh-tw', { + months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), + monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), + weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'), + weekdaysMin : '日_一_二_三_四_五_六'.split('_'), longDateFormat : { - LT : "Ah點mm", - L : "YYYY年MMMD日", - LL : "YYYY年MMMD日", - LLL : "YYYY年MMMD日LT", - LLLL : "YYYY年MMMD日ddddLT", - l : "YYYY年MMMD日", - ll : "YYYY年MMMD日", - lll : "YYYY年MMMD日LT", - llll : "YYYY年MMMD日ddddLT" + LT : 'Ah點mm分', + LTS : 'Ah點m分s秒', + L : 'YYYY年MMMD日', + LL : 'YYYY年MMMD日', + LLL : 'YYYY年MMMD日Ah點mm分', + LLLL : 'YYYY年MMMD日ddddAh點mm分', + l : 'YYYY年MMMD日', + ll : 'YYYY年MMMD日', + lll : 'YYYY年MMMD日Ah點mm分', + llll : 'YYYY年MMMD日ddddAh點mm分' + }, + meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') { + return hour; + } else if (meridiem === '中午') { + return hour >= 11 ? hour : hour + 12; + } else if (meridiem === '下午' || meridiem === '晚上') { + return hour + 12; + } }, meridiem : function (hour, minute, isLower) { var hm = hour * 100 + minute; - if (hm < 900) { - return "早上"; + if (hm < 600) { + return '凌晨'; + } else if (hm < 900) { + return '早上'; } else if (hm < 1130) { - return "上午"; + return '上午'; } else if (hm < 1230) { - return "中午"; + return '中午'; } else if (hm < 1800) { - return "下午"; + return '下午'; } else { - return "晚上"; + return '晚上'; } }, calendar : { @@ -50,35 +66,39 @@ lastWeek : '[上]ddddLT', sameElse : 'L' }, + ordinalParse: /\d{1,2}(日|月|週)/, ordinal : function (number, period) { switch (period) { - case "d" : - case "D" : - case "DDD" : - return number + "日"; - case "M" : - return number + "月"; - case "w" : - case "W" : - return number + "週"; - default : - return number; + case 'd' : + case 'D' : + case 'DDD' : + return number + '日'; + case 'M' : + return number + '月'; + case 'w' : + case 'W' : + return number + '週'; + default : + return number; } }, relativeTime : { - future : "%s內", - past : "%s前", - s : "幾秒", - m : "一分鐘", - mm : "%d分鐘", - h : "一小時", - hh : "%d小時", - d : "一天", - dd : "%d天", - M : "一個月", - MM : "%d個月", - y : "一年", - yy : "%d年" + future : '%s內', + past : '%s前', + s : '幾秒', + m : '1 分鐘', + mm : '%d 分鐘', + h : '1 小時', + hh : '%d 小時', + d : '1 天', + dd : '%d 天', + M : '1 個月', + MM : '%d 個月', + y : '1 年', + yy : '%d 年' } }); -})); + + return zh_tw; + +})); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/templates/Views/Common/PopupsLanguages.html b/rainloop/v/0.0.0/app/templates/Views/Common/PopupsLanguages.html index 4e365ef2d..03e3297ba 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Common/PopupsLanguages.html +++ b/rainloop/v/0.0.0/app/templates/Views/Common/PopupsLanguages.html @@ -1,23 +1,22 @@ -
- +
+
\ No newline at end of file diff --git a/rainloop/v/0.0.0/static/css/fonts/lg.eot b/rainloop/v/0.0.0/static/css/fonts/lg.eot index 5967563a0..1eb39169c 100644 Binary files a/rainloop/v/0.0.0/static/css/fonts/lg.eot and b/rainloop/v/0.0.0/static/css/fonts/lg.eot differ diff --git a/rainloop/v/0.0.0/static/css/fonts/lg.svg b/rainloop/v/0.0.0/static/css/fonts/lg.svg index f7c471498..648412d9d 100644 --- a/rainloop/v/0.0.0/static/css/fonts/lg.svg +++ b/rainloop/v/0.0.0/static/css/fonts/lg.svg @@ -1,41 +1,42 @@ - - - - - - -{ - "fontFamily": "lg", - "majorVersion": 1, - "minorVersion": 0, - "fontURL": "https://github.com/sachinchoolur/lightGallery", - "copyright": "sachin", - "license": "MLT", - "licenseURL": "http://opensource.org/licenses/MIT", - "version": "Version 1.0", - "fontId": "lg", - "psName": "lg", - "subFamily": "Regular", - "fullName": "lg", - "description": "Font generated by IcoMoon." -} - - - - - - - - - - - - - - - - - - - + + + + + + +{ + "fontFamily": "lg", + "majorVersion": 1, + "minorVersion": 0, + "fontURL": "https://github.com/sachinchoolur/lightGallery", + "copyright": "sachin", + "license": "MLT", + "licenseURL": "http://opensource.org/licenses/MIT", + "version": "Version 1.0", + "fontId": "lg", + "psName": "lg", + "subFamily": "Regular", + "fullName": "lg", + "description": "Font generated by IcoMoon." +} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rainloop/v/0.0.0/static/css/fonts/lg.ttf b/rainloop/v/0.0.0/static/css/fonts/lg.ttf index c28a50948..d33b8e5e8 100644 Binary files a/rainloop/v/0.0.0/static/css/fonts/lg.ttf and b/rainloop/v/0.0.0/static/css/fonts/lg.ttf differ diff --git a/rainloop/v/0.0.0/static/css/fonts/lg.woff b/rainloop/v/0.0.0/static/css/fonts/lg.woff index c0599a54a..bd370be88 100644 Binary files a/rainloop/v/0.0.0/static/css/fonts/lg.woff and b/rainloop/v/0.0.0/static/css/fonts/lg.woff differ diff --git a/vendors/Autolinker/Autolinker.js b/vendors/Autolinker/Autolinker.js deleted file mode 100644 index 1e04834c1..000000000 --- a/vendors/Autolinker/Autolinker.js +++ /dev/null @@ -1,1995 +0,0 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define([], function () { - return (root.returnExportsGlobal = factory()); - }); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like enviroments that support module.exports, - // like Node. - module.exports = factory(); - } else { - root['Autolinker'] = factory(); - } -}(this, function () { - - /*! - * Autolinker.js - * 0.15.2 - * - * Copyright(c) 2015 Gregory Jacobs - * MIT Licensed. http://www.opensource.org/licenses/mit-license.php - * - * https://github.com/gregjacobs/Autolinker.js - */ - /** - * @class Autolinker - * @extends Object - * - * Utility class used to process a given string of text, and wrap the URLs, email addresses, and Twitter handles in - * the appropriate anchor (<a>) tags to turn them into links. - * - * Any of the configuration options may be provided in an Object (map) provided to the Autolinker constructor, which - * will configure how the {@link #link link()} method will process the links. - * - * For example: - * - * var autolinker = new Autolinker( { - * newWindow : false, - * truncate : 30 - * } ); - * - * var html = autolinker.link( "Joe went to www.yahoo.com" ); - * // produces: 'Joe went to yahoo.com' - * - * - * The {@link #static-link static link()} method may also be used to inline options into a single call, which may - * be more convenient for one-off uses. For example: - * - * var html = Autolinker.link( "Joe went to www.yahoo.com", { - * newWindow : false, - * truncate : 30 - * } ); - * // produces: 'Joe went to yahoo.com' - * - * - * ## Custom Replacements of Links - * - * If the configuration options do not provide enough flexibility, a {@link #replaceFn} may be provided to fully customize - * the output of Autolinker. This function is called once for each URL/Email/Twitter handle match that is encountered. - * - * For example: - * - * var input = "..."; // string with URLs, Email Addresses, and Twitter Handles - * - * var linkedText = Autolinker.link( input, { - * replaceFn : function( autolinker, match ) { - * console.log( "href = ", match.getAnchorHref() ); - * console.log( "text = ", match.getAnchorText() ); - * - * switch( match.getType() ) { - * case 'url' : - * console.log( "url: ", match.getUrl() ); - * - * if( match.getUrl().indexOf( 'mysite.com' ) === -1 ) { - * var tag = autolinker.getTagBuilder().build( match ); // returns an `Autolinker.HtmlTag` instance, which provides mutator methods for easy changes - * tag.setAttr( 'rel', 'nofollow' ); - * tag.addClass( 'external-link' ); - * - * return tag; - * - * } else { - * return true; // let Autolinker perform its normal anchor tag replacement - * } - * - * case 'email' : - * var email = match.getEmail(); - * console.log( "email: ", email ); - * - * if( email === "my@own.address" ) { - * return false; // don't auto-link this particular email address; leave as-is - * } else { - * return; // no return value will have Autolinker perform its normal anchor tag replacement (same as returning `true`) - * } - * - * case 'twitter' : - * var twitterHandle = match.getTwitterHandle(); - * console.log( twitterHandle ); - * - * return '' + twitterHandle + ''; - * } - * } - * } ); - * - * - * The function may return the following values: - * - * - `true` (Boolean): Allow Autolinker to replace the match as it normally would. - * - `false` (Boolean): Do not replace the current match at all - leave as-is. - * - Any String: If a string is returned from the function, the string will be used directly as the replacement HTML for - * the match. - * - An {@link Autolinker.HtmlTag} instance, which can be used to build/modify an HTML tag before writing out its HTML text. - * - * @constructor - * @param {Object} [config] The configuration options for the Autolinker instance, specified in an Object (map). - */ - var Autolinker = function( cfg ) { - Autolinker.Util.assign( this, cfg ); // assign the properties of `cfg` onto the Autolinker instance. Prototype properties will be used for missing configs. - - this.matchValidator = new Autolinker.MatchValidator(); - }; - - - Autolinker.prototype = { - constructor : Autolinker, // fix constructor property - - /** - * @cfg {Boolean} urls - * - * `true` if miscellaneous URLs should be automatically linked, `false` if they should not be. - */ - urls : true, - - /** - * @cfg {Boolean} email - * - * `true` if email addresses should be automatically linked, `false` if they should not be. - */ - email : true, - - /** - * @cfg {Boolean} twitter - * - * `true` if Twitter handles ("@example") should be automatically linked, `false` if they should not be. - */ - twitter : true, - - /** - * @cfg {Boolean} newWindow - * - * `true` if the links should open in a new window, `false` otherwise. - */ - newWindow : true, - - /** - * @cfg {Boolean} stripPrefix - * - * `true` if 'http://' or 'https://' and/or the 'www.' should be stripped from the beginning of URL links' text, - * `false` otherwise. - */ - stripPrefix : true, - - /** - * @cfg {Number} truncate - * - * A number for how many characters long URLs/emails/twitter handles should be truncated to inside the text of - * a link. If the URL/email/twitter is over this number of characters, it will be truncated to this length by - * adding a two period ellipsis ('..') to the end of the string. - * - * For example: A url like 'http://www.yahoo.com/some/long/path/to/a/file' truncated to 25 characters might look - * something like this: 'yahoo.com/some/long/pat..' - */ - - /** - * @cfg {String} className - * - * A CSS class name to add to the generated links. This class will be added to all links, as well as this class - * plus url/email/twitter suffixes for styling url/email/twitter links differently. - * - * For example, if this config is provided as "myLink", then: - * - * - URL links will have the CSS classes: "myLink myLink-url" - * - Email links will have the CSS classes: "myLink myLink-email", and - * - Twitter links will have the CSS classes: "myLink myLink-twitter" - */ - className : "", - - /** - * @cfg {Function} replaceFn - * - * A function to individually process each URL/Email/Twitter match found in the input string. - * - * See the class's description for usage. - * - * This function is called with the following parameters: - * - * @cfg {Autolinker} replaceFn.autolinker The Autolinker instance, which may be used to retrieve child objects from (such - * as the instance's {@link #getTagBuilder tag builder}). - * @cfg {Autolinker.match.Match} replaceFn.match The Match instance which can be used to retrieve information about the - * {@link Autolinker.match.Url URL}/{@link Autolinker.match.Email email}/{@link Autolinker.match.Twitter Twitter} - * match that the `replaceFn` is currently processing. - */ - - - /** - * @private - * @property {RegExp} htmlCharacterEntitiesRegex - * - * The regular expression that matches common HTML character entities. - * - * Ignoring & as it could be part of a query string -- handling it separately. - */ - htmlCharacterEntitiesRegex: /( | |<|<|>|>|"|"|')/gi, - - /** - * @private - * @property {RegExp} matcherRegex - * - * The regular expression that matches URLs, email addresses, and Twitter handles. - * - * This regular expression has the following capturing groups: - * - * 1. Group that is used to determine if there is a Twitter handle match (i.e. \@someTwitterUser). Simply check for its - * existence to determine if there is a Twitter handle match. The next couple of capturing groups give information - * about the Twitter handle match. - * 2. The whitespace character before the \@sign in a Twitter handle. This is needed because there are no lookbehinds in - * JS regular expressions, and can be used to reconstruct the original string in a replace(). - * 3. The Twitter handle itself in a Twitter match. If the match is '@someTwitterUser', the handle is 'someTwitterUser'. - * 4. Group that matches an email address. Used to determine if the match is an email address, as well as holding the full - * address. Ex: 'me@my.com' - * 5. Group that matches a URL in the input text. Ex: 'http://google.com', 'www.google.com', or just 'google.com'. - * This also includes a path, url parameters, or hash anchors. Ex: google.com/path/to/file?q1=1&q2=2#myAnchor - * 6. Group that matches a protocol URL (i.e. 'http://google.com'). This is used to match protocol URLs with just a single - * word, like 'http://localhost', where we won't double check that the domain name has at least one '.' in it. - * 7. A protocol-relative ('//') match for the case of a 'www.' prefixed URL. Will be an empty string if it is not a - * protocol-relative match. We need to know the character before the '//' in order to determine if it is a valid match - * or the // was in a string we don't want to auto-link. - * 8. A protocol-relative ('//') match for the case of a known TLD prefixed URL. Will be an empty string if it is not a - * protocol-relative match. See #6 for more info. - */ - matcherRegex : (function() { - var twitterRegex = /(^|[^\w])@(\w{1,15})/, // For matching a twitter handle. Ex: @gregory_jacobs - - emailRegex = /(?:[\-;:&=\+\$,\w\.]+@)/, // something@ for email addresses (a.k.a. local-part) - - protocolRegex = /(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/, // match protocol, allow in format "http://" or "mailto:". However, do not match the first part of something like 'link:http://www.google.com' (i.e. don't match "link:"). Also, make sure we don't interpret 'google.com:8000' as if 'google.com' was a protocol here (i.e. ignore a trailing port number in this regex) - wwwRegex = /(?:www\.)/, // starting with 'www.' - domainNameRegex = /[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/, // anything looking at all like a domain, non-unicode domains, not ending in a period - tldRegex = /\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/, // match our known top level domains (TLDs) - - // Allow optional path, query string, and hash anchor, not ending in the following characters: "?!:,.;" - // http://blog.codinghorror.com/the-problem-with-urls/ - urlSuffixRegex = /[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/; - - return new RegExp( [ - '(', // *** Capturing group $1, which can be used to check for a twitter handle match. Use group $3 for the actual twitter handle though. $2 may be used to reconstruct the original string in a replace() - // *** Capturing group $2, which matches the whitespace character before the '@' sign (needed because of no lookbehinds), and - // *** Capturing group $3, which matches the actual twitter handle - twitterRegex.source, - ')', - - '|', - - '(', // *** Capturing group $4, which is used to determine an email match - emailRegex.source, - domainNameRegex.source, - tldRegex.source, - ')', - - '|', - - '(', // *** Capturing group $5, which is used to match a URL - '(?:', // parens to cover match for protocol (optional), and domain - '(', // *** Capturing group $6, for a protocol-prefixed url (ex: http://google.com) - protocolRegex.source, - domainNameRegex.source, - ')', - - '|', - - '(?:', // non-capturing paren for a 'www.' prefixed url (ex: www.google.com) - '(.?//)?', // *** Capturing group $7 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character - wwwRegex.source, - domainNameRegex.source, - ')', - - '|', - - '(?:', // non-capturing paren for known a TLD url (ex: google.com) - '(.?//)?', // *** Capturing group $8 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character - domainNameRegex.source, - tldRegex.source, - ')', - ')', - - '(?:' + urlSuffixRegex.source + ')?', // match for path, query string, and/or hash anchor - optional - ')' - ].join( "" ), 'gi' ); - } )(), - - /** - * @private - * @property {RegExp} charBeforeProtocolRelMatchRegex - * - * The regular expression used to retrieve the character before a protocol-relative URL match. - * - * This is used in conjunction with the {@link #matcherRegex}, which needs to grab the character before a protocol-relative - * '//' due to the lack of a negative look-behind in JavaScript regular expressions. The character before the match is stripped - * from the URL. - */ - charBeforeProtocolRelMatchRegex : /^(.)?\/\//, - - /** - * @private - * @property {Autolinker.MatchValidator} matchValidator - * - * The MatchValidator object, used to filter out any false positives from the {@link #matcherRegex}. See - * {@link Autolinker.MatchValidator} for details. - */ - - /** - * @private - * @property {Autolinker.HtmlParser} htmlParser - * - * The HtmlParser instance used to skip over HTML tags, while finding text nodes to process. This is lazily instantiated - * in the {@link #getHtmlParser} method. - */ - - /** - * @private - * @property {Autolinker.AnchorTagBuilder} tagBuilder - * - * The AnchorTagBuilder instance used to build the URL/email/Twitter replacement anchor tags. This is lazily instantiated - * in the {@link #getTagBuilder} method. - */ - - - /** - * Automatically links URLs, email addresses, and Twitter handles found in the given chunk of HTML. - * Does not link URLs found within HTML tags. - * - * For instance, if given the text: `You should go to http://www.yahoo.com`, then the result - * will be `You should go to <a href="http://www.yahoo.com">http://www.yahoo.com</a>` - * - * This method finds the text around any HTML elements in the input `textOrHtml`, which will be the text that is processed. - * Any original HTML elements will be left as-is, as well as the text that is already wrapped in anchor (<a>) tags. - * - * @param {String} textOrHtml The HTML or text to link URLs, email addresses, and Twitter handles within (depending on if - * the {@link #urls}, {@link #email}, and {@link #twitter} options are enabled). - * @return {String} The HTML, with URLs/emails/Twitter handles automatically linked. - */ - link : function( textOrHtml ) { - var me = this, // for closure - htmlParser = this.getHtmlParser(), - htmlCharacterEntitiesRegex = this.htmlCharacterEntitiesRegex, - anchorTagStackCount = 0, // used to only process text around anchor tags, and any inner text/html they may have - resultHtml = []; - - htmlParser.parse( textOrHtml, { - // Process HTML nodes in the input `textOrHtml` - processHtmlNode : function( tagText, tagName, isClosingTag ) { - if( tagName === 'a' ) { - if( !isClosingTag ) { // it's the start tag - anchorTagStackCount++; - } else { // it's the end tag - anchorTagStackCount = Math.max( anchorTagStackCount - 1, 0 ); // attempt to handle extraneous tags by making sure the stack count never goes below 0 - } - } - resultHtml.push( tagText ); // now add the text of the tag itself verbatim - }, - - // Process text nodes in the input `textOrHtml` - processTextNode : function( text ) { - if( anchorTagStackCount === 0 ) { - // If we're not within an tag, process the text node - var unescapedText = Autolinker.Util.splitAndCapture( text, htmlCharacterEntitiesRegex ); // split at HTML entities, but include the HTML entities in the results array - - for ( var i = 0, len = unescapedText.length; i < len; i++ ) { - var textToProcess = unescapedText[ i ], - processedTextNode = me.processTextNode( textToProcess ); - - resultHtml.push( processedTextNode ); - } - - } else { - // `text` is within an tag, simply append the text - we do not want to autolink anything - // already within an ... tag - resultHtml.push( text ); - } - } - } ); - - return resultHtml.join( "" ); - }, - - - /** - * Lazily instantiates and returns the {@link #htmlParser} instance for this Autolinker instance. - * - * @protected - * @return {Autolinker.HtmlParser} - */ - getHtmlParser : function() { - var htmlParser = this.htmlParser; - - if( !htmlParser ) { - htmlParser = this.htmlParser = new Autolinker.HtmlParser(); - } - - return htmlParser; - }, - - - /** - * Returns the {@link #tagBuilder} instance for this Autolinker instance, lazily instantiating it - * if it does not yet exist. - * - * This method may be used in a {@link #replaceFn} to generate the {@link Autolinker.HtmlTag HtmlTag} instance that - * Autolinker would normally generate, and then allow for modifications before returning it. For example: - * - * var html = Autolinker.link( "Test google.com", { - * replaceFn : function( autolinker, match ) { - * var tag = autolinker.getTagBuilder().build( match ); // returns an {@link Autolinker.HtmlTag} instance - * tag.setAttr( 'rel', 'nofollow' ); - * - * return tag; - * } - * } ); - * - * // generated html: - * // Test google.com - * - * @return {Autolinker.AnchorTagBuilder} - */ - getTagBuilder : function() { - var tagBuilder = this.tagBuilder; - - if( !tagBuilder ) { - tagBuilder = this.tagBuilder = new Autolinker.AnchorTagBuilder( { - newWindow : this.newWindow, - truncate : this.truncate, - className : this.className - } ); - } - - return tagBuilder; - }, - - - /** - * Process the text that lies inbetween HTML tags. This method does the actual wrapping of URLs with - * anchor tags. - * - * @private - * @param {String} text The text to auto-link. - * @return {String} The text with anchor tags auto-filled. - */ - processTextNode : function( text ) { - var me = this; // for closure - - return text.replace( this.matcherRegex, function( matchStr, $1, $2, $3, $4, $5, $6, $7, $8 ) { - var matchDescObj = me.processCandidateMatch( matchStr, $1, $2, $3, $4, $5, $6, $7, $8 ); // match description object - - // Return out with no changes for match types that are disabled (url, email, twitter), or for matches that are - // invalid (false positives from the matcherRegex, which can't use look-behinds since they are unavailable in JS). - if( !matchDescObj ) { - return matchStr; - - } else { - // Generate the replacement text for the match - var matchReturnVal = me.createMatchReturnVal( matchDescObj.match, matchDescObj.matchStr ); - return matchDescObj.prefixStr + matchReturnVal + matchDescObj.suffixStr; - } - } ); - }, - - - /** - * Processes a candidate match from the {@link #matcherRegex}. - * - * Not all matches found by the regex are actual URL/email/Twitter matches, as determined by the {@link #matchValidator}. In - * this case, the method returns `null`. Otherwise, a valid Object with `prefixStr`, `match`, and `suffixStr` is returned. - * - * @private - * @param {String} matchStr The full match that was found by the {@link #matcherRegex}. - * @param {String} twitterMatch The matched text of a Twitter handle, if the match is a Twitter match. - * @param {String} twitterHandlePrefixWhitespaceChar The whitespace char before the @ sign in a Twitter handle match. This - * is needed because of no lookbehinds in JS regexes, and is need to re-include the character for the anchor tag replacement. - * @param {String} twitterHandle The actual Twitter user (i.e the word after the @ sign in a Twitter match). - * @param {String} emailAddressMatch The matched email address for an email address match. - * @param {String} urlMatch The matched URL string for a URL match. - * @param {String} protocolUrlMatch The match URL string for a protocol match. Ex: 'http://yahoo.com'. This is used to match - * something like 'http://localhost', where we won't double check that the domain name has at least one '.' in it. - * @param {String} wwwProtocolRelativeMatch The '//' for a protocol-relative match from a 'www' url, with the character that - * comes before the '//'. - * @param {String} tldProtocolRelativeMatch The '//' for a protocol-relative match from a TLD (top level domain) match, with - * the character that comes before the '//'. - * - * @return {Object} A "match description object". This will be `null` if the match was invalid, or if a match type is disabled. - * Otherwise, this will be an Object (map) with the following properties: - * @return {String} return.prefixStr The char(s) that should be prepended to the replacement string. These are char(s) that - * were needed to be included from the regex match that were ignored by processing code, and should be re-inserted into - * the replacement stream. - * @return {String} return.suffixStr The char(s) that should be appended to the replacement string. These are char(s) that - * were needed to be included from the regex match that were ignored by processing code, and should be re-inserted into - * the replacement stream. - * @return {String} return.matchStr The `matchStr`, fixed up to remove characters that are no longer needed (which have been - * added to `prefixStr` and `suffixStr`). - * @return {Autolinker.match.Match} return.match The Match object that represents the match that was found. - */ - processCandidateMatch : function( - matchStr, twitterMatch, twitterHandlePrefixWhitespaceChar, twitterHandle, - emailAddressMatch, urlMatch, protocolUrlMatch, wwwProtocolRelativeMatch, tldProtocolRelativeMatch - ) { - var protocolRelativeMatch = wwwProtocolRelativeMatch || tldProtocolRelativeMatch, - match, // Will be an Autolinker.match.Match object - - prefixStr = "", // A string to use to prefix the anchor tag that is created. This is needed for the Twitter handle match - suffixStr = ""; // A string to suffix the anchor tag that is created. This is used if there is a trailing parenthesis that should not be auto-linked. - - - // Return out with `null` for match types that are disabled (url, email, twitter), or for matches that are - // invalid (false positives from the matcherRegex, which can't use look-behinds since they are unavailable in JS). - if( - ( twitterMatch && !this.twitter ) || ( emailAddressMatch && !this.email ) || ( urlMatch && !this.urls ) || - !this.matchValidator.isValidMatch( urlMatch, protocolUrlMatch, protocolRelativeMatch ) - ) { - return null; - } - - // Handle a closing parenthesis at the end of the match, and exclude it if there is not a matching open parenthesis - // in the match itself. - if( this.matchHasUnbalancedClosingParen( matchStr ) ) { - matchStr = matchStr.substr( 0, matchStr.length - 1 ); // remove the trailing ")" - suffixStr = ")"; // this will be added after the generated tag - } - - - if( emailAddressMatch ) { - match = new Autolinker.match.Email( { matchedText: matchStr, email: emailAddressMatch } ); - - } else if( twitterMatch ) { - // fix up the `matchStr` if there was a preceding whitespace char, which was needed to determine the match - // itself (since there are no look-behinds in JS regexes) - if( twitterHandlePrefixWhitespaceChar ) { - prefixStr = twitterHandlePrefixWhitespaceChar; - matchStr = matchStr.slice( 1 ); // remove the prefixed whitespace char from the match - } - match = new Autolinker.match.Twitter( { matchedText: matchStr, twitterHandle: twitterHandle } ); - - } else { // url match - // If it's a protocol-relative '//' match, remove the character before the '//' (which the matcherRegex needed - // to match due to the lack of a negative look-behind in JavaScript regular expressions) - if( protocolRelativeMatch ) { - var charBeforeMatch = protocolRelativeMatch.match( this.charBeforeProtocolRelMatchRegex )[ 1 ] || ""; - - if( charBeforeMatch ) { // fix up the `matchStr` if there was a preceding char before a protocol-relative match, which was needed to determine the match itself (since there are no look-behinds in JS regexes) - prefixStr = charBeforeMatch; - matchStr = matchStr.slice( 1 ); // remove the prefixed char from the match - } - } - - match = new Autolinker.match.Url( { - matchedText : matchStr, - url : matchStr, - protocolUrlMatch : !!protocolUrlMatch, - protocolRelativeMatch : !!protocolRelativeMatch, - stripPrefix : this.stripPrefix - } ); - } - - return { - prefixStr : prefixStr, - suffixStr : suffixStr, - matchStr : matchStr, - match : match - }; - }, - - - /** - * Determines if a match found has an unmatched closing parenthesis. If so, this parenthesis will be removed - * from the match itself, and appended after the generated anchor tag in {@link #processTextNode}. - * - * A match may have an extra closing parenthesis at the end of the match because the regular expression must include parenthesis - * for URLs such as "wikipedia.com/something_(disambiguation)", which should be auto-linked. - * - * However, an extra parenthesis *will* be included when the URL itself is wrapped in parenthesis, such as in the case of - * "(wikipedia.com/something_(disambiguation))". In this case, the last closing parenthesis should *not* be part of the URL - * itself, and this method will return `true`. - * - * @private - * @param {String} matchStr The full match string from the {@link #matcherRegex}. - * @return {Boolean} `true` if there is an unbalanced closing parenthesis at the end of the `matchStr`, `false` otherwise. - */ - matchHasUnbalancedClosingParen : function( matchStr ) { - var lastChar = matchStr.charAt( matchStr.length - 1 ); - - if( lastChar === ')' ) { - var openParensMatch = matchStr.match( /\(/g ), - closeParensMatch = matchStr.match( /\)/g ), - numOpenParens = ( openParensMatch && openParensMatch.length ) || 0, - numCloseParens = ( closeParensMatch && closeParensMatch.length ) || 0; - - if( numOpenParens < numCloseParens ) { - return true; - } - } - - return false; - }, - - - /** - * Creates the return string value for a given match in the input string, for the {@link #processTextNode} method. - * - * This method handles the {@link #replaceFn}, if one was provided. - * - * @private - * @param {Autolinker.match.Match} match The Match object that represents the match. - * @param {String} matchStr The original match string, after having been preprocessed to fix match edge cases (see - * the `prefixStr` and `suffixStr` vars in {@link #processTextNode}. - * @return {String} The string that the `match` should be replaced with. This is usually the anchor tag string, but - * may be the `matchStr` itself if the match is not to be replaced. - */ - createMatchReturnVal : function( match, matchStr ) { - // Handle a custom `replaceFn` being provided - var replaceFnResult; - if( this.replaceFn ) { - replaceFnResult = this.replaceFn.call( this, this, match ); // Autolinker instance is the context, and the first arg - } - - if( typeof replaceFnResult === 'string' ) { - return replaceFnResult; // `replaceFn` returned a string, use that - - } else if( replaceFnResult === false ) { - return matchStr; // no replacement for the match - - } else if( replaceFnResult instanceof Autolinker.HtmlTag ) { - return replaceFnResult.toString(); - - } else { // replaceFnResult === true, or no/unknown return value from function - // Perform Autolinker's default anchor tag generation - var tagBuilder = this.getTagBuilder(), - anchorTag = tagBuilder.build( match ); // returns an Autolinker.HtmlTag instance - - return anchorTag.toString(); - } - } - - }; - - - /** - * Automatically links URLs, email addresses, and Twitter handles found in the given chunk of HTML. - * Does not link URLs found within HTML tags. - * - * For instance, if given the text: `You should go to http://www.yahoo.com`, then the result - * will be `You should go to <a href="http://www.yahoo.com">http://www.yahoo.com</a>` - * - * Example: - * - * var linkedText = Autolinker.link( "Go to google.com", { newWindow: false } ); - * // Produces: "Go to google.com" - * - * @static - * @param {String} textOrHtml The HTML or text to find URLs, email addresses, and Twitter handles within (depending on if - * the {@link #urls}, {@link #email}, and {@link #twitter} options are enabled). - * @param {Object} [options] Any of the configuration options for the Autolinker class, specified in an Object (map). - * See the class description for an example call. - * @return {String} The HTML text, with URLs automatically linked - */ - Autolinker.link = function( textOrHtml, options ) { - var autolinker = new Autolinker( options ); - return autolinker.link( textOrHtml ); - }; - - - // Namespace for `match` classes - Autolinker.match = {}; - /*global Autolinker */ - /*jshint eqnull:true, boss:true */ - /** - * @class Autolinker.Util - * @singleton - * - * A few utility methods for Autolinker. - */ - Autolinker.Util = { - - /** - * @property {Function} abstractMethod - * - * A function object which represents an abstract method. - */ - abstractMethod : function() { throw "abstract"; }, - - - /** - * Assigns (shallow copies) the properties of `src` onto `dest`. - * - * @param {Object} dest The destination object. - * @param {Object} src The source object. - * @return {Object} The destination object (`dest`) - */ - assign : function( dest, src ) { - for( var prop in src ) { - if( src.hasOwnProperty( prop ) ) { - dest[ prop ] = src[ prop ]; - } - } - - return dest; - }, - - - /** - * Extends `superclass` to create a new subclass, adding the `protoProps` to the new subclass's prototype. - * - * @param {Function} superclass The constructor function for the superclass. - * @param {Object} protoProps The methods/properties to add to the subclass's prototype. This may contain the - * special property `constructor`, which will be used as the new subclass's constructor function. - * @return {Function} The new subclass function. - */ - extend : function( superclass, protoProps ) { - var superclassProto = superclass.prototype; - - var F = function() {}; - F.prototype = superclassProto; - - var subclass; - if( protoProps.hasOwnProperty( 'constructor' ) ) { - subclass = protoProps.constructor; - } else { - subclass = function() { superclassProto.constructor.apply( this, arguments ); }; - } - - var subclassProto = subclass.prototype = new F(); // set up prototype chain - subclassProto.constructor = subclass; // fix constructor property - subclassProto.superclass = superclassProto; - - delete protoProps.constructor; // don't re-assign constructor property to the prototype, since a new function may have been created (`subclass`), which is now already there - Autolinker.Util.assign( subclassProto, protoProps ); - - return subclass; - }, - - - /** - * Truncates the `str` at `len - ellipsisChars.length`, and adds the `ellipsisChars` to the - * end of the string (by default, two periods: '..'). If the `str` length does not exceed - * `len`, the string will be returned unchanged. - * - * @param {String} str The string to truncate and add an ellipsis to. - * @param {Number} truncateLen The length to truncate the string at. - * @param {String} [ellipsisChars=..] The ellipsis character(s) to add to the end of `str` - * when truncated. Defaults to '..' - */ - ellipsis : function( str, truncateLen, ellipsisChars ) { - if( str.length > truncateLen ) { - ellipsisChars = ( ellipsisChars == null ) ? '..' : ellipsisChars; - str = str.substring( 0, truncateLen - ellipsisChars.length ) + ellipsisChars; - } - return str; - }, - - - /** - * Supports `Array.prototype.indexOf()` functionality for old IE (IE8 and below). - * - * @param {Array} arr The array to find an element of. - * @param {*} element The element to find in the array, and return the index of. - * @return {Number} The index of the `element`, or -1 if it was not found. - */ - indexOf : function( arr, element ) { - if( Array.prototype.indexOf ) { - return arr.indexOf( element ); - - } else { - for( var i = 0, len = arr.length; i < len; i++ ) { - if( arr[ i ] === element ) return i; - } - return -1; - } - }, - - - - /** - * Performs the functionality of what modern browsers do when `String.prototype.split()` is called - * with a regular expression that contains capturing parenthesis. - * - * For example: - * - * // Modern browsers: - * "a,b,c".split( /(,)/ ); // --> [ 'a', ',', 'b', ',', 'c' ] - * - * // Old IE (including IE8): - * "a,b,c".split( /(,)/ ); // --> [ 'a', 'b', 'c' ] - * - * This method emulates the functionality of modern browsers for the old IE case. - * - * @param {String} str The string to split. - * @param {RegExp} splitRegex The regular expression to split the input `str` on. The splitting - * character(s) will be spliced into the array, as in the "modern browsers" example in the - * description of this method. - * Note #1: the supplied regular expression **must** have the 'g' flag specified. - * Note #2: for simplicity's sake, the regular expression does not need - * to contain capturing parenthesis - it will be assumed that any match has them. - * @return {String[]} The split array of strings, with the splitting character(s) included. - */ - splitAndCapture : function( str, splitRegex ) { - if( !splitRegex.global ) throw new Error( "`splitRegex` must have the 'g' flag set" ); - - var result = [], - lastIdx = 0, - match; - - while( match = splitRegex.exec( str ) ) { - result.push( str.substring( lastIdx, match.index ) ); - result.push( match[ 0 ] ); // push the splitting char(s) - - lastIdx = match.index + match[ 0 ].length; - } - result.push( str.substring( lastIdx ) ); - - return result; - } - - }; - /*global Autolinker */ - /** - * @private - * @class Autolinker.HtmlParser - * @extends Object - * - * An HTML parser implementation which simply walks an HTML string and calls the provided visitor functions to process - * HTML and text nodes. - * - * Autolinker uses this to only link URLs/emails/Twitter handles within text nodes, basically ignoring HTML tags. - */ - Autolinker.HtmlParser = Autolinker.Util.extend( Object, { - - /** - * @private - * @property {RegExp} htmlRegex - * - * The regular expression used to pull out HTML tags from a string. Handles namespaced HTML tags and - * attribute names, as specified by http://www.w3.org/TR/html-markup/syntax.html. - * - * Capturing groups: - * - * 1. The "!DOCTYPE" tag name, if a tag is a <!DOCTYPE> tag. - * 2. If it is an end tag, this group will have the '/'. - * 3. The tag name for all tags (other than the <!DOCTYPE> tag) - */ - htmlRegex : (function() { - var tagNameRegex = /[0-9a-zA-Z][0-9a-zA-Z:]*/, - attrNameRegex = /[^\s\0"'>\/=\x01-\x1F\x7F]+/, // the unicode range accounts for excluding control chars, and the delete char - attrValueRegex = /(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/, // double quoted, single quoted, or unquoted attribute values - nameEqualsValueRegex = attrNameRegex.source + '(?:\\s*=\\s*' + attrValueRegex.source + ')?'; // optional '=[value]' - - return new RegExp( [ - // for tag. Ex: ) - '(?:', - '<(!DOCTYPE)', // *** Capturing Group 1 - If it's a doctype tag - - // Zero or more attributes following the tag name - '(?:', - '\\s+', // one or more whitespace chars before an attribute - - // Either: - // A. attr="value", or - // B. "value" alone (To cover example doctype tag: ) - '(?:', nameEqualsValueRegex, '|', attrValueRegex.source + ')', - ')*', - '>', - ')', - - '|', - - // All other HTML tags (i.e. tags that are not ) - '(?:', - '<(/)?', // Beginning of a tag. Either '<' for a start tag, or '' - '>', - ')' - ].join( "" ), 'gi' ); - } )(), - - - /** - * Walks an HTML string, calling the `options.processHtmlNode` function for each HTML tag that is encountered, and calling - * the `options.processTextNode` function when each text around HTML tags is encountered. - * - * @param {String} html The HTML to parse. - * @param {Object} [options] An Object (map) which may contain the following properties: - * - * @param {Function} [options.processHtmlNode] A visitor function which allows processing of an encountered HTML node. - * This function is called with the following arguments: - * @param {String} [options.processHtmlNode.tagText] The HTML tag text that was found. - * @param {String} [options.processHtmlNode.tagName] The tag name for the HTML tag that was found. Ex: 'a' for an anchor tag. - * @param {String} [options.processHtmlNode.isClosingTag] `true` if the tag is a closing tag (ex: </a>), `false` otherwise. - * - * @param {Function} [options.processTextNode] A visitor function which allows processing of an encountered text node. - * This function is called with the following arguments: - * @param {String} [options.processTextNode.text] The text node that was matched. - */ - parse : function( html, options ) { - options = options || {}; - - var processHtmlNodeVisitor = options.processHtmlNode || function() {}, - processTextNodeVisitor = options.processTextNode || function() {}, - htmlRegex = this.htmlRegex, - currentResult, - lastIndex = 0; - - // Loop over the HTML string, ignoring HTML tags, and processing the text that lies between them, - // wrapping the URLs in anchor tags - while( ( currentResult = htmlRegex.exec( html ) ) !== null ) { - var tagText = currentResult[ 0 ], - tagName = currentResult[ 1 ] || currentResult[ 3 ], // The tag (ex: "!DOCTYPE"), or another tag (ex: "a") - isClosingTag = !!currentResult[ 2 ], - inBetweenTagsText = html.substring( lastIndex, currentResult.index ); - - if( inBetweenTagsText ) { - processTextNodeVisitor( inBetweenTagsText ); - } - - processHtmlNodeVisitor( tagText, tagName.toLowerCase(), isClosingTag ); - - lastIndex = currentResult.index + tagText.length; - } - - // Process any remaining text after the last HTML element. Will process all of the text if there were no HTML elements. - if( lastIndex < html.length ) { - var text = html.substring( lastIndex ); - - if( text ) { - processTextNodeVisitor( text ); - } - } - } - - } ); - /*global Autolinker */ - /*jshint boss:true */ - /** - * @class Autolinker.HtmlTag - * @extends Object - * - * Represents an HTML tag, which can be used to easily build/modify HTML tags programmatically. - * - * Autolinker uses this abstraction to create HTML tags, and then write them out as strings. You may also use - * this class in your code, especially within a {@link Autolinker#replaceFn replaceFn}. - * - * ## Examples - * - * Example instantiation: - * - * var tag = new Autolinker.HtmlTag( { - * tagName : 'a', - * attrs : { 'href': 'http://google.com', 'class': 'external-link' }, - * innerHtml : 'Google' - * } ); - * - * tag.toString(); // Google - * - * // Individual accessor methods - * tag.getTagName(); // 'a' - * tag.getAttr( 'href' ); // 'http://google.com' - * tag.hasClass( 'external-link' ); // true - * - * - * Using mutator methods (which may be used in combination with instantiation config properties): - * - * var tag = new Autolinker.HtmlTag(); - * tag.setTagName( 'a' ); - * tag.setAttr( 'href', 'http://google.com' ); - * tag.addClass( 'external-link' ); - * tag.setInnerHtml( 'Google' ); - * - * tag.getTagName(); // 'a' - * tag.getAttr( 'href' ); // 'http://google.com' - * tag.hasClass( 'external-link' ); // true - * - * tag.toString(); // Google - * - * - * ## Example use within a {@link Autolinker#replaceFn replaceFn} - * - * var html = Autolinker.link( "Test google.com", { - * replaceFn : function( autolinker, match ) { - * var tag = autolinker.getTagBuilder().build( match ); // returns an {@link Autolinker.HtmlTag} instance, configured with the Match's href and anchor text - * tag.setAttr( 'rel', 'nofollow' ); - * - * return tag; - * } - * } ); - * - * // generated html: - * // Test google.com - * - * - * ## Example use with a new tag for the replacement - * - * var html = Autolinker.link( "Test google.com", { - * replaceFn : function( autolinker, match ) { - * var tag = new Autolinker.HtmlTag( { - * tagName : 'button', - * attrs : { 'title': 'Load URL: ' + match.getAnchorHref() }, - * innerHtml : 'Load URL: ' + match.getAnchorText() - * } ); - * - * return tag; - * } - * } ); - * - * // generated html: - * // Test - */ - Autolinker.HtmlTag = Autolinker.Util.extend( Object, { - - /** - * @cfg {String} tagName - * - * The tag name. Ex: 'a', 'button', etc. - * - * Not required at instantiation time, but should be set using {@link #setTagName} before {@link #toString} - * is executed. - */ - - /** - * @cfg {Object.} attrs - * - * An key/value Object (map) of attributes to create the tag with. The keys are the attribute names, and the - * values are the attribute values. - */ - - /** - * @cfg {String} innerHtml - * - * The inner HTML for the tag. - * - * Note the camel case name on `innerHtml`. Acronyms are camelCased in this utility (such as not to run into the acronym - * naming inconsistency that the DOM developers created with `XMLHttpRequest`). You may alternatively use {@link #innerHTML} - * if you prefer, but this one is recommended. - */ - - /** - * @cfg {String} innerHTML - * - * Alias of {@link #innerHtml}, accepted for consistency with the browser DOM api, but prefer the camelCased version - * for acronym names. - */ - - - /** - * @protected - * @property {RegExp} whitespaceRegex - * - * Regular expression used to match whitespace in a string of CSS classes. - */ - whitespaceRegex : /\s+/, - - - /** - * @constructor - * @param {Object} [cfg] The configuration properties for this class, in an Object (map) - */ - constructor : function( cfg ) { - Autolinker.Util.assign( this, cfg ); - - this.innerHtml = this.innerHtml || this.innerHTML; // accept either the camelCased form or the fully capitalized acronym - }, - - - /** - * Sets the tag name that will be used to generate the tag with. - * - * @param {String} tagName - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setTagName : function( tagName ) { - this.tagName = tagName; - return this; - }, - - - /** - * Retrieves the tag name. - * - * @return {String} - */ - getTagName : function() { - return this.tagName || ""; - }, - - - /** - * Sets an attribute on the HtmlTag. - * - * @param {String} attrName The attribute name to set. - * @param {String} attrValue The attribute value to set. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setAttr : function( attrName, attrValue ) { - var tagAttrs = this.getAttrs(); - tagAttrs[ attrName ] = attrValue; - - return this; - }, - - - /** - * Retrieves an attribute from the HtmlTag. If the attribute does not exist, returns `undefined`. - * - * @param {String} name The attribute name to retrieve. - * @return {String} The attribute's value, or `undefined` if it does not exist on the HtmlTag. - */ - getAttr : function( attrName ) { - return this.getAttrs()[ attrName ]; - }, - - - /** - * Sets one or more attributes on the HtmlTag. - * - * @param {Object.} attrs A key/value Object (map) of the attributes to set. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setAttrs : function( attrs ) { - var tagAttrs = this.getAttrs(); - Autolinker.Util.assign( tagAttrs, attrs ); - - return this; - }, - - - /** - * Retrieves the attributes Object (map) for the HtmlTag. - * - * @return {Object.} A key/value object of the attributes for the HtmlTag. - */ - getAttrs : function() { - return this.attrs || ( this.attrs = {} ); - }, - - - /** - * Sets the provided `cssClass`, overwriting any current CSS classes on the HtmlTag. - * - * @param {String} cssClass One or more space-separated CSS classes to set (overwrite). - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setClass : function( cssClass ) { - return this.setAttr( 'class', cssClass ); - }, - - - /** - * Convenience method to add one or more CSS classes to the HtmlTag. Will not add duplicate CSS classes. - * - * @param {String} cssClass One or more space-separated CSS classes to add. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - addClass : function( cssClass ) { - var classAttr = this.getClass(), - whitespaceRegex = this.whitespaceRegex, - indexOf = Autolinker.Util.indexOf, // to support IE8 and below - classes = ( !classAttr ) ? [] : classAttr.split( whitespaceRegex ), - newClasses = cssClass.split( whitespaceRegex ), - newClass; - - while( newClass = newClasses.shift() ) { - if( indexOf( classes, newClass ) === -1 ) { - classes.push( newClass ); - } - } - - this.getAttrs()[ 'class' ] = classes.join( " " ); - return this; - }, - - - /** - * Convenience method to remove one or more CSS classes from the HtmlTag. - * - * @param {String} cssClass One or more space-separated CSS classes to remove. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - removeClass : function( cssClass ) { - var classAttr = this.getClass(), - whitespaceRegex = this.whitespaceRegex, - indexOf = Autolinker.Util.indexOf, // to support IE8 and below - classes = ( !classAttr ) ? [] : classAttr.split( whitespaceRegex ), - removeClasses = cssClass.split( whitespaceRegex ), - removeClass; - - while( classes.length && ( removeClass = removeClasses.shift() ) ) { - var idx = indexOf( classes, removeClass ); - if( idx !== -1 ) { - classes.splice( idx, 1 ); - } - } - - this.getAttrs()[ 'class' ] = classes.join( " " ); - return this; - }, - - - /** - * Convenience method to retrieve the CSS class(es) for the HtmlTag, which will each be separated by spaces when - * there are multiple. - * - * @return {String} - */ - getClass : function() { - return this.getAttrs()[ 'class' ] || ""; - }, - - - /** - * Convenience method to check if the tag has a CSS class or not. - * - * @param {String} cssClass The CSS class to check for. - * @return {Boolean} `true` if the HtmlTag has the CSS class, `false` otherwise. - */ - hasClass : function( cssClass ) { - return ( ' ' + this.getClass() + ' ' ).indexOf( ' ' + cssClass + ' ' ) !== -1; - }, - - - /** - * Sets the inner HTML for the tag. - * - * @param {String} html The inner HTML to set. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setInnerHtml : function( html ) { - this.innerHtml = html; - - return this; - }, - - - /** - * Retrieves the inner HTML for the tag. - * - * @return {String} - */ - getInnerHtml : function() { - return this.innerHtml || ""; - }, - - - /** - * Override of superclass method used to generate the HTML string for the tag. - * - * @return {String} - */ - toString : function() { - var tagName = this.getTagName(), - attrsStr = this.buildAttrsStr(); - - attrsStr = ( attrsStr ) ? ' ' + attrsStr : ''; // prepend a space if there are actually attributes - - return [ '<', tagName, attrsStr, '>', this.getInnerHtml(), '' ].join( "" ); - }, - - - /** - * Support method for {@link #toString}, returns the string space-separated key="value" pairs, used to populate - * the stringified HtmlTag. - * - * @protected - * @return {String} Example return: `attr1="value1" attr2="value2"` - */ - buildAttrsStr : function() { - if( !this.attrs ) return ""; // no `attrs` Object (map) has been set, return empty string - - var attrs = this.getAttrs(), - attrsArr = []; - - for( var prop in attrs ) { - if( attrs.hasOwnProperty( prop ) ) { - attrsArr.push( prop + '="' + attrs[ prop ] + '"' ); - } - } - return attrsArr.join( " " ); - } - - } ); - /*global Autolinker */ - /*jshint scripturl:true */ - /** - * @private - * @class Autolinker.MatchValidator - * @extends Object - * - * Used by Autolinker to filter out false positives from the {@link Autolinker#matcherRegex}. - * - * Due to the limitations of regular expressions (including the missing feature of look-behinds in JS regular expressions), - * we cannot always determine the validity of a given match. This class applies a bit of additional logic to filter out any - * false positives that have been matched by the {@link Autolinker#matcherRegex}. - */ - Autolinker.MatchValidator = Autolinker.Util.extend( Object, { - - /** - * @private - * @property {RegExp} invalidProtocolRelMatchRegex - * - * The regular expression used to check a potential protocol-relative URL match, coming from the - * {@link Autolinker#matcherRegex}. A protocol-relative URL is, for example, "//yahoo.com" - * - * This regular expression checks to see if there is a word character before the '//' match in order to determine if - * we should actually autolink a protocol-relative URL. This is needed because there is no negative look-behind in - * JavaScript regular expressions. - * - * For instance, we want to autolink something like "Go to: //google.com", but we don't want to autolink something - * like "abc//google.com" - */ - invalidProtocolRelMatchRegex : /^[\w]\/\//, - - /** - * Regex to test for a full protocol, with the two trailing slashes. Ex: 'http://' - * - * @private - * @property {RegExp} hasFullProtocolRegex - */ - hasFullProtocolRegex : /^[A-Za-z][-.+A-Za-z0-9]+:\/\//, - - /** - * Regex to find the URI scheme, such as 'mailto:'. - * - * This is used to filter out 'javascript:' and 'vbscript:' schemes. - * - * @private - * @property {RegExp} uriSchemeRegex - */ - uriSchemeRegex : /^[A-Za-z][-.+A-Za-z0-9]+:/, - - /** - * Regex to determine if at least one word char exists after the protocol (i.e. after the ':') - * - * @private - * @property {RegExp} hasWordCharAfterProtocolRegex - */ - hasWordCharAfterProtocolRegex : /:[^\s]*?[A-Za-z]/, - - - /** - * Determines if a given match found by {@link Autolinker#processTextNode} is valid. Will return `false` for: - * - * 1) URL matches which do not have at least have one period ('.') in the domain name (effectively skipping over - * matches like "abc:def"). However, URL matches with a protocol will be allowed (ex: 'http://localhost') - * 2) URL matches which do not have at least one word character in the domain name (effectively skipping over - * matches like "git:1.0"). - * 3) A protocol-relative url match (a URL beginning with '//') whose previous character is a word character - * (effectively skipping over strings like "abc//google.com") - * - * Otherwise, returns `true`. - * - * @param {String} urlMatch The matched URL, if there was one. Will be an empty string if the match is not a URL match. - * @param {String} protocolUrlMatch The match URL string for a protocol match. Ex: 'http://yahoo.com'. This is used to match - * something like 'http://localhost', where we won't double check that the domain name has at least one '.' in it. - * @param {String} protocolRelativeMatch The protocol-relative string for a URL match (i.e. '//'), possibly with a preceding - * character (ex, a space, such as: ' //', or a letter, such as: 'a//'). The match is invalid if there is a word character - * preceding the '//'. - * @return {Boolean} `true` if the match given is valid and should be processed, or `false` if the match is invalid and/or - * should just not be processed. - */ - isValidMatch : function( urlMatch, protocolUrlMatch, protocolRelativeMatch ) { - if( - ( protocolUrlMatch && !this.isValidUriScheme( protocolUrlMatch ) ) || - this.urlMatchDoesNotHaveProtocolOrDot( urlMatch, protocolUrlMatch ) || // At least one period ('.') must exist in the URL match for us to consider it an actual URL, *unless* it was a full protocol match (like 'http://localhost') - this.urlMatchDoesNotHaveAtLeastOneWordChar( urlMatch, protocolUrlMatch ) || // At least one letter character must exist in the domain name after a protocol match. Ex: skip over something like "git:1.0" - this.isInvalidProtocolRelativeMatch( protocolRelativeMatch ) // A protocol-relative match which has a word character in front of it (so we can skip something like "abc//google.com") - ) { - return false; - } - - return true; - }, - - - /** - * Determines if the URI scheme is a valid scheme to be autolinked. Returns `false` if the scheme is - * 'javascript:' or 'vbscript:' - * - * @private - * @param {String} uriSchemeMatch The match URL string for a full URI scheme match. Ex: 'http://yahoo.com' - * or 'mailto:a@a.com'. - * @return {Boolean} `true` if the scheme is a valid one, `false` otherwise. - */ - isValidUriScheme : function( uriSchemeMatch ) { - var uriScheme = uriSchemeMatch.match( this.uriSchemeRegex )[ 0 ]; - - return ( uriScheme !== 'javascript:' && uriScheme !== 'vbscript:' ); - }, - - - /** - * Determines if a URL match does not have either: - * - * a) a full protocol (i.e. 'http://'), or - * b) at least one dot ('.') in the domain name (for a non-full-protocol match). - * - * Either situation is considered an invalid URL (ex: 'git:d' does not have either the '://' part, or at least one dot - * in the domain name. If the match was 'git:abc.com', we would consider this valid.) - * - * @private - * @param {String} urlMatch The matched URL, if there was one. Will be an empty string if the match is not a URL match. - * @param {String} protocolUrlMatch The match URL string for a protocol match. Ex: 'http://yahoo.com'. This is used to match - * something like 'http://localhost', where we won't double check that the domain name has at least one '.' in it. - * @return {Boolean} `true` if the URL match does not have a full protocol, or at least one dot ('.') in a non-full-protocol - * match. - */ - urlMatchDoesNotHaveProtocolOrDot : function( urlMatch, protocolUrlMatch ) { - return ( !!urlMatch && ( !protocolUrlMatch || !this.hasFullProtocolRegex.test( protocolUrlMatch ) ) && urlMatch.indexOf( '.' ) === -1 ); - }, - - - /** - * Determines if a URL match does not have at least one word character after the protocol (i.e. in the domain name). - * - * At least one letter character must exist in the domain name after a protocol match. Ex: skip over something - * like "git:1.0" - * - * @private - * @param {String} urlMatch The matched URL, if there was one. Will be an empty string if the match is not a URL match. - * @param {String} protocolUrlMatch The match URL string for a protocol match. Ex: 'http://yahoo.com'. This is used to - * know whether or not we have a protocol in the URL string, in order to check for a word character after the protocol - * separator (':'). - * @return {Boolean} `true` if the URL match does not have at least one word character in it after the protocol, `false` - * otherwise. - */ - urlMatchDoesNotHaveAtLeastOneWordChar : function( urlMatch, protocolUrlMatch ) { - if( urlMatch && protocolUrlMatch ) { - return !this.hasWordCharAfterProtocolRegex.test( urlMatch ); - } else { - return false; - } - }, - - - /** - * Determines if a protocol-relative match is an invalid one. This method returns `true` if there is a `protocolRelativeMatch`, - * and that match contains a word character before the '//' (i.e. it must contain whitespace or nothing before the '//' in - * order to be considered valid). - * - * @private - * @param {String} protocolRelativeMatch The protocol-relative string for a URL match (i.e. '//'), possibly with a preceding - * character (ex, a space, such as: ' //', or a letter, such as: 'a//'). The match is invalid if there is a word character - * preceding the '//'. - * @return {Boolean} `true` if it is an invalid protocol-relative match, `false` otherwise. - */ - isInvalidProtocolRelativeMatch : function( protocolRelativeMatch ) { - return ( !!protocolRelativeMatch && this.invalidProtocolRelMatchRegex.test( protocolRelativeMatch ) ); - } - - } ); - /*global Autolinker */ - /*jshint sub:true */ - /** - * @protected - * @class Autolinker.AnchorTagBuilder - * @extends Object - * - * Builds anchor (<a>) tags for the Autolinker utility when a match is found. - * - * Normally this class is instantiated, configured, and used internally by an {@link Autolinker} instance, but may - * actually be retrieved in a {@link Autolinker#replaceFn replaceFn} to create {@link Autolinker.HtmlTag HtmlTag} instances - * which may be modified before returning from the {@link Autolinker#replaceFn replaceFn}. For example: - * - * var html = Autolinker.link( "Test google.com", { - * replaceFn : function( autolinker, match ) { - * var tag = autolinker.getTagBuilder().build( match ); // returns an {@link Autolinker.HtmlTag} instance - * tag.setAttr( 'rel', 'nofollow' ); - * - * return tag; - * } - * } ); - * - * // generated html: - * // Test google.com - */ - Autolinker.AnchorTagBuilder = Autolinker.Util.extend( Object, { - - /** - * @cfg {Boolean} newWindow - * @inheritdoc Autolinker#newWindow - */ - - /** - * @cfg {Number} truncate - * @inheritdoc Autolinker#truncate - */ - - /** - * @cfg {String} className - * @inheritdoc Autolinker#className - */ - - - /** - * @constructor - * @param {Object} [cfg] The configuration options for the AnchorTagBuilder instance, specified in an Object (map). - */ - constructor : function( cfg ) { - Autolinker.Util.assign( this, cfg ); - }, - - - /** - * Generates the actual anchor (<a>) tag to use in place of the matched URL/email/Twitter text, - * via its `match` object. - * - * @param {Autolinker.match.Match} match The Match instance to generate an anchor tag from. - * @return {Autolinker.HtmlTag} The HtmlTag instance for the anchor tag. - */ - build : function( match ) { - var tag = new Autolinker.HtmlTag( { - tagName : 'a', - attrs : this.createAttrs( match.getType(), match.getAnchorHref() ), - innerHtml : this.processAnchorText( match.getAnchorText() ) - } ); - - return tag; - }, - - - /** - * Creates the Object (map) of the HTML attributes for the anchor (<a>) tag being generated. - * - * @protected - * @param {"url"/"email"/"twitter"} matchType The type of match that an anchor tag is being generated for. - * @param {String} href The href for the anchor tag. - * @return {Object} A key/value Object (map) of the anchor tag's attributes. - */ - createAttrs : function( matchType, anchorHref ) { - var attrs = { - 'href' : anchorHref // we'll always have the `href` attribute - }; - - var cssClass = this.createCssClass( matchType ); - if( cssClass ) { - attrs[ 'class' ] = cssClass; - } - if( this.newWindow ) { - attrs[ 'target' ] = "_blank"; - } - - return attrs; - }, - - - /** - * Creates the CSS class that will be used for a given anchor tag, based on the `matchType` and the {@link #className} - * config. - * - * @private - * @param {"url"/"email"/"twitter"} matchType The type of match that an anchor tag is being generated for. - * @return {String} The CSS class string for the link. Example return: "myLink myLink-url". If no {@link #className} - * was configured, returns an empty string. - */ - createCssClass : function( matchType ) { - var className = this.className; - - if( !className ) - return ""; - else - return className + " " + className + "-" + matchType; // ex: "myLink myLink-url", "myLink myLink-email", or "myLink myLink-twitter" - }, - - - /** - * Processes the `anchorText` by truncating the text according to the {@link #truncate} config. - * - * @private - * @param {String} anchorText The anchor tag's text (i.e. what will be displayed). - * @return {String} The processed `anchorText`. - */ - processAnchorText : function( anchorText ) { - anchorText = this.doTruncate( anchorText ); - - return anchorText; - }, - - - /** - * Performs the truncation of the `anchorText`, if the `anchorText` is longer than the {@link #truncate} option. - * Truncates the text to 2 characters fewer than the {@link #truncate} option, and adds ".." to the end. - * - * @private - * @param {String} text The anchor tag's text (i.e. what will be displayed). - * @return {String} The truncated anchor text. - */ - doTruncate : function( anchorText ) { - return Autolinker.Util.ellipsis( anchorText, this.truncate || Number.POSITIVE_INFINITY ); - } - - } ); - /*global Autolinker */ - /** - * @abstract - * @class Autolinker.match.Match - * - * Represents a match found in an input string which should be Autolinked. A Match object is what is provided in a - * {@link Autolinker#replaceFn replaceFn}, and may be used to query for details about the match. - * - * For example: - * - * var input = "..."; // string with URLs, Email Addresses, and Twitter Handles - * - * var linkedText = Autolinker.link( input, { - * replaceFn : function( autolinker, match ) { - * console.log( "href = ", match.getAnchorHref() ); - * console.log( "text = ", match.getAnchorText() ); - * - * switch( match.getType() ) { - * case 'url' : - * console.log( "url: ", match.getUrl() ); - * - * case 'email' : - * console.log( "email: ", match.getEmail() ); - * - * case 'twitter' : - * console.log( "twitter: ", match.getTwitterHandle() ); - * } - * } - * } ); - * - * See the {@link Autolinker} class for more details on using the {@link Autolinker#replaceFn replaceFn}. - */ - Autolinker.match.Match = Autolinker.Util.extend( Object, { - - /** - * @cfg {String} matchedText (required) - * - * The original text that was matched. - */ - - - /** - * @constructor - * @param {Object} cfg The configuration properties for the Match instance, specified in an Object (map). - */ - constructor : function( cfg ) { - Autolinker.Util.assign( this, cfg ); - }, - - - /** - * Returns a string name for the type of match that this class represents. - * - * @abstract - * @return {String} - */ - getType : Autolinker.Util.abstractMethod, - - - /** - * Returns the original text that was matched. - * - * @return {String} - */ - getMatchedText : function() { - return this.matchedText; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @abstract - * @return {String} - */ - getAnchorHref : Autolinker.Util.abstractMethod, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @abstract - * @return {String} - */ - getAnchorText : Autolinker.Util.abstractMethod - - } ); - /*global Autolinker */ - /** - * @class Autolinker.match.Email - * @extends Autolinker.match.Match - * - * Represents a Email match found in an input string which should be Autolinked. - * - * See this class's superclass ({@link Autolinker.match.Match}) for more details. - */ - Autolinker.match.Email = Autolinker.Util.extend( Autolinker.match.Match, { - - /** - * @cfg {String} email (required) - * - * The email address that was matched. - */ - - - /** - * Returns a string name for the type of match that this class represents. - * - * @return {String} - */ - getType : function() { - return 'email'; - }, - - - /** - * Returns the email address that was matched. - * - * @return {String} - */ - getEmail : function() { - return this.email; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @return {String} - */ - getAnchorHref : function() { - return 'mailto:' + this.email; - }, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @return {String} - */ - getAnchorText : function() { - return this.email; - } - - } ); - /*global Autolinker */ - /** - * @class Autolinker.match.Twitter - * @extends Autolinker.match.Match - * - * Represents a Twitter match found in an input string which should be Autolinked. - * - * See this class's superclass ({@link Autolinker.match.Match}) for more details. - */ - Autolinker.match.Twitter = Autolinker.Util.extend( Autolinker.match.Match, { - - /** - * @cfg {String} twitterHandle (required) - * - * The Twitter handle that was matched. - */ - - - /** - * Returns the type of match that this class represents. - * - * @return {String} - */ - getType : function() { - return 'twitter'; - }, - - - /** - * Returns a string name for the type of match that this class represents. - * - * @return {String} - */ - getTwitterHandle : function() { - return this.twitterHandle; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @return {String} - */ - getAnchorHref : function() { - return 'https://twitter.com/' + this.twitterHandle; - }, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @return {String} - */ - getAnchorText : function() { - return '@' + this.twitterHandle; - } - - } ); - /*global Autolinker */ - /** - * @class Autolinker.match.Url - * @extends Autolinker.match.Match - * - * Represents a Url match found in an input string which should be Autolinked. - * - * See this class's superclass ({@link Autolinker.match.Match}) for more details. - */ - Autolinker.match.Url = Autolinker.Util.extend( Autolinker.match.Match, { - - /** - * @cfg {String} url (required) - * - * The url that was matched. - */ - - /** - * @cfg {Boolean} protocolUrlMatch (required) - * - * `true` if the URL is a match which already has a protocol (i.e. 'http://'), `false` if the match was from a 'www' or - * known TLD match. - */ - - /** - * @cfg {Boolean} protocolRelativeMatch (required) - * - * `true` if the URL is a protocol-relative match. A protocol-relative match is a URL that starts with '//', - * and will be either http:// or https:// based on the protocol that the site is loaded under. - */ - - /** - * @cfg {Boolean} stripPrefix (required) - * @inheritdoc Autolinker#stripPrefix - */ - - - /** - * @private - * @property {RegExp} urlPrefixRegex - * - * A regular expression used to remove the 'http://' or 'https://' and/or the 'www.' from URLs. - */ - urlPrefixRegex: /^(https?:\/\/)?(www\.)?/i, - - /** - * @private - * @property {RegExp} protocolRelativeRegex - * - * The regular expression used to remove the protocol-relative '//' from the {@link #url} string, for purposes - * of {@link #getAnchorText}. A protocol-relative URL is, for example, "//yahoo.com" - */ - protocolRelativeRegex : /^\/\//, - - /** - * @private - * @property {Boolean} protocolPrepended - * - * Will be set to `true` if the 'http://' protocol has been prepended to the {@link #url} (because the - * {@link #url} did not have a protocol) - */ - protocolPrepended : false, - - - /** - * Returns a string name for the type of match that this class represents. - * - * @return {String} - */ - getType : function() { - return 'url'; - }, - - - /** - * Returns the url that was matched, assuming the protocol to be 'http://' if the original - * match was missing a protocol. - * - * @return {String} - */ - getUrl : function() { - var url = this.url; - - // if the url string doesn't begin with a protocol, assume 'http://' - if( !this.protocolRelativeMatch && !this.protocolUrlMatch && !this.protocolPrepended ) { - url = this.url = 'http://' + url; - - this.protocolPrepended = true; - } - - return url; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @return {String} - */ - getAnchorHref : function() { - var url = this.getUrl(); - - return url.replace( /&/g, '&' ); // any &'s in the URL should be converted back to '&' if they were displayed as & in the source html - }, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @return {String} - */ - getAnchorText : function() { - var anchorText = this.getUrl(); - - if( this.protocolRelativeMatch ) { - // Strip off any protocol-relative '//' from the anchor text - anchorText = this.stripProtocolRelativePrefix( anchorText ); - } - if( this.stripPrefix ) { - anchorText = this.stripUrlPrefix( anchorText ); - } - anchorText = this.removeTrailingSlash( anchorText ); // remove trailing slash, if there is one - - return anchorText; - }, - - - // --------------------------------------- - - // Utility Functionality - - /** - * Strips the URL prefix (such as "http://" or "https://") from the given text. - * - * @private - * @param {String} text The text of the anchor that is being generated, for which to strip off the - * url prefix (such as stripping off "http://") - * @return {String} The `anchorText`, with the prefix stripped. - */ - stripUrlPrefix : function( text ) { - return text.replace( this.urlPrefixRegex, '' ); - }, - - - /** - * Strips any protocol-relative '//' from the anchor text. - * - * @private - * @param {String} text The text of the anchor that is being generated, for which to strip off the - * protocol-relative prefix (such as stripping off "//") - * @return {String} The `anchorText`, with the protocol-relative prefix stripped. - */ - stripProtocolRelativePrefix : function( text ) { - return text.replace( this.protocolRelativeRegex, '' ); - }, - - - /** - * Removes any trailing slash from the given `anchorText`, in preparation for the text to be displayed. - * - * @private - * @param {String} anchorText The text of the anchor that is being generated, for which to remove any trailing - * slash ('/') that may exist. - * @return {String} The `anchorText`, with the trailing slash removed. - */ - removeTrailingSlash : function( anchorText ) { - if( anchorText.charAt( anchorText.length - 1 ) === '/' ) { - anchorText = anchorText.slice( 0, -1 ); - } - return anchorText; - } - - } ); - - return Autolinker; - - -})); diff --git a/vendors/Autolinker/Autolinker.min.js b/vendors/Autolinker/Autolinker.min.js deleted file mode 100644 index 9bb4c7112..000000000 --- a/vendors/Autolinker/Autolinker.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * Autolinker.js - * 0.15.2 - * - * Copyright(c) 2015 Gregory Jacobs - * MIT Licensed. http://www.opensource.org/licenses/mit-license.php - * - * https://github.com/gregjacobs/Autolinker.js - */ -!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.returnExportsGlobal=b()}):"object"==typeof exports?module.exports=b():a.Autolinker=b()}(this,function(){var a=function(b){a.Util.assign(this,b),this.matchValidator=new a.MatchValidator};return a.prototype={constructor:a,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,className:"",htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,matcherRegex:function(){var a=/(^|[^\w])@(\w{1,15})/,b=/(?:[\-;:&=\+\$,\w\.]+@)/,c=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,d=/(?:www\.)/,e=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,f=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,g=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",a.source,")","|","(",b.source,e.source,f.source,")","|","(","(?:","(",c.source,e.source,")","|","(?:","(.?//)?",d.source,e.source,")","|","(?:","(.?//)?",e.source,f.source,")",")","(?:"+g.source+")?",")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,link:function(b){var c=this,d=this.getHtmlParser(),e=this.htmlCharacterEntitiesRegex,f=0,g=[];return d.parse(b,{processHtmlNode:function(a,b,c){"a"===b&&(c?f=Math.max(f-1,0):f++),g.push(a)},processTextNode:function(b){if(0===f)for(var d=a.Util.splitAndCapture(b,e),h=0,i=d.length;i>h;h++){var j=d[h],k=c.processTextNode(j);g.push(k)}else g.push(b)}}),g.join("")},getHtmlParser:function(){var b=this.htmlParser;return b||(b=this.htmlParser=new a.HtmlParser),b},getTagBuilder:function(){var b=this.tagBuilder;return b||(b=this.tagBuilder=new a.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),b},processTextNode:function(a){var b=this;return a.replace(this.matcherRegex,function(a,c,d,e,f,g,h,i,j){var k=b.processCandidateMatch(a,c,d,e,f,g,h,i,j);if(k){var l=b.createMatchReturnVal(k.match,k.matchStr);return k.prefixStr+l+k.suffixStr}return a})},processCandidateMatch:function(b,c,d,e,f,g,h,i,j){var k,l=i||j,m="",n="";if(c&&!this.twitter||f&&!this.email||g&&!this.urls||!this.matchValidator.isValidMatch(g,h,l))return null;if(this.matchHasUnbalancedClosingParen(b)&&(b=b.substr(0,b.length-1),n=")"),f)k=new a.match.Email({matchedText:b,email:f});else if(c)d&&(m=d,b=b.slice(1)),k=new a.match.Twitter({matchedText:b,twitterHandle:e});else{if(l){var o=l.match(this.charBeforeProtocolRelMatchRegex)[1]||"";o&&(m=o,b=b.slice(1))}k=new a.match.Url({matchedText:b,url:b,protocolUrlMatch:!!h,protocolRelativeMatch:!!l,stripPrefix:this.stripPrefix})}return{prefixStr:m,suffixStr:n,matchStr:b,match:k}},matchHasUnbalancedClosingParen:function(a){var b=a.charAt(a.length-1);if(")"===b){var c=a.match(/\(/g),d=a.match(/\)/g),e=c&&c.length||0,f=d&&d.length||0;if(f>e)return!0}return!1},createMatchReturnVal:function(b,c){var d;if(this.replaceFn&&(d=this.replaceFn.call(this,this,b)),"string"==typeof d)return d;if(d===!1)return c;if(d instanceof a.HtmlTag)return d.toString();var e=this.getTagBuilder(),f=e.build(b);return f.toString()}},a.link=function(b,c){var d=new a(c);return d.link(b)},a.match={},a.Util={abstractMethod:function(){throw"abstract"},assign:function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a},extend:function(b,c){var d=b.prototype,e=function(){};e.prototype=d;var f;f=c.hasOwnProperty("constructor")?c.constructor:function(){d.constructor.apply(this,arguments)};var g=f.prototype=new e;return g.constructor=f,g.superclass=d,delete c.constructor,a.Util.assign(g,c),f},ellipsis:function(a,b,c){return a.length>b&&(c=null==c?"..":c,a=a.substring(0,b-c.length)+c),a},indexOf:function(a,b){if(Array.prototype.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},splitAndCapture:function(a,b){if(!b.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var c,d=[],e=0;c=b.exec(a);)d.push(a.substring(e,c.index)),d.push(c[0]),e=c.index+c[0].length;return d.push(a.substring(e)),d}},a.HtmlParser=a.Util.extend(Object,{htmlRegex:function(){var a=/[0-9a-zA-Z][0-9a-zA-Z:]*/,b=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,c=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,d=b.source+"(?:\\s*=\\s*"+c.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",d,"|",c.source+")",")*",">",")","|","(?:","<(/)?","("+a.source+")","(?:","\\s+",d,")*","\\s*/?",">",")"].join(""),"gi")}(),parse:function(a,b){b=b||{};for(var c,d=b.processHtmlNode||function(){},e=b.processTextNode||function(){},f=this.htmlRegex,g=0;null!==(c=f.exec(a));){var h=c[0],i=c[1]||c[3],j=!!c[2],k=a.substring(g,c.index);k&&e(k),d(h,i.toLowerCase(),j),g=c.index+h.length}if(g",this.getInnerHtml(),""].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var a=this.getAttrs(),b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c+'="'+a[c]+'"');return b.join(" ")}}),a.MatchValidator=a.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(a,b,c){return b&&!this.isValidUriScheme(b)||this.urlMatchDoesNotHaveProtocolOrDot(a,b)||this.urlMatchDoesNotHaveAtLeastOneWordChar(a,b)||this.isInvalidProtocolRelativeMatch(c)?!1:!0},isValidUriScheme:function(a){var b=a.match(this.uriSchemeRegex)[0];return"javascript:"!==b&&"vbscript:"!==b},urlMatchDoesNotHaveProtocolOrDot:function(a,b){return!(!a||b&&this.hasFullProtocolRegex.test(b)||-1!==a.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(a,b){return a&&b?!this.hasWordCharAfterProtocolRegex.test(a):!1},isInvalidProtocolRelativeMatch:function(a){return!!a&&this.invalidProtocolRelMatchRegex.test(a)}}),a.AnchorTagBuilder=a.Util.extend(Object,{constructor:function(b){a.Util.assign(this,b)},build:function(b){var c=new a.HtmlTag({tagName:"a",attrs:this.createAttrs(b.getType(),b.getAnchorHref()),innerHtml:this.processAnchorText(b.getAnchorText())});return c},createAttrs:function(a,b){var c={href:b},d=this.createCssClass(a);return d&&(c["class"]=d),this.newWindow&&(c.target="_blank"),c},createCssClass:function(a){var b=this.className;return b?b+" "+b+"-"+a:""},processAnchorText:function(a){return a=this.doTruncate(a)},doTruncate:function(b){return a.Util.ellipsis(b,this.truncate||Number.POSITIVE_INFINITY)}}),a.match.Match=a.Util.extend(Object,{constructor:function(b){a.Util.assign(this,b)},getType:a.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:a.Util.abstractMethod,getAnchorText:a.Util.abstractMethod}),a.match.Email=a.Util.extend(a.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),a.match.Twitter=a.Util.extend(a.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),a.match.Url=a.Util.extend(a.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var a=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(a=this.url="http://"+a,this.protocolPrepended=!0),a},getAnchorHref:function(){var a=this.getUrl();return a.replace(/&/g,"&")},getAnchorText:function(){var a=this.getUrl();return this.protocolRelativeMatch&&(a=this.stripProtocolRelativePrefix(a)),this.stripPrefix&&(a=this.stripUrlPrefix(a)),a=this.removeTrailingSlash(a)},stripUrlPrefix:function(a){return a.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(a){return a.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(a){return"/"===a.charAt(a.length-1)&&(a=a.slice(0,-1)),a}}),a}); \ No newline at end of file diff --git a/vendors/Autolinker/LICENSE b/vendors/Autolinker/LICENSE deleted file mode 100644 index 3ff145b9f..000000000 --- a/vendors/Autolinker/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Gregory Jacobs (http://greg-jacobs.com) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendors/Autolinker/README.md b/vendors/Autolinker/README.md deleted file mode 100644 index fc1660603..000000000 --- a/vendors/Autolinker/README.md +++ /dev/null @@ -1,230 +0,0 @@ -# Autolinker.js - -Because I had so much trouble finding a good autolinking implementation out in the wild, I decided to roll my own. It -seemed that everything I found out there was either an implementation that didn't cover every case, or was just limited -in one way or another. - -So, this utility attempts to handle everything. It: - -- Autolinks URLs, whether or not they start with the protocol (i.e. 'http://'). In other words, it will automatically link the - text "google.com", as well as "http://google.com". -- Will properly handle URLs with special characters -- Will properly handle URLs with query parameters or a named anchor (i.e. hash) -- Will autolink email addresses. -- Will autolink Twitter handles. -- Will properly handle HTML input. The utility will not change the `href` attribute inside anchor (<a>) tags (or any other - tag/attribute for that matter), and will not accidentally wrap the inner text of an anchor tag with a new one (which would cause - doubly-nested anchor tags). - -Hope that this utility helps you as well! - - -## Installation - -#### Download - -Simply clone or download the zip of the project, and link to either `dist/Autolinker.js` or `dist/Autolinker.min.js` with a script tag: - -```html - -``` - -#### Using with the [Bower](http://bower.io) package manager: - -Command line: - -```shell -bower install Autolinker.js --save -``` - -#### Using with [Node.js](http://nodejs.org) via [npm](https://www.npmjs.org/): - -Command Line: - -```shell -npm install autolinker --save -``` - -JavaScript: - -```javascript -var Autolinker = require( 'autolinker' ); -// note: npm wants an all-lowercase package name, but the utility is a class and should be -// aliased with a capital letter -``` - - -## Usage - -Using the static [link()](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-static-method-link) method: - -```javascript -var linkedText = Autolinker.link( textToAutolink[, options] ); -``` - -Using as a class: - -```javascript -var autolinker = new Autolinker( [ options ] ); - -var linkedText = autolinker.link( textToAutoLink ); -``` - -Note: if using the same options to autolink multiple pieces of html/text, it is slightly more efficient to create a single -Autolinker instance, and run the [link()](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-method-link) method repeatedly (i.e. use the "class" form above). - - -#### Example: - -```javascript -var linkedText = Autolinker.link( "Check out google.com", { className: "myLink" } ); -// Produces: "Check out google.com" -``` - -## Options - -These are the options which may be specified for linking. These are specified by providing an Object as the second parameter to [Autolinker.link()](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-static-method-link). These include: - -- [newWindow](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-newWindow) : Boolean
- `true` to have the links should open in a new window when clicked, `false` otherwise. Defaults to `true`.

-- [stripPrefix](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-stripPrefix) : Boolean
- `true` to have the 'http://' or 'https://' and/or the 'www.' stripped from the beginning of links, `false` otherwise. Defaults to `true`.

-- [truncate](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-truncate) : Number
- A number for how many characters long URLs/emails/twitter handles should be truncated to inside the text of a link. If the URL/email/twitter is over the number of characters, it will be truncated to this length by replacing the end of the string with a two period ellipsis ('..').

- Example: a url like 'http://www.yahoo.com/some/long/path/to/a/file' truncated to 25 characters may look like this: 'yahoo.com/some/long/pat..'

-- [className](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-className) : String
- A CSS class name to add to the generated anchor tags. This class will be added to all links, as well as this class - plus "url"/"email"/"twitter" suffixes for styling url/email/twitter links differently. - - For example, if this config is provided as "myLink", then: - - 1) URL links will have the CSS classes: "myLink myLink-url"
- 2) Email links will have the CSS classes: "myLink myLink-email", and
- 3) Twitter links will have the CSS classes: "myLink myLink-twitter"
- -- [urls](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-urls) : Boolean
- `true` to have URLs auto-linked, `false` to skip auto-linking of URLs. Defaults to `true`.
-- [email](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-email) : Boolean
- `true` to have email addresses auto-linked, `false` to skip auto-linking of email addresses. Defaults to `true`.

-- [twitter](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-twitter) : Boolean
- `true` to have Twitter handles auto-linked, `false` to skip auto-linking of Twitter handles. Defaults to `true`.

-- [replaceFn](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-replaceFn) : Function
- A function to use to programmatically make replacements of matches in the input string, one at a time. See the section - Custom Replacement Function for more details. - - -For example, if you wanted to disable links from opening in [new windows](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-newWindow), you could do: - -```javascript -var linkedText = Autolinker.link( "Check out google.com", { newWindow: false } ); -// Produces: "Check out google.com" -``` - -And if you wanted to truncate the length of URLs (while also not opening in a new window), you could do: - -```javascript -var linkedText = Autolinker.link( "http://www.yahoo.com/some/long/path/to/a/file", { truncate: 25, newWindow: false } ); -// Produces: "yahoo.com/some/long/pat.." -``` - -## More Examples -One could update an entire DOM element that has unlinked text to auto-link them as such: - -```javascript -var myTextEl = document.getElementById( 'text' ); -myTextEl.innerHTML = Autolinker.link( myTextEl.innerHTML ); -``` - -Using the same pre-configured [Autolinker](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker) instance in multiple locations of a codebase (usually by dependency injection): - -```javascript -var autolinker = new Autolinker( { newWindow: false, truncate: 25 } ); - -//... - -autolinker.link( "Check out http://www.yahoo.com/some/long/path/to/a/file" ); -// Produces: "Check out yahoo.com/some/long/pat.." - -//... - -autolinker.link( "Go to www.google.com" ); -// Produces: "Go to google.com" - -``` - - -## Custom Replacement Function - -A custom replacement function ([replaceFn](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-cfg-replaceFn)) may be provided to replace url/email/twitter matches on an individual basis, based -on the return from this function. - -Full example, for purposes of documenting the API: - -```javascript -var input = "..."; // string with URLs, Email Addresses, and Twitter Handles - -var linkedText = Autolinker.link( input, { - replaceFn : function( autolinker, match ) { - console.log( "href = ", match.getAnchorHref() ); - console.log( "text = ", match.getAnchorText() ); - - switch( match.getType() ) { - case 'url' : - console.log( "url: ", match.getUrl() ); - - if( match.getUrl().indexOf( 'mysite.com' ) === -1 ) { - var tag = autolinker.getTagBuilder().build( match ); // returns an `Autolinker.HtmlTag` instance, which provides mutator methods for easy changes - tag.setAttr( 'rel', 'nofollow' ); - tag.addClass( 'external-link' ); - - return tag; - - } else { - return true; // let Autolinker perform its normal anchor tag replacement - } - - case 'email' : - var email = match.getEmail(); - console.log( "email: ", email ); - - if( email === "my@own.address" ) { - return false; // don't auto-link this particular email address; leave as-is - } else { - return; // no return value will have Autolinker perform its normal anchor tag replacement (same as returning `true`) - } - - case 'twitter' : - var twitterHandle = match.getTwitterHandle(); - console.log( twitterHandle ); - - return '' + twitterHandle + ''; - } - } -} ); -``` - - -The function is provided two arguments: - -1. The Autolinker instance that is performing replacements. This can be used to query the options that the Autolinker - instance is configured with, or to retrieve its TagBuilder instance (via [autolinker.getTagBuilder()](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker-method-getTagBuilder)). -2. An [Autolinker.match.Match](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker.match.Match) object which details the match that is to be replaced. - - -A replacement of the match is made based on the return value of the function. The following return values may be provided: - -- No return value (`undefined`), or `true` (Boolean): Delegate back to Autolinker to replace the match as it normally would. -- `false` (Boolean): Do not replace the current match at all - leave as-is. -- Any String: If a string is returned from the function, the string will be used directly as the replacement HTML for - the match. -- An [Autolinker.HtmlTag](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker.HtmlTag) instance, which can be used to build/modify an HTML tag before writing out its HTML text. - - -## Full API Docs - -The full API docs for Autolinker may be referenced at: [http://gregjacobs.github.io/Autolinker.js/docs/](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker) - - -## Changelog - -See [Releases](https://github.com/gregjacobs/Autolinker.js/releases) diff --git a/vendors/Autolinker/_/Autolinker.js b/vendors/Autolinker/_/Autolinker.js deleted file mode 100644 index 01eaecc78..000000000 --- a/vendors/Autolinker/_/Autolinker.js +++ /dev/null @@ -1,1781 +0,0 @@ -/*! - * Autolinker.js - * 0.12.2 - * - * Copyright(c) 2014 Gregory Jacobs - * MIT Licensed. http://www.opensource.org/licenses/mit-license.php - * - * https://github.com/gregjacobs/Autolinker.js - */ -/*global define, module */ -( function( root, factory ) { - - if( typeof define === 'function' && define.amd ) { - define( factory ); // Define as AMD module if an AMD loader is present (ex: RequireJS). - } else if( typeof exports !== 'undefined' ) { - module.exports = factory(); // Define as CommonJS module for Node.js, if available. - } else { - root.Autolinker = factory(); // Finally, define as a browser global if no module loader. - } -}( this, function() { - - /** - * @class Autolinker - * @extends Object - * - * Utility class used to process a given string of text, and wrap the URLs, email addresses, and Twitter handles in - * the appropriate anchor (<a>) tags to turn them into links. - * - * Any of the configuration options may be provided in an Object (map) provided to the Autolinker constructor, which - * will configure how the {@link #link link()} method will process the links. - * - * For example: - * - * var autolinker = new Autolinker( { - * newWindow : false, - * truncate : 30 - * } ); - * - * var html = autolinker.link( "Joe went to www.yahoo.com" ); - * // produces: 'Joe went to yahoo.com' - * - * - * The {@link #static-link static link()} method may also be used to inline options into a single call, which may - * be more convenient for one-off uses. For example: - * - * var html = Autolinker.link( "Joe went to www.yahoo.com", { - * newWindow : false, - * truncate : 30 - * } ); - * // produces: 'Joe went to yahoo.com' - * - * - * ## Custom Replacements of Links - * - * If the configuration options do not provide enough flexibility, a {@link #replaceFn} may be provided to fully customize - * the output of Autolinker. This function is called once for each URL/Email/Twitter handle match that is encountered. - * - * For example: - * - * var input = "..."; // string with URLs, Email Addresses, and Twitter Handles - * - * var linkedText = Autolinker.link( input, { - * replaceFn : function( autolinker, match ) { - * console.log( "href = ", match.getAnchorHref() ); - * console.log( "text = ", match.getAnchorText() ); - * - * switch( match.getType() ) { - * case 'url' : - * console.log( "url: ", match.getUrl() ); - * - * if( match.getUrl().indexOf( 'mysite.com' ) === -1 ) { - * var tag = autolinker.getTagBuilder().build( match ); // returns an `Autolinker.HtmlTag` instance, which provides mutator methods for easy changes - * tag.setAttr( 'rel', 'nofollow' ); - * tag.addClass( 'external-link' ); - * - * return tag; - * - * } else { - * return true; // let Autolinker perform its normal anchor tag replacement - * } - * - * case 'email' : - * var email = match.getEmail(); - * console.log( "email: ", email ); - * - * if( email === "my@own.address" ) { - * return false; // don't auto-link this particular email address; leave as-is - * } else { - * return; // no return value will have Autolinker perform its normal anchor tag replacement (same as returning `true`) - * } - * - * case 'twitter' : - * var twitterHandle = match.getTwitterHandle(); - * console.log( twitterHandle ); - * - * return '' + twitterHandle + ''; - * } - * } - * } ); - * - * - * The function may return the following values: - * - * - `true` (Boolean): Allow Autolinker to replace the match as it normally would. - * - `false` (Boolean): Do not replace the current match at all - leave as-is. - * - Any String: If a string is returned from the function, the string will be used directly as the replacement HTML for - * the match. - * - An {@link Autolinker.HtmlTag} instance, which can be used to build/modify an HTML tag before writing out its HTML text. - * - * @constructor - * @param {Object} [config] The configuration options for the Autolinker instance, specified in an Object (map). - */ - var Autolinker = function( cfg ) { - Autolinker.Util.assign( this, cfg ); // assign the properties of `cfg` onto the Autolinker instance. Prototype properties will be used for missing configs. - }; - - - Autolinker.prototype = { - constructor : Autolinker, // fix constructor property - - /** - * @cfg {Boolean} urls - * - * `true` if miscellaneous URLs should be automatically linked, `false` if they should not be. - */ - urls : true, - - /** - * @cfg {Boolean} email - * - * `true` if email addresses should be automatically linked, `false` if they should not be. - */ - email : true, - - /** - * @cfg {Boolean} twitter - * - * `true` if Twitter handles ("@example") should be automatically linked, `false` if they should not be. - */ - twitter : true, - - /** - * @cfg {Boolean} newWindow - * - * `true` if the links should open in a new window, `false` otherwise. - */ - newWindow : true, - - /** - * @cfg {Boolean} stripPrefix - * - * `true` if 'http://' or 'https://' and/or the 'www.' should be stripped from the beginning of URL links' text, - * `false` otherwise. - */ - stripPrefix : true, - - /** - * @cfg {Number} truncate - * - * A number for how many characters long URLs/emails/twitter handles should be truncated to inside the text of - * a link. If the URL/email/twitter is over this number of characters, it will be truncated to this length by - * adding a two period ellipsis ('..') to the end of the string. - * - * For example: A url like 'http://www.yahoo.com/some/long/path/to/a/file' truncated to 25 characters might look - * something like this: 'yahoo.com/some/long/pat..' - */ - - /** - * @cfg {String} className - * - * A CSS class name to add to the generated links. This class will be added to all links, as well as this class - * plus url/email/twitter suffixes for styling url/email/twitter links differently. - * - * For example, if this config is provided as "myLink", then: - * - * - URL links will have the CSS classes: "myLink myLink-url" - * - Email links will have the CSS classes: "myLink myLink-email", and - * - Twitter links will have the CSS classes: "myLink myLink-twitter" - */ - className : "", - - /** - * @cfg {Function} replaceFn - * - * A function to individually process each URL/Email/Twitter match found in the input string. - * - * See the class's description for usage. - * - * This function is called with the following parameters: - * - * @cfg {Autolinker} replaceFn.autolinker The Autolinker instance, which may be used to retrieve child objects from (such - * as the instance's {@link #getTagBuilder tag builder}). - * @cfg {Autolinker.match.Match} replaceFn.match The Match instance which can be used to retrieve information about the - * {@link Autolinker.match.Url URL}/{@link Autolinker.match.Email email}/{@link Autolinker.match.Twitter Twitter} - * match that the `replaceFn` is currently processing. - */ - - - /** - * @private - * @property {RegExp} htmlCharacterEntitiesRegex - * - * The regular expression that matches common HTML character entities. - * - * Ignoring & as it could be part of a query string -- handling it separately. - */ - htmlCharacterEntitiesRegex: /( | |<|<|>|>)/gi, - - /** - * @private - * @property {RegExp} matcherRegex - * - * The regular expression that matches URLs, email addresses, and Twitter handles. - * - * This regular expression has the following capturing groups: - * - * 1. Group that is used to determine if there is a Twitter handle match (i.e. \@someTwitterUser). Simply check for its - * existence to determine if there is a Twitter handle match. The next couple of capturing groups give information - * about the Twitter handle match. - * 2. The whitespace character before the \@sign in a Twitter handle. This is needed because there are no lookbehinds in - * JS regular expressions, and can be used to reconstruct the original string in a replace(). - * 3. The Twitter handle itself in a Twitter match. If the match is '@someTwitterUser', the handle is 'someTwitterUser'. - * 4. Group that matches an email address. Used to determine if the match is an email address, as well as holding the full - * address. Ex: 'me@my.com' - * 5. Group that matches a URL in the input text. Ex: 'http://google.com', 'www.google.com', or just 'google.com'. - * This also includes a path, url parameters, or hash anchors. Ex: google.com/path/to/file?q1=1&q2=2#myAnchor - * 6. A protocol-relative ('//') match for the case of a 'www.' prefixed URL. Will be an empty string if it is not a - * protocol-relative match. We need to know the character before the '//' in order to determine if it is a valid match - * or the // was in a string we don't want to auto-link. - * 7. A protocol-relative ('//') match for the case of a known TLD prefixed URL. Will be an empty string if it is not a - * protocol-relative match. See #6 for more info. - */ - matcherRegex : (function() { - var twitterRegex = /(^|[^\w])@(\w{1,15})/, // For matching a twitter handle. Ex: @gregory_jacobs - - emailRegex = /(?:[\-;:&=\+\$,\w\.]+@)/, // something@ for email addresses (a.k.a. local-part) - - protocolRegex = /(?:[A-Za-z]{3,9}:(?:\/\/)?)/, // match protocol, allow in format http:// or mailto: - wwwRegex = /(?:www\.)/, // starting with 'www.' - domainNameRegex = /[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/, // anything looking at all like a domain, non-unicode domains, not ending in a period - tldRegex = /\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/, // match our known top level domains (TLDs) - - // Allow optional path, query string, and hash anchor, not ending in the following characters: "!:,.;" - // http://blog.codinghorror.com/the-problem-with-urls/ - urlSuffixRegex = /(?:[\-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|])?/; // note: optional part of the full regex - - return new RegExp( [ - '(', // *** Capturing group $1, which can be used to check for a twitter handle match. Use group $3 for the actual twitter handle though. $2 may be used to reconstruct the original string in a replace() - // *** Capturing group $2, which matches the whitespace character before the '@' sign (needed because of no lookbehinds), and - // *** Capturing group $3, which matches the actual twitter handle - twitterRegex.source, - ')', - - '|', - - '(', // *** Capturing group $4, which is used to determine an email match - emailRegex.source, - domainNameRegex.source, - tldRegex.source, - ')', - - '|', - - '(', // *** Capturing group $5, which is used to match a URL - '(?:', // parens to cover match for protocol (optional), and domain - '(?:', // non-capturing paren for a protocol-prefixed url (ex: http://google.com) - protocolRegex.source, - domainNameRegex.source, - ')', - - '|', - - '(?:', // non-capturing paren for a 'www.' prefixed url (ex: www.google.com) - '(.?//)?', // *** Capturing group $6 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character - wwwRegex.source, - domainNameRegex.source, - ')', - - '|', - - '(?:', // non-capturing paren for known a TLD url (ex: google.com) - '(.?//)?', // *** Capturing group $7 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character - domainNameRegex.source, - tldRegex.source, - ')', - ')', - - urlSuffixRegex.source, // match for path, query string, and/or hash anchor - ')' - ].join( "" ), 'gi' ); - } )(), - - /** - * @private - * @property {RegExp} invalidProtocolRelMatchRegex - * - * The regular expression used to check a potential protocol-relative URL match, coming from the {@link #matcherRegex}. - * A protocol-relative URL is, for example, "//yahoo.com" - * - * This regular expression is used in conjunction with the {@link #matcherRegex}, and checks to see if there is a word character - * before the '//' in order to determine if we should actually autolink a protocol-relative URL. This is needed because there - * is no negative look-behind in JavaScript regular expressions. - * - * For instance, we want to autolink something like "//google.com", but we don't want to autolink something - * like "abc//google.com" - */ - invalidProtocolRelMatchRegex : /^[\w]\/\//, - - /** - * @private - * @property {RegExp} charBeforeProtocolRelMatchRegex - * - * The regular expression used to retrieve the character before a protocol-relative URL match. - * - * This is used in conjunction with the {@link #matcherRegex}, which needs to grab the character before a protocol-relative - * '//' due to the lack of a negative look-behind in JavaScript regular expressions. The character before the match is stripped - * from the URL. - */ - charBeforeProtocolRelMatchRegex : /^(.)?\/\//, - - /** - * @private - * @property {Autolinker.HtmlParser} htmlParser - * - * The HtmlParser instance used to skip over HTML tags, while finding text nodes to process. This is lazily instantiated - * in the {@link #getHtmlParser} method. - */ - - /** - * @private - * @property {Autolinker.AnchorTagBuilder} tagBuilder - * - * The AnchorTagBuilder instance used to build the URL/email/Twitter replacement anchor tags. This is lazily instantiated - * in the {@link #getTagBuilder} method. - */ - - - /** - * Automatically links URLs, email addresses, and Twitter handles found in the given chunk of HTML. - * Does not link URLs found within HTML tags. - * - * For instance, if given the text: `You should go to http://www.yahoo.com`, then the result - * will be `You should go to <a href="http://www.yahoo.com">http://www.yahoo.com</a>` - * - * This method finds the text around any HTML elements in the input `textOrHtml`, which will be the text that is processed. - * Any original HTML elements will be left as-is, as well as the text that is already wrapped in anchor (<a>) tags. - * - * @param {String} textOrHtml The HTML or text to link URLs, email addresses, and Twitter handles within. - * @return {String} The HTML, with URLs/emails/Twitter handles automatically linked. - */ - link : function( textOrHtml ) { - var me = this, // for closure - htmlParser = this.getHtmlParser(), - htmlCharacterEntitiesRegex = this.htmlCharacterEntitiesRegex, - anchorTagStackCount = 0, // used to only process text around anchor tags, and any inner text/html they may have - resultHtml = []; - - htmlParser.parse( textOrHtml, { - // Process HTML nodes in the input `textOrHtml` - processHtmlNode : function( tagText, tagName, isClosingTag ) { - if( tagName === 'a' ) { - if( !isClosingTag ) { // it's the start tag - anchorTagStackCount++; - } else { // it's the end tag - anchorTagStackCount = Math.max( anchorTagStackCount - 1, 0 ); // attempt to handle extraneous tags by making sure the stack count never goes below 0 - } - } - resultHtml.push( tagText ); // now add the text of the tag itself verbatim - }, - - // Process text nodes in the input `textOrHtml` - processTextNode : function( text ) { - if( anchorTagStackCount === 0 ) { - // If we're not within an tag, process the text node - var unescapedText = Autolinker.Util.splitAndCapture( text, htmlCharacterEntitiesRegex ); // split at HTML entities, but include the HTML entities in the results array - - for ( var i = 0, len = unescapedText.length; i < len; i++ ) { - var textToProcess = unescapedText[ i ], - processedTextNode = me.processTextNode( textToProcess ); - - resultHtml.push( processedTextNode ); - } - - } else { - // `text` is within an tag, simply append the text - we do not want to autolink anything - // already within an ... tag - resultHtml.push( text ); - } - } - } ); - - return resultHtml.join( "" ); - }, - - - /** - * Lazily instantiates and returns the {@link #htmlParser} instance for this Autolinker instance. - * - * @protected - * @return {Autolinker.HtmlParser} - */ - getHtmlParser : function() { - var htmlParser = this.htmlParser; - - if( !htmlParser ) { - htmlParser = this.htmlParser = new Autolinker.HtmlParser(); - } - - return htmlParser; - }, - - - /** - * Returns the {@link #tagBuilder} instance for this Autolinker instance, lazily instantiating it - * if it does not yet exist. - * - * This method may be used in a {@link #replaceFn} to generate the {@link Autolinker.HtmlTag HtmlTag} instance that - * Autolinker would normally generate, and then allow for modifications before returning it. For example: - * - * var html = Autolinker.link( "Test google.com", { - * replaceFn : function( autolinker, match ) { - * var tag = autolinker.getTagBuilder().build( match ); // returns an {@link Autolinker.HtmlTag} instance - * tag.setAttr( 'rel', 'nofollow' ); - * - * return tag; - * } - * } ); - * - * // generated html: - * // Test google.com - * - * @return {Autolinker.AnchorTagBuilder} - */ - getTagBuilder : function() { - var tagBuilder = this.tagBuilder; - - if( !tagBuilder ) { - tagBuilder = this.tagBuilder = new Autolinker.AnchorTagBuilder( { - newWindow : this.newWindow, - truncate : this.truncate, - className : this.className - } ); - } - - return tagBuilder; - }, - - - /** - * Process the text that lies inbetween HTML tags. This method does the actual wrapping of URLs with - * anchor tags. - * - * @private - * @param {String} text The text to auto-link. - * @return {String} The text with anchor tags auto-filled. - */ - processTextNode : function( text ) { - var me = this, // for closure - charBeforeProtocolRelMatchRegex = this.charBeforeProtocolRelMatchRegex; - - return text.replace( this.matcherRegex, function( matchStr, $1, $2, $3, $4, $5, $6, $7 ) { - var twitterMatch = $1, - twitterHandlePrefixWhitespaceChar = $2, // The whitespace char before the @ sign in a Twitter handle match. This is needed because of no lookbehinds in JS regexes. - twitterHandle = $3, // The actual twitterUser (i.e the word after the @ sign in a Twitter handle match) - emailAddressMatch = $4, // For both determining if it is an email address, and stores the actual email address - urlMatch = $5, // The matched URL string - protocolRelativeMatch = $6 || $7, // The '//' for a protocol-relative match, with the character that comes before the '//' - - prefixStr = "", // A string to use to prefix the anchor tag that is created. This is needed for the Twitter handle match - suffixStr = "", // A string to suffix the anchor tag that is created. This is used if there is a trailing parenthesis that should not be auto-linked. - - match; // Will be an Autolinker.match.Match object - - - // Return out with no changes for match types that are disabled (url, email, twitter), or for matches that are - // invalid (false positives from the matcherRegex, which can't use look-behinds since they are unavailable in JS). - if( !me.isValidMatch( twitterMatch, emailAddressMatch, urlMatch, protocolRelativeMatch ) ) { - return matchStr; - } - - // Handle a closing parenthesis at the end of the match, and exclude it if there is not a matching open parenthesis - // in the match itself. - if( me.matchHasUnbalancedClosingParen( matchStr ) ) { - matchStr = matchStr.substr( 0, matchStr.length - 1 ); // remove the trailing ")" - suffixStr = ")"; // this will be added after the generated tag - } - - - if( emailAddressMatch ) { - match = new Autolinker.match.Email( { matchedText: matchStr, email: emailAddressMatch } ); - - } else if( twitterMatch ) { - // fix up the `matchStr` if there was a preceding whitespace char, which was needed to determine the match - // itself (since there are no look-behinds in JS regexes) - if( twitterHandlePrefixWhitespaceChar ) { - prefixStr = twitterHandlePrefixWhitespaceChar; - matchStr = matchStr.slice( 1 ); // remove the prefixed whitespace char from the match - } - match = new Autolinker.match.Twitter( { matchedText: matchStr, twitterHandle: twitterHandle } ); - - } else { // url match - // If it's a protocol-relative '//' match, remove the character before the '//' (which the matcherRegex needed - // to match due to the lack of a negative look-behind in JavaScript regular expressions) - if( protocolRelativeMatch ) { - var charBeforeMatch = protocolRelativeMatch.match( charBeforeProtocolRelMatchRegex )[ 1 ] || ""; - - if( charBeforeMatch ) { // fix up the `matchStr` if there was a preceding char before a protocol-relative match, which was needed to determine the match itself (since there are no look-behinds in JS regexes) - prefixStr = charBeforeMatch; - matchStr = matchStr.slice( 1 ); // remove the prefixed char from the match - } - } - - match = new Autolinker.match.Url( { - matchedText : matchStr, - url : matchStr, - protocolRelativeMatch : protocolRelativeMatch, - stripPrefix : me.stripPrefix - } ); - } - - // Generate the replacement text for the match - var matchReturnVal = me.createMatchReturnVal( match, matchStr ); - return prefixStr + matchReturnVal + suffixStr; - } ); - }, - - - /** - * Determines if a given match found by {@link #processTextNode} is valid. Will return `false` for: - * - * 1) Disabled link types (i.e. having a Twitter match, but {@link #twitter} matching is disabled) - * 2) URL matches which do not have at least have one period ('.') in the domain name (effectively skipping over - * matches like "abc:def") - * 3) A protocol-relative url match (a URL beginning with '//') whose previous character is a word character - * (effectively skipping over strings like "abc//google.com") - * - * Otherwise, returns `true`. - * - * @private - * @param {String} twitterMatch The matched Twitter handle, if there was one. Will be empty string if the match is not a - * Twitter match. - * @param {String} emailAddressMatch The matched Email address, if there was one. Will be empty string if the match is not - * an Email address match. - * @param {String} urlMatch The matched URL, if there was one. Will be an empty string if the match is not a URL match. - * @param {String} protocolRelativeMatch The protocol-relative string for a URL match (i.e. '//'), possibly with a preceding - * character (ex, a space, such as: ' //', or a letter, such as: 'a//'). The match is invalid if there is a word character - * preceding the '//'. - * @return {Boolean} `true` if the match given is valid and should be processed, or `false` if the match is invalid and/or - * should just not be processed (such as, if it's a Twitter match, but {@link #twitter} matching is disabled}. - */ - isValidMatch : function( twitterMatch, emailAddressMatch, urlMatch, protocolRelativeMatch ) { - if( - ( twitterMatch && !this.twitter ) || ( emailAddressMatch && !this.email ) || ( urlMatch && !this.urls ) || - ( urlMatch && urlMatch.indexOf( '.' ) === -1 ) || // At least one period ('.') must exist in the URL match for us to consider it an actual URL - ( urlMatch && /^[A-Za-z]{3,9}:/.test( urlMatch ) && !/:.*?[A-Za-z]/.test( urlMatch ) ) || // At least one letter character must exist in the domain name after a protocol match. Ex: skip over something like "git:1.0" - ( protocolRelativeMatch && this.invalidProtocolRelMatchRegex.test( protocolRelativeMatch ) ) // a protocol-relative match which has a word character in front of it (so we can skip something like "abc//google.com") - ) { - return false; - } - - return true; - }, - - - /** - * Determines if a match found has an unmatched closing parenthesis. If so, this parenthesis will be removed - * from the match itself, and appended after the generated anchor tag in {@link #processTextNode}. - * - * A match may have an extra closing parenthesis at the end of the match because the regular expression must include parenthesis - * for URLs such as "wikipedia.com/something_(disambiguation)", which should be auto-linked. - * - * However, an extra parenthesis *will* be included when the URL itself is wrapped in parenthesis, such as in the case of - * "(wikipedia.com/something_(disambiguation))". In this case, the last closing parenthesis should *not* be part of the URL - * itself, and this method will return `true`. - * - * @private - * @param {String} matchStr The full match string from the {@link #matcherRegex}. - * @return {Boolean} `true` if there is an unbalanced closing parenthesis at the end of the `matchStr`, `false` otherwise. - */ - matchHasUnbalancedClosingParen : function( matchStr ) { - var lastChar = matchStr.charAt( matchStr.length - 1 ); - - if( lastChar === ')' ) { - var openParensMatch = matchStr.match( /\(/g ), - closeParensMatch = matchStr.match( /\)/g ), - numOpenParens = ( openParensMatch && openParensMatch.length ) || 0, - numCloseParens = ( closeParensMatch && closeParensMatch.length ) || 0; - - if( numOpenParens < numCloseParens ) { - return true; - } - } - - return false; - }, - - - /** - * Creates the return string value for a given match in the input string, for the {@link #processTextNode} method. - * - * This method handles the {@link #replaceFn}, if one was provided. - * - * @private - * @param {Autolinker.match.Match} match The Match object that represents the match. - * @param {String} matchStr The original match string, after having been preprocessed to fix match edge cases (see - * the `prefixStr` and `suffixStr` vars in {@link #processTextNode}. - * @return {String} The string that the `match` should be replaced with. This is usually the anchor tag string, but - * may be the `matchStr` itself if the match is not to be replaced. - */ - createMatchReturnVal : function( match, matchStr ) { - // Handle a custom `replaceFn` being provided - var replaceFnResult; - if( this.replaceFn ) { - replaceFnResult = this.replaceFn.call( this, this, match ); // Autolinker instance is the context, and the first arg - } - - if( typeof replaceFnResult === 'string' ) { - return replaceFnResult; // `replaceFn` returned a string, use that - - } else if( replaceFnResult === false ) { - return matchStr; // no replacement for the match - - } else if( replaceFnResult instanceof Autolinker.HtmlTag ) { - return replaceFnResult.toString(); - - } else { // replaceFnResult === true, or no/unknown return value from function - // Perform Autolinker's default anchor tag generation - var tagBuilder = this.getTagBuilder(), - anchorTag = tagBuilder.build( match ); // returns an Autolinker.HtmlTag instance - - return anchorTag.toString(); - } - } - - }; - - - /** - * Automatically links URLs, email addresses, and Twitter handles found in the given chunk of HTML. - * Does not link URLs found within HTML tags. - * - * For instance, if given the text: `You should go to http://www.yahoo.com`, then the result - * will be `You should go to <a href="http://www.yahoo.com">http://www.yahoo.com</a>` - * - * Example: - * - * var linkedText = Autolinker.link( "Go to google.com", { newWindow: false } ); - * // Produces: "Go to google.com" - * - * @static - * @method link - * @param {String} html The HTML text to link URLs within. - * @param {Object} [options] Any of the configuration options for the Autolinker class, specified in an Object (map). - * See the class description for an example call. - * @return {String} The HTML text, with URLs automatically linked - */ - Autolinker.link = function( text, options ) { - var autolinker = new Autolinker( options ); - return autolinker.link( text ); - }; - - - // Namespace for `match` classes - Autolinker.match = {}; - /*global Autolinker */ - /*jshint eqnull:true, boss:true */ - /** - * @class Autolinker.Util - * @singleton - * - * A few utility methods for Autolinker. - */ - Autolinker.Util = { - - /** - * @property {Function} abstractMethod - * - * A function object which represents an abstract method. - */ - abstractMethod : function() { throw "abstract"; }, - - - /** - * Assigns (shallow copies) the properties of `src` onto `dest`. - * - * @param {Object} dest The destination object. - * @param {Object} src The source object. - * @return {Object} The destination object. - */ - assign : function( dest, src ) { - for( var prop in src ) { - if( src.hasOwnProperty( prop ) ) { - dest[ prop ] = src[ prop ]; - } - } - - return dest; - }, - - - /** - * Extends `superclass` to create a new subclass, adding the `protoProps` to the new subclass's prototype. - * - * @param {Function} superclass The constructor function for the superclass. - * @param {Object} protoProps The methods/properties to add to the subclass's prototype. This may contain the - * special property `constructor`, which will be used as the new subclass's constructor function. - * @return {Function} The new subclass function. - */ - extend : function( superclass, protoProps ) { - var superclassProto = superclass.prototype; - - var F = function() {}; - F.prototype = superclassProto; - - var subclass; - if( protoProps.hasOwnProperty( 'constructor' ) ) { - subclass = protoProps.constructor; - } else { - subclass = function() { superclassProto.constructor.apply( this, arguments ); }; - } - - var subclassProto = subclass.prototype = new F(); // set up prototype chain - subclassProto.constructor = subclass; // fix constructor property - subclassProto.superclass = superclassProto; - - delete protoProps.constructor; // don't re-assign constructor property to the prototype, since a new function may have been created (`subclass`), which is now already there - Autolinker.Util.assign( subclassProto, protoProps ); - - return subclass; - }, - - - /** - * Truncates the `str` at `len - ellipsisChars.length`, and adds the `ellipsisChars` to the - * end of the string (by default, two periods: '..'). If the `str` length does not exceed - * `len`, the string will be returned unchanged. - * - * @param {String} str The string to truncate and add an ellipsis to. - * @param {Number} truncateLen The length to truncate the string at. - * @param {String} [ellipsisChars=..] The ellipsis character(s) to add to the end of `str` - * when truncated. Defaults to '..' - */ - ellipsis : function( str, truncateLen, ellipsisChars ) { - if( str.length > truncateLen ) { - ellipsisChars = ( ellipsisChars == null ) ? '..' : ellipsisChars; - str = str.substring( 0, truncateLen - ellipsisChars.length ) + ellipsisChars; - } - return str; - }, - - - /** - * Supports `Array.prototype.indexOf()` functionality for old IE (IE8 and below). - * - * @param {Array} arr The array to find an element of. - * @param {*} element The element to find in the array, and return the index of. - * @return {Number} The index of the `element`, or -1 if it was not found. - */ - indexOf : function( arr, element ) { - if( Array.prototype.indexOf ) { - return arr.indexOf( element ); - - } else { - for( var i = 0, len = arr.length; i < len; i++ ) { - if( arr[ i ] === element ) return i; - } - return -1; - } - }, - - - - /** - * Performs the functionality of what modern browsers do when `String.prototype.split()` is called - * with a regular expression that contains capturing parenthesis. - * - * For example: - * - * // Modern browsers: - * "a,b,c".split( /(,)/ ); // --> [ 'a', ',', 'b', ',', 'c' ] - * - * // Old IE (including IE8): - * "a,b,c".split( /(,)/ ); // --> [ 'a', 'b', 'c' ] - * - * This method emulates the functionality of modern browsers for the old IE case. - * - * @param {String} str The string to split. - * @param {RegExp} splitRegex The regular expression to split the input `str` on. The splitting - * character(s) will be spliced into the array, as in the "modern browsers" example in the - * description of this method. - * Note #1: the supplied regular expression **must** have the 'g' flag specified. - * Note #2: for simplicity's sake, the regular expression does not need - * to contain capturing parenthesis - it will be assumed that any match has them. - * @return {String[]} The split array of strings, with the splitting character(s) included. - */ - splitAndCapture : function( str, splitRegex ) { - if( !splitRegex.global ) throw new Error( "`splitRegex` must have the 'g' flag set" ); - - var result = [], - lastIdx = 0, - match; - - while( match = splitRegex.exec( str ) ) { - result.push( str.substring( lastIdx, match.index ) ); - result.push( match[ 0 ] ); // push the splitting char(s) - - lastIdx = match.index + match[ 0 ].length; - } - result.push( str.substring( lastIdx ) ); - - return result; - } - - }; - /*global Autolinker */ - /** - * @private - * @class Autolinker.HtmlParser - * @extends Object - * - * An HTML parser implementation which simply walks an HTML string and calls the provided visitor functions to process - * HTML and text nodes. - * - * Autolinker uses this to only link URLs/emails/Twitter handles within text nodes, basically ignoring HTML tags. - */ - Autolinker.HtmlParser = Autolinker.Util.extend( Object, { - - /** - * @private - * @property {RegExp} htmlRegex - * - * The regular expression used to pull out HTML tags from a string. Handles namespaced HTML tags and - * attribute names, as specified by http://www.w3.org/TR/html-markup/syntax.html. - * - * Capturing groups: - * - * 1. If it is an end tag, this group will have the '/'. - * 2. The tag name. - */ - htmlRegex : (function() { - var tagNameRegex = /[0-9a-zA-Z:]+/, - attrNameRegex = /[^\s\0"'>\/=\x01-\x1F\x7F]+/, // the unicode range accounts for excluding control chars, and the delete char - attrValueRegex = /(?:".*?"|'.*?'|[^'"=<>`\s]+)/, // double quoted, single quoted, or unquoted attribute values - nameEqualsValueRegex = attrNameRegex.source + '(?:\\s*=\\s*' + attrValueRegex.source + ')?'; // optional '=[value]' - - return new RegExp( [ - '<(?:!|(/))?', // Beginning of a tag. Either '<' for a start tag, ' tag. The slash or an empty string is Capturing Group 1. - - // The tag name (Capturing Group 2) - '(' + tagNameRegex.source + ')', - - // Zero or more attributes following the tag name - '(?:', - '\\s+', // one or more whitespace chars before an attribute - - // Either: - // A. tag="value", or - // B. "value" alone (for tag. Ex: ) - '(?:', nameEqualsValueRegex, '|', attrValueRegex.source + ')', - ')*', - - '\\s*/?', // any trailing spaces and optional '/' before the closing '>' - '>' - ].join( "" ), 'g' ); - } )(), - - - /** - * Walks an HTML string, calling the `options.processHtmlNode` function for each HTML tag that is encountered, and calling - * the `options.processTextNode` function when each text around HTML tags is encountered. - * - * @param {String} html The HTML to parse. - * @param {Object} [options] An Object (map) which may contain the following properties: - * - * @param {Function} [options.processHtmlNode] A visitor function which allows processing of an encountered HTML node. - * This function is called with the following arguments: - * @param {String} [options.processHtmlNode.tagText] The HTML tag text that was found. - * @param {String} [options.processHtmlNode.tagName] The tag name for the HTML tag that was found. Ex: 'a' for an anchor tag. - * @param {String} [options.processHtmlNode.isClosingTag] `true` if the tag is a closing tag (ex: </a>), `false` otherwise. - * - * @param {Function} [options.processTextNode] A visitor function which allows processing of an encountered text node. - * This function is called with the following arguments: - * @param {String} [options.processTextNode.text] The text node that was matched. - */ - parse : function( html, options ) { - options = options || {}; - - var processHtmlNodeVisitor = options.processHtmlNode || function() {}, - processTextNodeVisitor = options.processTextNode || function() {}, - htmlRegex = this.htmlRegex, - currentResult, - lastIndex = 0; - - // Loop over the HTML string, ignoring HTML tags, and processing the text that lies between them, - // wrapping the URLs in anchor tags - while( ( currentResult = htmlRegex.exec( html ) ) !== null ) { - var tagText = currentResult[ 0 ], - tagName = currentResult[ 2 ], - isClosingTag = !!currentResult[ 1 ], - inBetweenTagsText = html.substring( lastIndex, currentResult.index ); - - if( inBetweenTagsText ) { - processTextNodeVisitor( inBetweenTagsText ); - } - - processHtmlNodeVisitor( tagText, tagName, isClosingTag ); - - lastIndex = currentResult.index + tagText.length; - } - - // Process any remaining text after the last HTML element. Will process all of the text if there were no HTML elements. - if( lastIndex < html.length ) { - var text = html.substring( lastIndex ); - - if( text ) { - processTextNodeVisitor( text ); - } - } - } - - } ); - /*global Autolinker */ - /*jshint boss:true */ - /** - * @class Autolinker.HtmlTag - * @extends Object - * - * Represents an HTML tag, which can be used to easily build/modify HTML tags programmatically. - * - * Autolinker uses this abstraction to create HTML tags, and then write them out as strings. You may also use - * this class in your code, especially within a {@link Autolinker#replaceFn replaceFn}. - * - * ## Examples - * - * Example instantiation: - * - * var tag = new Autolinker.HtmlTag( { - * tagName : 'a', - * attrs : { 'href': 'http://google.com', 'class': 'external-link' }, - * innerHtml : 'Google' - * } ); - * - * tag.toString(); // Google - * - * // Individual accessor methods - * tag.getTagName(); // 'a' - * tag.getAttr( 'href' ); // 'http://google.com' - * tag.hasClass( 'external-link' ); // true - * - * - * Using mutator methods (which may be used in combination with instantiation config properties): - * - * var tag = new Autolinker.HtmlTag(); - * tag.setTagName( 'a' ); - * tag.setAttr( 'href', 'http://google.com' ); - * tag.addClass( 'external-link' ); - * tag.setInnerHtml( 'Google' ); - * - * tag.getTagName(); // 'a' - * tag.getAttr( 'href' ); // 'http://google.com' - * tag.hasClass( 'external-link' ); // true - * - * tag.toString(); // Google - * - * - * ## Example use within a {@link Autolinker#replaceFn replaceFn} - * - * var html = Autolinker.link( "Test google.com", { - * replaceFn : function( autolinker, match ) { - * var tag = autolinker.getTagBuilder().build( match ); // returns an {@link Autolinker.HtmlTag} instance, configured with the Match's href and anchor text - * tag.setAttr( 'rel', 'nofollow' ); - * - * return tag; - * } - * } ); - * - * // generated html: - * // Test google.com - * - * - * ## Example use with a new tag for the replacement - * - * var html = Autolinker.link( "Test google.com", { - * replaceFn : function( autolinker, match ) { - * var tag = new Autolinker.HtmlTag( { - * tagName : 'button', - * attrs : { 'title': 'Load URL: ' + match.getAnchorHref() }, - * innerHtml : 'Load URL: ' + match.getAnchorText() - * } ); - * - * return tag; - * } - * } ); - * - * // generated html: - * // Test - */ - Autolinker.HtmlTag = Autolinker.Util.extend( Object, { - - /** - * @cfg {String} tagName - * - * The tag name. Ex: 'a', 'button', etc. - * - * Not required at instantiation time, but should be set using {@link #setTagName} before {@link #toString} - * is executed. - */ - - /** - * @cfg {Object.} attrs - * - * An key/value Object (map) of attributes to create the tag with. The keys are the attribute names, and the - * values are the attribute values. - */ - - /** - * @cfg {String} innerHtml - * - * The inner HTML for the tag. - * - * Note the camel case name on `innerHtml`. Acronyms are camelCased in this utility (such as not to run into the acronym - * naming inconsistency that the DOM developers created with `XMLHttpRequest`). You may alternatively use {@link #innerHTML} - * if you prefer, but this one is recommended. - */ - - /** - * @cfg {String} innerHTML - * - * Alias of {@link #innerHtml}, accepted for consistency with the browser DOM api, but prefer the camelCased version - * for acronym names. - */ - - - /** - * @protected - * @property {RegExp} whitespaceRegex - * - * Regular expression used to match whitespace in a string of CSS classes. - */ - whitespaceRegex : /\s+/, - - - /** - * @constructor - * @param {Object} [cfg] The configuration properties for this class, in an Object (map) - */ - constructor : function( cfg ) { - Autolinker.Util.assign( this, cfg ); - - this.innerHtml = this.innerHtml || this.innerHTML; // accept either the camelCased form or the fully capitalized acronym - }, - - - /** - * Sets the tag name that will be used to generate the tag with. - * - * @param {String} tagName - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setTagName : function( tagName ) { - this.tagName = tagName; - return this; - }, - - - /** - * Retrieves the tag name. - * - * @return {String} - */ - getTagName : function() { - return this.tagName || ""; - }, - - - /** - * Sets an attribute on the HtmlTag. - * - * @param {String} attrName The attribute name to set. - * @param {String} attrValue The attribute value to set. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setAttr : function( attrName, attrValue ) { - var tagAttrs = this.getAttrs(); - tagAttrs[ attrName ] = attrValue; - - return this; - }, - - - /** - * Retrieves an attribute from the HtmlTag. If the attribute does not exist, returns `undefined`. - * - * @param {String} name The attribute name to retrieve. - * @return {String} The attribute's value, or `undefined` if it does not exist on the HtmlTag. - */ - getAttr : function( attrName ) { - return this.getAttrs()[ attrName ]; - }, - - - /** - * Sets one or more attributes on the HtmlTag. - * - * @param {Object.} attrs A key/value Object (map) of the attributes to set. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setAttrs : function( attrs ) { - var tagAttrs = this.getAttrs(); - Autolinker.Util.assign( tagAttrs, attrs ); - - return this; - }, - - - /** - * Retrieves the attributes Object (map) for the HtmlTag. - * - * @return {Object.} A key/value object of the attributes for the HtmlTag. - */ - getAttrs : function() { - return this.attrs || ( this.attrs = {} ); - }, - - - /** - * Sets the provided `cssClass`, overwriting any current CSS classes on the HtmlTag. - * - * @param {String} cssClass One or more space-separated CSS classes to set (overwrite). - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setClass : function( cssClass ) { - return this.setAttr( 'class', cssClass ); - }, - - - /** - * Convenience method to add one or more CSS classes to the HtmlTag. Will not add duplicate CSS classes. - * - * @param {String} cssClass One or more space-separated CSS classes to add. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - addClass : function( cssClass ) { - var classAttr = this.getClass(), - whitespaceRegex = this.whitespaceRegex, - indexOf = Autolinker.Util.indexOf, // to support IE8 and below - classes = ( !classAttr ) ? [] : classAttr.split( whitespaceRegex ), - newClasses = cssClass.split( whitespaceRegex ), - newClass; - - while( newClass = newClasses.shift() ) { - if( indexOf( classes, newClass ) === -1 ) { - classes.push( newClass ); - } - } - - this.getAttrs()[ 'class' ] = classes.join( " " ); - return this; - }, - - - /** - * Convenience method to remove one or more CSS classes from the HtmlTag. - * - * @param {String} cssClass One or more space-separated CSS classes to remove. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - removeClass : function( cssClass ) { - var classAttr = this.getClass(), - whitespaceRegex = this.whitespaceRegex, - indexOf = Autolinker.Util.indexOf, // to support IE8 and below - classes = ( !classAttr ) ? [] : classAttr.split( whitespaceRegex ), - removeClasses = cssClass.split( whitespaceRegex ), - removeClass; - - while( classes.length && ( removeClass = removeClasses.shift() ) ) { - var idx = indexOf( classes, removeClass ); - if( idx !== -1 ) { - classes.splice( idx, 1 ); - } - } - - this.getAttrs()[ 'class' ] = classes.join( " " ); - return this; - }, - - - /** - * Convenience method to retrieve the CSS class(es) for the HtmlTag, which will each be separated by spaces when - * there are multiple. - * - * @return {String} - */ - getClass : function() { - return this.getAttrs()[ 'class' ] || ""; - }, - - - /** - * Convenience method to check if the tag has a CSS class or not. - * - * @param {String} cssClass The CSS class to check for. - * @return {Boolean} `true` if the HtmlTag has the CSS class, `false` otherwise. - */ - hasClass : function( cssClass ) { - return ( ' ' + this.getClass() + ' ' ).indexOf( ' ' + cssClass + ' ' ) !== -1; - }, - - - /** - * Sets the inner HTML for the tag. - * - * @param {String} html The inner HTML to set. - * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained. - */ - setInnerHtml : function( html ) { - this.innerHtml = html; - - return this; - }, - - - /** - * Retrieves the inner HTML for the tag. - * - * @return {String} - */ - getInnerHtml : function() { - return this.innerHtml || ""; - }, - - - /** - * Override of superclass method used to generate the HTML string for the tag. - * - * @return {String} - */ - toString : function() { - var tagName = this.getTagName(), - attrsStr = this.buildAttrsStr(); - - attrsStr = ( attrsStr ) ? ' ' + attrsStr : ''; // prepend a space if there are actually attributes - - return [ '<', tagName, attrsStr, '>', this.getInnerHtml(), '' ].join( "" ); - }, - - - /** - * Support method for {@link #toString}, returns the string space-separated key="value" pairs, used to populate - * the stringified HtmlTag. - * - * @protected - * @return {String} Example return: `attr1="value1" attr2="value2"` - */ - buildAttrsStr : function() { - if( !this.attrs ) return ""; // no `attrs` Object (map) has been set, return empty string - - var attrs = this.getAttrs(), - attrsArr = []; - - for( var prop in attrs ) { - if( attrs.hasOwnProperty( prop ) ) { - attrsArr.push( prop + '="' + attrs[ prop ] + '"' ); - } - } - return attrsArr.join( " " ); - } - - } ); - /*global Autolinker */ - /*jshint sub:true */ - /** - * @protected - * @class Autolinker.AnchorTagBuilder - * @extends Object - * - * Builds anchor (<a>) tags for the Autolinker utility when a match is found. - * - * Normally this class is instantiated, configured, and used internally by an {@link Autolinker} instance, but may - * actually be retrieved in a {@link Autolinker#replaceFn replaceFn} to create {@link Autolinker.HtmlTag HtmlTag} instances - * which may be modified before returning from the {@link Autolinker#replaceFn replaceFn}. For example: - * - * var html = Autolinker.link( "Test google.com", { - * replaceFn : function( autolinker, match ) { - * var tag = autolinker.getTagBuilder().build( match ); // returns an {@link Autolinker.HtmlTag} instance - * tag.setAttr( 'rel', 'nofollow' ); - * - * return tag; - * } - * } ); - * - * // generated html: - * // Test google.com - */ - Autolinker.AnchorTagBuilder = Autolinker.Util.extend( Object, { - - /** - * @cfg {Boolean} newWindow - * @inheritdoc Autolinker#newWindow - */ - - /** - * @cfg {Number} truncate - * @inheritdoc Autolinker#truncate - */ - - /** - * @cfg {String} className - * @inheritdoc Autolinker#className - */ - - - /** - * @constructor - * @param {Object} [cfg] The configuration options for the AnchorTagBuilder instance, specified in an Object (map). - */ - constructor : function( cfg ) { - Autolinker.Util.assign( this, cfg ); - }, - - - /** - * Generates the actual anchor (<a>) tag to use in place of the matched URL/email/Twitter text, - * via its `match` object. - * - * @param {Autolinker.match.Match} match The Match instance to generate an anchor tag from. - * @return {Autolinker.HtmlTag} The HtmlTag instance for the anchor tag. - */ - build : function( match ) { - var tag = new Autolinker.HtmlTag( { - tagName : 'a', - attrs : this.createAttrs( match.getType(), match.getAnchorHref() ), - innerHtml : this.processAnchorText( match.getAnchorText() ) - } ); - - return tag; - }, - - - /** - * Creates the Object (map) of the HTML attributes for the anchor (<a>) tag being generated. - * - * @protected - * @param {"url"/"email"/"twitter"} matchType The type of match that an anchor tag is being generated for. - * @param {String} href The href for the anchor tag. - * @return {Object} A key/value Object (map) of the anchor tag's attributes. - */ - createAttrs : function( matchType, anchorHref ) { - var attrs = { - 'href' : anchorHref // we'll always have the `href` attribute - }; - - var cssClass = this.createCssClass( matchType ); - if( cssClass ) { - attrs[ 'class' ] = cssClass; - } - if( this.newWindow ) { - attrs[ 'target' ] = "_blank"; - } - - return attrs; - }, - - - /** - * Creates the CSS class that will be used for a given anchor tag, based on the `matchType` and the {@link #className} - * config. - * - * @private - * @param {"url"/"email"/"twitter"} matchType The type of match that an anchor tag is being generated for. - * @return {String} The CSS class string for the link. Example return: "myLink myLink-url". If no {@link #className} - * was configured, returns an empty string. - */ - createCssClass : function( matchType ) { - var className = this.className; - - if( !className ) - return ""; - else - return className + " " + className + "-" + matchType; // ex: "myLink myLink-url", "myLink myLink-email", or "myLink myLink-twitter" - }, - - - /** - * Processes the `anchorText` by truncating the text according to the {@link #truncate} config. - * - * @private - * @param {String} anchorText The anchor tag's text (i.e. what will be displayed). - * @return {String} The processed `anchorText`. - */ - processAnchorText : function( anchorText ) { - anchorText = this.doTruncate( anchorText ); - - return anchorText; - }, - - - /** - * Performs the truncation of the `anchorText`, if the `anchorText` is longer than the {@link #truncate} option. - * Truncates the text to 2 characters fewer than the {@link #truncate} option, and adds ".." to the end. - * - * @private - * @param {String} text The anchor tag's text (i.e. what will be displayed). - * @return {String} The truncated anchor text. - */ - doTruncate : function( anchorText ) { - return Autolinker.Util.ellipsis( anchorText, this.truncate || Number.POSITIVE_INFINITY ); - } - - } ); - /*global Autolinker */ - /** - * @abstract - * @class Autolinker.match.Match - * - * Represents a match found in an input string which should be Autolinked. A Match object is what is provided in a - * {@link Autolinker#replaceFn replaceFn}, and may be used to query for details about the match. - * - * For example: - * - * var input = "..."; // string with URLs, Email Addresses, and Twitter Handles - * - * var linkedText = Autolinker.link( input, { - * replaceFn : function( autolinker, match ) { - * console.log( "href = ", match.getAnchorHref() ); - * console.log( "text = ", match.getAnchorText() ); - * - * switch( match.getType() ) { - * case 'url' : - * console.log( "url: ", match.getUrl() ); - * - * case 'email' : - * console.log( "email: ", match.getEmail() ); - * - * case 'twitter' : - * console.log( "twitter: ", match.getTwitterHandle() ); - * } - * } - * } ); - * - * See the {@link Autolinker} class for more details on using the {@link Autolinker#replaceFn replaceFn}. - */ - Autolinker.match.Match = Autolinker.Util.extend( Object, { - - /** - * @cfg {String} matchedText (required) - * - * The original text that was matched. - */ - - - /** - * @constructor - * @param {Object} cfg The configuration properties for the Match instance, specified in an Object (map). - */ - constructor : function( cfg ) { - Autolinker.Util.assign( this, cfg ); - }, - - - /** - * Returns a string name for the type of match that this class represents. - * - * @abstract - * @return {String} - */ - getType : Autolinker.Util.abstractMethod, - - - /** - * Returns the original text that was matched. - * - * @return {String} - */ - getMatchedText : function() { - return this.matchedText; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @abstract - * @return {String} - */ - getAnchorHref : Autolinker.Util.abstractMethod, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @abstract - * @return {String} - */ - getAnchorText : Autolinker.Util.abstractMethod - - } ); - /*global Autolinker */ - /** - * @class Autolinker.match.Email - * @extends Autolinker.match.Match - * - * Represents a Email match found in an input string which should be Autolinked. - * - * See this class's superclass ({@link Autolinker.match.Match}) for more details. - */ - Autolinker.match.Email = Autolinker.Util.extend( Autolinker.match.Match, { - - /** - * @cfg {String} email (required) - * - * The email address that was matched. - */ - - - /** - * Returns a string name for the type of match that this class represents. - * - * @return {String} - */ - getType : function() { - return 'email'; - }, - - - /** - * Returns the email address that was matched. - * - * @return {String} - */ - getEmail : function() { - return this.email; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @return {String} - */ - getAnchorHref : function() { - return 'mailto:' + this.email; - }, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @return {String} - */ - getAnchorText : function() { - return this.email; - } - - } ); - /*global Autolinker */ - /** - * @class Autolinker.match.Twitter - * @extends Autolinker.match.Match - * - * Represents a Twitter match found in an input string which should be Autolinked. - * - * See this class's superclass ({@link Autolinker.match.Match}) for more details. - */ - Autolinker.match.Twitter = Autolinker.Util.extend( Autolinker.match.Match, { - - /** - * @cfg {String} twitterHandle (required) - * - * The Twitter handle that was matched. - */ - - - /** - * Returns the type of match that this class represents. - * - * @return {String} - */ - getType : function() { - return 'twitter'; - }, - - - /** - * Returns a string name for the type of match that this class represents. - * - * @return {String} - */ - getTwitterHandle : function() { - return this.twitterHandle; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @return {String} - */ - getAnchorHref : function() { - return 'https://twitter.com/' + this.twitterHandle; - }, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @return {String} - */ - getAnchorText : function() { - return '@' + this.twitterHandle; - } - - } ); - /*global Autolinker */ - /** - * @class Autolinker.match.Url - * @extends Autolinker.match.Match - * - * Represents a Url match found in an input string which should be Autolinked. - * - * See this class's superclass ({@link Autolinker.match.Match}) for more details. - */ - Autolinker.match.Url = Autolinker.Util.extend( Autolinker.match.Match, { - - /** - * @cfg {String} url (required) - * - * The url that was matched. - */ - - /** - * @cfg {Boolean} protocolRelativeMatch (required) - * - * `true` if the URL is a protocol-relative match. A protocol-relative match is a URL that starts with '//', - * and will be either http:// or https:// based on the protocol that the site is loaded under. - */ - - /** - * @cfg {Boolean} stripPrefix (required) - * @inheritdoc {@link Autolinker#stripPrefix} - */ - - - /** - * @private - * @property {RegExp} urlPrefixRegex - * - * A regular expression used to remove the 'http://' or 'https://' and/or the 'www.' from URLs. - */ - urlPrefixRegex: /^(https?:\/\/)?(www\.)?/i, - - /** - * @private - * @property {RegExp} protocolRelativeRegex - * - * The regular expression used to remove the protocol-relative '//' from the {@link #url} string, for purposes - * of {@link #getAnchorText}. A protocol-relative URL is, for example, "//yahoo.com" - */ - protocolRelativeRegex : /^\/\//, - - /** - * @protected - * @property {RegExp} checkForProtocolRegex - * - * A regular expression used to check if the {@link #url} is missing a protocol (in which case, 'http://' - * will be added). - */ - checkForProtocolRegex: /^[A-Za-z]{3,9}:/, - - - /** - * Returns a string name for the type of match that this class represents. - * - * @return {String} - */ - getType : function() { - return 'url'; - }, - - - /** - * Returns the url that was matched, assuming the protocol to be 'http://' if the match - * was missing a protocol. - * - * @return {String} - */ - getUrl : function() { - var url = this.url; - - // if the url string doesn't begin with a protocol, assume http:// - if( !this.protocolRelativeMatch && !this.checkForProtocolRegex.test( url ) ) { - url = this.url = 'http://' + url; - } - - return url; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @return {String} - */ - getAnchorHref : function() { - var url = this.getUrl(); - - return url.replace( /&/g, '&' ); // any &'s in the URL should be converted back to '&' if they were displayed as & in the source html - }, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @return {String} - */ - getAnchorText : function() { - var anchorText = this.getUrl(); - - if( this.protocolRelativeMatch ) { - // Strip off any protocol-relative '//' from the anchor text - anchorText = this.stripProtocolRelativePrefix( anchorText ); - } - if( this.stripPrefix ) { - anchorText = this.stripUrlPrefix( anchorText ); - } - anchorText = this.removeTrailingSlash( anchorText ); // remove trailing slash, if there is one - - return anchorText; - }, - - - // --------------------------------------- - - // Utility Functionality - - /** - * Strips the URL prefix (such as "http://" or "https://") from the given text. - * - * @private - * @param {String} text The text of the anchor that is being generated, for which to strip off the - * url prefix (such as stripping off "http://") - * @return {String} The `anchorText`, with the prefix stripped. - */ - stripUrlPrefix : function( text ) { - return text.replace( this.urlPrefixRegex, '' ); - }, - - - /** - * Strips any protocol-relative '//' from the anchor text. - * - * @private - * @param {String} text The text of the anchor that is being generated, for which to strip off the - * protocol-relative prefix (such as stripping off "//") - * @return {String} The `anchorText`, with the protocol-relative prefix stripped. - */ - stripProtocolRelativePrefix : function( text ) { - return text.replace( this.protocolRelativeRegex, '' ); - }, - - - /** - * Removes any trailing slash from the given `anchorText`, in preparation for the text to be displayed. - * - * @private - * @param {String} anchorText The text of the anchor that is being generated, for which to remove any trailing - * slash ('/') that may exist. - * @return {String} The `anchorText`, with the trailing slash removed. - */ - removeTrailingSlash : function( anchorText ) { - if( anchorText.charAt( anchorText.length - 1 ) === '/' ) { - anchorText = anchorText.slice( 0, -1 ); - } - return anchorText; - } - - } ); - - return Autolinker; - -} ) ); \ No newline at end of file diff --git a/vendors/Autolinker/_/Autolinker.min.js b/vendors/Autolinker/_/Autolinker.min.js deleted file mode 100644 index 5974a6de3..000000000 --- a/vendors/Autolinker/_/Autolinker.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * Autolinker.js - * 0.12.2 - * - * Copyright(c) 2014 Gregory Jacobs - * MIT Licensed. http://www.opensource.org/licenses/mit-license.php - * - * https://github.com/gregjacobs/Autolinker.js - */ -!function(a,b){"function"==typeof define&&define.amd?define(b):"undefined"!=typeof exports?module.exports=b():a.Autolinker=b()}(this,function(){var a=function(b){a.Util.assign(this,b)};return a.prototype={constructor:a,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,className:"",htmlCharacterEntitiesRegex:/( | |<|<|>|>)/gi,matcherRegex:function(){var a=/(^|[^\w])@(\w{1,15})/,b=/(?:[\-;:&=\+\$,\w\.]+@)/,c=/(?:[A-Za-z]{3,9}:(?:\/\/)?)/,d=/(?:www\.)/,e=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,f=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,g=/(?:[\-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|])?/;return new RegExp(["(",a.source,")","|","(",b.source,e.source,f.source,")","|","(","(?:","(?:",c.source,e.source,")","|","(?:","(.?//)?",d.source,e.source,")","|","(?:","(.?//)?",e.source,f.source,")",")",g.source,")"].join(""),"gi")}(),invalidProtocolRelMatchRegex:/^[\w]\/\//,charBeforeProtocolRelMatchRegex:/^(.)?\/\//,link:function(b){var c=this,d=this.getHtmlParser(),e=this.htmlCharacterEntitiesRegex,f=0,g=[];return d.parse(b,{processHtmlNode:function(a,b,c){"a"===b&&(c?f=Math.max(f-1,0):f++),g.push(a)},processTextNode:function(b){if(0===f)for(var d=a.Util.splitAndCapture(b,e),h=0,i=d.length;i>h;h++){var j=d[h],k=c.processTextNode(j);g.push(k)}else g.push(b)}}),g.join("")},getHtmlParser:function(){var b=this.htmlParser;return b||(b=this.htmlParser=new a.HtmlParser),b},getTagBuilder:function(){var b=this.tagBuilder;return b||(b=this.tagBuilder=new a.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),b},processTextNode:function(b){var c=this,d=this.charBeforeProtocolRelMatchRegex;return b.replace(this.matcherRegex,function(b,e,f,g,h,i,j,k){var l,m=e,n=f,o=g,p=h,q=i,r=j||k,s="",t="";if(!c.isValidMatch(m,p,q,r))return b;if(c.matchHasUnbalancedClosingParen(b)&&(b=b.substr(0,b.length-1),t=")"),p)l=new a.match.Email({matchedText:b,email:p});else if(m)n&&(s=n,b=b.slice(1)),l=new a.match.Twitter({matchedText:b,twitterHandle:o});else{if(r){var u=r.match(d)[1]||"";u&&(s=u,b=b.slice(1))}l=new a.match.Url({matchedText:b,url:b,protocolRelativeMatch:r,stripPrefix:c.stripPrefix})}var v=c.createMatchReturnVal(l,b);return s+v+t})},isValidMatch:function(a,b,c,d){return a&&!this.twitter||b&&!this.email||c&&!this.urls||c&&-1===c.indexOf(".")||c&&/^[A-Za-z]{3,9}:/.test(c)&&!/:.*?[A-Za-z]/.test(c)||d&&this.invalidProtocolRelMatchRegex.test(d)?!1:!0},matchHasUnbalancedClosingParen:function(a){var b=a.charAt(a.length-1);if(")"===b){var c=a.match(/\(/g),d=a.match(/\)/g),e=c&&c.length||0,f=d&&d.length||0;if(f>e)return!0}return!1},createMatchReturnVal:function(b,c){var d;if(this.replaceFn&&(d=this.replaceFn.call(this,this,b)),"string"==typeof d)return d;if(d===!1)return c;if(d instanceof a.HtmlTag)return d.toString();var e=this.getTagBuilder(),f=e.build(b);return f.toString()}},a.link=function(b,c){var d=new a(c);return d.link(b)},a.match={},a.Util={abstractMethod:function(){throw"abstract"},assign:function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a},extend:function(b,c){var d=b.prototype,e=function(){};e.prototype=d;var f;f=c.hasOwnProperty("constructor")?c.constructor:function(){d.constructor.apply(this,arguments)};var g=f.prototype=new e;return g.constructor=f,g.superclass=d,delete c.constructor,a.Util.assign(g,c),f},ellipsis:function(a,b,c){return a.length>b&&(c=null==c?"..":c,a=a.substring(0,b-c.length)+c),a},indexOf:function(a,b){if(Array.prototype.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},splitAndCapture:function(a,b){if(!b.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var c,d=[],e=0;c=b.exec(a);)d.push(a.substring(e,c.index)),d.push(c[0]),e=c.index+c[0].length;return d.push(a.substring(e)),d}},a.HtmlParser=a.Util.extend(Object,{htmlRegex:function(){var a=/[0-9a-zA-Z:]+/,b=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,c=/(?:".*?"|'.*?'|[^'"=<>`\s]+)/,d=b.source+"(?:\\s*=\\s*"+c.source+")?";return new RegExp(["<(?:!|(/))?","("+a.source+")","(?:","\\s+","(?:",d,"|",c.source+")",")*","\\s*/?",">"].join(""),"g")}(),parse:function(a,b){b=b||{};for(var c,d=b.processHtmlNode||function(){},e=b.processTextNode||function(){},f=this.htmlRegex,g=0;null!==(c=f.exec(a));){var h=c[0],i=c[2],j=!!c[1],k=a.substring(g,c.index);k&&e(k),d(h,i,j),g=c.index+h.length}if(g",this.getInnerHtml(),""].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var a=this.getAttrs(),b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c+'="'+a[c]+'"');return b.join(" ")}}),a.AnchorTagBuilder=a.Util.extend(Object,{constructor:function(b){a.Util.assign(this,b)},build:function(b){var c=new a.HtmlTag({tagName:"a",attrs:this.createAttrs(b.getType(),b.getAnchorHref()),innerHtml:this.processAnchorText(b.getAnchorText())});return c},createAttrs:function(a,b){var c={href:b},d=this.createCssClass(a);return d&&(c["class"]=d),this.newWindow&&(c.target="_blank"),c},createCssClass:function(a){var b=this.className;return b?b+" "+b+"-"+a:""},processAnchorText:function(a){return a=this.doTruncate(a)},doTruncate:function(b){return a.Util.ellipsis(b,this.truncate||Number.POSITIVE_INFINITY)}}),a.match.Match=a.Util.extend(Object,{constructor:function(b){a.Util.assign(this,b)},getType:a.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:a.Util.abstractMethod,getAnchorText:a.Util.abstractMethod}),a.match.Email=a.Util.extend(a.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),a.match.Twitter=a.Util.extend(a.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),a.match.Url=a.Util.extend(a.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,checkForProtocolRegex:/^[A-Za-z]{3,9}:/,getType:function(){return"url"},getUrl:function(){var a=this.url;return this.protocolRelativeMatch||this.checkForProtocolRegex.test(a)||(a=this.url="http://"+a),a},getAnchorHref:function(){var a=this.getUrl();return a.replace(/&/g,"&")},getAnchorText:function(){var a=this.getUrl();return this.protocolRelativeMatch&&(a=this.stripProtocolRelativePrefix(a)),this.stripPrefix&&(a=this.stripUrlPrefix(a)),a=this.removeTrailingSlash(a)},stripUrlPrefix:function(a){return a.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(a){return a.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(a){return"/"===a.charAt(a.length-1)&&(a=a.slice(0,-1)),a}}),a}); \ No newline at end of file diff --git a/vendors/Autolinker/_/LICENSE b/vendors/Autolinker/_/LICENSE deleted file mode 100644 index 3ff145b9f..000000000 --- a/vendors/Autolinker/_/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Gregory Jacobs (http://greg-jacobs.com) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendors/Autolinker/_/README.md b/vendors/Autolinker/_/README.md deleted file mode 100644 index c6df0f15f..000000000 --- a/vendors/Autolinker/_/README.md +++ /dev/null @@ -1,350 +0,0 @@ -# Autolinker.js - -Because I had so much trouble finding a good autolinking implementation out in the wild, I decided to roll my own. It -seemed that everything I found out there was either an implementation that didn't cover every case, or was just limited -in one way or another. - -So, this utility attempts to handle everything. It: - -- Autolinks URLs, whether or not they start with the protocol (i.e. 'http://'). In other words, it will automatically link the - text "google.com", as well as "http://google.com". -- Will properly handle URLs with special characters -- Will properly handle URLs with query parameters or a named anchor (i.e. hash) -- Will autolink email addresses. -- Will autolink Twitter handles. -- Will properly handle HTML input. The utility will not change the `href` attribute inside anchor (<a>) tags (or any other - tag/attribute for that matter), and will not accidentally wrap the inner text of an anchor tag with a new one (which would cause - doubly-nested anchor tags). - -Hope that this utility helps you as well! - - -## Installation - -#### Download - -Simply clone or download the zip of the project, and link to either `dist/Autolinker.js` or `dist/Autolinker.min.js` with a script tag: - -```html - -``` - -#### Using with the [Bower](http://bower.io) package manager: - -Command line: - -```shell -bower install Autolinker.js --save -``` - -#### Using with [Node.js](http://nodejs.org) via [npm](https://www.npmjs.org/): - -Command Line: - -```shell -npm install autolinker --save -``` - -JavaScript: - -```javascript -var Autolinker = require( 'autolinker' ); -// note: npm wants an all-lowercase package name, but the utility is a class and should be -// aliased with a captial letter -``` - - -## Usage - -Using the static `link()` method: - -```javascript -var linkedText = Autolinker.link( textToAutolink[, options] ); -``` - -Using as a class: - -```javascript -var autolinker = new Autolinker( [ options ] ); - -var linkedText = autolinker.link( textToAutoLink ); -``` - -Note: if using the same options to autolink multiple pieces of html/text, it is slightly more efficient to create a single -Autolinker instance, and run the `link()` method repeatedly (i.e. use the "class" form above). - - -#### Example: - -```javascript -var linkedText = Autolinker.link( "Check out google.com", { className: "myLink" } ); -// Produces: "Check out google.com" -``` - -## Options - -These are the options which may be specified for linking. These are specified by providing an Object as the second parameter to `Autolinker.link()`. These include: - -- **newWindow** : Boolean
- `true` to have the links should open in a new window when clicked, `false` otherwise. Defaults to `true`.

-- **stripPrefix** : Boolean
- `true` to have the 'http://' or 'https://' and/or the 'www.' stripped from the beginning of links, `false` otherwise. Defaults to `true`.

-- **truncate** : Number
- A number for how many characters long URLs/emails/twitter handles should be truncated to inside the text of a link. If the URL/email/twitter is over the number of characters, it will be truncated to this length by replacing the end of the string with a two period ellipsis ('..').

- Example: a url like 'http://www.yahoo.com/some/long/path/to/a/file' truncated to 25 characters may look like this: 'yahoo.com/some/long/pat..'
-- **className** : String
- A CSS class name to add to the generated anchor tags. This class will be added to all links, as well as this class - plus "url"/"email"/"twitter" suffixes for styling url/email/twitter links differently. - - For example, if this config is provided as "myLink", then: - - 1) URL links will have the CSS classes: "myLink myLink-url"
- 2) Email links will have the CSS classes: "myLink myLink-email", and
- 3) Twitter links will have the CSS classes: "myLink myLink-twitter"
- -- **urls** : Boolean
- `true` to have URLs auto-linked, `false` to skip auto-linking of URLs. Defaults to `true`.
-- **email** : Boolean
- `true` to have email addresses auto-linked, `false` to skip auto-linking of email addresses. Defaults to `true`.

-- **twitter** : Boolean
- `true` to have Twitter handles auto-linked, `false` to skip auto-linking of Twitter handles. Defaults to `true`. -- **replaceFn** : Function
- A function to use to programmatically make replacements of matches in the input string, one at a time. See the section - Custom Replacement Function for more details. - - -For example, if you wanted to disable links from opening in new windows, you could do: - -```javascript -var linkedText = Autolinker.link( "Check out google.com", { newWindow: false } ); -// Produces: "Check out google.com" -``` - -And if you wanted to truncate the length of URLs (while also not opening in a new window), you could do: - -```javascript -var linkedText = Autolinker.link( "http://www.yahoo.com/some/long/path/to/a/file", { truncate: 25, newWindow: false } ); -// Produces: "yahoo.com/some/long/pat.." -``` - -## More Examples -One could update an entire DOM element that has unlinked text to auto-link them as such: - -```javascript -var myTextEl = document.getElementById( 'text' ); -myTextEl.innerHTML = Autolinker.link( myTextEl.innerHTML ); -``` - -Using the same pre-configured Autolinker instance in multiple locations of a codebase (usually by dependency injection): - -```javascript -var autolinker = new Autolinker( { newWindow: false, truncate: 25 } ); - -//... - -autolinker.link( "Check out http://www.yahoo.com/some/long/path/to/a/file" ); -// Produces: "Check out yahoo.com/some/long/pat.." - -//... - -autolinker.link( "Go to www.google.com" ); -// Produces: "Go to google.com" - -``` - - -## Custom Replacement Function - -A custom replacement function (`replaceFn`) may be provided to replace url/email/twitter matches on an individual basis, based -on the return from this function. - -Full example, for purposes of documenting the API: - -```javascript -var input = "..."; // string with URLs, Email Addresses, and Twitter Handles - -var linkedText = Autolinker.link( input, { - replaceFn : function( autolinker, match ) { - console.log( "href = ", match.getAnchorHref() ); - console.log( "text = ", match.getAnchorText() ); - - switch( match.getType() ) { - case 'url' : - console.log( "url: ", match.getUrl() ); - - if( match.getUrl().indexOf( 'mysite.com' ) === -1 ) { - var tag = autolinker.getTagBuilder().build( match ); // returns an `Autolinker.HtmlTag` instance, which provides mutator methods for easy changes - tag.setAttr( 'rel', 'nofollow' ); - tag.addClass( 'external-link' ); - - return tag; - - } else { - return true; // let Autolinker perform its normal anchor tag replacement - } - - case 'email' : - var email = match.getEmail(); - console.log( "email: ", email ); - - if( email === "my@own.address" ) { - return false; // don't auto-link this particular email address; leave as-is - } else { - return; // no return value will have Autolinker perform its normal anchor tag replacement (same as returning `true`) - } - - case 'twitter' : - var twitterHandle = match.getTwitterHandle(); - console.log( twitterHandle ); - - return '' + twitterHandle + ''; - } - } -} ); -``` - - -The function is provided two arguments: - -1. The Autolinker instance that is performing replacements. This can be used to query the options that the Autolinker - instance is configured with, or to retrieve its TagBuilder instance (via `autolinker.getTagBuilder()`). -2. An `Autolinker.match.Match` object which details the match that is to be replaced. - - -A replacement of the match is made based on the return value of the function. The following return values may be provided: - -- No return value (`undefined`), or `true` (Boolean): Delegate back to Autolinker to replace the match as it normally would. -- `false` (Boolean): Do not replace the current match at all - leave as-is. -- Any String: If a string is returned from the function, the string will be used directly as the replacement HTML for - the match. -- An `Autolinker.HtmlTag` instance, which can be used to build/modify an HTML tag before writing out its HTML text. - - -## Full API Docs - -The full API docs for Autolinker may be referenced at: [http://gregjacobs.github.io/Autolinker.js/docs/](http://gregjacobs.github.io/Autolinker.js/docs/#!/api/Autolinker) - - -## Changelog: - -### 0.12.3 - -- Add `Autolinker.match.Match#getMatchedText` method - -### 0.12.2 - -- Add documentation generation, and update inline documentation. - -### 0.12.1 - -- Expose the `Autolinker.HtmlTag` class, and allow it to be used in the `replaceFn` - -### 0.12.0 - -- Add `replaceFn` option - -### 0.11.0 - -- Allow Autolinker to link fully-capitalized URLs/Emails/Twitter handles. - -### 0.10.1 - -- Added fix to not autolink strings like "version:1.0", which were accidentally being interpreted as a protocol:domain string. - -### 0.10.0 - -- Added support for protocol-relative URLs (ex: `//google.com`, which will effectively either have the `http://` or `https://` - protocol depending on the protocol that is hosting the website) - -### 0.9.4 - -- Fixed an issue where a string in the form of `abc:def` would be autolinked as a protocol and domain name URL. Autolinker now - requires the domain name to have at least one period in it to be considered. - -### 0.9.3 - -- Fixed an issue where Twitter handles wouldn't be autolinked if they existed as the sole entity within parenthesis or brackets - (thanks [@busticated](https://github.com/busticated) for pointing this out and providing unit tests) - -### 0.9.2 - -- Fixed an issue with nested tags within an existing <a> tag, where the nested tags' inner text would be accidentally - removed from the output (thanks [@mjsabin01](https://github.com/mjsabin01)) - -### 0.9.1 - -- Added a patch to attempt to better handle extraneous </a> tags in the input string if any exist. This is for when the - input may have some invalid markup (for instance, on sites which allow user comments, blog posts, etc.). - -### 0.9.0 - -- Added better support for the processing of existing HTML in the input string. Now handles namespaced tags, and attribute names - with dashes or any other Unicode character (thanks [@aziraphale](https://github.com/aziraphale)) - -### 0.8.0 - -- Added `className` option for easily styling produced links (thanks [@busticated](https://github.com/busticated)) -- Refactored into a JS class. Autolinker can now be instantiated using: - -```javascript -var autolinker = new Autolinker( { newWindow: false, truncate: 25 } ); - -autolinker.link( "Check out http://www.yahoo.com/some/long/path/to/a/file" ); -// Produces: "Check out yahoo.com/some/long/pat.." -``` - -This allows options to be set on a single instance, and used throughout a codebase by injecting the `autolinker` instance as a dependency to the modules/classes that use it. (Note: Autolinker may still be used with the static `Autolinker.link()` method as was previously available as well.) - -### 0.7.0 - -- Changed build system to Grunt. -- Added AMD and CommonJS module loading support (ex: RequireJS, and Node.js's module loader). -- Added command line Jasmine test runner (`grunt test`) -- Upgraded Jasmine from 1.3.1 to 2.0 -- Added license header to dist files. - -(Thanks to [@busticated](https://github.com/busticated)!) - -### 0.6.1 - -- Added LICENSE file to repository. - -### 0.6.0 - -- Added options for granular control of which types are linked (urls, email addresses, and/or twitter handles). - (thanks [@aziraphale](https://github.com/aziraphale)) - -### 0.5.0 - -- Simplified the path / query string / hash processing into a single regular expression instead of 3 separate ones. -- Added support for parenthesis in URLs, such as: `en.wikipedia.org/wiki/IANA_(disambiguation)` (thanks [@dandv](https://github.com/dandv)) -- Add all known top-level domains (TLDs) (thanks [@wouter0100](https://github.com/wouter0100)) - -### 0.4.0 - -Merged pull requests from [@afeld](https://github.com/afeld): - -- strip protocol and 'www.' by default - fixes #1 -- truncate URLs from the end -- make simpler regex for detecting prefix -- remove trailing slashes from URLs, and handle periods at the end of paths -- re-use domain+TLD regexes for email matching -- add .me and .io to list of TLDs - -Thanks Aidan :) - -### 0.3.1 - -- Fixed an issue with handling nested HTML tags within anchor tags. - -### 0.3 - -- Implemented the `truncate` option. - -### 0.2 - -- Implemented autolinking Twitter handles. - -### 0.1 - -* Initial implementation, which autolinks URLs and email addresses. Working on linking Twitter handles. diff --git a/vendors/Autolinker/_/_/Autolinker.js b/vendors/Autolinker/_/_/Autolinker.js deleted file mode 100644 index 5b91fa54e..000000000 --- a/vendors/Autolinker/_/_/Autolinker.js +++ /dev/null @@ -1,1020 +0,0 @@ -/*! - * Autolinker.js - * 0.11.2 - * - * Copyright(c) 2014 Gregory Jacobs - * MIT Licensed. http://www.opensource.org/licenses/mit-license.php - * - * https://github.com/gregjacobs/Autolinker.js - */ -/*global define, module */ -( function( root, factory ) { - - if( typeof define === 'function' && define.amd ) { - define( factory ); // Define as AMD module if an AMD loader is present (ex: RequireJS). - } else if( typeof exports !== 'undefined' ) { - module.exports = factory(); // Define as CommonJS module for Node.js, if available. - } else { - root.Autolinker = factory(); // Finally, define as a browser global if no module loader. - } -}( this, function() { - - /** - * @class Autolinker - * @extends Object - * - * Utility class used to process a given string of text, and wrap the URLs, email addresses, and Twitter handles in - * the appropriate anchor (<a>) tags to turn them into links. - * - * Any of the configuration options may be provided in an Object (map) provided to the Autolinker constructor, which - * will configure how the {@link #link link()} method will process the links. - * - * For example: - * - * var autolinker = new Autolinker( { - * newWindow : false, - * truncate : 30 - * } ); - * - * var html = autolinker.link( "Joe went to www.yahoo.com" ); - * // produces: 'Joe went to yahoo.com' - * - * - * The {@link #static-link static link()} method may also be used to inline options into a single call, which may - * be more convenient for one-off uses. For example: - * - * var html = Autolinker.link( "Joe went to www.yahoo.com", { - * newWindow : false, - * truncate : 30 - * } ); - * // produces: 'Joe went to yahoo.com' - * - * @constructor - * @param {Object} [config] The configuration options for the Autolinker instance, specified in an Object (map). - */ - var Autolinker = function( cfg ) { - Autolinker.Util.assign( this, cfg ); // assign the properties of `cfg` onto the Autolinker instance. Prototype properties will be used for missing configs. - }; - - - Autolinker.prototype = { - constructor : Autolinker, // fix constructor property - - /** - * @cfg {Boolean} urls - * - * `true` if miscellaneous URLs should be automatically linked, `false` if they should not be. - */ - urls : true, - - /** - * @cfg {Boolean} email - * - * `true` if email addresses should be automatically linked, `false` if they should not be. - */ - email : true, - - /** - * @cfg {Boolean} twitter - * - * `true` if Twitter handles ("@example") should be automatically linked, `false` if they should not be. - */ - twitter : true, - - /** - * @cfg {Boolean} newWindow - * - * `true` if the links should open in a new window, `false` otherwise. - */ - newWindow : true, - - /** - * @cfg {Boolean} stripPrefix - * - * `true` if 'http://' or 'https://' and/or the 'www.' should be stripped from the beginning of URL links' text, - * `false` otherwise. - */ - stripPrefix : true, - - /** - * @cfg {Number} truncate - * - * A number for how many characters long URLs/emails/twitter handles should be truncated to inside the text of - * a link. If the URL/email/twitter is over this number of characters, it will be truncated to this length by - * adding a two period ellipsis ('..') to the end of the string. - * - * For example: A url like 'http://www.yahoo.com/some/long/path/to/a/file' truncated to 25 characters might look - * something like this: 'yahoo.com/some/long/pat..' - */ - - /** - * @cfg {String} className - * - * A CSS class name to add to the generated links. This class will be added to all links, as well as this class - * plus url/email/twitter suffixes for styling url/email/twitter links differently. - * - * For example, if this config is provided as "myLink", then: - * - * 1) URL links will have the CSS classes: "myLink myLink-url" - * 2) Email links will have the CSS classes: "myLink myLink-email", and - * 3) Twitter links will have the CSS classes: "myLink myLink-twitter" - */ - className : "", - - - /** - * @private - * @property {RegExp} htmlRegex - * - * The regular expression used to pull out HTML tags from a string. Handles namespaced HTML tags and - * attribute names, as specified by http://www.w3.org/TR/html-markup/syntax.html. - * - * Capturing groups: - * - * 1. If it is an end tag, this group will have the '/'. - * 2. The tag name. - */ - htmlRegex : (function() { - var tagNameRegex = /[0-9a-zA-Z:]+/, - attrNameRegex = /[^\s\0"'>\/=\x01-\x1F\x7F]+/, // the unicode range accounts for excluding control chars, and the delete char - attrValueRegex = /(?:".*?"|'.*?'|[^'"=<>`\s]+)/, // double quoted, single quoted, or unquoted attribute values - nameEqualsValueRegex = attrNameRegex.source + '(?:\\s*=\\s*' + attrValueRegex.source + ')?'; // optional '=[value]' - - return new RegExp( [ - '<(?:!|(/))?', // Beginning of a tag. Either '<' for a start tag, ' tag. The slash or an empty string is Capturing Group 1. - - // The tag name (Capturing Group 2) - '(' + tagNameRegex.source + ')', - - // Zero or more attributes following the tag name - '(?:', - '\\s+', // one or more whitespace chars before an attribute - - // Either: - // A. tag="value", or - // B. "value" alone (for tag. Ex: ) - '(?:', nameEqualsValueRegex, '|', attrValueRegex.source + ')', - ')*', - - '\\s*/?', // any trailing spaces and optional '/' before the closing '>' - '>' - ].join( "" ), 'g' ); - } )(), - - /** - * @private - * @property {RegExp} matcherRegex - * - * The regular expression that matches URLs, email addresses, and Twitter handles. - * - * This regular expression has the following capturing groups: - * - * 1. Group that is used to determine if there is a Twitter handle match (i.e. @someTwitterUser). Simply check for its - * existence to determine if there is a Twitter handle match. The next couple of capturing groups give information - * about the Twitter handle match. - * 2. The whitespace character before the @sign in a Twitter handle. This is needed because there are no lookbehinds in - * JS regular expressions, and can be used to reconstruct the original string in a replace(). - * 3. The Twitter handle itself in a Twitter match. If the match is '@someTwitterUser', the handle is 'someTwitterUser'. - * 4. Group that matches an email address. Used to determine if the match is an email address, as well as holding the full - * address. Ex: 'me@my.com' - * 5. Group that matches a URL in the input text. Ex: 'http://google.com', 'www.google.com', or just 'google.com'. - * This also includes a path, url parameters, or hash anchors. Ex: google.com/path/to/file?q1=1&q2=2#myAnchor - * 6. A protocol-relative ('//') match for the case of a 'www.' prefixed URL. Will be an empty string if it is not a - * protocol-relative match. We need to know the character before the '//' in order to determine if it is a valid match - * or the // was in a string we don't want to auto-link. - * 7. A protocol-relative ('//') match for the case of a known TLD prefixed URL. Will be an empty string if it is not a - * protocol-relative match. See #6 for more info. - */ - matcherRegex : (function() { - var twitterRegex = /(^|[^\w])@(\w{1,15})/, // For matching a twitter handle. Ex: @gregory_jacobs - - emailRegex = /(?:[\-;:&=\+\$,\w\.]+@)/, // something@ for email addresses (a.k.a. local-part) - - protocolRegex = /(?:[A-Za-z]{3,9}:(?:\/\/)?)/, // match protocol, allow in format http:// or mailto: - wwwRegex = /(?:www\.)/, // starting with 'www.' - domainNameRegex = /[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/, // anything looking at all like a domain, non-unicode domains, not ending in a period - tldRegex = /\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/, // match our known top level domains (TLDs) - - // Allow optional path, query string, and hash anchor, not ending in the following characters: "!:,.;" - // http://blog.codinghorror.com/the-problem-with-urls/ - urlSuffixRegex = /(?:[\-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|])?/; // note: optional part of the full regex - - return new RegExp( [ - '(', // *** Capturing group $1, which can be used to check for a twitter handle match. Use group $3 for the actual twitter handle though. $2 may be used to reconstruct the original string in a replace() - // *** Capturing group $2, which matches the whitespace character before the '@' sign (needed because of no lookbehinds), and - // *** Capturing group $3, which matches the actual twitter handle - twitterRegex.source, - ')', - - '|', - - '(', // *** Capturing group $4, which is used to determine an email match - emailRegex.source, - domainNameRegex.source, - tldRegex.source, - ')', - - '|', - - '(', // *** Capturing group $5, which is used to match a URL - '(?:', // parens to cover match for protocol (optional), and domain - '(?:', // non-capturing paren for a protocol-prefixed url (ex: http://google.com) - protocolRegex.source, - domainNameRegex.source, - ')', - - '|', - - '(?:', // non-capturing paren for a 'www.' prefixed url (ex: www.google.com) - '(.?//)?', // *** Capturing group $6 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character - wwwRegex.source, - domainNameRegex.source, - ')', - - '|', - - '(?:', // non-capturing paren for known a TLD url (ex: google.com) - '(.?//)?', // *** Capturing group $7 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character - domainNameRegex.source, - tldRegex.source, - ')', - ')', - - urlSuffixRegex.source, // match for path, query string, and/or hash anchor - ')' - ].join( "" ), 'gi' ); - } )(), - - /** - * @private - * @property {RegExp} invalidProtocolRelMatchRegex - * - * The regular expression used to check a potential protocol-relative URL match, coming from the {@link #matcherRegex}. - * A protocol-relative URL is, for example, "//yahoo.com" - * - * This regular expression is used in conjunction with the {@link #matcherRegex}, and checks to see if there is a word character - * before the '//' in order to determine if we should actually autolink a protocol-relative URL. This is needed because there - * is no negative look-behind in JavaScript regular expressions. - * - * For instance, we want to autolink something like "//google.com", but we don't want to autolink something - * like "abc//google.com" - */ - invalidProtocolRelMatchRegex : /^[\w]\/\//, - - /** - * @private - * @property {RegExp} charBeforeProtocolRelMatchRegex - * - * The regular expression used to retrieve the character before a protocol-relative URL match. - * - * This is used in conjunction with the {@link #matcherRegex}, which needs to grab the character before a protocol-relative - * '//' due to the lack of a negative look-behind in JavaScript regular expressions. The character before the match is stripped - * from the URL. - */ - charBeforeProtocolRelMatchRegex : /^(.)?\/\//, - - - /** - * Automatically links URLs, email addresses, and Twitter handles found in the given chunk of HTML. - * Does not link URLs found within HTML tags. - * - * For instance, if given the text: `You should go to http://www.yahoo.com`, then the result - * will be `You should go to <a href="http://www.yahoo.com">http://www.yahoo.com</a>` - * - * @method link - * @param {String} textOrHtml The HTML or text to link URLs, email addresses, and Twitter handles within. - * @return {String} The HTML, with URLs/emails/twitter handles automatically linked. - */ - link : function( textOrHtml ) { - return this.processHtml( textOrHtml ); - }, - - - /** - * Lazily instantiates and returns the {@link #anchorTagBuilder} instance for this Autolinker instance. - * - * @return {Autolinker.AnchorTagBuilder} - */ - getAnchorTagBuilder : function() { - var anchorTagBuilder = this.anchorTagBuilder; - - if( !anchorTagBuilder ) { - anchorTagBuilder = this.anchorTagBuilder = new Autolinker.AnchorTagBuilder( { - newWindow : this.newWindow, - stripPrefix : this.stripPrefix, - truncate : this.truncate, - className : this.className - } ); - } - - return anchorTagBuilder; - }, - - - /** - * Processes the given HTML to auto-link URLs/emails/Twitter handles. - * - * Finds the text around any HTML elements in the input `html`, which will be the text that is processed. - * Any original HTML elements will be left as-is, as well as the text that is already wrapped in anchor tags. - * - * @private - * @method processHtml - * @param {String} html The input text or HTML to process in order to auto-link. - * @return {String} - */ - processHtml : function( html ) { - // Loop over the HTML string, ignoring HTML tags, and processing the text that lies between them, - // wrapping the URLs in anchor tags - var htmlRegex = this.htmlRegex, - currentResult, - inBetweenTagsText, - lastIndex = 0, - anchorTagStackCount = 0, - resultHtml = []; - - while( ( currentResult = htmlRegex.exec( html ) ) !== null ) { - var tagText = currentResult[ 0 ], - tagName = currentResult[ 2 ], - isClosingTag = !!currentResult[ 1 ]; - - inBetweenTagsText = html.substring( lastIndex, currentResult.index ); - lastIndex = currentResult.index + tagText.length; - - // Process around anchor tags, and any inner text / html they may have - if( tagName === 'a' ) { - if( !isClosingTag ) { // it's the start tag - anchorTagStackCount++; - resultHtml.push( this.processTextNode( inBetweenTagsText ) ); - - } else { // it's the end tag - anchorTagStackCount = Math.max( anchorTagStackCount - 1, 0 ); // attempt to handle extraneous tags by making sure the stack count never goes below 0 - if( anchorTagStackCount === 0 ) { - resultHtml.push( inBetweenTagsText ); // We hit the matching tag, simply add all of the text from the start tag to the end tag without linking it - } - } - - } else if( anchorTagStackCount === 0 ) { // not within an anchor tag, link the "in between" text - resultHtml.push( this.processTextNode( inBetweenTagsText ) ); - - } else { - // if we have a tag that is in between anchor tags (ex: google.com), - // just append the inner text - resultHtml.push( inBetweenTagsText ); - } - - resultHtml.push( tagText ); // now add the text of the tag itself verbatim - } - - // Process any remaining text after the last HTML element. Will process all of the text if there were no HTML elements. - if( lastIndex < html.length ) { - var processedTextNode = this.processTextNode( html.substring( lastIndex ) ); - resultHtml.push( processedTextNode ); - } - - return resultHtml.join( "" ); - }, - - - /** - * Process the text that lies inbetween HTML tags. This method does the actual wrapping of URLs with - * anchor tags. - * - * @private - * @param {String} text The text to auto-link. - * @return {String} The text with anchor tags auto-filled. - */ - processTextNode : function( text ) { - var me = this, // for closure - invalidProtocolRelMatchRegex = this.invalidProtocolRelMatchRegex, - charBeforeProtocolRelMatchRegex = this.charBeforeProtocolRelMatchRegex, - anchorTagBuilder = this.getAnchorTagBuilder(); - - return text.replace( this.matcherRegex, function( matchStr, $1, $2, $3, $4, $5, $6, $7 ) { - var twitterMatch = $1, - twitterHandlePrefixWhitespaceChar = $2, // The whitespace char before the @ sign in a Twitter handle match. This is needed because of no lookbehinds in JS regexes - twitterHandle = $3, // The actual twitterUser (i.e the word after the @ sign in a Twitter handle match) - emailAddressMatch = $4, // For both determining if it is an email address, and stores the actual email address - urlMatch = $5, // The matched URL string - protocolRelativeMatch = $6 || $7, // The '//' for a protocol-relative match, with the character that comes before the '//' - - prefixStr = "", // A string to use to prefix the anchor tag that is created. This is needed for the Twitter handle match - suffixStr = "", // A string to suffix the anchor tag that is created. This is used if there is a trailing parenthesis that should not be auto-linked. - - match; // Will be an Autolinker.Match object - - - // Return out with no changes for match types that are disabled (url, email, twitter), or for matches - // that are invalid. - if( !me.isValidMatch( twitterMatch, emailAddressMatch, urlMatch, protocolRelativeMatch ) ) { - return matchStr; - } - - - // Handle a closing parenthesis at the end of the match, and exclude it if there is not a matching open parenthesis - // in the match. This handles cases like the string "wikipedia.com/something_(disambiguation)" (which should be auto- - // linked, and when it is enclosed in parenthesis itself, such as: "(wikipedia.com/something_(disambiguation))" (in - // which the outer parens should *not* be auto-linked. - var lastChar = matchStr.charAt( matchStr.length - 1 ); - if( lastChar === ')' ) { - var openParensMatch = matchStr.match( /\(/g ), - closeParensMatch = matchStr.match( /\)/g ), - numOpenParens = ( openParensMatch && openParensMatch.length ) || 0, - numCloseParens = ( closeParensMatch && closeParensMatch.length ) || 0; - - if( numOpenParens < numCloseParens ) { - matchStr = matchStr.substr( 0, matchStr.length - 1 ); // remove the trailing ")" - suffixStr = ")"; // this will be added after the tag - } - } - - - if( twitterMatch ) { - prefixStr = twitterHandlePrefixWhitespaceChar; - match = new Autolinker.TwitterMatch( { twitterHandle: twitterHandle } ); - - } else if( emailAddressMatch ) { - match = new Autolinker.EmailMatch( { emailAddress: emailAddressMatch } ); - - } else { // url match - // If it's a protocol-relative '//' match, remove the character before the '//' (which the matcherRegex needed - // to match due to the lack of a negative look-behind in JavaScript regular expressions) - if( protocolRelativeMatch ) { - var charBeforeMatch = protocolRelativeMatch.match( charBeforeProtocolRelMatchRegex )[ 1 ] || ""; - - if( charBeforeMatch ) { - prefixStr = charBeforeMatch; // re-add the character before the '//' to what will be placed before the generated tag - matchStr = matchStr.slice( 1 ); - } - } - - match = new Autolinker.UrlMatch( { url: matchStr, protocolRelativeMatch: protocolRelativeMatch } ); - } - - // wrap the match in an anchor tag - var anchorTag = anchorTagBuilder.createAnchorTag( match.getType(), match.getAnchorHref(), match.getAnchorText() ); - return prefixStr + anchorTag + suffixStr; - } ); - }, - - - /** - * Determines if a given match found by {@link #processTextNode} is valid. Will return `false` for: - * - * 1) Disabled link types (i.e. having a Twitter match, but {@link #twitter} matching is disabled) - * 2) URL matches which do not have at least have one period ('.') in the domain name (effectively skipping over - * matches like "abc:def") - * 3) A protocol-relative url match (a URL beginning with '//') whose previous character is a word character - * (effectively skipping over strings like "abc//google.com") - * - * Otherwise, returns `true`. - * - * @private - * @param {String} twitterMatch The matched Twitter handle, if there was one. Will be empty string if the match is not a - * Twitter match. - * @param {String} emailAddressMatch The matched Email address, if there was one. Will be empty string if the match is not - * an Email address match. - * @param {String} urlMatch The matched URL, if there was one. Will be an empty string if the match is not a URL match. - * @param {String} protocolRelativeMatch The protocol-relative string for a URL match (i.e. '//'), possibly with a preceding - * character (ex, a space, such as: ' //', or a letter, such as: 'a//'). The match is invalid if there is a word character - * preceding the '//'. - * @return {Boolean} `true` if the match given is valid and should be processed, or `false` if the match is invalid and/or - * should just not be processed (such as, if it's a Twitter match, but {@link #twitter} matching is disabled}. - */ - isValidMatch : function( twitterMatch, emailAddressMatch, urlMatch, protocolRelativeMatch ) { - if( - ( twitterMatch && !this.twitter ) || ( emailAddressMatch && !this.email ) || ( urlMatch && !this.urls ) || - ( urlMatch && urlMatch.indexOf( '.' ) === -1 ) || // At least one period ('.') must exist in the URL match for us to consider it an actual URL - ( urlMatch && /^[A-Za-z]{3,9}:/.test( urlMatch ) && !/:.*?[A-Za-z]/.test( urlMatch ) ) || // At least one letter character must exist in the domain name after a protocol match. Ex: skip over something like "git:1.0" - ( protocolRelativeMatch && this.invalidProtocolRelMatchRegex.test( protocolRelativeMatch ) ) // a protocol-relative match which has a word character in front of it (so we can skip something like "abc//google.com") - ) { - return false; - } - - return true; - } - - }; - - - /** - * Automatically links URLs, email addresses, and Twitter handles found in the given chunk of HTML. - * Does not link URLs found within HTML tags. - * - * For instance, if given the text: `You should go to http://www.yahoo.com`, then the result - * will be `You should go to <a href="http://www.yahoo.com">http://www.yahoo.com</a>` - * - * Example: - * - * var linkedText = Autolinker.link( "Go to google.com", { newWindow: false } ); - * // Produces: "Go to google.com" - * - * @static - * @method link - * @param {String} html The HTML text to link URLs within. - * @param {Object} [options] Any of the configuration options for the Autolinker class, specified in an Object (map). - * See the class description for an example call. - * @return {String} The HTML text, with URLs automatically linked - */ - Autolinker.link = function( text, options ) { - var autolinker = new Autolinker( options ); - return autolinker.link( text ); - }; - - /** - * @class Autolinker.Util - * @singleton - * - * A few utility methods for Autolinker. - */ - Autolinker.Util = { - - /** - * @property {Function} abstractMethod - * - * A function object which represents an abstract method. - */ - abstractMethod : function() { throw "abstract"; }, - - - /** - * Assigns (shallow copies) the properties of `src` onto `dest`. - * - * @param {Object} dest The destination object. - * @param {Object} src The source object. - * @return {Object} The destination object. - */ - assign : function( dest, src ) { - for( var prop in src ) { - if( src.hasOwnProperty( prop ) ) { - dest[ prop ] = src[ prop ]; - } - } - - return dest; - }, - - - /** - * Extends `superclass` to create a new subclass, adding the `protoProps` to the new subclass's prototype. - * - * @param {Function} superclass The constructor function for the superclass. - * @param {Object} protoProps The methods/properties to add to the subclass's prototype. This may contain the - * special property `constructor`, which will be used as the new subclass's constructor function. - * @return {Function} The new subclass function. - */ - extend : function( superclass, protoProps ) { - var superclassProto = superclass.prototype; - - var F = function() {}; - F.prototype = superclassProto; - - var subclass; - if( protoProps.hasOwnProperty( 'constructor' ) ) { - subclass = protoProps.constructor; - } else { - subclass = function() { superclassProto.constructor.apply( this, arguments ); }; - } - - var subclassProto = subclass.prototype = new F(); // set up prototype chain - subclassProto.constructor = subclass; // fix constructor property - subclassProto.superclass = superclassProto; - - delete protoProps.constructor; // don't re-assign constructor property to the prototype, since a new function may have been created (`subclass`), which is now already there - Autolinker.Util.assign( subclassProto, protoProps ); - - return subclass; - } - - }; - /** - * @private - * @class Autolinker.AnchorTagBuilder - * @extends Object - * - * Builds the anchor (<a>) tags for the Autolinker utility when a match is found. - */ - Autolinker.AnchorTagBuilder = Autolinker.Util.extend( Object, { - - /** - * @cfg {Boolean} newWindow - * - * See {@link Autolinker#newWindow} for details. - */ - - /** - * @cfg {Boolean} stripPrefix - * - * See {@link Autolinker#stripPrefix} for details. - */ - - /** - * @cfg {Number} truncate - * - * See {@link Autolinker#truncate} for details. - */ - - /** - * @cfg {String} className - * - * See {@link Autolinker#className} for details. - */ - - - /** - * @private - * @property {RegExp} urlPrefixRegex - * - * A regular expression used to remove the 'http://' or 'https://' and/or the 'www.' from URLs. - */ - urlPrefixRegex: /^(https?:\/\/)?(www\.)?/i, - - - /** - * @constructor - * @param {Object} [cfg] The configuration options for the AnchorTagBuilder instance, specified in an Object (map). - */ - constructor : function( cfg ) { - Autolinker.Util.assign( this, cfg ); - }, - - - /** - * Generates the actual anchor (<a>) tag to use in place of a source url/email/twitter link. - * - * @param {"url"/"email"/"twitter"} matchType The type of match that an anchor tag is being generated for. - * @param {String} anchorHref The href for the anchor tag. - * @param {String} anchorText The anchor tag's text (i.e. what will be displayed). - * @return {String} The full HTML for the anchor tag. - */ - createAnchorTag : function( matchType, anchorHref, anchorText ) { - var attributesStr = this.createAnchorAttrsStr( matchType, anchorHref ); - anchorText = this.processAnchorText( anchorText ); - - return '' + anchorText + ''; - }, - - - /** - * Creates the string which will be the HTML attributes for the anchor (<a>) tag being generated. - * - * @private - * @param {"url"/"email"/"twitter"} matchType The type of match that an anchor tag is being generated for. - * @param {String} href The href for the anchor tag. - * @return {String} The anchor tag's attribute. Ex: `href="http://google.com" class="myLink myLink-url" target="_blank"` - */ - createAnchorAttrsStr : function( matchType, anchorHref ) { - var attrs = [ 'href="' + anchorHref + '"' ]; // we'll always have the `href` attribute - - var cssClass = this.createCssClass( matchType ); - if( cssClass ) { - attrs.push( 'class="' + cssClass + '"' ); - } - if( this.newWindow ) { - attrs.push( 'target="_blank"' ); - } - - return attrs.join( " " ); - }, - - - /** - * Creates the CSS class that will be used for a given anchor tag, based on the `matchType` and the {@link #className} - * config. - * - * @private - * @param {"url"/"email"/"twitter"} matchType The type of match that an anchor tag is being generated for. - * @return {String} The CSS class string for the link. Example return: "myLink myLink-url". If no {@link #className} - * was configured, returns an empty string. - */ - createCssClass : function( matchType ) { - var className = this.className; - - if( !className ) - return ""; - else - return className + " " + className + "-" + matchType; // ex: "myLink myLink-url", "myLink myLink-email", or "myLink myLink-twitter" - }, - - - /** - * Processes the `anchorText` by stripping the URL prefix (if {@link #stripPrefix} is `true`), removing - * any trailing slash, and truncating the text according to the {@link #truncate} config. - * - * @private - * @param {String} anchorText The anchor tag's text (i.e. what will be displayed). - * @return {String} The processed `anchorText`. - */ - processAnchorText : function( anchorText ) { - if( this.stripPrefix ) { - anchorText = this.stripUrlPrefix( anchorText ); - } - anchorText = this.removeTrailingSlash( anchorText ); // remove trailing slash, if there is one - anchorText = this.doTruncate( anchorText ); - - return anchorText; - }, - - - /** - * Strips the URL prefix (such as "http://" or "https://") from the given text. - * - * @private - * @param {String} text The text of the anchor that is being generated, for which to strip off the - * url prefix (such as stripping off "http://") - * @return {String} The `anchorText`, with the prefix stripped. - */ - stripUrlPrefix : function( text ) { - return text.replace( this.urlPrefixRegex, '' ); - }, - - - /** - * Removes any trailing slash from the given `anchorText`, in preparation for the text to be displayed. - * - * @private - * @param {String} anchorText The text of the anchor that is being generated, for which to remove any trailing - * slash ('/') that may exist. - * @return {String} The `anchorText`, with the trailing slash removed. - */ - removeTrailingSlash : function( anchorText ) { - if( anchorText.charAt( anchorText.length - 1 ) === '/' ) { - anchorText = anchorText.slice( 0, -1 ); - } - return anchorText; - }, - - - /** - * Performs the truncation of the `anchorText`, if the `anchorText` is longer than the {@link #truncate} option. - * Truncates the text to 2 characters fewer than the {@link #truncate} option, and adds ".." to the end. - * - * @private - * @param {String} text The anchor tag's text (i.e. what will be displayed). - * @return {String} The truncated anchor text. - */ - doTruncate : function( anchorText ) { - var truncateLen = this.truncate; - - // Truncate the anchor text if it is longer than the provided 'truncate' option - if( truncateLen && anchorText.length > truncateLen ) { - anchorText = anchorText.substring( 0, truncateLen - 2 ) + '..'; - } - return anchorText; - } - - } ); - /** - * @private - * @abstract - * @class Autolinker.Match - * - * Represents a match found in an input string which should be Autolinked. - */ - Autolinker.Match = Autolinker.Util.extend( Object, { - - /** - * @constructor - * @param {Object} cfg The configuration properties for the Match instance, specified in an Object (map). - */ - constructor : function( cfg ) { - Autolinker.Util.assign( this, cfg ); - }, - - - /** - * Returns a string name for the type of match that this class represents. - * - * @abstract - * @return {String} - */ - getType : Autolinker.Util.abstractMethod, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @abstract - * @return {String} - */ - getAnchorHref : Autolinker.Util.abstractMethod, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @abstract - * @return {String} - */ - getAnchorText : Autolinker.Util.abstractMethod - - } ); - /** - * @private - * @class Autolinker.EmailMatch - * - * Represents a Email match found in an input string which should be Autolinked. - */ - Autolinker.EmailMatch = Autolinker.Util.extend( Autolinker.Match, { - - /** - * @cfg {String} emailAddress (required) - * - * The email address that was matched. - */ - - - /** - * Returns a string name for the type of match that this class represents. - * - * @return {String} - */ - getType : function() { - return 'email'; - }, - - - /** - * Returns the email address that was matched. - * - * @return {String} - */ - getEmailAddress : function() { - return this.emailAddress; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @return {String} - */ - getAnchorHref : function() { - return 'mailto:' + this.emailAddress; - }, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @return {String} - */ - getAnchorText : function() { - return this.emailAddress; - } - - } ); - /** - * @private - * @class Autolinker.TwitterMatch - * - * Represents a Twitter match found in an input string which should be Autolinked. - */ - Autolinker.TwitterMatch = Autolinker.Util.extend( Autolinker.Match, { - - /** - * @cfg {String} twitterHandle (required) - * - * The Twitter handle that was matched. - */ - - - /** - * Returns the type of match that this class represents. - * - * @return {String} - */ - getType : function() { - return 'twitter'; - }, - - - /** - * Returns a string name for the type of match that this class represents. - * - * @return {String} - */ - getTwitterHandle : function() { - return this.twitterHandle; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @return {String} - */ - getAnchorHref : function() { - return 'https://twitter.com/' + this.twitterHandle; - }, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @return {String} - */ - getAnchorText : function() { - return '@' + this.twitterHandle; - } - - } ); - /** - * @private - * @class Autolinker.TwitterMatch - * - * Represents a Url match found in an input string which should be Autolinked. - */ - Autolinker.UrlMatch = Autolinker.Util.extend( Autolinker.Match, { - - /** - * @cfg {String} url (required) - * - * The url that was matched. - */ - - /** - * @cfg {Boolean} protocolRelativeMatch (required) - * - * `true` if the URL is a protocol-relative match. A protocol-relative match is a URL that starts with '//', - * and will be either http:// or https:// based on the protocol that the site is loaded under. - */ - - - /** - * @private - * @property {RegExp} protocolRelativeRegex - * - * The regular expression used to remove the protocol-relative '//' from the {@link #url} string, for purposes - * of {@link #getAnchorText}. A protocol-relative URL is, for example, "//yahoo.com" - */ - protocolRelativeRegex : /^\/\//, - - /** - * @protected - * @property {RegExp} checkForProtocolRegex - * - * A regular expression used to check if the {@link #url} is missing a protocol (in which case, 'http://' - * will be added). - */ - checkForProtocolRegex: /^[A-Za-z]{3,9}:/, - - - /** - * Returns a string name for the type of match that this class represents. - * - * @return {String} - */ - getType : function() { - return 'url'; - }, - - - /** - * Returns the url that was matched, assuming the protocol to be 'http://' if the match - * was missing a protocol. - * - * @return {String} - */ - getUrl : function() { - var url = this.url; - - // if the url string doesn't begin with a protocol, assume http:// - if( !this.protocolRelativeMatch && !this.checkForProtocolRegex.test( url ) ) { - url = this.url = 'http://' + url; - } - - return url; - }, - - - /** - * Returns the anchor href that should be generated for the match. - * - * @return {String} - */ - getAnchorHref : function() { - return this.getUrl(); - }, - - - /** - * Returns the anchor text that should be generated for the match. - * - * @return {String} - */ - getAnchorText : function() { - var url = this.getUrl(); - - if( this.protocolRelativeMatch ) { - // Strip off any protocol-relative '//' from the anchor text - url = url.replace( this.protocolRelativeRegex, '' ); - } - - return url; - } - - } ); - - return Autolinker; - -} ) ); \ No newline at end of file diff --git a/vendors/Autolinker/_/_/Autolinker.min.js b/vendors/Autolinker/_/_/Autolinker.min.js deleted file mode 100644 index 6b0a97c63..000000000 --- a/vendors/Autolinker/_/_/Autolinker.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * Autolinker.js - * 0.11.2 - * - * Copyright(c) 2014 Gregory Jacobs - * MIT Licensed. http://www.opensource.org/licenses/mit-license.php - * - * https://github.com/gregjacobs/Autolinker.js - */ -!function(a,b){"function"==typeof define&&define.amd?define(b):"undefined"!=typeof exports?module.exports=b():a.Autolinker=b()}(this,function(){var a=function(b){a.Util.assign(this,b)};return a.prototype={constructor:a,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,className:"",htmlRegex:function(){var a=/[0-9a-zA-Z:]+/,b=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,c=/(?:".*?"|'.*?'|[^'"=<>`\s]+)/,d=b.source+"(?:\\s*=\\s*"+c.source+")?";return new RegExp(["<(?:!|(/))?","("+a.source+")","(?:","\\s+","(?:",d,"|",c.source+")",")*","\\s*/?",">"].join(""),"g")}(),matcherRegex:function(){var a=/(^|[^\w])@(\w{1,15})/,b=/(?:[\-;:&=\+\$,\w\.]+@)/,c=/(?:[A-Za-z]{3,9}:(?:\/\/)?)/,d=/(?:www\.)/,e=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,f=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,g=/(?:[\-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|])?/;return new RegExp(["(",a.source,")","|","(",b.source,e.source,f.source,")","|","(","(?:","(?:",c.source,e.source,")","|","(?:","(.?//)?",d.source,e.source,")","|","(?:","(.?//)?",e.source,f.source,")",")",g.source,")"].join(""),"gi")}(),invalidProtocolRelMatchRegex:/^[\w]\/\//,charBeforeProtocolRelMatchRegex:/^(.)?\/\//,link:function(a){return this.processHtml(a)},getAnchorTagBuilder:function(){var b=this.anchorTagBuilder;return b||(b=this.anchorTagBuilder=new a.AnchorTagBuilder({newWindow:this.newWindow,stripPrefix:this.stripPrefix,truncate:this.truncate,className:this.className})),b},processHtml:function(a){for(var b,c,d=this.htmlRegex,e=0,f=0,g=[];null!==(b=d.exec(a));){var h=b[0],i=b[2],j=!!b[1];c=a.substring(e,b.index),e=b.index+h.length,"a"===i?j?(f=Math.max(f-1,0),0===f&&g.push(c)):(f++,g.push(this.processTextNode(c))):g.push(0===f?this.processTextNode(c):c),g.push(h)}if(ey&&(b=b.substr(0,b.length-1),u=")")}if(n)t=o,m=new a.TwitterMatch({twitterHandle:p});else if(q)m=new a.EmailMatch({emailAddress:q});else{if(s){var A=s.match(d)[1]||"";A&&(t=A,b=b.slice(1))}m=new a.UrlMatch({url:b,protocolRelativeMatch:s})}var B=e.createAnchorTag(m.getType(),m.getAnchorHref(),m.getAnchorText());return t+B+u})},isValidMatch:function(a,b,c,d){return a&&!this.twitter||b&&!this.email||c&&!this.urls||c&&-1===c.indexOf(".")||c&&/^[A-Za-z]{3,9}:/.test(c)&&!/:.*?[A-Za-z]/.test(c)||d&&this.invalidProtocolRelMatchRegex.test(d)?!1:!0}},a.link=function(b,c){var d=new a(c);return d.link(b)},a.Util={abstractMethod:function(){throw"abstract"},assign:function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a},extend:function(b,c){var d=b.prototype,e=function(){};e.prototype=d;var f;f=c.hasOwnProperty("constructor")?c.constructor:function(){d.constructor.apply(this,arguments)};var g=f.prototype=new e;return g.constructor=f,g.superclass=d,delete c.constructor,a.Util.assign(g,c),f}},a.AnchorTagBuilder=a.Util.extend(Object,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,constructor:function(b){a.Util.assign(this,b)},createAnchorTag:function(a,b,c){var d=this.createAnchorAttrsStr(a,b);return c=this.processAnchorText(c),""+c+""},createAnchorAttrsStr:function(a,b){var c=['href="'+b+'"'],d=this.createCssClass(a);return d&&c.push('class="'+d+'"'),this.newWindow&&c.push('target="_blank"'),c.join(" ")},createCssClass:function(a){var b=this.className;return b?b+" "+b+"-"+a:""},processAnchorText:function(a){return this.stripPrefix&&(a=this.stripUrlPrefix(a)),a=this.removeTrailingSlash(a),a=this.doTruncate(a)},stripUrlPrefix:function(a){return a.replace(this.urlPrefixRegex,"")},removeTrailingSlash:function(a){return"/"===a.charAt(a.length-1)&&(a=a.slice(0,-1)),a},doTruncate:function(a){var b=this.truncate;return b&&a.length>b&&(a=a.substring(0,b-2)+".."),a}}),a.Match=a.Util.extend(Object,{constructor:function(b){a.Util.assign(this,b)},getType:a.Util.abstractMethod,getAnchorHref:a.Util.abstractMethod,getAnchorText:a.Util.abstractMethod}),a.EmailMatch=a.Util.extend(a.Match,{getType:function(){return"email"},getEmailAddress:function(){return this.emailAddress},getAnchorHref:function(){return"mailto:"+this.emailAddress},getAnchorText:function(){return this.emailAddress}}),a.TwitterMatch=a.Util.extend(a.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),a.UrlMatch=a.Util.extend(a.Match,{protocolRelativeRegex:/^\/\//,checkForProtocolRegex:/^[A-Za-z]{3,9}:/,getType:function(){return"url"},getUrl:function(){var a=this.url;return this.protocolRelativeMatch||this.checkForProtocolRegex.test(a)||(a=this.url="http://"+a),a},getAnchorHref:function(){return this.getUrl()},getAnchorText:function(){var a=this.getUrl();return this.protocolRelativeMatch&&(a=a.replace(this.protocolRelativeRegex,"")),a}}),a}); \ No newline at end of file diff --git a/vendors/Autolinker/_/_/LICENSE b/vendors/Autolinker/_/_/LICENSE deleted file mode 100644 index 3ff145b9f..000000000 --- a/vendors/Autolinker/_/_/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Gregory Jacobs (http://greg-jacobs.com) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendors/Autolinker/_/_/README.md b/vendors/Autolinker/_/_/README.md deleted file mode 100644 index 76f327c38..000000000 --- a/vendors/Autolinker/_/_/README.md +++ /dev/null @@ -1,255 +0,0 @@ -# Autolinker.js - -Because I had so much trouble finding a good autolinking implementation out in the wild, I decided to roll my own. It -seemed that everything I found out there was either an implementation that didn't cover every case, or was just limited -in one way or another. - -So, this utility attempts to handle everything. It: - -- Autolinks URLs, whether or not they start with the protocol (i.e. 'http://'). In other words, it will automatically link the - text "google.com", as well as "http://google.com". -- Will properly handle URLs with special characters -- Will properly handle URLs with query parameters or a named anchor (i.e. hash) -- Will autolink email addresses. -- Will autolink Twitter handles. -- Will properly handle HTML input. The utility will not change the `href` attribute inside anchor (<a>) tags (or any other - tag/attribute for that matter), and will not accidentally wrap the inner text of an anchor tag with a new one (which would cause - doubly-nested anchor tags). - -Hope that this utility helps you as well! - - -## Installation - -#### Download - -Simply clone or download the zip of the project, and link to either `dist/Autolinker.js` or `dist/Autolinker.min.js` with a script tag: - -```html - -``` - -#### Using with the [Bower](http://bower.io) package manager: - -Command line: - -```shell -bower install Autolinker.js --save -``` - -#### Using with [Node.js](http://nodejs.org) via [npm](https://www.npmjs.org/): - -Command Line: - -```shell -npm install autolinker --save -``` - -JavaScript: - -```javascript -var Autolinker = require( 'autolinker' ); -// note: npm wants an all-lowercase package name, but the utility is a class and should be -// aliased with a captial letter -``` - - -## Usage - -Using the static `link()` method: - -```javascript -var linkedText = Autolinker.link( textToAutolink[, options] ); -``` - -Using as a class: - -```javascript -var autolinker = new Autolinker( [ options ] ); - -var linkedText = autolinker.link( textToAutoLink ); -``` - - -#### Example: - -```javascript -var linkedText = Autolinker.link( "Check out google.com", { className: "myLink" } ); -// Produces: "Check out google.com" -``` - -## Options - -These are the options which may be specified for linking. These are specified by providing an Object as the second parameter to `Autolinker.link()`. These include: - -- **newWindow** : Boolean
- `true` to have the links should open in a new window when clicked, `false` otherwise. Defaults to `true`.

-- **stripPrefix** : Boolean
- `true` to have the 'http://' or 'https://' and/or the 'www.' stripped from the beginning of links, `false` otherwise. Defaults to `true`.

-- **truncate** : Number
- A number for how many characters long URLs/emails/twitter handles should be truncated to inside the text of a link. If the URL/email/twitter is over the number of characters, it will be truncated to this length by replacing the end of the string with a two period ellipsis ('..').

- Example: a url like 'http://www.yahoo.com/some/long/path/to/a/file' truncated to 25 characters may look like this: 'yahoo.com/some/long/pat..'
-- **className** : String
- A CSS class name to add to the generated anchor tags. This class will be added to all links, as well as this class - plus "url"/"email"/"twitter" suffixes for styling url/email/twitter links differently. - - For example, if this config is provided as "myLink", then: - - 1) URL links will have the CSS classes: "myLink myLink-url"
- 2) Email links will have the CSS classes: "myLink myLink-email", and
- 3) Twitter links will have the CSS classes: "myLink myLink-twitter"
- -- **urls** : Boolean
- `true` to have URLs auto-linked, `false` to skip auto-linking of URLs. Defaults to `true`.
-- **email** : Boolean
- `true` to have email addresses auto-linked, `false` to skip auto-linking of email addresses. Defaults to `true`.

-- **twitter** : Boolean
- `true` to have Twitter handles auto-linked, `false` to skip auto-linking of Twitter handles. Defaults to `true`. - -For example, if you wanted to disable links from opening in new windows, you could do: - -```javascript -var linkedText = Autolinker.link( "Check out google.com", { newWindow: false } ); -// Produces: "Check out google.com" -``` - -And if you wanted to truncate the length of URLs (while also not opening in a new window), you could do: - -```javascript -var linkedText = Autolinker.link( "http://www.yahoo.com/some/long/path/to/a/file", { truncate: 25, newWindow: false } ); -// Produces: "yahoo.com/some/long/pat.." -``` - -## More Examples -One could update an entire DOM element that has unlinked text to auto-link them as such: - -```javascript -var myTextEl = document.getElementById( 'text' ); -myTextEl.innerHTML = Autolinker.link( myTextEl.innerHTML ); -``` - -Using the same pre-configured Autolinker instance in multiple locations of a codebase (usually by dependency injection): - -```javascript -var autolinker = new Autolinker( { newWindow: false, truncate: 25 } ); - -//... - -autolinker.link( "Check out http://www.yahoo.com/some/long/path/to/a/file" ); -// Produces: "Check out yahoo.com/some/long/pat.." - -//... - -autolinker.link( "Go to www.google.com" ); -// Produces: "Go to google.com" - -``` - - -## Changelog: - -### 0.11.0 - -- Allow Autolinker to link fully-capitalized URLs/Emails/Twitter handles. - -### 0.10.1 - -- Added fix to not autolink strings like "version:1.0", which were accidentally being interpreted as a protocol:domain string. - -### 0.10.0 - -- Added support for protocol-relative URLs (ex: `//google.com`, which will effectively either have the `http://` or `https://` - protocol depending on the protocol that is hosting the website) - -### 0.9.4 - -- Fixed an issue where a string in the form of `abc:def` would be autolinked as a protocol and domain name URL. Autolinker now - requires the domain name to have at least one period in it to be considered. - -### 0.9.3 - -- Fixed an issue where Twitter handles wouldn't be autolinked if they existed as the sole entity within parenthesis or brackets - (thanks [@busticated](https://github.com/busticated) for pointing this out and providing unit tests) - -### 0.9.2 - -- Fixed an issue with nested tags within an existing <a> tag, where the nested tags' inner text would be accidentally - removed from the output (thanks [@mjsabin01](https://github.com/mjsabin01)) - -### 0.9.1 - -- Added a patch to attempt to better handle extraneous </a> tags in the input string if any exist. This is for when the - input may have some invalid markup (for instance, on sites which allow user comments, blog posts, etc.). - -### 0.9.0 - -- Added better support for the processing of existing HTML in the input string. Now handles namespaced tags, and attribute names - with dashes or any other Unicode character (thanks [@aziraphale](https://github.com/aziraphale)) - -### 0.8.0 - -- Added `className` option for easily styling produced links (thanks [@busticated](https://github.com/busticated)) -- Refactored into a JS class. Autolinker can now be instantiated using: - -```javascript -var autolinker = new Autolinker( { newWindow: false, truncate: 25 } ); - -autolinker.link( "Check out http://www.yahoo.com/some/long/path/to/a/file" ); -// Produces: "Check out yahoo.com/some/long/pat.." -``` - -This allows options to be set on a single instance, and used throughout a codebase by injecting the `autolinker` instance as a dependency to the modules/classes that use it. (Note: Autolinker may still be used with the static `Autolinker.link()` method as was previously available as well.) - -### 0.7.0 - -- Changed build system to Grunt. -- Added AMD and CommonJS module loading support (ex: RequireJS, and Node.js's module loader). -- Added command line Jasmine test runner (`grunt test`) -- Upgraded Jasmine from 1.3.1 to 2.0 -- Added license header to dist files. - -(Thanks to [@busticated](https://github.com/busticated)!) - -### 0.6.1 - -- Added LICENSE file to repository. - -### 0.6.0 - -- Added options for granular control of which types are linked (urls, email addresses, and/or twitter handles). - (thanks [@aziraphale](https://github.com/aziraphale)) - -### 0.5.0 - -- Simplified the path / query string / hash processing into a single regular expression instead of 3 separate ones. -- Added support for parenthesis in URLs, such as: `en.wikipedia.org/wiki/IANA_(disambiguation)` (thanks [@dandv](https://github.com/dandv)) -- Add all known top-level domains (TLDs) (thanks [@wouter0100](https://github.com/wouter0100)) - -### 0.4.0 - -Merged pull requests from [@afeld](https://github.com/afeld): - -- strip protocol and 'www.' by default - fixes #1 -- truncate URLs from the end -- make simpler regex for detecting prefix -- remove trailing slashes from URLs, and handle periods at the end of paths -- re-use domain+TLD regexes for email matching -- add .me and .io to list of TLDs - -Thanks Aidan :) - -### 0.3.1 - -- Fixed an issue with handling nested HTML tags within anchor tags. - -### 0.3 - -- Implemented the `truncate` option. - -### 0.2 - -- Implemented autolinking Twitter handles. - -### 0.1 - -* Initial implementation, which autolinks URLs and email addresses. Working on linking Twitter handles. diff --git a/vendors/flags/flags-fixed.css b/vendors/flags/flags-fixed.css index e1df17a4f..ecdca55bb 100644 --- a/vendors/flags/flags-fixed.css +++ b/vendors/flags/flags-fixed.css @@ -1,51 +1,51 @@ -.flag-wrapper { - width: 24px; - height: 16px; - display: inline-block; -} - -.flag { - width: 16px; - height: 11px; - display: inline-block; - background: url(flags.png) no-repeat; -} - -.flag.flag-en {background-position: -144px -154px} -.flag.flag-en_us {background-position: -144px -154px} -.flag.flag-en_gb {background-position: -176px -44px} -.flag.flag-en_uk {background-position: -176px -44px} -.flag.flag-en_ca {background-position: -48px -22px} -.flag.flag-el_gr {background-position: -112px -55px} -.flag.flag-uk_ua {background-position: -96px -154px} -.flag.flag-ru_ru {background-position: -224px -121px} -.flag.flag-pt_br {background-position: -192px -11px} -.flag.flag-pl_pl {background-position: -32px -121px} -.flag.flag-nl_nl {background-position: -80px -110px} -.flag.flag-nb_no {background-position: -96px -110px} -.flag.flag-it_it {background-position: -208px -66px} -.flag.flag-de_de {background-position: -80px -33px} -.flag.flag-ro_ro {background-position: -192px -121px} -.flag.flag-fr_fr {background-position: -144px -44px} -.flag.flag-fr_ca {background-position: -144px -44px} -.flag.flag-pt_pt {background-position: -112px -121px} -.flag.flag-pt_br {background-position: -192px -11px} -.flag.flag-ar_sa {background-position: -160px 0} -.flag.flag-bg_bg {background-position: -80px -11px} -.flag.flag-es_es {background-position: -16px -44px} -.flag.flag-es_la {background-position: -16px -44px} -.flag.flag-et_ee {background-position: -192px -33px} -.flag.flag-lt_lt {background-position: -80px -88px} -.flag.flag-lv_lv {background-position: -112px -88px} -.flag.flag-is_is {background-position: -192px -66px} -.flag.flag-hu_hu {background-position: -32px -66px} -.flag.flag-ko_kr {background-position: -144px -77px} -.flag.flag-ja_jp {background-position: -16px -77px} -.flag.flag-sl_si {background-position: -128px -132px} -.flag.flag-sk_sk {background-position: -144px -132px} -.flag.flag-tr_tr {background-position: -16px -154px} -.flag.flag-sv_se {background-position: -80px -132px} -.flag.flag-cs_cz {background-position: -64px -33px} -.flag.flag-zh_cn {background-position: -208px -22px} -.flag.flag-zh_tw {background-position: -64px -154px} -.flag.flag-zh_hk {background-position: -208px -22px} +.flag-wrapper { + width: 24px; + height: 16px; + display: inline-block; +} + +.flag { + width: 16px; + height: 11px; + display: inline-block; + background: url(flags.png) no-repeat; +} + +.flag.flag-en {background-position: -144px -154px} +.flag.flag-en_us {background-position: -144px -154px} +.flag.flag-en_gb {background-position: -176px -44px} +.flag.flag-en_uk {background-position: -176px -44px} +.flag.flag-en_ca {background-position: -48px -22px} +.flag.flag-el_gr {background-position: -112px -55px} +.flag.flag-uk_ua {background-position: -96px -154px} +.flag.flag-ru_ru {background-position: -224px -121px} +.flag.flag-pt_br {background-position: -192px -11px} +.flag.flag-pl_pl {background-position: -32px -121px} +.flag.flag-nl_nl {background-position: -80px -110px} +.flag.flag-nb_no {background-position: -96px -110px} +.flag.flag-it_it {background-position: -208px -66px} +.flag.flag-de_de {background-position: -80px -33px} +.flag.flag-ro_ro {background-position: -192px -121px} +.flag.flag-fr_fr {background-position: -144px -44px} +.flag.flag-fr_ca {background-position: -144px -44px} +.flag.flag-pt_pt {background-position: -112px -121px} +.flag.flag-pt_br {background-position: -192px -11px} +.flag.flag-ar_sa {background-position: 0 -132px} +.flag.flag-bg_bg {background-position: -80px -11px} +.flag.flag-es_es {background-position: -16px -44px} +.flag.flag-es_la {background-position: -16px -44px} +.flag.flag-et_ee {background-position: -192px -33px} +.flag.flag-lt_lt {background-position: -80px -88px} +.flag.flag-lv_lv {background-position: -112px -88px} +.flag.flag-is_is {background-position: -192px -66px} +.flag.flag-hu_hu {background-position: -32px -66px} +.flag.flag-ko_kr {background-position: -144px -77px} +.flag.flag-ja_jp {background-position: -16px -77px} +.flag.flag-sl_si {background-position: -128px -132px} +.flag.flag-sk_sk {background-position: -144px -132px} +.flag.flag-tr_tr {background-position: -16px -154px} +.flag.flag-sv_se {background-position: -80px -132px} +.flag.flag-cs_cz {background-position: -64px -33px} +.flag.flag-zh_cn {background-position: -208px -22px} +.flag.flag-zh_tw {background-position: -64px -154px} +.flag.flag-zh_hk {background-position: -208px -22px} diff --git a/vendors/ifvisible/.jshintrc b/vendors/ifvisible/.jshintrc deleted file mode 100644 index 6c3f5d197..000000000 --- a/vendors/ifvisible/.jshintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "boss": true, - "undef": false, - "white": false, - "eqeqeq": false, - "browser": true, - "devel": true, - "bitwise": false, - "quotmark": false, - "camelcase": false, - "strict": false, - "trailing": true -} diff --git a/vendors/ifvisible/README.md b/vendors/ifvisible/README.md deleted file mode 100644 index 0b39e63e7..000000000 --- a/vendors/ifvisible/README.md +++ /dev/null @@ -1,102 +0,0 @@ -ifvisible.js ------------- - -Crosbrowser & lightweight way to check if user is looking at the page or interacting with it. - -#### Check out the [Demo](http://serkanyersen.github.com/ifvisible.js/demo.html) or read below for code example or Check [Annotated Sorce](http://serkanyersen.github.com/ifvisible.js/docs/ifvisible.html) - - -## Installation -From Bower -``` -bower install ifvisible -``` - -For Meteor -``` -mrt add ifvisible -``` -> meteor package is provided by [@frozeman](https://github.com/frozeman/meteor-ifvisible.js) via [Atmosphere](https://atmosphere.meteor.com/package/ifvisible) - -## Examples - -```javascript - -// If page is visible right now -if( ifvisible.now() ){ - // Display pop-up - openPopUp(); -} - -``` - -Handle tab switch or browser minimize states - -```javascript - -ifvisible.on("blur", function(){ - // example code here.. - animations.pause(); -}); - -ifvisible.on("focus", function(){ - // resume all animations - animations.resume(); -}); - -``` - -ifvisible.js can handle activity states too, such as being IDLE or ACTIVE on the page - -```javascript - -ifvisible.on("idle", function(){ - // Stop auto updating the live data - stream.pause(); -}); - -ifvisible.on("wakeup", function(){ - // go back updating data - stream.resume(); -}); - -``` - -Default idle duration is 60 seconds but you can change it with `setIdleDuration` method - -```javascript - -ifvisible.setIdleDuration(120); // Page will become idle after 120 seconds - -``` - -You can manually trigger status events by calling them directly or you can set events with their names by giving first argument as a callback - -```javascript - -ifvisible.idle(); // will put page in a idle status - -ifvisible.idle(function(){ - // This code will work when page goes into idle status -}); - -// other methods are -ifvisible.blur(); -ifvisible.focus(); -ifvisible.idle(); -ifvisible.wakeup(); - -``` - -You can set your smart intervals with ifvisible.js, if user is IDLE or not seeing the page the interval will automatically stop itself - -```javascript - -// If page is visible run this function on every half seconds -ifvisible.onEvery(0.5, function(){ - // Do an animation on the logo only when page is visible - animateLogo(); - -}); - -``` diff --git a/vendors/ifvisible/component.json b/vendors/ifvisible/component.json deleted file mode 100644 index 448bbfffd..000000000 --- a/vendors/ifvisible/component.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "ifvisible.js", - "version": "1.0.0", - "main": "./src/ifvisible.js" -} \ No newline at end of file diff --git a/vendors/ifvisible/ifvisible.min.js b/vendors/ifvisible/ifvisible.min.js deleted file mode 100644 index d17ef0dfe..000000000 --- a/vendors/ifvisible/ifvisible.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*!ifvisible.js v1.0.0 (c) 2013 Serkan Yersen | MIT */ -(function(){"use strict";var e,t,n,i,r,u,o,f,c,d,s,a,v,l;c={},n=document,s=!1,a="active",o=6e4,u=!1,t=function(){var e,t,n,i,r,u;return e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)},r=function(){return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},u={},n="__ceGUID",t=function(e,t,i){return e[n]=void 0,e[n]||(e[n]="ifvisible.object.event.identifier"),u[e[n]]||(u[e[n]]={}),u[e[n]][t]||(u[e[n]][t]=[]),u[e[n]][t].push(i)},i=function(e,t,i){var r,o,f,c,d;if(e[n]&&u[e[n]]&&u[e[n]][t]){for(c=u[e[n]][t],d=[],o=0,f=c.length;f>o;o++)r=c[o],d.push(r(i||{}));return d}},{add:t,fire:i}}(),e=function(){var e;return e=!1,function(t,n,i){return e||(e=t.addEventListener?function(e,t,n){return e.addEventListener(t,n,!1)}:t.attachEvent?function(e,t,n){return e.attachEvent("on"+t,n,!1)}:function(e,t,n){return e["on"+t]=n}),e(t,n,i)}}(),i=function(e,t){var i;return n.createEventObject?e.fireEvent("on"+t,i):(i=n.createEvent("HTMLEvents"),i.initEvent(t,!0,!0),!e.dispatchEvent(i))},f=function(){var e,t,i,r,u;for(r=void 0,u=3,i=n.createElement("div"),e=i.getElementsByTagName("i"),t=function(){return i.innerHTML="",e[0]};t(););return u>4?u:r}(),r=!1,l=void 0,"undefined"!=typeof n.hidden?(r="hidden",l="visibilitychange"):"undefined"!=typeof n.mozHidden?(r="mozHidden",l="mozvisibilitychange"):"undefined"!=typeof n.msHidden?(r="msHidden",l="msvisibilitychange"):"undefined"!=typeof n.webkitHidden&&(r="webkitHidden",l="webkitvisibilitychange"),v=function(){var t,i;return t=!1,i=function(){return clearTimeout(t),"active"!==a&&c.wakeup(),u=+new Date,t=setTimeout(function(){return"active"===a?c.idle():void 0},o)},i(),e(n,"mousemove",i),e(n,"keyup",i),e(window,"scroll",i),c.focus(i)},d=function(){var t;return s?!0:(r===!1?(t="blur",9>f&&(t="focusout"),e(window,t,function(){return c.blur()}),e(window,"focus",function(){return c.focus()})):e(n,l,function(){return n[r]?c.blur():c.focus()},!1),s=!0,v())},c={setIdleDuration:function(e){return o=1e3*e},getIdleDuration:function(){return o},getIdleInfo:function(){var e,t;return e=+new Date,t={},"idle"===a?(t.isIdle=!0,t.idleFor=e-u,t.timeLeft=0,t.timeLeftPer=100):(t.isIdle=!1,t.idleFor=e-u,t.timeLeft=u+o-e,t.timeLeftPer=(100-100*t.timeLeft/o).toFixed(2)),t},focus:function(e){return"function"==typeof e?this.on("focus",e):(a="active",t.fire(this,"focus"),t.fire(this,"wakeup"),t.fire(this,"statusChanged",{status:a}))},blur:function(e){return"function"==typeof e?this.on("blur",e):(a="hidden",t.fire(this,"blur"),t.fire(this,"idle"),t.fire(this,"statusChanged",{status:a}))},idle:function(e){return"function"==typeof e?this.on("idle",e):(a="idle",t.fire(this,"idle"),t.fire(this,"statusChanged",{status:a}))},wakeup:function(e){return"function"==typeof e?this.on("wakeup",e):(a="active",t.fire(this,"wakeup"),t.fire(this,"statusChanged",{status:a}))},on:function(e,n){return d(),t.add(this,e,n)},onEvery:function(e,t){var n;return d(),n=setInterval(function(){return"active"===a?t():void 0},1e3*e),{stop:function(){return clearInterval(n)},code:n,callback:t}},now:function(){return d(),"active"===a}},"function"==typeof define&&define.amd?define(function(){return c}):window.ifvisible=c}).call(this); \ No newline at end of file diff --git a/vendors/ifvisible/src/ifvisible.coffee b/vendors/ifvisible/src/ifvisible.coffee deleted file mode 100644 index 20084d819..000000000 --- a/vendors/ifvisible/src/ifvisible.coffee +++ /dev/null @@ -1,417 +0,0 @@ -# # Ifvisible.js -# By Serkan Yersen - http://serkanyersen.github.com/ifvisible.js/ - - -###Copyright (c) 2013 Serkan Yersen - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.### - -# Use strict rules for proper coding -"use strict" - -# Export Object -# ``` -# @type {Object} -# ``` -ifvisible = {} - -# document element -# ``` -# @type {Document Object} -# ``` -doc = document - -# flag to prevent multiple initializations -# ``` -# @type {Boolean}` -# ``` -initialized = false - -# Current status, may contain `active`, `idle`, `hidden` -# ``` -# @type {String}` -# ``` -status = "active" - -# Time to wait when setting page to idle -# ``` -# @type {Number} in miliseconds -# ``` -idleTime = 60000 - -# To track how many time left to become IDLE I need to know -# when we started keeping the time -# ``` -# @type {Number} in miliseconds -# ``` -idleStartedTime = false - -# ## Custome Event Handler - -# Handle Custom Object events -# ``` -# @return {Object} add and fire methods to handle custom events -# ``` -customEvent = (-> - # Create a synthetic GUID - S4 = -> - (((1+Math.random())*0x10000)|0).toString(16).substring(1) - guid = -> - (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()) - - # Event listeners - # ``` - # @type {Object} - # ``` - listeners = {} - - # Name of the custom GUID property - # ``` - # @type {String} - # ``` - cgid = '__ceGUID' - - # Add a custom event to a given object - # ``` - # @param {Object} obj Object to add custom events - # @param {string} event name of the custom event - # @param {Function} callback callback function to run when - # event is fired - # ``` - addCustomEvent = (obj, event, callback)-> - # Extent Objects with custom event GUID so that it will be hidden - obj[cgid] = `undefined` # it was using prototype before but diabled - # We were using GUID here but it's disabled to keep events object in scope - obj[cgid] = "ifvisible.object.event.identifier" unless obj[cgid] - # create a place for event - listeners[obj[cgid]] = {} unless listeners[obj[cgid]] - listeners[obj[cgid]][event] = [] unless listeners[obj[cgid]][event] - # add event - listeners[obj[cgid]][event].push(callback) - - # Trigger the custom event on given object - # ``` - # @param {Object} obj Object to trigger the event - # @param {string} event name of the event to trigger - # @param {object} memo a custom argument to send - # triggered event - # ``` - fireCustomEvent = (obj, event, memo)-> - if obj[cgid] and listeners[obj[cgid]] and listeners[obj[cgid]][event] - ev memo or {} for ev in listeners[obj[cgid]][event] - - # export methods to use - add: addCustomEvent - fire: fireCustomEvent -)() - -# ## Regular Event Handlers - -# CrossBrowser event attachement -# ``` -# @param {DomElement} el Dom Element to attach the event -# @param {string} ev name of the event with on prefix -# @param {Function} fn callback function to run when event -# is fired -# ``` -addEvent = (-> - setListener = false - # return an anonmous function with the correct version of set listener - (el, ev, fn)-> - if not setListener - if el.addEventListener - setListener = (el, ev, fn) -> - el.addEventListener(ev, fn, false) - else if el.attachEvent - setListener = (el, ev, fn) -> - el.attachEvent('on' + ev, fn, false) - else - setListener = (el, ev, fn) -> - el['on' + ev] = fn - setListener(el, ev, fn) -)() - -# Trigger any HTML events -# ``` -# @param {DomElement} element Dom Element to trigger -# events on -# @param {string} event event name to trigger -# @return {boolean} if dispached or not -# ``` -fireEvent = (element, event) -> - if doc.createEventObject - element.fireEvent('on'+event,evt) - else - evt = doc.createEvent('HTMLEvents') - evt.initEvent(event, true, true) - not element.dispatchEvent(evt) - -# ## IE Detection - -# Get the IE version -# ``` -# @return {Number|Undefined} version number of IE or undefined -# ``` -ie = (-> - undef = undefined - v = 3 - div = doc.createElement("div") - all = div.getElementsByTagName("i") - - check = -> - return ((div.innerHTML = ""); all[0]) - - while check() - continue - - (if v > 4 then v else undef) -)() - -# ## Get HTML5 visibility api for current browser - -# Set the name of the hidden property and the change event for visibility checks -hidden = false -visibilityChange = undefined -# Standarts -if typeof doc.hidden isnt "undefined" - hidden = "hidden" - visibilityChange = "visibilitychange" -# For Gecko browsers -else if typeof doc.mozHidden isnt "undefined" - hidden = "mozHidden" - visibilityChange = "mozvisibilitychange" -# For MSIE -else if typeof doc.msHidden isnt "undefined" - hidden = "msHidden" - visibilityChange = "msvisibilitychange" -# For Webkit browsers -else if typeof doc.webkitHidden isnt "undefined" - hidden = "webkitHidden" - visibilityChange = "webkitvisibilitychange" - - -# Track if the page is idle or not -trackIdleStatus = -> - timer = false - wakeUp = -> - clearTimeout timer - ifvisible.wakeup() if status isnt "active" - idleStartedTime = +(new Date()) - timer = setTimeout(-> - ifvisible.idle() if status is "active" - , idleTime) - - # Call once so that it can set page to idle without doing anything - wakeUp() - addEvent doc, "mousemove", wakeUp - addEvent doc, "keyup", wakeUp - addEvent window, "scroll", wakeUp - # If page got focus but noinput activity was recorded - ifvisible.focus wakeUp - -# ## Initialize the module - -# constructor -init = -> - return true if initialized - - # If hidden is false the use the legacy methods - if hidden is false - blur = "blur" - blur = "focusout" if ie < 9 - addEvent window, blur, -> - ifvisible.blur() - - addEvent window, "focus", -> - ifvisible.focus() - - else - - # add HTML5 visibility events - addEvent doc, visibilityChange, -> - if doc[hidden] - ifvisible.blur() - else - ifvisible.focus() - , false - initialized = true - - #Set method to be initialized - trackIdleStatus() - -# ## Exports - -# Methods to be exported -# ``` -# @type {Object} -# ``` -ifvisible = - - # Change idle timeout value. - # ``` - # @param {Number} seconds a number in seconds such as: 10 or 0.5 - # ``` - setIdleDuration: (seconds) -> - idleTime = seconds * 1000 - - - # Get idle timeout value. - getIdleDuration: -> - idleTime - - - # Get information about user being idle. - # ``` - # @return {Object} An object contining information about idle status - # ``` - # Informations is as following - # ``` - # isIdle: [current idle status true/false] - # idleFor: [how long the user was idle - # in milliseconds] - # timeLeft: [How long does it take to become - # idle in milliseconds] - # timeLeftPer: [How long does it take to become - # idle in percentage] - # ``` - getIdleInfo: -> - now = +(new Date()) - res = {} - if status is "idle" - res.isIdle = true - res.idleFor = now - idleStartedTime - res.timeLeft = 0 - res.timeLeftPer = 100 - else - res.isIdle = false - res.idleFor = now - idleStartedTime - res.timeLeft = (idleStartedTime + idleTime) - now - res.timeLeftPer = (100 - (res.timeLeft * 100 / idleTime)).toFixed(2) - res - - - # When User Opens the page, - # ``` - # @note: User may not be looking at it directly - # ``` - focus: (callback) -> - - # if first argument is a callback then set an event - return @on("focus", callback) if typeof callback is "function" - # else trigger event - status = "active" - customEvent.fire this, "focus" - customEvent.fire this, "wakeup" # When focused page will woke up too. - customEvent.fire this, "statusChanged", { status: status } - - - # When User swicthes tabs or minimizes the window - # ``` - # @note: this may trigger when iframes are selected - # ``` - blur: (callback) -> - - # if first argument is a callback then set an event - return @on("blur", callback) if typeof callback is "function" - # else trigger event - status = "hidden" - customEvent.fire this, "blur" - customEvent.fire this, "idle" # When blurred page is idle too - customEvent.fire this, "statusChanged", { status: status } - - - # When page is focused but user is doing nothing on the page - idle: (callback) -> - - # if first argument is a callback then set an event - return @on("idle", callback) if typeof callback is "function" - # else trigger event - status = "idle" - customEvent.fire this, "idle" - customEvent.fire this, "statusChanged", { status: status } - - - # When user started to make interactions on the page such as: - # `mousemove`, `click`, `keypress`, `scroll` - # This will be called when page has focus too - wakeup: (callback) -> - - # if first argument is a callback then set an event - return @on("wakeup", callback) if typeof callback is "function" - # else trigger event - status = "active" - customEvent.fire this, "wakeup" - customEvent.fire this, "statusChanged", { status: status } - - - - # Set an event to ifvisible object - # ``` - # @param {string} name Event name such as focus, - # idle, blur, wakeup - # @param {Function} callback callback function to call - # when event is fired - # @return {object} an object with a stop method - # to unbid this event - # ``` - on: (name, callback) -> - init() # Auto init on first call - customEvent.add this, name, callback - - - # if page is visible then run given code in given seconds of intervals - # ``` - # @param {float} seconds seconds to run interval - # @param {Function} callback callback function to run - # ``` - onEvery: (seconds, callback) -> - # Auto init on first call - init() - t = setInterval(-> - callback() if status is "active" - , seconds * 1000) - - # return methods - stop: -> - clearInterval t - - code: t - callback: callback - - - # `ifvisible.now()` return if the page is visible right now? - # ``` - # @return {boolean} true if page is visible - # ``` - now: -> - # Auto init on first call - init() - status is "active" - - -# If there is a **Require JS** kind of library use it othervise -# place it on the `window` -if typeof define is "function" and define.amd - define -> - ifvisible - -else - window.ifvisible = ifvisible - -# compile code: `coffee -wcm ifvisible.coffee` diff --git a/vendors/ifvisible/src/ifvisible.js b/vendors/ifvisible/src/ifvisible.js deleted file mode 100644 index 5f1a02d88..000000000 --- a/vendors/ifvisible/src/ifvisible.js +++ /dev/null @@ -1,315 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -/*Copyright (c) 2013 Serkan Yersen - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - - -(function() { - "use strict"; - var addEvent, customEvent, doc, fireEvent, hidden, idleStartedTime, idleTime, ie, ifvisible, init, initialized, status, trackIdleStatus, visibilityChange; - - ifvisible = {}; - - doc = document; - - initialized = false; - - status = "active"; - - idleTime = 60000; - - idleStartedTime = false; - - customEvent = (function() { - var S4, addCustomEvent, cgid, fireCustomEvent, guid, listeners; - - S4 = function() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); - }; - guid = function() { - return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4(); - }; - listeners = {}; - cgid = '__ceGUID'; - addCustomEvent = function(obj, event, callback) { - obj[cgid] = undefined; - if (!obj[cgid]) { - obj[cgid] = "ifvisible.object.event.identifier"; - } - if (!listeners[obj[cgid]]) { - listeners[obj[cgid]] = {}; - } - if (!listeners[obj[cgid]][event]) { - listeners[obj[cgid]][event] = []; - } - return listeners[obj[cgid]][event].push(callback); - }; - fireCustomEvent = function(obj, event, memo) { - var ev, _i, _len, _ref, _results; - - if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { - _ref = listeners[obj[cgid]][event]; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - ev = _ref[_i]; - _results.push(ev(memo || {})); - } - return _results; - } - }; - return { - add: addCustomEvent, - fire: fireCustomEvent - }; - })(); - - addEvent = (function() { - var setListener; - - setListener = false; - return function(el, ev, fn) { - if (!setListener) { - if (el.addEventListener) { - setListener = function(el, ev, fn) { - return el.addEventListener(ev, fn, false); - }; - } else if (el.attachEvent) { - setListener = function(el, ev, fn) { - return el.attachEvent('on' + ev, fn, false); - }; - } else { - setListener = function(el, ev, fn) { - return el['on' + ev] = fn; - }; - } - } - return setListener(el, ev, fn); - }; - })(); - - fireEvent = function(element, event) { - var evt; - - if (doc.createEventObject) { - return element.fireEvent('on' + event, evt); - } else { - evt = doc.createEvent('HTMLEvents'); - evt.initEvent(event, true, true); - return !element.dispatchEvent(evt); - } - }; - - ie = (function() { - var all, check, div, undef, v; - - undef = void 0; - v = 3; - div = doc.createElement("div"); - all = div.getElementsByTagName("i"); - check = function() { - return (div.innerHTML = "", all[0]); - }; - while (check()) { - continue; - } - if (v > 4) { - return v; - } else { - return undef; - } - })(); - - hidden = false; - - visibilityChange = void 0; - - if (typeof doc.hidden !== "undefined") { - hidden = "hidden"; - visibilityChange = "visibilitychange"; - } else if (typeof doc.mozHidden !== "undefined") { - hidden = "mozHidden"; - visibilityChange = "mozvisibilitychange"; - } else if (typeof doc.msHidden !== "undefined") { - hidden = "msHidden"; - visibilityChange = "msvisibilitychange"; - } else if (typeof doc.webkitHidden !== "undefined") { - hidden = "webkitHidden"; - visibilityChange = "webkitvisibilitychange"; - } - - trackIdleStatus = function() { - var timer, wakeUp; - - timer = false; - wakeUp = function() { - clearTimeout(timer); - if (status !== "active") { - ifvisible.wakeup(); - } - idleStartedTime = +(new Date()); - return timer = setTimeout(function() { - if (status === "active") { - return ifvisible.idle(); - } - }, idleTime); - }; - wakeUp(); - addEvent(doc, "mousemove", wakeUp); - addEvent(doc, "keyup", wakeUp); - addEvent(window, "scroll", wakeUp); - return ifvisible.focus(wakeUp); - }; - - init = function() { - var blur; - - if (initialized) { - return true; - } - if (hidden === false) { - blur = "blur"; - if (ie < 9) { - blur = "focusout"; - } - addEvent(window, blur, function() { - return ifvisible.blur(); - }); - addEvent(window, "focus", function() { - return ifvisible.focus(); - }); - } else { - addEvent(doc, visibilityChange, function() { - if (doc[hidden]) { - return ifvisible.blur(); - } else { - return ifvisible.focus(); - } - }, false); - } - initialized = true; - return trackIdleStatus(); - }; - - ifvisible = { - setIdleDuration: function(seconds) { - return idleTime = seconds * 1000; - }, - getIdleDuration: function() { - return idleTime; - }, - getIdleInfo: function() { - var now, res; - - now = +(new Date()); - res = {}; - if (status === "idle") { - res.isIdle = true; - res.idleFor = now - idleStartedTime; - res.timeLeft = 0; - res.timeLeftPer = 100; - } else { - res.isIdle = false; - res.idleFor = now - idleStartedTime; - res.timeLeft = (idleStartedTime + idleTime) - now; - res.timeLeftPer = (100 - (res.timeLeft * 100 / idleTime)).toFixed(2); - } - return res; - }, - focus: function(callback) { - if (typeof callback === "function") { - return this.on("focus", callback); - } - status = "active"; - customEvent.fire(this, "focus"); - customEvent.fire(this, "wakeup"); - return customEvent.fire(this, "statusChanged", { - status: status - }); - }, - blur: function(callback) { - if (typeof callback === "function") { - return this.on("blur", callback); - } - status = "hidden"; - customEvent.fire(this, "blur"); - customEvent.fire(this, "idle"); - return customEvent.fire(this, "statusChanged", { - status: status - }); - }, - idle: function(callback) { - if (typeof callback === "function") { - return this.on("idle", callback); - } - status = "idle"; - customEvent.fire(this, "idle"); - return customEvent.fire(this, "statusChanged", { - status: status - }); - }, - wakeup: function(callback) { - if (typeof callback === "function") { - return this.on("wakeup", callback); - } - status = "active"; - customEvent.fire(this, "wakeup"); - return customEvent.fire(this, "statusChanged", { - status: status - }); - }, - on: function(name, callback) { - init(); - return customEvent.add(this, name, callback); - }, - onEvery: function(seconds, callback) { - var t; - - init(); - t = setInterval(function() { - if (status === "active") { - return callback(); - } - }, seconds * 1000); - return { - stop: function() { - return clearInterval(t); - }, - code: t, - callback: callback - }; - }, - now: function() { - init(); - return status === "active"; - } - }; - - if (typeof define === "function" && define.amd) { - define(function() { - return ifvisible; - }); - } else { - window.ifvisible = ifvisible; - } - -}).call(this); - -/* -//@ sourceMappingURL=ifvisible.map -*/ diff --git a/vendors/ifvisible/src/ifvisible.map b/vendors/ifvisible/src/ifvisible.map deleted file mode 100644 index 9e5cb1ff8..000000000 --- a/vendors/ifvisible/src/ifvisible.map +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 3, - "file": "ifvisible.js", - "sourceRoot": "", - "sources": [ - "ifvisible.coffee" - ], - "names": [], - "mappings": ";AAIA;;;;;;;;;;;;;;;;;;;CAAA;CAAA;CAAA;CAAA,CAoBA,UApBA;CAAA,KAAA,+IAAA;;CAAA,CA0BA,CAAY,MAAZ;;CA1BA,CAgCA,CAAA,KAhCA;;CAAA,CAsCA,CAAc,EAtCd,MAsCA;;CAtCA,CA4CA,CAAS,GAAT,EA5CA;;CAAA,CAkDA,CAAW,EAlDX,GAkDA;;CAlDA,CAyDA,CAAkB,EAzDlB,UAyDA;;CAzDA,CAiEA,CAAc,MAAC,EAAf;CAEE,OAAA,kDAAA;;CAAA,CAAA,CAAK,CAAL,KAAK;CACD,CAAD,CAAK,CAAI,EAAJ,CAAJ,CAAD,CAAA,IAAA;CADH,IAAK;CAAL,EAEO,CAAP,KAAO;CACH,CAAA,CAAK,UAAL;CAHJ,IAEO;CAFP,CAAA,CASY,CAAZ,KAAA;CATA,EAeO,CAAP,MAfA;CAAA,CAwBuB,CAAN,CAAjB,CAAiB,GAAA,CAAC,KAAlB;CAEE,EAAI,CAAA,EAAJ,GAAA;AAEuD,CAAvD,EAA2D,CAA3D,EAAA;CAAA,EAAI,CAAA,IAAJ,2BAAA;QAFA;AAIkC,CAAlC,EAAgD,CAAhD,EAAA,GAA4C;CAA5C,CAAA,CAAc,CAAA,IAAd,CAAU;QAJV;AAKwC,CAAxC,EAAsD,CAAtD,CAA6D,CAA7D,GAAkD;CAAlD,CAAA,CAAc,CAAA,CAAO,GAArB,CAAU;QALV;CAOU,EAAI,CAAA,CAAO,GAArB,CAAU,IAAV;CAjCF,IAwBiB;CAxBjB,CA0CwB,CAAN,CAAlB,CAAkB,IAAC,MAAnB;CACE,SAAA,kBAAA;;CAAA,EAAO,CAAJ,CAA4D,CAA/D,GAA2B;CACzB;CAAA;cAAA,6BAAA;yBAAA;CAAA,CAAA,EAAG;CAAH;yBADF;QADgB;CA1ClB,IA0CkB;WAKlB;CAAA,CAAK,CAAL,GAAA,QAAA;CAAA,CACM,EAAN,EAAA,SADA;CAjDa;CAAD,EAAC;;CAjEf,CA+HA,CAAW,KAAX,CAAY;CACV,OAAA,GAAA;;CAAA,EAAc,CAAd,CAAA,MAAA;EAEA,CAAA,MAAC,EAAD;AACS,CAAP,GAAG,EAAH,KAAA;CACE,CAAK,EAAF,IAAH,QAAA;CACE,CAAc,CAAA,MAAC,CAAf,CAAA;CACK,CAAD,GAAF,WAAA,GAAA;CADF,UAAc;CAEL,CAAD,EAAF,EAHR,IAAA,CAAA;CAIE,CAAc,CAAA,MAAC,CAAf,CAAA;CACK,CAAD,CAAoB,CAAP,CAAf,MAAA,QAAA;CADF,UAAc;MAJhB,IAAA;CAOE,CAAc,CAAA,MAAC,CAAf,CAAA;CACK,CAAA,CAAO,CAAP,eAAH;CADF,UAAc;UARlB;QAAA;CAUY,CAAZ,SAAA,EAAA;CAdQ,IAGV;CAHS,EAAC;;CA/HZ,CAuJA,CAAY,EAAA,EAAA,EAAZ;CACE,EAAA,KAAA;;CAAA,EAAM,CAAN,aAAA;CACU,CAAqB,CAAN,CAAL,CAAlB,EAAO,EAAP,IAAA;MADF;CAGE,EAAA,GAAA,KAAM,CAAA;CAAN,CACqB,CAAlB,CAAH,CAAA,CAAA,GAAA;AACI,CAAJ,EAAI,IAAO,MAAX;MANQ;CAvJZ,EAuJY;;CAvJZ,CAqKA,CAAK,MAAC;CACJ,OAAA,iBAAA;;CAAA,EAAQ,CAAR,CAAA,CAAA;CAAA,EACI,CAAJ;CADA,EAEA,CAAA,CAAM,QAAA;CAFN,EAGA,CAAA,gBAAM;CAHN,EAKQ,CAAR,CAAA,IAAQ;AACyC,CAA/C,CAA6C,CAAjC,MAAH,IAAF,GAAkB,OAAjB;CANV,IAKQ;CAIR,EAAA,EAAM,MAAA;CACJ,cADF;CATA,IASA;CAGC,EAAO,CAAP;CAAA,YAAc;MAAd;CAAA,YAAqB;MAblB;CAAD,EAAC;;CArKN,CAwLA,CAAS,EAxLT,CAwLA;;CAxLA,CAyLA,CAAmB,GAzLnB,UAyLA;;AAEG,CAAH,CAAA,CAAa,CAAV,CAAuB,CAAvB,KAAH;CACE,EAAS,CAAT,EAAA,EAAA;CAAA,EACmB,CAAnB,YAAA,EADA;AAGM,CAAA,EAAU,CAJlB,CAIkC,CAJlC,GAIQ,EAJR;CAKE,EAAS,CAAT,EAAA,KAAA;CAAA,EACmB,CAAnB,YAAA,KADA;AAGM,CAAA,EAAU,CARlB,CAQiC,CARjC,EAQQ,GARR;CASE,EAAS,CAAT,EAAA,IAAA;CAAA,EACmB,CAAnB,YAAA,IADA;AAGM,CAAA,EAAU,CAZlB,CAYqC,CAZrC,KAAA,CAYQ;CACN,EAAS,CAAT,EAAA,QAAA;CAAA,EACmB,CAAnB,YAAA,QADA;IAxMF;;CAAA,CA6MA,CAAkB,MAAA,MAAlB;CACE,OAAA,KAAA;;CAAA,EAAQ,CAAR,CAAA;CAAA,EACS,CAAT,EAAA,GAAS;CACP,IAAA,CAAA,MAAA;CACA,GAAuB,CAAY,CAAnC,EAAA;CAAA,KAAA,EAAA,CAAS;QADT;AAEmB,CAFnB,EAEkB,CAAM,EAAxB,SAAA;CACmB,EAAX,EAAR,IAAmB,CAAX,GAAR;CACE,GAAqB,CAAU,CAAV,EAArB;CAAU,GAAV,KAAS,QAAT;UADiB;CAAX,CAEN,KAFiB,CAAX;CALV,IACS;CADT,GAUA,EAAA;CAVA,CAWc,CAAd,CAAA,EAAA,EAAA,GAAA;CAXA,CAYc,CAAd,CAAA,EAAA,CAAA,CAAA;CAZA,CAaiB,EAAjB,EAAA,EAAA;CAEU,IAAV,CAAA,GAAS,EAAT;CA7NF,EA6MkB;;CA7MlB,CAkOA,CAAO,CAAP,KAAO;CACL,GAAA,IAAA;;CAAA,GAAA,OAAA;CAAA,GAAA,SAAO;MAAP;CAGA,GAAA,CAAa,CAAV;CACD,EAAO,CAAP,EAAA;CACA,CAAsB,CAAK,CAAL,EAAtB;CAAA,EAAO,CAAP,IAAA,EAAA;QADA;CAAA,CAEiB,CAAM,CAAvB,EAAA,EAAA,CAAuB;CACX,GAAV,KAAS,MAAT;CADF,MAAuB;CAFvB,CAKiB,CAAS,GAA1B,CAAA,CAAA,CAA0B;CACd,IAAV,IAAS,MAAT;CADF,MAA0B;MAN5B;CAYE,CAAc,CAAd,GAAA,EAAA,CAAgC,OAAhC;CACE,EAAO,CAAJ,EAAI,EAAP;CACY,GAAV,KAAS,QAAT;MADF,IAAA;CAGY,IAAV,IAAS,QAAT;UAJ4B;CAAhC,CAKE,GALF,EAAgC;MAflC;CAAA,EAqBc,CAAd,OAAA;CAGA,UAAA,IAAA;CA3PF,EAkOO;;CAlOP,CAmQA,CAME,MANF;CAME,CAAiB,CAAA,CAAjB,GAAiB,EAAC,MAAlB;CAAiB,EACJ,IAAA,CAAX,KAAA;CADF,IAAiB;CAAjB,CAKiB,CAAA,CAAjB,KAAiB,MAAjB;CAAiB,YACf;CANF,IAKiB;CALjB,CAuBa,CAAA,CAAb,KAAa,EAAb;CACE,OAAA,EAAA;;AAAO,CAAP,EAAA,CAAY,EAAZ;CAAA,CAAA,CACA,GAAA;CACA,GAAG,CAAU,CAAb;CACE,EAAG,CAAH,EAAA,EAAA;CAAA,EACG,IAAH,CAAA,OADA;CAAA,EAEG,KAAH;CAFA,EAGG,KAAH,GAAA;MAJF,EAAA;CAME,EAAG,EAAH,CAAA,EAAA;CAAA,EACG,IAAH,CAAA,OADA;CAAA,EAEG,KAAH,OAAgB;CAFhB,EAGG,IAAe,CAAlB,GAAA;QAXF;CADW,YAaX;CApCF,IAuBa;CAvBb,CA2CO,CAAA,CAAP,CAAA,GAAO,CAAC;AAG4B,CAAlC,GAAkC,CAAmB,CAArD,EAAkC,EAAlC;CAAA,CAAO,EAAC,GAAD,CAAA,OAAA;QAAP;CAAA,EAES,GAAT,EAFA;CAAA,CAGuB,EAAvB,EAAA,CAAA,IAAW;CAHX,CAIuB,EAAvB,EAAA,EAAA,GAAW;CACC,CAAW,EAAvB,OAAW,EAAX,EAAA;CAAwC,CAAU,IAAR,EAAA;CARrC,OAQL;CAnDF,IA2CO;CA3CP,CA0DM,CAAA,CAAN,IAAM,CAAC;AAG4B,CAAjC,GAAiC,CAAmB,CAApD,EAAiC,EAAjC;CAAA,CAAO,EAAC,EAAD,EAAA,OAAA;QAAP;CAAA,EAES,GAAT,EAFA;CAAA,CAGuB,EAAvB,EAAA,KAAW;CAHX,CAIuB,EAAvB,EAAA,KAAW;CACC,CAAW,EAAvB,OAAW,EAAX,EAAA;CAAwC,CAAU,IAAR,EAAA;CARtC,OAQJ;CAlEF,IA0DM;CA1DN,CAsEM,CAAA,CAAN,IAAM,CAAC;AAG4B,CAAjC,GAAiC,CAAmB,CAApD,EAAiC,EAAjC;CAAA,CAAO,EAAC,EAAD,EAAA,OAAA;QAAP;CAAA,EAES,GAAT;CAFA,CAGuB,EAAvB,EAAA,KAAW;CACC,CAAW,EAAvB,OAAW,EAAX,EAAA;CAAwC,CAAU,IAAR,EAAA;CAPtC,OAOJ;CA7EF,IAsEM;CAtEN,CAmFQ,CAAA,CAAR,EAAA,EAAQ,CAAC;AAG4B,CAAnC,GAAmC,CAAmB,CAAtD,EAAmC,EAAnC;CAAA,CAAO,EAAC,IAAD,OAAA;QAAP;CAAA,EAES,GAAT,EAFA;CAAA,CAGuB,EAAvB,EAAA,EAAA,GAAW;CACC,CAAW,EAAvB,OAAW,EAAX,EAAA;CAAwC,CAAU,IAAR,EAAA;CAPpC,OAON;CA1FF,IAmFQ;CAnFR,CAuGA,CAAI,CAAJ,IAAI,CAAC;CACH,GAAA,EAAA;CACY,CAAU,CAAtB,CAAA,IAAA,GAAW,EAAX;CAzGF,IAuGI;CAvGJ,CAiHS,CAAA,CAAT,GAAA,CAAS,CAAC;CAER,SAAA;;CAAA,GAAA,EAAA;CAAA,EACI,GAAJ,GAAgB,EAAZ;CACF,GAAe,CAAU,CAAV,EAAf;CAAA,OAAA,SAAA;UADc;CAAZ,CAEF,CAAU,CAFR,GAAY;aAKhB;CAAA,CAAM,CAAA,CAAN,IAAA,CAAM;CACU,YAAd,IAAA;CADF,QAAM;CAAN,CAGM,EAAN,IAAA;CAHA,CAIU,MAAV;CAZO;CAjHT,IAiHS;CAjHT,CAoIK,CAAL,CAAA,KAAK;CAEH,GAAA,EAAA;CAFG,IAGO,CAAV,OAAA;CAvIF,IAoIK;CA7YP,GAAA;;AAqZG,CAAH,CAAA,CAAA,CAAG,CAAiB,CAAjB,IAAA;CACD,EAAO,CAAP,EAAA,GAAO;CAAA,YACL;CADF,IAAO;IADT,EAAA;CAKE,EAAmB,CAAnB,EAAM,GAAN;IA1ZF;CAAA" -} \ No newline at end of file diff --git a/vendors/inputosaurus/inputosaurus.min.js b/vendors/inputosaurus/inputosaurus.min.js deleted file mode 100644 index e55ec777a..000000000 --- a/vendors/inputosaurus/inputosaurus.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! Inputosaurus Text v0.1.6 (c) 2013 Dan Kielp ; modified by RainLoop Team | MIT */ -!function(e){var t={version:"0.1.6",fakeSpan:e(''),eventprefix:"inputosaurus",options:{inputDelimiters:[",",";"],outputDelimiter:",",allowDuplicates:!1,allowDragAndDrop:!0,focusCallback:null,parseOnBlur:!1,wrapperElement:null,width:null,autoCompleteSource:"",activateFinalResult:!1,parseHook:null,elementHook:null,placeholder:null},_create:function(){var t=this,i={},n=t.options,s=n.placeholder||this.element.attr("placeholder")||null;this._chosenValues=[],i.ul=e('
    '),this.options.allowDragAndDrop&&i.ul.droppable({drop:function(e,n){n.draggable.addClass("inputosaurus-dropped"),i.input.val(n.draggable.data("inputosaurus-value")),n.draggable.__widget&&n.draggable.__widget._removeDraggedTag(n.draggable),t.parseInput()}}),i.input=e(''),i.inputCont=e('
  • '),i.origInputCont=e('
  • '),i.lastEdit="",i.input.on("focus",function(){t._focusTrigger(!0)}).on("blur",function(){t._focusTrigger(!1)}),s&&(n.placeholder=s,i.input.attr("placeholder",n.placeholder),n.width&&i.input.css("min-width",n.width-50)),n.wrapperElement&&n.wrapperElement.append(i.ul),this.element.replaceWith(n.wrapperElement||i.ul),i.origInputCont.append(this.element).hide(),i.inputCont.append(i.input),i.ul.append(i.inputCont),i.ul.append(i.origInputCont),n.width&&i.ul.css("width",n.width),this.elements=i,t._attachEvents(),e.trim(this.element.val())&&(i.input.val(this.element.val()),this.parseInput()),this._instAutocomplete()},_focusTriggerTimer:0,_focusTrigger:function(e){var t=this;window.clearTimeout(this._focusTriggerTimer),this._focusTriggerTimer=window.setTimeout(function(){t.elements.ul[e?"addClass":"removeClass"]("inputosaurus-focused"),t.options.focusCallback&&t.options.focusCallback(e)},10)},_instAutocomplete:function(){if(this.options.autoCompleteSource){var t=this;this.elements.input.autocomplete({position:{of:this.elements.ul},source:this.options.autoCompleteSource,minLength:1,autoFocus:!0,select:function(e,i){e.preventDefault(),t.elements.input.val(i.item.value),t.parseInput()},open:function(){var i,n=e(this).data("ui-autocomplete").menu;n.element.width(t.elements.ul.outerWidth()-6),t.options.activateFinalResult&&(i=n.element.find("li"),1===i.size()&&n[n.activate?"activate":"focus"](e.Event("click"),i))},focus:function(){return!1}})}},_autoCompleteMenuPosition:function(){var e;this.options.autoCompleteSource&&(e=this.elements.input.data("ui-autocomplete"),e&&e.menu.element.position({of:this.elements.ul,my:"left top",at:"left bottom",collision:"none"}))},parseInput:function(t){var i,n=t&&t.data.widget||this,s=!1,u=[];i=n.elements.input.val(),i&&(s=n._containsDelimiter(i)),s!==!1?u=i.split(s):t&&(t.which!==e.ui.keyCode.ENTER||e(".ui-menu-item .ui-state-focus").size()||e("#ui-active-menuitem").size())?"blur"!==t.type||e("#ui-active-menuitem").size()||u.push(i):(u.push(i),t&&t.preventDefault()),e.isFunction(n.options.parseHook)&&(u=n.options.parseHook(u)),u.length&&(n._setChosen(u),n.elements.input.val(""),n._resizeInput()),n._resetPlaceholder()},_inputFocus:function(e){var t=e.data.widget||this;t.elements.input.value||t.options.autoCompleteSource.length&&t.elements.input.autocomplete("search","")},_inputKeypress:function(t){var i=t.data.widget||this;switch("keyup"===t.type&&i._trigger("keyup",t,i),t.which){case e.ui.keyCode.BACKSPACE:"keydown"===t.type&&i._inputBackspace(t);break;case e.ui.keyCode.LEFT:"keydown"===t.type&&i._inputBackspace(t);break;default:i.parseInput(t),i._resizeInput(t)}i.options.autoCompleteSource&&setTimeout(function(){i._autoCompleteMenuPosition.call(i)},200)},resizeInput:function(){this._resizeInput()},_resizeInput:function(e){var i=e&&e.data.widget||this;t.fakeSpan.text(i.elements.input.val());var n=25+t.fakeSpan.width();n=n>50?n:50,n=500>n?n:500,i.elements.input.width(n)},_resetPlaceholder:function(){var e=this.options.placeholder,t=this.elements.input,i=this.options.width||"inherit";e&&0===this.element.val().length?t.attr("placeholder",e).css("min-width",i-50):t.attr("placeholder","").css("min-width","inherit")},_inputBackspace:function(t){var i=t&&t.data.widget||this,n=i.elements.ul.find("li:not(.inputosaurus-required):last");t.stopPropagation(),(!e(t.currentTarget).val()||"selectionStart"in t.currentTarget&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd)&&n.size()&&(t.preventDefault(),n.find("a").focus())},_editTag:function(t){var i=t&&t.data.widget||this,n="",s=e(t.currentTarget).closest("li"),u=s.data("inputosaurus");if(!u)return!0;t.preventDefault();var a=null,o=!1;e.each(i._chosenValues,function(e,t){t.key===u?(n=t.value,o=!0):o&&!a&&(a=t)}),a&&(i.elements.lastEdit=a.value),s.after(i.elements.inputCont),i.elements.input.val(n),window.setTimeout(function(){i.elements.input.select()},100),i._removeTag(t),i._resizeInput(t)},_tagKeypress:function(t){var i=t.data.widget;switch(t.which){case e.ui.keyCode.DELETE:case e.ui.keyCode.BACKSPACE:t&&t.preventDefault(),t&&t.stopPropagation(),e(t.currentTarget).trigger("click");break;case 69:case e.ui.keyCode.ENTER:i._editTag(t);break;case e.ui.keyCode.LEFT:"keydown"===t.type&&i._prevTag(t);break;case e.ui.keyCode.RIGHT:"keydown"===t.type&&i._nextTag(t);break;case e.ui.keyCode.DOWN:"keydown"===t.type&&i._focus(t)}},_prevTag:function(t){var i=t&&t.data.widget||this,n=e(t.currentTarget).closest("li"),s=n.prev();s.is("li")?s.find("a").focus():i._focus()},_nextTag:function(t){var i=t&&t.data.widget||this,n=e(t.currentTarget).closest("li"),s=n.next();s.is("li:not(.inputosaurus-input)")?s.find("a").focus():i._focus()},_containsDelimiter:function(t){var i=!1;return e.each(this.options.inputDelimiters,function(e,n){-1!==t.indexOf(n)&&(i=n)}),i},_setChosen:function(t){var i=this;return e.isArray(t)?(e.each(t,function(t,n){var s="",u=!1,a=-1,o={key:"",obj:null,value:""};s=e.trim(n[0]),e.each(i._chosenValues,function(e,t){t.value===i.elements.lastEdit&&(a=e),t.value===s&&(u=!0)}),""===s||u&&!i.options.allowDuplicates||(o.key="mi_"+Math.random().toString(16).slice(2,10),o.value=s,o.obj=n[1],a>-1?i._chosenValues.splice(a,0,o):i._chosenValues.push(o),i.elements.lastEdit="",i._renderTags())}),1===t.length&&""===t[0]&&""!==i.elements.lastEdit&&(i.elements.lastEdit="",i._renderTags()),void i._setValue(i._buildValue())):!1},_buildValue:function(){var t=this,i="";return e.each(this._chosenValues,function(e,n){i+=i.length?t.options.outputDelimiter+n.value:n.value}),i},_setValue:function(e){var t=this.element.val();t!==e&&(this.element.val(e),this._trigger("change"))},_createTag:function(t,i,n){if(void 0!==t&&n){var s=this,u=e('
  • '+n.toLine(!0,!1,!0)+"
  • ");return u.data("inputosaurus-value",n.toLine(!1,!1,!1)),this.options.allowDragAndDrop&&u.draggable({revert:"invalid",revertDuration:200,start:function(e,t){t.helper.__widget=s}}),e.isFunction(this.options.elementHook)&&this.options.elementHook(u,n),u}},_renderTags:function(){var t=this;this.elements.ul.find("li:not(.inputosaurus-required)").remove(),e.each(this._chosenValues,function(e,i){var n=t._createTag(i.value,i.key,i.obj);t.elements.ul.find("li.inputosaurus-input").before(n)})},_removeTag:function(t){var i=e(t.currentTarget).closest("li").data("inputosaurus"),n=!1,s=t&&t.data.widget||this;e.each(s._chosenValues,function(e,t){i===t.key&&(n=e)}),n!==!1&&s._chosenValues.splice(n,1),s._setValue(s._buildValue()),e(t.currentTarget).closest("li").remove(),window.setTimeout(function(){s.elements.input.focus()},100)},_removeDraggedTag:function(t){var i=t.data("inputosaurus"),n=this,s=!1;e.each(n._chosenValues,function(e,t){i===t.key&&(s=e)}),!1!==s&&(n._chosenValues.splice(s,1),n._setValue(n._buildValue())),t.remove()},focus:function(){this.elements.input.focus()},blur:function(){this.elements.input.blur()},_focus:function(t){var i=t&&t.data.widget||this,n=t&&t.target?e(t.target).closest("li"):null;n&&n.is("li")&&n.find("a").focus(),t&&e(t.target).closest("li").data("inputosaurus")||i.elements.input.focus()},_tagFocus:function(t){e(t.currentTarget).parent()["focusout"===t.type?"removeClass":"addClass"]("inputosaurus-selected")},refresh:function(){var t=this.options.outputDelimiter,i=this.element.val(),n=[];n.push(i),t&&(n=i.split(t)),n.length&&(this._chosenValues=[],e.isFunction(this.options.parseHook)&&(n=this.options.parseHook(n)),this._setChosen(n),this._renderTags(),this.elements.input.val(""),this._resizeInput())},_attachEvents:function(){var e=this;this.elements.input.on("keyup.inputosaurus",{widget:e},this._inputKeypress),this.elements.input.on("keydown.inputosaurus",{widget:e},this._inputKeypress),this.elements.input.on("change.inputosaurus",{widget:e},this._inputKeypress),this.elements.input.on("focus.inputosaurus",{widget:e},this._inputFocus),this.options.parseOnBlur&&this.elements.input.on("blur.inputosaurus",{widget:e},this.parseInput),this.elements.ul.on("click.inputosaurus",{widget:e},this._focus),this.elements.ul.on("click.inputosaurus","a",{widget:e},this._removeTag),this.elements.ul.on("dblclick.inputosaurus","li",{widget:e},this._editTag),this.elements.ul.on("doubletap.inputosaurus","li",{widget:e},this._editTag),this.elements.ul.on("focus.inputosaurus","a",{widget:e},this._tagFocus),this.elements.ul.on("blur.inputosaurus","a",{widget:e},this._tagFocus),this.elements.ul.on("keydown.inputosaurus","a",{widget:e},this._tagKeypress)},_destroy:function(){this.elements.input.unbind(".inputosaurus"),this.elements.ul.replaceWith(this.element)}};e("body").append(t.fakeSpan),e.widget("ui.inputosaurus",t)}(jQuery); diff --git a/vendors/jquery-backstretch/LICENSE-MIT b/vendors/jquery-backstretch/LICENSE-MIT deleted file mode 100644 index 536df7d99..000000000 --- a/vendors/jquery-backstretch/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Scott Robbin - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendors/jquery-backstretch/README.md b/vendors/jquery-backstretch/README.md deleted file mode 100644 index bddf3fa72..000000000 --- a/vendors/jquery-backstretch/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# Backstretch - -Backstretch is a simple jQuery plugin that allows you to add a dynamically-resized, slideshow-capable background image to any page or element. The image will stretch to fit the page/element, and will automatically resize as the window/element size changes. -## Demo - -There are a couple of examples included with this package, or feel free to check it out live [on the project page itself](http://srobbin.com/jquery-plugins/backstretch/). - -## Setup - -Include the jQuery library (version 1.7 or newer) and Backstretch plugin files in your webpage (preferably at the bottom of the page, before the closing BODY tag): - -```html - - - -``` - -## Options - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| `centeredX` | The ratio of the width/height of the image doesn't always jive with the width/height of the window. This parameter controls whether or not we center the image on the X axis to account for the discrepancy. | Boolean | true | -| `centeredY` | This parameter controls whether or not we center the image on the Y axis to account for the aforementioned discrepancy. | Boolean | true | -| `fade` | This is the speed at which the image will fade in. Integers in milliseconds are accepted, as well as standard jQuery speed strings (slow, normal, fast). | Integer or String | 0 | -| `duration` | The amount of time in between slides, when using Backstretch as a slideshow, expressed as the number of milliseconds. | Integer | 5000 | - -## Slideshow API - -Once you've instantiated a Backstretch slideshow, there are many actions that you can perform it: - -```javascript -// Start a slideshow -$('.foo').backstretch([ - 'path/to/image.jpg', - 'path/to/image2.jpg', - 'path/to/image3.jpg' -]); - -// Pause the slideshow -$('.foo').backstretch("pause"); - -// Advance to the next slide -$('.foo').backstretch("next"); -``` - -| Method | Description | -|------|-------------| -| `.backstretch("show", n)` | Jump to the slide at a given index, where n is the number of the image that you'd like to display. Slide number starts at 0. | -| `.backstretch("prev")` | Display the previous image in a slideshow. | -| `.backstretch("next")` | Advance to the next image in a slideshow. | -| `.backstretch("pause")` | Pause the slideshow. | -| `.backstretch("resume")` | Resume a paused slideshow. | -| `.backstretch("destroy", preserveBackground)` | Destroy the Backstretch instance. Optionally, you can pass in a Boolean parameter, preserveBackground, to determine whether or not you'd like to keep the current image stretched as the background image. | -| `.backstretch("resize")` | This method is called automatically when the container (window or block-level element) is resized, however you can always call this manually if needed. | - -## Public Variables - -Sometimes, you'll want to access Backstretch's images after you've instantiated the plugin. For example, perhaps you'd like to be able add more images to a slideshow. Doing so is easy. You can access the images array as follows: - -```javascript -$('.foo').backstretch([ - 'path/to/image.jpg', - 'path/to/image2.jpg', - 'path/to/image3.jpg' -]); - -// Access the instance -var instance = $('.foo').data('backstretch'); - -// Then, you can manipulate the images array directly -instance.images.push('path/to/image4.jpg') -``` - -Additionally, the current index of a slideshow is available through the instance as well: - -```javascript -$("body").data("backstretch").index; -``` - -## Events - -### backstretch.before - -Backstretch will fire a "backstretch.before" event before a new image loads, triggering a function that is passed the event, Backstretch instance, and index of the image that will be displayed. If you listen for that event, you can, for example, coordinate other changes to coincide with your slideshow. - -```javascript -$(window).on("backstretch.before", function (e, instance, index) { - // If we wanted to stop the slideshow after it reached the end - if (index === instance.images.length - 1) { - instance.pause(); - }; -}); -``` - -### backstretch.after - -Backstretch will also fire a "backstretch.after" event after the new images has completed loading. - -```javascript -$(window).on("backstretch.after", function (e, instance, index) { - // Do something -}); -``` - -## Changelog - -### Version 2.0 - -* Now accepts an array of images to create a slideshow -* Can attach Backstretch to any block-level element, not just the body -* Deprecated "speed" option in favor of "fade" for fadeIn timing -* Added "duration" option, and Slideshow API - -### Version 1.2 - -* You can now called backstretch twice, and it will replace the existing image. - -### Version 1.1 - -* Added 'centeredX' and 'centeredY' options. -* Removed 'hideUntilReady' option. It looks pretty bad if you don't hide the image until it's fully loaded. -* Fixed IE img onload bug. -* Now supports iPhone/iPad orientation changes. diff --git a/vendors/jquery-backstretch/jquery.backstretch.js b/vendors/jquery-backstretch/jquery.backstretch.js deleted file mode 100644 index 7ac0875f8..000000000 --- a/vendors/jquery-backstretch/jquery.backstretch.js +++ /dev/null @@ -1,377 +0,0 @@ -/*! Backstretch - v2.0.4 - 2013-06-19 -* http://srobbin.com/jquery-plugins/backstretch/ -* Copyright (c) 2013 Scott Robbin; Licensed MIT */ - -;(function ($, window, undefined) { - 'use strict'; - - /* PLUGIN DEFINITION - * ========================= */ - - $.fn.backstretch = function (images, options) { - // We need at least one image or method name - if (images === undefined || images.length === 0) { - $.error("No images were supplied for Backstretch"); - } - - /* - * Scroll the page one pixel to get the right window height on iOS - * Pretty harmless for everyone else - */ - if ($(window).scrollTop() === 0 ) { - window.scrollTo(0, 0); - } - - return this.each(function () { - var $this = $(this) - , obj = $this.data('backstretch'); - - // Do we already have an instance attached to this element? - if (obj) { - - // Is this a method they're trying to execute? - if (typeof images == 'string' && typeof obj[images] == 'function') { - // Call the method - obj[images](options); - - // No need to do anything further - return; - } - - // Merge the old options with the new - options = $.extend(obj.options, options); - - // Remove the old instance - obj.destroy(true); - } - - obj = new Backstretch(this, images, options); - $this.data('backstretch', obj); - }); - }; - - // If no element is supplied, we'll attach to body - $.backstretch = function (images, options) { - // Return the instance - return $('body') - .backstretch(images, options) - .data('backstretch'); - }; - - // Custom selector - $.expr[':'].backstretch = function(elem) { - return $(elem).data('backstretch') !== undefined; - }; - - /* DEFAULTS - * ========================= */ - - $.fn.backstretch.defaults = { - centeredX: true // Should we center the image on the X axis? - , centeredY: true // Should we center the image on the Y axis? - , duration: 5000 // Amount of time in between slides (if slideshow) - , fade: 0 // Speed of fade transition between slides - }; - - /* STYLES - * - * Baked-in styles that we'll apply to our elements. - * In an effort to keep the plugin simple, these are not exposed as options. - * That said, anyone can override these in their own stylesheet. - * ========================= */ - var styles = { - wrap: { - left: 0 - , top: 0 - , overflow: 'hidden' - , margin: 0 - , padding: 0 - , height: '100%' - , width: '100%' - , zIndex: -999999 - } - , img: { - position: 'absolute' - , display: 'none' - , margin: 0 - , padding: 0 - , border: 'none' - , width: 'auto' - , height: 'auto' - , maxHeight: 'none' - , maxWidth: 'none' - , zIndex: -999999 - } - }; - - /* CLASS DEFINITION - * ========================= */ - var Backstretch = function (container, images, options) { - this.options = $.extend({}, $.fn.backstretch.defaults, options || {}); - - /* In its simplest form, we allow Backstretch to be called on an image path. - * e.g. $.backstretch('/path/to/image.jpg') - * So, we need to turn this back into an array. - */ - this.images = $.isArray(images) ? images : [images]; - - // Preload images - $.each(this.images, function () { - $('')[0].src = this; - }); - - // Convenience reference to know if the container is body. - this.isBody = container === document.body; - - /* We're keeping track of a few different elements - * - * Container: the element that Backstretch was called on. - * Wrap: a DIV that we place the image into, so we can hide the overflow. - * Root: Convenience reference to help calculate the correct height. - */ - this.$container = $(container); - this.$root = this.isBody ? supportsFixedPosition ? $(window) : $(document) : this.$container; - - // Don't create a new wrap if one already exists (from a previous instance of Backstretch) - var $existing = this.$container.children(".backstretch").first(); - this.$wrap = $existing.length ? $existing : $('
    ').css(styles.wrap).appendTo(this.$container); - - // Non-body elements need some style adjustments - if (!this.isBody) { - // If the container is statically positioned, we need to make it relative, - // and if no zIndex is defined, we should set it to zero. - var position = this.$container.css('position') - , zIndex = this.$container.css('zIndex'); - - this.$container.css({ - position: position === 'static' ? 'relative' : position - , zIndex: zIndex === 'auto' ? 0 : zIndex - , background: 'none' - }); - - // Needs a higher z-index - this.$wrap.css({zIndex: -999998}); - } - - // Fixed or absolute positioning? - this.$wrap.css({ - position: this.isBody && supportsFixedPosition ? 'fixed' : 'absolute' - }); - - // Set the first image - this.index = 0; - this.show(this.index); - - // Listen for resize - $(window).on('resize.backstretch', $.proxy(this.resize, this)) - .on('orientationchange.backstretch', $.proxy(function () { - // Need to do this in order to get the right window height - if (this.isBody && window.pageYOffset === 0) { - window.scrollTo(0, 1); - this.resize(); - } - }, this)); - }; - - /* PUBLIC METHODS - * ========================= */ - Backstretch.prototype = { - resize: function () { - try { - var bgCSS = {left: 0, top: 0} - , rootWidth = this.isBody ? this.$root.width() : this.$root.innerWidth() - , bgWidth = rootWidth - , rootHeight = this.isBody ? ( window.innerHeight ? window.innerHeight : this.$root.height() ) : this.$root.innerHeight() - , bgHeight = bgWidth / this.$img.data('ratio') - , bgOffset; - - // Make adjustments based on image ratio - if (bgHeight >= rootHeight) { - bgOffset = (bgHeight - rootHeight) / 2; - if(this.options.centeredY) { - bgCSS.top = '-' + bgOffset + 'px'; - } - } else { - bgHeight = rootHeight; - bgWidth = bgHeight * this.$img.data('ratio'); - bgOffset = (bgWidth - rootWidth) / 2; - if(this.options.centeredX) { - bgCSS.left = '-' + bgOffset + 'px'; - } - } - - this.$wrap.css({width: rootWidth, height: rootHeight}) - .find('img:not(.deleteable)').css({width: bgWidth, height: bgHeight}).css(bgCSS); - } catch(err) { - // IE7 seems to trigger resize before the image is loaded. - // This try/catch block is a hack to let it fail gracefully. - } - - return this; - } - - // Show the slide at a certain position - , show: function (newIndex) { - - // Validate index - if (Math.abs(newIndex) > this.images.length - 1) { - return; - } - - // Vars - var self = this - , oldImage = self.$wrap.find('img').addClass('deleteable') - , evtOptions = { relatedTarget: self.$container[0] }; - - // Trigger the "before" event - self.$container.trigger($.Event('backstretch.before', evtOptions), [self, newIndex]); - - // Set the new index - this.index = newIndex; - - // Pause the slideshow - clearInterval(self.interval); - - // New image - self.$img = $('') - .css(styles.img) - .bind('load', function (e) { - var imgWidth = this.width || $(e.target).width() - , imgHeight = this.height || $(e.target).height(); - - // Save the ratio - $(this).data('ratio', imgWidth / imgHeight); - - // Show the image, then delete the old one - // "speed" option has been deprecated, but we want backwards compatibilty - $(this).fadeIn(self.options.speed || self.options.fade, function () { - oldImage.remove(); - - // Resume the slideshow - if (!self.paused) { - self.cycle(); - } - - // Trigger the "after" and "show" events - // "show" is being deprecated - $(['after', 'show']).each(function () { - self.$container.trigger($.Event('backstretch.' + this, evtOptions), [self, newIndex]); - }); - }); - - // Resize - self.resize(); - }) - .appendTo(self.$wrap); - - // Hack for IE img onload event - self.$img.attr('src', self.images[newIndex]); - return self; - } - - , next: function () { - // Next slide - return this.show(this.index < this.images.length - 1 ? this.index + 1 : 0); - } - - , prev: function () { - // Previous slide - return this.show(this.index === 0 ? this.images.length - 1 : this.index - 1); - } - - , pause: function () { - // Pause the slideshow - this.paused = true; - return this; - } - - , resume: function () { - // Resume the slideshow - this.paused = false; - this.next(); - return this; - } - - , cycle: function () { - // Start/resume the slideshow - if(this.images.length > 1) { - // Clear the interval, just in case - clearInterval(this.interval); - - this.interval = setInterval($.proxy(function () { - // Check for paused slideshow - if (!this.paused) { - this.next(); - } - }, this), this.options.duration); - } - return this; - } - - , destroy: function (preserveBackground) { - // Stop the resize events - $(window).off('resize.backstretch orientationchange.backstretch'); - - // Clear the interval - clearInterval(this.interval); - - // Remove Backstretch - if(!preserveBackground) { - this.$wrap.remove(); - } - this.$container.removeData('backstretch'); - } - }; - - /* SUPPORTS FIXED POSITION? - * - * Based on code from jQuery Mobile 1.1.0 - * http://jquerymobile.com/ - * - * In a nutshell, we need to figure out if fixed positioning is supported. - * Unfortunately, this is very difficult to do on iOS, and usually involves - * injecting content, scrolling the page, etc.. It's ugly. - * jQuery Mobile uses this workaround. It's not ideal, but works. - * - * Modified to detect IE6 - * ========================= */ - - var supportsFixedPosition = (function () { - var ua = navigator.userAgent - , platform = navigator.platform - // Rendering engine is Webkit, and capture major version - , wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ) - , wkversion = !!wkmatch && wkmatch[ 1 ] - , ffmatch = ua.match( /Fennec\/([0-9]+)/ ) - , ffversion = !!ffmatch && ffmatch[ 1 ] - , operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ ) - , omversion = !!operammobilematch && operammobilematch[ 1 ] - , iematch = ua.match( /MSIE ([0-9]+)/ ) - , ieversion = !!iematch && iematch[ 1 ]; - - return !( - // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5) - ((platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534) || - - // Opera Mini - (window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]") || - (operammobilematch && omversion < 7458) || - - //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2) - (ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533) || - - // Firefox Mobile before 6.0 - - (ffversion && ffversion < 6) || - - // WebOS less than 3 - ("palmGetResource" in window && wkversion && wkversion < 534) || - - // MeeGo - (ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1) || - - // IE6 - (ieversion && ieversion <= 6) - ); - }()); - -}(jQuery, window)); \ No newline at end of file diff --git a/vendors/jquery-backstretch/jquery.backstretch.min.js b/vendors/jquery-backstretch/jquery.backstretch.min.js deleted file mode 100644 index 1bb20f83c..000000000 --- a/vendors/jquery-backstretch/jquery.backstretch.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! Backstretch - v2.0.4 - 2013-06-19 -* http://srobbin.com/jquery-plugins/backstretch/ -* Copyright (c) 2013 Scott Robbin; Licensed MIT */ -(function(a,d,p){a.fn.backstretch=function(c,b){(c===p||0===c.length)&&a.error("No images were supplied for Backstretch");0===a(d).scrollTop()&&d.scrollTo(0,0);return this.each(function(){var d=a(this),g=d.data("backstretch");if(g){if("string"==typeof c&&"function"==typeof g[c]){g[c](b);return}b=a.extend(g.options,b);g.destroy(!0)}g=new q(this,c,b);d.data("backstretch",g)})};a.backstretch=function(c,b){return a("body").backstretch(c,b).data("backstretch")};a.expr[":"].backstretch=function(c){return a(c).data("backstretch")!==p};a.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5E3,fade:0};var r={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},s={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999},q=function(c,b,e){this.options=a.extend({},a.fn.backstretch.defaults,e||{});this.images=a.isArray(b)?b:[b];a.each(this.images,function(){a("")[0].src=this});this.isBody=c===document.body;this.$container=a(c);this.$root=this.isBody?l?a(d):a(document):this.$container;c=this.$container.children(".backstretch").first();this.$wrap=c.length?c:a('
    ').css(r).appendTo(this.$container);this.isBody||(c=this.$container.css("position"),b=this.$container.css("zIndex"),this.$container.css({position:"static"===c?"relative":c,zIndex:"auto"===b?0:b,background:"none"}),this.$wrap.css({zIndex:-999998}));this.$wrap.css({position:this.isBody&&l?"fixed":"absolute"});this.index=0;this.show(this.index);a(d).on("resize.backstretch",a.proxy(this.resize,this)).on("orientationchange.backstretch",a.proxy(function(){this.isBody&&0===d.pageYOffset&&(d.scrollTo(0,1),this.resize())},this))};q.prototype={resize:function(){try{var a={left:0,top:0},b=this.isBody?this.$root.width():this.$root.innerWidth(),e=b,g=this.isBody?d.innerHeight?d.innerHeight:this.$root.height():this.$root.innerHeight(),j=e/this.$img.data("ratio"),f;j>=g?(f=(j-g)/2,this.options.centeredY&&(a.top="-"+f+"px")):(j=g,e=j*this.$img.data("ratio"),f=(e-b)/2,this.options.centeredX&&(a.left="-"+f+"px"));this.$wrap.css({width:b,height:g}).find("img:not(.deleteable)").css({width:e,height:j}).css(a)}catch(h){}return this},show:function(c){if(!(Math.abs(c)>this.images.length-1)){var b=this,e=b.$wrap.find("img").addClass("deleteable"),d={relatedTarget:b.$container[0]};b.$container.trigger(a.Event("backstretch.before",d),[b,c]);this.index=c;clearInterval(b.interval);b.$img=a("").css(s).bind("load",function(f){var h=this.width||a(f.target).width();f=this.height||a(f.target).height();a(this).data("ratio",h/f);a(this).fadeIn(b.options.speed||b.options.fade,function(){e.remove();b.paused||b.cycle();a(["after","show"]).each(function(){b.$container.trigger(a.Event("backstretch."+this,d),[b,c])})});b.resize()}).appendTo(b.$wrap);b.$img.attr("src",b.images[c]);return b}},next:function(){return this.show(this.indexe||d.operamini&&"[object OperaMini]"==={}.toString.call(d.operamini)||n&&7458>t||-1e||h&&6>h||"palmGetResource"in d&&e&&534>e||-1=k)})(jQuery,window); \ No newline at end of file diff --git a/vendors/jquery-cookie/CHANGELOG.md b/vendors/jquery-cookie/CHANGELOG.md deleted file mode 100644 index 467dd4210..000000000 --- a/vendors/jquery-cookie/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -HEAD ------ - -1.4.0 ------ -- Support for AMD. - -- Removed deprecated method `$.cookie('name', null)` for deleting a cookie, - use `$.removeCookie('name')`. - -- `$.cookie('name')` now returns `undefined` in case such cookie does not exist - (was `null`). Because the return value is still falsy, testing for existence - of a cookie like `if ( $.cookie('foo') )` keeps working without change. - -- Renamed bower package definition (component.json -> bower.json) for usage - with up-to-date bower. - -- Badly encoded cookies no longer throw exception upon reading but do return - undefined (similar to how we handle JSON parse errors with json = true). - -- Added conversion function as optional last argument for reading, - so that values can be changed to a different representation easily on the fly. - Useful for parsing numbers for instance: - - ```javascript - $.cookie('foo', '42'); - $.cookie('foo', Number); // => 42 - ``` - -1.3.1 ------ -- Fixed issue where it was no longer possible to check for an arbitrary cookie, - while json is set to true, there was a SyntaxError thrown from JSON.parse. - -- Fixed issue where RFC 2068 decoded cookies were not properly read. - -1.3.0 ------ -- Configuration options: `raw`, `json`. Replaces raw option, becomes config: - - ```javascript - $.cookie.raw = true; // bypass encoding/decoding the cookie value - $.cookie.json = true; // automatically JSON stringify/parse value - ``` - - Thus the default options now cleanly contain cookie attributes only. - -- Removing licensing under GPL Version 2, the plugin is now released under MIT License only -(keeping it simple and following the jQuery library itself here). - -- Bugfix: Properly handle RFC 2068 quoted cookie values. - -- Added component.json for bower. - -- Added jQuery plugin package manifest. - -- `$.cookie()` returns all available cookies. - -1.2.0 ------ -- Adding `$.removeCookie('foo')` for deleting a cookie, using `$.cookie('foo', null)` is now deprecated. - -1.1 ---- -- Adding default options. diff --git a/vendors/jquery-cookie/CONTRIBUTING.md b/vendors/jquery-cookie/CONTRIBUTING.md deleted file mode 100644 index f174678ad..000000000 --- a/vendors/jquery-cookie/CONTRIBUTING.md +++ /dev/null @@ -1,53 +0,0 @@ -##Issues - -- Report issues or feature requests on [GitHub Issues](https://github.com/carhartl/jquery-cookie/issues). -- If reporting a bug, please add a [simplified example](http://sscce.org/). - -##Pull requests -- Create a new topic branch for every separate change you make. -- Create a test case if you are fixing a bug or implementing an important feature. -- Make sure the build runs successfully. - -## Development - -###Tools -We use the following tools for development: - -- [Qunit](http://qunitjs.com/) for tests. -- [NodeJS](http://nodejs.org/download/) required to run grunt and the test server only. -- [Grunt](http://gruntjs.com/getting-started) for task management. - -###Getting started -Install [NodeJS](http://nodejs.org/). -Install globally grunt-cli using the following command: - - $ npm install -g grunt-cli - -Browse to the project root directory and install the dev dependencies: - - $ npm install -d - -To execute the build and tests run the following command in the root of the project: - - $ grunt - -You should see a green message in the console: - - Done, without errors. - -###Tests -You can also run the tests in the browser. -Start a test server from the project root: - - $ node test/server.js - -Open the following URL in a browser: - - $ open http://0.0.0.0:8124/test/index.html - -_Note: we recommend cleaning all the browser cookies before running the tests, that can avoid false positive failures._ - -###Automatic build -You can build automatically after a file change using the following command: - - $ grunt watch diff --git a/vendors/jquery-cookie/MIT-LICENSE.txt b/vendors/jquery-cookie/MIT-LICENSE.txt deleted file mode 100644 index 8ae647bc8..000000000 --- a/vendors/jquery-cookie/MIT-LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2013 Klaus Hartl - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendors/jquery-cookie/README.md b/vendors/jquery-cookie/README.md deleted file mode 100644 index e4091477b..000000000 --- a/vendors/jquery-cookie/README.md +++ /dev/null @@ -1,148 +0,0 @@ -# jquery.cookie [![Build Status](https://travis-ci.org/carhartl/jquery-cookie.png?branch=master)](https://travis-ci.org/carhartl/jquery-cookie) [![Code Climate](https://codeclimate.com/github/carhartl/jquery-cookie.png)](https://codeclimate.com/github/carhartl/jquery-cookie) - -A simple, lightweight jQuery plugin for reading, writing and deleting cookies. - -## Build Status Matrix - -[![Selenium Test Status](https://saucelabs.com/browser-matrix/jquery-cookie.svg)](https://saucelabs.com/u/jquery-cookie) - -## Installation - -Include script *after* the jQuery library (unless you are packaging scripts somehow else): - -```html - -``` - -**Do not include the script directly from GitHub (http://raw.github.com/...).** The file is being served as text/plain and as such being blocked -in Internet Explorer on Windows 7 for instance (because of the wrong MIME type). Bottom line: GitHub is not a CDN. - -The plugin can also be loaded as AMD module. - -## Usage - -Create session cookie: - -```javascript -$.cookie('the_cookie', 'the_value'); -``` - -Create expiring cookie, 7 days from then: - -```javascript -$.cookie('the_cookie', 'the_value', { expires: 7 }); -``` - -Create expiring cookie, valid across entire site: - -```javascript -$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' }); -``` - -Read cookie: - -```javascript -$.cookie('the_cookie'); // => "the_value" -$.cookie('not_existing'); // => undefined -``` - -Read all available cookies: - -```javascript -$.cookie(); // => { "the_cookie": "the_value", "...remaining": "cookies" } -``` - -Delete cookie: - -```javascript -// Returns true when cookie was found, false when no cookie was found... -$.removeCookie('the_cookie'); - -// Same path as when the cookie was written... -$.removeCookie('the_cookie', { path: '/' }); -``` - -*Note: when deleting a cookie, you must pass the exact same path, domain and secure options that were used to set the cookie, unless you're relying on the default options that is.* - -## Configuration - -### raw - -By default the cookie value is encoded/decoded when writing/reading, using `encodeURIComponent`/`decodeURIComponent`. Bypass this by setting raw to true: - -```javascript -$.cookie.raw = true; -``` - -### json - -Turn on automatic storage of JSON objects passed as the cookie value. Assumes `JSON.stringify` and `JSON.parse`: - -```javascript -$.cookie.json = true; -``` - -## Cookie Options - -Cookie attributes can be set globally by setting properties of the `$.cookie.defaults` object or individually for each call to `$.cookie()` by passing a plain object to the options argument. Per-call options override the default options. - -### expires - - expires: 365 - -Define lifetime of the cookie. Value can be a `Number` which will be interpreted as days from time of creation or a `Date` object. If omitted, the cookie becomes a session cookie. - -### path - - path: '/' - -Define the path where the cookie is valid. *By default the path of the cookie is the path of the page where the cookie was created (standard browser behavior).* If you want to make it available for instance across the entire domain use `path: '/'`. Default: path of page where the cookie was created. - -**Note regarding Internet Explorer:** - -> Due to an obscure bug in the underlying WinINET InternetGetCookie implementation, IE’s document.cookie will not return a cookie if it was set with a path attribute containing a filename. - -(From [Internet Explorer Cookie Internals (FAQ)](http://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx)) - -This means one cannot set a path using `path: window.location.pathname` in case such pathname contains a filename like so: `/check.html` (or at least, such cookie cannot be read correctly). - -### domain - - domain: 'example.com' - -Define the domain where the cookie is valid. Default: domain of page where the cookie was created. - -### secure - - secure: true - -If true, the cookie transmission requires a secure protocol (https). Default: `false`. - -## Converters - -Provide a conversion function as optional last argument for reading, in order to change the cookie's value -to a different representation on the fly. - -Example for parsing a value into a number: - -```javascript -$.cookie('foo', '42'); -$.cookie('foo', Number); // => 42 -``` - -Dealing with cookies that have been encoded using `escape` (3rd party cookies): - -```javascript -$.cookie.raw = true; -$.cookie('foo', unescape); -``` - -You can pass an arbitrary conversion function. - -## Contributing - -Check out the [Contributing Guidelines](CONTRIBUTING.md) - -## Authors - -[Klaus Hartl](https://github.com/carhartl) diff --git a/vendors/jquery-cookie/bower.json b/vendors/jquery-cookie/bower.json deleted file mode 100644 index 8a5b5d04c..000000000 --- a/vendors/jquery-cookie/bower.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "jquery.cookie", - "version": "1.4.0", - "main": [ - "./jquery.cookie.js" - ], - "dependencies": { - "jquery": ">=1.2" - }, - "ignore": [ - "test", - ".*", - "*.json", - "*.md", - "*.txt", - "Gruntfile.js" - ] -} diff --git a/vendors/jquery-cookie/cookie.jquery.json b/vendors/jquery-cookie/cookie.jquery.json deleted file mode 100644 index 522d5e159..000000000 --- a/vendors/jquery-cookie/cookie.jquery.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "cookie", - "version": "1.4.0", - "title": "jQuery Cookie", - "description": "A simple, lightweight jQuery plugin for reading, writing and deleting cookies.", - "author": { - "name": "Klaus Hartl", - "url": "https://github.com/carhartl" - }, - "maintainers": [ - { - "name": "Klaus Hartl", - "url": "https://github.com/carhartl" - }, - { - "name": "Fagner Martins", - "url": "https://github.com/FagnerMartinsBrack" - } - ], - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/carhartl/jquery-cookie/master/MIT-LICENSE.txt" - } - ], - "dependencies": { - "jquery": ">=1.2" - }, - "bugs": "https://github.com/carhartl/jquery-cookie/issues", - "homepage": "https://github.com/carhartl/jquery-cookie", - "docs": "https://github.com/carhartl/jquery-cookie#readme" -} diff --git a/vendors/jquery-cookie/jquery.cookie-1.4.0.min.js b/vendors/jquery-cookie/jquery.cookie-1.4.0.min.js deleted file mode 100644 index 59824dac8..000000000 --- a/vendors/jquery-cookie/jquery.cookie-1.4.0.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jquery.cookie v1.4.0 (c) 2013 Klaus Hartl | MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setDate(k.getDate()+j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}}); \ No newline at end of file diff --git a/vendors/jquery-cookie/jquery.cookie.js b/vendors/jquery-cookie/jquery.cookie.js deleted file mode 100644 index 6aee051c8..000000000 --- a/vendors/jquery-cookie/jquery.cookie.js +++ /dev/null @@ -1,113 +0,0 @@ -/*! - * jQuery Cookie Plugin v1.4.0 - * https://github.com/carhartl/jquery-cookie - * - * Copyright 2013 Klaus Hartl - * Released under the MIT license - */ -(function (factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as anonymous module. - define(['jquery'], factory); - } else { - // Browser globals. - factory(jQuery); - } -}(function ($) { - - var pluses = /\+/g; - - function encode(s) { - return config.raw ? s : encodeURIComponent(s); - } - - function decode(s) { - return config.raw ? s : decodeURIComponent(s); - } - - function stringifyCookieValue(value) { - return encode(config.json ? JSON.stringify(value) : String(value)); - } - - function parseCookieValue(s) { - if (s.indexOf('"') === 0) { - // This is a quoted cookie as according to RFC2068, unescape... - s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); - } - - try { - // Replace server-side written pluses with spaces. - // If we can't decode the cookie, ignore it, it's unusable. - // If we can't parse the cookie, ignore it, it's unusable. - s = decodeURIComponent(s.replace(pluses, ' ')); - return config.json ? JSON.parse(s) : s; - } catch(e) {} - } - - function read(s, converter) { - var value = config.raw ? s : parseCookieValue(s); - return $.isFunction(converter) ? converter(value) : value; - } - - var config = $.cookie = function (key, value, options) { - - // Write - if (value !== undefined && !$.isFunction(value)) { - options = $.extend({}, config.defaults, options); - - if (typeof options.expires === 'number') { - var days = options.expires, t = options.expires = new Date(); - t.setDate(t.getDate() + days); - } - - return (document.cookie = [ - encode(key), '=', stringifyCookieValue(value), - options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE - options.path ? '; path=' + options.path : '', - options.domain ? '; domain=' + options.domain : '', - options.secure ? '; secure' : '' - ].join('')); - } - - // Read - - var result = key ? undefined : {}; - - // To prevent the for loop in the first place assign an empty array - // in case there are no cookies at all. Also prevents odd result when - // calling $.cookie(). - var cookies = document.cookie ? document.cookie.split('; ') : []; - - for (var i = 0, l = cookies.length; i < l; i++) { - var parts = cookies[i].split('='); - var name = decode(parts.shift()); - var cookie = parts.join('='); - - if (key && key === name) { - // If second argument (value) is a function it's a converter... - result = read(cookie, value); - break; - } - - // Prevent storing a cookie that we couldn't decode. - if (!key && (cookie = read(cookie)) !== undefined) { - result[name] = cookie; - } - } - - return result; - }; - - config.defaults = {}; - - $.removeCookie = function (key, options) { - if ($.cookie(key) === undefined) { - return false; - } - - // Must not alter options, thus extending a fresh object... - $.cookie(key, '', $.extend({}, options, { expires: -1 })); - return !$.cookie(key); - }; - -})); diff --git a/vendors/jquery-cookie/package.json b/vendors/jquery-cookie/package.json deleted file mode 100644 index 3942d3247..000000000 --- a/vendors/jquery-cookie/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "jquery.cookie", - "version": "1.4.0", - "description": "A simple, lightweight jQuery plugin for reading, writing and deleting cookies.", - "main": "Gruntfile.js", - "directories": { - "test": "test" - }, - "scripts": { - "test": "grunt" - }, - "repository": { - "type": "git", - "url": "git://github.com/carhartl/jquery-cookie.git" - }, - "author": "Klaus Hartl", - "license": "MIT", - "gitHead": "bd3c9713222bace68d25fe2128c0f8633cad1269", - "readmeFilename": "README.md", - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.4.0", - "grunt-contrib-uglify": "~0.2.0", - "grunt-contrib-qunit": "~0.2.0", - "grunt-contrib-watch": "~0.3.0", - "grunt-compare-size": "~0.4.0", - "grunt-saucelabs": "~4.1.1", - "grunt-contrib-connect": "~0.5.0", - "gzip-js": "~0.3.0" - } -} diff --git a/vendors/jquery-finger/CONTRIBUTING.md b/vendors/jquery-finger/CONTRIBUTING.md deleted file mode 100644 index 94af4724d..000000000 --- a/vendors/jquery-finger/CONTRIBUTING.md +++ /dev/null @@ -1,35 +0,0 @@ -# Contributing - -## Important notes -Please don't edit files in the `dist` subdirectory as they are generated via grunt. You'll find source code in the `src` subdirectory! - -### Code style -Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.** - -### PhantomJS -While grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers. - -See the [Why does grunt complain that PhantomJS isn't installed?](https://github.com/gruntjs/grunt/blob/master/docs/faq.md#why-does-grunt-complain-that-phantomjs-isnt-installed) guide in the [Grunt FAQ](https://github.com/gruntjs/grunt/blob/master/docs/faq.md) for help with installing or troubleshooting PhantomJS. - -## Modifying the code -First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed. - -Test that grunt is installed globally by running `grunt --version` at the command-line. If grunt isn't installed globally, run `npm install -g grunt` to install the latest version. _You may need to run `sudo npm install -g grunt`._ - -_Note that in Windows, you may have to run `grunt.cmd` instead of `grunt`._ - -1. Fork and clone the repo. -1. Run `npm install` to install all dependencies (including grunt). -1. Run `grunt` to grunt this project. - -Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken. - -## Submitting pull requests - -1. Create a new branch, please don't work in your `master` branch directly. -1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail. -1. Fix stuff. -1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done. -1. Open `test/*.html` unit test file(s) in actual browser to ensure tests pass everywhere. -1. Update the documentation to reflect any changes. -1. Push to your fork and submit a pull request. diff --git a/vendors/jquery-finger/LICENSE-MIT b/vendors/jquery-finger/LICENSE-MIT deleted file mode 100644 index a0f33ef42..000000000 --- a/vendors/jquery-finger/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "ngryman" Nicolas Gryman - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendors/jquery-finger/README.md b/vendors/jquery-finger/README.md deleted file mode 100644 index 9aa429a7b..000000000 --- a/vendors/jquery-finger/README.md +++ /dev/null @@ -1,225 +0,0 @@ -# jQuery Finger 0.1.0-alpha - -jQuery tap & gestures, fingers in the nose. - -**jQuery Finger** unifies click and touch events by removing the **300ms delay** on touch devices. It also provide a common -set of events to handle basic gestures such as **drag** and **flick**.
    -Very small (< 0.5kb gzipped), it is focused on **performance** and **KISS**, is well tested and also supports jQuery **delegated events**. - -[![Build Status](https://travis-ci.org/ngryman/jquery.finger.png)](https://travis-ci.org/ngryman/jquery.finger) -[![Dependency Status](https://gemnasium.com/ngryman/jquery.finger.png)](https://gemnasium.com/ngryman/jquery.finger) -[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/cec9f8a0012c619d46fc5398ab2f3046 "githalytics.com")](http://githalytics.com/ngryman/jquery.finger) - -## Getting Started - -Download the [production version][min] *(470 bytes gzipped)* or the [development version][max] *(4163 bytes)*.
    -You can also install it via [Jam] or [Bower]. - -[min]: https://raw.github.com/ngryman/jquery.finger/master/dist/jquery.finger.min.js -[max]: https://raw.github.com/ngryman/jquery.finger/master/dist/jquery.finger.js -[Jam]: http://jamjs.org -[Bower]: http://twitter.github.io/bower - -In your web page: - -```html - - - -``` - -## Documentation - -### Gestures - -**jQuery Finger** focuses on one finger events: - - | tap | doubletap | press | drag | flick | -----------|-----|-----------|-------|------|-------| -Available | ✔ | ✔ | ✔ | ✔ | ✔ | - -### Thresholds - -You can tweak how **jQuery Finger** handles events by modifying thresholds found in the `$.Finger` object. - -#### `pressDuration` - -This is the time the user will have to hold in order to fire a `press` event. -If this time is not reached, a `tap` event will be fired instead. -This defaults to `300`ms. - -#### `doubleTapInterval` - -This is the maximum time between two `tap` events to fire a `doubletap` event. -If this time is reached, two distinct `tap` events will be fired instead. -This defaults to `300`ms. - -#### `flickDuration` - -This is the maximum time the user will have to swipe in order to fire a `flick` event. -If this time is reached, a `drag` event will be fired instead. -This defaults to `150`ms. - -#### `motionThreshold` - -This is the number of pixel the user will have to move in order to fire motion events (drag or flick). -If this time is not reached, no motion will be handled and `tap`, `doubletap` or `press` event will be fired. -This defaults to `5`px. - -### Additional event parameters - -**jQuery Finger** enhances the default event object when there is motion (drag & flick). It gives information about -the pointer position and motion: - - **x**: the `x` page coordinate. - - **y**: the `y` page coordinate. - - **dx**: this `x` *delta* (amount of pixels moved) since the last event. - - **dy**: this `y` delta since the last event. - - **adx**: this `x` absolute delta since the last event. - - **ady**: this `y` absolute delta since the last event. - - **orientation**: - - `horizontal`: motion was detected as an horizontal one. This can be tweaked with `$.Finger.motionThreshold`. - - `vertical`: motion was detected as a vertical one. This can be tweaked with `$.Finger.motionThreshold`. - - **direction**: - - `1`: motion has a positive direction, either left to right for horizontal, or top to bottom for vertical. - - `-1`: motion has a negative direction, either right to left for horizontal, or bottom to top for vertical. - -### Prevent default - -You can prevent default browser behavior when binding events with **jQuery Finger**.
    -By specifying it, be aware that you will prevent **every native behavior** such as *following links*, *scrolling*, -*selecting text* and more ([details]). - -There are two way of preventing default behavior. - -[details]: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-to-prevent-default-touch-and-mouse-events-in-the-BlackBerry/ta-p/1223685 - -#### Globally - -You can tell to prevent default behavior for every event binded with **jQuery Finger** like this: -```javascript -$.Finger.preventDefault = true; -``` - -#### Specifically - -You can tell to prevent default behavior just for a particular event like this: -```javascript -$('body').on('tap', '.touchme', { preventDefault: true }, function() { - // ... -}); -``` - -## Examples - -### Remove the 300ms delay on every links of your page - -```javascript -$('body').on('tap', 'a', { preventDefault: true }, function() { - window.location = $(this).attr('href'); -}); -``` - -### Delegated events for dynamically loaded elements (AJAX): - -```javascript -$('body').on('tap', '.toggle', function() { - $(this).toggleClass('is-selected'); -}); -``` - -### Swipe to reveal - -```javascript -$('#menu').on('flick', function(e) { - if ('horizontal' == e.orientation) { - if (1 == e.direction) { - $(this).addClass('is-opened'); - } - else { - $(this).removeClass('is-opened'); - } - } -}); -``` - -## Notes - - - **jQuery Finger** uses [VirtualPointer] in its test suite to simulate mouse and touch events. - - On Chrome 25+, `preventDefault` does not work as expected because `ontouchstart` is defined. To make it work, you - have to manually prevent the default behavior in the `mousedown` or `click` event. - -[VirtualPointer]: https://github.com/ngryman/virtual-pointer - -## Instacode - -

    - -

    - -## Release History - -``` -v0.1.0-alpha - - ie8 legacy support. - - fixed prevent default event parameter. - -v0.0.11 - - `press` event is now fired by `timeout` instead of `touchend`. - -v0.0.10 - - fixed events fired multiple times (#1). - - added `preventDefault` support. - - internal refactoring for size and performance. - -v0.0.9 - - fixed incorrect event type. - - added to jam. - - added to bower. - -v0.0.8 - - fixed bugs on delegated events. - - better cross-browser support (still needs some work/tests). - - internal refactoring for consistency and performance. - -v0.0.7 - - various cross browsers fixes. - -v0.0.6 - - updated description. - -v0.0.5 - - updated jquery manifest and published on http://plugins.jquery.com. - -v0.0.4 - - added `drag` and `flick` gestures. - - enhanced `event` object. - - internal refactoring for consistency. - -v0.0.3 - - migration to **grunt** 0.4. - - migration to **mocha** / **chaijs** for tests. - -v0.0.2 - - added `doubletap` and `press` gestures. - - internal refactoring for consistency and performance. - -v0.0.1 - - `tap` gesture first implementation. -``` - -## Author - -| [![twitter/ngryman](http://gravatar.com/avatar/2e1c2b5e153872e9fb021a6e4e376ead?size=70)](http://twitter.com/ngryman "Follow @ngryman on Twitter") | -|---| -| [Nicolas Gryman](http://ngryman.sh) | diff --git a/vendors/jquery-finger/bower.json b/vendors/jquery-finger/bower.json deleted file mode 100644 index 15becf909..000000000 --- a/vendors/jquery-finger/bower.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "jquery.finger", - "version": "0.1.0-alpha", - "main": "dist/jquery.finger.js", - "ignore": [ - ".gitignore", - ".jshintrc", - ".travis.yml", - "Gruntfile.js", - "LICENSE-MIT", - "package.json", - "*.md", - "examples", - "libs", - "src", - "test" - ], - "dependencies": { - "jquery": "~1.7.0" - } -} \ No newline at end of file diff --git a/vendors/jquery-finger/finger.jquery.json b/vendors/jquery-finger/finger.jquery.json deleted file mode 100644 index 6eb30a9b4..000000000 --- a/vendors/jquery-finger/finger.jquery.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "finger", - "title": "jQuery Finger", - "version": "0.1.0-alpha", - "description": "jQuery Finger unifies click and touch events by removing the 300ms delay on touch devices. It also provide a common set of events to handle basic gestures such as drag and pinch. Small (< 1kb gzipped), it is focused on performance, is well tested and ... also supports jQuery delegated events.", - "homepage": "https://github.com/ngryman/jquery.finger", - "bugs": "https://github.com/ngryman/jquery.finger/issues", - "author": { - "name": "Nicolas Gryman", - "email": "ngryman@gmail.com", - "url": "http://ngryman.sh" - }, - "repository": { - "type": "git", - "url": "git://github.com/ngryman/jquery.finger.git" - }, - "bugs": { - "url": "https://github.com/ngryman/jquery.finger/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/ngryman/jquery.finger/blob/master/LICENSE-MIT" - } - ], - "dependencies": { - "jquery": "~1.7.0" - }, - "keywords": [ - "tap", - "doubletap", - "swipe", - "flick", - "drag", - "move", - "gestures", - "touch", - "tappable", - "event", - "mobile", - "tablet" - ] -} \ No newline at end of file diff --git a/vendors/jquery-finger/jquery.finger.js b/vendors/jquery-finger/jquery.finger.js deleted file mode 100644 index 1ba470e3a..000000000 --- a/vendors/jquery-finger/jquery.finger.js +++ /dev/null @@ -1,147 +0,0 @@ -/*! jquery.finger - v0.1.0-alpha - 2013-07-01 -* https://github.com/ngryman/jquery.finger -* Copyright (c) 2013 Nicolas Gryman; Licensed MIT */ - -(function($) { - - var hasTouch = 'ontouchstart' in window, - startEvent = hasTouch ? 'touchstart' : 'mousedown', - stopEvent = hasTouch ? 'touchend touchcancel' : 'mouseup mouseleave', - moveEvent = hasTouch ? 'touchmove' : 'mousemove', - - namespace = 'finger', - safeguard, - - Finger = $.Finger = { - pressDuration: 300, - doubleTapInterval: 300, - flickDuration: 150, - motionThreshold: 5 - }; - - function page(coord, e) { - return (hasTouch ? e.originalEvent.touches[0] : e)['page' + coord.toUpperCase()]; - } - - function startHandler(event) { - var data = {}, - timeStamp = event.timeStamp || +new Date(), - f = $.data(this, namespace); - - if (safeguard == timeStamp) return; - safeguard = timeStamp; - - data.move = { x: page('x', event), y: page('y', event) }; - data.start = $.extend({ time: timeStamp, target: event.target }, data.move); - data.timeout = setTimeout($.proxy(function() { - $.event.trigger($.Event('press', data.move), null, event.target); - - $.event.remove(this, moveEvent + '.' + namespace, moveHandler); - $.event.remove(this, stopEvent + '.' + namespace, stopHandler); - }, this), $.Finger.pressDuration); - - $.event.add(this, moveEvent + '.' + namespace, moveHandler, data); - $.event.add(this, stopEvent + '.' + namespace, stopHandler, data); - - if (Finger.preventDefault || f.options.preventDefault) event.preventDefault(); - } - - function moveHandler(event) { - var data = event.data, - start = data.start, - move = data.move; - - // motion data - move.x = page('x', event); - move.y = page('y', event); - move.dx = move.x - start.x; - move.dy = move.y - start.y; - move.adx = Math.abs(move.dx); - move.ady = Math.abs(move.dy); - - // security - data.motion = move.adx > Finger.motionThreshold || move.ady > Finger.motionThreshold; - if (!data.motion) return; - - // moves cancel press events - clearTimeout(data.timeout); - - // orientation - if (!move.orientation) { - if (move.adx > data.move.ady) { - move.orientation = 'horizontal'; - move.direction = move.dx > 0 ? +1 : -1; - } - else { - move.orientation = 'vertical'; - move.direction = move.dy > 0 ? +1 : -1; - } - } - - // for delegated events, the target may change over time - // this ensures we notify the right target and simulates the mouseleave behavior - if (event.target !== start.target) { - event.target = start.target; - stopHandler.call(this, $.Event(stopEvent + '.' + namespace, event)); - return; - } - - // fire drag event - $.event.trigger($.Event('drag', move), null, event.target); - } - - function stopHandler(event) { - var data = event.data, - timeStamp = event.timeStamp || +new Date(), - f = $.data(this, namespace), - dt = timeStamp - data.start.time, - evtName; - - // always clears press timeout - clearTimeout(data.timeout); - - // ensures start target and end target are the same - if (event.target !== data.start.target) return; - - // tap-like events - if (!data.motion) { - evtName = dt < Finger.pressDuration && - !f.prev || f.prev && timeStamp - f.prev > Finger.doubleTapInterval ? 'tap' : 'doubletap'; - f.prev = timeStamp; - } - // motion events - else { - evtName = dt < Finger.flickDuration ? 'flick' : 'drag'; - data.move.end = true; - } - - $.event.trigger($.Event(evtName, data.move), null, event.target); - - $.event.remove(this, moveEvent + '.' + namespace, moveHandler); - $.event.remove(this, stopEvent + '.' + namespace, stopHandler); - } - - var fingerCustom = { - add: function(handleObj) { - if (!$.data(this, namespace)) { - $.event.add(this, startEvent + '.' + namespace, startHandler); - $.data(this, namespace, { options: handleObj.data || {} }); - } - }, - - teardown: function() { - if ($.data(this, namespace)) { - $.event.remove(this, startEvent + '.' + namespace, startHandler); - $.data(this, namespace, null); - } - } - }; - - // registers custom events - $.event.special.tap = fingerCustom; - $.event.special.press = fingerCustom; - $.event.special.doubletap = fingerCustom; - $.event.special.drag = fingerCustom; - $.event.special.flick = fingerCustom; - -})(jQuery); diff --git a/vendors/jquery-finger/jquery.finger.min.js b/vendors/jquery-finger/jquery.finger.min.js deleted file mode 100644 index cc07c9d10..000000000 --- a/vendors/jquery-finger/jquery.finger.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jquery.finger - v0.1.0-alpha - 2013-07-01 -* https://github.com/ngryman/jquery.finger -* Copyright (c) 2013 Nicolas Gryman; Licensed MIT */ -(function(t){function e(t,e){return(r?e.originalEvent.touches[0]:e)["page"+t.toUpperCase()]}function a(a){var r={},v=a.timeStamp||+new Date,m=t.data(this,u);i!=v&&(i=v,r.move={x:e("x",a),y:e("y",a)},r.start=t.extend({time:v,target:a.target},r.move),r.timeout=setTimeout(t.proxy(function(){t.event.trigger(t.Event("press",r.move),null,a.target),t.event.remove(this,d+"."+u,o),t.event.remove(this,s+"."+u,n)},this),t.Finger.pressDuration),t.event.add(this,d+"."+u,o,r),t.event.add(this,s+"."+u,n,r),(l.preventDefault||m.options.preventDefault)&&a.preventDefault())}function o(a){var o=a.data,i=o.start,r=o.move;return r.x=e("x",a),r.y=e("y",a),r.dx=r.x-i.x,r.dy=r.y-i.y,r.adx=Math.abs(r.dx),r.ady=Math.abs(r.dy),o.motion=r.adx>l.motionThreshold||r.ady>l.motionThreshold,o.motion?(clearTimeout(o.timeout),r.orientation||(r.adx>o.move.ady?(r.orientation="horizontal",r.direction=r.dx>0?1:-1):(r.orientation="vertical",r.direction=r.dy>0?1:-1)),a.target!==i.target?(a.target=i.target,n.call(this,t.Event(s+"."+u,a)),void 0):(t.event.trigger(t.Event("drag",r),null,a.target),void 0)):void 0}function n(e){var a,i=e.data,r=e.timeStamp||+new Date,v=t.data(this,u),m=r-i.start.time;clearTimeout(i.timeout),e.target===i.start.target&&(i.motion?(a=l.flickDuration>m?"flick":"drag",i.move.end=!0):(a=l.pressDuration>m&&!v.prev||v.prev&&r-v.prev>l.doubleTapInterval?"tap":"doubletap",v.prev=r),t.event.trigger(t.Event(a,i.move),null,e.target),t.event.remove(this,d+"."+u,o),t.event.remove(this,s+"."+u,n))}var i,r="ontouchstart"in window,v=r?"touchstart":"mousedown",s=r?"touchend touchcancel":"mouseup mouseleave",d=r?"touchmove":"mousemove",u="finger",l=t.Finger={pressDuration:300,doubleTapInterval:300,flickDuration:150,motionThreshold:5},m={add:function(e){t.data(this,u)||(t.event.add(this,v+"."+u,a),t.data(this,u,{options:e.data||{}}))},teardown:function(){t.data(this,u)&&(t.event.remove(this,v+"."+u,a),t.data(this,u,null))}};t.event.special.tap=m,t.event.special.press=m,t.event.special.doubletap=m,t.event.special.drag=m,t.event.special.flick=m})(jQuery); \ No newline at end of file diff --git a/vendors/jquery-finger/package.json b/vendors/jquery-finger/package.json deleted file mode 100644 index 9a1c800b1..000000000 --- a/vendors/jquery-finger/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "jquery.finger", - "version": "0.1.0-alpha", - "description": "jQuery Finger unifies click and touch events by removing the 300ms delay on touch devices. It also provide a common set of events to handle basic gestures such as drag and pinch. Small (< 1kb gzipped), it is focused on performance, is well tested and ... also supports jQuery delegated events.", - "homepage": "https://github.com/ngryman/jquery.finger", - "keywords": [ - "jquery", - "tap", - "doubletap", - "swipe", - "flick", - "drag", - "move", - "gestures", - "touch", - "tappable", - "event", - "mobile", - "tablet" - ], - "categories": [ - "UI", - "DOM", - "Shims", - "Utilities" - ], - "jam": { - "main": "dist/jquery.finger.js", - "include": [ - "dist/jquery.finger.js" - ], - "dependencies": { - "jquery": "~1.7.0" - } - }, - "author": { - "name": "Nicolas Gryman", - "email": "ngryman@gmail.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/ngryman/jquery.finger.git" - }, - "bugs": { - "url": "https://github.com/ngryman/jquery.finger/issues", - "email": "ngryman@gmail.com" - }, - "engines": { - "node": ">= 0.10" - }, - "scripts": { - "test": "grunt mocha" - }, - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.5.0", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-uglify": "~0.2.0", - "grunt-contrib-watch": "~0.4.0", - "grunt-contrib-connect": "~0.3.0", - "grunt-mocha": "~0.3.0" - } -} diff --git a/vendors/jquery-lazyload/jquery.lazyload.js b/vendors/jquery-lazyload/jquery.lazyload.js deleted file mode 100644 index 26cc80193..000000000 --- a/vendors/jquery-lazyload/jquery.lazyload.js +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Lazy Load - jQuery plugin for lazy loading images - * - * Copyright (c) 2007-2013 Mika Tuupola - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/mit-license.php - * - * Project home: - * http://www.appelsiini.net/projects/lazyload - * - * Version: 1.9.0 - * - */ - -(function($, window, document, undefined) { - var $window = $(window); - - $.fn.lazyload = function(options) { - var elements = this; - var $container; - var settings = { - threshold : 0, - failure_limit : 0, - event : "scroll", - effect : "show", - container : window, - data_attribute : "original", - skip_invisible : true, - appear : null, - load : null, - placeholder : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" - }; - - function update() { - var counter = 0; - - elements.each(function() { - var $this = $(this); - if (settings.skip_invisible && !$this.is(":visible")) { - return; - } - if ($.abovethetop(this, settings) || - $.leftofbegin(this, settings)) { - /* Nothing. */ - } else if (!$.belowthefold(this, settings) && - !$.rightoffold(this, settings)) { - $this.trigger("appear"); - /* if we found an image we'll load, reset the counter */ - counter = 0; - } else { - if (++counter > settings.failure_limit) { - return false; - } - } - }); - - } - - if(options) { - /* Maintain BC for a couple of versions. */ - if (undefined !== options.failurelimit) { - options.failure_limit = options.failurelimit; - delete options.failurelimit; - } - if (undefined !== options.effectspeed) { - options.effect_speed = options.effectspeed; - delete options.effectspeed; - } - - $.extend(settings, options); - } - - /* Cache container as jQuery as object. */ - $container = (settings.container === undefined || - settings.container === window) ? $window : $(settings.container); - - /* Fire one scroll event per scroll. Not one scroll event per image. */ - if (0 === settings.event.indexOf("scroll")) { - $container.bind(settings.event, function() { - return update(); - }); - } - - this.each(function() { - var self = this; - var $self = $(self); - - self.loaded = false; - - /* If no src attribute given use data:uri. */ - if ($self.attr("src") === undefined || $self.attr("src") === false) { - $self.attr("src", settings.placeholder); - } - - /* When appear is triggered load original image. */ - $self.one("appear", function() { - if (!this.loaded) { - if (settings.appear) { - var elements_left = elements.length; - settings.appear.call(self, elements_left, settings); - } - $("") - .bind("load", function() { - var original = $self.data(settings.data_attribute); - $self.hide(); - if ($self.is("img")) { - $self.attr("src", original); - } else { - $self.css("background-image", "url('" + original + "')"); - } - $self[settings.effect](settings.effect_speed); - - self.loaded = true; - - /* Remove image from array so it is not looped next time. */ - var temp = $.grep(elements, function(element) { - return !element.loaded; - }); - elements = $(temp); - - if (settings.load) { - var elements_left = elements.length; - settings.load.call(self, elements_left, settings); - } - }) - .attr("src", $self.data(settings.data_attribute)); - } - }); - - /* When wanted event is triggered load original image */ - /* by triggering appear. */ - if (0 !== settings.event.indexOf("scroll")) { - $self.bind(settings.event, function() { - if (!self.loaded) { - $self.trigger("appear"); - } - }); - } - }); - - /* Check if something appears when window is resized. */ - $window.bind("resize", function() { - update(); - }); - - /* With IOS5 force loading images when navigating with back button. */ - /* Non optimal workaround. */ - if ((/iphone|ipod|ipad.*os 5/gi).test(navigator.appVersion)) { - $window.bind("pageshow", function(event) { - if (event.originalEvent && event.originalEvent.persisted) { - elements.each(function() { - $(this).trigger("appear"); - }); - } - }); - } - - /* Force initial check if images should appear. */ - $(document).ready(function() { - update(); - }); - - return this; - }; - - /* Convenience methods in jQuery namespace. */ - /* Use as $.belowthefold(element, {threshold : 100, container : window}) */ - - $.belowthefold = function(element, settings) { - var fold; - - if (settings.container === undefined || settings.container === window) { - fold = (window.innerHeight ? window.innerHeight : $window.height()) + $window.scrollTop(); - } else { - fold = $(settings.container).offset().top + $(settings.container).height(); - } - - return fold <= $(element).offset().top - settings.threshold; - }; - - $.rightoffold = function(element, settings) { - var fold; - - if (settings.container === undefined || settings.container === window) { - fold = $window.width() + $window.scrollLeft(); - } else { - fold = $(settings.container).offset().left + $(settings.container).width(); - } - - return fold <= $(element).offset().left - settings.threshold; - }; - - $.abovethetop = function(element, settings) { - var fold; - - if (settings.container === undefined || settings.container === window) { - fold = $window.scrollTop(); - } else { - fold = $(settings.container).offset().top; - } - - return fold >= $(element).offset().top + settings.threshold + $(element).height(); - }; - - $.leftofbegin = function(element, settings) { - var fold; - - if (settings.container === undefined || settings.container === window) { - fold = $window.scrollLeft(); - } else { - fold = $(settings.container).offset().left; - } - - return fold >= $(element).offset().left + settings.threshold + $(element).width(); - }; - - $.inviewport = function(element, settings) { - return !$.rightoffold(element, settings) && !$.leftofbegin(element, settings) && - !$.belowthefold(element, settings) && !$.abovethetop(element, settings); - }; - - /* Custom selectors for your convenience. */ - /* Use as $("img:below-the-fold").something() or */ - /* $("img").filter(":below-the-fold").something() which is faster */ - - $.extend($.expr[":"], { - "below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); }, - "above-the-top" : function(a) { return !$.belowthefold(a, {threshold : 0}); }, - "right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); }, - "left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); }, - "in-viewport" : function(a) { return $.inviewport(a, {threshold : 0}); }, - /* Maintain BC for couple of versions. */ - "above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); }, - "right-of-fold" : function(a) { return $.rightoffold(a, {threshold : 0}); }, - "left-of-fold" : function(a) { return !$.rightoffold(a, {threshold : 0}); } - }); - -})(jQuery, window, document); diff --git a/vendors/jquery-lazyload/jquery.lazyload.min.js b/vendors/jquery-lazyload/jquery.lazyload.min.js deleted file mode 100644 index f64679432..000000000 --- a/vendors/jquery-lazyload/jquery.lazyload.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! RainLoop Top Driver v1.0; Mika Tuupola; Licensed under MIT */ -!function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("").bind("load",function(){var d=c.data(j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.data(j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/iphone|ipod|ipad.*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document); \ No newline at end of file diff --git a/vendors/jquery-mousewheel/ChangeLog.markdown b/vendors/jquery-mousewheel/ChangeLog.markdown deleted file mode 100644 index 5c88a1e80..000000000 --- a/vendors/jquery-mousewheel/ChangeLog.markdown +++ /dev/null @@ -1,96 +0,0 @@ -# Mouse Wheel ChangeLog - -## 3.1.4 - -* Always set the deltaY -* Add back in the deltaX and deltaY support for older Firefox versions - -## 3.1.3 - -* Include `MozMousePixelScroll` in the to fix list to avoid inconsistent behavior in older Firefox - -## 3.1.2 - -* Include grunt utilities for development purposes (jshint and uglify) -* Include support for browserify -* Some basic cleaning up - -## 3.1.1 - -* Fix rounding issue with deltas less than zero - - -## 3.1.0 - -* Fix Firefox 17+ issues by using new wheel event -* Normalize delta values -* Adds horizontal support for IE 9+ by using new wheel event -* Support AMD loaders - - -## 3.0.6 - -* Fix issue with delta being 0 in Firefox - - -## 3.0.5 - -* jQuery 1.7 compatibility - - -## 3.0.4 - -* Fix IE issue - - -## 3.0.3 - -* Added `deltaX` and `deltaY` for horizontal scrolling support (Thanks to Seamus Leahy) - - -## 3.0.2 - -* Fixed delta being opposite value in latest Opera -* No longer fix `pageX`, `pageY` for older Mozilla browsers -* Removed browser detection -* Cleaned up the code - - -## 3.0.1 - -* Bad release... creating a new release due to plugins.jquery.com issue :( - - -## 3.0 - -* Uses new special events API in jQuery 1.2.2+ -* You can now treat `mousewheel` as a normal event and use `.bind`, `.unbind` and `.trigger` -* Using jQuery.data API for expandos - - -## 2.2 - -* Fixed `pageX`, `pageY`, `clientX` and `clientY` event properties for Mozilla based browsers - - -## 2.1.1 - -* Updated to work with jQuery 1.1.3 -* Used one instead of bind to do unload event for clean up - - -## 2.1 - -* Fixed an issue with the unload handler - - -## 2.0 - -* Major reduction in code size and complexity (internals have change a whole lot) - - -## 1.0 - -* Fixed Opera issue -* Fixed an issue with children elements that also have a mousewheel handler -* Added ability to handle multiple handlers diff --git a/vendors/jquery-mousewheel/LICENSE.txt b/vendors/jquery-mousewheel/LICENSE.txt deleted file mode 100644 index d64b7076b..000000000 --- a/vendors/jquery-mousewheel/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2013, Brandon Aaron (http://brandonaaron.net/) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendors/jquery-mousewheel/README.markdown b/vendors/jquery-mousewheel/README.markdown deleted file mode 100644 index 15e1735e7..000000000 --- a/vendors/jquery-mousewheel/README.markdown +++ /dev/null @@ -1,58 +0,0 @@ -# jQuery Mouse Wheel Plugin - -A [jQuery](http://jquery.com/) plugin that adds cross-browser mouse wheel support. - -In order to use the plugin, simply bind the `mousewheel` event to an element. -It also provides two helper methods called `mousewheel` and `unmousewheel` -that act just like other event helper methods in jQuery. The event callback -receives three extra arguments which are the normalized "deltas" of the mouse wheel. - -Here is an example of using both the bind and helper method syntax: - -```js -// using bind -$('#my_elem').on('mousewheel', function(event, delta, deltaX, deltaY) { - console.log(delta, deltaX, deltaY); -}); - -// using the event helper -$('#my_elem').mousewheel(function(event, delta, deltaX, deltaY) { - console.log(delta, deltaX, deltaY); -}); -``` - -## See it in action -[See the tests on Github](http://brandonaaron.github.io/jquery-mousewheel/test). - -## Using with [Browserify](http://browserify.org) - -Support for browserify is baked in. - -```bash -npm install jquery-mousewheel -npm install jquery-browserify -``` - -In your server-side node.js code: - -```js -var express = require('express'); -var app = express.createServer(); - -app.use(require('browserify')({ - require : [ 'jquery-browserify', 'jquery-mousewheel' ] -})); -``` - -In your browser-side javascript: - -```js -var $ = require('jquery-browserify'); -require('jquery-mousewheel')($); -``` - -## License - -This plugin is licensed under the [MIT License](LICENSE.txt). - -Copyright (c) 2013 [Brandon Aaron](http://brandon.aaron.sh) diff --git a/vendors/jquery-mousewheel/jquery.mousewheel-3.1.4.min.js b/vendors/jquery-mousewheel/jquery.mousewheel-3.1.4.min.js deleted file mode 100644 index e62186803..000000000 --- a/vendors/jquery-mousewheel/jquery.mousewheel-3.1.4.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jquery.mousewheel v3.1.4 (c) 2013 Brandon Aaron (http://brandon.aaron.sh) | MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var e,f=b||window.event,g=[].slice.call(arguments,1),h=0,i=0,j=0,k=0,l=0;return b=a.event.fix(f),b.type="mousewheel",f.wheelDelta&&(h=f.wheelDelta),f.detail&&(h=-1*f.detail),j=h,void 0!==f.axis&&f.axis===f.HORIZONTAL_AXIS&&(j=0,i=-1*h),f.deltaY&&(j=-1*f.deltaY,h=j),f.deltaX&&(i=f.deltaX,h=-1*i),void 0!==f.wheelDeltaY&&(j=f.wheelDeltaY),void 0!==f.wheelDeltaX&&(i=-1*f.wheelDeltaX),k=Math.abs(h),(!c||c>k)&&(c=k),l=Math.max(Math.abs(j),Math.abs(i)),(!d||d>l)&&(d=l),e=h>0?"floor":"ceil",h=Math[e](h/c),i=Math[e](i/d),j=Math[e](j/d),g.unshift(b,h,i,j),(a.event.dispatch||a.event.handle).apply(this,g)}var c,d,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],f="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"];if(a.event.fixHooks)for(var g=e.length;g;)a.event.fixHooks[e[--g]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=f.length;a;)this.addEventListener(f[--a],b,!1);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],b,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); \ No newline at end of file diff --git a/vendors/jquery-mousewheel/jquery.mousewheel.js b/vendors/jquery-mousewheel/jquery.mousewheel.js deleted file mode 100644 index e1d0e50b3..000000000 --- a/vendors/jquery-mousewheel/jquery.mousewheel.js +++ /dev/null @@ -1,122 +0,0 @@ -/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh) - * Licensed under the MIT License (LICENSE.txt). - * - * Version: 3.1.4 - * - * Requires: 1.2.2+ - */ - -(function (factory) { - if ( typeof define === 'function' && define.amd ) { - // AMD. Register as an anonymous module. - define(['jquery'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS style for Browserify - module.exports = factory; - } else { - // Browser globals - factory(jQuery); - } -}(function ($) { - - var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll']; - var toBind = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll']; - var lowestDelta, lowestDeltaXY; - - if ( $.event.fixHooks ) { - for ( var i = toFix.length; i; ) { - $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; - } - } - - $.event.special.mousewheel = { - setup: function() { - if ( this.addEventListener ) { - for ( var i = toBind.length; i; ) { - this.addEventListener( toBind[--i], handler, false ); - } - } else { - this.onmousewheel = handler; - } - }, - - teardown: function() { - if ( this.removeEventListener ) { - for ( var i = toBind.length; i; ) { - this.removeEventListener( toBind[--i], handler, false ); - } - } else { - this.onmousewheel = null; - } - } - }; - - $.fn.extend({ - mousewheel: function(fn) { - return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); - }, - - unmousewheel: function(fn) { - return this.unbind('mousewheel', fn); - } - }); - - - function handler(event) { - var orgEvent = event || window.event, - args = [].slice.call(arguments, 1), - delta = 0, - deltaX = 0, - deltaY = 0, - absDelta = 0, - absDeltaXY = 0, - fn; - event = $.event.fix(orgEvent); - event.type = 'mousewheel'; - - // Old school scrollwheel delta - if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta; } - if ( orgEvent.detail ) { delta = orgEvent.detail * -1; } - - // At a minimum, setup the deltaY to be delta - deltaY = delta; - - // Firefox < 17 related to DOMMouseScroll event - if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { - deltaY = 0; - deltaX = delta * -1; - } - - // New school wheel delta (wheel event) - if ( orgEvent.deltaY ) { - deltaY = orgEvent.deltaY * -1; - delta = deltaY; - } - if ( orgEvent.deltaX ) { - deltaX = orgEvent.deltaX; - delta = deltaX * -1; - } - - // Webkit - if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY; } - if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = orgEvent.wheelDeltaX * -1; } - - // Look for lowest delta to normalize the delta values - absDelta = Math.abs(delta); - if ( !lowestDelta || absDelta < lowestDelta ) { lowestDelta = absDelta; } - absDeltaXY = Math.max(Math.abs(deltaY), Math.abs(deltaX)); - if ( !lowestDeltaXY || absDeltaXY < lowestDeltaXY ) { lowestDeltaXY = absDeltaXY; } - - // Get a whole value for the deltas - fn = delta > 0 ? 'floor' : 'ceil'; - delta = Math[fn](delta / lowestDelta); - deltaX = Math[fn](deltaX / lowestDeltaXY); - deltaY = Math[fn](deltaY / lowestDeltaXY); - - // Add event and delta to the front of the arguments - args.unshift(event, delta, deltaX, deltaY); - - return ($.event.dispatch || $.event.handle).apply(this, args); - } - -})); diff --git a/vendors/jquery-mousewheel/mousewheel.jquery.json b/vendors/jquery-mousewheel/mousewheel.jquery.json deleted file mode 100644 index e5a68ed14..000000000 --- a/vendors/jquery-mousewheel/mousewheel.jquery.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "mousewheel", - "title": "jQuery Mousewheel", - "description": "A jQuery plugin that adds cross-browser mouse wheel support.", - "keywords": [ - "mousewheel", - "mouse", - "event" - ], - "version": "3.1.4", - "author": { - "name": "Brandon Aaron", - "url": "http://brandonaaron.net" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/brandonaaron/jquery-mousewheel/master/LICENSE.txt" - } - ], - "bugs": "https://github.com/brandonaaron/jquery-mousewheel/issues", - "homepage": "https://github.com/brandonaaron/jquery-mousewheel", - "download": "https://github.com/brandonaaron/jquery-mousewheel/tags", - "dependencies": { - "jquery": ">=1.2.2" - } -} diff --git a/vendors/jquery-mousewheel/package.json b/vendors/jquery-mousewheel/package.json deleted file mode 100644 index 49e99cf03..000000000 --- a/vendors/jquery-mousewheel/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "jquery-mousewheel", - "version": "3.1.4", - "author": "Brandon Aaron (http://brandonaaron.net/)", - "description": "A jQuery plugin that adds cross-browser mouse wheel support.", - "main": "./jquery.mousewheel.js", - "repository": { - "type": "git", - "url": "https://github.com/brandonaaron/jquery-mousewheel.git" - }, - "bugs": { - "url": "https://github.com/brandonaaron/jquery-mousewheel/issues" - }, - "keywords": [ - "jquery", - "mouse", - "wheel", - "event", - "mousewheel", - "plugin", - "browser" - ], - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/brandonaaron/jquery-mousewheel/master/LICENSE.txt" - } - ], - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.6.4", - "grunt-contrib-uglify": "~0.2.4" - }, - "readmeFilename": "README.markdown", - "directories": { - "test": "test" - }, - "jam": { - "dependencies": { - "jquery": ">=1.2.2" - } - } -} diff --git a/vendors/jquery-nanoscroller/jquery.nanoscroller-0.7.min.js b/vendors/jquery-nanoscroller/jquery.nanoscroller-0.7.min.js deleted file mode 100644 index d25daa594..000000000 --- a/vendors/jquery-nanoscroller/jquery.nanoscroller-0.7.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! nanoScrollerJS v0.7 (c) 2013 James Florentino; modified by RainLoop Team | MIT */ -!function(t,i,e){"use strict";var s,l,o,n,r,h,a,c,d,p,v,g,f,u,m,S,b,w,T,y,$;y={paneClass:"pane",sliderClass:"slider",contentClass:"content",iOSNativeScrolling:!1,preventPageScrolling:!1,disableResize:!1,alwaysVisible:!1,flashDelay:1500,sliderMinHeight:20,sliderMaxHeight:null},S="scrollbar",m="scroll",c="mousedown",d="mousemove",v="mousewheel",p="mouseup",u="resize",r="drag",w="up",f="panedown",o="DOMMouseScroll",n="down",T="wheel",h="keydown",a="keyup",b="touchmove",s="Microsoft Internet Explorer"===i.navigator.appName&&/msie 7./i.test(i.navigator.appVersion)&&i.ActiveXObject,l=null,$=function(){var t,i,s;return t=e.createElement("div"),i=t.style,i.position="absolute",i.width="100px",i.height="100px",i.overflow=m,i.top="-9999px",t.className="nano-visibility-hidden",e.body.appendChild(t),s=t.offsetWidth-t.clientWidth,e.body.removeChild(t),s},g=function(){function h(s,o){this.el=s,this.options=o,l||(l=$()),this.$el=t(this.el),this.doc=t(e),this.win=t(i),this.$content=this.$el.children("."+o.contentClass),this.$content.attr("tabindex",0),this.content=this.$content[0],this.options.iOSNativeScrolling&&null!=this.el.style.WebkitOverflowScrolling?this.nativeScrolling():this.generate(),this.createEvents(),this.addEvents(),this.reset()}return h.prototype.preventScrolling=function(t,i){if(this.isActive||this.isActive2)if(t.type===o)(i===n&&t.originalEvent.detail>0||i===w&&t.originalEvent.detail<0)&&t.preventDefault();else if(t.type===v){if(!t.originalEvent||!t.originalEvent.wheelDelta)return;(i===n&&t.originalEvent.wheelDelta<0||i===w&&t.originalEvent.wheelDelta>0)&&t.preventDefault()}},h.prototype.scrollClassTimer=0,h.prototype.scrollClassTrigger=function(){i.clearTimeout(this.scrollClassTimer);var t=this;t.$el.addClass("nano-scrollevent"),t.pane.addClass("activescroll"),t.pane2.addClass("activescroll"),this.scrollClassTimer=i.setTimeout(function(){t.$el.removeClass("nano-scrollevent"),t.pane.removeClass("activescroll"),t.pane2.removeClass("activescroll")},1e3)},h.prototype.nativeScrolling=function(){this.$content.css({WebkitOverflowScrolling:"touch"}),this.iOSNativeScrolling=!0,this.isActive=!0,this.isActive2=!0},h.prototype.updateScrollValues=function(){var t,i=8;t=this.content,this.maxScrollTop=t.scrollHeight-t.clientHeight,this.maxScroll2Left=t.scrollWidth-t.clientWidth,this.contentScrollTop=t.scrollTop,this.contentScroll2Left=t.scrollLeft,this.iOSNativeScrolling||(this.maxSliderTop=this.paneHeight-this.sliderHeight,this.maxSlider2Left=this.pane2Width-this.slider2Width,this.sliderTop=this.contentScrollTop*this.maxSliderTop/this.maxScrollTop,this.slider2Left=this.contentScroll2Left*this.maxSlider2Left/this.maxScroll2Left,i=this.maxScrollTop?this.$el.removeClass("nano-scrolllimit-bottom"):this.$el.addClass("nano-scrolllimit-bottom"))},h.prototype.createEvents=function(){var t=this;this.events={down:function(i){return t.isBeingDragged=!0,t.offsetY=i.pageY-t.slider.offset().top,t.pane.addClass("active"),t.doc.bind(d,t.events[r]).bind(p,t.events[w]),!1},down2:function(i){return t.isBeingDragged2=!0,t.offsetX=i.pageX-t.slider2.offset().left,t.pane2.addClass("active"),t.doc.bind(d,t.events.drag2).bind(p,t.events.up2),!1},drag:function(i){return t.sliderY=i.pageY-t.$el.offset().top-t.offsetY,t.scroll(),t.updateScrollValues(),t.contentScrollTop>=t.maxScrollTop?t.$el.trigger("scrollend"):0===t.contentScrollTop&&t.$el.trigger("scrolltop"),!1},drag2:function(i){return t.slider2X=i.pageX-t.$el.offset().left-t.offsetX,t.scroll(),t.updateScrollValues(),!1},up:function(){return t.isBeingDragged=!1,t.pane.removeClass("active"),t.doc.unbind(d,t.events[r]).unbind(p,t.events[w]),!1},up2:function(){return t.isBeingDragged2=!1,t.pane2.removeClass("active"),t.doc.unbind(d,t.events.drag2).unbind(p,t.events.up2),!1},resize:function(){t.reset()},panedown:function(i){return t.sliderY=(i.offsetY||i.originalEvent.layerY)-.5*t.sliderHeight,t.scroll(),t.events.down(i),!1},panedown2:function(i){return t.slider2X=(i.offsetX||i.originalEvent.layerX)-.5*t.slider2Width,t.scroll(),t.events.down2(i),!1},scroll:function(i){t.isBeingDragged||t.isBeingDragged2||(t.updateScrollValues(),t.iOSNativeScrolling||(t.sliderY=t.sliderTop,t.slider.css({top:t.sliderTop}),t.slider2X=t.slider2Left,t.slider2.css({left:t.slider2Left})),i&&(t.contentScrollTop>=t.maxScrollTop?(t.options.preventPageScrolling&&t.preventScrolling(i,n),t.$el.trigger("scrollend")):0===t.contentScrollTop&&(t.options.preventPageScrolling&&t.preventScrolling(i,w),t.$el.trigger("scrolltop")),t.iOSNativeScrolling||t.scrollClassTrigger()))},wheel:function(i){return i&&void 0!==i.wheelDeltaY&&void 0!==i.delta?(t.sliderY+=-i.wheelDeltaY||-i.delta,t.scroll(),!1):void 0}}},h.prototype.addEvents=function(){var t;this.removeEvents(),t=this.events,this.options.disableResize||this.win.bind(u,t[u]),this.iOSNativeScrolling||(this.slider.bind(c,t[n]),this.slider2.bind(c,t.down2),this.pane.bind(c,t[f]),this.pane2.bind(c,t.panedown2)),this.$content.bind(""+m+" "+v+" "+o+" "+b,t[m])},h.prototype.removeEvents=function(){var t;t=this.events,this.win.unbind(u,t[u]),this.iOSNativeScrolling||(this.slider.unbind(),this.pane.unbind(),this.slider2.unbind(),this.pane2.unbind()),this.$content.unbind(""+m+" "+v+" "+o+" "+b,t[m])},h.prototype.generate=function(){var t,i,e,s,o;return e=this.options,s=e.paneClass,o=e.sliderClass,t=e.contentClass,this.$el.find("."+s).length||this.$el.find("."+o).length||this.$el.append('
    '),this.$el.find(".pane2").length||this.$el.find(".slider2").length||this.$el.append('
    '),this.slider=this.$el.find("."+o),this.slider2=this.$el.find(".slider2"),this.pane=this.$el.find("."+s),this.pane2=this.$el.find(".pane2"),l&&(i="rtl"===this.$el.css("direction")?{left:-l,bottom:-l}:{right:-l,bottom:-l},this.$el.addClass("has-scrollbar")),null!=i&&this.$content.css(i),this},h.prototype.restore=function(){this.stopped=!1,this.pane.show(),this.pane2.show(),this.addEvents()},h.prototype.reset=function(){var t,i,e,o,n,r,h,a,c,d,p,v,g,f,u,S;return this.iOSNativeScrolling?(this.contentHeight=this.content.scrollHeight,void(this.contentWidth=this.content.scrollWidth)):(this.$el.find("."+this.options.paneClass).length||this.generate().stop(),this.$el.find(".pane2").length||this.generate().stop(),this.stopped&&this.restore(),t=this.content,e=t.style,o=e.overflowY,d=e.overflowX,s&&this.$content.css({height:this.$content.height()}),i=t.scrollHeight+l,p=t.scrollWidth+l,r=this.pane.outerHeight(),v=this.pane2.outerWidth(),a=parseInt(this.pane.css("top"),10),f=parseInt(this.pane2.css("left"),10),n=parseInt(this.pane.css("bottom"),10),g=parseInt(this.pane2.css("right"),10),h=r+a+n,u=v+f+g,c=Math.round(h/i*h),S=Math.round(u/p*u),cthis.options.sliderMaxHeight&&(c=this.options.sliderMaxHeight),Sthis.options.sliderMaxHeight&&(S=this.options.sliderMaxHeight),o===m&&e.overflowX!==m&&(c+=l),d===m&&e.overflowY!==m&&(S+=l),this.maxSliderTop=h-c,this.maxSlider2Left=u-S,this.contentHeight=i,this.contentWidth=p,this.paneHeight=r,this.pane2Width=v,this.paneOuterHeight=h,this.pane2OuterWidth=u,this.sliderHeight=c,this.slider2Width=S,this.slider.height(c),this.slider2.width(S),this.events.scroll(),this.pane.show(),this.pane2.show(),this.isActive=!0,t.scrollHeight===t.clientHeight||this.pane.outerHeight(!0)>=t.scrollHeight&&o!==m?(this.pane.hide(),this.isActive=!1):this.el.clientHeight===t.scrollHeight&&o===m?this.slider.hide():this.slider.show(),this.isActive2=!0,t.scrollWidth===t.clientWidth||this.pane2.outerWidth(!0)>=t.scrollWidth-30&&d!==m?(this.pane2.hide(),this.isActive2=!1):this.el.clientWidth===t.scrollWidth&&d===m?this.slider2.hide():this.slider2.show(),this.pane.css({opacity:this.options.alwaysVisible?1:"",visibility:this.options.alwaysVisible?"visible":""}),this.pane2.css({opacity:this.options.alwaysVisible?1:"",visibility:this.options.alwaysVisible?"visible":""}),this)},h.prototype.scroll=function(){return this.isActive||this.isActive2?(this.isActive&&(this.sliderY=Math.max(0,this.sliderY),this.sliderY=Math.min(this.maxSliderTop,this.sliderY),this.$content.scrollTop((this.paneHeight-this.contentHeight+l)*this.sliderY/this.maxSliderTop*-1)),this.isActive2&&(this.slider2X=Math.max(0,this.slider2X),this.slider2X=Math.min(this.maxSlider2Left,this.slider2X),this.$content.scrollLeft((this.pane2Width-this.contentWidth+l)*this.slider2X/this.maxSlider2Left*-1)),this.iOSNativeScrolling||(this.isActive&&this.slider.css({top:this.sliderY}),this.isActive2&&this.slider2.css({left:this.slider2X})),this):void 0},h.prototype.scrollBottom=function(t){return this.isActive||this.isActive2?(this.reset(),this.$content.scrollTop(this.contentHeight-this.$content.height()-t).trigger(v),this):void 0},h.prototype.scrollTop=function(t){return this.isActive||this.isActive2?(this.reset(),this.$content.scrollTop(+t).trigger(v),this):void 0},h.prototype.scrollTo=function(i){return this.isActive||this.isActive2?(this.reset(),this.scrollTop(t(i).get(0).offsetTop),this):void 0},h.prototype.stop=function(){return this.stopped=!0,this.removeEvents(),this.pane.hide(),this},h.prototype.flash=function(){var t=this;if(this.isActive||this.isActive2)return this.reset(),this.pane.addClass("flashed"),setTimeout(function(){t.pane.removeClass("flashed")},this.options.flashDelay),this},h}(),t.fn.nanoScroller=function(i){return this.each(function(){var e,s;if((s=this.nanoscroller)||(e=t.extend({},y,i),this.nanoscroller=s=new g(this,e)),i&&"object"==typeof i){if(t.extend(s.options,i),i.scrollBottom)return s.scrollBottom(i.scrollBottom);if(i.scrollTop)return s.scrollTop(i.scrollTop);if(i.scrollTo)return s.scrollTo(i.scrollTo);if("bottom"===i.scroll)return s.scrollBottom(0);if("top"===i.scroll)return s.scrollTop(0);if(i.scroll&&i.scroll instanceof t)return s.scrollTo(i.scroll);if(i.stop)return s.stop();if(i.flash)return s.flash()}return s.reset()})}}(jQuery,window,document); \ No newline at end of file diff --git a/vendors/jquery-scrollstop/jquery.scrollstop.js b/vendors/jquery-scrollstop/jquery.scrollstop.js deleted file mode 100644 index a0bb63710..000000000 --- a/vendors/jquery-scrollstop/jquery.scrollstop.js +++ /dev/null @@ -1,72 +0,0 @@ -/* http://james.padolsey.com/javascript/special-scroll-events-for-jquery/ */ - -(function(){ - - var special = jQuery.event.special, - uid1 = "D" + (+new Date()), - uid2 = "D" + (+new Date() + 1); - - special.scrollstart = { - setup: function() { - - var timer, - handler = function(evt) { - - var _self = this, - _args = arguments; - - if (timer) { - clearTimeout(timer); - } else { - evt.type = "scrollstart"; - jQuery.event.dispatch.apply(_self, _args); - } - - timer = setTimeout( function(){ - timer = null; - }, special.scrollstop.latency); - - }; - - jQuery(this).bind("scroll", handler).data(uid1, handler); - - }, - teardown: function(){ - jQuery(this).unbind( "scroll", jQuery(this).data(uid1) ); - } - }; - - special.scrollstop = { - latency: 300, - setup: function() { - - var timer, - handler = function(evt) { - - var _self = this, - _args = arguments; - - if (timer) { - clearTimeout(timer); - } - - timer = setTimeout( function(){ - - timer = null; - evt.type = "scrollstop"; - jQuery.event.dispatch.apply(_self, _args); - - - }, special.scrollstop.latency); - - }; - - jQuery(this).bind("scroll", handler).data(uid2, handler); - - }, - teardown: function() { - jQuery(this).unbind( "scroll", jQuery(this).data(uid2) ); - } - }; - -})(); \ No newline at end of file diff --git a/vendors/jquery-scrollstop/jquery.scrollstop.min.js b/vendors/jquery-scrollstop/jquery.scrollstop.min.js deleted file mode 100644 index 5c4162ed9..000000000 --- a/vendors/jquery-scrollstop/jquery.scrollstop.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* http://james.padolsey.com/javascript/special-scroll-events-for-jquery/ */ -!function(){var a=jQuery.event.special,b="D"+ +new Date,c="D"+(+new Date+1);a.scrollstart={setup:function(){var c,d=function(b){var d=this,e=arguments;c?clearTimeout(c):(b.type="scrollstart",jQuery.event.dispatch.apply(d,e)),c=setTimeout(function(){c=null},a.scrollstop.latency)};jQuery(this).bind("scroll",d).data(b,d)},teardown:function(){jQuery(this).unbind("scroll",jQuery(this).data(b))}},a.scrollstop={latency:300,setup:function(){var b,d=function(c){var d=this,e=arguments;b&&clearTimeout(b),b=setTimeout(function(){b=null,c.type="scrollstop",jQuery.event.dispatch.apply(d,e)},a.scrollstop.latency)};jQuery(this).bind("scroll",d).data(c,d)},teardown:function(){jQuery(this).unbind("scroll",jQuery(this).data(c))}}}(); \ No newline at end of file diff --git a/vendors/jquery-wakeup/jquery.wakeup.min.js b/vendors/jquery-wakeup/jquery.wakeup.min.js deleted file mode 100644 index c21ce521a..000000000 --- a/vendors/jquery-wakeup/jquery.wakeup.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery WakeUp plugin (c) 2013 Paul Okopny | MIT */ -!function(a){var b=1e3,c=new Array;a.wakeUp=function(a,d,e){if(e&&"number"==typeof e||(e=b),"function"!=typeof a)return null;var f=(new Date).getTime(),g=setInterval(function(){var b=(new Date).getTime();if(b>f+e+1e3){var c=b-f;f=b,d?a(c,d):a(c)}else f=b},e);return c.push(g),g},a.ignoreBell=function(b){b&&(c.splice(a.inArray(b,c),1),clearInterval(b))},a.dreamOn=function(){a.each(c,function(a,b){clearInterval(b)}),c=new Array}}(jQuery,document); \ No newline at end of file diff --git a/vendors/jquery/jquery-1.11.0.min.js b/vendors/jquery/jquery-1.11.0.min.js deleted file mode 100644 index 73f33fb3a..000000000 --- a/vendors/jquery/jquery-1.11.0.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
    ",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f -}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
    a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:l.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("'; - - } else if (isVideo.vimeo) { - - a = '?autoplay=' + autoplay + '&api=1'; - if (this.core.s.vimeoPlayerParams) { - a = a + '&' + $.param(this.core.s.vimeoPlayerParams); - } - - video = ''; - - } else if (isVideo.html5) { - var fL = html.substring(0, 1); - if (fL === '.' || fL === '#') { - html = $(html).html(); - } - - video = html; - } - - return video; - }; - - Video.prototype.destroy = function() { - this.videoLoaded = false; - }; - - $.fn.lightGallery.modules.video = Video; - -})(jQuery, window, document); diff --git a/vendors/lightGallery/dist/js/lg-video.min.js b/vendors/lightGallery/dist/js/lg-video.min.js deleted file mode 100644 index ec14b71d8..000000000 --- a/vendors/lightGallery/dist/js/lg-video.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! lightgallery - v1.2.0 - 2015-08-26 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2015 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";var e={videoMaxWidth:"855px",youtubePlayerParams:!1,vimeoPlayerParams:!1,videojs:!1},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.videoLoaded=!1,this.init(),this};f.prototype.init=function(){var b=this;b.core.$el.on("hasVideo.lg.tm",function(a,c,d,e){if(b.core.$slide.eq(c).find(".lg-video").append(b.loadVideo(d,"lg-object",!0,c,e)),e)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(c).find(".lg-html5").get(0),{},function(){b.videoLoaded||this.play()})}catch(f){console.error("Make sure you have included videojs")}else b.core.$slide.eq(c).find(".lg-html5").get(0).play()}),b.core.$el.on("onAferAppendSlide.lg.tm",function(a,c){b.core.$slide.eq(c).find(".lg-video-cont").css("max-width",b.core.s.videoMaxWidth),b.videoLoaded=!0});var c=function(a){if(a.find(".lg-object").hasClass("lg-has-poster"))if(a.hasClass("lg-has-video")){var c=a.find(".lg-youtube").get(0),d=a.find(".lg-vimeo").get(0),e=a.find(".lg-html5").get(0);if(c)c.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*");else if(d)try{$f(d).api("play")}catch(f){console.error("Make sure you have included froogaloop2 js")}else if(e)if(b.core.s.videojs)try{videojs(e).play()}catch(f){console.error("Make sure you have included videojs")}else e.play();a.addClass("lg-video-palying")}else{a.addClass("lg-video-palying lg-has-video");var g,h,i=function(c,d){if(a.find(".lg-video").append(b.loadVideo(c,"",!1,b.core.index,d)),d)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(b.core.index).find(".lg-html5").get(0),{},function(){this.play()})}catch(e){console.error("Make sure you have included videojs")}else b.core.$slide.eq(b.core.index).find(".lg-html5").get(0).play()};b.core.s.dynamic?(g=b.core.s.dynamicEl[b.core.index].src,h=b.core.s.dynamicEl[b.core.index].html,i(g,h)):(g=b.core.$items.eq(b.core.index).attr("data-src"),h=b.core.$items.eq(b.core.index).attr("data-html"),i(g,h));var j=a.find(".lg-object");a.find(".lg-video").append(j),a.find(".lg-video-object").hasClass("lg-html5")||(a.removeClass("lg-complete"),a.find(".lg-video-object").on("load.lg error.lg",function(){a.addClass("lg-complete")}))}};b.core.doCss()?b.core.$el.on("onSlideClick.lg.tm",function(){var a=b.core.$slide.eq(b.core.index);c(a)}):b.core.$slide.on("click.lg",function(){c(a(this))}),b.core.$el.on("onBeforeSlide.lg.tm",function(a,c){var d=b.core.$slide.eq(c),e=d.find(".lg-youtube").get(0),f=d.find(".lg-vimeo").get(0),g=d.find(".lg-html5").get(0);if(e)e.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*");else if(f)try{$f(f).api("pause")}catch(h){console.error("Make sure you have included froogaloop2 js")}else if(g)if(b.core.s.videojs)try{videojs(g).pause()}catch(h){console.error("Make sure you have included videojs")}else g.pause()}),b.core.$el.on("onAfterSlide.lg.tm",function(a,c){b.core.$slide.eq(c).removeClass("lg-video-palying")})},f.prototype.loadVideo=function(b,c,d,e,f){var g="",h=1,i="",j=this.core.isVideo(b,e)||{};if(d&&(h=this.videoLoaded?0:1),j.youtube)i="?wmode=opaque&autoplay="+h+"&enablejsapi=1",this.core.s.youtubePlayerParams&&(i=i+"&"+a.param(this.core.s.youtubePlayerParams)),g='';else if(j.vimeo)i="?autoplay="+h+"&api=1",this.core.s.vimeoPlayerParams&&(i=i+"&"+a.param(this.core.s.vimeoPlayerParams)),g='';else if(j.html5){var k=f.substring(0,1);("."===k||"#"===k)&&(f=a(f).html()),g=f}return g},f.prototype.destroy=function(){this.videoLoaded=!1},a.fn.lightGallery.modules.video=f}(jQuery,window,document); \ No newline at end of file diff --git a/vendors/lightGallery/dist/js/lg-zoom.js b/vendors/lightGallery/dist/js/lg-zoom.js deleted file mode 100644 index 7f0be2ae3..000000000 --- a/vendors/lightGallery/dist/js/lg-zoom.js +++ /dev/null @@ -1,418 +0,0 @@ -/*! lightgallery - v1.2.0 - 2015-08-26 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2015 Sachin N; Licensed Apache 2.0 */ -/** - * Zoom Plugin - * @version 1.2.0 - * @author Sachin N - @sachinchoolur - * @license MIT License (MIT) - */ -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - scale: 1, - zoom: true, - enableZoomAfter: 300 - }; - - var Zoom = function(element) { - - this.core = $(element).data('lightGallery'); - - this.core.s = $.extend({}, defaults, this.core.s); - - if (this.core.s.zoom && this.core.doCss()) { - this.init(); - this.zoomabletimeout = false; - } - - return this; - }; - - Zoom.prototype.init = function() { - - var _this = this; - var zoomIcons = ''; - - this.core.$outer.find('.lg-toolbar').append(zoomIcons); - - // Add zoomable class - _this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) { - - // delay will be 0 except first time - var _speed = _this.core.s.enableZoomAfter + delay; - - // set _speed value 0 if gallery opened from direct url and if it is first slide - if ($('body').hasClass('lg-from-hash') && delay) { - - // will execute only one time - _speed = 0; - } else { - - // Remove lg-from-hash to enable starting animation. - $('body').removeClass('lg-from-hash'); - } - - _this.zoomabletimeout = setTimeout(function() { - _this.core.$slide.eq(index).addClass('lg-zoomable'); - }, _speed + 30); - }); - - var scale = 1; - /** - * @desc Image zoom - * Translate the wrap and scale the image to get better user experience - * - * @param {String} scaleVal - Zoom decrement/increment value - * @param {Boolean} db - true if zoom called via doubleclick - * @todo Currently zoom origin is center it should work from all the directions - */ - var zoom = function(scaleVal, db, pageX, pageY) { - - var $image = _this.core.$outer.find('.lg-current .lg-image'); - var _x; - var _y; - if (db) { - _x = pageX - $image.offset().left; - _y = pageY - $image.offset().top; - } else { - _x = $image.width() / 2; - _y = $image.height() / 2; - } - - var x = (scaleVal - 1) * (_x); - var y = (scaleVal - 1) * (_y); - - $image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal); - - $image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y); - }; - - var callScale = function(db, pageX, pageY) { - if (scale > 1) { - _this.core.$outer.addClass('lg-zoomed'); - } else { - _this.core.$outer.removeClass('lg-zoomed'); - } - - if (scale < 1) { - scale = 1; - } - - zoom(scale, db, pageX, pageY); - }; - - // event triggered after appending slide content - _this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) { - - // Get the current element - var $image = _this.core.$slide.eq(index).find('.lg-image'); - - $image.dblclick(function(event) { - - var w = $image.width(); - var nw = (_this.core.s.dynamic ? false : _this.core.$items.eq(index).attr('data-width')) || $image[0].naturalWidth || w; - var _scale; - - if (_this.core.$outer.hasClass('lg-zoomed')) { - scale = 1; - } else { - if (nw > w) { - _scale = nw / w; - scale = _scale || 2; - } - } - - callScale(true, event.pageX, event.pageY); - setTimeout(function() { - _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab'); - }, 10); - }); - - }); - - // Update zoom on resize and orientationchange - $(window).on('resize.lg.zoom orientationchange.lg.zoom', function() { - setTimeout(function() { - if (_this.core.$outer.hasClass('lg-zoomed')) { - zoom(scale); - } - }, 10); - }); - - $('#lg-zoom-out').on('click.lg', function() { - if (_this.core.$outer.find('.lg-current .lg-image').length) { - scale -= _this.core.s.scale; - callScale(); - } - }); - - $('#lg-zoom-in').on('click.lg', function() { - if (_this.core.$outer.find('.lg-current .lg-image').length) { - scale += _this.core.s.scale; - callScale(); - } - }); - - // Reset zoom on slide change - _this.core.$el.on('onBeforeSlide.lg.tm', function() { - _this.resetZoom(); - }); - - // Drag option after zoom - if (!_this.core.isTouch) { - _this.zoomDrag(); - } - - if (_this.core.isTouch) { - _this.zoomSwipe(); - } - - }; - - // Reset zoom effect - Zoom.prototype.resetZoom = function() { - this.core.$outer.removeClass('lg-zoomed'); - this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y'); - this.core.$slide.find('.lg-image').removeAttr('style data-scale'); - }; - - Zoom.prototype.zoomSwipe = function() { - var _this = this; - var startCoords = {}; - var endCoords = {}; - var isMoved = false; - - // Allow x direction drag - var allowX = false; - - // Allow Y direction drag - var allowY = false; - - _this.core.$slide.on('touchstart.lg', function(e) { - - if (_this.core.$outer.hasClass('lg-zoomed')) { - var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - - allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); - allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); - if ((allowX || allowY)) { - e.preventDefault(); - startCoords = { - x: e.originalEvent.targetTouches[0].pageX, - y: e.originalEvent.targetTouches[0].pageY - }; - } - } - - }); - - _this.core.$slide.on('touchmove.lg', function(e) { - - if (_this.core.$outer.hasClass('lg-zoomed')) { - - var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); - var distanceX; - var distanceY; - - e.preventDefault(); - isMoved = true; - endCoords = e.originalEvent.targetTouches[0].pageX; - - endCoords = { - x: e.originalEvent.targetTouches[0].pageX, - y: e.originalEvent.targetTouches[0].pageY - }; - - // reset opacity and transition duration - _this.core.$outer.addClass('lg-zoom-dragging'); - - if (allowY) { - distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - } else { - distanceY = -Math.abs(_$el.attr('data-y')); - } - - if (allowX) { - distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); - } else { - distanceX = -Math.abs(_$el.attr('data-x')); - } - - _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); - - } - - }); - - _this.core.$slide.on('touchend.lg', function() { - if (_this.core.$outer.hasClass('lg-zoomed')) { - if (isMoved) { - isMoved = false; - _this.core.$outer.removeClass('lg-zoom-dragging'); - _this.touchendZoom(startCoords, endCoords, allowX, allowY); - - } - } - }); - - }; - - Zoom.prototype.zoomDrag = function() { - - var _this = this; - var startCoords = {}; - var endCoords = {}; - var isDraging = false; - var isMoved = false; - - // Allow x direction drag - var allowX = false; - - // Allow Y direction drag - var allowY = false; - - _this.core.$slide.on('mousedown.lg.zoom', function(e) { - - // execute only on .lg-object - var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - - allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); - allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); - - if (_this.core.$outer.hasClass('lg-zoomed')) { - if ($(e.target).hasClass('lg-object') && (allowX || allowY)) { - e.preventDefault(); - startCoords = { - x: e.pageX, - y: e.pageY - }; - - isDraging = true; - - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.core.$outer.scrollLeft += 1; - _this.core.$outer.scrollLeft -= 1; - - _this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing'); - } - } - }); - - $(window).on('mousemove.lg.zoom', function(e) { - if (isDraging) { - var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); - var distanceX; - var distanceY; - - isMoved = true; - endCoords = { - x: e.pageX, - y: e.pageY - }; - - // reset opacity and transition duration - _this.core.$outer.addClass('lg-zoom-dragging'); - - if (allowY) { - distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - } else { - distanceY = -Math.abs(_$el.attr('data-y')); - } - - if (allowX) { - distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); - } else { - distanceX = -Math.abs(_$el.attr('data-x')); - } - - _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); - } - }); - - $(window).on('mouseup.lg.zoom', function(e) { - - if (isDraging) { - isDraging = false; - _this.core.$outer.removeClass('lg-zoom-dragging'); - - // Fix for chrome mouse move on click - if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) { - endCoords = { - x: e.pageX, - y: e.pageY - }; - _this.touchendZoom(startCoords, endCoords, allowX, allowY); - - } - - isMoved = false; - } - - _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab'); - - }); - }; - - Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) { - - var _this = this; - var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); - var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); - var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - var minY = (_this.core.$outer.find('.lg').height() - $image.outerHeight()) / 2; - var maxY = Math.abs(($image.outerHeight() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY); - var minX = (_this.core.$outer.find('.lg').width() - $image.outerWidth()) / 2; - var maxX = Math.abs(($image.outerWidth() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX); - - if (allowY) { - if (distanceY <= -maxY) { - distanceY = -maxY; - } else if (distanceY >= -minY) { - distanceY = -minY; - } - } - - if (allowX) { - if (distanceX <= -maxX) { - distanceX = -maxX; - } else if (distanceX >= -minX) { - distanceX = -minX; - } - } - - if (allowY) { - _$el.attr('data-y', Math.abs(distanceY)); - } else { - distanceY = -Math.abs(_$el.attr('data-y')); - } - - if (allowX) { - _$el.attr('data-x', Math.abs(distanceX)); - } else { - distanceX = -Math.abs(_$el.attr('data-x')); - } - - _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); - }; - - Zoom.prototype.destroy = function() { - - var _this = this; - - // Unbind all events added by lightGallery zoom plugin - _this.core.$el.off('.lg.zoom'); - $(window).off('.lg.zoom'); - _this.core.$slide.off('.lg.zoom'); - _this.core.$el.off('.lg.tm.zoom'); - _this.resetZoom(); - clearTimeout(_this.zoomabletimeout); - _this.zoomabletimeout = false; - }; - - $.fn.lightGallery.modules.zoom = Zoom; - -})(jQuery, window, document); diff --git a/vendors/lightGallery/dist/js/lg-zoom.min.js b/vendors/lightGallery/dist/js/lg-zoom.min.js deleted file mode 100644 index 04cbdc733..000000000 --- a/vendors/lightGallery/dist/js/lg-zoom.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! lightgallery - v1.2.0 - 2015-08-26 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2015 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";var e={scale:1,zoom:!0,enableZoomAfter:300},f=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.core.s.zoom&&this.core.doCss()&&(this.init(),this.zoomabletimeout=!1),this};f.prototype.init=function(){var c=this,d='';this.core.$outer.find(".lg-toolbar").append(d),c.core.$el.on("onSlideItemLoad.lg.tm.zoom",function(b,d,e){var f=c.core.s.enableZoomAfter+e;a("body").hasClass("lg-from-hash")&&e?f=0:a("body").removeClass("lg-from-hash"),c.zoomabletimeout=setTimeout(function(){c.core.$slide.eq(d).addClass("lg-zoomable")},f+30)});var e=1,f=function(a,b,d,e){var f,g,h=c.core.$outer.find(".lg-current .lg-image");b?(f=d-h.offset().left,g=e-h.offset().top):(f=h.width()/2,g=h.height()/2);var i=(a-1)*f,j=(a-1)*g;h.css("transform","scale3d("+a+", "+a+", 1)").attr("data-scale",a),h.parent().css("transform","translate3d(-"+i+"px, -"+j+"px, 0)").attr("data-x",i).attr("data-y",j)},g=function(a,b,d){e>1?c.core.$outer.addClass("lg-zoomed"):c.core.$outer.removeClass("lg-zoomed"),1>e&&(e=1),f(e,a,b,d)};c.core.$el.on("onAferAppendSlide.lg.tm.zoom",function(a,b){var d=c.core.$slide.eq(b).find(".lg-image");d.dblclick(function(a){var f,h=d.width(),i=(c.core.s.dynamic?!1:c.core.$items.eq(b).attr("data-width"))||d[0].naturalWidth||h;c.core.$outer.hasClass("lg-zoomed")?e=1:i>h&&(f=i/h,e=f||2),g(!0,a.pageX,a.pageY),setTimeout(function(){c.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")},10)})}),a(b).on("resize.lg.zoom orientationchange.lg.zoom",function(){setTimeout(function(){c.core.$outer.hasClass("lg-zoomed")&&f(e)},10)}),a("#lg-zoom-out").on("click.lg",function(){c.core.$outer.find(".lg-current .lg-image").length&&(e-=c.core.s.scale,g())}),a("#lg-zoom-in").on("click.lg",function(){c.core.$outer.find(".lg-current .lg-image").length&&(e+=c.core.s.scale,g())}),c.core.$el.on("onBeforeSlide.lg.tm",function(){c.resetZoom()}),c.core.isTouch||c.zoomDrag(),c.core.isTouch&&c.zoomSwipe()},f.prototype.resetZoom=function(){this.core.$outer.removeClass("lg-zoomed"),this.core.$slide.find(".lg-img-wrap").removeAttr("style data-x data-y"),this.core.$slide.find(".lg-image").removeAttr("style data-scale")},f.prototype.zoomSwipe=function(){var a=this,b={},c={},d=!1,e=!1,f=!1;a.core.$slide.on("touchstart.lg",function(c){if(a.core.$outer.hasClass("lg-zoomed")){var d=a.core.$slide.eq(a.core.index).find(".lg-object");f=d.outerHeight()*d.attr("data-scale")>a.core.$outer.find(".lg").height(),e=d.outerWidth()*d.attr("data-scale")>a.core.$outer.find(".lg").width(),(e||f)&&(c.preventDefault(),b={x:c.originalEvent.targetTouches[0].pageX,y:c.originalEvent.targetTouches[0].pageY})}}),a.core.$slide.on("touchmove.lg",function(g){if(a.core.$outer.hasClass("lg-zoomed")){var h,i,j=a.core.$slide.eq(a.core.index).find(".lg-img-wrap");g.preventDefault(),d=!0,c=g.originalEvent.targetTouches[0].pageX,c={x:g.originalEvent.targetTouches[0].pageX,y:g.originalEvent.targetTouches[0].pageY},a.core.$outer.addClass("lg-zoom-dragging"),i=f?-Math.abs(j.attr("data-y"))+(c.y-b.y):-Math.abs(j.attr("data-y")),h=e?-Math.abs(j.attr("data-x"))+(c.x-b.x):-Math.abs(j.attr("data-x")),j.css("transform","translate3d("+h+"px, "+i+"px, 0)")}}),a.core.$slide.on("touchend.lg",function(){a.core.$outer.hasClass("lg-zoomed")&&d&&(d=!1,a.core.$outer.removeClass("lg-zoom-dragging"),a.touchendZoom(b,c,e,f))})},f.prototype.zoomDrag=function(){var c=this,d={},e={},f=!1,g=!1,h=!1,i=!1;c.core.$slide.on("mousedown.lg.zoom",function(b){var e=c.core.$slide.eq(c.core.index).find(".lg-object");i=e.outerHeight()*e.attr("data-scale")>c.core.$outer.find(".lg").height(),h=e.outerWidth()*e.attr("data-scale")>c.core.$outer.find(".lg").width(),c.core.$outer.hasClass("lg-zoomed")&&a(b.target).hasClass("lg-object")&&(h||i)&&(b.preventDefault(),d={x:b.pageX,y:b.pageY},f=!0,c.core.$outer.scrollLeft+=1,c.core.$outer.scrollLeft-=1,c.core.$outer.removeClass("lg-grab").addClass("lg-grabbing"))}),a(b).on("mousemove.lg.zoom",function(a){if(f){var b,j,k=c.core.$slide.eq(c.core.index).find(".lg-img-wrap");g=!0,e={x:a.pageX,y:a.pageY},c.core.$outer.addClass("lg-zoom-dragging"),j=i?-Math.abs(k.attr("data-y"))+(e.y-d.y):-Math.abs(k.attr("data-y")),b=h?-Math.abs(k.attr("data-x"))+(e.x-d.x):-Math.abs(k.attr("data-x")),k.css("transform","translate3d("+b+"px, "+j+"px, 0)")}}),a(b).on("mouseup.lg.zoom",function(a){f&&(f=!1,c.core.$outer.removeClass("lg-zoom-dragging"),!g||d.x===e.x&&d.y===e.y||(e={x:a.pageX,y:a.pageY},c.touchendZoom(d,e,h,i)),g=!1),c.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")})},f.prototype.touchendZoom=function(a,b,c,d){var e=this,f=e.core.$slide.eq(e.core.index).find(".lg-img-wrap"),g=e.core.$slide.eq(e.core.index).find(".lg-object"),h=-Math.abs(f.attr("data-x"))+(b.x-a.x),i=-Math.abs(f.attr("data-y"))+(b.y-a.y),j=(e.core.$outer.find(".lg").height()-g.outerHeight())/2,k=Math.abs(g.outerHeight()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").height()+j),l=(e.core.$outer.find(".lg").width()-g.outerWidth())/2,m=Math.abs(g.outerWidth()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").width()+l);d&&(-k>=i?i=-k:i>=-j&&(i=-j)),c&&(-m>=h?h=-m:h>=-l&&(h=-l)),d?f.attr("data-y",Math.abs(i)):i=-Math.abs(f.attr("data-y")),c?f.attr("data-x",Math.abs(h)):h=-Math.abs(f.attr("data-x")),f.css("transform","translate3d("+h+"px, "+i+"px, 0)")},f.prototype.destroy=function(){var c=this;c.core.$el.off(".lg.zoom"),a(b).off(".lg.zoom"),c.core.$slide.off(".lg.zoom"),c.core.$el.off(".lg.tm.zoom"),c.resetZoom(),clearTimeout(c.zoomabletimeout),c.zoomabletimeout=!1},a.fn.lightGallery.modules.zoom=f}(jQuery,window,document); \ No newline at end of file diff --git a/vendors/lightGallery/dist/js/lightgallery-all.js b/vendors/lightGallery/dist/js/lightgallery-all.js deleted file mode 100644 index 26afce203..000000000 --- a/vendors/lightGallery/dist/js/lightgallery-all.js +++ /dev/null @@ -1,2764 +0,0 @@ -/*! lightgallery - v1.2.0 - 2015-08-26 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2015 Sachin N; Licensed Apache 2.0 */ -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - - mode: 'lg-slide', - - // Ex : 'ease' - cssEasing: 'cubic-bezier(0.25, 0, 0.25, 1)', - - //'for jquery animation' - easing: 'linear', - speed: 600, - height: '100%', - width: '100%', - addClass: '', - startClass: 'lg-start-zoom', - backdropDuration: 150, - hideBarsDelay: 6000, - - useLeft: false, - - closable: true, - loop: true, - escKey: true, - keyPress: true, - controls: true, - slideEndAnimatoin: true, - hideControlOnEnd: false, - mousewheel: true, - - // .lg-item || '.lg-sub-html' - appendSubHtmlTo: '.lg-sub-html', - - /** - * @desc number of preload slides - * will exicute only after the current slide is fully loaded. - * - * @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th - * slide will be loaded in the background after the 4th slide is fully loaded.. - * if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ... - * - */ - preload: 1, - showAfterLoad: true, - selector: '', - nextHtml: '', - prevHtml: '', - - // 0, 1 - index: false, - - iframeMaxWidth: '100%', - - download: true, - counter: true, - appendCounterTo: '.lg-toolbar', - - swipeThreshold: 50, - enableSwipe: true, - enableDrag: true, - - dynamic: false, - dynamicEl: [], - galleryId: 1 - }; - - function Plugin(element, options) { - - // Current lightGallery element - this.el = element; - - // Current jquery element - this.$el = $(element); - - // lightGallery settings - this.s = $.extend({}, defaults, options); - - // lightGallery modules - this.modules = {}; - - // false when lightgallery complete first slide; - this.lGalleryOn = false; - - this.lgBusy = false; - - // Timeout function for hiding controls; - this.hideBartimeout = false; - - // To determine browser supports for touch events; - this.isTouch = ('ontouchstart' in document.documentElement); - - // DIsable hideControlOnEnd if sildeEndAnimation is true - if (this.s.slideEndAnimatoin) { - this.s.hideControlOnEnd = false; - } - - // Gallery items - if (this.s.dynamic) { - this.$items = this.s.dynamicEl; - } else { - if (this.s.selector === 'this') { - this.$items = this.$el; - } else if (this.s.selector !== '') { - this.$items = this.$el.find($(this.s.selector)); - } else { - this.$items = this.$el.children(); - } - } - - // .lg-item - this.$slide = ''; - - // .lg-outer - this.$outer = ''; - - this.init(); - - return this; - } - - Plugin.prototype.init = function() { - - var _this = this; - - // s.preload should not be more than $item.length - if (_this.s.preload > _this.$items.length) { - _this.s.preload = _this.$items.length; - } - - // if dynamic option is enabled execute immediately - var _hash = window.location.hash; - if (_hash.indexOf('lg=' + this.s.galleryId) > 0) { - - _this.index = parseInt(_hash.split('&slide=')[1], 10); - - $('body').addClass('lg-from-hash'); - if (!$('body').hasClass('lg-on')) { - setTimeout(function() { - _this.build(_this.index); - $('body').addClass('lg-on'); - }); - } - } - - if (_this.s.dynamic) { - - _this.$el.trigger('onBeforeOpen.lg'); - - _this.index = _this.s.index || 0; - - // prevent accidental double execution - if (!$('body').hasClass('lg-on')) { - setTimeout(function() { - _this.build(_this.index); - $('body').addClass('lg-on'); - }); - } - } else { - - // Using different namespace for click because click event should not unbind if selector is same object('this') - _this.$items.on('click.lgcustom', function(event) { - - // For IE8 - try { - event.preventDefault(); - event.preventDefault(); - } catch (er) { - event.returnValue = false; - } - - _this.$el.trigger('onBeforeOpen.lg'); - - _this.index = _this.s.index || _this.$items.index(this); - - // prevent accidental double execution - if (!$('body').hasClass('lg-on')) { - _this.build(_this.index); - $('body').addClass('lg-on'); - } - }); - } - - }; - - Plugin.prototype.build = function(index) { - - var _this = this; - - _this.structure(); - - // module constructor - $.each($.fn.lightGallery.modules, function(key) { - _this.modules[key] = new $.fn.lightGallery.modules[key](_this.el); - }); - - // initiate slide function - _this.slide(index, false, false); - - if (_this.s.keyPress) { - _this.keyPress(); - } - - if (_this.$items.length > 1) { - - _this.arrow(); - - setTimeout(function() { - _this.enableDrag(); - _this.enableSwipe(); - }, 50); - - if (_this.s.mousewheel) { - _this.mousewheel(); - } - } - - _this.counter(); - - _this.closeGallery(); - - // Hide controllers if mouse doesn't move for some period - _this.$outer.on('mousemove.lg click.lg touchstart.lg', function() { - - _this.$outer.removeClass('lg-hide-items'); - - clearTimeout(_this.hideBartimeout); - - // Timeout will be cleared on each slide movement also - _this.hideBartimeout = setTimeout(function() { - _this.$outer.addClass('lg-hide-items'); - }, _this.s.hideBarsDelay); - - }); - - }; - - Plugin.prototype.structure = function() { - var list = ''; - var controls = ''; - var i = 0; - var subHtmlCont = ''; - var template; - var _this = this; - - $('body').append('
    '); - $('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms'); - - // Create gallery items - for (i = 0; i < this.$items.length; i++) { - list += '
    '; - } - - // Create controlls - if (this.s.controls && this.$items.length > 1) { - controls = '
    ' + - '
    ' + this.s.prevHtml + '
    ' + - '
    ' + this.s.nextHtml + '
    ' + - '
    '; - } - - if (this.s.appendSubHtmlTo === '.lg-sub-html') { - subHtmlCont = '
    '; - } - - template = '
    ' + - '
    ' + - '
    ' + list + '
    ' + - '
    ' + - '' + - '
    ' + - controls + - subHtmlCont + - '
    ' + - '
    '; - - $('body').append(template); - this.$outer = $('.lg-outer'); - this.$slide = this.$outer.find('.lg-item'); - - if (this.s.useLeft) { - this.$outer.addClass('lg-use-left'); - } else { - this.$outer.addClass('lg-use-css3'); - } - - // For fixed height gallery - _this.setTop(); - $(window).on('resize.lg orientationchange.lg', function() { - setTimeout(function() { - _this.setTop(); - }, 100); - }); - - // add class lg-current to remove initial transition - this.$slide.eq(this.index).addClass('lg-current'); - - // add Class for css support and transition mode - if (this.doCss()) { - this.$outer.addClass('lg-css3'); - } else { - this.$outer.addClass('lg-css'); - } - - this.$outer.addClass(this.s.mode); - - if (this.s.enableDrag && this.$items.length > 1) { - this.$outer.addClass('lg-grab'); - } - - if (this.s.showAfterLoad) { - this.$outer.addClass('lg-show-after-load'); - } - - if (this.doCss()) { - var $inner = this.$outer.find('.lg-inner'); - $inner.css('transition-timing-function', this.s.cssEasing); - $inner.css('transition-duration', this.s.speed + 'ms'); - } - - $('.lg-backdrop').addClass('in'); - - setTimeout(function() { - _this.$outer.addClass('lg-visible'); - }, this.s.backdropDuration); - - if (this.s.download) { - this.$outer.find('.lg-toolbar').append(''); - } - - }; - - // For fixed height gallery - Plugin.prototype.setTop = function() { - if (this.s.height !== '100%') { - var wH = $(window).height(); - var top = (wH - parseInt(this.s.height, 10)) / 2; - var $lGallery = this.$outer.find('.lg'); - if (wH >= parseInt(this.s.height, 10)) { - $lGallery.css('top', top + 'px'); - } else { - $lGallery.css('top', '0px'); - } - } - }; - - // Find css3 support - Plugin.prototype.doCss = function() { - // check for css animation support - var support = function() { - var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; - var root = document.documentElement; - var i = 0; - for (i = 0; i < transition.length; i++) { - if (transition[i] in root.style) { - return true; - } - } - }; - - if (support()) { - return true; - } - - return false; - }; - - /** - * @desc Check the given src is video - * @param {String} src - * @return {Object} video type - * Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] } - */ - Plugin.prototype.isVideo = function(src, index) { - - var html; - if (this.s.dynamic) { - html = this.s.dynamicEl[index].html; - } else { - html = this.$items.eq(index).attr('data-html'); - } - - if (!src && html) { - return { - html5: true - }; - } - - var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9self\-]+)/i); - var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_this]+)/i); - - // return { youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] } - if (youtube) { - return { - youtube: youtube - }; - } else if (vimeo) { - return { - vimeo: vimeo - }; - } - }; - - /** - * @desc Create image counter - * Ex: 1/10 - */ - Plugin.prototype.counter = function() { - if (this.s.counter) { - $(this.s.appendCounterTo).append('
    ' + (parseInt(this.index, 10) + 1) + ' / ' + this.$items.length + '
    '); - } - }; - - /** - * @desc add sub-html into the slide - * @param {Number} index - index of the slide - */ - Plugin.prototype.addHtml = function(index) { - var subHtml = null; - if (this.s.dynamic) { - subHtml = this.s.dynamicEl[index].subHtml; - } else { - subHtml = this.$items.eq(index).attr('data-sub-html'); - } - - if (typeof subHtml !== 'undefined' && subHtml !== null) { - - // get first letter of subhtml - // if first letter starts with . or # get the html form the jQuery object - var fL = subHtml.substring(0, 1); - if (fL === '.' || fL === '#') { - subHtml = $(subHtml).html(); - } else { - subHtml = subHtml; - } - } else { - subHtml = ''; - } - - if (this.s.appendSubHtmlTo === '.lg-sub-html') { - this.$outer.find(this.s.appendSubHtmlTo).html(subHtml); - - // Add lg-empty-html class if title doesn't exist - if (subHtml === '') { - this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html'); - } else { - this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html'); - } - } else { - this.$slide.eq(index).append(subHtml); - } - - this.$el.trigger('onAfterAppendSubHtml.lg', [index]); - }; - - /** - * @desc Preload slides - * @param {Number} index - index of the slide - */ - Plugin.prototype.preload = function(index) { - var i = 1; - var j = 1; - for (i = 1; i <= this.s.preload; i++) { - if (i >= this.$items.length - index) { - break; - } - - this.loadContent(index + i, false, 0); - } - - for (j = 1; j <= this.s.preload; j++) { - if (index - j < 0) { - break; - } - - this.loadContent(index - j, false, 0); - } - }; - - /** - * @desc Load slide content into slide. - * @param {Number} index - index of the slide. - * @param {Boolean} rec - if true call loadcontent() function again. - * @param {Boolean} delay - delay for adding complete class. it is 0 except first time. - */ - Plugin.prototype.loadContent = function(index, rec, delay) { - - var _this = this; - var _hasPoster = false; - var _$img; - var _src; - var _poster; - var _srcset; - var _sizes; - var _html; - var getResponsiveSrc = function(srcItms) { - var rsWidth = []; - var rsSrc = []; - for (var i = 0; i < srcItms.length; i++) { - var __src = srcItms[i].split(' '); - - // Manage empty space - if (__src[0] === '') { - __src.splice(0, 1); - } - - rsSrc.push(__src[0]); - rsWidth.push(__src[1]); - } - - var wWidth = $(window).width(); - for (var j = 0; j < rsWidth.length; j++) { - if (parseInt(rsWidth[j], 10) > wWidth) { - _src = rsSrc[j]; - break; - } - } - }; - - if (_this.s.dynamic) { - - if (_this.s.dynamicEl[index].poster) { - _hasPoster = true; - _poster = _this.s.dynamicEl[index].poster; - } - - _html = _this.s.dynamicEl[index].html; - _src = _this.s.dynamicEl[index].src; - - if (_this.s.dynamicEl[index].responsive) { - var srcDyItms = _this.s.dynamicEl[index].responsive.split(','); - getResponsiveSrc(srcDyItms); - } - - _srcset = _this.s.dynamicEl[index].srcset; - _sizes = _this.s.dynamicEl[index].sizes; - - } else { - - if (_this.$items.eq(index).attr('data-poster')) { - _hasPoster = true; - _poster = _this.$items.eq(index).attr('data-poster'); - } - - _html = _this.$items.eq(index).attr('data-html'); - _src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'); - - if (_this.$items.eq(index).attr('data-responsive')) { - var srcItms = _this.$items.eq(index).attr('data-responsive').split(','); - getResponsiveSrc(srcItms); - } - - _srcset = _this.$items.eq(index).attr('data-srcset'); - _sizes = _this.$items.eq(index).attr('data-sizes'); - - } - - //if (_src || _srcset || _sizes || _poster) { - - var iframe = false; - if (_this.s.dynamic) { - if (_this.s.dynamicEl[index].iframe) { - iframe = true; - } - } else { - if (_this.$items.eq(index).attr('data-iframe') === 'true') { - iframe = true; - } - } - - var _isVideo = _this.isVideo(_src, index); - if (!_this.$slide.eq(index).hasClass('lg-loaded')) { - if (iframe) { - _this.$slide.eq(index).prepend('
    '); - } else if (_hasPoster) { - var videoClass = ''; - if (_isVideo && _isVideo.youtube) { - videoClass = 'lg-has-youtube'; - } else if (_isVideo && _isVideo.vimeo) { - videoClass = 'lg-has-vimeo'; - } else { - videoClass = 'lg-has-html5'; - } - - _this.$slide.eq(index).prepend('
    '); - - } else if (_isVideo) { - _this.$slide.eq(index).prepend('
    '); - _this.$el.trigger('hasVideo.lg', [index, _src, _html]); - } else { - _this.$slide.eq(index).prepend('
    '); - } - - _this.$el.trigger('onAferAppendSlide.lg', [index]); - - _$img = _this.$slide.eq(index).find('.lg-object'); - if (_sizes) { - _$img.attr('sizes', _sizes); - } - - if (_srcset) { - _$img.attr('srcset', _srcset); - try { - picturefill({ - elements: [_$img[0]] - }); - } catch (e) { - console.error('Make sure you have included Picturefill version 2'); - } - } - - if (this.s.appendSubHtmlTo !== '.lg-sub-html') { - _this.addHtml(index); - } - - _this.$slide.eq(index).addClass('lg-loaded'); - } - - _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { - - // For first time add some delay for displaying the start animation. - var _speed = 0; - - // Do not change the delay value because it is required for zoom plugin. - // If gallery opened from direct url (hash) speed value should be 0 - if (delay && !$('body').hasClass('lg-from-hash')) { - _speed = delay; - } - - setTimeout(function() { - _this.$slide.eq(index).addClass('lg-complete'); - _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]); - }, _speed); - - }); - - // @todo check load state for html5 videos - if (_isVideo && _isVideo.html5 && !_hasPoster) { - _this.$slide.eq(index).addClass('lg-complete'); - } - - if (rec === true) { - if (!_this.$slide.eq(index).hasClass('lg-complete')) { - _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { - _this.preload(index); - }); - } else { - _this.preload(index); - } - } - - //} - }; - - /** - * @desc slide function for lightgallery - ** Slide() gets call on start - ** ** Set lg.on true once slide() function gets called. - ** Call loadContent() on slide() function inside setTimeout - ** ** On first slide we do not want any animation like slide of fade - ** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately - ** ** Else loadContent() should wait for the transition to complete. - ** ** So set timeout s.speed + 50 - <=> ** loadContent() will load slide content in to the particular slide - ** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function. - ** ** preload will execute only when the previous slide is fully loaded (images iframe) - ** ** avoid simultaneous image load - <=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value - ** loadContent() <====> Preload(); - - * @param {Number} index - index of the slide - * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag - * @param {Boolean} fromThumb - true if slide function called via thumbnail click - */ - Plugin.prototype.slide = function(index, fromTouch, fromThumb) { - - var _prevIndex = this.$outer.find('.lg-current').index(); - var _this = this; - - // Prevent if multiple call - // Required for hsh plugin - if (_this.lGalleryOn && (_prevIndex === index)) { - return; - } - - var _length = this.$slide.length; - var _time = _this.lGalleryOn ? this.s.speed : 0; - var _next = false; - var _prev = false; - - if (!_this.lgBusy) { - - this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); - - _this.lgBusy = true; - - clearTimeout(_this.hideBartimeout); - - // Add title if this.s.appendSubHtmlTo === lg-sub-html - if (this.s.appendSubHtmlTo === '.lg-sub-html') { - - // wait for slide animation to complete - setTimeout(function() { - _this.addHtml(index); - }, _time); - } - - this.arrowDisable(index); - - if (!fromTouch) { - - // remove all transitions - _this.$outer.addClass('lg-no-trans'); - - this.$slide.removeClass('lg-prev-slide lg-next-slide'); - - if (index < _prevIndex) { - _prev = true; - if ((index === 0) && (_prevIndex === _length - 1) && !fromThumb) { - _prev = false; - _next = true; - } - } else if (index > _prevIndex) { - _next = true; - if ((index === _length - 1) && (_prevIndex === 0) && !fromThumb) { - _prev = true; - _next = false; - } - } - - if (_prev) { - - //prevslide - this.$slide.eq(index).addClass('lg-prev-slide'); - this.$slide.eq(_prevIndex).addClass('lg-next-slide'); - } else if (_next) { - - // next slide - this.$slide.eq(index).addClass('lg-next-slide'); - this.$slide.eq(_prevIndex).addClass('lg-prev-slide'); - } - - // give 50 ms for browser to add/remove class - setTimeout(function() { - _this.$slide.removeClass('lg-current'); - - //_this.$slide.eq(_prevIndex).removeClass('lg-current'); - _this.$slide.eq(index).addClass('lg-current'); - - // reset all transitions - _this.$outer.removeClass('lg-no-trans'); - }, 50); - } else { - - var touchPrev = index - 1; - var touchNext = index + 1; - - if ((index === 0) && (_prevIndex === _length - 1)) { - - // next slide - touchNext = 0; - touchPrev = _length - 1; - } else if ((index === _length - 1) && (_prevIndex === 0)) { - - // prev slide - touchNext = 0; - touchPrev = _length - 1; - } - - this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); - _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); - _this.$slide.eq(touchNext).addClass('lg-next-slide'); - _this.$slide.eq(index).addClass('lg-current'); - } - - if (_this.lGalleryOn) { - setTimeout(function() { - _this.loadContent(index, true, 0); - }, this.s.speed + 50); - - setTimeout(function() { - _this.lgBusy = false; - _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); - }, this.s.speed); - - // Support non css3 browser - if (!_this.doCss()) { - _this.$slide.fadeOut(_this.s.speed); - _this.$slide.eq(index).fadeIn(_this.s.speed); - } - } else { - _this.loadContent(index, true, _this.s.backdropDuration); - - _this.lgBusy = false; - _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); - - // Support non css3 browser - if (!_this.doCss()) { - _this.$slide.fadeOut(50); - _this.$slide.eq(index).fadeIn(50); - } - } - - if (this.s.download) { - var _src; - if (_this.s.dynamic) { - _src = _this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src; - } else { - _src = _this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'); - - } - - $('#lg-download').attr('href', _src); - } - - _this.lGalleryOn = true; - - if (this.s.counter) { - $('#lg-counter-current').text(index + 1); - } - - } - - }; - - /** - * @desc Go to next slide - * @param {Boolean} fromTouch - true if slide function called via touch event - */ - Plugin.prototype.goToNextSlide = function(fromTouch) { - var _this = this; - if (!_this.lgBusy) { - if ((_this.index + 1) < _this.$slide.length) { - _this.index++; - _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); - _this.slide(_this.index, fromTouch, false); - } else { - if (_this.s.loop) { - _this.index = 0; - _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); - _this.slide(_this.index, fromTouch, false); - } else if (_this.s.slideEndAnimatoin) { - _this.$outer.addClass('lg-right-end'); - setTimeout(function() { - _this.$outer.removeClass('lg-right-end'); - }, 400); - } - } - } - }; - - /** - * @desc Go to previous slide - * @param {Boolean} fromTouch - true if slide function called via touch event - */ - Plugin.prototype.goToPrevSlide = function(fromTouch) { - var _this = this; - if (!_this.lgBusy) { - if (_this.index > 0) { - _this.index--; - _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); - _this.slide(_this.index, fromTouch, false); - } else { - if (_this.s.loop) { - _this.index = _this.$items.length - 1; - _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); - _this.slide(_this.index, fromTouch, false); - } else if (_this.s.slideEndAnimatoin) { - _this.$outer.addClass('lg-left-end'); - setTimeout(function() { - _this.$outer.removeClass('lg-left-end'); - }, 400); - } - } - } - }; - - Plugin.prototype.keyPress = function() { - var _this = this; - if (this.$items.length > 1) { - $(window).on('keyup.lg', function(e) { - if (_this.$items.length > 1) { - if (e.keyCode === 37) { - e.preventDefault(); - _this.goToPrevSlide(); - } - - if (e.keyCode === 39) { - e.preventDefault(); - _this.goToNextSlide(); - } - } - }); - } - - $(window).on('keydown.lg', function(e) { - if (_this.s.escKey === true && e.keyCode === 27 && !_this.$outer.hasClass('lg-thumb-open')) { - e.preventDefault(); - _this.destroy(); - } - }); - }; - - Plugin.prototype.arrow = function() { - var _this = this; - this.$outer.find('.lg-prev').on('click.lg', function() { - _this.goToPrevSlide(); - }); - - this.$outer.find('.lg-next').on('click.lg', function() { - _this.goToNextSlide(); - }); - }; - - Plugin.prototype.arrowDisable = function(index) { - - // Disable arrows if s.hideControlOnEnd is true - if (!this.s.loop && this.s.hideControlOnEnd) { - if ((index + 1) < this.$slide.length) { - this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled'); - } else { - this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled'); - } - - if (index > 0) { - this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled'); - } else { - this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled'); - } - } - }; - - Plugin.prototype.setTranslate = function($el, xValue, yValue) { - // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 - if (this.s.useLeft) { - $el.css('left', xValue); - } else { - $el.css({ - transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)' - }); - } - }; - - Plugin.prototype.touchMove = function(startCoords, endCoords) { - - var distance = endCoords - startCoords; - - // reset opacity and transition duration - this.$outer.addClass('lg-dragging'); - - // move current slide - this.setTranslate(this.$slide.eq(this.index), distance, 0); - - // move next and prev slide with current slide - this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0); - this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0); - }; - - Plugin.prototype.touchEnd = function(distance) { - var _this = this; - - // keep slide animation for any mode while dragg/swipe - if (_this.s.mode !== 'lg-slide') { - _this.$outer.addClass('lg-slide'); - } - - this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0'); - - // set transition duration - setTimeout(function() { - _this.$outer.removeClass('lg-dragging'); - if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { - _this.goToNextSlide(true); - } else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { - _this.goToPrevSlide(true); - } else if (Math.abs(distance) < 5) { - - // Trigger click if distance is less than 5 pix - _this.$el.trigger('onSlideClick.lg'); - } - - _this.$slide.removeAttr('style'); - }); - - // remove slide class once drag/swipe is completed if mode is not slide - setTimeout(function() { - if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') { - _this.$outer.removeClass('lg-slide'); - } - }, _this.s.speed + 100); - - }; - - Plugin.prototype.enableSwipe = function() { - var _this = this; - var startCoords = 0; - var endCoords = 0; - var isMoved = false; - - if (_this.s.enableSwipe && _this.isTouch && _this.doCss()) { - - _this.$slide.on('touchstart.lg', function(e) { - if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) { - e.preventDefault(); - _this.manageSwipeClass(); - startCoords = e.originalEvent.targetTouches[0].pageX; - } - }); - - _this.$slide.on('touchmove.lg', function(e) { - if (!_this.$outer.hasClass('lg-zoomed')) { - e.preventDefault(); - endCoords = e.originalEvent.targetTouches[0].pageX; - _this.touchMove(startCoords, endCoords); - isMoved = true; - } - }); - - _this.$slide.on('touchend.lg', function() { - if (!_this.$outer.hasClass('lg-zoomed')) { - if (isMoved) { - isMoved = false; - _this.touchEnd(endCoords - startCoords); - } else { - _this.$el.trigger('onSlideClick.lg'); - } - } - }); - } - - }; - - Plugin.prototype.enableDrag = function() { - var _this = this; - var startCoords = 0; - var endCoords = 0; - var isDraging = false; - var isMoved = false; - if (_this.s.enableDrag && !_this.isTouch && _this.doCss()) { - _this.$slide.on('mousedown.lg', function(e) { - // execute only on .lg-object - if (!_this.$outer.hasClass('lg-zoomed')) { - if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { - e.preventDefault(); - - if (!_this.lgBusy) { - _this.manageSwipeClass(); - startCoords = e.pageX; - isDraging = true; - - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.$outer.scrollLeft += 1; - _this.$outer.scrollLeft -= 1; - - // * - - _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); - - _this.$el.trigger('onDragstart.lg'); - } - - } - } - }); - - $(window).on('mousemove.lg', function(e) { - if (isDraging) { - isMoved = true; - endCoords = e.pageX; - _this.touchMove(startCoords, endCoords); - _this.$el.trigger('onDragmove.lg'); - } - }); - - $(window).on('mouseup.lg', function(e) { - if (isMoved) { - isMoved = false; - _this.touchEnd(endCoords - startCoords); - _this.$el.trigger('onDragend.lg'); - } else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { - _this.$el.trigger('onSlideClick.lg'); - } - - // Prevent execution on click - if (isDraging) { - isDraging = false; - _this.$outer.removeClass('lg-grabbing').addClass('lg-grab'); - } - }); - - } - }; - - Plugin.prototype.manageSwipeClass = function() { - var touchNext = this.index + 1; - var touchPrev = this.index - 1; - var length = this.$slide.length; - if (this.s.loop) { - if (this.index === 0) { - touchPrev = length - 1; - } else if (this.index === length - 1) { - touchNext = 0; - } - } - - this.$slide.removeClass('lg-next-slide lg-prev-slide'); - if (touchPrev > -1) { - this.$slide.eq(touchPrev).addClass('lg-prev-slide'); - } - - this.$slide.eq(touchNext).addClass('lg-next-slide'); - }; - - Plugin.prototype.mousewheel = function() { - var _this = this; - _this.$outer.on('mousewheel.lg', function(e) { - if (e.deltaY > 0) { - _this.goToPrevSlide(); - } else { - _this.goToNextSlide(); - } - - e.preventDefault(); - }); - - }; - - Plugin.prototype.closeGallery = function() { - - var _this = this; - var mousedown = false; - this.$outer.find('.lg-close').on('click.lg', function() { - _this.destroy(); - }); - - if (_this.s.closable) { - - // If you drag the slide and release outside gallery gets close on chrome - // for preventing this check mousedown and mouseup happened on .lg-item or lg-outer - _this.$outer.on('mousedown.lg', function(e) { - - if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) { - mousedown = true; - } else { - mousedown = false; - } - - }); - - _this.$outer.on('mouseup.lg', function(e) { - - if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) { - if (!_this.$outer.hasClass('lg-dragging')) { - _this.destroy(); - } - } - - }); - - } - - }; - - Plugin.prototype.destroy = function(d) { - - var _this = this; - - _this.$el.trigger('onBeforeClose.lg'); - - /** - * if d is false or undefined destroy will only close the gallery - * plugins instance remains with the element - - * if d is true destroy will completely remove the plugin - */ - - if (d) { - this.$items.off('click.lg click.lgcustom'); - $.removeData(_this.el, 'lightGallery'); - } - - // Unbind all events added by lightGallery - this.$el.off('.lg.tm'); - - // Distroy all lightGallery modules - $.each($.fn.lightGallery.modules, function(key) { - if (_this.modules[key]) { - _this.modules[key].destroy(); - } - }); - - this.lGalleryOn = false; - - clearTimeout(_this.hideBartimeout); - this.hideBartimeout = false; - $(window).off('.lg'); - $('body').removeClass('lg-on lg-from-hash'); - - if (_this.$outer) { - _this.$outer.removeClass('lg-visible'); - } - - $('.lg-backdrop').removeClass('in'); - - setTimeout(function() { - if (_this.$outer) { - _this.$outer.remove(); - } - - $('.lg-backdrop').remove(); - - _this.$el.trigger('onCloseAfter.lg'); - }, _this.s.backdropDuration + 50); - }; - - $.fn.lightGallery = function(options) { - return this.each(function() { - if (!$.data(this, 'lightGallery')) { - $.data(this, 'lightGallery', new Plugin(this, options)); - } else { - try { - $(this).data('lightGallery').init(); - } catch (err) { - console.error('lightGallery has not initiated properly'); - } - } - }); - }; - - $.fn.lightGallery.modules = {}; - -})(jQuery, window, document); - -/** - * Autoplay Plugin - * @version 1.2.0 - * @author Sachin N - @sachinchoolur - * @license MIT License (MIT) - */ - -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - autoplay: false, - pause: 5000, - progressBar: true, - fourceAutoplay: false, - autoplayControls: true, - appendAutoplayControlsTo: '.lg-toolbar' - }; - - /** - * Creates the autoplay plugin. - * @param {object} element - lightGallery element - */ - var Autoplay = function(element) { - - this.core = $(element).data('lightGallery'); - - this.$el = $(element); - - // Exicute only if items are above 1 - if (this.core.$items.length < 2) { - return false; - } - - this.core.s = $.extend({}, defaults, this.core.s); - this.interval = false; - - // Identify if slide happened from autoplay - this.fromAuto = true; - - // Identify if autoplay canceled from touch/drag - this.canceledOnTouch = false; - - // save fourceautoplay value - this.fourceAutoplayTemp = this.core.s.fourceAutoplay; - - // do not allow progress bar if browser does not support css3 transitions - if (!this.core.doCss()) { - this.core.s.progressBar = false; - } - - this.init(); - - return this; - }; - - Autoplay.prototype.init = function() { - var _this = this; - - // append autoplay controls - if (_this.core.s.autoplayControls) { - _this.controls(); - } - - // Create progress bar - if (_this.core.s.progressBar) { - _this.core.$outer.find('.lg').append('
    '); - } - - // set progress - _this.progress(); - - // Start autoplay - if (_this.core.s.autoplay) { - _this.startlAuto(); - } - - // cancel interval on touchstart and dragstart - _this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() { - if (_this.interval) { - _this.cancelAuto(); - _this.canceledOnTouch = true; - } - }); - - // restore autoplay if autoplay canceled from touchstart / dragstart - _this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() { - if (!_this.interval && _this.canceledOnTouch) { - _this.startlAuto(); - _this.canceledOnTouch = false; - } - }); - - }; - - Autoplay.prototype.progress = function() { - - var _this = this; - var _$progressBar; - var _$progress; - - _this.$el.on('onBeforeSlide.lg.tm', function() { - - // start progress bar animation - if (_this.core.s.progressBar && _this.fromAuto) { - _$progressBar = _this.core.$outer.find('.lg-progress-bar'); - _$progress = _this.core.$outer.find('.lg-progress'); - if (_this.interval) { - _$progress.removeAttr('style'); - _$progressBar.removeClass('lg-start'); - setTimeout(function() { - _$progress.css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s'); - _$progressBar.addClass('lg-start'); - }, 20); - } - } - - // Remove setinterval if slide is trigered manualy and fourceautoplay is false - if (!_this.fromAuto && !_this.core.s.fourceAutoplay) { - _this.cancelAuto(); - } - - _this.fromAuto = false; - - }); - }; - - // Manage autoplay via play/stop buttons - Autoplay.prototype.controls = function() { - var _this = this; - var _html = ''; - - // Append autoplay controls - $(this.core.s.appendAutoplayControlsTo).append(_html); - - _this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() { - if ($(_this.core.$outer).hasClass('lg-show-autoplay')) { - _this.cancelAuto(); - _this.core.s.fourceAutoplay = false; - } else { - if (!_this.interval) { - _this.startlAuto(); - _this.core.s.fourceAutoplay = _this.fourceAutoplayTemp; - } - } - }); - }; - - // Autostart gallery - Autoplay.prototype.startlAuto = function() { - var _this = this; - - _this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s'); - _this.core.$outer.addClass('lg-show-autoplay'); - _this.core.$outer.find('.lg-progress-bar').addClass('lg-start'); - - _this.interval = setInterval(function() { - if (_this.core.index + 1 < _this.core.$items.length) { - _this.core.index = _this.core.index; - } else { - _this.core.index = -1; - } - - _this.core.index++; - _this.fromAuto = true; - _this.core.slide(_this.core.index, false, false); - }, _this.core.s.speed + _this.core.s.pause); - }; - - // cancel Autostart - Autoplay.prototype.cancelAuto = function() { - clearInterval(this.interval); - this.interval = false; - this.core.$outer.find('.lg-progress').removeAttr('style'); - this.core.$outer.removeClass('lg-show-autoplay'); - this.core.$outer.find('.lg-progress-bar').removeClass('lg-start'); - }; - - Autoplay.prototype.destroy = function() { - - this.cancelAuto(); - this.core.$outer.find('.lg-progress-bar').remove(); - }; - - $.fn.lightGallery.modules.autoplay = Autoplay; - -})(jQuery, window, document); - -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - fullScreen: true - }; - - var Fullscreen = function(element) { - - // get lightGallery core plugin data - this.core = $(element).data('lightGallery'); - - this.$el = $(element); - - // extend module defalut settings with lightGallery core settings - this.core.s = $.extend({}, defaults, this.core.s); - - this.init(); - - return this; - }; - - Fullscreen.prototype.init = function() { - var fullScreen = ''; - if (this.core.s.fullScreen) { - - // check for fullscreen browser support - if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled && - !document.mozFullScreenEnabled && !document.msFullscreenEnabled) { - return; - } else { - fullScreen = ''; - this.core.$outer.find('.lg-toolbar').append(fullScreen); - this.fullScreen(); - } - } - }; - - Fullscreen.prototype.reuestFullscreen = function() { - var el = document.documentElement; - if (el.requestFullscreen) { - el.requestFullscreen(); - } else if (el.msRequestFullscreen) { - el.msRequestFullscreen(); - } else if (el.mozRequestFullScreen) { - el.mozRequestFullScreen(); - } else if (el.webkitRequestFullscreen) { - el.webkitRequestFullscreen(); - } - }; - - Fullscreen.prototype.exitFullscreen = function() { - if (document.exitFullscreen) { - document.exitFullscreen(); - } else if (document.msExitFullscreen) { - document.msExitFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.webkitExitFullscreen) { - document.webkitExitFullscreen(); - } - }; - - // https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode - Fullscreen.prototype.fullScreen = function() { - var _this = this; - - $(document).on('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg', function() { - _this.core.$outer.toggleClass('lg-fullscreen-on'); - }); - - this.core.$outer.find('.lg-fullscreen').on('click.lg', function() { - if (!document.fullscreenElement && - !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) { - _this.reuestFullscreen(); - } else { - _this.exitFullscreen(); - } - }); - - }; - - Fullscreen.prototype.destroy = function() { - - // exit from fullscreen if activated - this.exitFullscreen(); - - $(document).off('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg'); - }; - - $.fn.lightGallery.modules.fullscreen = Fullscreen; - -})(jQuery, window, document); - -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - pager: false - }; - - var Pager = function(element) { - - this.core = $(element).data('lightGallery'); - - this.$el = $(element); - this.core.s = $.extend({}, defaults, this.core.s); - if (this.core.s.pager && this.core.$items.length > 1) { - this.init(); - } - - return this; - }; - - Pager.prototype.init = function() { - var _this = this; - var pagerList = ''; - var $pagerCont; - var $pagerOuter; - var timeout; - - _this.core.$outer.find('.lg').append('
    '); - - if (_this.core.s.dynamic) { - for (var i = 0; i < _this.core.s.dynamicEl.length; i++) { - pagerList += '
    '; - } - } else { - _this.core.$items.each(function() { - - if (!_this.core.s.exThumbImage) { - pagerList += '
    '; - } else { - pagerList += '
    '; - } - - }); - } - - $pagerOuter = _this.core.$outer.find('.lg-pager-outer'); - - $pagerOuter.html(pagerList); - - $pagerCont = _this.core.$outer.find('.lg-pager-cont'); - $pagerCont.on('click.lg touchend.lg', function() { - var _$this = $(this); - _this.core.index = _$this.index(); - _this.core.slide(_this.core.index, false, false); - }); - - $pagerOuter.on('mouseover.lg', function() { - clearTimeout(timeout); - $pagerOuter.addClass('lg-pager-hover'); - }); - - $pagerOuter.on('mouseout.lg', function() { - timeout = setTimeout(function() { - $pagerOuter.removeClass('lg-pager-hover'); - }); - }); - - _this.core.$el.on('onBeforeSlide.lg.tm', function(e, prevIndex, index) { - $pagerCont.removeClass('lg-pager-active'); - $pagerCont.eq(index).addClass('lg-pager-active'); - }); - - }; - - Pager.prototype.destroy = function() { - - }; - - $.fn.lightGallery.modules.pager = Pager; - -})(jQuery, window, document); - -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - thumbnail: true, - - animateThumb: true, - currentPagerPosition: 'middle', - - thumbWidth: 100, - thumbContHeight: 100, - thumbMargin: 5, - - exThumbImage: false, - showThumbByDefault: true, - toogleThumb: true, - - enableThumbDrag: true, - enableThumbSwipe: true, - swipeThreshold: 50, - - loadYoutubeThumbnail: true, - youtubeThumbSize: 1, - - loadVimeoThumbnail: true, - vimeoThumbSize: 'thumbnail_small' - }; - - var Thumbnail = function(element) { - - // get lightGallery core plugin data - this.core = $(element).data('lightGallery'); - - // extend module default settings with lightGallery core settings - this.core.s = $.extend({}, defaults, this.core.s); - - this.$el = $(element); - this.$thumbOuter = null; - this.thumbOuterWidth = 0; - this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin)); - this.thumbIndex = this.core.index; - - // Thumbnail animation value - this.left = 0; - - this.init(); - - return this; - }; - - Thumbnail.prototype.init = function() { - if (this.core.s.thumbnail && this.core.$items.length > 1) { - if (this.core.s.showThumbByDefault) { - this.core.$outer.addClass('lg-thumb-open'); - } - - this.build(); - if (this.core.s.animateThumb) { - if (this.core.s.enableThumbDrag && !this.core.isTouch && this.core.doCss()) { - this.enableThumbDrag(); - } - - if (this.core.s.enableThumbSwipe && this.core.isTouch && this.core.doCss()) { - this.enableThumbSwipe(); - } - - this.thumbClickable = false; - } else { - this.thumbClickable = true; - } - - this.toogle(); - this.thumbkeyPress(); - } - }; - - Thumbnail.prototype.build = function() { - var _this = this; - var thumbList = ''; - var viemoErrorThumbSize = ''; - var $thumb; - var html = '
    ' + - '
    ' + - '
    ' + - '
    '; - - switch (this.core.s.vimeoThumbSize) { - case 'thumbnail_large': - viemoErrorThumbSize = '640'; - break; - case 'thumbnail_medium': - viemoErrorThumbSize = '200x150'; - break; - case 'thumbnail_small': - viemoErrorThumbSize = '100x75'; - } - - _this.core.$outer.addClass('lg-has-thumb'); - - _this.core.$outer.find('.lg').append(html); - - _this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer'); - _this.thumbOuterWidth = _this.$thumbOuter.width(); - - if (_this.core.s.animateThumb) { - _this.core.$outer.find('.lg-thumb').css({ - width: _this.thumbTotalWidth + 'px', - position: 'relative' - }); - } - - if (this.core.s.animateThumb) { - _this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px'); - } - - function getThumb(src, thumb, index) { - var isVideo = _this.core.isVideo(src, index) || {}; - var thumbImg; - var vimeoId = ''; - - if (isVideo.youtube || isVideo.vimeo) { - if (isVideo.youtube) { - if (_this.core.s.loadYoutubeThumbnail) { - thumbImg = 'http://img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg'; - } else { - thumbImg = thumb; - } - } else if (isVideo.vimeo) { - if (_this.core.s.loadVimeoThumbnail) { - thumbImg = 'https://i.vimeocdn.com/video/error_' + viemoErrorThumbSize + '.jpg'; - vimeoId = isVideo.vimeo[1]; - } else { - thumbImg = thumb; - } - } - } else { - thumbImg = thumb; - } - - thumbList += '
    '; - vimeoId = ''; - } - - if (_this.core.s.dynamic) { - for (var i = 0; i < _this.core.s.dynamicEl.length; i++) { - getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i); - } - } else { - _this.core.$items.each(function(i) { - - if (!_this.core.s.exThumbImage) { - getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i); - } else { - getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i); - } - - }); - } - - _this.core.$outer.find('.lg-thumb').html(thumbList); - - $thumb = _this.core.$outer.find('.lg-thumb-item'); - - // Load vimeo thumbnails - $thumb.each(function() { - var $this = $(this); - var vimeoVideoId = $this.attr('data-vimoe-id'); - - if (vimeoVideoId) { - $.getJSON('http://www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', { - format: 'json' - }, function(data) { - $this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]); - }); - } - }); - - // manage active class for thumbnail - $thumb.eq(_this.core.index).addClass('active'); - _this.core.$el.on('onBeforeSlide.lg.tm', function() { - $thumb.removeClass('active'); - $thumb.eq(_this.core.index).addClass('active'); - }); - - $thumb.on('click.lg touchend.lg', function() { - var _$this = $(this); - setTimeout(function() { - - // In IE9 and bellow touch does not support - // Go to slide if browser does not support css transitions - if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) { - _this.core.index = _$this.index(); - _this.core.slide(_this.core.index, false, true); - } - }, 50); - }); - - _this.core.$el.on('onBeforeSlide.lg.tm', function() { - _this.animateThumb(_this.core.index); - }); - - $(window).on('resize.lg.thumb orientationchange.lg.thumb', function() { - setTimeout(function() { - _this.animateThumb(_this.core.index); - _this.thumbOuterWidth = _this.$thumbOuter.width(); - }, 200); - }); - - }; - - Thumbnail.prototype.setTranslate = function(value) { - // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 - this.core.$outer.find('.lg-thumb').css({ - transform: 'translate3d(-' + (value) + 'px, 0px, 0px)' - }); - }; - - Thumbnail.prototype.animateThumb = function(index) { - var $thumb = this.core.$outer.find('.lg-thumb'); - if (this.core.s.animateThumb) { - var position; - switch (this.core.s.currentPagerPosition) { - case 'left': - position = 0; - break; - case 'middle': - position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2); - break; - case 'right': - position = this.thumbOuterWidth - this.core.s.thumbWidth; - } - this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position; - if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) { - this.left = this.thumbTotalWidth - this.thumbOuterWidth; - } - - if (this.left < 0) { - this.left = 0; - } - - if (this.core.lGalleryOn) { - if (!$thumb.hasClass('on')) { - this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms'); - } - - if (!this.core.doCss()) { - $thumb.animate({ - left: -this.left + 'px' - }, this.core.s.speed); - } - } else { - if (!this.core.doCss()) { - $thumb.css('left', -this.left + 'px'); - } - } - - this.setTranslate(this.left); - - } - }; - - // Enable thumbnail dragging and swiping - Thumbnail.prototype.enableThumbDrag = function() { - - var _this = this; - var startCoords = 0; - var endCoords = 0; - var isDraging = false; - var isMoved = false; - var tempLeft = 0; - - _this.$thumbOuter.addClass('lg-grab'); - - _this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) { - if (_this.thumbTotalWidth > _this.thumbOuterWidth) { - // execute only on .lg-object - e.preventDefault(); - startCoords = e.pageX; - isDraging = true; - - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.core.$outer.scrollLeft += 1; - _this.core.$outer.scrollLeft -= 1; - - // * - _this.thumbClickable = false; - _this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing'); - } - }); - - $(window).on('mousemove.lg.thumb', function(e) { - if (isDraging) { - tempLeft = _this.left; - isMoved = true; - endCoords = e.pageX; - - _this.$thumbOuter.addClass('lg-dragging'); - - tempLeft = tempLeft - (endCoords - startCoords); - - if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) { - tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth; - } - - if (tempLeft < 0) { - tempLeft = 0; - } - - // move current slide - _this.setTranslate(tempLeft); - - } - }); - - $(window).on('mouseup.lg.thumb', function() { - if (isMoved) { - isMoved = false; - _this.$thumbOuter.removeClass('lg-dragging'); - - _this.left = tempLeft; - - if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) { - _this.thumbClickable = true; - } - - } else { - _this.thumbClickable = true; - } - - if (isDraging) { - isDraging = false; - _this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab'); - } - }); - - }; - - Thumbnail.prototype.enableThumbSwipe = function() { - var _this = this; - var startCoords = 0; - var endCoords = 0; - var isMoved = false; - var tempLeft = 0; - - _this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) { - if (_this.thumbTotalWidth > _this.thumbOuterWidth) { - e.preventDefault(); - startCoords = e.originalEvent.targetTouches[0].pageX; - _this.thumbClickable = false; - } - }); - - _this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) { - if (_this.thumbTotalWidth > _this.thumbOuterWidth) { - e.preventDefault(); - endCoords = e.originalEvent.targetTouches[0].pageX; - isMoved = true; - - _this.$thumbOuter.addClass('lg-dragging'); - - tempLeft = _this.left; - - tempLeft = tempLeft - (endCoords - startCoords); - - if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) { - tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth; - } - - if (tempLeft < 0) { - tempLeft = 0; - } - - // move current slide - _this.setTranslate(tempLeft); - - } - }); - - _this.core.$outer.find('.lg-thumb').on('touchend.lg', function() { - if (_this.thumbTotalWidth > _this.thumbOuterWidth) { - - if (isMoved) { - isMoved = false; - _this.$thumbOuter.removeClass('lg-dragging'); - if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) { - _this.thumbClickable = true; - } - - _this.left = tempLeft; - } else { - _this.thumbClickable = true; - } - } else { - _this.thumbClickable = true; - } - }); - - }; - - Thumbnail.prototype.toogle = function() { - var _this = this; - if (_this.core.s.toogleThumb) { - _this.core.$outer.addClass('lg-can-toggle'); - _this.$thumbOuter.append(''); - _this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() { - _this.core.$outer.toggleClass('lg-thumb-open'); - }); - } - }; - - Thumbnail.prototype.thumbkeyPress = function() { - var _this = this; - $(window).on('keydown.lg.thumb', function(e) { - if (e.keyCode === 38) { - e.preventDefault(); - _this.core.$outer.addClass('lg-thumb-open'); - } else if (e.keyCode === 40) { - e.preventDefault(); - _this.core.$outer.removeClass('lg-thumb-open'); - } - }); - }; - - Thumbnail.prototype.destroy = function() { - if (this.core.s.thumbnail && this.core.$items.length > 1) { - $(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb'); - this.$thumbOuter.remove(); - this.core.$outer.removeClass('lg-has-thumb'); - } - }; - - $.fn.lightGallery.modules.Thumbnail = Thumbnail; - -})(jQuery, window, document); - -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - videoMaxWidth: '855px', - youtubePlayerParams: false, - vimeoPlayerParams: false, - videojs: false - }; - - var Video = function(element) { - - this.core = $(element).data('lightGallery'); - - this.$el = $(element); - this.core.s = $.extend({}, defaults, this.core.s); - this.videoLoaded = false; - - this.init(); - - return this; - }; - - Video.prototype.init = function() { - var _this = this; - - // Event triggered when video url found without poster - _this.core.$el.on('hasVideo.lg.tm', function(event, index, src, html) { - _this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html)); - if (html) { - if (_this.core.s.videojs) { - try { - videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), {}, function() { - if (!_this.videoLoaded) { - this.play(); - } - }); - } catch (e) { - console.error('Make sure you have included videojs'); - } - } else { - _this.core.$slide.eq(index).find('.lg-html5').get(0).play(); - } - } - }); - - // Set max width for video - _this.core.$el.on('onAferAppendSlide.lg.tm', function(event, index) { - _this.core.$slide.eq(index).find('.lg-video-cont').css('max-width', _this.core.s.videoMaxWidth); - _this.videoLoaded = true; - }); - - var loadOnClick = function($el) { - // check slide has poster - if ($el.find('.lg-object').hasClass('lg-has-poster')) { - - // chack already video element present - if (!$el.hasClass('lg-has-video')) { - - $el.addClass('lg-video-palying lg-has-video'); - - var _src; - var _html; - var _loadVideo = function(_src, _html) { - - $el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html)); - - if (_html) { - if (_this.core.s.videojs) { - try { - videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), {}, function() { - this.play(); - }); - } catch (e) { - console.error('Make sure you have included videojs'); - } - } else { - _this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play(); - } - } - - }; - - if (_this.core.s.dynamic) { - - _src = _this.core.s.dynamicEl[_this.core.index].src; - _html = _this.core.s.dynamicEl[_this.core.index].html; - - _loadVideo(_src, _html); - - } else { - - _src = _this.core.$items.eq(_this.core.index).attr('data-src'); - _html = _this.core.$items.eq(_this.core.index).attr('data-html'); - - _loadVideo(_src, _html); - - } - - var $tempImg = $el.find('.lg-object'); - $el.find('.lg-video').append($tempImg); - - // @todo loading icon for html5 videos also - // for showing the loading indicator while loading video - if (!$el.find('.lg-video-object').hasClass('lg-html5')) { - $el.removeClass('lg-complete'); - $el.find('.lg-video-object').on('load.lg error.lg', function() { - $el.addClass('lg-complete'); - }); - } - - } else { - - var youtubePlayer = $el.find('.lg-youtube').get(0); - var vimeoPlayer = $el.find('.lg-vimeo').get(0); - var html5Player = $el.find('.lg-html5').get(0); - if (youtubePlayer) { - youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); - } else if (vimeoPlayer) { - try { - $f(vimeoPlayer).api('play'); - } catch (e) { - console.error('Make sure you have included froogaloop2 js'); - } - } else if (html5Player) { - if (_this.core.s.videojs) { - try { - videojs(html5Player).play(); - } catch (e) { - console.error('Make sure you have included videojs'); - } - } else { - html5Player.play(); - } - } - - $el.addClass('lg-video-palying'); - - } - } - }; - - if (_this.core.doCss()) { - _this.core.$el.on('onSlideClick.lg.tm', function() { - var $el = _this.core.$slide.eq(_this.core.index); - loadOnClick($el); - }); - } else { - - // For IE 9 and bellow - _this.core.$slide.on('click.lg', function() { - loadOnClick($(this)); - }); - } - - _this.core.$el.on('onBeforeSlide.lg.tm', function(event, prevIndex) { - - var $videoSlide = _this.core.$slide.eq(prevIndex); - var youtubePlayer = $videoSlide.find('.lg-youtube').get(0); - var vimeoPlayer = $videoSlide.find('.lg-vimeo').get(0); - var html5Player = $videoSlide.find('.lg-html5').get(0); - if (youtubePlayer) { - youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); - } else if (vimeoPlayer) { - try { - $f(vimeoPlayer).api('pause'); - } catch (e) { - console.error('Make sure you have included froogaloop2 js'); - } - } else if (html5Player) { - if (_this.core.s.videojs) { - try { - videojs(html5Player).pause(); - } catch (e) { - console.error('Make sure you have included videojs'); - } - } else { - html5Player.pause(); - } - } - - //$videoSlide.addClass('lg-complete'); - - }); - - _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) { - _this.core.$slide.eq(prevIndex).removeClass('lg-video-palying'); - }); - }; - - Video.prototype.loadVideo = function(src, addClass, noposter, index, html) { - var video = ''; - var autoplay = 1; - var a = ''; - var isVideo = this.core.isVideo(src, index) || {}; - - // Enable autoplay for first video if poster doesn't exist - if (noposter) { - if (this.videoLoaded) { - autoplay = 0; - } else { - autoplay = 1; - } - } - - if (isVideo.youtube) { - - a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1'; - if (this.core.s.youtubePlayerParams) { - a = a + '&' + $.param(this.core.s.youtubePlayerParams); - } - - video = ''; - - } else if (isVideo.vimeo) { - - a = '?autoplay=' + autoplay + '&api=1'; - if (this.core.s.vimeoPlayerParams) { - a = a + '&' + $.param(this.core.s.vimeoPlayerParams); - } - - video = ''; - - } else if (isVideo.html5) { - var fL = html.substring(0, 1); - if (fL === '.' || fL === '#') { - html = $(html).html(); - } - - video = html; - } - - return video; - }; - - Video.prototype.destroy = function() { - this.videoLoaded = false; - }; - - $.fn.lightGallery.modules.video = Video; - -})(jQuery, window, document); - -/** - * Zoom Plugin - * @version 1.2.0 - * @author Sachin N - @sachinchoolur - * @license MIT License (MIT) - */ -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - scale: 1, - zoom: true, - enableZoomAfter: 300 - }; - - var Zoom = function(element) { - - this.core = $(element).data('lightGallery'); - - this.core.s = $.extend({}, defaults, this.core.s); - - if (this.core.s.zoom && this.core.doCss()) { - this.init(); - this.zoomabletimeout = false; - } - - return this; - }; - - Zoom.prototype.init = function() { - - var _this = this; - var zoomIcons = ''; - - this.core.$outer.find('.lg-toolbar').append(zoomIcons); - - // Add zoomable class - _this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) { - - // delay will be 0 except first time - var _speed = _this.core.s.enableZoomAfter + delay; - - // set _speed value 0 if gallery opened from direct url and if it is first slide - if ($('body').hasClass('lg-from-hash') && delay) { - - // will execute only one time - _speed = 0; - } else { - - // Remove lg-from-hash to enable starting animation. - $('body').removeClass('lg-from-hash'); - } - - _this.zoomabletimeout = setTimeout(function() { - _this.core.$slide.eq(index).addClass('lg-zoomable'); - }, _speed + 30); - }); - - var scale = 1; - /** - * @desc Image zoom - * Translate the wrap and scale the image to get better user experience - * - * @param {String} scaleVal - Zoom decrement/increment value - * @param {Boolean} db - true if zoom called via doubleclick - * @todo Currently zoom origin is center it should work from all the directions - */ - var zoom = function(scaleVal, db, pageX, pageY) { - - var $image = _this.core.$outer.find('.lg-current .lg-image'); - var _x; - var _y; - if (db) { - _x = pageX - $image.offset().left; - _y = pageY - $image.offset().top; - } else { - _x = $image.width() / 2; - _y = $image.height() / 2; - } - - var x = (scaleVal - 1) * (_x); - var y = (scaleVal - 1) * (_y); - - $image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal); - - $image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y); - }; - - var callScale = function(db, pageX, pageY) { - if (scale > 1) { - _this.core.$outer.addClass('lg-zoomed'); - } else { - _this.core.$outer.removeClass('lg-zoomed'); - } - - if (scale < 1) { - scale = 1; - } - - zoom(scale, db, pageX, pageY); - }; - - // event triggered after appending slide content - _this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) { - - // Get the current element - var $image = _this.core.$slide.eq(index).find('.lg-image'); - - $image.dblclick(function(event) { - - var w = $image.width(); - var nw = _this.core.$items.eq(index).attr('data-width') || $image[0].naturalWidth || w; - var _scale; - - if (_this.core.$outer.hasClass('lg-zoomed')) { - scale = 1; - } else { - if (nw > w) { - _scale = nw / w; - scale = _scale || 2; - } - } - - callScale(true, event.pageX, event.pageY); - setTimeout(function() { - _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab'); - }, 10); - }); - - }); - - // Update zoom on resize and orientationchange - $(window).on('resize.lg.zoom orientationchange.lg.zoom', function() { - setTimeout(function() { - if (_this.core.$outer.hasClass('lg-zoomed')) { - zoom(scale); - } - }, 10); - }); - - $('#lg-zoom-out').on('click.lg', function() { - if (_this.core.$outer.find('.lg-current .lg-image').length) { - scale -= _this.core.s.scale; - callScale(); - } - }); - - $('#lg-zoom-in').on('click.lg', function() { - if (_this.core.$outer.find('.lg-current .lg-image').length) { - scale += _this.core.s.scale; - callScale(); - } - }); - - // Reset zoom on slide change - _this.core.$el.on('onBeforeSlide.lg.tm', function() { - _this.resetZoom(); - }); - - // Drag option after zoom - if (!_this.core.isTouch) { - _this.zoomDrag(); - } - - if (_this.core.isTouch) { - _this.zoomSwipe(); - } - - }; - - // Reset zoom effect - Zoom.prototype.resetZoom = function() { - this.core.$outer.removeClass('lg-zoomed'); - this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y'); - this.core.$slide.find('.lg-image').removeAttr('style data-scale'); - }; - - Zoom.prototype.zoomSwipe = function() { - var _this = this; - var startCoords = {}; - var endCoords = {}; - var isMoved = false; - - // Allow x direction drag - var allowX = false; - - // Allow Y direction drag - var allowY = false; - - _this.core.$slide.on('touchstart.lg', function(e) { - - if (_this.core.$outer.hasClass('lg-zoomed')) { - var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - - allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); - allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); - if ((allowX || allowY)) { - e.preventDefault(); - startCoords = { - x: e.originalEvent.targetTouches[0].pageX, - y: e.originalEvent.targetTouches[0].pageY - }; - } - } - - }); - - _this.core.$slide.on('touchmove.lg', function(e) { - - if (_this.core.$outer.hasClass('lg-zoomed')) { - - var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); - var distanceX; - var distanceY; - - e.preventDefault(); - isMoved = true; - endCoords = e.originalEvent.targetTouches[0].pageX; - - endCoords = { - x: e.originalEvent.targetTouches[0].pageX, - y: e.originalEvent.targetTouches[0].pageY - }; - - // reset opacity and transition duration - _this.core.$outer.addClass('lg-zoom-dragging'); - - if (allowY) { - distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - } else { - distanceY = -Math.abs(_$el.attr('data-y')); - } - - if (allowX) { - distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); - } else { - distanceX = -Math.abs(_$el.attr('data-x')); - } - - _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); - - } - - }); - - _this.core.$slide.on('touchend.lg', function() { - if (_this.core.$outer.hasClass('lg-zoomed')) { - if (isMoved) { - isMoved = false; - _this.core.$outer.removeClass('lg-zoom-dragging'); - _this.touchendZoom(startCoords, endCoords, allowX, allowY); - - } - } - }); - - }; - - Zoom.prototype.zoomDrag = function() { - - var _this = this; - var startCoords = {}; - var endCoords = {}; - var isDraging = false; - var isMoved = false; - - // Allow x direction drag - var allowX = false; - - // Allow Y direction drag - var allowY = false; - - _this.core.$slide.on('mousedown.lg.zoom', function(e) { - - // execute only on .lg-object - var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - - allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); - allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); - - if (_this.core.$outer.hasClass('lg-zoomed')) { - if ($(e.target).hasClass('lg-object') && (allowX || allowY)) { - e.preventDefault(); - startCoords = { - x: e.pageX, - y: e.pageY - }; - - isDraging = true; - - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.core.$outer.scrollLeft += 1; - _this.core.$outer.scrollLeft -= 1; - - _this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing'); - } - } - }); - - $(window).on('mousemove.lg.zoom', function(e) { - if (isDraging) { - var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); - var distanceX; - var distanceY; - - isMoved = true; - endCoords = { - x: e.pageX, - y: e.pageY - }; - - // reset opacity and transition duration - _this.core.$outer.addClass('lg-zoom-dragging'); - - if (allowY) { - distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - } else { - distanceY = -Math.abs(_$el.attr('data-y')); - } - - if (allowX) { - distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); - } else { - distanceX = -Math.abs(_$el.attr('data-x')); - } - - _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); - } - }); - - $(window).on('mouseup.lg.zoom', function(e) { - - if (isDraging) { - isDraging = false; - _this.core.$outer.removeClass('lg-zoom-dragging'); - - // Fix for chrome mouse move on click - if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) { - endCoords = { - x: e.pageX, - y: e.pageY - }; - _this.touchendZoom(startCoords, endCoords, allowX, allowY); - - } - - isMoved = false; - } - - _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab'); - - }); - }; - - Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) { - - var _this = this; - var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); - var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); - var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - var minY = (_this.core.$outer.find('.lg').height() - $image.outerHeight()) / 2; - var maxY = Math.abs(($image.outerHeight() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY); - var minX = (_this.core.$outer.find('.lg').width() - $image.outerWidth()) / 2; - var maxX = Math.abs(($image.outerWidth() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX); - - if (allowY) { - if (distanceY <= -maxY) { - distanceY = -maxY; - } else if (distanceY >= -minY) { - distanceY = -minY; - } - } - - if (allowX) { - if (distanceX <= -maxX) { - distanceX = -maxX; - } else if (distanceX >= -minX) { - distanceX = -minX; - } - } - - if (allowY) { - _$el.attr('data-y', Math.abs(distanceY)); - } else { - distanceY = -Math.abs(_$el.attr('data-y')); - } - - if (allowX) { - _$el.attr('data-x', Math.abs(distanceX)); - } else { - distanceX = -Math.abs(_$el.attr('data-x')); - } - - _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); - }; - - Zoom.prototype.destroy = function() { - - var _this = this; - - // Unbind all events added by lightGallery zoom plugin - _this.core.$el.off('.lg.zoom'); - $(window).off('.lg.zoom'); - _this.core.$slide.off('.lg.zoom'); - _this.core.$el.off('.lg.tm.zoom'); - _this.resetZoom(); - clearTimeout(_this.zoomabletimeout); - _this.zoomabletimeout = false; - }; - - $.fn.lightGallery.modules.zoom = Zoom; - -})(jQuery, window, document); - -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - hash: true - }; - - var Hash = function(element) { - - this.core = $(element).data('lightGallery'); - - this.core.s = $.extend({}, defaults, this.core.s); - - if (this.core.s.hash) { - this.oldHash = window.location.hash; - this.init(); - } - - return this; - }; - - Hash.prototype.init = function() { - var _this = this; - var _hash; - - // Change hash value on after each slide transition - _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) { - window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index; - }); - - // Listen hash change and change the slide according to slide value - $(window).on('hashchange', function() { - _hash = window.location.hash; - var _idx = parseInt(_hash.split('&slide=')[1], 10); - - // it galleryId doesn't exist in the url close the gallery - if ((_hash.indexOf('lg=' + _this.core.s.galleryId) > -1)) { - _this.core.slide(_idx); - } else if (_this.core.lGalleryOn) { - _this.core.destroy(); - } - - }); - }; - - Hash.prototype.destroy = function() { - - // Reset to old hash value - if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) { - window.location.hash = this.oldHash; - } else { - if (history.pushState) { - history.pushState('', document.title, window.location.pathname + window.location.search); - } else { - window.location.hash = ''; - } - } - - }; - - $.fn.lightGallery.modules.hash = Hash; - -})(jQuery, window, document); diff --git a/vendors/lightGallery/dist/js/lightgallery-all.min.js b/vendors/lightGallery/dist/js/lightgallery-all.min.js deleted file mode 100644 index 45913ecd5..000000000 --- a/vendors/lightGallery/dist/js/lightgallery-all.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! lightgallery - v1.2.0 - 2015-08-26 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2015 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";function e(b,d){return this.el=b,this.$el=a(b),this.s=a.extend({},f,d),this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in c.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var f={mode:"lg-slide",cssEasing:"cubic-bezier(0.25, 0, 0.25, 1)",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,appendSubHtmlTo:".lg-sub-html",preload:1,showAfterLoad:!0,selector:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};e.prototype.init=function(){var c=this;c.s.preload>c.$items.length&&(c.s.preload=c.$items.length);var d=b.location.hash;d.indexOf("lg="+this.s.galleryId)>0&&(c.index=parseInt(d.split("&slide=")[1],10),a("body").addClass("lg-from-hash"),a("body").hasClass("lg-on")||setTimeout(function(){c.build(c.index),a("body").addClass("lg-on")})),c.s.dynamic?(c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||0,a("body").hasClass("lg-on")||setTimeout(function(){c.build(c.index),a("body").addClass("lg-on")})):c.$items.on("click.lgcustom",function(b){try{b.preventDefault(),b.preventDefault()}catch(d){b.returnValue=!1}c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||c.$items.index(this),a("body").hasClass("lg-on")||(c.build(c.index),a("body").addClass("lg-on"))})},e.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightGallery.modules,function(b){c.modules[b]=new a.fn.lightGallery.modules[b](c.el)}),c.slide(b,!1,!1),c.s.keyPress&&c.keyPress(),c.$items.length>1&&(c.arrow(),setTimeout(function(){c.enableDrag(),c.enableSwipe()},50),c.s.mousewheel&&c.mousewheel()),c.counter(),c.closeGallery(),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeClass("lg-hide-items"),clearTimeout(c.hideBartimeout),c.hideBartimeout=setTimeout(function(){c.$outer.addClass("lg-hide-items")},c.s.hideBarsDelay)})},e.prototype.structure=function(){var c,d="",e="",f=0,g="",h=this;for(a("body").append('
    '),a(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),f=0;f';if(this.s.controls&&this.$items.length>1&&(e='
    '+this.s.prevHtml+'
    '+this.s.nextHtml+"
    "),".lg-sub-html"===this.s.appendSubHtmlTo&&(g='
    '),c='
    '+d+'
    '+e+g+"
    ",a("body").append(c),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?this.$outer.addClass("lg-use-left"):this.$outer.addClass("lg-use-css3"),h.setTop(),a(b).on("resize.lg orientationchange.lg",function(){setTimeout(function(){h.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):this.$outer.addClass("lg-css"),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var i=this.$outer.find(".lg-inner");i.css("transition-timing-function",this.s.cssEasing),i.css("transition-duration",this.s.speed+"ms")}a(".lg-backdrop").addClass("in"),setTimeout(function(){h.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append('')},e.prototype.setTop=function(){if("100%"!==this.s.height){var c=a(b).height(),d=(c-parseInt(this.s.height,10))/2,e=this.$outer.find(".lg");c>=parseInt(this.s.height,10)?e.css("top",d+"px"):e.css("top","0px")}},e.prototype.doCss=function(){var a=function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=c.documentElement,d=0;for(d=0;d'+(parseInt(this.index,10)+1)+' / '+this.$items.length+"")},e.prototype.addHtml=function(b){var c=null;if(c=this.s.dynamic?this.s.dynamicEl[b].subHtml:this.$items.eq(b).attr("data-sub-html"),"undefined"!=typeof c&&null!==c){var d=c.substring(0,1);c="."===d||"#"===d?a(c).html():c}else c="";".lg-sub-html"===this.s.appendSubHtmlTo?(this.$outer.find(this.s.appendSubHtmlTo).html(c),""===c?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")):this.$slide.eq(b).append(c),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},e.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(0>a-c);c++)this.loadContent(a-c,!1,0)},e.prototype.loadContent=function(c,d,e){var f,g,h,i,j,k,l=this,m=!1,n=function(c){for(var d=[],e=[],f=0;fi){g=e[j];break}};if(l.s.dynamic){if(l.s.dynamicEl[c].poster&&(m=!0,h=l.s.dynamicEl[c].poster),k=l.s.dynamicEl[c].html,g=l.s.dynamicEl[c].src,l.s.dynamicEl[c].responsive){var o=l.s.dynamicEl[c].responsive.split(",");n(o)}i=l.s.dynamicEl[c].srcset,j=l.s.dynamicEl[c].sizes}else{if(l.$items.eq(c).attr("data-poster")&&(m=!0,h=l.$items.eq(c).attr("data-poster")),k=l.$items.eq(c).attr("data-html"),g=l.$items.eq(c).attr("href")||l.$items.eq(c).attr("data-src"),l.$items.eq(c).attr("data-responsive")){var p=l.$items.eq(c).attr("data-responsive").split(",");n(p)}i=l.$items.eq(c).attr("data-srcset"),j=l.$items.eq(c).attr("data-sizes")}var q=!1;l.s.dynamic?l.s.dynamicEl[c].iframe&&(q=!0):"true"===l.$items.eq(c).attr("data-iframe")&&(q=!0);var r=l.isVideo(g,c);if(!l.$slide.eq(c).hasClass("lg-loaded")){if(q)l.$slide.eq(c).prepend('
    ');else if(m){var s="";s=r&&r.youtube?"lg-has-youtube":r&&r.vimeo?"lg-has-vimeo":"lg-has-html5",l.$slide.eq(c).prepend('
    ')}else r?(l.$slide.eq(c).prepend('
    '),l.$el.trigger("hasVideo.lg",[c,g,k])):l.$slide.eq(c).prepend('
    ');if(l.$el.trigger("onAferAppendSlide.lg",[c]),f=l.$slide.eq(c).find(".lg-object"),j&&f.attr("sizes",j),i){f.attr("srcset",i);try{picturefill({elements:[f[0]]})}catch(t){console.error("Make sure you have included Picturefill version 2")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&l.addHtml(c),l.$slide.eq(c).addClass("lg-loaded")}l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){var b=0;e&&!a("body").hasClass("lg-from-hash")&&(b=e),setTimeout(function(){l.$slide.eq(c).addClass("lg-complete"),l.$el.trigger("onSlideItemLoad.lg",[c,e||0])},b)}),r&&r.html5&&!m&&l.$slide.eq(c).addClass("lg-complete"),d===!0&&(l.$slide.eq(c).hasClass("lg-complete")?l.preload(c):l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){l.preload(c)}))},e.prototype.slide=function(b,c,d){var e=this.$outer.find(".lg-current").index(),f=this;if(!f.lGalleryOn||e!==b){var g=this.$slide.length,h=f.lGalleryOn?this.s.speed:0,i=!1,j=!1;if(!f.lgBusy){if(this.$el.trigger("onBeforeSlide.lg",[e,b,c,d]),f.lgBusy=!0,clearTimeout(f.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){f.addHtml(b)},h),this.arrowDisable(b),c){var k=b-1,l=b+1;0===b&&e===g-1?(l=0,k=g-1):b===g-1&&0===e&&(l=0,k=g-1),this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide"),f.$slide.eq(k).addClass("lg-prev-slide"),f.$slide.eq(l).addClass("lg-next-slide"),f.$slide.eq(b).addClass("lg-current")}else f.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),e>b?(j=!0,0!==b||e!==g-1||d||(j=!1,i=!0)):b>e&&(i=!0,b!==g-1||0!==e||d||(j=!0,i=!1)),j?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(e).addClass("lg-next-slide")):i&&(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(e).addClass("lg-prev-slide")),setTimeout(function(){f.$slide.removeClass("lg-current"),f.$slide.eq(b).addClass("lg-current"),f.$outer.removeClass("lg-no-trans")},50);if(f.lGalleryOn?(setTimeout(function(){f.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])},this.s.speed),f.doCss()||(f.$slide.fadeOut(f.s.speed),f.$slide.eq(b).fadeIn(f.s.speed))):(f.loadContent(b,!0,f.s.backdropDuration),f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d]),f.doCss()||(f.$slide.fadeOut(50),f.$slide.eq(b).fadeIn(50))),this.s.download){var m;m=f.s.dynamic?f.s.dynamicEl[b].downloadUrl||f.s.dynamicEl[b].src:f.$items.eq(b).attr("data-download-url")||f.$items.eq(b).attr("href")||f.$items.eq(b).attr("data-src"),a("#lg-download").attr("href",m)}f.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}}},e.prototype.goToNextSlide=function(a){var b=this;b.lgBusy||(b.index+10?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.loop?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.slideEndAnimatoin&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},e.prototype.keyPress=function(){var c=this;this.$items.length>1&&a(b).on("keyup.lg",function(a){c.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),c.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),c.goToNextSlide()))}),a(b).on("keydown.lg",function(a){c.s.escKey!==!0||27!==a.keyCode||c.$outer.hasClass("lg-thumb-open")||(a.preventDefault(),c.destroy())})},e.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},e.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+10?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},e.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},e.prototype.touchMove=function(b,c){var d=c-b;this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0)},e.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),0>a&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},e.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.isTouch&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},e.prototype.enableDrag=function(){var c=this,d=0,e=0,f=!1,g=!1;c.s.enableDrag&&!c.isTouch&&c.doCss()&&(c.$slide.on("mousedown.lg",function(b){c.$outer.hasClass("lg-zoomed")||(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&(b.preventDefault(),c.lgBusy||(c.manageSwipeClass(),d=b.pageX,f=!0,c.$outer.scrollLeft+=1,c.$outer.scrollLeft-=1,c.$outer.removeClass("lg-grab").addClass("lg-grabbing"),c.$el.trigger("onDragstart.lg")))}),a(b).on("mousemove.lg",function(a){f&&(g=!0,e=a.pageX,c.touchMove(d,e),c.$el.trigger("onDragmove.lg"))}),a(b).on("mouseup.lg",function(b){g?(g=!1,c.touchEnd(e-d),c.$el.trigger("onDragend.lg")):(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&c.$el.trigger("onSlideClick.lg"),f&&(f=!1,c.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},e.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1,c=this.$slide.length;this.s.loop&&(0===this.index?b=c-1:this.index===c-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},e.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault()})},e.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap")?!0:!1}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},e.prototype.destroy=function(c){var d=this;d.$el.trigger("onBeforeClose.lg"),c&&(this.$items.off("click.lg click.lgcustom"),a.removeData(d.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){d.modules[a]&&d.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(d.hideBartimeout),this.hideBartimeout=!1,a(b).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),d.$outer&&d.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){d.$outer&&d.$outer.remove(),a(".lg-backdrop").remove(),d.$el.trigger("onCloseAfter.lg")},d.s.backdropDuration+50)},a.fn.lightGallery=function(b){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(c){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new e(this,b))})},a.fn.lightGallery.modules={}}(jQuery,window,document),function(a,b,c,d){"use strict";var e={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.$items.length<2?!1:(this.core.s=a.extend({},e,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)};f.prototype.init=function(){var a=this;a.core.s.autoplayControls&&a.controls(),a.core.s.progressBar&&a.core.$outer.find(".lg").append('
    '),a.progress(),a.core.s.autoplay&&a.startlAuto(),a.$el.on("onDragstart.lg.tm touchstart.lg.tm",function(){a.interval&&(a.cancelAuto(),a.canceledOnTouch=!0)}),a.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",function(){!a.interval&&a.canceledOnTouch&&(a.startlAuto(),a.canceledOnTouch=!1)})},f.prototype.progress=function(){var a,b,c=this;c.$el.on("onBeforeSlide.lg.tm",function(){c.core.s.progressBar&&c.fromAuto&&(a=c.core.$outer.find(".lg-progress-bar"),b=c.core.$outer.find(".lg-progress"),c.interval&&(b.removeAttr("style"),a.removeClass("lg-start"),setTimeout(function(){b.css("transition","width "+(c.core.s.speed+c.core.s.pause)+"ms ease 0s"),a.addClass("lg-start")},20))),c.fromAuto||c.core.s.fourceAutoplay||c.cancelAuto(),c.fromAuto=!1})},f.prototype.controls=function(){var b=this,c='';a(this.core.s.appendAutoplayControlsTo).append(c),b.core.$outer.find(".lg-autoplay-button").on("click.lg",function(){a(b.core.$outer).hasClass("lg-show-autoplay")?(b.cancelAuto(),b.core.s.fourceAutoplay=!1):b.interval||(b.startlAuto(),b.core.s.fourceAutoplay=b.fourceAutoplayTemp)})},f.prototype.startlAuto=function(){var a=this;a.core.$outer.find(".lg-progress").css("transition","width "+(a.core.s.speed+a.core.s.pause)+"ms ease 0s"),a.core.$outer.addClass("lg-show-autoplay"),a.core.$outer.find(".lg-progress-bar").addClass("lg-start"),a.interval=setInterval(function(){a.core.index+11&&this.init(),this};f.prototype.init=function(){var b,c,d,e=this,f="";if(e.core.$outer.find(".lg").append('
    '),e.core.s.dynamic)for(var g=0;g
    ';else e.core.$items.each(function(){f+=e.core.s.exThumbImage?'
    ':'
    '});c=e.core.$outer.find(".lg-pager-outer"),c.html(f),b=e.core.$outer.find(".lg-pager-cont"),b.on("click.lg touchend.lg",function(){var b=a(this);e.core.index=b.index(),e.core.slide(e.core.index,!1,!1)}),c.on("mouseover.lg",function(){clearTimeout(d),c.addClass("lg-pager-hover")}),c.on("mouseout.lg",function(){d=setTimeout(function(){c.removeClass("lg-pager-hover")})}),e.core.$el.on("onBeforeSlide.lg.tm",function(a,c,d){b.removeClass("lg-pager-active"),b.eq(d).addClass("lg-pager-active")})},f.prototype.destroy=function(){},a.fn.lightGallery.modules.pager=f}(jQuery,window,document),function(a,b,c,d){"use strict";var e={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",thumbWidth:100,thumbContHeight:100,thumbMargin:5,exThumbImage:!1,showThumbByDefault:!0,toogleThumb:!0,enableThumbDrag:!0,enableThumbSwipe:!0,swipeThreshold:50,loadYoutubeThumbnail:!0,youtubeThumbSize:1,loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_small"},f=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.$el=a(b),this.$thumbOuter=null,this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.$items.length*(this.core.s.thumbWidth+this.core.s.thumbMargin),this.thumbIndex=this.core.index,this.left=0,this.init(),this};f.prototype.init=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(this.core.s.showThumbByDefault&&this.core.$outer.addClass("lg-thumb-open"),this.build(),this.core.s.animateThumb?(this.core.s.enableThumbDrag&&!this.core.isTouch&&this.core.doCss()&&this.enableThumbDrag(),this.core.s.enableThumbSwipe&&this.core.isTouch&&this.core.doCss()&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toogle(),this.thumbkeyPress())},f.prototype.build=function(){function c(a,b,c){var d,h=e.core.isVideo(a,c)||{},i="";h.youtube||h.vimeo?h.youtube?d=e.core.s.loadYoutubeThumbnail?"http://img.youtube.com/vi/"+h.youtube[1]+"/"+e.core.s.youtubeThumbSize+".jpg":b:h.vimeo&&(e.core.s.loadVimeoThumbnail?(d="https://i.vimeocdn.com/video/error_"+g+".jpg",i=h.vimeo[1]):d=b):d=b,f+='
    ',i=""}var d,e=this,f="",g="",h='
    ';switch(this.core.s.vimeoThumbSize){case"thumbnail_large":g="640";break;case"thumbnail_medium":g="200x150";break;case"thumbnail_small":g="100x75"}if(e.core.$outer.addClass("lg-has-thumb"),e.core.$outer.find(".lg").append(h),e.$thumbOuter=e.core.$outer.find(".lg-thumb-outer"),e.thumbOuterWidth=e.$thumbOuter.width(),e.core.s.animateThumb&&e.core.$outer.find(".lg-thumb").css({width:e.thumbTotalWidth+"px",position:"relative"}),this.core.s.animateThumb&&e.$thumbOuter.css("height",e.core.s.thumbContHeight+"px"),e.core.s.dynamic)for(var i=0;ithis.thumbTotalWidth-this.thumbOuterWidth&&(this.left=this.thumbTotalWidth-this.thumbOuterWidth),this.left<0&&(this.left=0),this.core.lGalleryOn?(b.hasClass("on")||this.core.$outer.find(".lg-thumb").css("transition-duration",this.core.s.speed+"ms"),this.core.doCss()||b.animate({left:-this.left+"px"},this.core.s.speed)):this.core.doCss()||b.css("left",-this.left+"px"),this.setTranslate(this.left)}},f.prototype.enableThumbDrag=function(){var c=this,d=0,e=0,f=!1,g=!1,h=0;c.$thumbOuter.addClass("lg-grab"),c.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb",function(a){c.thumbTotalWidth>c.thumbOuterWidth&&(a.preventDefault(),d=a.pageX,f=!0,c.core.$outer.scrollLeft+=1,c.core.$outer.scrollLeft-=1,c.thumbClickable=!1,c.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),a(b).on("mousemove.lg.thumb",function(a){f&&(h=c.left,g=!0,e=a.pageX,c.$thumbOuter.addClass("lg-dragging"),h-=e-d,h>c.thumbTotalWidth-c.thumbOuterWidth&&(h=c.thumbTotalWidth-c.thumbOuterWidth),0>h&&(h=0),c.setTranslate(h))}),a(b).on("mouseup.lg.thumb",function(){g?(g=!1,c.$thumbOuter.removeClass("lg-dragging"),c.left=h,Math.abs(e-d)a.thumbOuterWidth&&(c.preventDefault(),b=c.originalEvent.targetTouches[0].pageX,a.thumbClickable=!1)}),a.core.$outer.find(".lg-thumb").on("touchmove.lg",function(f){a.thumbTotalWidth>a.thumbOuterWidth&&(f.preventDefault(),c=f.originalEvent.targetTouches[0].pageX,d=!0,a.$thumbOuter.addClass("lg-dragging"),e=a.left,e-=c-b,e>a.thumbTotalWidth-a.thumbOuterWidth&&(e=a.thumbTotalWidth-a.thumbOuterWidth),0>e&&(e=0),a.setTranslate(e))}),a.core.$outer.find(".lg-thumb").on("touchend.lg",function(){a.thumbTotalWidth>a.thumbOuterWidth&&d?(d=!1,a.$thumbOuter.removeClass("lg-dragging"),Math.abs(c-b)'),a.core.$outer.find(".lg-toogle-thumb").on("click.lg",function(){a.core.$outer.toggleClass("lg-thumb-open")}))},f.prototype.thumbkeyPress=function(){var c=this;a(b).on("keydown.lg.thumb",function(a){38===a.keyCode?(a.preventDefault(),c.core.$outer.addClass("lg-thumb-open")):40===a.keyCode&&(a.preventDefault(),c.core.$outer.removeClass("lg-thumb-open"))})},f.prototype.destroy=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(a(b).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"),this.$thumbOuter.remove(),this.core.$outer.removeClass("lg-has-thumb"))},a.fn.lightGallery.modules.Thumbnail=f}(jQuery,window,document),function(a,b,c,d){"use strict";var e={videoMaxWidth:"855px",youtubePlayerParams:!1,vimeoPlayerParams:!1,videojs:!1},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.videoLoaded=!1,this.init(),this};f.prototype.init=function(){var b=this;b.core.$el.on("hasVideo.lg.tm",function(a,c,d,e){if(b.core.$slide.eq(c).find(".lg-video").append(b.loadVideo(d,"lg-object",!0,c,e)),e)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(c).find(".lg-html5").get(0),{},function(){b.videoLoaded||this.play()})}catch(f){console.error("Make sure you have included videojs")}else b.core.$slide.eq(c).find(".lg-html5").get(0).play()}),b.core.$el.on("onAferAppendSlide.lg.tm",function(a,c){b.core.$slide.eq(c).find(".lg-video-cont").css("max-width",b.core.s.videoMaxWidth),b.videoLoaded=!0});var c=function(a){if(a.find(".lg-object").hasClass("lg-has-poster"))if(a.hasClass("lg-has-video")){var c=a.find(".lg-youtube").get(0),d=a.find(".lg-vimeo").get(0),e=a.find(".lg-html5").get(0);if(c)c.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*");else if(d)try{$f(d).api("play")}catch(f){console.error("Make sure you have included froogaloop2 js")}else if(e)if(b.core.s.videojs)try{videojs(e).play()}catch(f){console.error("Make sure you have included videojs")}else e.play();a.addClass("lg-video-palying")}else{a.addClass("lg-video-palying lg-has-video");var g,h,i=function(c,d){if(a.find(".lg-video").append(b.loadVideo(c,"",!1,b.core.index,d)),d)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(b.core.index).find(".lg-html5").get(0),{},function(){this.play()})}catch(e){console.error("Make sure you have included videojs")}else b.core.$slide.eq(b.core.index).find(".lg-html5").get(0).play()};b.core.s.dynamic?(g=b.core.s.dynamicEl[b.core.index].src,h=b.core.s.dynamicEl[b.core.index].html,i(g,h)):(g=b.core.$items.eq(b.core.index).attr("data-src"),h=b.core.$items.eq(b.core.index).attr("data-html"),i(g,h));var j=a.find(".lg-object");a.find(".lg-video").append(j),a.find(".lg-video-object").hasClass("lg-html5")||(a.removeClass("lg-complete"),a.find(".lg-video-object").on("load.lg error.lg",function(){a.addClass("lg-complete")}))}};b.core.doCss()?b.core.$el.on("onSlideClick.lg.tm",function(){var a=b.core.$slide.eq(b.core.index);c(a)}):b.core.$slide.on("click.lg",function(){c(a(this))}),b.core.$el.on("onBeforeSlide.lg.tm",function(a,c){var d=b.core.$slide.eq(c),e=d.find(".lg-youtube").get(0),f=d.find(".lg-vimeo").get(0),g=d.find(".lg-html5").get(0);if(e)e.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*");else if(f)try{$f(f).api("pause")}catch(h){console.error("Make sure you have included froogaloop2 js")}else if(g)if(b.core.s.videojs)try{videojs(g).pause()}catch(h){console.error("Make sure you have included videojs")}else g.pause()}),b.core.$el.on("onAfterSlide.lg.tm",function(a,c){b.core.$slide.eq(c).removeClass("lg-video-palying")})},f.prototype.loadVideo=function(b,c,d,e,f){ -var g="",h=1,i="",j=this.core.isVideo(b,e)||{};if(d&&(h=this.videoLoaded?0:1),j.youtube)i="?wmode=opaque&autoplay="+h+"&enablejsapi=1",this.core.s.youtubePlayerParams&&(i=i+"&"+a.param(this.core.s.youtubePlayerParams)),g='';else if(j.vimeo)i="?autoplay="+h+"&api=1",this.core.s.vimeoPlayerParams&&(i=i+"&"+a.param(this.core.s.vimeoPlayerParams)),g='';else if(j.html5){var k=f.substring(0,1);("."===k||"#"===k)&&(f=a(f).html()),g=f}return g},f.prototype.destroy=function(){this.videoLoaded=!1},a.fn.lightGallery.modules.video=f}(jQuery,window,document),function(a,b,c,d){"use strict";var e={scale:1,zoom:!0,enableZoomAfter:300},f=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.core.s.zoom&&this.core.doCss()&&(this.init(),this.zoomabletimeout=!1),this};f.prototype.init=function(){var c=this,d='';this.core.$outer.find(".lg-toolbar").append(d),c.core.$el.on("onSlideItemLoad.lg.tm.zoom",function(b,d,e){var f=c.core.s.enableZoomAfter+e;a("body").hasClass("lg-from-hash")&&e?f=0:a("body").removeClass("lg-from-hash"),c.zoomabletimeout=setTimeout(function(){c.core.$slide.eq(d).addClass("lg-zoomable")},f+30)});var e=1,f=function(a,b,d,e){var f,g,h=c.core.$outer.find(".lg-current .lg-image");b?(f=d-h.offset().left,g=e-h.offset().top):(f=h.width()/2,g=h.height()/2);var i=(a-1)*f,j=(a-1)*g;h.css("transform","scale3d("+a+", "+a+", 1)").attr("data-scale",a),h.parent().css("transform","translate3d(-"+i+"px, -"+j+"px, 0)").attr("data-x",i).attr("data-y",j)},g=function(a,b,d){e>1?c.core.$outer.addClass("lg-zoomed"):c.core.$outer.removeClass("lg-zoomed"),1>e&&(e=1),f(e,a,b,d)};c.core.$el.on("onAferAppendSlide.lg.tm.zoom",function(a,b){var d=c.core.$slide.eq(b).find(".lg-image");d.dblclick(function(a){var f,h=d.width(),i=c.core.$items.eq(b).attr("data-width")||d[0].naturalWidth||h;c.core.$outer.hasClass("lg-zoomed")?e=1:i>h&&(f=i/h,e=f||2),g(!0,a.pageX,a.pageY),setTimeout(function(){c.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")},10)})}),a(b).on("resize.lg.zoom orientationchange.lg.zoom",function(){setTimeout(function(){c.core.$outer.hasClass("lg-zoomed")&&f(e)},10)}),a("#lg-zoom-out").on("click.lg",function(){c.core.$outer.find(".lg-current .lg-image").length&&(e-=c.core.s.scale,g())}),a("#lg-zoom-in").on("click.lg",function(){c.core.$outer.find(".lg-current .lg-image").length&&(e+=c.core.s.scale,g())}),c.core.$el.on("onBeforeSlide.lg.tm",function(){c.resetZoom()}),c.core.isTouch||c.zoomDrag(),c.core.isTouch&&c.zoomSwipe()},f.prototype.resetZoom=function(){this.core.$outer.removeClass("lg-zoomed"),this.core.$slide.find(".lg-img-wrap").removeAttr("style data-x data-y"),this.core.$slide.find(".lg-image").removeAttr("style data-scale")},f.prototype.zoomSwipe=function(){var a=this,b={},c={},d=!1,e=!1,f=!1;a.core.$slide.on("touchstart.lg",function(c){if(a.core.$outer.hasClass("lg-zoomed")){var d=a.core.$slide.eq(a.core.index).find(".lg-object");f=d.outerHeight()*d.attr("data-scale")>a.core.$outer.find(".lg").height(),e=d.outerWidth()*d.attr("data-scale")>a.core.$outer.find(".lg").width(),(e||f)&&(c.preventDefault(),b={x:c.originalEvent.targetTouches[0].pageX,y:c.originalEvent.targetTouches[0].pageY})}}),a.core.$slide.on("touchmove.lg",function(g){if(a.core.$outer.hasClass("lg-zoomed")){var h,i,j=a.core.$slide.eq(a.core.index).find(".lg-img-wrap");g.preventDefault(),d=!0,c=g.originalEvent.targetTouches[0].pageX,c={x:g.originalEvent.targetTouches[0].pageX,y:g.originalEvent.targetTouches[0].pageY},a.core.$outer.addClass("lg-zoom-dragging"),i=f?-Math.abs(j.attr("data-y"))+(c.y-b.y):-Math.abs(j.attr("data-y")),h=e?-Math.abs(j.attr("data-x"))+(c.x-b.x):-Math.abs(j.attr("data-x")),j.css("transform","translate3d("+h+"px, "+i+"px, 0)")}}),a.core.$slide.on("touchend.lg",function(){a.core.$outer.hasClass("lg-zoomed")&&d&&(d=!1,a.core.$outer.removeClass("lg-zoom-dragging"),a.touchendZoom(b,c,e,f))})},f.prototype.zoomDrag=function(){var c=this,d={},e={},f=!1,g=!1,h=!1,i=!1;c.core.$slide.on("mousedown.lg.zoom",function(b){var e=c.core.$slide.eq(c.core.index).find(".lg-object");i=e.outerHeight()*e.attr("data-scale")>c.core.$outer.find(".lg").height(),h=e.outerWidth()*e.attr("data-scale")>c.core.$outer.find(".lg").width(),c.core.$outer.hasClass("lg-zoomed")&&a(b.target).hasClass("lg-object")&&(h||i)&&(b.preventDefault(),d={x:b.pageX,y:b.pageY},f=!0,c.core.$outer.scrollLeft+=1,c.core.$outer.scrollLeft-=1,c.core.$outer.removeClass("lg-grab").addClass("lg-grabbing"))}),a(b).on("mousemove.lg.zoom",function(a){if(f){var b,j,k=c.core.$slide.eq(c.core.index).find(".lg-img-wrap");g=!0,e={x:a.pageX,y:a.pageY},c.core.$outer.addClass("lg-zoom-dragging"),j=i?-Math.abs(k.attr("data-y"))+(e.y-d.y):-Math.abs(k.attr("data-y")),b=h?-Math.abs(k.attr("data-x"))+(e.x-d.x):-Math.abs(k.attr("data-x")),k.css("transform","translate3d("+b+"px, "+j+"px, 0)")}}),a(b).on("mouseup.lg.zoom",function(a){f&&(f=!1,c.core.$outer.removeClass("lg-zoom-dragging"),!g||d.x===e.x&&d.y===e.y||(e={x:a.pageX,y:a.pageY},c.touchendZoom(d,e,h,i)),g=!1),c.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")})},f.prototype.touchendZoom=function(a,b,c,d){var e=this,f=e.core.$slide.eq(e.core.index).find(".lg-img-wrap"),g=e.core.$slide.eq(e.core.index).find(".lg-object"),h=-Math.abs(f.attr("data-x"))+(b.x-a.x),i=-Math.abs(f.attr("data-y"))+(b.y-a.y),j=(e.core.$outer.find(".lg").height()-g.outerHeight())/2,k=Math.abs(g.outerHeight()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").height()+j),l=(e.core.$outer.find(".lg").width()-g.outerWidth())/2,m=Math.abs(g.outerWidth()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").width()+l);d&&(-k>=i?i=-k:i>=-j&&(i=-j)),c&&(-m>=h?h=-m:h>=-l&&(h=-l)),d?f.attr("data-y",Math.abs(i)):i=-Math.abs(f.attr("data-y")),c?f.attr("data-x",Math.abs(h)):h=-Math.abs(f.attr("data-x")),f.css("transform","translate3d("+h+"px, "+i+"px, 0)")},f.prototype.destroy=function(){var c=this;c.core.$el.off(".lg.zoom"),a(b).off(".lg.zoom"),c.core.$slide.off(".lg.zoom"),c.core.$el.off(".lg.tm.zoom"),c.resetZoom(),clearTimeout(c.zoomabletimeout),c.zoomabletimeout=!1},a.fn.lightGallery.modules.zoom=f}(jQuery,window,document),function(a,b,c,d){"use strict";var e={hash:!0},f=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.core.s.hash&&(this.oldHash=b.location.hash,this.init()),this};f.prototype.init=function(){var c,d=this;d.core.$el.on("onAfterSlide.lg.tm",function(a,c,e){b.location.hash="lg="+d.core.s.galleryId+"&slide="+e}),a(b).on("hashchange",function(){c=b.location.hash;var a=parseInt(c.split("&slide=")[1],10);c.indexOf("lg="+d.core.s.galleryId)>-1?d.core.slide(a):d.core.lGalleryOn&&d.core.destroy()})},f.prototype.destroy=function(){this.oldHash&&this.oldHash.indexOf("lg="+this.core.s.galleryId)<0?b.location.hash=this.oldHash:history.pushState?history.pushState("",c.title,b.location.pathname+b.location.search):b.location.hash=""},a.fn.lightGallery.modules.hash=f}(jQuery,window,document); \ No newline at end of file diff --git a/vendors/lightGallery/dist/js/lightgallery.js b/vendors/lightGallery/dist/js/lightgallery.js deleted file mode 100644 index 4a13995d2..000000000 --- a/vendors/lightGallery/dist/js/lightgallery.js +++ /dev/null @@ -1,1236 +0,0 @@ -/*! lightgallery - v1.2.0 - 2015-08-26 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2015 Sachin N; Licensed Apache 2.0 */ -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - - mode: 'lg-slide', - - // Ex : 'ease' - cssEasing: 'cubic-bezier(0.25, 0, 0.25, 1)', - - //'for jquery animation' - easing: 'linear', - speed: 600, - height: '100%', - width: '100%', - addClass: '', - startClass: 'lg-start-zoom', - backdropDuration: 150, - hideBarsDelay: 6000, - - useLeft: false, - - closable: true, - loop: true, - escKey: true, - keyPress: true, - controls: true, - slideEndAnimatoin: true, - hideControlOnEnd: false, - mousewheel: true, - - // .lg-item || '.lg-sub-html' - appendSubHtmlTo: '.lg-sub-html', - - /** - * @desc number of preload slides - * will exicute only after the current slide is fully loaded. - * - * @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th - * slide will be loaded in the background after the 4th slide is fully loaded.. - * if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ... - * - */ - preload: 1, - showAfterLoad: true, - selector: '', - nextHtml: '', - prevHtml: '', - - // 0, 1 - index: false, - - iframeMaxWidth: '100%', - - download: true, - counter: true, - appendCounterTo: '.lg-toolbar', - - swipeThreshold: 50, - enableSwipe: true, - enableDrag: true, - - dynamic: false, - dynamicEl: [], - galleryId: 1 - }; - - function Plugin(element, options) { - - // Current lightGallery element - this.el = element; - - // Current jquery element - this.$el = $(element); - - // lightGallery settings - this.s = $.extend({}, defaults, options); - - // lightGallery modules - this.modules = {}; - - // false when lightgallery complete first slide; - this.lGalleryOn = false; - - this.lgBusy = false; - - // Timeout function for hiding controls; - this.hideBartimeout = false; - - // To determine browser supports for touch events; - this.isTouch = ('ontouchstart' in document.documentElement); - - // DIsable hideControlOnEnd if sildeEndAnimation is true - if (this.s.slideEndAnimatoin) { - this.s.hideControlOnEnd = false; - } - - // Gallery items - if (this.s.dynamic) { - this.$items = this.s.dynamicEl; - } else { - if (this.s.selector === 'this') { - this.$items = this.$el; - } else if (this.s.selector !== '') { - this.$items = this.$el.find($(this.s.selector)); - } else { - this.$items = this.$el.children(); - } - } - - // .lg-item - this.$slide = ''; - - // .lg-outer - this.$outer = ''; - - this.init(); - - return this; - } - - Plugin.prototype.init = function() { - - var _this = this; - - // s.preload should not be more than $item.length - if (_this.s.preload > _this.$items.length) { - _this.s.preload = _this.$items.length; - } - - // if dynamic option is enabled execute immediately - var _hash = window.location.hash; - if (_hash.indexOf('lg=' + this.s.galleryId) > 0) { - - _this.index = parseInt(_hash.split('&slide=')[1], 10); - - $('body').addClass('lg-from-hash'); - if (!$('body').hasClass('lg-on')) { - setTimeout(function() { - _this.build(_this.index); - $('body').addClass('lg-on'); - }); - } - } - - if (_this.s.dynamic) { - - _this.$el.trigger('onBeforeOpen.lg'); - - _this.index = _this.s.index || 0; - - // prevent accidental double execution - if (!$('body').hasClass('lg-on')) { - setTimeout(function() { - _this.build(_this.index); - $('body').addClass('lg-on'); - }); - } - } else { - - // Using different namespace for click because click event should not unbind if selector is same object('this') - _this.$items.on('click.lgcustom', function(event) { - - // For IE8 - try { - event.preventDefault(); - event.preventDefault(); - } catch (er) { - event.returnValue = false; - } - - _this.$el.trigger('onBeforeOpen.lg'); - - _this.index = _this.s.index || _this.$items.index(this); - - // prevent accidental double execution - if (!$('body').hasClass('lg-on')) { - _this.build(_this.index); - $('body').addClass('lg-on'); - } - }); - } - - }; - - Plugin.prototype.build = function(index) { - - var _this = this; - - _this.structure(); - - // module constructor - $.each($.fn.lightGallery.modules, function(key) { - _this.modules[key] = new $.fn.lightGallery.modules[key](_this.el); - }); - - // initiate slide function - _this.slide(index, false, false); - - if (_this.s.keyPress) { - _this.keyPress(); - } - - if (_this.$items.length > 1) { - - _this.arrow(); - - setTimeout(function() { - _this.enableDrag(); - _this.enableSwipe(); - }, 50); - - if (_this.s.mousewheel) { - _this.mousewheel(); - } - } - - _this.counter(); - - _this.closeGallery(); - - // Hide controllers if mouse doesn't move for some period - _this.$outer.on('mousemove.lg click.lg touchstart.lg', function() { - - _this.$outer.removeClass('lg-hide-items'); - - clearTimeout(_this.hideBartimeout); - - // Timeout will be cleared on each slide movement also - _this.hideBartimeout = setTimeout(function() { - _this.$outer.addClass('lg-hide-items'); - }, _this.s.hideBarsDelay); - - }); - - }; - - Plugin.prototype.structure = function() { - var list = ''; - var controls = ''; - var i = 0; - var subHtmlCont = ''; - var template; - var _this = this; - - $('body').append('
    '); - $('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms'); - - // Create gallery items - for (i = 0; i < this.$items.length; i++) { - list += '
    '; - } - - // Create controlls - if (this.s.controls && this.$items.length > 1) { - controls = '
    ' + - '
    ' + this.s.prevHtml + '
    ' + - '
    ' + this.s.nextHtml + '
    ' + - '
    '; - } - - if (this.s.appendSubHtmlTo === '.lg-sub-html') { - subHtmlCont = '
    '; - } - - template = '
    ' + - '
    ' + - '
    ' + list + '
    ' + - '
    ' + - '' + - '
    ' + - controls + - subHtmlCont + - '
    ' + - '
    '; - - $('body').append(template); - this.$outer = $('.lg-outer'); - this.$slide = this.$outer.find('.lg-item'); - - if (this.s.useLeft) { - this.$outer.addClass('lg-use-left'); - } else { - this.$outer.addClass('lg-use-css3'); - } - - // For fixed height gallery - _this.setTop(); - $(window).on('resize.lg orientationchange.lg', function() { - setTimeout(function() { - _this.setTop(); - }, 100); - }); - - // add class lg-current to remove initial transition - this.$slide.eq(this.index).addClass('lg-current'); - - // add Class for css support and transition mode - if (this.doCss()) { - this.$outer.addClass('lg-css3'); - } else { - this.$outer.addClass('lg-css'); - } - - this.$outer.addClass(this.s.mode); - - if (this.s.enableDrag && this.$items.length > 1) { - this.$outer.addClass('lg-grab'); - } - - if (this.s.showAfterLoad) { - this.$outer.addClass('lg-show-after-load'); - } - - if (this.doCss()) { - var $inner = this.$outer.find('.lg-inner'); - $inner.css('transition-timing-function', this.s.cssEasing); - $inner.css('transition-duration', this.s.speed + 'ms'); - } - - $('.lg-backdrop').addClass('in'); - - setTimeout(function() { - _this.$outer.addClass('lg-visible'); - }, this.s.backdropDuration); - - if (this.s.download) { - this.$outer.find('.lg-toolbar').append(''); - } - - }; - - // For fixed height gallery - Plugin.prototype.setTop = function() { - if (this.s.height !== '100%') { - var wH = $(window).height(); - var top = (wH - parseInt(this.s.height, 10)) / 2; - var $lGallery = this.$outer.find('.lg'); - if (wH >= parseInt(this.s.height, 10)) { - $lGallery.css('top', top + 'px'); - } else { - $lGallery.css('top', '0px'); - } - } - }; - - // Find css3 support - Plugin.prototype.doCss = function() { - // check for css animation support - var support = function() { - var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; - var root = document.documentElement; - var i = 0; - for (i = 0; i < transition.length; i++) { - if (transition[i] in root.style) { - return true; - } - } - }; - - if (support()) { - return true; - } - - return false; - }; - - /** - * @desc Check the given src is video - * @param {String} src - * @return {Object} video type - * Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] } - */ - Plugin.prototype.isVideo = function(src, index) { - - var html; - if (this.s.dynamic) { - html = this.s.dynamicEl[index].html; - } else { - html = this.$items.eq(index).attr('data-html'); - } - - if (!src && html) { - return { - html5: true - }; - } - - var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9self\-]+)/i); - var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_this]+)/i); - - // return { youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] } - if (youtube) { - return { - youtube: youtube - }; - } else if (vimeo) { - return { - vimeo: vimeo - }; - } - }; - - /** - * @desc Create image counter - * Ex: 1/10 - */ - Plugin.prototype.counter = function() { - if (this.s.counter) { - $(this.s.appendCounterTo).append('
    ' + (parseInt(this.index, 10) + 1) + ' / ' + this.$items.length + '
    '); - } - }; - - /** - * @desc add sub-html into the slide - * @param {Number} index - index of the slide - */ - Plugin.prototype.addHtml = function(index) { - var subHtml = null; - if (this.s.dynamic) { - subHtml = this.s.dynamicEl[index].subHtml; - } else { - subHtml = this.$items.eq(index).attr('data-sub-html'); - } - - if (typeof subHtml !== 'undefined' && subHtml !== null) { - - // get first letter of subhtml - // if first letter starts with . or # get the html form the jQuery object - var fL = subHtml.substring(0, 1); - if (fL === '.' || fL === '#') { - subHtml = $(subHtml).html(); - } else { - subHtml = subHtml; - } - } else { - subHtml = ''; - } - - if (this.s.appendSubHtmlTo === '.lg-sub-html') { - this.$outer.find(this.s.appendSubHtmlTo).html(subHtml); - - // Add lg-empty-html class if title doesn't exist - if (subHtml === '') { - this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html'); - } else { - this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html'); - } - } else { - this.$slide.eq(index).append(subHtml); - } - - this.$el.trigger('onAfterAppendSubHtml.lg', [index]); - }; - - /** - * @desc Preload slides - * @param {Number} index - index of the slide - */ - Plugin.prototype.preload = function(index) { - var i = 1; - var j = 1; - for (i = 1; i <= this.s.preload; i++) { - if (i >= this.$items.length - index) { - break; - } - - this.loadContent(index + i, false, 0); - } - - for (j = 1; j <= this.s.preload; j++) { - if (index - j < 0) { - break; - } - - this.loadContent(index - j, false, 0); - } - }; - - /** - * @desc Load slide content into slide. - * @param {Number} index - index of the slide. - * @param {Boolean} rec - if true call loadcontent() function again. - * @param {Boolean} delay - delay for adding complete class. it is 0 except first time. - */ - Plugin.prototype.loadContent = function(index, rec, delay) { - - var _this = this; - var _hasPoster = false; - var _$img; - var _src; - var _poster; - var _srcset; - var _sizes; - var _html; - var getResponsiveSrc = function(srcItms) { - var rsWidth = []; - var rsSrc = []; - for (var i = 0; i < srcItms.length; i++) { - var __src = srcItms[i].split(' '); - - // Manage empty space - if (__src[0] === '') { - __src.splice(0, 1); - } - - rsSrc.push(__src[0]); - rsWidth.push(__src[1]); - } - - var wWidth = $(window).width(); - for (var j = 0; j < rsWidth.length; j++) { - if (parseInt(rsWidth[j], 10) > wWidth) { - _src = rsSrc[j]; - break; - } - } - }; - - if (_this.s.dynamic) { - - if (_this.s.dynamicEl[index].poster) { - _hasPoster = true; - _poster = _this.s.dynamicEl[index].poster; - } - - _html = _this.s.dynamicEl[index].html; - _src = _this.s.dynamicEl[index].src; - - if (_this.s.dynamicEl[index].responsive) { - var srcDyItms = _this.s.dynamicEl[index].responsive.split(','); - getResponsiveSrc(srcDyItms); - } - - _srcset = _this.s.dynamicEl[index].srcset; - _sizes = _this.s.dynamicEl[index].sizes; - - } else { - - if (_this.$items.eq(index).attr('data-poster')) { - _hasPoster = true; - _poster = _this.$items.eq(index).attr('data-poster'); - } - - _html = _this.$items.eq(index).attr('data-html'); - _src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'); - - if (_this.$items.eq(index).attr('data-responsive')) { - var srcItms = _this.$items.eq(index).attr('data-responsive').split(','); - getResponsiveSrc(srcItms); - } - - _srcset = _this.$items.eq(index).attr('data-srcset'); - _sizes = _this.$items.eq(index).attr('data-sizes'); - - } - - //if (_src || _srcset || _sizes || _poster) { - - var iframe = false; - if (_this.s.dynamic) { - if (_this.s.dynamicEl[index].iframe) { - iframe = true; - } - } else { - if (_this.$items.eq(index).attr('data-iframe') === 'true') { - iframe = true; - } - } - - var _isVideo = _this.isVideo(_src, index); - if (!_this.$slide.eq(index).hasClass('lg-loaded')) { - if (iframe) { - _this.$slide.eq(index).prepend('
    '); - } else if (_hasPoster) { - var videoClass = ''; - if (_isVideo && _isVideo.youtube) { - videoClass = 'lg-has-youtube'; - } else if (_isVideo && _isVideo.vimeo) { - videoClass = 'lg-has-vimeo'; - } else { - videoClass = 'lg-has-html5'; - } - - _this.$slide.eq(index).prepend('
    '); - - } else if (_isVideo) { - _this.$slide.eq(index).prepend('
    '); - _this.$el.trigger('hasVideo.lg', [index, _src, _html]); - } else { - _this.$slide.eq(index).prepend('
    '); - } - - _this.$el.trigger('onAferAppendSlide.lg', [index]); - - _$img = _this.$slide.eq(index).find('.lg-object'); - if (_sizes) { - _$img.attr('sizes', _sizes); - } - - if (_srcset) { - _$img.attr('srcset', _srcset); - try { - picturefill({ - elements: [_$img[0]] - }); - } catch (e) { - console.error('Make sure you have included Picturefill version 2'); - } - } - - if (this.s.appendSubHtmlTo !== '.lg-sub-html') { - _this.addHtml(index); - } - - _this.$slide.eq(index).addClass('lg-loaded'); - } - - _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { - - // For first time add some delay for displaying the start animation. - var _speed = 0; - - // Do not change the delay value because it is required for zoom plugin. - // If gallery opened from direct url (hash) speed value should be 0 - if (delay && !$('body').hasClass('lg-from-hash')) { - _speed = delay; - } - - setTimeout(function() { - _this.$slide.eq(index).addClass('lg-complete'); - _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]); - }, _speed); - - }); - - // @todo check load state for html5 videos - if (_isVideo && _isVideo.html5 && !_hasPoster) { - _this.$slide.eq(index).addClass('lg-complete'); - } - - if (rec === true) { - if (!_this.$slide.eq(index).hasClass('lg-complete')) { - _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { - _this.preload(index); - }); - } else { - _this.preload(index); - } - } - - //} - }; - - /** - * @desc slide function for lightgallery - ** Slide() gets call on start - ** ** Set lg.on true once slide() function gets called. - ** Call loadContent() on slide() function inside setTimeout - ** ** On first slide we do not want any animation like slide of fade - ** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately - ** ** Else loadContent() should wait for the transition to complete. - ** ** So set timeout s.speed + 50 - <=> ** loadContent() will load slide content in to the particular slide - ** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function. - ** ** preload will execute only when the previous slide is fully loaded (images iframe) - ** ** avoid simultaneous image load - <=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value - ** loadContent() <====> Preload(); - - * @param {Number} index - index of the slide - * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag - * @param {Boolean} fromThumb - true if slide function called via thumbnail click - */ - Plugin.prototype.slide = function(index, fromTouch, fromThumb) { - - var _prevIndex = this.$outer.find('.lg-current').index(); - var _this = this; - - // Prevent if multiple call - // Required for hsh plugin - if (_this.lGalleryOn && (_prevIndex === index)) { - return; - } - - var _length = this.$slide.length; - var _time = _this.lGalleryOn ? this.s.speed : 0; - var _next = false; - var _prev = false; - - if (!_this.lgBusy) { - - this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); - - _this.lgBusy = true; - - clearTimeout(_this.hideBartimeout); - - // Add title if this.s.appendSubHtmlTo === lg-sub-html - if (this.s.appendSubHtmlTo === '.lg-sub-html') { - - // wait for slide animation to complete - setTimeout(function() { - _this.addHtml(index); - }, _time); - } - - this.arrowDisable(index); - - if (!fromTouch) { - - // remove all transitions - _this.$outer.addClass('lg-no-trans'); - - this.$slide.removeClass('lg-prev-slide lg-next-slide'); - - if (index < _prevIndex) { - _prev = true; - if ((index === 0) && (_prevIndex === _length - 1) && !fromThumb) { - _prev = false; - _next = true; - } - } else if (index > _prevIndex) { - _next = true; - if ((index === _length - 1) && (_prevIndex === 0) && !fromThumb) { - _prev = true; - _next = false; - } - } - - if (_prev) { - - //prevslide - this.$slide.eq(index).addClass('lg-prev-slide'); - this.$slide.eq(_prevIndex).addClass('lg-next-slide'); - } else if (_next) { - - // next slide - this.$slide.eq(index).addClass('lg-next-slide'); - this.$slide.eq(_prevIndex).addClass('lg-prev-slide'); - } - - // give 50 ms for browser to add/remove class - setTimeout(function() { - _this.$slide.removeClass('lg-current'); - - //_this.$slide.eq(_prevIndex).removeClass('lg-current'); - _this.$slide.eq(index).addClass('lg-current'); - - // reset all transitions - _this.$outer.removeClass('lg-no-trans'); - }, 50); - } else { - - var touchPrev = index - 1; - var touchNext = index + 1; - - if ((index === 0) && (_prevIndex === _length - 1)) { - - // next slide - touchNext = 0; - touchPrev = _length - 1; - } else if ((index === _length - 1) && (_prevIndex === 0)) { - - // prev slide - touchNext = 0; - touchPrev = _length - 1; - } - - this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); - _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); - _this.$slide.eq(touchNext).addClass('lg-next-slide'); - _this.$slide.eq(index).addClass('lg-current'); - } - - if (_this.lGalleryOn) { - setTimeout(function() { - _this.loadContent(index, true, 0); - }, this.s.speed + 50); - - setTimeout(function() { - _this.lgBusy = false; - _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); - }, this.s.speed); - - // Support non css3 browser - if (!_this.doCss()) { - _this.$slide.fadeOut(_this.s.speed); - _this.$slide.eq(index).fadeIn(_this.s.speed); - } - } else { - _this.loadContent(index, true, _this.s.backdropDuration); - - _this.lgBusy = false; - _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); - - // Support non css3 browser - if (!_this.doCss()) { - _this.$slide.fadeOut(50); - _this.$slide.eq(index).fadeIn(50); - } - } - - if (this.s.download) { - var _src; - if (_this.s.dynamic) { - _src = _this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src; - } else { - _src = _this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'); - - } - - $('#lg-download').attr('href', _src); - } - - _this.lGalleryOn = true; - - if (this.s.counter) { - $('#lg-counter-current').text(index + 1); - } - - } - - }; - - /** - * @desc Go to next slide - * @param {Boolean} fromTouch - true if slide function called via touch event - */ - Plugin.prototype.goToNextSlide = function(fromTouch) { - var _this = this; - if (!_this.lgBusy) { - if ((_this.index + 1) < _this.$slide.length) { - _this.index++; - _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); - _this.slide(_this.index, fromTouch, false); - } else { - if (_this.s.loop) { - _this.index = 0; - _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); - _this.slide(_this.index, fromTouch, false); - } else if (_this.s.slideEndAnimatoin) { - _this.$outer.addClass('lg-right-end'); - setTimeout(function() { - _this.$outer.removeClass('lg-right-end'); - }, 400); - } - } - } - }; - - /** - * @desc Go to previous slide - * @param {Boolean} fromTouch - true if slide function called via touch event - */ - Plugin.prototype.goToPrevSlide = function(fromTouch) { - var _this = this; - if (!_this.lgBusy) { - if (_this.index > 0) { - _this.index--; - _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); - _this.slide(_this.index, fromTouch, false); - } else { - if (_this.s.loop) { - _this.index = _this.$items.length - 1; - _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); - _this.slide(_this.index, fromTouch, false); - } else if (_this.s.slideEndAnimatoin) { - _this.$outer.addClass('lg-left-end'); - setTimeout(function() { - _this.$outer.removeClass('lg-left-end'); - }, 400); - } - } - } - }; - - Plugin.prototype.keyPress = function() { - var _this = this; - if (this.$items.length > 1) { - $(window).on('keyup.lg', function(e) { - if (_this.$items.length > 1) { - if (e.keyCode === 37) { - e.preventDefault(); - _this.goToPrevSlide(); - } - - if (e.keyCode === 39) { - e.preventDefault(); - _this.goToNextSlide(); - } - } - }); - } - - $(window).on('keydown.lg', function(e) { - if (_this.s.escKey === true && e.keyCode === 27 && !_this.$outer.hasClass('lg-thumb-open')) { - e.preventDefault(); - _this.destroy(); - } - }); - }; - - Plugin.prototype.arrow = function() { - var _this = this; - this.$outer.find('.lg-prev').on('click.lg', function() { - _this.goToPrevSlide(); - }); - - this.$outer.find('.lg-next').on('click.lg', function() { - _this.goToNextSlide(); - }); - }; - - Plugin.prototype.arrowDisable = function(index) { - - // Disable arrows if s.hideControlOnEnd is true - if (!this.s.loop && this.s.hideControlOnEnd) { - if ((index + 1) < this.$slide.length) { - this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled'); - } else { - this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled'); - } - - if (index > 0) { - this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled'); - } else { - this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled'); - } - } - }; - - Plugin.prototype.setTranslate = function($el, xValue, yValue) { - // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 - if (this.s.useLeft) { - $el.css('left', xValue); - } else { - $el.css({ - transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)' - }); - } - }; - - Plugin.prototype.touchMove = function(startCoords, endCoords) { - - var distance = endCoords - startCoords; - - // reset opacity and transition duration - this.$outer.addClass('lg-dragging'); - - // move current slide - this.setTranslate(this.$slide.eq(this.index), distance, 0); - - // move next and prev slide with current slide - this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0); - this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0); - }; - - Plugin.prototype.touchEnd = function(distance) { - var _this = this; - - // keep slide animation for any mode while dragg/swipe - if (_this.s.mode !== 'lg-slide') { - _this.$outer.addClass('lg-slide'); - } - - this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0'); - - // set transition duration - setTimeout(function() { - _this.$outer.removeClass('lg-dragging'); - if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { - _this.goToNextSlide(true); - } else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { - _this.goToPrevSlide(true); - } else if (Math.abs(distance) < 5) { - - // Trigger click if distance is less than 5 pix - _this.$el.trigger('onSlideClick.lg'); - } - - _this.$slide.removeAttr('style'); - }); - - // remove slide class once drag/swipe is completed if mode is not slide - setTimeout(function() { - if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') { - _this.$outer.removeClass('lg-slide'); - } - }, _this.s.speed + 100); - - }; - - Plugin.prototype.enableSwipe = function() { - var _this = this; - var startCoords = 0; - var endCoords = 0; - var isMoved = false; - - if (_this.s.enableSwipe && _this.isTouch && _this.doCss()) { - - _this.$slide.on('touchstart.lg', function(e) { - if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) { - e.preventDefault(); - _this.manageSwipeClass(); - startCoords = e.originalEvent.targetTouches[0].pageX; - } - }); - - _this.$slide.on('touchmove.lg', function(e) { - if (!_this.$outer.hasClass('lg-zoomed')) { - e.preventDefault(); - endCoords = e.originalEvent.targetTouches[0].pageX; - _this.touchMove(startCoords, endCoords); - isMoved = true; - } - }); - - _this.$slide.on('touchend.lg', function() { - if (!_this.$outer.hasClass('lg-zoomed')) { - if (isMoved) { - isMoved = false; - _this.touchEnd(endCoords - startCoords); - } else { - _this.$el.trigger('onSlideClick.lg'); - } - } - }); - } - - }; - - Plugin.prototype.enableDrag = function() { - var _this = this; - var startCoords = 0; - var endCoords = 0; - var isDraging = false; - var isMoved = false; - if (_this.s.enableDrag && !_this.isTouch && _this.doCss()) { - _this.$slide.on('mousedown.lg', function(e) { - // execute only on .lg-object - if (!_this.$outer.hasClass('lg-zoomed')) { - if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { - e.preventDefault(); - - if (!_this.lgBusy) { - _this.manageSwipeClass(); - startCoords = e.pageX; - isDraging = true; - - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.$outer.scrollLeft += 1; - _this.$outer.scrollLeft -= 1; - - // * - - _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); - - _this.$el.trigger('onDragstart.lg'); - } - - } - } - }); - - $(window).on('mousemove.lg', function(e) { - if (isDraging) { - isMoved = true; - endCoords = e.pageX; - _this.touchMove(startCoords, endCoords); - _this.$el.trigger('onDragmove.lg'); - } - }); - - $(window).on('mouseup.lg', function(e) { - if (isMoved) { - isMoved = false; - _this.touchEnd(endCoords - startCoords); - _this.$el.trigger('onDragend.lg'); - } else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { - _this.$el.trigger('onSlideClick.lg'); - } - - // Prevent execution on click - if (isDraging) { - isDraging = false; - _this.$outer.removeClass('lg-grabbing').addClass('lg-grab'); - } - }); - - } - }; - - Plugin.prototype.manageSwipeClass = function() { - var touchNext = this.index + 1; - var touchPrev = this.index - 1; - var length = this.$slide.length; - if (this.s.loop) { - if (this.index === 0) { - touchPrev = length - 1; - } else if (this.index === length - 1) { - touchNext = 0; - } - } - - this.$slide.removeClass('lg-next-slide lg-prev-slide'); - if (touchPrev > -1) { - this.$slide.eq(touchPrev).addClass('lg-prev-slide'); - } - - this.$slide.eq(touchNext).addClass('lg-next-slide'); - }; - - Plugin.prototype.mousewheel = function() { - var _this = this; - _this.$outer.on('mousewheel.lg', function(e) { - if (e.deltaY > 0) { - _this.goToPrevSlide(); - } else { - _this.goToNextSlide(); - } - - e.preventDefault(); - }); - - }; - - Plugin.prototype.closeGallery = function() { - - var _this = this; - var mousedown = false; - this.$outer.find('.lg-close').on('click.lg', function() { - _this.destroy(); - }); - - if (_this.s.closable) { - - // If you drag the slide and release outside gallery gets close on chrome - // for preventing this check mousedown and mouseup happened on .lg-item or lg-outer - _this.$outer.on('mousedown.lg', function(e) { - - if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) { - mousedown = true; - } else { - mousedown = false; - } - - }); - - _this.$outer.on('mouseup.lg', function(e) { - - if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) { - if (!_this.$outer.hasClass('lg-dragging')) { - _this.destroy(); - } - } - - }); - - } - - }; - - Plugin.prototype.destroy = function(d) { - - var _this = this; - - _this.$el.trigger('onBeforeClose.lg'); - - /** - * if d is false or undefined destroy will only close the gallery - * plugins instance remains with the element - - * if d is true destroy will completely remove the plugin - */ - - if (d) { - this.$items.off('click.lg click.lgcustom'); - $.removeData(_this.el, 'lightGallery'); - } - - // Unbind all events added by lightGallery - this.$el.off('.lg.tm'); - - // Distroy all lightGallery modules - $.each($.fn.lightGallery.modules, function(key) { - if (_this.modules[key]) { - _this.modules[key].destroy(); - } - }); - - this.lGalleryOn = false; - - clearTimeout(_this.hideBartimeout); - this.hideBartimeout = false; - $(window).off('.lg'); - $('body').removeClass('lg-on lg-from-hash'); - - if (_this.$outer) { - _this.$outer.removeClass('lg-visible'); - } - - $('.lg-backdrop').removeClass('in'); - - setTimeout(function() { - if (_this.$outer) { - _this.$outer.remove(); - } - - $('.lg-backdrop').remove(); - - _this.$el.trigger('onCloseAfter.lg'); - }, _this.s.backdropDuration + 50); - }; - - $.fn.lightGallery = function(options) { - return this.each(function() { - if (!$.data(this, 'lightGallery')) { - $.data(this, 'lightGallery', new Plugin(this, options)); - } else { - try { - $(this).data('lightGallery').init(); - } catch (err) { - console.error('lightGallery has not initiated properly'); - } - } - }); - }; - - $.fn.lightGallery.modules = {}; - -})(jQuery, window, document); diff --git a/vendors/lightGallery/dist/js/lightgallery.min.js b/vendors/lightGallery/dist/js/lightgallery.min.js deleted file mode 100644 index 3a441fe38..000000000 --- a/vendors/lightGallery/dist/js/lightgallery.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! lightgallery - v1.2.0 - 2015-08-26 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2015 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";function e(b,d){return this.el=b,this.$el=a(b),this.s=a.extend({},f,d),this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in c.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var f={mode:"lg-slide",cssEasing:"cubic-bezier(0.25, 0, 0.25, 1)",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,appendSubHtmlTo:".lg-sub-html",preload:1,showAfterLoad:!0,selector:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};e.prototype.init=function(){var c=this;c.s.preload>c.$items.length&&(c.s.preload=c.$items.length);var d=b.location.hash;d.indexOf("lg="+this.s.galleryId)>0&&(c.index=parseInt(d.split("&slide=")[1],10),a("body").addClass("lg-from-hash"),a("body").hasClass("lg-on")||setTimeout(function(){c.build(c.index),a("body").addClass("lg-on")})),c.s.dynamic?(c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||0,a("body").hasClass("lg-on")||setTimeout(function(){c.build(c.index),a("body").addClass("lg-on")})):c.$items.on("click.lgcustom",function(b){try{b.preventDefault(),b.preventDefault()}catch(d){b.returnValue=!1}c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||c.$items.index(this),a("body").hasClass("lg-on")||(c.build(c.index),a("body").addClass("lg-on"))})},e.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightGallery.modules,function(b){c.modules[b]=new a.fn.lightGallery.modules[b](c.el)}),c.slide(b,!1,!1),c.s.keyPress&&c.keyPress(),c.$items.length>1&&(c.arrow(),setTimeout(function(){c.enableDrag(),c.enableSwipe()},50),c.s.mousewheel&&c.mousewheel()),c.counter(),c.closeGallery(),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeClass("lg-hide-items"),clearTimeout(c.hideBartimeout),c.hideBartimeout=setTimeout(function(){c.$outer.addClass("lg-hide-items")},c.s.hideBarsDelay)})},e.prototype.structure=function(){var c,d="",e="",f=0,g="",h=this;for(a("body").append('
    '),a(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),f=0;f';if(this.s.controls&&this.$items.length>1&&(e='
    '+this.s.prevHtml+'
    '+this.s.nextHtml+"
    "),".lg-sub-html"===this.s.appendSubHtmlTo&&(g='
    '),c='
    '+d+'
    '+e+g+"
    ",a("body").append(c),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?this.$outer.addClass("lg-use-left"):this.$outer.addClass("lg-use-css3"),h.setTop(),a(b).on("resize.lg orientationchange.lg",function(){setTimeout(function(){h.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):this.$outer.addClass("lg-css"),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var i=this.$outer.find(".lg-inner");i.css("transition-timing-function",this.s.cssEasing),i.css("transition-duration",this.s.speed+"ms")}a(".lg-backdrop").addClass("in"),setTimeout(function(){h.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append('')},e.prototype.setTop=function(){if("100%"!==this.s.height){var c=a(b).height(),d=(c-parseInt(this.s.height,10))/2,e=this.$outer.find(".lg");c>=parseInt(this.s.height,10)?e.css("top",d+"px"):e.css("top","0px")}},e.prototype.doCss=function(){var a=function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=c.documentElement,d=0;for(d=0;d'+(parseInt(this.index,10)+1)+' / '+this.$items.length+"")},e.prototype.addHtml=function(b){var c=null;if(c=this.s.dynamic?this.s.dynamicEl[b].subHtml:this.$items.eq(b).attr("data-sub-html"),"undefined"!=typeof c&&null!==c){var d=c.substring(0,1);c="."===d||"#"===d?a(c).html():c}else c="";".lg-sub-html"===this.s.appendSubHtmlTo?(this.$outer.find(this.s.appendSubHtmlTo).html(c),""===c?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")):this.$slide.eq(b).append(c),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},e.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(0>a-c);c++)this.loadContent(a-c,!1,0)},e.prototype.loadContent=function(c,d,e){var f,g,h,i,j,k,l=this,m=!1,n=function(c){for(var d=[],e=[],f=0;fi){g=e[j];break}};if(l.s.dynamic){if(l.s.dynamicEl[c].poster&&(m=!0,h=l.s.dynamicEl[c].poster),k=l.s.dynamicEl[c].html,g=l.s.dynamicEl[c].src,l.s.dynamicEl[c].responsive){var o=l.s.dynamicEl[c].responsive.split(",");n(o)}i=l.s.dynamicEl[c].srcset,j=l.s.dynamicEl[c].sizes}else{if(l.$items.eq(c).attr("data-poster")&&(m=!0,h=l.$items.eq(c).attr("data-poster")),k=l.$items.eq(c).attr("data-html"),g=l.$items.eq(c).attr("href")||l.$items.eq(c).attr("data-src"),l.$items.eq(c).attr("data-responsive")){var p=l.$items.eq(c).attr("data-responsive").split(",");n(p)}i=l.$items.eq(c).attr("data-srcset"),j=l.$items.eq(c).attr("data-sizes")}var q=!1;l.s.dynamic?l.s.dynamicEl[c].iframe&&(q=!0):"true"===l.$items.eq(c).attr("data-iframe")&&(q=!0);var r=l.isVideo(g,c);if(!l.$slide.eq(c).hasClass("lg-loaded")){if(q)l.$slide.eq(c).prepend('
    ');else if(m){var s="";s=r&&r.youtube?"lg-has-youtube":r&&r.vimeo?"lg-has-vimeo":"lg-has-html5",l.$slide.eq(c).prepend('
    ')}else r?(l.$slide.eq(c).prepend('
    '),l.$el.trigger("hasVideo.lg",[c,g,k])):l.$slide.eq(c).prepend('
    ');if(l.$el.trigger("onAferAppendSlide.lg",[c]),f=l.$slide.eq(c).find(".lg-object"),j&&f.attr("sizes",j),i){f.attr("srcset",i);try{picturefill({elements:[f[0]]})}catch(t){console.error("Make sure you have included Picturefill version 2")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&l.addHtml(c),l.$slide.eq(c).addClass("lg-loaded")}l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){var b=0;e&&!a("body").hasClass("lg-from-hash")&&(b=e),setTimeout(function(){l.$slide.eq(c).addClass("lg-complete"),l.$el.trigger("onSlideItemLoad.lg",[c,e||0])},b)}),r&&r.html5&&!m&&l.$slide.eq(c).addClass("lg-complete"),d===!0&&(l.$slide.eq(c).hasClass("lg-complete")?l.preload(c):l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){l.preload(c)}))},e.prototype.slide=function(b,c,d){var e=this.$outer.find(".lg-current").index(),f=this;if(!f.lGalleryOn||e!==b){var g=this.$slide.length,h=f.lGalleryOn?this.s.speed:0,i=!1,j=!1;if(!f.lgBusy){if(this.$el.trigger("onBeforeSlide.lg",[e,b,c,d]),f.lgBusy=!0,clearTimeout(f.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){f.addHtml(b)},h),this.arrowDisable(b),c){var k=b-1,l=b+1;0===b&&e===g-1?(l=0,k=g-1):b===g-1&&0===e&&(l=0,k=g-1),this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide"),f.$slide.eq(k).addClass("lg-prev-slide"),f.$slide.eq(l).addClass("lg-next-slide"),f.$slide.eq(b).addClass("lg-current")}else f.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),e>b?(j=!0,0!==b||e!==g-1||d||(j=!1,i=!0)):b>e&&(i=!0,b!==g-1||0!==e||d||(j=!0,i=!1)),j?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(e).addClass("lg-next-slide")):i&&(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(e).addClass("lg-prev-slide")),setTimeout(function(){f.$slide.removeClass("lg-current"),f.$slide.eq(b).addClass("lg-current"),f.$outer.removeClass("lg-no-trans")},50);if(f.lGalleryOn?(setTimeout(function(){f.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])},this.s.speed),f.doCss()||(f.$slide.fadeOut(f.s.speed),f.$slide.eq(b).fadeIn(f.s.speed))):(f.loadContent(b,!0,f.s.backdropDuration),f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d]),f.doCss()||(f.$slide.fadeOut(50),f.$slide.eq(b).fadeIn(50))),this.s.download){var m;m=f.s.dynamic?f.s.dynamicEl[b].downloadUrl||f.s.dynamicEl[b].src:f.$items.eq(b).attr("data-download-url")||f.$items.eq(b).attr("href")||f.$items.eq(b).attr("data-src"),a("#lg-download").attr("href",m)}f.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}}},e.prototype.goToNextSlide=function(a){var b=this;b.lgBusy||(b.index+10?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.loop?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.slideEndAnimatoin&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},e.prototype.keyPress=function(){var c=this;this.$items.length>1&&a(b).on("keyup.lg",function(a){c.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),c.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),c.goToNextSlide()))}),a(b).on("keydown.lg",function(a){c.s.escKey!==!0||27!==a.keyCode||c.$outer.hasClass("lg-thumb-open")||(a.preventDefault(),c.destroy())})},e.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},e.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+10?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},e.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},e.prototype.touchMove=function(b,c){var d=c-b;this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0)},e.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),0>a&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},e.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.isTouch&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},e.prototype.enableDrag=function(){var c=this,d=0,e=0,f=!1,g=!1;c.s.enableDrag&&!c.isTouch&&c.doCss()&&(c.$slide.on("mousedown.lg",function(b){c.$outer.hasClass("lg-zoomed")||(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&(b.preventDefault(),c.lgBusy||(c.manageSwipeClass(),d=b.pageX,f=!0,c.$outer.scrollLeft+=1,c.$outer.scrollLeft-=1,c.$outer.removeClass("lg-grab").addClass("lg-grabbing"),c.$el.trigger("onDragstart.lg")))}),a(b).on("mousemove.lg",function(a){f&&(g=!0,e=a.pageX,c.touchMove(d,e),c.$el.trigger("onDragmove.lg"))}),a(b).on("mouseup.lg",function(b){g?(g=!1,c.touchEnd(e-d),c.$el.trigger("onDragend.lg")):(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&c.$el.trigger("onSlideClick.lg"),f&&(f=!1,c.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},e.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1,c=this.$slide.length;this.s.loop&&(0===this.index?b=c-1:this.index===c-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},e.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault()})},e.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap")?!0:!1}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},e.prototype.destroy=function(c){var d=this;d.$el.trigger("onBeforeClose.lg"),c&&(this.$items.off("click.lg click.lgcustom"),a.removeData(d.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){d.modules[a]&&d.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(d.hideBartimeout),this.hideBartimeout=!1,a(b).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),d.$outer&&d.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){d.$outer&&d.$outer.remove(),a(".lg-backdrop").remove(),d.$el.trigger("onCloseAfter.lg")},d.s.backdropDuration+50)},a.fn.lightGallery=function(b){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(c){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new e(this,b))})},a.fn.lightGallery.modules={}}(jQuery,window,document); \ No newline at end of file diff --git a/vendors/moment/CONTRIBUTING.md b/vendors/moment/CONTRIBUTING.md deleted file mode 100644 index fa2977d50..000000000 --- a/vendors/moment/CONTRIBUTING.md +++ /dev/null @@ -1,46 +0,0 @@ -All pull requests to the `master` branch will be closed. -======================================================== - -Please submit all pull requests to the `develop` branch. - -Language translations will not be merged without unit tests. -============================================================ - -See [the British english unit tests](https://github.com/moment/moment/blob/develop/test/lang/en-gb.js) for an example. - -Submitting Issues -================= - -If you are submitting a bug, please create a [jsfiddle](http://jsfiddle.net/) demonstrating the issue. - -Contributing -============ - -To contribute, fork the library and install grunt and dependencies. - - npm install -g grunt-cli - npm install - -You can add tests to the files in `/test/moment` or add a new test file if you are adding a new feature. - -To run the tests, do `grunt` to run all tests. - -To check the filesize, you can use `grunt size`. - -To minify all the files, use `grunt release`. **But please don't include minified files in pull requests.** We'll minify them when we release. - -If your code passes the unit tests (including the ones you wrote), submit a pull request. - -Submitting pull requests -======================== - -Moment.js now uses [git-flow](https://github.com/nvie/gitflow). If you're not familiar with git-flow, please read up on it, you'll be glad you did. - -When submitting new features, please create a new feature branch using `git flow feature start ` and submit the pull request to the `develop` branch. - -Pull requests for enhancements for features should be submitted to the `develop` branch as well. - -When submitting a bugfix, please check if there is an existing bugfix branch. If the latest stable version is `1.5.0`, the bugfix branch would be `hotfix/1.5.1`. All pull requests for bug fixes should be on a `hotfix` branch, unless the bug fix depends on a new feature. - -The `master` branch should always have the latest stable version. When bugfix or minor releases are needed, the develop/hotfix branch will be merged into master and released. - diff --git a/vendors/moment/Gruntfile.js b/vendors/moment/Gruntfile.js deleted file mode 100644 index 5b2f80407..000000000 --- a/vendors/moment/Gruntfile.js +++ /dev/null @@ -1,211 +0,0 @@ -module.exports = function (grunt) { - - var embedOption = grunt.option('embedLanguages'), - embedLanguageDest = embedOption ? - 'min/moment-with-customlangs.js' : - 'min/moment-with-langs.js', - embedLanguageLangs = 'lang/*.js'; - - if (embedOption && embedOption.match(/,/)) { - embedLanguageLangs = 'lang/{' + embedOption + '}.js'; - } - else if (embedOption) { - embedLanguageLangs = 'lang/' + embedOption + '.js'; - } - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - concat : { - langs: { - src: 'lang/*.js', - dest: 'min/langs.js' - }, - tests: { - src: [ - 'test/browser-prefix.js', - 'test/moment/*.js', - 'test/lang/*.js', - 'test/browser-suffix.js' - ], - dest: 'min/tests.js' - } - }, - env : { - sauceLabs : (grunt.file.exists('.sauce-labs.creds') ? - grunt.file.readJSON('.sauce-labs.creds') : {}) - }, - karma : { - options: { - frameworks: ['nodeunit'], - files: [ - 'min/moment-with-langs.js', - 'min/tests.js', - 'test/browser.js' - ], - sauceLabs: { - startConnect: true, - testName: 'MomentJS' - }, - customLaunchers: { - slChromeWinXp: { - base: 'SauceLabs', - browserName: 'chrome', - platform: 'Windows XP' - }, - slIe9Win7: { - base: 'SauceLabs', - browserName: 'internet explorer', - platform: 'Windows 7', - version: '9' - }, - slIe8Win7: { - base: 'SauceLabs', - browserName: 'internet explorer', - platform: 'Windows 7', - version: '8' - }, - slFfLinux: { - base: 'SauceLabs', - browserName: 'firefox', - platform: 'Linux' - }, - slSafariOsx: { - base: 'SauceLabs', - browserName: 'safari', - platform: 'OS X 10.8' - } - } - }, - server: { - browsers: [] - }, - chrome: { - singleRun: true, - browsers: ['Chrome'] - }, - firefox: { - singleRun: true, - browsers: ['Firefox'] - }, - sauce: { - options: {reporters: ['dots']}, - singleRun: true, - browsers: [ - 'slChromeWinXp', - 'slIe9Win7', - 'slIe8Win7', - 'slFfLinux', - 'slSafariOsx' - ] - } - }, - - uglify : { - target: { - files: { - 'min/moment-with-langs.min.js' : 'min/moment-with-langs.js', - 'min/moment-with-customlangs.min.js' : 'min/moment-with-customlangs.js', - 'min/langs.min.js' : 'min/langs.js', - 'min/moment.min.js' : 'moment.js' - } - }, - options: { - mangle: true, - compress: { - dead_code: false // jshint ignore:line - }, - output: { - ascii_only: true // jshint ignore:line - }, - report: 'min', - preserveComments: 'some' - } - }, - nodeunit : { - all : ["test/moment/**/*.js", "test/lang/**/*.js"] - }, - jshint: { - all: [ - "Gruntfile.js", "moment.js", "lang/**/*.js", "test/**/*.js", - "!test/browser*.js" - ], - options: { - "node" : true, - "browser" : true, - "boss" : false, - "curly" : true, - "debug" : false, - "devel" : false, - "eqeqeq" : true, - "eqnull" : true, - "evil" : false, - "forin" : false, - "immed" : false, - "laxbreak" : false, - "newcap" : true, - "noarg" : true, - "noempty" : false, - "nonew" : false, - "onevar" : true, - "plusplus" : false, - "regexp" : false, - "undef" : true, - "sub" : true, - "strict" : false, - "white" : true, - "es3" : true, - "camelcase" : true, - "globals": { - "define": false - } - } - }, - watch : { - test : { - files : [ - 'moment.js', - 'lang/*.js', - 'test/**/*.js' - ], - tasks: ['nodeunit'] - }, - jshint : { - files : '<%= jshint.all %>', - tasks: ['jshint'] - } - }, - embedLanguages: { - moment: 'moment.js', - dest: embedLanguageDest, - targetLangs: embedLanguageLangs - } - }); - - grunt.loadTasks("tasks"); - - // These plugins provide necessary tasks. - require('load-grunt-tasks')(grunt); - - // Default task. - grunt.registerTask('default', ['jshint', 'nodeunit']); - - //test tasks - grunt.registerTask('test', ['test:node', 'test:browser']); - grunt.registerTask('test:node', ['nodeunit']); - grunt.registerTask('test:server', ['concat', 'embedLanguages', 'karma:server']); - grunt.registerTask('test:browser', ['concat', 'embedLanguages', 'karma:chrome', 'karma:firefox']); - grunt.registerTask('test:sauce-browser', ['concat', 'embedLanguages', 'env:sauceLabs', 'karma:sauce']); - grunt.registerTask('test:travis-sauce-browser', ['concat', 'embedLanguages', 'karma:sauce']); - - // travis build task - grunt.registerTask('build:travis', [ - 'jshint', 'test:node', 'check-sauce-creds', - 'test:travis-sauce-browser' - ]); - - // Task to be run when releasing a new version - grunt.registerTask('release', [ - 'jshint', 'nodeunit', 'concat', 'embedLanguages', - 'component', 'uglify' - ]); -}; diff --git a/vendors/moment/LICENSE b/vendors/moment/LICENSE deleted file mode 100644 index bd172467a..000000000 --- a/vendors/moment/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendors/moment/bower.json b/vendors/moment/bower.json deleted file mode 100644 index e67f55e40..000000000 --- a/vendors/moment/bower.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "moment", - "version": "2.6.0", - "main": "moment.js", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests", - "tasks", - "component.json", - "composer.json", - "CONTRIBUTING.md", - "ender.js", - "Gruntfile.js", - "package.js", - "package.json" - ] -} diff --git a/vendors/moment/component.json b/vendors/moment/component.json deleted file mode 100644 index f9ef7aece..000000000 --- a/vendors/moment/component.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "moment", - "version": "2.5.1", - "main": "moment.js", - "description": "Parse, validate, manipulate, and display dates in javascript.", - "files": [ - "moment.js", - "lang/ar-ma.js", - "lang/ar.js", - "lang/bg.js", - "lang/br.js", - "lang/bs.js", - "lang/ca.js", - "lang/cs.js", - "lang/cv.js", - "lang/cy.js", - "lang/da.js", - "lang/de.js", - "lang/el.js", - "lang/en-au.js", - "lang/en-ca.js", - "lang/en-gb.js", - "lang/eo.js", - "lang/es.js", - "lang/et.js", - "lang/eu.js", - "lang/fa.js", - "lang/fi.js", - "lang/fo.js", - "lang/fr-ca.js", - "lang/fr.js", - "lang/gl.js", - "lang/he.js", - "lang/hi.js", - "lang/hr.js", - "lang/hu.js", - "lang/hy-am.js", - "lang/id.js", - "lang/is.js", - "lang/it.js", - "lang/ja.js", - "lang/ka.js", - "lang/km.js", - "lang/ko.js", - "lang/lb.js", - "lang/lt.js", - "lang/lv.js", - "lang/mk.js", - "lang/ml.js", - "lang/mr.js", - "lang/ms-my.js", - "lang/nb.js", - "lang/ne.js", - "lang/nl.js", - "lang/nn.js", - "lang/pl.js", - "lang/pt-br.js", - "lang/pt.js", - "lang/ro.js", - "lang/ru.js", - "lang/sk.js", - "lang/sl.js", - "lang/sq.js", - "lang/sr-cyr.js", - "lang/sr.js", - "lang/sv.js", - "lang/ta.js", - "lang/th.js", - "lang/tl-ph.js", - "lang/tr.js", - "lang/tzm-la.js", - "lang/tzm.js", - "lang/uk.js", - "lang/uz.js", - "lang/vi.js", - "lang/zh-cn.js", - "lang/zh-tw.js" - ], - "scripts": [ - "moment.js" - ] -} \ No newline at end of file diff --git a/vendors/moment/composer.json b/vendors/moment/composer.json deleted file mode 100644 index eb9c50b05..000000000 --- a/vendors/moment/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "moment/moment", - "description": "Parse, validate, manipulate, and display dates in javascript.", - "keywords": [ - "moment", - "date", - "time", - "parse", - "format", - "validate", - "i18n", - "l10n", - "ender" - ], - "homepage": "http://github.com/moment/moment/", - "authors": [{"name": "Tim Wood", "email": "washwithcare@gmail.com"}], - "license": "MIT", - "type": "component", - "require": { - "robloach/component-installer": "*" - }, - "extra": { - "component": { - "scripts": [ - "moment.js" - ], - "files": [ - "min/*.js", - "lang/*.js" - ] - } - } -} diff --git a/vendors/moment/ender.js b/vendors/moment/ender.js deleted file mode 100644 index 71462a770..000000000 --- a/vendors/moment/ender.js +++ /dev/null @@ -1 +0,0 @@ -$.ender({ moment: require('moment') }) diff --git a/vendors/moment/lang/ar-ma.js b/vendors/moment/lang/ar-ma.js deleted file mode 100644 index 1c159f102..000000000 --- a/vendors/moment/lang/ar-ma.js +++ /dev/null @@ -1,56 +0,0 @@ -// moment.js language configuration -// language : Moroccan Arabic (ar-ma) -// author : ElFadili Yassine : https://github.com/ElFadiliY -// author : Abdel Said : https://github.com/abdelsaid - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ar-ma', { - months : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), - monthsShort : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), - weekdays : "الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysShort : "احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"), - weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[اليوم على الساعة] LT", - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : "في %s", - past : "منذ %s", - s : "ثوان", - m : "دقيقة", - mm : "%d دقائق", - h : "ساعة", - hh : "%d ساعات", - d : "يوم", - dd : "%d أيام", - M : "شهر", - MM : "%d أشهر", - y : "سنة", - yy : "%d سنوات" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ar.js b/vendors/moment/lang/ar.js deleted file mode 100644 index dd01a42cf..000000000 --- a/vendors/moment/lang/ar.js +++ /dev/null @@ -1,97 +0,0 @@ -// moment.js language configuration -// language : Arabic (ar) -// author : Abdel Said : https://github.com/abdelsaid -// changes in months, weekdays : Ahmed Elkhatib - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠' - }, numberMap = { - '١': '1', - '٢': '2', - '٣': '3', - '٤': '4', - '٥': '5', - '٦': '6', - '٧': '7', - '٨': '8', - '٩': '9', - '٠': '0' - }; - - return moment.lang('ar', { - months : "يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"), - monthsShort : "يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"), - weekdays : "الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysShort : "أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"), - weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "ص"; - } else { - return "م"; - } - }, - calendar : { - sameDay: "[اليوم على الساعة] LT", - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : "في %s", - past : "منذ %s", - s : "ثوان", - m : "دقيقة", - mm : "%d دقائق", - h : "ساعة", - hh : "%d ساعات", - d : "يوم", - dd : "%d أيام", - M : "شهر", - MM : "%d أشهر", - y : "سنة", - yy : "%d سنوات" - }, - preparse: function (string) { - return string.replace(/[۰-۹]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/bg.js b/vendors/moment/lang/bg.js deleted file mode 100644 index f47ed65a9..000000000 --- a/vendors/moment/lang/bg.js +++ /dev/null @@ -1,86 +0,0 @@ -// moment.js language configuration -// language : bulgarian (bg) -// author : Krasen Borisov : https://github.com/kraz - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('bg', { - months : "януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"), - monthsShort : "янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"), - weekdays : "неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"), - weekdaysShort : "нед_пон_вто_сря_чет_пет_съб".split("_"), - weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"), - longDateFormat : { - LT : "H:mm", - L : "D.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Днес в] LT', - nextDay : '[Утре в] LT', - nextWeek : 'dddd [в] LT', - lastDay : '[Вчера в] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[В изминалата] dddd [в] LT'; - case 1: - case 2: - case 4: - case 5: - return '[В изминалия] dddd [в] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "след %s", - past : "преди %s", - s : "няколко секунди", - m : "минута", - mm : "%d минути", - h : "час", - hh : "%d часа", - d : "ден", - dd : "%d дни", - M : "месец", - MM : "%d месеца", - y : "година", - yy : "%d години" - }, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/br.js b/vendors/moment/lang/br.js deleted file mode 100644 index 39c60df07..000000000 --- a/vendors/moment/lang/br.js +++ /dev/null @@ -1,107 +0,0 @@ -// moment.js language configuration -// language : breton (br) -// author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function relativeTimeWithMutation(number, withoutSuffix, key) { - var format = { - 'mm': "munutenn", - 'MM': "miz", - 'dd': "devezh" - }; - return number + ' ' + mutation(format[key], number); - } - - function specialMutationForYears(number) { - switch (lastNumber(number)) { - case 1: - case 3: - case 4: - case 5: - case 9: - return number + ' bloaz'; - default: - return number + ' vloaz'; - } - } - - function lastNumber(number) { - if (number > 9) { - return lastNumber(number % 10); - } - return number; - } - - function mutation(text, number) { - if (number === 2) { - return softMutation(text); - } - return text; - } - - function softMutation(text) { - var mutationTable = { - 'm': 'v', - 'b': 'v', - 'd': 'z' - }; - if (mutationTable[text.charAt(0)] === undefined) { - return text; - } - return mutationTable[text.charAt(0)] + text.substring(1); - } - - return moment.lang('br', { - months : "Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"), - monthsShort : "Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"), - weekdays : "Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"), - weekdaysShort : "Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"), - weekdaysMin : "Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"), - longDateFormat : { - LT : "h[e]mm A", - L : "DD/MM/YYYY", - LL : "D [a viz] MMMM YYYY", - LLL : "D [a viz] MMMM YYYY LT", - LLLL : "dddd, D [a viz] MMMM YYYY LT" - }, - calendar : { - sameDay : '[Hiziv da] LT', - nextDay : '[Warc\'hoazh da] LT', - nextWeek : 'dddd [da] LT', - lastDay : '[Dec\'h da] LT', - lastWeek : 'dddd [paset da] LT', - sameElse : 'L' - }, - relativeTime : { - future : "a-benn %s", - past : "%s 'zo", - s : "un nebeud segondennoù", - m : "ur vunutenn", - mm : relativeTimeWithMutation, - h : "un eur", - hh : "%d eur", - d : "un devezh", - dd : relativeTimeWithMutation, - M : "ur miz", - MM : relativeTimeWithMutation, - y : "ur bloaz", - yy : specialMutationForYears - }, - ordinal : function (number) { - var output = (number === 1) ? 'añ' : 'vet'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/bs.js b/vendors/moment/lang/bs.js deleted file mode 100644 index 83a9b4c07..000000000 --- a/vendors/moment/lang/bs.js +++ /dev/null @@ -1,139 +0,0 @@ -// moment.js language configuration -// language : bosnian (bs) -// author : Nedim Cholich : https://github.com/frontyard -// based on (hr) translation by Bojan Marković - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - return moment.lang('bs', { - months : "januar_februar_mart_april_maj_juni_juli_avgust_septembar_oktobar_novembar_decembar".split("_"), - monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"), - weekdays : "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), - weekdaysShort : "ned._pon._uto._sri._čet._pet._sub.".split("_"), - weekdaysMin : "ne_po_ut_sr_če_pe_su".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "za %s", - past : "prije %s", - s : "par sekundi", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "dan", - dd : translate, - M : "mjesec", - MM : translate, - y : "godinu", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ca.js b/vendors/moment/lang/ca.js deleted file mode 100644 index cf471130d..000000000 --- a/vendors/moment/lang/ca.js +++ /dev/null @@ -1,66 +0,0 @@ -// moment.js language configuration -// language : catalan (ca) -// author : Juan G. Hurtado : https://github.com/juanghurtado - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ca', { - months : "gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"), - monthsShort : "gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"), - weekdays : "diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"), - weekdaysShort : "dg._dl._dt._dc._dj._dv._ds.".split("_"), - weekdaysMin : "Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay : function () { - return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextDay : function () { - return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastDay : function () { - return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : "en %s", - past : "fa %s", - s : "uns segons", - m : "un minut", - mm : "%d minuts", - h : "una hora", - hh : "%d hores", - d : "un dia", - dd : "%d dies", - M : "un mes", - MM : "%d mesos", - y : "un any", - yy : "%d anys" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/cs.js b/vendors/moment/lang/cs.js deleted file mode 100644 index cb79c9b3c..000000000 --- a/vendors/moment/lang/cs.js +++ /dev/null @@ -1,155 +0,0 @@ -// moment.js language configuration -// language : czech (cs) -// author : petrbela : https://github.com/petrbela - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var months = "leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"), - monthsShort = "led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"); - - function plural(n) { - return (n > 1) && (n < 5) && (~~(n / 10) !== 1); - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minuty' : 'minut'); - } else { - return result + 'minutami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodin'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'den' : 'dnem'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dny' : 'dní'); - } else { - return result + 'dny'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'měsíce' : 'měsíců'); - } else { - return result + 'měsíci'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokem'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'let'); - } else { - return result + 'lety'; - } - break; - } - } - - return moment.lang('cs', { - months : months, - monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), - weekdays : "neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"), - weekdaysShort : "ne_po_út_st_čt_pá_so".split("_"), - weekdaysMin : "ne_po_út_st_čt_pá_so".split("_"), - longDateFormat : { - LT: "H.mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd D. MMMM YYYY LT" - }, - calendar : { - sameDay: "[dnes v] LT", - nextDay: '[zítra v] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v neděli v] LT'; - case 1: - case 2: - return '[v] dddd [v] LT'; - case 3: - return '[ve středu v] LT'; - case 4: - return '[ve čtvrtek v] LT'; - case 5: - return '[v pátek v] LT'; - case 6: - return '[v sobotu v] LT'; - } - }, - lastDay: '[včera v] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulou neděli v] LT'; - case 1: - case 2: - return '[minulé] dddd [v] LT'; - case 3: - return '[minulou středu v] LT'; - case 4: - case 5: - return '[minulý] dddd [v] LT'; - case 6: - return '[minulou sobotu v] LT'; - } - }, - sameElse: "L" - }, - relativeTime : { - future : "za %s", - past : "před %s", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/cv.js b/vendors/moment/lang/cv.js deleted file mode 100644 index a5812deba..000000000 --- a/vendors/moment/lang/cv.js +++ /dev/null @@ -1,59 +0,0 @@ -// moment.js language configuration -// language : chuvash (cv) -// author : Anatoly Mironov : https://github.com/mirontoli - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('cv', { - months : "кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"), - monthsShort : "кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"), - weekdays : "вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"), - weekdaysShort : "выр_тун_ытл_юн_кĕç_эрн_шăм".split("_"), - weekdaysMin : "вр_тн_ыт_юн_кç_эр_шм".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD-MM-YYYY", - LL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]", - LLL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT", - LLLL : "dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT" - }, - calendar : { - sameDay: '[Паян] LT [сехетре]', - nextDay: '[Ыран] LT [сехетре]', - lastDay: '[Ĕнер] LT [сехетре]', - nextWeek: '[Çитес] dddd LT [сехетре]', - lastWeek: '[Иртнĕ] dddd LT [сехетре]', - sameElse: 'L' - }, - relativeTime : { - future : function (output) { - var affix = /сехет$/i.exec(output) ? "рен" : /çул$/i.exec(output) ? "тан" : "ран"; - return output + affix; - }, - past : "%s каялла", - s : "пĕр-ик çеккунт", - m : "пĕр минут", - mm : "%d минут", - h : "пĕр сехет", - hh : "%d сехет", - d : "пĕр кун", - dd : "%d кун", - M : "пĕр уйăх", - MM : "%d уйăх", - y : "пĕр çул", - yy : "%d çул" - }, - ordinal : '%d-мĕш', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/cy.js b/vendors/moment/lang/cy.js deleted file mode 100644 index b47d7c275..000000000 --- a/vendors/moment/lang/cy.js +++ /dev/null @@ -1,77 +0,0 @@ -// moment.js language configuration -// language : Welsh (cy) -// author : Robert Allen - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang("cy", { - months: "Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"), - monthsShort: "Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"), - weekdays: "Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"), - weekdaysShort: "Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"), - weekdaysMin: "Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"), - // time formats are the same as en-gb - longDateFormat: { - LT: "HH:mm", - L: "DD/MM/YYYY", - LL: "D MMMM YYYY", - LLL: "D MMMM YYYY LT", - LLLL: "dddd, D MMMM YYYY LT" - }, - calendar: { - sameDay: '[Heddiw am] LT', - nextDay: '[Yfory am] LT', - nextWeek: 'dddd [am] LT', - lastDay: '[Ddoe am] LT', - lastWeek: 'dddd [diwethaf am] LT', - sameElse: 'L' - }, - relativeTime: { - future: "mewn %s", - past: "%s yn àl", - s: "ychydig eiliadau", - m: "munud", - mm: "%d munud", - h: "awr", - hh: "%d awr", - d: "diwrnod", - dd: "%d diwrnod", - M: "mis", - MM: "%d mis", - y: "blwyddyn", - yy: "%d flynedd" - }, - // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh - ordinal: function (number) { - var b = number, - output = '', - lookup = [ - '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed - 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed - ]; - - if (b > 20) { - if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) { - output = 'fed'; // not 30ain, 70ain or 90ain - } else { - output = 'ain'; - } - } else if (b > 0) { - output = lookup[b]; - } - - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/da.js b/vendors/moment/lang/da.js deleted file mode 100644 index 2fa8244c0..000000000 --- a/vendors/moment/lang/da.js +++ /dev/null @@ -1,56 +0,0 @@ -// moment.js language configuration -// language : danish (da) -// author : Ulrik Nielsen : https://github.com/mrbase - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('da', { - months : "januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), - weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), - weekdaysShort : "søn_man_tir_ons_tor_fre_lør".split("_"), - weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D. MMMM, YYYY LT" - }, - calendar : { - sameDay : '[I dag kl.] LT', - nextDay : '[I morgen kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[I går kl.] LT', - lastWeek : '[sidste] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : "om %s", - past : "%s siden", - s : "få sekunder", - m : "et minut", - mm : "%d minutter", - h : "en time", - hh : "%d timer", - d : "en dag", - dd : "%d dage", - M : "en måned", - MM : "%d måneder", - y : "et år", - yy : "%d år" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/de.js b/vendors/moment/lang/de.js deleted file mode 100644 index 86cd26877..000000000 --- a/vendors/moment/lang/de.js +++ /dev/null @@ -1,71 +0,0 @@ -// moment.js language configuration -// language : german (de) -// author : lluchs : https://github.com/lluchs -// author: Menelion Elensúle: https://github.com/Oire - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eine Minute', 'einer Minute'], - 'h': ['eine Stunde', 'einer Stunde'], - 'd': ['ein Tag', 'einem Tag'], - 'dd': [number + ' Tage', number + ' Tagen'], - 'M': ['ein Monat', 'einem Monat'], - 'MM': [number + ' Monate', number + ' Monaten'], - 'y': ['ein Jahr', 'einem Jahr'], - 'yy': [number + ' Jahre', number + ' Jahren'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - return moment.lang('de', { - months : "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), - monthsShort : "Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), - weekdays : "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), - weekdaysShort : "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), - weekdaysMin : "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), - longDateFormat : { - LT: "HH:mm [Uhr]", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay: "[Heute um] LT", - sameElse: "L", - nextDay: '[Morgen um] LT', - nextWeek: 'dddd [um] LT', - lastDay: '[Gestern um] LT', - lastWeek: '[letzten] dddd [um] LT' - }, - relativeTime : { - future : "in %s", - past : "vor %s", - s : "ein paar Sekunden", - m : processRelativeTime, - mm : "%d Minuten", - h : processRelativeTime, - hh : "%d Stunden", - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/el.js b/vendors/moment/lang/el.js deleted file mode 100644 index e2a38cdb5..000000000 --- a/vendors/moment/lang/el.js +++ /dev/null @@ -1,90 +0,0 @@ -// moment.js language configuration -// language : modern greek (el) -// author : Aggelos Karalias : https://github.com/mehiel - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('el', { - monthsNominativeEl : "Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"), - monthsGenitiveEl : "Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"), - months : function (momentToFormat, format) { - if (/D/.test(format.substring(0, format.indexOf("MMMM")))) { // if there is a day number before 'MMMM' - return this._monthsGenitiveEl[momentToFormat.month()]; - } else { - return this._monthsNominativeEl[momentToFormat.month()]; - } - }, - monthsShort : "Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"), - weekdays : "Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"), - weekdaysShort : "Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"), - weekdaysMin : "Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"), - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'μμ' : 'ΜΜ'; - } else { - return isLower ? 'πμ' : 'ΠΜ'; - } - }, - longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendarEl : { - sameDay : '[Σήμερα {}] LT', - nextDay : '[Αύριο {}] LT', - nextWeek : 'dddd [{}] LT', - lastDay : '[Χθες {}] LT', - lastWeek : function() { - switch (this.day()) { - case 6: - return '[το προηγούμενο] dddd [{}] LT'; - default: - return '[την προηγούμενη] dddd [{}] LT'; - } - }, - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendarEl[key], - hours = mom && mom.hours(); - - if (typeof output === 'function') { - output = output.apply(mom); - } - - return output.replace("{}", (hours % 12 === 1 ? "στη" : "στις")); - }, - relativeTime : { - future : "σε %s", - past : "%s πριν", - s : "δευτερόλεπτα", - m : "ένα λεπτό", - mm : "%d λεπτά", - h : "μία ώρα", - hh : "%d ώρες", - d : "μία μέρα", - dd : "%d μέρες", - M : "ένας μήνας", - MM : "%d μήνες", - y : "ένας χρόνος", - yy : "%d χρόνια" - }, - ordinal : function (number) { - return number + 'η'; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/en-au.js b/vendors/moment/lang/en-au.js deleted file mode 100644 index 4d91e2569..000000000 --- a/vendors/moment/lang/en-au.js +++ /dev/null @@ -1,62 +0,0 @@ -// moment.js language configuration -// language : australian english (en-au) - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('en-au', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/en-ca.js b/vendors/moment/lang/en-ca.js deleted file mode 100644 index a97e9f396..000000000 --- a/vendors/moment/lang/en-ca.js +++ /dev/null @@ -1,59 +0,0 @@ -// moment.js language configuration -// language : canadian english (en-ca) -// author : Jonathan Abourbih : https://github.com/jonbca - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('en-ca', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - longDateFormat : { - LT : "h:mm A", - L : "YYYY-MM-DD", - LL : "D MMMM, YYYY", - LLL : "D MMMM, YYYY LT", - LLLL : "dddd, D MMMM, YYYY LT" - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); -})); diff --git a/vendors/moment/lang/en-gb.js b/vendors/moment/lang/en-gb.js deleted file mode 100644 index 3a7907be5..000000000 --- a/vendors/moment/lang/en-gb.js +++ /dev/null @@ -1,63 +0,0 @@ -// moment.js language configuration -// language : great britain english (en-gb) -// author : Chris Gedrim : https://github.com/chrisgedrim - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('en-gb', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/eo.js b/vendors/moment/lang/eo.js deleted file mode 100644 index 03b1abff1..000000000 --- a/vendors/moment/lang/eo.js +++ /dev/null @@ -1,65 +0,0 @@ -// moment.js language configuration -// language : esperanto (eo) -// author : Colin Dean : https://github.com/colindean -// komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko. -// Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('eo', { - months : "januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"), - weekdays : "Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"), - weekdaysShort : "Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D[-an de] MMMM, YYYY", - LLL : "D[-an de] MMMM, YYYY LT", - LLLL : "dddd, [la] D[-an de] MMMM, YYYY LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'p.t.m.' : 'P.T.M.'; - } else { - return isLower ? 'a.t.m.' : 'A.T.M.'; - } - }, - calendar : { - sameDay : '[Hodiaŭ je] LT', - nextDay : '[Morgaŭ je] LT', - nextWeek : 'dddd [je] LT', - lastDay : '[Hieraŭ je] LT', - lastWeek : '[pasinta] dddd [je] LT', - sameElse : 'L' - }, - relativeTime : { - future : "je %s", - past : "antaŭ %s", - s : "sekundoj", - m : "minuto", - mm : "%d minutoj", - h : "horo", - hh : "%d horoj", - d : "tago",//ne 'diurno', ĉar estas uzita por proksimumo - dd : "%d tagoj", - M : "monato", - MM : "%d monatoj", - y : "jaro", - yy : "%d jaroj" - }, - ordinal : "%da", - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/es.js b/vendors/moment/lang/es.js deleted file mode 100644 index 67432ca3e..000000000 --- a/vendors/moment/lang/es.js +++ /dev/null @@ -1,75 +0,0 @@ -// moment.js language configuration -// language : spanish (es) -// author : Julio Napurí : https://github.com/julionc - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var monthsShortDot = "ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"), - monthsShort = "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"); - - return moment.lang('es', { - months : "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShort[m.month()]; - } else { - return monthsShortDot[m.month()]; - } - }, - weekdays : "domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"), - weekdaysShort : "dom._lun._mar._mié._jue._vie._sáb.".split("_"), - weekdaysMin : "Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [del] YYYY", - LLL : "D [de] MMMM [del] YYYY LT", - LLLL : "dddd, D [de] MMMM [del] YYYY LT" - }, - calendar : { - sameDay : function () { - return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextDay : function () { - return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastDay : function () { - return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : "en %s", - past : "hace %s", - s : "unos segundos", - m : "un minuto", - mm : "%d minutos", - h : "una hora", - hh : "%d horas", - d : "un día", - dd : "%d días", - M : "un mes", - MM : "%d meses", - y : "un año", - yy : "%d años" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/et.js b/vendors/moment/lang/et.js deleted file mode 100644 index fb410ef44..000000000 --- a/vendors/moment/lang/et.js +++ /dev/null @@ -1,76 +0,0 @@ -// moment.js language configuration -// language : estonian (et) -// author : Henry Kehlmann : https://github.com/madhenry -// improvements : Illimar Tambek : https://github.com/ragulka - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'], - 'm' : ['ühe minuti', 'üks minut'], - 'mm': [number + ' minuti', number + ' minutit'], - 'h' : ['ühe tunni', 'tund aega', 'üks tund'], - 'hh': [number + ' tunni', number + ' tundi'], - 'd' : ['ühe päeva', 'üks päev'], - 'M' : ['kuu aja', 'kuu aega', 'üks kuu'], - 'MM': [number + ' kuu', number + ' kuud'], - 'y' : ['ühe aasta', 'aasta', 'üks aasta'], - 'yy': [number + ' aasta', number + ' aastat'] - }; - if (withoutSuffix) { - return format[key][2] ? format[key][2] : format[key][1]; - } - return isFuture ? format[key][0] : format[key][1]; - } - - return moment.lang('et', { - months : "jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"), - monthsShort : "jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"), - weekdays : "pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"), - weekdaysShort : "P_E_T_K_N_R_L".split("_"), - weekdaysMin : "P_E_T_K_N_R_L".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[Täna,] LT', - nextDay : '[Homme,] LT', - nextWeek : '[Järgmine] dddd LT', - lastDay : '[Eile,] LT', - lastWeek : '[Eelmine] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s pärast", - past : "%s tagasi", - s : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : '%d päeva', - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/eu.js b/vendors/moment/lang/eu.js deleted file mode 100644 index 659b739bf..000000000 --- a/vendors/moment/lang/eu.js +++ /dev/null @@ -1,60 +0,0 @@ -// moment.js language configuration -// language : euskara (eu) -// author : Eneko Illarramendi : https://github.com/eillarra - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('eu', { - months : "urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"), - monthsShort : "urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"), - weekdays : "igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"), - weekdaysShort : "ig._al._ar._az._og._ol._lr.".split("_"), - weekdaysMin : "ig_al_ar_az_og_ol_lr".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "YYYY[ko] MMMM[ren] D[a]", - LLL : "YYYY[ko] MMMM[ren] D[a] LT", - LLLL : "dddd, YYYY[ko] MMMM[ren] D[a] LT", - l : "YYYY-M-D", - ll : "YYYY[ko] MMM D[a]", - lll : "YYYY[ko] MMM D[a] LT", - llll : "ddd, YYYY[ko] MMM D[a] LT" - }, - calendar : { - sameDay : '[gaur] LT[etan]', - nextDay : '[bihar] LT[etan]', - nextWeek : 'dddd LT[etan]', - lastDay : '[atzo] LT[etan]', - lastWeek : '[aurreko] dddd LT[etan]', - sameElse : 'L' - }, - relativeTime : { - future : "%s barru", - past : "duela %s", - s : "segundo batzuk", - m : "minutu bat", - mm : "%d minutu", - h : "ordu bat", - hh : "%d ordu", - d : "egun bat", - dd : "%d egun", - M : "hilabete bat", - MM : "%d hilabete", - y : "urte bat", - yy : "%d urte" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/fa.js b/vendors/moment/lang/fa.js deleted file mode 100644 index 4a690c407..000000000 --- a/vendors/moment/lang/fa.js +++ /dev/null @@ -1,97 +0,0 @@ -// moment.js language configuration -// language : Persian Language -// author : Ebrahim Byagowi : https://github.com/ebraminio - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var symbolMap = { - '1': '۱', - '2': '۲', - '3': '۳', - '4': '۴', - '5': '۵', - '6': '۶', - '7': '۷', - '8': '۸', - '9': '۹', - '0': '۰' - }, numberMap = { - '۱': '1', - '۲': '2', - '۳': '3', - '۴': '4', - '۵': '5', - '۶': '6', - '۷': '7', - '۸': '8', - '۹': '9', - '۰': '0' - }; - - return moment.lang('fa', { - months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'), - longDateFormat : { - LT : 'HH:mm', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY LT', - LLLL : 'dddd, D MMMM YYYY LT' - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "قبل از ظهر"; - } else { - return "بعد از ظهر"; - } - }, - calendar : { - sameDay : '[امروز ساعت] LT', - nextDay : '[فردا ساعت] LT', - nextWeek : 'dddd [ساعت] LT', - lastDay : '[دیروز ساعت] LT', - lastWeek : 'dddd [پیش] [ساعت] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'در %s', - past : '%s پیش', - s : 'چندین ثانیه', - m : 'یک دقیقه', - mm : '%d دقیقه', - h : 'یک ساعت', - hh : '%d ساعت', - d : 'یک روز', - dd : '%d روز', - M : 'یک ماه', - MM : '%d ماه', - y : 'یک سال', - yy : '%d سال' - }, - preparse: function (string) { - return string.replace(/[۰-۹]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - ordinal : '%dم', - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/fi.js b/vendors/moment/lang/fi.js deleted file mode 100644 index 49f477c08..000000000 --- a/vendors/moment/lang/fi.js +++ /dev/null @@ -1,103 +0,0 @@ -// moment.js language configuration -// language : finnish (fi) -// author : Tarmo Aidantausta : https://github.com/bleadof - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '), - numbersFuture = ['nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden', - numbersPast[7], numbersPast[8], numbersPast[9]]; - - function translate(number, withoutSuffix, key, isFuture) { - var result = ""; - switch (key) { - case 's': - return isFuture ? 'muutaman sekunnin' : 'muutama sekunti'; - case 'm': - return isFuture ? 'minuutin' : 'minuutti'; - case 'mm': - result = isFuture ? 'minuutin' : 'minuuttia'; - break; - case 'h': - return isFuture ? 'tunnin' : 'tunti'; - case 'hh': - result = isFuture ? 'tunnin' : 'tuntia'; - break; - case 'd': - return isFuture ? 'päivän' : 'päivä'; - case 'dd': - result = isFuture ? 'päivän' : 'päivää'; - break; - case 'M': - return isFuture ? 'kuukauden' : 'kuukausi'; - case 'MM': - result = isFuture ? 'kuukauden' : 'kuukautta'; - break; - case 'y': - return isFuture ? 'vuoden' : 'vuosi'; - case 'yy': - result = isFuture ? 'vuoden' : 'vuotta'; - break; - } - result = verbalNumber(number, isFuture) + " " + result; - return result; - } - - function verbalNumber(number, isFuture) { - return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number; - } - - return moment.lang('fi', { - months : "tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"), - monthsShort : "tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"), - weekdays : "sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"), - weekdaysShort : "su_ma_ti_ke_to_pe_la".split("_"), - weekdaysMin : "su_ma_ti_ke_to_pe_la".split("_"), - longDateFormat : { - LT : "HH.mm", - L : "DD.MM.YYYY", - LL : "Do MMMM[ta] YYYY", - LLL : "Do MMMM[ta] YYYY, [klo] LT", - LLLL : "dddd, Do MMMM[ta] YYYY, [klo] LT", - l : "D.M.YYYY", - ll : "Do MMM YYYY", - lll : "Do MMM YYYY, [klo] LT", - llll : "ddd, Do MMM YYYY, [klo] LT" - }, - calendar : { - sameDay : '[tänään] [klo] LT', - nextDay : '[huomenna] [klo] LT', - nextWeek : 'dddd [klo] LT', - lastDay : '[eilen] [klo] LT', - lastWeek : '[viime] dddd[na] [klo] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s päästä", - past : "%s sitten", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : "%d.", - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/fo.js b/vendors/moment/lang/fo.js deleted file mode 100644 index 2f1cbb815..000000000 --- a/vendors/moment/lang/fo.js +++ /dev/null @@ -1,56 +0,0 @@ -// moment.js language configuration -// language : faroese (fo) -// author : Ragnar Johannesen : https://github.com/ragnar123 - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('fo', { - months : "januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), - weekdays : "sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"), - weekdaysShort : "sun_mán_týs_mik_hós_frí_ley".split("_"), - weekdaysMin : "su_má_tý_mi_hó_fr_le".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D. MMMM, YYYY LT" - }, - calendar : { - sameDay : '[Í dag kl.] LT', - nextDay : '[Í morgin kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[Í gjár kl.] LT', - lastWeek : '[síðstu] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : "um %s", - past : "%s síðani", - s : "fá sekund", - m : "ein minutt", - mm : "%d minuttir", - h : "ein tími", - hh : "%d tímar", - d : "ein dagur", - dd : "%d dagar", - M : "ein mánaði", - MM : "%d mánaðir", - y : "eitt ár", - yy : "%d ár" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/fr-ca.js b/vendors/moment/lang/fr-ca.js deleted file mode 100644 index 3280d7945..000000000 --- a/vendors/moment/lang/fr-ca.js +++ /dev/null @@ -1,54 +0,0 @@ -// moment.js language configuration -// language : canadian french (fr-ca) -// author : Jonathan Abourbih : https://github.com/jonbca - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('fr-ca', { - months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), - monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), - weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), - weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[Aujourd'hui à] LT", - nextDay: '[Demain à] LT', - nextWeek: 'dddd [à] LT', - lastDay: '[Hier à] LT', - lastWeek: 'dddd [dernier à] LT', - sameElse: 'L' - }, - relativeTime : { - future : "dans %s", - past : "il y a %s", - s : "quelques secondes", - m : "une minute", - mm : "%d minutes", - h : "une heure", - hh : "%d heures", - d : "un jour", - dd : "%d jours", - M : "un mois", - MM : "%d mois", - y : "un an", - yy : "%d ans" - }, - ordinal : function (number) { - return number + (number === 1 ? 'er' : ''); - } - }); -})); diff --git a/vendors/moment/lang/fr.js b/vendors/moment/lang/fr.js deleted file mode 100644 index 6b3dc526e..000000000 --- a/vendors/moment/lang/fr.js +++ /dev/null @@ -1,58 +0,0 @@ -// moment.js language configuration -// language : french (fr) -// author : John Fischer : https://github.com/jfroffice - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('fr', { - months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), - monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), - weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), - weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[Aujourd'hui à] LT", - nextDay: '[Demain à] LT', - nextWeek: 'dddd [à] LT', - lastDay: '[Hier à] LT', - lastWeek: 'dddd [dernier à] LT', - sameElse: 'L' - }, - relativeTime : { - future : "dans %s", - past : "il y a %s", - s : "quelques secondes", - m : "une minute", - mm : "%d minutes", - h : "une heure", - hh : "%d heures", - d : "un jour", - dd : "%d jours", - M : "un mois", - MM : "%d mois", - y : "un an", - yy : "%d ans" - }, - ordinal : function (number) { - return number + (number === 1 ? 'er' : ''); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/gl.js b/vendors/moment/lang/gl.js deleted file mode 100644 index 8b141278e..000000000 --- a/vendors/moment/lang/gl.js +++ /dev/null @@ -1,71 +0,0 @@ -// moment.js language configuration -// language : galician (gl) -// author : Juan G. Hurtado : https://github.com/juanghurtado - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('gl', { - months : "Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"), - monthsShort : "Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"), - weekdays : "Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"), - weekdaysShort : "Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"), - weekdaysMin : "Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay : function () { - return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextDay : function () { - return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextWeek : function () { - return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - lastDay : function () { - return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT'; - }, - lastWeek : function () { - return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : function (str) { - if (str === "uns segundos") { - return "nuns segundos"; - } - return "en " + str; - }, - past : "hai %s", - s : "uns segundos", - m : "un minuto", - mm : "%d minutos", - h : "unha hora", - hh : "%d horas", - d : "un día", - dd : "%d días", - M : "un mes", - MM : "%d meses", - y : "un ano", - yy : "%d anos" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/he.js b/vendors/moment/lang/he.js deleted file mode 100644 index b85dbe858..000000000 --- a/vendors/moment/lang/he.js +++ /dev/null @@ -1,77 +0,0 @@ -// moment.js language configuration -// language : Hebrew (he) -// author : Tomer Cohen : https://github.com/tomer -// author : Moshe Simantov : https://github.com/DevelopmentIL -// author : Tal Ater : https://github.com/TalAter - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('he', { - months : "ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"), - monthsShort : "ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"), - weekdays : "ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"), - weekdaysShort : "א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"), - weekdaysMin : "א_ב_ג_ד_ה_ו_ש".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [ב]MMMM YYYY", - LLL : "D [ב]MMMM YYYY LT", - LLLL : "dddd, D [ב]MMMM YYYY LT", - l : "D/M/YYYY", - ll : "D MMM YYYY", - lll : "D MMM YYYY LT", - llll : "ddd, D MMM YYYY LT" - }, - calendar : { - sameDay : '[היום ב־]LT', - nextDay : '[מחר ב־]LT', - nextWeek : 'dddd [בשעה] LT', - lastDay : '[אתמול ב־]LT', - lastWeek : '[ביום] dddd [האחרון בשעה] LT', - sameElse : 'L' - }, - relativeTime : { - future : "בעוד %s", - past : "לפני %s", - s : "מספר שניות", - m : "דקה", - mm : "%d דקות", - h : "שעה", - hh : function (number) { - if (number === 2) { - return "שעתיים"; - } - return number + " שעות"; - }, - d : "יום", - dd : function (number) { - if (number === 2) { - return "יומיים"; - } - return number + " ימים"; - }, - M : "חודש", - MM : function (number) { - if (number === 2) { - return "חודשיים"; - } - return number + " חודשים"; - }, - y : "שנה", - yy : function (number) { - if (number === 2) { - return "שנתיים"; - } - return number + " שנים"; - } - } - }); -})); diff --git a/vendors/moment/lang/hi.js b/vendors/moment/lang/hi.js deleted file mode 100644 index 8e6e99c19..000000000 --- a/vendors/moment/lang/hi.js +++ /dev/null @@ -1,105 +0,0 @@ -// moment.js language configuration -// language : hindi (hi) -// author : Mayank Singhal : https://github.com/mayanksinghal - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - return moment.lang('hi', { - months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split("_"), - monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split("_"), - weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split("_"), - weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split("_"), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split("_"), - longDateFormat : { - LT : "A h:mm बजे", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[कल] LT', - nextWeek : 'dddd, LT', - lastDay : '[कल] LT', - lastWeek : '[पिछले] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s में", - past : "%s पहले", - s : "कुछ ही क्षण", - m : "एक मिनट", - mm : "%d मिनट", - h : "एक घंटा", - hh : "%d घंटे", - d : "एक दिन", - dd : "%d दिन", - M : "एक महीने", - MM : "%d महीने", - y : "एक वर्ष", - yy : "%d वर्ष" - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // Hindi notation for meridiems are quite fuzzy in practice. While there exists - // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi. - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "रात"; - } else if (hour < 10) { - return "सुबह"; - } else if (hour < 17) { - return "दोपहर"; - } else if (hour < 20) { - return "शाम"; - } else { - return "रात"; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/hr.js b/vendors/moment/lang/hr.js deleted file mode 100644 index 2e3bf1128..000000000 --- a/vendors/moment/lang/hr.js +++ /dev/null @@ -1,140 +0,0 @@ -// moment.js language configuration -// language : hrvatski (hr) -// author : Bojan Marković : https://github.com/bmarkovic - -// based on (sl) translation by Robert Sedovšek - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - return moment.lang('hr', { - months : "sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"), - monthsShort : "sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"), - weekdays : "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), - weekdaysShort : "ned._pon._uto._sri._čet._pet._sub.".split("_"), - weekdaysMin : "ne_po_ut_sr_če_pe_su".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "za %s", - past : "prije %s", - s : "par sekundi", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "dan", - dd : translate, - M : "mjesec", - MM : translate, - y : "godinu", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/hu.js b/vendors/moment/lang/hu.js deleted file mode 100644 index 9833024cd..000000000 --- a/vendors/moment/lang/hu.js +++ /dev/null @@ -1,105 +0,0 @@ -// moment.js language configuration -// language : hungarian (hu) -// author : Adam Brunner : https://github.com/adambrunner - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' '); - - function translate(number, withoutSuffix, key, isFuture) { - var num = number, - suffix; - - switch (key) { - case 's': - return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce'; - case 'm': - return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'mm': - return num + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'h': - return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'hh': - return num + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'd': - return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'dd': - return num + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'M': - return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'MM': - return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'y': - return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve'); - case 'yy': - return num + (isFuture || withoutSuffix ? ' év' : ' éve'); - } - - return ''; - } - - function week(isFuture) { - return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]'; - } - - return moment.lang('hu', { - months : "január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"), - monthsShort : "jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"), - weekdays : "vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"), - weekdaysShort : "vas_hét_kedd_sze_csüt_pén_szo".split("_"), - weekdaysMin : "v_h_k_sze_cs_p_szo".split("_"), - longDateFormat : { - LT : "H:mm", - L : "YYYY.MM.DD.", - LL : "YYYY. MMMM D.", - LLL : "YYYY. MMMM D., LT", - LLLL : "YYYY. MMMM D., dddd LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 12) { - return isLower === true ? 'de' : 'DE'; - } else { - return isLower === true ? 'du' : 'DU'; - } - }, - calendar : { - sameDay : '[ma] LT[-kor]', - nextDay : '[holnap] LT[-kor]', - nextWeek : function () { - return week.call(this, true); - }, - lastDay : '[tegnap] LT[-kor]', - lastWeek : function () { - return week.call(this, false); - }, - sameElse : 'L' - }, - relativeTime : { - future : "%s múlva", - past : "%s", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/hy-am.js b/vendors/moment/lang/hy-am.js deleted file mode 100644 index 951655bc2..000000000 --- a/vendors/moment/lang/hy-am.js +++ /dev/null @@ -1,113 +0,0 @@ -// moment.js language configuration -// language : Armenian (hy-am) -// author : Armendarabyan : https://github.com/armendarabyan - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function monthsShortCaseReplace(m, format) { - var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'); - - return monthsShort[m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'); - - return weekdays[m.day()]; - } - - return moment.lang('hy-am', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), - weekdaysMin : "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY թ.", - LLL : "D MMMM YYYY թ., LT", - LLLL : "dddd, D MMMM YYYY թ., LT" - }, - calendar : { - sameDay: '[այսօր] LT', - nextDay: '[վաղը] LT', - lastDay: '[երեկ] LT', - nextWeek: function () { - return 'dddd [օրը ժամը] LT'; - }, - lastWeek: function () { - return '[անցած] dddd [օրը ժամը] LT'; - }, - sameElse: 'L' - }, - relativeTime : { - future : "%s հետո", - past : "%s առաջ", - s : "մի քանի վայրկյան", - m : "րոպե", - mm : "%d րոպե", - h : "ժամ", - hh : "%d ժամ", - d : "օր", - dd : "%d օր", - M : "ամիս", - MM : "%d ամիս", - y : "տարի", - yy : "%d տարի" - }, - - meridiem : function (hour) { - if (hour < 4) { - return "գիշերվա"; - } else if (hour < 12) { - return "առավոտվա"; - } else if (hour < 17) { - return "ցերեկվա"; - } else { - return "երեկոյան"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'DDD': - case 'w': - case 'W': - case 'DDDo': - if (number === 1) { - return number + '-ին'; - } - return number + '-րդ'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/id.js b/vendors/moment/lang/id.js deleted file mode 100644 index f186280d8..000000000 --- a/vendors/moment/lang/id.js +++ /dev/null @@ -1,67 +0,0 @@ -// moment.js language configuration -// language : Bahasa Indonesia (id) -// author : Mohammad Satrio Utomo : https://github.com/tyok -// reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('id', { - months : "Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"), - weekdays : "Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"), - weekdaysShort : "Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"), - weekdaysMin : "Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"), - longDateFormat : { - LT : "HH.mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY [pukul] LT", - LLLL : "dddd, D MMMM YYYY [pukul] LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'siang'; - } else if (hours < 19) { - return 'sore'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Besok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kemarin pukul] LT', - lastWeek : 'dddd [lalu pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : "dalam %s", - past : "%s yang lalu", - s : "beberapa detik", - m : "semenit", - mm : "%d menit", - h : "sejam", - hh : "%d jam", - d : "sehari", - dd : "%d hari", - M : "sebulan", - MM : "%d bulan", - y : "setahun", - yy : "%d tahun" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/is.js b/vendors/moment/lang/is.js deleted file mode 100644 index 5b6b2a821..000000000 --- a/vendors/moment/lang/is.js +++ /dev/null @@ -1,124 +0,0 @@ -// moment.js language configuration -// language : icelandic (is) -// author : Hinrik Örn Sigurðsson : https://github.com/hinrik - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function plural(n) { - if (n % 100 === 11) { - return true; - } else if (n % 10 === 1) { - return false; - } - return true; - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - switch (key) { - case 's': - return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum'; - case 'm': - return withoutSuffix ? 'mínúta' : 'mínútu'; - case 'mm': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum'); - } else if (withoutSuffix) { - return result + 'mínúta'; - } - return result + 'mínútu'; - case 'hh': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum'); - } - return result + 'klukkustund'; - case 'd': - if (withoutSuffix) { - return 'dagur'; - } - return isFuture ? 'dag' : 'degi'; - case 'dd': - if (plural(number)) { - if (withoutSuffix) { - return result + 'dagar'; - } - return result + (isFuture ? 'daga' : 'dögum'); - } else if (withoutSuffix) { - return result + 'dagur'; - } - return result + (isFuture ? 'dag' : 'degi'); - case 'M': - if (withoutSuffix) { - return 'mánuður'; - } - return isFuture ? 'mánuð' : 'mánuði'; - case 'MM': - if (plural(number)) { - if (withoutSuffix) { - return result + 'mánuðir'; - } - return result + (isFuture ? 'mánuði' : 'mánuðum'); - } else if (withoutSuffix) { - return result + 'mánuður'; - } - return result + (isFuture ? 'mánuð' : 'mánuði'); - case 'y': - return withoutSuffix || isFuture ? 'ár' : 'ári'; - case 'yy': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); - } - return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); - } - } - - return moment.lang('is', { - months : "janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"), - monthsShort : "jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"), - weekdays : "sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"), - weekdaysShort : "sun_mán_þri_mið_fim_fös_lau".split("_"), - weekdaysMin : "Su_Má_Þr_Mi_Fi_Fö_La".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY [kl.] LT", - LLLL : "dddd, D. MMMM YYYY [kl.] LT" - }, - calendar : { - sameDay : '[í dag kl.] LT', - nextDay : '[á morgun kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[í gær kl.] LT', - lastWeek : '[síðasta] dddd [kl.] LT', - sameElse : 'L' - }, - relativeTime : { - future : "eftir %s", - past : "fyrir %s síðan", - s : translate, - m : translate, - mm : translate, - h : "klukkustund", - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/it.js b/vendors/moment/lang/it.js deleted file mode 100644 index 84b7698be..000000000 --- a/vendors/moment/lang/it.js +++ /dev/null @@ -1,59 +0,0 @@ -// moment.js language configuration -// language : italian (it) -// author : Lorenzo : https://github.com/aliem -// author: Mattia Larentis: https://github.com/nostalgiaz - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('it', { - months : "Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre".split("_"), - monthsShort : "Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"), - weekdays : "Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"), - weekdaysShort : "Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"), - weekdaysMin : "D_L_Ma_Me_G_V_S".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay: '[Oggi alle] LT', - nextDay: '[Domani alle] LT', - nextWeek: 'dddd [alle] LT', - lastDay: '[Ieri alle] LT', - lastWeek: '[lo scorso] dddd [alle] LT', - sameElse: 'L' - }, - relativeTime : { - future : function (s) { - return ((/^[0-9].+$/).test(s) ? "tra" : "in") + " " + s; - }, - past : "%s fa", - s : "alcuni secondi", - m : "un minuto", - mm : "%d minuti", - h : "un'ora", - hh : "%d ore", - d : "un giorno", - dd : "%d giorni", - M : "un mese", - MM : "%d mesi", - y : "un anno", - yy : "%d anni" - }, - ordinal: '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ja.js b/vendors/moment/lang/ja.js deleted file mode 100644 index 9cd7e9e98..000000000 --- a/vendors/moment/lang/ja.js +++ /dev/null @@ -1,58 +0,0 @@ -// moment.js language configuration -// language : japanese (ja) -// author : LI Long : https://github.com/baryon - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ja', { - months : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"), - weekdaysShort : "日_月_火_水_木_金_土".split("_"), - weekdaysMin : "日_月_火_水_木_金_土".split("_"), - longDateFormat : { - LT : "Ah時m分", - L : "YYYY/MM/DD", - LL : "YYYY年M月D日", - LLL : "YYYY年M月D日LT", - LLLL : "YYYY年M月D日LT dddd" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "午前"; - } else { - return "午後"; - } - }, - calendar : { - sameDay : '[今日] LT', - nextDay : '[明日] LT', - nextWeek : '[来週]dddd LT', - lastDay : '[昨日] LT', - lastWeek : '[前週]dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s後", - past : "%s前", - s : "数秒", - m : "1分", - mm : "%d分", - h : "1時間", - hh : "%d時間", - d : "1日", - dd : "%d日", - M : "1ヶ月", - MM : "%dヶ月", - y : "1年", - yy : "%d年" - } - }); -})); diff --git a/vendors/moment/lang/ka.js b/vendors/moment/lang/ka.js deleted file mode 100644 index 0cebdaae2..000000000 --- a/vendors/moment/lang/ka.js +++ /dev/null @@ -1,108 +0,0 @@ -// moment.js language configuration -// language : Georgian (ka) -// author : Irakli Janiashvili : https://github.com/irakli-janiashvili - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') - }, - - nounCase = (/D[oD] *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - 'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_') - }, - - nounCase = (/(წინა|შემდეგ)/).test(format) ? - 'accusative' : - 'nominative'; - - return weekdays[nounCase][m.day()]; - } - - return moment.lang('ka', { - months : monthsCaseReplace, - monthsShort : "იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"), - weekdays : weekdaysCaseReplace, - weekdaysShort : "კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"), - weekdaysMin : "კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"), - longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[დღეს] LT[-ზე]', - nextDay : '[ხვალ] LT[-ზე]', - lastDay : '[გუშინ] LT[-ზე]', - nextWeek : '[შემდეგ] dddd LT[-ზე]', - lastWeek : '[წინა] dddd LT-ზე', - sameElse : 'L' - }, - relativeTime : { - future : function (s) { - return (/(წამი|წუთი|საათი|წელი)/).test(s) ? - s.replace(/ი$/, "ში") : - s + "ში"; - }, - past : function (s) { - if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) { - return s.replace(/(ი|ე)$/, "ის წინ"); - } - if ((/წელი/).test(s)) { - return s.replace(/წელი$/, "წლის წინ"); - } - }, - s : "რამდენიმე წამი", - m : "წუთი", - mm : "%d წუთი", - h : "საათი", - hh : "%d საათი", - d : "დღე", - dd : "%d დღე", - M : "თვე", - MM : "%d თვე", - y : "წელი", - yy : "%d წელი" - }, - ordinal : function (number) { - if (number === 0) { - return number; - } - - if (number === 1) { - return number + "-ლი"; - } - - if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) { - return "მე-" + number; - } - - return number + "-ე"; - }, - week : { - dow : 1, - doy : 7 - } - }); -})); diff --git a/vendors/moment/lang/km.js b/vendors/moment/lang/km.js deleted file mode 100644 index 0759c8f1d..000000000 --- a/vendors/moment/lang/km.js +++ /dev/null @@ -1,55 +0,0 @@ -// moment.js language configuration -// language : khmer (km) -// author : Kruy Vanna : https://github.com/kruyvanna - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('km', { - months: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), - monthsShort: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), - weekdays: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - weekdaysShort: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - weekdaysMin: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - longDateFormat: { - LT: "HH:mm", - L: "DD/MM/YYYY", - LL: "D MMMM YYYY", - LLL: "D MMMM YYYY LT", - LLLL: "dddd, D MMMM YYYY LT" - }, - calendar: { - sameDay: '[ថ្ងៃនៈ ម៉ោង] LT', - nextDay: '[ស្អែក ម៉ោង] LT', - nextWeek: 'dddd [ម៉ោង] LT', - lastDay: '[ម្សិលមិញ ម៉ោង] LT', - lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', - sameElse: 'L' - }, - relativeTime: { - future: "%sទៀត", - past: "%sមុន", - s: "ប៉ុន្មានវិនាទី", - m: "មួយនាទី", - mm: "%d នាទី", - h: "មួយម៉ោង", - hh: "%d ម៉ោង", - d: "មួយថ្ងៃ", - dd: "%d ថ្ងៃ", - M: "មួយខែ", - MM: "%d ខែ", - y: "មួយឆ្នាំ", - yy: "%d ឆ្នាំ" - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ko.js b/vendors/moment/lang/ko.js deleted file mode 100644 index 3b469df33..000000000 --- a/vendors/moment/lang/ko.js +++ /dev/null @@ -1,63 +0,0 @@ -// moment.js language configuration -// language : korean (ko) -// -// authors -// -// - Kyungwook, Park : https://github.com/kyungw00k -// - Jeeeyul Lee -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ko', { - months : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), - monthsShort : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), - weekdays : "일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"), - weekdaysShort : "일_월_화_수_목_금_토".split("_"), - weekdaysMin : "일_월_화_수_목_금_토".split("_"), - longDateFormat : { - LT : "A h시 mm분", - L : "YYYY.MM.DD", - LL : "YYYY년 MMMM D일", - LLL : "YYYY년 MMMM D일 LT", - LLLL : "YYYY년 MMMM D일 dddd LT" - }, - meridiem : function (hour, minute, isUpper) { - return hour < 12 ? '오전' : '오후'; - }, - calendar : { - sameDay : '오늘 LT', - nextDay : '내일 LT', - nextWeek : 'dddd LT', - lastDay : '어제 LT', - lastWeek : '지난주 dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s 후", - past : "%s 전", - s : "몇초", - ss : "%d초", - m : "일분", - mm : "%d분", - h : "한시간", - hh : "%d시간", - d : "하루", - dd : "%d일", - M : "한달", - MM : "%d달", - y : "일년", - yy : "%d년" - }, - ordinal : '%d일', - meridiemParse : /(오전|오후)/, - isPM : function (token) { - return token === "오후"; - } - }); -})); diff --git a/vendors/moment/lang/lb.js b/vendors/moment/lang/lb.js deleted file mode 100644 index 946ba13c2..000000000 --- a/vendors/moment/lang/lb.js +++ /dev/null @@ -1,160 +0,0 @@ -// moment.js language configuration -// language : Luxembourgish (lb) -// author : mweimerskirch : https://github.com/mweimerskirch - -// Note: Luxembourgish has a very particular phonological rule ("Eifeler Regel") that causes the -// deletion of the final "n" in certain contexts. That's what the "eifelerRegelAppliesToWeekday" -// and "eifelerRegelAppliesToNumber" methods are meant for - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eng Minutt', 'enger Minutt'], - 'h': ['eng Stonn', 'enger Stonn'], - 'd': ['een Dag', 'engem Dag'], - 'dd': [number + ' Deeg', number + ' Deeg'], - 'M': ['ee Mount', 'engem Mount'], - 'MM': [number + ' Méint', number + ' Méint'], - 'y': ['ee Joer', 'engem Joer'], - 'yy': [number + ' Joer', number + ' Joer'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - function processFutureTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return "a " + string; - } - return "an " + string; - } - - function processPastTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return "viru " + string; - } - return "virun " + string; - } - - function processLastWeek(string1) { - var weekday = this.format('d'); - if (eifelerRegelAppliesToWeekday(weekday)) { - return '[Leschte] dddd [um] LT'; - } - return '[Leschten] dddd [um] LT'; - } - - /** - * Returns true if the word before the given week day loses the "-n" ending. - * e.g. "Leschten Dënschdeg" but "Leschte Méindeg" - * - * @param weekday {integer} - * @returns {boolean} - */ - function eifelerRegelAppliesToWeekday(weekday) { - weekday = parseInt(weekday, 10); - switch (weekday) { - case 0: // Sonndeg - case 1: // Méindeg - case 3: // Mëttwoch - case 5: // Freideg - case 6: // Samschdeg - return true; - default: // 2 Dënschdeg, 4 Donneschdeg - return false; - } - } - - /** - * Returns true if the word before the given number loses the "-n" ending. - * e.g. "an 10 Deeg" but "a 5 Deeg" - * - * @param number {integer} - * @returns {boolean} - */ - function eifelerRegelAppliesToNumber(number) { - number = parseInt(number, 10); - if (isNaN(number)) { - return false; - } - if (number < 0) { - // Negative Number --> always true - return true; - } else if (number < 10) { - // Only 1 digit - if (4 <= number && number <= 7) { - return true; - } - return false; - } else if (number < 100) { - // 2 digits - var lastDigit = number % 10, firstDigit = number / 10; - if (lastDigit === 0) { - return eifelerRegelAppliesToNumber(firstDigit); - } - return eifelerRegelAppliesToNumber(lastDigit); - } else if (number < 10000) { - // 3 or 4 digits --> recursively check first digit - while (number >= 10) { - number = number / 10; - } - return eifelerRegelAppliesToNumber(number); - } else { - // Anything larger than 4 digits: recursively check first n-3 digits - number = number / 1000; - return eifelerRegelAppliesToNumber(number); - } - } - - return moment.lang('lb', { - months: "Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), - monthsShort: "Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), - weekdays: "Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"), - weekdaysShort: "So._Mé._Dë._Më._Do._Fr._Sa.".split("_"), - weekdaysMin: "So_Mé_Dë_Më_Do_Fr_Sa".split("_"), - longDateFormat: { - LT: "H:mm [Auer]", - L: "DD.MM.YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" - }, - calendar: { - sameDay: "[Haut um] LT", - sameElse: "L", - nextDay: '[Muer um] LT', - nextWeek: 'dddd [um] LT', - lastDay: '[Gëschter um] LT', - lastWeek: processLastWeek - }, - relativeTime: { - future: processFutureTime, - past: processPastTime, - s: "e puer Sekonnen", - m: processRelativeTime, - mm: "%d Minutten", - h: processRelativeTime, - hh: "%d Stonnen", - d: processRelativeTime, - dd: processRelativeTime, - M: processRelativeTime, - MM: processRelativeTime, - y: processRelativeTime, - yy: processRelativeTime - }, - ordinal: '%d.', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/lt.js b/vendors/moment/lang/lt.js deleted file mode 100644 index 3377375cd..000000000 --- a/vendors/moment/lang/lt.js +++ /dev/null @@ -1,118 +0,0 @@ -// moment.js language configuration -// language : Lithuanian (lt) -// author : Mindaugas Mozūras : https://github.com/mmozuras - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var units = { - "m" : "minutė_minutės_minutę", - "mm": "minutės_minučių_minutes", - "h" : "valanda_valandos_valandą", - "hh": "valandos_valandų_valandas", - "d" : "diena_dienos_dieną", - "dd": "dienos_dienų_dienas", - "M" : "mėnuo_mėnesio_mėnesį", - "MM": "mėnesiai_mėnesių_mėnesius", - "y" : "metai_metų_metus", - "yy": "metai_metų_metus" - }, - weekDays = "pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis_sekmadienis".split("_"); - - function translateSeconds(number, withoutSuffix, key, isFuture) { - if (withoutSuffix) { - return "kelios sekundės"; - } else { - return isFuture ? "kelių sekundžių" : "kelias sekundes"; - } - } - - function translateSingular(number, withoutSuffix, key, isFuture) { - return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); - } - - function special(number) { - return number % 10 === 0 || (number > 10 && number < 20); - } - - function forms(key) { - return units[key].split("_"); - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - if (number === 1) { - return result + translateSingular(number, withoutSuffix, key[0], isFuture); - } else if (withoutSuffix) { - return result + (special(number) ? forms(key)[1] : forms(key)[0]); - } else { - if (isFuture) { - return result + forms(key)[1]; - } else { - return result + (special(number) ? forms(key)[1] : forms(key)[2]); - } - } - } - - function relativeWeekDay(moment, format) { - var nominative = format.indexOf('dddd HH:mm') === -1, - weekDay = weekDays[moment.weekday()]; - - return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + "į"; - } - - return moment.lang("lt", { - months : "sausio_vasario_kovo_balandžio_gegužės_biržėlio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"), - monthsShort : "sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"), - weekdays : relativeWeekDay, - weekdaysShort : "Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"), - weekdaysMin : "S_P_A_T_K_Pn_Š".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "YYYY [m.] MMMM D [d.]", - LLL : "YYYY [m.] MMMM D [d.], LT [val.]", - LLLL : "YYYY [m.] MMMM D [d.], dddd, LT [val.]", - l : "YYYY-MM-DD", - ll : "YYYY [m.] MMMM D [d.]", - lll : "YYYY [m.] MMMM D [d.], LT [val.]", - llll : "YYYY [m.] MMMM D [d.], ddd, LT [val.]" - }, - calendar : { - sameDay : "[Šiandien] LT", - nextDay : "[Rytoj] LT", - nextWeek : "dddd LT", - lastDay : "[Vakar] LT", - lastWeek : "[Praėjusį] dddd LT", - sameElse : "L" - }, - relativeTime : { - future : "po %s", - past : "prieš %s", - s : translateSeconds, - m : translateSingular, - mm : translate, - h : translateSingular, - hh : translate, - d : translateSingular, - dd : translate, - M : translateSingular, - MM : translate, - y : translateSingular, - yy : translate - }, - ordinal : function (number) { - return number + '-oji'; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/lv.js b/vendors/moment/lang/lv.js deleted file mode 100644 index ffe25cfe4..000000000 --- a/vendors/moment/lang/lv.js +++ /dev/null @@ -1,77 +0,0 @@ -// moment.js language configuration -// language : latvian (lv) -// author : Kristaps Karlsons : https://github.com/skakri - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var units = { - 'mm': 'minūti_minūtes_minūte_minūtes', - 'hh': 'stundu_stundas_stunda_stundas', - 'dd': 'dienu_dienas_diena_dienas', - 'MM': 'mēnesi_mēnešus_mēnesis_mēneši', - 'yy': 'gadu_gadus_gads_gadi' - }; - - function format(word, number, withoutSuffix) { - var forms = word.split('_'); - if (withoutSuffix) { - return number % 10 === 1 && number !== 11 ? forms[2] : forms[3]; - } else { - return number % 10 === 1 && number !== 11 ? forms[0] : forms[1]; - } - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - return number + ' ' + format(units[key], number, withoutSuffix); - } - - return moment.lang('lv', { - months : "janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"), - weekdays : "svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"), - weekdaysShort : "Sv_P_O_T_C_Pk_S".split("_"), - weekdaysMin : "Sv_P_O_T_C_Pk_S".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "YYYY. [gada] D. MMMM", - LLL : "YYYY. [gada] D. MMMM, LT", - LLLL : "YYYY. [gada] D. MMMM, dddd, LT" - }, - calendar : { - sameDay : '[Šodien pulksten] LT', - nextDay : '[Rīt pulksten] LT', - nextWeek : 'dddd [pulksten] LT', - lastDay : '[Vakar pulksten] LT', - lastWeek : '[Pagājušā] dddd [pulksten] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s vēlāk", - past : "%s agrāk", - s : "dažas sekundes", - m : "minūti", - mm : relativeTimeWithPlural, - h : "stundu", - hh : relativeTimeWithPlural, - d : "dienu", - dd : relativeTimeWithPlural, - M : "mēnesi", - MM : relativeTimeWithPlural, - y : "gadu", - yy : relativeTimeWithPlural - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/mk.js b/vendors/moment/lang/mk.js deleted file mode 100644 index 5f272fa2d..000000000 --- a/vendors/moment/lang/mk.js +++ /dev/null @@ -1,86 +0,0 @@ -// moment.js language configuration -// language : macedonian (mk) -// author : Borislav Mickov : https://github.com/B0k0 - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('mk', { - months : "јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"), - monthsShort : "јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"), - weekdays : "недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"), - weekdaysShort : "нед_пон_вто_сре_чет_пет_саб".split("_"), - weekdaysMin : "нe_пo_вт_ср_че_пе_сa".split("_"), - longDateFormat : { - LT : "H:mm", - L : "D.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Денес во] LT', - nextDay : '[Утре во] LT', - nextWeek : 'dddd [во] LT', - lastDay : '[Вчера во] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[Во изминатата] dddd [во] LT'; - case 1: - case 2: - case 4: - case 5: - return '[Во изминатиот] dddd [во] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "после %s", - past : "пред %s", - s : "неколку секунди", - m : "минута", - mm : "%d минути", - h : "час", - hh : "%d часа", - d : "ден", - dd : "%d дена", - M : "месец", - MM : "%d месеци", - y : "година", - yy : "%d години" - }, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ml.js b/vendors/moment/lang/ml.js deleted file mode 100644 index cc7db9a30..000000000 --- a/vendors/moment/lang/ml.js +++ /dev/null @@ -1,64 +0,0 @@ -// moment.js language configuration -// language : malayalam (ml) -// author : Floyd Pink : https://github.com/floydpink - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ml', { - months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split("_"), - monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split("_"), - weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split("_"), - weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split("_"), - weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split("_"), - longDateFormat : { - LT : "A h:mm -നു", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[ഇന്ന്] LT', - nextDay : '[നാളെ] LT', - nextWeek : 'dddd, LT', - lastDay : '[ഇന്നലെ] LT', - lastWeek : '[കഴിഞ്ഞ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s കഴിഞ്ഞ്", - past : "%s മുൻപ്", - s : "അൽപ നിമിഷങ്ങൾ", - m : "ഒരു മിനിറ്റ്", - mm : "%d മിനിറ്റ്", - h : "ഒരു മണിക്കൂർ", - hh : "%d മണിക്കൂർ", - d : "ഒരു ദിവസം", - dd : "%d ദിവസം", - M : "ഒരു മാസം", - MM : "%d മാസം", - y : "ഒരു വർഷം", - yy : "%d വർഷം" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "രാത്രി"; - } else if (hour < 12) { - return "രാവിലെ"; - } else if (hour < 17) { - return "ഉച്ച കഴിഞ്ഞ്"; - } else if (hour < 20) { - return "വൈകുന്നേരം"; - } else { - return "രാത്രി"; - } - } - }); -})); diff --git a/vendors/moment/lang/mr.js b/vendors/moment/lang/mr.js deleted file mode 100644 index 0d1adfd64..000000000 --- a/vendors/moment/lang/mr.js +++ /dev/null @@ -1,104 +0,0 @@ -// moment.js language configuration -// language : Marathi (mr) -// author : Harshad Kale : https://github.com/kalehv - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - return moment.lang('mr', { - months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split("_"), - monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split("_"), - weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split("_"), - weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split("_"), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split("_"), - longDateFormat : { - LT : "A h:mm वाजता", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[उद्या] LT', - nextWeek : 'dddd, LT', - lastDay : '[काल] LT', - lastWeek: '[मागील] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s नंतर", - past : "%s पूर्वी", - s : "सेकंद", - m: "एक मिनिट", - mm: "%d मिनिटे", - h : "एक तास", - hh : "%d तास", - d : "एक दिवस", - dd : "%d दिवस", - M : "एक महिना", - MM : "%d महिने", - y : "एक वर्ष", - yy : "%d वर्षे" - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiem: function (hour, minute, isLower) - { - if (hour < 4) { - return "रात्री"; - } else if (hour < 10) { - return "सकाळी"; - } else if (hour < 17) { - return "दुपारी"; - } else if (hour < 20) { - return "सायंकाळी"; - } else { - return "रात्री"; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ms-my.js b/vendors/moment/lang/ms-my.js deleted file mode 100644 index 501d5aaa0..000000000 --- a/vendors/moment/lang/ms-my.js +++ /dev/null @@ -1,66 +0,0 @@ -// moment.js language configuration -// language : Bahasa Malaysia (ms-MY) -// author : Weldan Jamili : https://github.com/weldan - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ms-my', { - months : "Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"), - monthsShort : "Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"), - weekdays : "Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"), - weekdaysShort : "Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"), - weekdaysMin : "Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"), - longDateFormat : { - LT : "HH.mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY [pukul] LT", - LLLL : "dddd, D MMMM YYYY [pukul] LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'tengahari'; - } else if (hours < 19) { - return 'petang'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Esok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kelmarin pukul] LT', - lastWeek : 'dddd [lepas pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : "dalam %s", - past : "%s yang lepas", - s : "beberapa saat", - m : "seminit", - mm : "%d minit", - h : "sejam", - hh : "%d jam", - d : "sehari", - dd : "%d hari", - M : "sebulan", - MM : "%d bulan", - y : "setahun", - yy : "%d tahun" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/nb.js b/vendors/moment/lang/nb.js deleted file mode 100644 index 2f652efd1..000000000 --- a/vendors/moment/lang/nb.js +++ /dev/null @@ -1,57 +0,0 @@ -// moment.js language configuration -// language : norwegian bokmål (nb) -// authors : Espen Hovlandsdal : https://github.com/rexxars -// Sigurd Gartmann : https://github.com/sigurdga - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('nb', { - months : "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"), - weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), - weekdaysShort : "sø._ma._ti._on._to._fr._lø.".split("_"), - weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"), - longDateFormat : { - LT : "H.mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY [kl.] LT", - LLLL : "dddd D. MMMM YYYY [kl.] LT" - }, - calendar : { - sameDay: '[i dag kl.] LT', - nextDay: '[i morgen kl.] LT', - nextWeek: 'dddd [kl.] LT', - lastDay: '[i går kl.] LT', - lastWeek: '[forrige] dddd [kl.] LT', - sameElse: 'L' - }, - relativeTime : { - future : "om %s", - past : "for %s siden", - s : "noen sekunder", - m : "ett minutt", - mm : "%d minutter", - h : "en time", - hh : "%d timer", - d : "en dag", - dd : "%d dager", - M : "en måned", - MM : "%d måneder", - y : "ett år", - yy : "%d år" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ne.js b/vendors/moment/lang/ne.js deleted file mode 100644 index 1d57b8cbf..000000000 --- a/vendors/moment/lang/ne.js +++ /dev/null @@ -1,105 +0,0 @@ -// moment.js language configuration -// language : nepali/nepalese -// author : suvash : https://github.com/suvash - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - return moment.lang('ne', { - months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split("_"), - monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split("_"), - weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split("_"), - weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split("_"), - weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split("_"), - longDateFormat : { - LT : "Aको h:mm बजे", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 3) { - return "राती"; - } else if (hour < 10) { - return "बिहान"; - } else if (hour < 15) { - return "दिउँसो"; - } else if (hour < 18) { - return "बेलुका"; - } else if (hour < 20) { - return "साँझ"; - } else { - return "राती"; - } - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[भोली] LT', - nextWeek : '[आउँदो] dddd[,] LT', - lastDay : '[हिजो] LT', - lastWeek : '[गएको] dddd[,] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%sमा", - past : "%s अगाडी", - s : "केही समय", - m : "एक मिनेट", - mm : "%d मिनेट", - h : "एक घण्टा", - hh : "%d घण्टा", - d : "एक दिन", - dd : "%d दिन", - M : "एक महिना", - MM : "%d महिना", - y : "एक बर्ष", - yy : "%d बर्ष" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/nl.js b/vendors/moment/lang/nl.js deleted file mode 100644 index ffd454faf..000000000 --- a/vendors/moment/lang/nl.js +++ /dev/null @@ -1,67 +0,0 @@ -// moment.js language configuration -// language : dutch (nl) -// author : Joris Röling : https://github.com/jjupiter - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var monthsShortWithDots = "jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"), - monthsShortWithoutDots = "jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"); - - return moment.lang('nl', { - months : "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShortWithoutDots[m.month()]; - } else { - return monthsShortWithDots[m.month()]; - } - }, - weekdays : "zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"), - weekdaysShort : "zo._ma._di._wo._do._vr._za.".split("_"), - weekdaysMin : "Zo_Ma_Di_Wo_Do_Vr_Za".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD-MM-YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: '[vandaag om] LT', - nextDay: '[morgen om] LT', - nextWeek: 'dddd [om] LT', - lastDay: '[gisteren om] LT', - lastWeek: '[afgelopen] dddd [om] LT', - sameElse: 'L' - }, - relativeTime : { - future : "over %s", - past : "%s geleden", - s : "een paar seconden", - m : "één minuut", - mm : "%d minuten", - h : "één uur", - hh : "%d uur", - d : "één dag", - dd : "%d dagen", - M : "één maand", - MM : "%d maanden", - y : "één jaar", - yy : "%d jaar" - }, - ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/nn.js b/vendors/moment/lang/nn.js deleted file mode 100644 index 8c1510855..000000000 --- a/vendors/moment/lang/nn.js +++ /dev/null @@ -1,56 +0,0 @@ -// moment.js language configuration -// language : norwegian nynorsk (nn) -// author : https://github.com/mechuwind - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('nn', { - months : "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), - weekdays : "sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"), - weekdaysShort : "sun_mån_tys_ons_tor_fre_lau".split("_"), - weekdaysMin : "su_må_ty_on_to_fr_lø".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: '[I dag klokka] LT', - nextDay: '[I morgon klokka] LT', - nextWeek: 'dddd [klokka] LT', - lastDay: '[I går klokka] LT', - lastWeek: '[Føregåande] dddd [klokka] LT', - sameElse: 'L' - }, - relativeTime : { - future : "om %s", - past : "for %s sidan", - s : "nokre sekund", - m : "eit minutt", - mm : "%d minutt", - h : "ein time", - hh : "%d timar", - d : "ein dag", - dd : "%d dagar", - M : "ein månad", - MM : "%d månader", - y : "eit år", - yy : "%d år" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/pl.js b/vendors/moment/lang/pl.js deleted file mode 100644 index 97770d2ad..000000000 --- a/vendors/moment/lang/pl.js +++ /dev/null @@ -1,98 +0,0 @@ -// moment.js language configuration -// language : polish (pl) -// author : Rafal Hirsz : https://github.com/evoL - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var monthsNominative = "styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"), - monthsSubjective = "stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"); - - function plural(n) { - return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1); - } - - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'minuta' : 'minutę'; - case 'mm': - return result + (plural(number) ? 'minuty' : 'minut'); - case 'h': - return withoutSuffix ? 'godzina' : 'godzinę'; - case 'hh': - return result + (plural(number) ? 'godziny' : 'godzin'); - case 'MM': - return result + (plural(number) ? 'miesiące' : 'miesięcy'); - case 'yy': - return result + (plural(number) ? 'lata' : 'lat'); - } - } - - return moment.lang('pl', { - months : function (momentToFormat, format) { - if (/D MMMM/.test(format)) { - return monthsSubjective[momentToFormat.month()]; - } else { - return monthsNominative[momentToFormat.month()]; - } - }, - monthsShort : "sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"), - weekdays : "niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"), - weekdaysShort : "nie_pon_wt_śr_czw_pt_sb".split("_"), - weekdaysMin : "N_Pn_Wt_Śr_Cz_Pt_So".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay: '[Dziś o] LT', - nextDay: '[Jutro o] LT', - nextWeek: '[W] dddd [o] LT', - lastDay: '[Wczoraj o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[W zeszłą niedzielę o] LT'; - case 3: - return '[W zeszłą środę o] LT'; - case 6: - return '[W zeszłą sobotę o] LT'; - default: - return '[W zeszły] dddd [o] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "za %s", - past : "%s temu", - s : "kilka sekund", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "1 dzień", - dd : '%d dni', - M : "miesiąc", - MM : translate, - y : "rok", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/pt-br.js b/vendors/moment/lang/pt-br.js deleted file mode 100644 index 8f142d19e..000000000 --- a/vendors/moment/lang/pt-br.js +++ /dev/null @@ -1,56 +0,0 @@ -// moment.js language configuration -// language : brazilian portuguese (pt-br) -// author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('pt-br', { - months : "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), - monthsShort : "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), - weekdays : "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), - weekdaysShort : "dom_seg_ter_qua_qui_sex_sáb".split("_"), - weekdaysMin : "dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [de] YYYY", - LLL : "D [de] MMMM [de] YYYY [às] LT", - LLLL : "dddd, D [de] MMMM [de] YYYY [às] LT" - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : "em %s", - past : "%s atrás", - s : "segundos", - m : "um minuto", - mm : "%d minutos", - h : "uma hora", - hh : "%d horas", - d : "um dia", - dd : "%d dias", - M : "um mês", - MM : "%d meses", - y : "um ano", - yy : "%d anos" - }, - ordinal : '%dº' - }); -})); diff --git a/vendors/moment/lang/pt.js b/vendors/moment/lang/pt.js deleted file mode 100644 index 77e1cad31..000000000 --- a/vendors/moment/lang/pt.js +++ /dev/null @@ -1,60 +0,0 @@ -// moment.js language configuration -// language : portuguese (pt) -// author : Jefferson : https://github.com/jalex79 - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('pt', { - months : "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), - monthsShort : "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), - weekdays : "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), - weekdaysShort : "dom_seg_ter_qua_qui_sex_sáb".split("_"), - weekdaysMin : "dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [de] YYYY", - LLL : "D [de] MMMM [de] YYYY LT", - LLLL : "dddd, D [de] MMMM [de] YYYY LT" - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : "em %s", - past : "%s atrás", - s : "segundos", - m : "um minuto", - mm : "%d minutos", - h : "uma hora", - hh : "%d horas", - d : "um dia", - dd : "%d dias", - M : "um mês", - MM : "%d meses", - y : "um ano", - yy : "%d anos" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ro.js b/vendors/moment/lang/ro.js deleted file mode 100644 index fc2750990..000000000 --- a/vendors/moment/lang/ro.js +++ /dev/null @@ -1,72 +0,0 @@ -// moment.js language configuration -// language : romanian (ro) -// author : Vlad Gurdiga : https://github.com/gurdiga -// author : Valentin Agachi : https://github.com/avaly - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': 'minute', - 'hh': 'ore', - 'dd': 'zile', - 'MM': 'luni', - 'yy': 'ani' - }, - separator = ' '; - if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) { - separator = ' de '; - } - - return number + separator + format[key]; - } - - return moment.lang('ro', { - months : "ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"), - monthsShort : "ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"), - weekdays : "duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"), - weekdaysShort : "Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"), - weekdaysMin : "Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY H:mm", - LLLL : "dddd, D MMMM YYYY H:mm" - }, - calendar : { - sameDay: "[azi la] LT", - nextDay: '[mâine la] LT', - nextWeek: 'dddd [la] LT', - lastDay: '[ieri la] LT', - lastWeek: '[fosta] dddd [la] LT', - sameElse: 'L' - }, - relativeTime : { - future : "peste %s", - past : "%s în urmă", - s : "câteva secunde", - m : "un minut", - mm : relativeTimeWithPlural, - h : "o oră", - hh : relativeTimeWithPlural, - d : "o zi", - dd : relativeTimeWithPlural, - M : "o lună", - MM : relativeTimeWithPlural, - y : "un an", - yy : relativeTimeWithPlural - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ru.js b/vendors/moment/lang/ru.js deleted file mode 100644 index ac5400da8..000000000 --- a/vendors/moment/lang/ru.js +++ /dev/null @@ -1,163 +0,0 @@ -// moment.js language configuration -// language : russian (ru) -// author : Viktorminator : https://github.com/Viktorminator -// Author : Menelion Elensúle : https://github.com/Oire - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', - 'hh': 'час_часа_часов', - 'dd': 'день_дня_дней', - 'MM': 'месяц_месяца_месяцев', - 'yy': 'год_года_лет' - }; - if (key === 'm') { - return withoutSuffix ? 'минута' : 'минуту'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function monthsShortCaseReplace(m, format) { - var monthsShort = { - 'nominative': 'янв_фев_мар_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return monthsShort[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_') - }, - - nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - - return weekdays[nounCase][m.day()]; - } - - return moment.lang('ru', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : "вс_пн_вт_ср_чт_пт_сб".split("_"), - weekdaysMin : "вс_пн_вт_ср_чт_пт_сб".split("_"), - monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i], - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY г.", - LLL : "D MMMM YYYY г., LT", - LLLL : "dddd, D MMMM YYYY г., LT" - }, - calendar : { - sameDay: '[Сегодня в] LT', - nextDay: '[Завтра в] LT', - lastDay: '[Вчера в] LT', - nextWeek: function () { - return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; - }, - lastWeek: function () { - switch (this.day()) { - case 0: - return '[В прошлое] dddd [в] LT'; - case 1: - case 2: - case 4: - return '[В прошлый] dddd [в] LT'; - case 3: - case 5: - case 6: - return '[В прошлую] dddd [в] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "через %s", - past : "%s назад", - s : "несколько секунд", - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : "час", - hh : relativeTimeWithPlural, - d : "день", - dd : relativeTimeWithPlural, - M : "месяц", - MM : relativeTimeWithPlural, - y : "год", - yy : relativeTimeWithPlural - }, - - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "ночи"; - } else if (hour < 12) { - return "утра"; - } else if (hour < 17) { - return "дня"; - } else { - return "вечера"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - return number + '-й'; - case 'D': - return number + '-го'; - case 'w': - case 'W': - return number + '-я'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/sk.js b/vendors/moment/lang/sk.js deleted file mode 100644 index ed8a41d48..000000000 --- a/vendors/moment/lang/sk.js +++ /dev/null @@ -1,156 +0,0 @@ -// moment.js language configuration -// language : slovak (sk) -// author : Martin Minka : https://github.com/k2s -// based on work of petrbela : https://github.com/petrbela - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var months = "január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"), - monthsShort = "jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"); - - function plural(n) { - return (n > 1) && (n < 5); - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minúty' : 'minút'); - } else { - return result + 'minútami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodín'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'deň' : 'dňom'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dni' : 'dní'); - } else { - return result + 'dňami'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'mesiace' : 'mesiacov'); - } else { - return result + 'mesiacmi'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokom'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'rokov'); - } else { - return result + 'rokmi'; - } - break; - } - } - - return moment.lang('sk', { - months : months, - monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), - weekdays : "nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"), - weekdaysShort : "ne_po_ut_st_št_pi_so".split("_"), - weekdaysMin : "ne_po_ut_st_št_pi_so".split("_"), - longDateFormat : { - LT: "H:mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd D. MMMM YYYY LT" - }, - calendar : { - sameDay: "[dnes o] LT", - nextDay: '[zajtra o] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v nedeľu o] LT'; - case 1: - case 2: - return '[v] dddd [o] LT'; - case 3: - return '[v stredu o] LT'; - case 4: - return '[vo štvrtok o] LT'; - case 5: - return '[v piatok o] LT'; - case 6: - return '[v sobotu o] LT'; - } - }, - lastDay: '[včera o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulú nedeľu o] LT'; - case 1: - case 2: - return '[minulý] dddd [o] LT'; - case 3: - return '[minulú stredu o] LT'; - case 4: - case 5: - return '[minulý] dddd [o] LT'; - case 6: - return '[minulú sobotu o] LT'; - } - }, - sameElse: "L" - }, - relativeTime : { - future : "za %s", - past : "pred %s", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/sl.js b/vendors/moment/lang/sl.js deleted file mode 100644 index d260f80d9..000000000 --- a/vendors/moment/lang/sl.js +++ /dev/null @@ -1,144 +0,0 @@ -// moment.js language configuration -// language : slovenian (sl) -// author : Robert Sedovšek : https://github.com/sedovsek - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'ena minuta' : 'eno minuto'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2) { - result += 'minuti'; - } else if (number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minut'; - } - return result; - case 'h': - return withoutSuffix ? 'ena ura' : 'eno uro'; - case 'hh': - if (number === 1) { - result += 'ura'; - } else if (number === 2) { - result += 'uri'; - } else if (number === 3 || number === 4) { - result += 'ure'; - } else { - result += 'ur'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dni'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mesec'; - } else if (number === 2) { - result += 'meseca'; - } else if (number === 3 || number === 4) { - result += 'mesece'; - } else { - result += 'mesecev'; - } - return result; - case 'yy': - if (number === 1) { - result += 'leto'; - } else if (number === 2) { - result += 'leti'; - } else if (number === 3 || number === 4) { - result += 'leta'; - } else { - result += 'let'; - } - return result; - } - } - - return moment.lang('sl', { - months : "januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"), - monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"), - weekdays : "nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"), - weekdaysShort : "ned._pon._tor._sre._čet._pet._sob.".split("_"), - weekdaysMin : "ne_po_to_sr_če_pe_so".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[danes ob] LT', - nextDay : '[jutri ob] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[v] [nedeljo] [ob] LT'; - case 3: - return '[v] [sredo] [ob] LT'; - case 6: - return '[v] [soboto] [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[v] dddd [ob] LT'; - } - }, - lastDay : '[včeraj ob] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[prejšnja] dddd [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prejšnji] dddd [ob] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "čez %s", - past : "%s nazaj", - s : "nekaj sekund", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "en dan", - dd : translate, - M : "en mesec", - MM : translate, - y : "eno leto", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/sq.js b/vendors/moment/lang/sq.js deleted file mode 100644 index 0d3cdcf7c..000000000 --- a/vendors/moment/lang/sq.js +++ /dev/null @@ -1,61 +0,0 @@ -// moment.js language configuration -// language : Albanian (sq) -// author : Flakërim Ismani : https://github.com/flakerimi -// author: Menelion Elensúle: https://github.com/Oire (tests) -// author : Oerd Cukalla : https://github.com/oerd (fixes) - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('sq', { - months : "Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"), - monthsShort : "Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"), - weekdays : "E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"), - weekdaysShort : "Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"), - weekdaysMin : "D_H_Ma_Më_E_P_Sh".split("_"), - meridiem : function (hours, minutes, isLower) { - return hours < 12 ? 'PD' : 'MD'; - }, - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Sot në] LT', - nextDay : '[Nesër në] LT', - nextWeek : 'dddd [në] LT', - lastDay : '[Dje në] LT', - lastWeek : 'dddd [e kaluar në] LT', - sameElse : 'L' - }, - relativeTime : { - future : "në %s", - past : "%s më parë", - s : "disa sekonda", - m : "një minutë", - mm : "%d minuta", - h : "një orë", - hh : "%d orë", - d : "një ditë", - dd : "%d ditë", - M : "një muaj", - MM : "%d muaj", - y : "një vit", - yy : "%d vite" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/sr-cyrl.js b/vendors/moment/lang/sr-cyrl.js deleted file mode 100644 index ae1754b34..000000000 --- a/vendors/moment/lang/sr-cyrl.js +++ /dev/null @@ -1,106 +0,0 @@ -// moment.js language configuration -// language : Serbian-cyrillic (sr-cyrl) -// author : Milan Janačković : https://github.com/milan-j - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - var translator = { - words: { //Different grammatical cases - m: ['један минут', 'једне минуте'], - mm: ['минут', 'минуте', 'минута'], - h: ['један сат', 'једног сата'], - hh: ['сат', 'сата', 'сати'], - dd: ['дан', 'дана', 'дана'], - MM: ['месец', 'месеца', 'месеци'], - yy: ['година', 'године', 'година'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - return moment.lang('sr-cyrl', { - months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], - monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], - weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], - weekdaysShort: ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], - weekdaysMin: ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], - longDateFormat: { - LT: "H:mm", - L: "DD. MM. YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" - }, - calendar: { - sameDay: '[данас у] LT', - nextDay: '[сутра у] LT', - - nextWeek: function () { - switch (this.day()) { - case 0: - return '[у] [недељу] [у] LT'; - case 3: - return '[у] [среду] [у] LT'; - case 6: - return '[у] [суботу] [у] LT'; - case 1: - case 2: - case 4: - case 5: - return '[у] dddd [у] LT'; - } - }, - lastDay : '[јуче у] LT', - lastWeek : function () { - var lastWeekDays = [ - '[прошле] [недеље] [у] LT', - '[прошлог] [понедељка] [у] LT', - '[прошлог] [уторка] [у] LT', - '[прошле] [среде] [у] LT', - '[прошлог] [четвртка] [у] LT', - '[прошлог] [петка] [у] LT', - '[прошле] [суботе] [у] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : "за %s", - past : "пре %s", - s : "неколико секунди", - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : "дан", - dd : translator.translate, - M : "месец", - MM : translator.translate, - y : "годину", - yy : translator.translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/sr.js b/vendors/moment/lang/sr.js deleted file mode 100644 index 54a5f4f6e..000000000 --- a/vendors/moment/lang/sr.js +++ /dev/null @@ -1,106 +0,0 @@ -// moment.js language configuration -// language : Serbian-latin (sr) -// author : Milan Janačković : https://github.com/milan-j - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - var translator = { - words: { //Different grammatical cases - m: ['jedan minut', 'jedne minute'], - mm: ['minut', 'minute', 'minuta'], - h: ['jedan sat', 'jednog sata'], - hh: ['sat', 'sata', 'sati'], - dd: ['dan', 'dana', 'dana'], - MM: ['mesec', 'meseca', 'meseci'], - yy: ['godina', 'godine', 'godina'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - return moment.lang('sr', { - months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], - monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], - weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], - weekdaysShort: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], - weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], - longDateFormat: { - LT: "H:mm", - L: "DD. MM. YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" - }, - calendar: { - sameDay: '[danas u] LT', - nextDay: '[sutra u] LT', - - nextWeek: function () { - switch (this.day()) { - case 0: - return '[u] [nedelju] [u] LT'; - case 3: - return '[u] [sredu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[juče u] LT', - lastWeek : function () { - var lastWeekDays = [ - '[prošle] [nedelje] [u] LT', - '[prošlog] [ponedeljka] [u] LT', - '[prošlog] [utorka] [u] LT', - '[prošle] [srede] [u] LT', - '[prošlog] [četvrtka] [u] LT', - '[prošlog] [petka] [u] LT', - '[prošle] [subote] [u] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : "za %s", - past : "pre %s", - s : "nekoliko sekundi", - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : "dan", - dd : translator.translate, - M : "mesec", - MM : translator.translate, - y : "godinu", - yy : translator.translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/sv.js b/vendors/moment/lang/sv.js deleted file mode 100644 index 0de8c40ba..000000000 --- a/vendors/moment/lang/sv.js +++ /dev/null @@ -1,63 +0,0 @@ -// moment.js language configuration -// language : swedish (sv) -// author : Jens Alm : https://github.com/ulmus - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('sv', { - months : "januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), - weekdays : "söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"), - weekdaysShort : "sön_mån_tis_ons_tor_fre_lör".split("_"), - weekdaysMin : "sö_må_ti_on_to_fr_lö".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: '[Idag] LT', - nextDay: '[Imorgon] LT', - lastDay: '[Igår] LT', - nextWeek: 'dddd LT', - lastWeek: '[Förra] dddd[en] LT', - sameElse: 'L' - }, - relativeTime : { - future : "om %s", - past : "för %s sedan", - s : "några sekunder", - m : "en minut", - mm : "%d minuter", - h : "en timme", - hh : "%d timmar", - d : "en dag", - dd : "%d dagar", - M : "en månad", - MM : "%d månader", - y : "ett år", - yy : "%d år" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'e' : - (b === 1) ? 'a' : - (b === 2) ? 'a' : - (b === 3) ? 'e' : 'e'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/ta.js b/vendors/moment/lang/ta.js deleted file mode 100644 index cc742c989..000000000 --- a/vendors/moment/lang/ta.js +++ /dev/null @@ -1,112 +0,0 @@ -// moment.js language configuration -// language : tamil (ta) -// author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - /*var symbolMap = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦' - }, - numberMap = { - '௧': '1', - '௨': '2', - '௩': '3', - '௪': '4', - '௫': '5', - '௬': '6', - '௭': '7', - '௮': '8', - '௯': '9', - '௦': '0' - }; */ - - return moment.lang('ta', { - months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split("_"), - monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split("_"), - weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split("_"), - weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split("_"), - weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[இன்று] LT', - nextDay : '[நாளை] LT', - nextWeek : 'dddd, LT', - lastDay : '[நேற்று] LT', - lastWeek : '[கடந்த வாரம்] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s இல்", - past : "%s முன்", - s : "ஒரு சில விநாடிகள்", - m : "ஒரு நிமிடம்", - mm : "%d நிமிடங்கள்", - h : "ஒரு மணி நேரம்", - hh : "%d மணி நேரம்", - d : "ஒரு நாள்", - dd : "%d நாட்கள்", - M : "ஒரு மாதம்", - MM : "%d மாதங்கள்", - y : "ஒரு வருடம்", - yy : "%d ஆண்டுகள்" - }, -/* preparse: function (string) { - return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - },*/ - ordinal : function (number) { - return number + 'வது'; - }, - - -// refer http://ta.wikipedia.org/s/1er1 - - meridiem : function (hour, minute, isLower) { - if (hour >= 6 && hour <= 10) { - return " காலை"; - } else if (hour >= 10 && hour <= 14) { - return " நண்பகல்"; - } else if (hour >= 14 && hour <= 18) { - return " எற்பாடு"; - } else if (hour >= 18 && hour <= 20) { - return " மாலை"; - } else if (hour >= 20 && hour <= 24) { - return " இரவு"; - } else if (hour >= 0 && hour <= 6) { - return " வைகறை"; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/th.js b/vendors/moment/lang/th.js deleted file mode 100644 index 70336c87e..000000000 --- a/vendors/moment/lang/th.js +++ /dev/null @@ -1,58 +0,0 @@ -// moment.js language configuration -// language : thai (th) -// author : Kridsada Thanabulpong : https://github.com/sirn - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('th', { - months : "มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"), - monthsShort : "มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"), - weekdays : "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"), - weekdaysShort : "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"), // yes, three characters difference - weekdaysMin : "อา._จ._อ._พ._พฤ._ศ._ส.".split("_"), - longDateFormat : { - LT : "H นาฬิกา m นาที", - L : "YYYY/MM/DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY เวลา LT", - LLLL : "วันddddที่ D MMMM YYYY เวลา LT" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "ก่อนเที่ยง"; - } else { - return "หลังเที่ยง"; - } - }, - calendar : { - sameDay : '[วันนี้ เวลา] LT', - nextDay : '[พรุ่งนี้ เวลา] LT', - nextWeek : 'dddd[หน้า เวลา] LT', - lastDay : '[เมื่อวานนี้ เวลา] LT', - lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT', - sameElse : 'L' - }, - relativeTime : { - future : "อีก %s", - past : "%sที่แล้ว", - s : "ไม่กี่วินาที", - m : "1 นาที", - mm : "%d นาที", - h : "1 ชั่วโมง", - hh : "%d ชั่วโมง", - d : "1 วัน", - dd : "%d วัน", - M : "1 เดือน", - MM : "%d เดือน", - y : "1 ปี", - yy : "%d ปี" - } - }); -})); diff --git a/vendors/moment/lang/tl-ph.js b/vendors/moment/lang/tl-ph.js deleted file mode 100644 index 804448306..000000000 --- a/vendors/moment/lang/tl-ph.js +++ /dev/null @@ -1,58 +0,0 @@ -// moment.js language configuration -// language : Tagalog/Filipino (tl-ph) -// author : Dan Hagman - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('tl-ph', { - months : "Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"), - monthsShort : "Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"), - weekdays : "Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"), - weekdaysShort : "Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"), - weekdaysMin : "Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "MM/D/YYYY", - LL : "MMMM D, YYYY", - LLL : "MMMM D, YYYY LT", - LLLL : "dddd, MMMM DD, YYYY LT" - }, - calendar : { - sameDay: "[Ngayon sa] LT", - nextDay: '[Bukas sa] LT', - nextWeek: 'dddd [sa] LT', - lastDay: '[Kahapon sa] LT', - lastWeek: 'dddd [huling linggo] LT', - sameElse: 'L' - }, - relativeTime : { - future : "sa loob ng %s", - past : "%s ang nakalipas", - s : "ilang segundo", - m : "isang minuto", - mm : "%d minuto", - h : "isang oras", - hh : "%d oras", - d : "isang araw", - dd : "%d araw", - M : "isang buwan", - MM : "%d buwan", - y : "isang taon", - yy : "%d taon" - }, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/tr.js b/vendors/moment/lang/tr.js deleted file mode 100644 index e90f250e5..000000000 --- a/vendors/moment/lang/tr.js +++ /dev/null @@ -1,93 +0,0 @@ -// moment.js language configuration -// language : turkish (tr) -// authors : Erhan Gundogan : https://github.com/erhangundogan, -// Burak Yiğit Kaya: https://github.com/BYK - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - var suffixes = { - 1: "'inci", - 5: "'inci", - 8: "'inci", - 70: "'inci", - 80: "'inci", - - 2: "'nci", - 7: "'nci", - 20: "'nci", - 50: "'nci", - - 3: "'üncü", - 4: "'üncü", - 100: "'üncü", - - 6: "'ncı", - - 9: "'uncu", - 10: "'uncu", - 30: "'uncu", - - 60: "'ıncı", - 90: "'ıncı" - }; - - return moment.lang('tr', { - months : "Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"), - monthsShort : "Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"), - weekdays : "Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"), - weekdaysShort : "Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"), - weekdaysMin : "Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[bugün saat] LT', - nextDay : '[yarın saat] LT', - nextWeek : '[haftaya] dddd [saat] LT', - lastDay : '[dün] LT', - lastWeek : '[geçen hafta] dddd [saat] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s sonra", - past : "%s önce", - s : "birkaç saniye", - m : "bir dakika", - mm : "%d dakika", - h : "bir saat", - hh : "%d saat", - d : "bir gün", - dd : "%d gün", - M : "bir ay", - MM : "%d ay", - y : "bir yıl", - yy : "%d yıl" - }, - ordinal : function (number) { - if (number === 0) { // special case for zero - return number + "'ıncı"; - } - var a = number % 10, - b = number % 100 - a, - c = number >= 100 ? 100 : null; - - return number + (suffixes[a] || suffixes[b] || suffixes[c]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/tzm-latn.js b/vendors/moment/lang/tzm-latn.js deleted file mode 100644 index f7e908977..000000000 --- a/vendors/moment/lang/tzm-latn.js +++ /dev/null @@ -1,55 +0,0 @@ -// moment.js language configuration -// language : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn) -// author : Abdel Said : https://github.com/abdelsaid - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('tzm-latn', { - months : "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), - monthsShort : "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), - weekdays : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - weekdaysShort : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - weekdaysMin : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[asdkh g] LT", - nextDay: '[aska g] LT', - nextWeek: 'dddd [g] LT', - lastDay: '[assant g] LT', - lastWeek: 'dddd [g] LT', - sameElse: 'L' - }, - relativeTime : { - future : "dadkh s yan %s", - past : "yan %s", - s : "imik", - m : "minuḍ", - mm : "%d minuḍ", - h : "saɛa", - hh : "%d tassaɛin", - d : "ass", - dd : "%d ossan", - M : "ayowr", - MM : "%d iyyirn", - y : "asgas", - yy : "%d isgasn" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/tzm.js b/vendors/moment/lang/tzm.js deleted file mode 100644 index c7c76bdc6..000000000 --- a/vendors/moment/lang/tzm.js +++ /dev/null @@ -1,55 +0,0 @@ -// moment.js language configuration -// language : Morocco Central Atlas Tamaziɣt (tzm) -// author : Abdel Said : https://github.com/abdelsaid - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('tzm', { - months : "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), - monthsShort : "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), - weekdays : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - weekdaysShort : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - weekdaysMin : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[ⴰⵙⴷⵅ ⴴ] LT", - nextDay: '[ⴰⵙⴽⴰ ⴴ] LT', - nextWeek: 'dddd [ⴴ] LT', - lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT', - lastWeek: 'dddd [ⴴ] LT', - sameElse: 'L' - }, - relativeTime : { - future : "ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s", - past : "ⵢⴰⵏ %s", - s : "ⵉⵎⵉⴽ", - m : "ⵎⵉⵏⵓⴺ", - mm : "%d ⵎⵉⵏⵓⴺ", - h : "ⵙⴰⵄⴰ", - hh : "%d ⵜⴰⵙⵙⴰⵄⵉⵏ", - d : "ⴰⵙⵙ", - dd : "%d oⵙⵙⴰⵏ", - M : "ⴰⵢoⵓⵔ", - MM : "%d ⵉⵢⵢⵉⵔⵏ", - y : "ⴰⵙⴳⴰⵙ", - yy : "%d ⵉⵙⴳⴰⵙⵏ" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/uk.js b/vendors/moment/lang/uk.js deleted file mode 100644 index 47056cb64..000000000 --- a/vendors/moment/lang/uk.js +++ /dev/null @@ -1,157 +0,0 @@ -// moment.js language configuration -// language : ukrainian (uk) -// author : zemlanin : https://github.com/zemlanin -// Author : Menelion Elensúle : https://github.com/Oire - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': 'хвилина_хвилини_хвилин', - 'hh': 'година_години_годин', - 'dd': 'день_дні_днів', - 'MM': 'місяць_місяці_місяців', - 'yy': 'рік_роки_років' - }; - if (key === 'm') { - return withoutSuffix ? 'хвилина' : 'хвилину'; - } - else if (key === 'h') { - return withoutSuffix ? 'година' : 'годину'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'), - 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') - }, - - nounCase = (/D[oD]? *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), - 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'), - 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_') - }, - - nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ? - 'accusative' : - ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ? - 'genitive' : - 'nominative'); - - return weekdays[nounCase][m.day()]; - } - - function processHoursFunction(str) { - return function () { - return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; - }; - } - - return moment.lang('uk', { - months : monthsCaseReplace, - monthsShort : "січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"), - weekdays : weekdaysCaseReplace, - weekdaysShort : "нд_пн_вт_ср_чт_пт_сб".split("_"), - weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY р.", - LLL : "D MMMM YYYY р., LT", - LLLL : "dddd, D MMMM YYYY р., LT" - }, - calendar : { - sameDay: processHoursFunction('[Сьогодні '), - nextDay: processHoursFunction('[Завтра '), - lastDay: processHoursFunction('[Вчора '), - nextWeek: processHoursFunction('[У] dddd ['), - lastWeek: function () { - switch (this.day()) { - case 0: - case 3: - case 5: - case 6: - return processHoursFunction('[Минулої] dddd [').call(this); - case 1: - case 2: - case 4: - return processHoursFunction('[Минулого] dddd [').call(this); - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "за %s", - past : "%s тому", - s : "декілька секунд", - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : "годину", - hh : relativeTimeWithPlural, - d : "день", - dd : relativeTimeWithPlural, - M : "місяць", - MM : relativeTimeWithPlural, - y : "рік", - yy : relativeTimeWithPlural - }, - - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "ночі"; - } else if (hour < 12) { - return "ранку"; - } else if (hour < 17) { - return "дня"; - } else { - return "вечора"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return number + '-й'; - case 'D': - return number + '-го'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/uz.js b/vendors/moment/lang/uz.js deleted file mode 100644 index a5b06fa9f..000000000 --- a/vendors/moment/lang/uz.js +++ /dev/null @@ -1,55 +0,0 @@ -// moment.js language configuration -// language : uzbek -// author : Sardor Muminov : https://github.com/muminoff - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('uz', { - months : "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), - monthsShort : "янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"), - weekdays : "Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"), - weekdaysShort : "Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"), - weekdaysMin : "Як_Ду_Се_Чо_Па_Жу_Ша".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "D MMMM YYYY, dddd LT" - }, - calendar : { - sameDay : '[Бугун соат] LT [да]', - nextDay : '[Эртага] LT [да]', - nextWeek : 'dddd [куни соат] LT [да]', - lastDay : '[Кеча соат] LT [да]', - lastWeek : '[Утган] dddd [куни соат] LT [да]', - sameElse : 'L' - }, - relativeTime : { - future : "Якин %s ичида", - past : "Бир неча %s олдин", - s : "фурсат", - m : "бир дакика", - mm : "%d дакика", - h : "бир соат", - hh : "%d соат", - d : "бир кун", - dd : "%d кун", - M : "бир ой", - MM : "%d ой", - y : "бир йил", - yy : "%d йил" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/vi.js b/vendors/moment/lang/vi.js deleted file mode 100644 index 94890b03d..000000000 --- a/vendors/moment/lang/vi.js +++ /dev/null @@ -1,62 +0,0 @@ -// moment.js language configuration -// language : vietnamese (vi) -// author : Bang Nguyen : https://github.com/bangnk - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('vi', { - months : "tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"), - monthsShort : "Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"), - weekdays : "chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"), - weekdaysShort : "CN_T2_T3_T4_T5_T6_T7".split("_"), - weekdaysMin : "CN_T2_T3_T4_T5_T6_T7".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM [năm] YYYY", - LLL : "D MMMM [năm] YYYY LT", - LLLL : "dddd, D MMMM [năm] YYYY LT", - l : "DD/M/YYYY", - ll : "D MMM YYYY", - lll : "D MMM YYYY LT", - llll : "ddd, D MMM YYYY LT" - }, - calendar : { - sameDay: "[Hôm nay lúc] LT", - nextDay: '[Ngày mai lúc] LT', - nextWeek: 'dddd [tuần tới lúc] LT', - lastDay: '[Hôm qua lúc] LT', - lastWeek: 'dddd [tuần rồi lúc] LT', - sameElse: 'L' - }, - relativeTime : { - future : "%s tới", - past : "%s trước", - s : "vài giây", - m : "một phút", - mm : "%d phút", - h : "một giờ", - hh : "%d giờ", - d : "một ngày", - dd : "%d ngày", - M : "một tháng", - MM : "%d tháng", - y : "một năm", - yy : "%d năm" - }, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/zh-cn.js b/vendors/moment/lang/zh-cn.js deleted file mode 100644 index 50a3ed93f..000000000 --- a/vendors/moment/lang/zh-cn.js +++ /dev/null @@ -1,108 +0,0 @@ -// moment.js language configuration -// language : chinese -// author : suupic : https://github.com/suupic -// author : Zeno Zeng : https://github.com/zenozeng - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('zh-cn', { - months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), - weekdaysShort : "周日_周一_周二_周三_周四_周五_周六".split("_"), - weekdaysMin : "日_一_二_三_四_五_六".split("_"), - longDateFormat : { - LT : "Ah点mm", - L : "YYYY-MM-DD", - LL : "YYYY年MMMD日", - LLL : "YYYY年MMMD日LT", - LLLL : "YYYY年MMMD日ddddLT", - l : "YYYY-MM-DD", - ll : "YYYY年MMMD日", - lll : "YYYY年MMMD日LT", - llll : "YYYY年MMMD日ddddLT" - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return "凌晨"; - } else if (hm < 900) { - return "早上"; - } else if (hm < 1130) { - return "上午"; - } else if (hm < 1230) { - return "中午"; - } else if (hm < 1800) { - return "下午"; - } else { - return "晚上"; - } - }, - calendar : { - sameDay : function () { - return this.minutes() === 0 ? "[今天]Ah[点整]" : "[今天]LT"; - }, - nextDay : function () { - return this.minutes() === 0 ? "[明天]Ah[点整]" : "[明天]LT"; - }, - lastDay : function () { - return this.minutes() === 0 ? "[昨天]Ah[点整]" : "[昨天]LT"; - }, - nextWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]'; - return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm"; - }, - lastWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; - return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm"; - }, - sameElse : 'LL' - }, - ordinal : function (number, period) { - switch (period) { - case "d": - case "D": - case "DDD": - return number + "日"; - case "M": - return number + "月"; - case "w": - case "W": - return number + "周"; - default: - return number; - } - }, - relativeTime : { - future : "%s内", - past : "%s前", - s : "几秒", - m : "1分钟", - mm : "%d分钟", - h : "1小时", - hh : "%d小时", - d : "1天", - dd : "%d天", - M : "1个月", - MM : "%d个月", - y : "1年", - yy : "%d年" - }, - week : { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); diff --git a/vendors/moment/lang/zh-tw.js b/vendors/moment/lang/zh-tw.js deleted file mode 100644 index bbb07376e..000000000 --- a/vendors/moment/lang/zh-tw.js +++ /dev/null @@ -1,84 +0,0 @@ -// moment.js language configuration -// language : traditional chinese (zh-tw) -// author : Ben : https://github.com/ben-lin - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('zh-tw', { - months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), - weekdaysShort : "週日_週一_週二_週三_週四_週五_週六".split("_"), - weekdaysMin : "日_一_二_三_四_五_六".split("_"), - longDateFormat : { - LT : "Ah點mm", - L : "YYYY年MMMD日", - LL : "YYYY年MMMD日", - LLL : "YYYY年MMMD日LT", - LLLL : "YYYY年MMMD日ddddLT", - l : "YYYY年MMMD日", - ll : "YYYY年MMMD日", - lll : "YYYY年MMMD日LT", - llll : "YYYY年MMMD日ddddLT" - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 900) { - return "早上"; - } else if (hm < 1130) { - return "上午"; - } else if (hm < 1230) { - return "中午"; - } else if (hm < 1800) { - return "下午"; - } else { - return "晚上"; - } - }, - calendar : { - sameDay : '[今天]LT', - nextDay : '[明天]LT', - nextWeek : '[下]ddddLT', - lastDay : '[昨天]LT', - lastWeek : '[上]ddddLT', - sameElse : 'L' - }, - ordinal : function (number, period) { - switch (period) { - case "d" : - case "D" : - case "DDD" : - return number + "日"; - case "M" : - return number + "月"; - case "w" : - case "W" : - return number + "週"; - default : - return number; - } - }, - relativeTime : { - future : "%s內", - past : "%s前", - s : "幾秒", - m : "一分鐘", - mm : "%d分鐘", - h : "一小時", - hh : "%d小時", - d : "一天", - dd : "%d天", - M : "一個月", - MM : "%d個月", - y : "一年", - yy : "%d年" - } - }); -})); diff --git a/vendors/moment/min/langs.js b/vendors/moment/min/langs.js deleted file mode 100644 index c0b3c6b43..000000000 --- a/vendors/moment/min/langs.js +++ /dev/null @@ -1,5991 +0,0 @@ -// moment.js language configuration -// language : Moroccan Arabic (ar-ma) -// author : ElFadili Yassine : https://github.com/ElFadiliY -// author : Abdel Said : https://github.com/abdelsaid - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ar-ma', { - months : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), - monthsShort : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), - weekdays : "الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysShort : "احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"), - weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[اليوم على الساعة] LT", - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : "في %s", - past : "منذ %s", - s : "ثوان", - m : "دقيقة", - mm : "%d دقائق", - h : "ساعة", - hh : "%d ساعات", - d : "يوم", - dd : "%d أيام", - M : "شهر", - MM : "%d أشهر", - y : "سنة", - yy : "%d سنوات" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Arabic (ar) -// author : Abdel Said : https://github.com/abdelsaid -// changes in months, weekdays : Ahmed Elkhatib - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ar', { - months : "يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"), - monthsShort : "يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"), - weekdays : "الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysShort : "الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[اليوم على الساعة] LT", - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : "في %s", - past : "منذ %s", - s : "ثوان", - m : "دقيقة", - mm : "%d دقائق", - h : "ساعة", - hh : "%d ساعات", - d : "يوم", - dd : "%d أيام", - M : "شهر", - MM : "%d أشهر", - y : "سنة", - yy : "%d سنوات" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : bulgarian (bg) -// author : Krasen Borisov : https://github.com/kraz - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('bg', { - months : "януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"), - monthsShort : "янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"), - weekdays : "неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"), - weekdaysShort : "нед_пон_вто_сря_чет_пет_съб".split("_"), - weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"), - longDateFormat : { - LT : "H:mm", - L : "D.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Днес в] LT', - nextDay : '[Утре в] LT', - nextWeek : 'dddd [в] LT', - lastDay : '[Вчера в] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[В изминалата] dddd [в] LT'; - case 1: - case 2: - case 4: - case 5: - return '[В изминалия] dddd [в] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "след %s", - past : "преди %s", - s : "няколко секунди", - m : "минута", - mm : "%d минути", - h : "час", - hh : "%d часа", - d : "ден", - dd : "%d дни", - M : "месец", - MM : "%d месеца", - y : "година", - yy : "%d години" - }, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : breton (br) -// author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function relativeTimeWithMutation(number, withoutSuffix, key) { - var format = { - 'mm': "munutenn", - 'MM': "miz", - 'dd': "devezh" - }; - return number + ' ' + mutation(format[key], number); - } - - function specialMutationForYears(number) { - switch (lastNumber(number)) { - case 1: - case 3: - case 4: - case 5: - case 9: - return number + ' bloaz'; - default: - return number + ' vloaz'; - } - } - - function lastNumber(number) { - if (number > 9) { - return lastNumber(number % 10); - } - return number; - } - - function mutation(text, number) { - if (number === 2) { - return softMutation(text); - } - return text; - } - - function softMutation(text) { - var mutationTable = { - 'm': 'v', - 'b': 'v', - 'd': 'z' - }; - if (mutationTable[text.charAt(0)] === undefined) { - return text; - } - return mutationTable[text.charAt(0)] + text.substring(1); - } - - return moment.lang('br', { - months : "Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"), - monthsShort : "Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"), - weekdays : "Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"), - weekdaysShort : "Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"), - weekdaysMin : "Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"), - longDateFormat : { - LT : "h[e]mm A", - L : "DD/MM/YYYY", - LL : "D [a viz] MMMM YYYY", - LLL : "D [a viz] MMMM YYYY LT", - LLLL : "dddd, D [a viz] MMMM YYYY LT" - }, - calendar : { - sameDay : '[Hiziv da] LT', - nextDay : '[Warc\'hoazh da] LT', - nextWeek : 'dddd [da] LT', - lastDay : '[Dec\'h da] LT', - lastWeek : 'dddd [paset da] LT', - sameElse : 'L' - }, - relativeTime : { - future : "a-benn %s", - past : "%s 'zo", - s : "un nebeud segondennoù", - m : "ur vunutenn", - mm : relativeTimeWithMutation, - h : "un eur", - hh : "%d eur", - d : "un devezh", - dd : relativeTimeWithMutation, - M : "ur miz", - MM : relativeTimeWithMutation, - y : "ur bloaz", - yy : specialMutationForYears - }, - ordinal : function (number) { - var output = (number === 1) ? 'añ' : 'vet'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : bosnian (bs) -// author : Nedim Cholich : https://github.com/frontyard -// based on (hr) translation by Bojan Marković - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - return moment.lang('bs', { - months : "januar_februar_mart_april_maj_juni_juli_avgust_septembar_oktobar_novembar_decembar".split("_"), - monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"), - weekdays : "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), - weekdaysShort : "ned._pon._uto._sri._čet._pet._sub.".split("_"), - weekdaysMin : "ne_po_ut_sr_če_pe_su".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "za %s", - past : "prije %s", - s : "par sekundi", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "dan", - dd : translate, - M : "mjesec", - MM : translate, - y : "godinu", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : catalan (ca) -// author : Juan G. Hurtado : https://github.com/juanghurtado - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ca', { - months : "gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"), - monthsShort : "gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"), - weekdays : "diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"), - weekdaysShort : "dg._dl._dt._dc._dj._dv._ds.".split("_"), - weekdaysMin : "Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay : function () { - return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextDay : function () { - return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastDay : function () { - return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : "en %s", - past : "fa %s", - s : "uns segons", - m : "un minut", - mm : "%d minuts", - h : "una hora", - hh : "%d hores", - d : "un dia", - dd : "%d dies", - M : "un mes", - MM : "%d mesos", - y : "un any", - yy : "%d anys" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : czech (cs) -// author : petrbela : https://github.com/petrbela - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var months = "leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"), - monthsShort = "led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"); - - function plural(n) { - return (n > 1) && (n < 5) && (~~(n / 10) !== 1); - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minuty' : 'minut'); - } else { - return result + 'minutami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodin'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'den' : 'dnem'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dny' : 'dní'); - } else { - return result + 'dny'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'měsíce' : 'měsíců'); - } else { - return result + 'měsíci'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokem'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'let'); - } else { - return result + 'lety'; - } - break; - } - } - - return moment.lang('cs', { - months : months, - monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), - weekdays : "neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"), - weekdaysShort : "ne_po_út_st_čt_pá_so".split("_"), - weekdaysMin : "ne_po_út_st_čt_pá_so".split("_"), - longDateFormat : { - LT: "H.mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd D. MMMM YYYY LT" - }, - calendar : { - sameDay: "[dnes v] LT", - nextDay: '[zítra v] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v neděli v] LT'; - case 1: - case 2: - return '[v] dddd [v] LT'; - case 3: - return '[ve středu v] LT'; - case 4: - return '[ve čtvrtek v] LT'; - case 5: - return '[v pátek v] LT'; - case 6: - return '[v sobotu v] LT'; - } - }, - lastDay: '[včera v] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulou neděli v] LT'; - case 1: - case 2: - return '[minulé] dddd [v] LT'; - case 3: - return '[minulou středu v] LT'; - case 4: - case 5: - return '[minulý] dddd [v] LT'; - case 6: - return '[minulou sobotu v] LT'; - } - }, - sameElse: "L" - }, - relativeTime : { - future : "za %s", - past : "před %s", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : chuvash (cv) -// author : Anatoly Mironov : https://github.com/mirontoli - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('cv', { - months : "кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"), - monthsShort : "кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"), - weekdays : "вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"), - weekdaysShort : "выр_тун_ытл_юн_кĕç_эрн_шăм".split("_"), - weekdaysMin : "вр_тн_ыт_юн_кç_эр_шм".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD-MM-YYYY", - LL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]", - LLL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT", - LLLL : "dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT" - }, - calendar : { - sameDay: '[Паян] LT [сехетре]', - nextDay: '[Ыран] LT [сехетре]', - lastDay: '[Ĕнер] LT [сехетре]', - nextWeek: '[Çитес] dddd LT [сехетре]', - lastWeek: '[Иртнĕ] dddd LT [сехетре]', - sameElse: 'L' - }, - relativeTime : { - future : function (output) { - var affix = /сехет$/i.exec(output) ? "рен" : /çул$/i.exec(output) ? "тан" : "ран"; - return output + affix; - }, - past : "%s каялла", - s : "пĕр-ик çеккунт", - m : "пĕр минут", - mm : "%d минут", - h : "пĕр сехет", - hh : "%d сехет", - d : "пĕр кун", - dd : "%d кун", - M : "пĕр уйăх", - MM : "%d уйăх", - y : "пĕр çул", - yy : "%d çул" - }, - ordinal : '%d-мĕш', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Welsh (cy) -// author : Robert Allen - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang("cy", { - months: "Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"), - monthsShort: "Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"), - weekdays: "Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"), - weekdaysShort: "Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"), - weekdaysMin: "Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"), - // time formats are the same as en-gb - longDateFormat: { - LT: "HH:mm", - L: "DD/MM/YYYY", - LL: "D MMMM YYYY", - LLL: "D MMMM YYYY LT", - LLLL: "dddd, D MMMM YYYY LT" - }, - calendar: { - sameDay: '[Heddiw am] LT', - nextDay: '[Yfory am] LT', - nextWeek: 'dddd [am] LT', - lastDay: '[Ddoe am] LT', - lastWeek: 'dddd [diwethaf am] LT', - sameElse: 'L' - }, - relativeTime: { - future: "mewn %s", - past: "%s yn àl", - s: "ychydig eiliadau", - m: "munud", - mm: "%d munud", - h: "awr", - hh: "%d awr", - d: "diwrnod", - dd: "%d diwrnod", - M: "mis", - MM: "%d mis", - y: "blwyddyn", - yy: "%d flynedd" - }, - // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh - ordinal: function (number) { - var b = number, - output = '', - lookup = [ - '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed - 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed - ]; - - if (b > 20) { - if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) { - output = 'fed'; // not 30ain, 70ain or 90ain - } else { - output = 'ain'; - } - } else if (b > 0) { - output = lookup[b]; - } - - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : danish (da) -// author : Ulrik Nielsen : https://github.com/mrbase - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('da', { - months : "januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), - weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), - weekdaysShort : "søn_man_tir_ons_tor_fre_lør".split("_"), - weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D. MMMM, YYYY LT" - }, - calendar : { - sameDay : '[I dag kl.] LT', - nextDay : '[I morgen kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[I går kl.] LT', - lastWeek : '[sidste] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : "om %s", - past : "%s siden", - s : "få sekunder", - m : "et minut", - mm : "%d minutter", - h : "en time", - hh : "%d timer", - d : "en dag", - dd : "%d dage", - M : "en måned", - MM : "%d måneder", - y : "et år", - yy : "%d år" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : german (de) -// author : lluchs : https://github.com/lluchs -// author: Menelion Elensúle: https://github.com/Oire - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eine Minute', 'einer Minute'], - 'h': ['eine Stunde', 'einer Stunde'], - 'd': ['ein Tag', 'einem Tag'], - 'dd': [number + ' Tage', number + ' Tagen'], - 'M': ['ein Monat', 'einem Monat'], - 'MM': [number + ' Monate', number + ' Monaten'], - 'y': ['ein Jahr', 'einem Jahr'], - 'yy': [number + ' Jahre', number + ' Jahren'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - return moment.lang('de', { - months : "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), - monthsShort : "Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), - weekdays : "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), - weekdaysShort : "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), - weekdaysMin : "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), - longDateFormat : { - LT: "HH:mm [Uhr]", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay: "[Heute um] LT", - sameElse: "L", - nextDay: '[Morgen um] LT', - nextWeek: 'dddd [um] LT', - lastDay: '[Gestern um] LT', - lastWeek: '[letzten] dddd [um] LT' - }, - relativeTime : { - future : "in %s", - past : "vor %s", - s : "ein paar Sekunden", - m : processRelativeTime, - mm : "%d Minuten", - h : processRelativeTime, - hh : "%d Stunden", - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : modern greek (el) -// author : Aggelos Karalias : https://github.com/mehiel - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('el', { - monthsNominativeEl : "Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"), - monthsGenitiveEl : "Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"), - months : function (momentToFormat, format) { - if (/D/.test(format.substring(0, format.indexOf("MMMM")))) { // if there is a day number before 'MMMM' - return this._monthsGenitiveEl[momentToFormat.month()]; - } else { - return this._monthsNominativeEl[momentToFormat.month()]; - } - }, - monthsShort : "Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"), - weekdays : "Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"), - weekdaysShort : "Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"), - weekdaysMin : "Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"), - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'μμ' : 'ΜΜ'; - } else { - return isLower ? 'πμ' : 'ΠΜ'; - } - }, - longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendarEl : { - sameDay : '[Σήμερα {}] LT', - nextDay : '[Αύριο {}] LT', - nextWeek : 'dddd [{}] LT', - lastDay : '[Χθες {}] LT', - lastWeek : '[την προηγούμενη] dddd [{}] LT', - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendarEl[key], - hours = mom && mom.hours(); - - return output.replace("{}", (hours % 12 === 1 ? "στη" : "στις")); - }, - relativeTime : { - future : "σε %s", - past : "%s πριν", - s : "δευτερόλεπτα", - m : "ένα λεπτό", - mm : "%d λεπτά", - h : "μία ώρα", - hh : "%d ώρες", - d : "μία μέρα", - dd : "%d μέρες", - M : "ένας μήνας", - MM : "%d μήνες", - y : "ένας χρόνος", - yy : "%d χρόνια" - }, - ordinal : function (number) { - return number + 'η'; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : australian english (en-au) - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('en-au', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : canadian english (en-ca) -// author : Jonathan Abourbih : https://github.com/jonbca - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('en-ca', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - longDateFormat : { - LT : "h:mm A", - L : "YYYY-MM-DD", - LL : "D MMMM, YYYY", - LLL : "D MMMM, YYYY LT", - LLLL : "dddd, D MMMM, YYYY LT" - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); -})); - -// moment.js language configuration -// language : great britain english (en-gb) -// author : Chris Gedrim : https://github.com/chrisgedrim - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('en-gb', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : esperanto (eo) -// author : Colin Dean : https://github.com/colindean -// komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko. -// Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('eo', { - months : "januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"), - weekdays : "Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"), - weekdaysShort : "Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D[-an de] MMMM, YYYY", - LLL : "D[-an de] MMMM, YYYY LT", - LLLL : "dddd, [la] D[-an de] MMMM, YYYY LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'p.t.m.' : 'P.T.M.'; - } else { - return isLower ? 'a.t.m.' : 'A.T.M.'; - } - }, - calendar : { - sameDay : '[Hodiaŭ je] LT', - nextDay : '[Morgaŭ je] LT', - nextWeek : 'dddd [je] LT', - lastDay : '[Hieraŭ je] LT', - lastWeek : '[pasinta] dddd [je] LT', - sameElse : 'L' - }, - relativeTime : { - future : "je %s", - past : "antaŭ %s", - s : "sekundoj", - m : "minuto", - mm : "%d minutoj", - h : "horo", - hh : "%d horoj", - d : "tago",//ne 'diurno', ĉar estas uzita por proksimumo - dd : "%d tagoj", - M : "monato", - MM : "%d monatoj", - y : "jaro", - yy : "%d jaroj" - }, - ordinal : "%da", - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : spanish (es) -// author : Julio Napurí : https://github.com/julionc - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var monthsShortDot = "ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"), - monthsShort = "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"); - - return moment.lang('es', { - months : "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShort[m.month()]; - } else { - return monthsShortDot[m.month()]; - } - }, - weekdays : "domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"), - weekdaysShort : "dom._lun._mar._mié._jue._vie._sáb.".split("_"), - weekdaysMin : "Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [del] YYYY", - LLL : "D [de] MMMM [del] YYYY LT", - LLLL : "dddd, D [de] MMMM [del] YYYY LT" - }, - calendar : { - sameDay : function () { - return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextDay : function () { - return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastDay : function () { - return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : "en %s", - past : "hace %s", - s : "unos segundos", - m : "un minuto", - mm : "%d minutos", - h : "una hora", - hh : "%d horas", - d : "un día", - dd : "%d días", - M : "un mes", - MM : "%d meses", - y : "un año", - yy : "%d años" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : estonian (et) -// author : Henry Kehlmann : https://github.com/madhenry -// improvements : Illimar Tambek : https://github.com/ragulka - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'], - 'm' : ['ühe minuti', 'üks minut'], - 'mm': [number + ' minuti', number + ' minutit'], - 'h' : ['ühe tunni', 'tund aega', 'üks tund'], - 'hh': [number + ' tunni', number + ' tundi'], - 'd' : ['ühe päeva', 'üks päev'], - 'M' : ['kuu aja', 'kuu aega', 'üks kuu'], - 'MM': [number + ' kuu', number + ' kuud'], - 'y' : ['ühe aasta', 'aasta', 'üks aasta'], - 'yy': [number + ' aasta', number + ' aastat'] - }; - if (withoutSuffix) { - return format[key][2] ? format[key][2] : format[key][1]; - } - return isFuture ? format[key][0] : format[key][1]; - } - - return moment.lang('et', { - months : "jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"), - monthsShort : "jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"), - weekdays : "pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"), - weekdaysShort : "P_E_T_K_N_R_L".split("_"), - weekdaysMin : "P_E_T_K_N_R_L".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[Täna,] LT', - nextDay : '[Homme,] LT', - nextWeek : '[Järgmine] dddd LT', - lastDay : '[Eile,] LT', - lastWeek : '[Eelmine] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s pärast", - past : "%s tagasi", - s : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : '%d päeva', - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : euskara (eu) -// author : Eneko Illarramendi : https://github.com/eillarra - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('eu', { - months : "urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"), - monthsShort : "urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"), - weekdays : "igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"), - weekdaysShort : "ig._al._ar._az._og._ol._lr.".split("_"), - weekdaysMin : "ig_al_ar_az_og_ol_lr".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "YYYY[ko] MMMM[ren] D[a]", - LLL : "YYYY[ko] MMMM[ren] D[a] LT", - LLLL : "dddd, YYYY[ko] MMMM[ren] D[a] LT", - l : "YYYY-M-D", - ll : "YYYY[ko] MMM D[a]", - lll : "YYYY[ko] MMM D[a] LT", - llll : "ddd, YYYY[ko] MMM D[a] LT" - }, - calendar : { - sameDay : '[gaur] LT[etan]', - nextDay : '[bihar] LT[etan]', - nextWeek : 'dddd LT[etan]', - lastDay : '[atzo] LT[etan]', - lastWeek : '[aurreko] dddd LT[etan]', - sameElse : 'L' - }, - relativeTime : { - future : "%s barru", - past : "duela %s", - s : "segundo batzuk", - m : "minutu bat", - mm : "%d minutu", - h : "ordu bat", - hh : "%d ordu", - d : "egun bat", - dd : "%d egun", - M : "hilabete bat", - MM : "%d hilabete", - y : "urte bat", - yy : "%d urte" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Persian Language -// author : Ebrahim Byagowi : https://github.com/ebraminio - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var symbolMap = { - '1': '۱', - '2': '۲', - '3': '۳', - '4': '۴', - '5': '۵', - '6': '۶', - '7': '۷', - '8': '۸', - '9': '۹', - '0': '۰' - }, numberMap = { - '۱': '1', - '۲': '2', - '۳': '3', - '۴': '4', - '۵': '5', - '۶': '6', - '۷': '7', - '۸': '8', - '۹': '9', - '۰': '0' - }; - - return moment.lang('fa', { - months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'), - longDateFormat : { - LT : 'HH:mm', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY LT', - LLLL : 'dddd, D MMMM YYYY LT' - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "قبل از ظهر"; - } else { - return "بعد از ظهر"; - } - }, - calendar : { - sameDay : '[امروز ساعت] LT', - nextDay : '[فردا ساعت] LT', - nextWeek : 'dddd [ساعت] LT', - lastDay : '[دیروز ساعت] LT', - lastWeek : 'dddd [پیش] [ساعت] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'در %s', - past : '%s پیش', - s : 'چندین ثانیه', - m : 'یک دقیقه', - mm : '%d دقیقه', - h : 'یک ساعت', - hh : '%d ساعت', - d : 'یک روز', - dd : '%d روز', - M : 'یک ماه', - MM : '%d ماه', - y : 'یک سال', - yy : '%d سال' - }, - preparse: function (string) { - return string.replace(/[۰-۹]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - ordinal : '%dم', - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : finnish (fi) -// author : Tarmo Aidantausta : https://github.com/bleadof - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '), - numbersFuture = ['nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden', - numbersPast[7], numbersPast[8], numbersPast[9]]; - - function translate(number, withoutSuffix, key, isFuture) { - var result = ""; - switch (key) { - case 's': - return isFuture ? 'muutaman sekunnin' : 'muutama sekunti'; - case 'm': - return isFuture ? 'minuutin' : 'minuutti'; - case 'mm': - result = isFuture ? 'minuutin' : 'minuuttia'; - break; - case 'h': - return isFuture ? 'tunnin' : 'tunti'; - case 'hh': - result = isFuture ? 'tunnin' : 'tuntia'; - break; - case 'd': - return isFuture ? 'päivän' : 'päivä'; - case 'dd': - result = isFuture ? 'päivän' : 'päivää'; - break; - case 'M': - return isFuture ? 'kuukauden' : 'kuukausi'; - case 'MM': - result = isFuture ? 'kuukauden' : 'kuukautta'; - break; - case 'y': - return isFuture ? 'vuoden' : 'vuosi'; - case 'yy': - result = isFuture ? 'vuoden' : 'vuotta'; - break; - } - result = verbalNumber(number, isFuture) + " " + result; - return result; - } - - function verbalNumber(number, isFuture) { - return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number; - } - - return moment.lang('fi', { - months : "tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"), - monthsShort : "tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"), - weekdays : "sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"), - weekdaysShort : "su_ma_ti_ke_to_pe_la".split("_"), - weekdaysMin : "su_ma_ti_ke_to_pe_la".split("_"), - longDateFormat : { - LT : "HH.mm", - L : "DD.MM.YYYY", - LL : "Do MMMM[ta] YYYY", - LLL : "Do MMMM[ta] YYYY, [klo] LT", - LLLL : "dddd, Do MMMM[ta] YYYY, [klo] LT", - l : "D.M.YYYY", - ll : "Do MMM YYYY", - lll : "Do MMM YYYY, [klo] LT", - llll : "ddd, Do MMM YYYY, [klo] LT" - }, - calendar : { - sameDay : '[tänään] [klo] LT', - nextDay : '[huomenna] [klo] LT', - nextWeek : 'dddd [klo] LT', - lastDay : '[eilen] [klo] LT', - lastWeek : '[viime] dddd[na] [klo] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s päästä", - past : "%s sitten", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : "%d.", - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : faroese (fo) -// author : Ragnar Johannesen : https://github.com/ragnar123 - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('fo', { - months : "januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), - weekdays : "sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"), - weekdaysShort : "sun_mán_týs_mik_hós_frí_ley".split("_"), - weekdaysMin : "su_má_tý_mi_hó_fr_le".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D. MMMM, YYYY LT" - }, - calendar : { - sameDay : '[Í dag kl.] LT', - nextDay : '[Í morgin kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[Í gjár kl.] LT', - lastWeek : '[síðstu] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : "um %s", - past : "%s síðani", - s : "fá sekund", - m : "ein minutt", - mm : "%d minuttir", - h : "ein tími", - hh : "%d tímar", - d : "ein dagur", - dd : "%d dagar", - M : "ein mánaði", - MM : "%d mánaðir", - y : "eitt ár", - yy : "%d ár" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : canadian french (fr-ca) -// author : Jonathan Abourbih : https://github.com/jonbca - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('fr-ca', { - months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), - monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), - weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), - weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[Aujourd'hui à] LT", - nextDay: '[Demain à] LT', - nextWeek: 'dddd [à] LT', - lastDay: '[Hier à] LT', - lastWeek: 'dddd [dernier à] LT', - sameElse: 'L' - }, - relativeTime : { - future : "dans %s", - past : "il y a %s", - s : "quelques secondes", - m : "une minute", - mm : "%d minutes", - h : "une heure", - hh : "%d heures", - d : "un jour", - dd : "%d jours", - M : "un mois", - MM : "%d mois", - y : "un an", - yy : "%d ans" - }, - ordinal : function (number) { - return number + (number === 1 ? 'er' : ''); - } - }); -})); - -// moment.js language configuration -// language : french (fr) -// author : John Fischer : https://github.com/jfroffice - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('fr', { - months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), - monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), - weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), - weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[Aujourd'hui à] LT", - nextDay: '[Demain à] LT', - nextWeek: 'dddd [à] LT', - lastDay: '[Hier à] LT', - lastWeek: 'dddd [dernier à] LT', - sameElse: 'L' - }, - relativeTime : { - future : "dans %s", - past : "il y a %s", - s : "quelques secondes", - m : "une minute", - mm : "%d minutes", - h : "une heure", - hh : "%d heures", - d : "un jour", - dd : "%d jours", - M : "un mois", - MM : "%d mois", - y : "un an", - yy : "%d ans" - }, - ordinal : function (number) { - return number + (number === 1 ? 'er' : ''); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : galician (gl) -// author : Juan G. Hurtado : https://github.com/juanghurtado - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('gl', { - months : "Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"), - monthsShort : "Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"), - weekdays : "Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"), - weekdaysShort : "Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"), - weekdaysMin : "Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay : function () { - return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextDay : function () { - return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextWeek : function () { - return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - lastDay : function () { - return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT'; - }, - lastWeek : function () { - return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : function (str) { - if (str === "uns segundos") { - return "nuns segundos"; - } - return "en " + str; - }, - past : "hai %s", - s : "uns segundos", - m : "un minuto", - mm : "%d minutos", - h : "unha hora", - hh : "%d horas", - d : "un día", - dd : "%d días", - M : "un mes", - MM : "%d meses", - y : "un ano", - yy : "%d anos" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Hebrew (he) -// author : Tomer Cohen : https://github.com/tomer -// author : Moshe Simantov : https://github.com/DevelopmentIL -// author : Tal Ater : https://github.com/TalAter - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('he', { - months : "ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"), - monthsShort : "ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"), - weekdays : "ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"), - weekdaysShort : "א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"), - weekdaysMin : "א_ב_ג_ד_ה_ו_ש".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [ב]MMMM YYYY", - LLL : "D [ב]MMMM YYYY LT", - LLLL : "dddd, D [ב]MMMM YYYY LT", - l : "D/M/YYYY", - ll : "D MMM YYYY", - lll : "D MMM YYYY LT", - llll : "ddd, D MMM YYYY LT" - }, - calendar : { - sameDay : '[היום ב־]LT', - nextDay : '[מחר ב־]LT', - nextWeek : 'dddd [בשעה] LT', - lastDay : '[אתמול ב־]LT', - lastWeek : '[ביום] dddd [האחרון בשעה] LT', - sameElse : 'L' - }, - relativeTime : { - future : "בעוד %s", - past : "לפני %s", - s : "מספר שניות", - m : "דקה", - mm : "%d דקות", - h : "שעה", - hh : function (number) { - if (number === 2) { - return "שעתיים"; - } - return number + " שעות"; - }, - d : "יום", - dd : function (number) { - if (number === 2) { - return "יומיים"; - } - return number + " ימים"; - }, - M : "חודש", - MM : function (number) { - if (number === 2) { - return "חודשיים"; - } - return number + " חודשים"; - }, - y : "שנה", - yy : function (number) { - if (number === 2) { - return "שנתיים"; - } - return number + " שנים"; - } - } - }); -})); - -// moment.js language configuration -// language : hindi (hi) -// author : Mayank Singhal : https://github.com/mayanksinghal - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - return moment.lang('hi', { - months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split("_"), - monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split("_"), - weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split("_"), - weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split("_"), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split("_"), - longDateFormat : { - LT : "A h:mm बजे", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[कल] LT', - nextWeek : 'dddd, LT', - lastDay : '[कल] LT', - lastWeek : '[पिछले] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s में", - past : "%s पहले", - s : "कुछ ही क्षण", - m : "एक मिनट", - mm : "%d मिनट", - h : "एक घंटा", - hh : "%d घंटे", - d : "एक दिन", - dd : "%d दिन", - M : "एक महीने", - MM : "%d महीने", - y : "एक वर्ष", - yy : "%d वर्ष" - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // Hindi notation for meridiems are quite fuzzy in practice. While there exists - // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi. - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "रात"; - } else if (hour < 10) { - return "सुबह"; - } else if (hour < 17) { - return "दोपहर"; - } else if (hour < 20) { - return "शाम"; - } else { - return "रात"; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : hrvatski (hr) -// author : Bojan Marković : https://github.com/bmarkovic - -// based on (sl) translation by Robert Sedovšek - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - return moment.lang('hr', { - months : "sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"), - monthsShort : "sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"), - weekdays : "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), - weekdaysShort : "ned._pon._uto._sri._čet._pet._sub.".split("_"), - weekdaysMin : "ne_po_ut_sr_če_pe_su".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "za %s", - past : "prije %s", - s : "par sekundi", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "dan", - dd : translate, - M : "mjesec", - MM : translate, - y : "godinu", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : hungarian (hu) -// author : Adam Brunner : https://github.com/adambrunner - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' '); - - function translate(number, withoutSuffix, key, isFuture) { - var num = number, - suffix; - - switch (key) { - case 's': - return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce'; - case 'm': - return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'mm': - return num + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'h': - return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'hh': - return num + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'd': - return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'dd': - return num + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'M': - return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'MM': - return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'y': - return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve'); - case 'yy': - return num + (isFuture || withoutSuffix ? ' év' : ' éve'); - } - - return ''; - } - - function week(isFuture) { - return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]'; - } - - return moment.lang('hu', { - months : "január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"), - monthsShort : "jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"), - weekdays : "vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"), - weekdaysShort : "vas_hét_kedd_sze_csüt_pén_szo".split("_"), - weekdaysMin : "v_h_k_sze_cs_p_szo".split("_"), - longDateFormat : { - LT : "H:mm", - L : "YYYY.MM.DD.", - LL : "YYYY. MMMM D.", - LLL : "YYYY. MMMM D., LT", - LLLL : "YYYY. MMMM D., dddd LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 12) { - return isLower === true ? 'de' : 'DE'; - } else { - return isLower === true ? 'du' : 'DU'; - } - }, - calendar : { - sameDay : '[ma] LT[-kor]', - nextDay : '[holnap] LT[-kor]', - nextWeek : function () { - return week.call(this, true); - }, - lastDay : '[tegnap] LT[-kor]', - lastWeek : function () { - return week.call(this, false); - }, - sameElse : 'L' - }, - relativeTime : { - future : "%s múlva", - past : "%s", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Armenian (hy-am) -// author : Armendarabyan : https://github.com/armendarabyan - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function monthsShortCaseReplace(m, format) { - var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'); - - return monthsShort[m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'); - - return weekdays[m.day()]; - } - - return moment.lang('hy-am', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), - weekdaysMin : "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY թ.", - LLL : "D MMMM YYYY թ., LT", - LLLL : "dddd, D MMMM YYYY թ., LT" - }, - calendar : { - sameDay: '[այսօր] LT', - nextDay: '[վաղը] LT', - lastDay: '[երեկ] LT', - nextWeek: function () { - return 'dddd [օրը ժամը] LT'; - }, - lastWeek: function () { - return '[անցած] dddd [օրը ժամը] LT'; - }, - sameElse: 'L' - }, - relativeTime : { - future : "%s հետո", - past : "%s առաջ", - s : "մի քանի վայրկյան", - m : "րոպե", - mm : "%d րոպե", - h : "ժամ", - hh : "%d ժամ", - d : "օր", - dd : "%d օր", - M : "ամիս", - MM : "%d ամիս", - y : "տարի", - yy : "%d տարի" - }, - - meridiem : function (hour) { - if (hour < 4) { - return "գիշերվա"; - } else if (hour < 12) { - return "առավոտվա"; - } else if (hour < 17) { - return "ցերեկվա"; - } else { - return "երեկոյան"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'DDD': - case 'w': - case 'W': - case 'DDDo': - if (number === 1) { - return number + '-ին'; - } - return number + '-րդ'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Bahasa Indonesia (id) -// author : Mohammad Satrio Utomo : https://github.com/tyok -// reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('id', { - months : "Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"), - weekdays : "Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"), - weekdaysShort : "Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"), - weekdaysMin : "Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"), - longDateFormat : { - LT : "HH.mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY [pukul] LT", - LLLL : "dddd, D MMMM YYYY [pukul] LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'siang'; - } else if (hours < 19) { - return 'sore'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Besok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kemarin pukul] LT', - lastWeek : 'dddd [lalu pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : "dalam %s", - past : "%s yang lalu", - s : "beberapa detik", - m : "semenit", - mm : "%d menit", - h : "sejam", - hh : "%d jam", - d : "sehari", - dd : "%d hari", - M : "sebulan", - MM : "%d bulan", - y : "setahun", - yy : "%d tahun" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : icelandic (is) -// author : Hinrik Örn Sigurðsson : https://github.com/hinrik - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function plural(n) { - if (n % 100 === 11) { - return true; - } else if (n % 10 === 1) { - return false; - } - return true; - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - switch (key) { - case 's': - return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum'; - case 'm': - return withoutSuffix ? 'mínúta' : 'mínútu'; - case 'mm': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum'); - } else if (withoutSuffix) { - return result + 'mínúta'; - } - return result + 'mínútu'; - case 'hh': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum'); - } - return result + 'klukkustund'; - case 'd': - if (withoutSuffix) { - return 'dagur'; - } - return isFuture ? 'dag' : 'degi'; - case 'dd': - if (plural(number)) { - if (withoutSuffix) { - return result + 'dagar'; - } - return result + (isFuture ? 'daga' : 'dögum'); - } else if (withoutSuffix) { - return result + 'dagur'; - } - return result + (isFuture ? 'dag' : 'degi'); - case 'M': - if (withoutSuffix) { - return 'mánuður'; - } - return isFuture ? 'mánuð' : 'mánuði'; - case 'MM': - if (plural(number)) { - if (withoutSuffix) { - return result + 'mánuðir'; - } - return result + (isFuture ? 'mánuði' : 'mánuðum'); - } else if (withoutSuffix) { - return result + 'mánuður'; - } - return result + (isFuture ? 'mánuð' : 'mánuði'); - case 'y': - return withoutSuffix || isFuture ? 'ár' : 'ári'; - case 'yy': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); - } - return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); - } - } - - return moment.lang('is', { - months : "janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"), - monthsShort : "jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"), - weekdays : "sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"), - weekdaysShort : "sun_mán_þri_mið_fim_fös_lau".split("_"), - weekdaysMin : "Su_Má_Þr_Mi_Fi_Fö_La".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY [kl.] LT", - LLLL : "dddd, D. MMMM YYYY [kl.] LT" - }, - calendar : { - sameDay : '[í dag kl.] LT', - nextDay : '[á morgun kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[í gær kl.] LT', - lastWeek : '[síðasta] dddd [kl.] LT', - sameElse : 'L' - }, - relativeTime : { - future : "eftir %s", - past : "fyrir %s síðan", - s : translate, - m : translate, - mm : translate, - h : "klukkustund", - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : italian (it) -// author : Lorenzo : https://github.com/aliem -// author: Mattia Larentis: https://github.com/nostalgiaz - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('it', { - months : "Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre".split("_"), - monthsShort : "Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"), - weekdays : "Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"), - weekdaysShort : "Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"), - weekdaysMin : "D_L_Ma_Me_G_V_S".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay: '[Oggi alle] LT', - nextDay: '[Domani alle] LT', - nextWeek: 'dddd [alle] LT', - lastDay: '[Ieri alle] LT', - lastWeek: '[lo scorso] dddd [alle] LT', - sameElse: 'L' - }, - relativeTime : { - future : function (s) { - return ((/^[0-9].+$/).test(s) ? "tra" : "in") + " " + s; - }, - past : "%s fa", - s : "alcuni secondi", - m : "un minuto", - mm : "%d minuti", - h : "un'ora", - hh : "%d ore", - d : "un giorno", - dd : "%d giorni", - M : "un mese", - MM : "%d mesi", - y : "un anno", - yy : "%d anni" - }, - ordinal: '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : japanese (ja) -// author : LI Long : https://github.com/baryon - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ja', { - months : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"), - weekdaysShort : "日_月_火_水_木_金_土".split("_"), - weekdaysMin : "日_月_火_水_木_金_土".split("_"), - longDateFormat : { - LT : "Ah時m分", - L : "YYYY/MM/DD", - LL : "YYYY年M月D日", - LLL : "YYYY年M月D日LT", - LLLL : "YYYY年M月D日LT dddd" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "午前"; - } else { - return "午後"; - } - }, - calendar : { - sameDay : '[今日] LT', - nextDay : '[明日] LT', - nextWeek : '[来週]dddd LT', - lastDay : '[昨日] LT', - lastWeek : '[前週]dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s後", - past : "%s前", - s : "数秒", - m : "1分", - mm : "%d分", - h : "1時間", - hh : "%d時間", - d : "1日", - dd : "%d日", - M : "1ヶ月", - MM : "%dヶ月", - y : "1年", - yy : "%d年" - } - }); -})); - -// moment.js language configuration -// language : Georgian (ka) -// author : Irakli Janiashvili : https://github.com/irakli-janiashvili - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') - }, - - nounCase = (/D[oD] *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - 'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_') - }, - - nounCase = (/(წინა|შემდეგ)/).test(format) ? - 'accusative' : - 'nominative'; - - return weekdays[nounCase][m.day()]; - } - - return moment.lang('ka', { - months : monthsCaseReplace, - monthsShort : "იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"), - weekdays : weekdaysCaseReplace, - weekdaysShort : "კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"), - weekdaysMin : "კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"), - longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[დღეს] LT[-ზე]', - nextDay : '[ხვალ] LT[-ზე]', - lastDay : '[გუშინ] LT[-ზე]', - nextWeek : '[შემდეგ] dddd LT[-ზე]', - lastWeek : '[წინა] dddd LT-ზე', - sameElse : 'L' - }, - relativeTime : { - future : function (s) { - return (/(წამი|წუთი|საათი|წელი)/).test(s) ? - s.replace(/ი$/, "ში") : - s + "ში"; - }, - past : function (s) { - if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) { - return s.replace(/(ი|ე)$/, "ის წინ"); - } - if ((/წელი/).test(s)) { - return s.replace(/წელი$/, "წლის წინ"); - } - }, - s : "რამდენიმე წამი", - m : "წუთი", - mm : "%d წუთი", - h : "საათი", - hh : "%d საათი", - d : "დღე", - dd : "%d დღე", - M : "თვე", - MM : "%d თვე", - y : "წელი", - yy : "%d წელი" - }, - ordinal : function (number) { - if (number === 0) { - return number; - } - - if (number === 1) { - return number + "-ლი"; - } - - if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) { - return "მე-" + number; - } - - return number + "-ე"; - }, - week : { - dow : 1, - doy : 7 - } - }); -})); - -// moment.js language configuration -// language : khmer (km) -// author : Kruy Vanna : https://github.com/kruyvanna - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('km', { - months: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), - monthsShort: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), - weekdays: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - weekdaysShort: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - weekdaysMin: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - longDateFormat: { - LT: "HH:mm", - L: "DD/MM/YYYY", - LL: "D MMMM YYYY", - LLL: "D MMMM YYYY LT", - LLLL: "dddd, D MMMM YYYY LT" - }, - calendar: { - sameDay: '[ថ្ងៃនៈ ម៉ោង] LT', - nextDay: '[ស្អែក ម៉ោង] LT', - nextWeek: 'dddd [ម៉ោង] LT', - lastDay: '[ម្សិលមិញ ម៉ោង] LT', - lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', - sameElse: 'L' - }, - relativeTime: { - future: "%sទៀត", - past: "%sមុន", - s: "ប៉ុន្មានវិនាទី", - m: "មួយនាទី", - mm: "%d នាទី", - h: "មួយម៉ោង", - hh: "%d ម៉ោង", - d: "មួយថ្ងៃ", - dd: "%d ថ្ងៃ", - M: "មួយខែ", - MM: "%d ខែ", - y: "មួយឆ្នាំ", - yy: "%d ឆ្នាំ" - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : korean (ko) -// -// authors -// -// - Kyungwook, Park : https://github.com/kyungw00k -// - Jeeeyul Lee -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ko', { - months : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), - monthsShort : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), - weekdays : "일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"), - weekdaysShort : "일_월_화_수_목_금_토".split("_"), - weekdaysMin : "일_월_화_수_목_금_토".split("_"), - longDateFormat : { - LT : "A h시 mm분", - L : "YYYY.MM.DD", - LL : "YYYY년 MMMM D일", - LLL : "YYYY년 MMMM D일 LT", - LLLL : "YYYY년 MMMM D일 dddd LT" - }, - meridiem : function (hour, minute, isUpper) { - return hour < 12 ? '오전' : '오후'; - }, - calendar : { - sameDay : '오늘 LT', - nextDay : '내일 LT', - nextWeek : 'dddd LT', - lastDay : '어제 LT', - lastWeek : '지난주 dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s 후", - past : "%s 전", - s : "몇초", - ss : "%d초", - m : "일분", - mm : "%d분", - h : "한시간", - hh : "%d시간", - d : "하루", - dd : "%d일", - M : "한달", - MM : "%d달", - y : "일년", - yy : "%d년" - }, - ordinal : '%d일', - meridiemParse : /(오전|오후)/, - isPM : function (token) { - return token === "오후"; - } - }); -})); - -// moment.js language configuration -// language : Luxembourgish (lb) -// author : mweimerskirch : https://github.com/mweimerskirch - -// Note: Luxembourgish has a very particular phonological rule ("Eifeler Regel") that causes the -// deletion of the final "n" in certain contexts. That's what the "eifelerRegelAppliesToWeekday" -// and "eifelerRegelAppliesToNumber" methods are meant for - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eng Minutt', 'enger Minutt'], - 'h': ['eng Stonn', 'enger Stonn'], - 'd': ['een Dag', 'engem Dag'], - 'dd': [number + ' Deeg', number + ' Deeg'], - 'M': ['ee Mount', 'engem Mount'], - 'MM': [number + ' Méint', number + ' Méint'], - 'y': ['ee Joer', 'engem Joer'], - 'yy': [number + ' Joer', number + ' Joer'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - function processFutureTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return "a " + string; - } - return "an " + string; - } - - function processPastTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return "viru " + string; - } - return "virun " + string; - } - - function processLastWeek(string1) { - var weekday = this.format('d'); - if (eifelerRegelAppliesToWeekday(weekday)) { - return '[Leschte] dddd [um] LT'; - } - return '[Leschten] dddd [um] LT'; - } - - /** - * Returns true if the word before the given week day loses the "-n" ending. - * e.g. "Leschten Dënschdeg" but "Leschte Méindeg" - * - * @param weekday {integer} - * @returns {boolean} - */ - function eifelerRegelAppliesToWeekday(weekday) { - weekday = parseInt(weekday, 10); - switch (weekday) { - case 0: // Sonndeg - case 1: // Méindeg - case 3: // Mëttwoch - case 5: // Freideg - case 6: // Samschdeg - return true; - default: // 2 Dënschdeg, 4 Donneschdeg - return false; - } - } - - /** - * Returns true if the word before the given number loses the "-n" ending. - * e.g. "an 10 Deeg" but "a 5 Deeg" - * - * @param number {integer} - * @returns {boolean} - */ - function eifelerRegelAppliesToNumber(number) { - number = parseInt(number, 10); - if (isNaN(number)) { - return false; - } - if (number < 0) { - // Negative Number --> always true - return true; - } else if (number < 10) { - // Only 1 digit - if (4 <= number && number <= 7) { - return true; - } - return false; - } else if (number < 100) { - // 2 digits - var lastDigit = number % 10, firstDigit = number / 10; - if (lastDigit === 0) { - return eifelerRegelAppliesToNumber(firstDigit); - } - return eifelerRegelAppliesToNumber(lastDigit); - } else if (number < 10000) { - // 3 or 4 digits --> recursively check first digit - while (number >= 10) { - number = number / 10; - } - return eifelerRegelAppliesToNumber(number); - } else { - // Anything larger than 4 digits: recursively check first n-3 digits - number = number / 1000; - return eifelerRegelAppliesToNumber(number); - } - } - - return moment.lang('lb', { - months: "Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), - monthsShort: "Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), - weekdays: "Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"), - weekdaysShort: "So._Mé._Dë._Më._Do._Fr._Sa.".split("_"), - weekdaysMin: "So_Mé_Dë_Më_Do_Fr_Sa".split("_"), - longDateFormat: { - LT: "H:mm [Auer]", - L: "DD.MM.YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" - }, - calendar: { - sameDay: "[Haut um] LT", - sameElse: "L", - nextDay: '[Muer um] LT', - nextWeek: 'dddd [um] LT', - lastDay: '[Gëschter um] LT', - lastWeek: processLastWeek - }, - relativeTime: { - future: processFutureTime, - past: processPastTime, - s: "e puer Sekonnen", - m: processRelativeTime, - mm: "%d Minutten", - h: processRelativeTime, - hh: "%d Stonnen", - d: processRelativeTime, - dd: processRelativeTime, - M: processRelativeTime, - MM: processRelativeTime, - y: processRelativeTime, - yy: processRelativeTime - }, - ordinal: '%d.', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Lithuanian (lt) -// author : Mindaugas Mozūras : https://github.com/mmozuras - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var units = { - "m" : "minutė_minutės_minutę", - "mm": "minutės_minučių_minutes", - "h" : "valanda_valandos_valandą", - "hh": "valandos_valandų_valandas", - "d" : "diena_dienos_dieną", - "dd": "dienos_dienų_dienas", - "M" : "mėnuo_mėnesio_mėnesį", - "MM": "mėnesiai_mėnesių_mėnesius", - "y" : "metai_metų_metus", - "yy": "metai_metų_metus" - }, - weekDays = "pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis_sekmadienis".split("_"); - - function translateSeconds(number, withoutSuffix, key, isFuture) { - if (withoutSuffix) { - return "kelios sekundės"; - } else { - return isFuture ? "kelių sekundžių" : "kelias sekundes"; - } - } - - function translateSingular(number, withoutSuffix, key, isFuture) { - return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); - } - - function special(number) { - return number % 10 === 0 || (number > 10 && number < 20); - } - - function forms(key) { - return units[key].split("_"); - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - if (number === 1) { - return result + translateSingular(number, withoutSuffix, key[0], isFuture); - } else if (withoutSuffix) { - return result + (special(number) ? forms(key)[1] : forms(key)[0]); - } else { - if (isFuture) { - return result + forms(key)[1]; - } else { - return result + (special(number) ? forms(key)[1] : forms(key)[2]); - } - } - } - - function relativeWeekDay(moment, format) { - var nominative = format.indexOf('dddd HH:mm') === -1, - weekDay = weekDays[moment.weekday()]; - - return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + "į"; - } - - return moment.lang("lt", { - months : "sausio_vasario_kovo_balandžio_gegužės_biržėlio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"), - monthsShort : "sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"), - weekdays : relativeWeekDay, - weekdaysShort : "Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"), - weekdaysMin : "S_P_A_T_K_Pn_Š".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "YYYY [m.] MMMM D [d.]", - LLL : "YYYY [m.] MMMM D [d.], LT [val.]", - LLLL : "YYYY [m.] MMMM D [d.], dddd, LT [val.]", - l : "YYYY-MM-DD", - ll : "YYYY [m.] MMMM D [d.]", - lll : "YYYY [m.] MMMM D [d.], LT [val.]", - llll : "YYYY [m.] MMMM D [d.], ddd, LT [val.]" - }, - calendar : { - sameDay : "[Šiandien] LT", - nextDay : "[Rytoj] LT", - nextWeek : "dddd LT", - lastDay : "[Vakar] LT", - lastWeek : "[Praėjusį] dddd LT", - sameElse : "L" - }, - relativeTime : { - future : "po %s", - past : "prieš %s", - s : translateSeconds, - m : translateSingular, - mm : translate, - h : translateSingular, - hh : translate, - d : translateSingular, - dd : translate, - M : translateSingular, - MM : translate, - y : translateSingular, - yy : translate - }, - ordinal : function (number) { - return number + '-oji'; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : latvian (lv) -// author : Kristaps Karlsons : https://github.com/skakri - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var units = { - 'mm': 'minūti_minūtes_minūte_minūtes', - 'hh': 'stundu_stundas_stunda_stundas', - 'dd': 'dienu_dienas_diena_dienas', - 'MM': 'mēnesi_mēnešus_mēnesis_mēneši', - 'yy': 'gadu_gadus_gads_gadi' - }; - - function format(word, number, withoutSuffix) { - var forms = word.split('_'); - if (withoutSuffix) { - return number % 10 === 1 && number !== 11 ? forms[2] : forms[3]; - } else { - return number % 10 === 1 && number !== 11 ? forms[0] : forms[1]; - } - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - return number + ' ' + format(units[key], number, withoutSuffix); - } - - return moment.lang('lv', { - months : "janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"), - weekdays : "svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"), - weekdaysShort : "Sv_P_O_T_C_Pk_S".split("_"), - weekdaysMin : "Sv_P_O_T_C_Pk_S".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "YYYY. [gada] D. MMMM", - LLL : "YYYY. [gada] D. MMMM, LT", - LLLL : "YYYY. [gada] D. MMMM, dddd, LT" - }, - calendar : { - sameDay : '[Šodien pulksten] LT', - nextDay : '[Rīt pulksten] LT', - nextWeek : 'dddd [pulksten] LT', - lastDay : '[Vakar pulksten] LT', - lastWeek : '[Pagājušā] dddd [pulksten] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s vēlāk", - past : "%s agrāk", - s : "dažas sekundes", - m : "minūti", - mm : relativeTimeWithPlural, - h : "stundu", - hh : relativeTimeWithPlural, - d : "dienu", - dd : relativeTimeWithPlural, - M : "mēnesi", - MM : relativeTimeWithPlural, - y : "gadu", - yy : relativeTimeWithPlural - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : macedonian (mk) -// author : Borislav Mickov : https://github.com/B0k0 - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('mk', { - months : "јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"), - monthsShort : "јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"), - weekdays : "недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"), - weekdaysShort : "нед_пон_вто_сре_чет_пет_саб".split("_"), - weekdaysMin : "нe_пo_вт_ср_че_пе_сa".split("_"), - longDateFormat : { - LT : "H:mm", - L : "D.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Денес во] LT', - nextDay : '[Утре во] LT', - nextWeek : 'dddd [во] LT', - lastDay : '[Вчера во] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[Во изминатата] dddd [во] LT'; - case 1: - case 2: - case 4: - case 5: - return '[Во изминатиот] dddd [во] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "после %s", - past : "пред %s", - s : "неколку секунди", - m : "минута", - mm : "%d минути", - h : "час", - hh : "%d часа", - d : "ден", - dd : "%d дена", - M : "месец", - MM : "%d месеци", - y : "година", - yy : "%d години" - }, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : malayalam (ml) -// author : Floyd Pink : https://github.com/floydpink - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ml', { - months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split("_"), - monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split("_"), - weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split("_"), - weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split("_"), - weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split("_"), - longDateFormat : { - LT : "A h:mm -നു", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[ഇന്ന്] LT', - nextDay : '[നാളെ] LT', - nextWeek : 'dddd, LT', - lastDay : '[ഇന്നലെ] LT', - lastWeek : '[കഴിഞ്ഞ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s കഴിഞ്ഞ്", - past : "%s മുൻപ്", - s : "അൽപ നിമിഷങ്ങൾ", - m : "ഒരു മിനിറ്റ്", - mm : "%d മിനിറ്റ്", - h : "ഒരു മണിക്കൂർ", - hh : "%d മണിക്കൂർ", - d : "ഒരു ദിവസം", - dd : "%d ദിവസം", - M : "ഒരു മാസം", - MM : "%d മാസം", - y : "ഒരു വർഷം", - yy : "%d വർഷം" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "രാത്രി"; - } else if (hour < 12) { - return "രാവിലെ"; - } else if (hour < 17) { - return "ഉച്ച കഴിഞ്ഞ്"; - } else if (hour < 20) { - return "വൈകുന്നേരം"; - } else { - return "രാത്രി"; - } - } - }); -})); - -// moment.js language configuration -// language : Marathi (mr) -// author : Harshad Kale : https://github.com/kalehv - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - return moment.lang('mr', { - months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split("_"), - monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split("_"), - weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split("_"), - weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split("_"), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split("_"), - longDateFormat : { - LT : "A h:mm वाजता", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[उद्या] LT', - nextWeek : 'dddd, LT', - lastDay : '[काल] LT', - lastWeek: '[मागील] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s नंतर", - past : "%s पूर्वी", - s : "सेकंद", - m: "एक मिनिट", - mm: "%d मिनिटे", - h : "एक तास", - hh : "%d तास", - d : "एक दिवस", - dd : "%d दिवस", - M : "एक महिना", - MM : "%d महिने", - y : "एक वर्ष", - yy : "%d वर्षे" - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiem: function (hour, minute, isLower) - { - if (hour < 4) { - return "रात्री"; - } else if (hour < 10) { - return "सकाळी"; - } else if (hour < 17) { - return "दुपारी"; - } else if (hour < 20) { - return "सायंकाळी"; - } else { - return "रात्री"; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Bahasa Malaysia (ms-MY) -// author : Weldan Jamili : https://github.com/weldan - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('ms-my', { - months : "Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"), - monthsShort : "Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"), - weekdays : "Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"), - weekdaysShort : "Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"), - weekdaysMin : "Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"), - longDateFormat : { - LT : "HH.mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY [pukul] LT", - LLLL : "dddd, D MMMM YYYY [pukul] LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'tengahari'; - } else if (hours < 19) { - return 'petang'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Esok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kelmarin pukul] LT', - lastWeek : 'dddd [lepas pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : "dalam %s", - past : "%s yang lepas", - s : "beberapa saat", - m : "seminit", - mm : "%d minit", - h : "sejam", - hh : "%d jam", - d : "sehari", - dd : "%d hari", - M : "sebulan", - MM : "%d bulan", - y : "setahun", - yy : "%d tahun" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : norwegian bokmål (nb) -// authors : Espen Hovlandsdal : https://github.com/rexxars -// Sigurd Gartmann : https://github.com/sigurdga - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('nb', { - months : "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"), - weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), - weekdaysShort : "sø._ma._ti._on._to._fr._lø.".split("_"), - weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"), - longDateFormat : { - LT : "H.mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY [kl.] LT", - LLLL : "dddd D. MMMM YYYY [kl.] LT" - }, - calendar : { - sameDay: '[i dag kl.] LT', - nextDay: '[i morgen kl.] LT', - nextWeek: 'dddd [kl.] LT', - lastDay: '[i går kl.] LT', - lastWeek: '[forrige] dddd [kl.] LT', - sameElse: 'L' - }, - relativeTime : { - future : "om %s", - past : "for %s siden", - s : "noen sekunder", - m : "ett minutt", - mm : "%d minutter", - h : "en time", - hh : "%d timer", - d : "en dag", - dd : "%d dager", - M : "en måned", - MM : "%d måneder", - y : "ett år", - yy : "%d år" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : nepali/nepalese -// author : suvash : https://github.com/suvash - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - return moment.lang('ne', { - months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split("_"), - monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split("_"), - weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split("_"), - weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split("_"), - weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split("_"), - longDateFormat : { - LT : "Aको h:mm बजे", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 3) { - return "राती"; - } else if (hour < 10) { - return "बिहान"; - } else if (hour < 15) { - return "दिउँसो"; - } else if (hour < 18) { - return "बेलुका"; - } else if (hour < 20) { - return "साँझ"; - } else { - return "राती"; - } - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[भोली] LT', - nextWeek : '[आउँदो] dddd[,] LT', - lastDay : '[हिजो] LT', - lastWeek : '[गएको] dddd[,] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%sमा", - past : "%s अगाडी", - s : "केही समय", - m : "एक मिनेट", - mm : "%d मिनेट", - h : "एक घण्टा", - hh : "%d घण्टा", - d : "एक दिन", - dd : "%d दिन", - M : "एक महिना", - MM : "%d महिना", - y : "एक बर्ष", - yy : "%d बर्ष" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : dutch (nl) -// author : Joris Röling : https://github.com/jjupiter - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var monthsShortWithDots = "jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"), - monthsShortWithoutDots = "jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"); - - return moment.lang('nl', { - months : "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShortWithoutDots[m.month()]; - } else { - return monthsShortWithDots[m.month()]; - } - }, - weekdays : "zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"), - weekdaysShort : "zo._ma._di._wo._do._vr._za.".split("_"), - weekdaysMin : "Zo_Ma_Di_Wo_Do_Vr_Za".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD-MM-YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: '[vandaag om] LT', - nextDay: '[morgen om] LT', - nextWeek: 'dddd [om] LT', - lastDay: '[gisteren om] LT', - lastWeek: '[afgelopen] dddd [om] LT', - sameElse: 'L' - }, - relativeTime : { - future : "over %s", - past : "%s geleden", - s : "een paar seconden", - m : "één minuut", - mm : "%d minuten", - h : "één uur", - hh : "%d uur", - d : "één dag", - dd : "%d dagen", - M : "één maand", - MM : "%d maanden", - y : "één jaar", - yy : "%d jaar" - }, - ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : norwegian nynorsk (nn) -// author : https://github.com/mechuwind - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('nn', { - months : "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), - weekdays : "sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"), - weekdaysShort : "sun_mån_tys_ons_tor_fre_lau".split("_"), - weekdaysMin : "su_må_ty_on_to_fr_lø".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: '[I dag klokka] LT', - nextDay: '[I morgon klokka] LT', - nextWeek: 'dddd [klokka] LT', - lastDay: '[I går klokka] LT', - lastWeek: '[Føregåande] dddd [klokka] LT', - sameElse: 'L' - }, - relativeTime : { - future : "om %s", - past : "for %s sidan", - s : "nokre sekund", - m : "eit minutt", - mm : "%d minutt", - h : "ein time", - hh : "%d timar", - d : "ein dag", - dd : "%d dagar", - M : "ein månad", - MM : "%d månader", - y : "eit år", - yy : "%d år" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : polish (pl) -// author : Rafal Hirsz : https://github.com/evoL - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var monthsNominative = "styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"), - monthsSubjective = "stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"); - - function plural(n) { - return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1); - } - - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'minuta' : 'minutę'; - case 'mm': - return result + (plural(number) ? 'minuty' : 'minut'); - case 'h': - return withoutSuffix ? 'godzina' : 'godzinę'; - case 'hh': - return result + (plural(number) ? 'godziny' : 'godzin'); - case 'MM': - return result + (plural(number) ? 'miesiące' : 'miesięcy'); - case 'yy': - return result + (plural(number) ? 'lata' : 'lat'); - } - } - - return moment.lang('pl', { - months : function (momentToFormat, format) { - if (/D MMMM/.test(format)) { - return monthsSubjective[momentToFormat.month()]; - } else { - return monthsNominative[momentToFormat.month()]; - } - }, - monthsShort : "sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"), - weekdays : "niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"), - weekdaysShort : "nie_pon_wt_śr_czw_pt_sb".split("_"), - weekdaysMin : "N_Pn_Wt_Śr_Cz_Pt_So".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay: '[Dziś o] LT', - nextDay: '[Jutro o] LT', - nextWeek: '[W] dddd [o] LT', - lastDay: '[Wczoraj o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[W zeszłą niedzielę o] LT'; - case 3: - return '[W zeszłą środę o] LT'; - case 6: - return '[W zeszłą sobotę o] LT'; - default: - return '[W zeszły] dddd [o] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "za %s", - past : "%s temu", - s : "kilka sekund", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "1 dzień", - dd : '%d dni', - M : "miesiąc", - MM : translate, - y : "rok", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : brazilian portuguese (pt-br) -// author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('pt-br', { - months : "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), - monthsShort : "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), - weekdays : "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), - weekdaysShort : "dom_seg_ter_qua_qui_sex_sáb".split("_"), - weekdaysMin : "dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [de] YYYY", - LLL : "D [de] MMMM [de] YYYY [às] LT", - LLLL : "dddd, D [de] MMMM [de] YYYY [às] LT" - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : "em %s", - past : "%s atrás", - s : "segundos", - m : "um minuto", - mm : "%d minutos", - h : "uma hora", - hh : "%d horas", - d : "um dia", - dd : "%d dias", - M : "um mês", - MM : "%d meses", - y : "um ano", - yy : "%d anos" - }, - ordinal : '%dº' - }); -})); - -// moment.js language configuration -// language : portuguese (pt) -// author : Jefferson : https://github.com/jalex79 - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('pt', { - months : "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), - monthsShort : "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), - weekdays : "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), - weekdaysShort : "dom_seg_ter_qua_qui_sex_sáb".split("_"), - weekdaysMin : "dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [de] YYYY", - LLL : "D [de] MMMM [de] YYYY LT", - LLLL : "dddd, D [de] MMMM [de] YYYY LT" - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : "em %s", - past : "%s atrás", - s : "segundos", - m : "um minuto", - mm : "%d minutos", - h : "uma hora", - hh : "%d horas", - d : "um dia", - dd : "%d dias", - M : "um mês", - MM : "%d meses", - y : "um ano", - yy : "%d anos" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : romanian (ro) -// author : Vlad Gurdiga : https://github.com/gurdiga -// author : Valentin Agachi : https://github.com/avaly - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': 'minute', - 'hh': 'ore', - 'dd': 'zile', - 'MM': 'luni', - 'yy': 'ani' - }, - separator = ' '; - if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) { - separator = ' de '; - } - - return number + separator + format[key]; - } - - return moment.lang('ro', { - months : "ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"), - monthsShort : "ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"), - weekdays : "duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"), - weekdaysShort : "Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"), - weekdaysMin : "Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY H:mm", - LLLL : "dddd, D MMMM YYYY H:mm" - }, - calendar : { - sameDay: "[azi la] LT", - nextDay: '[mâine la] LT', - nextWeek: 'dddd [la] LT', - lastDay: '[ieri la] LT', - lastWeek: '[fosta] dddd [la] LT', - sameElse: 'L' - }, - relativeTime : { - future : "peste %s", - past : "%s în urmă", - s : "câteva secunde", - m : "un minut", - mm : relativeTimeWithPlural, - h : "o oră", - hh : relativeTimeWithPlural, - d : "o zi", - dd : relativeTimeWithPlural, - M : "o lună", - MM : relativeTimeWithPlural, - y : "un an", - yy : relativeTimeWithPlural - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : russian (ru) -// author : Viktorminator : https://github.com/Viktorminator -// Author : Menelion Elensúle : https://github.com/Oire - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', - 'hh': 'час_часа_часов', - 'dd': 'день_дня_дней', - 'MM': 'месяц_месяца_месяцев', - 'yy': 'год_года_лет' - }; - if (key === 'm') { - return withoutSuffix ? 'минута' : 'минуту'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function monthsShortCaseReplace(m, format) { - var monthsShort = { - 'nominative': 'янв_фев_мар_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return monthsShort[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_') - }, - - nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - - return weekdays[nounCase][m.day()]; - } - - return moment.lang('ru', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : "вс_пн_вт_ср_чт_пт_сб".split("_"), - weekdaysMin : "вс_пн_вт_ср_чт_пт_сб".split("_"), - monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i], - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY г.", - LLL : "D MMMM YYYY г., LT", - LLLL : "dddd, D MMMM YYYY г., LT" - }, - calendar : { - sameDay: '[Сегодня в] LT', - nextDay: '[Завтра в] LT', - lastDay: '[Вчера в] LT', - nextWeek: function () { - return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; - }, - lastWeek: function () { - switch (this.day()) { - case 0: - return '[В прошлое] dddd [в] LT'; - case 1: - case 2: - case 4: - return '[В прошлый] dddd [в] LT'; - case 3: - case 5: - case 6: - return '[В прошлую] dddd [в] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "через %s", - past : "%s назад", - s : "несколько секунд", - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : "час", - hh : relativeTimeWithPlural, - d : "день", - dd : relativeTimeWithPlural, - M : "месяц", - MM : relativeTimeWithPlural, - y : "год", - yy : relativeTimeWithPlural - }, - - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "ночи"; - } else if (hour < 12) { - return "утра"; - } else if (hour < 17) { - return "дня"; - } else { - return "вечера"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - return number + '-й'; - case 'D': - return number + '-го'; - case 'w': - case 'W': - return number + '-я'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : slovak (sk) -// author : Martin Minka : https://github.com/k2s -// based on work of petrbela : https://github.com/petrbela - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - var months = "január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"), - monthsShort = "jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"); - - function plural(n) { - return (n > 1) && (n < 5); - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minúty' : 'minút'); - } else { - return result + 'minútami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodín'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'deň' : 'dňom'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dni' : 'dní'); - } else { - return result + 'dňami'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'mesiace' : 'mesiacov'); - } else { - return result + 'mesiacmi'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokom'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'rokov'); - } else { - return result + 'rokmi'; - } - break; - } - } - - return moment.lang('sk', { - months : months, - monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), - weekdays : "nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"), - weekdaysShort : "ne_po_ut_st_št_pi_so".split("_"), - weekdaysMin : "ne_po_ut_st_št_pi_so".split("_"), - longDateFormat : { - LT: "H:mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd D. MMMM YYYY LT" - }, - calendar : { - sameDay: "[dnes o] LT", - nextDay: '[zajtra o] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v nedeľu o] LT'; - case 1: - case 2: - return '[v] dddd [o] LT'; - case 3: - return '[v stredu o] LT'; - case 4: - return '[vo štvrtok o] LT'; - case 5: - return '[v piatok o] LT'; - case 6: - return '[v sobotu o] LT'; - } - }, - lastDay: '[včera o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulú nedeľu o] LT'; - case 1: - case 2: - return '[minulý] dddd [o] LT'; - case 3: - return '[minulú stredu o] LT'; - case 4: - case 5: - return '[minulý] dddd [o] LT'; - case 6: - return '[minulú sobotu o] LT'; - } - }, - sameElse: "L" - }, - relativeTime : { - future : "za %s", - past : "pred %s", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : slovenian (sl) -// author : Robert Sedovšek : https://github.com/sedovsek - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'ena minuta' : 'eno minuto'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2) { - result += 'minuti'; - } else if (number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minut'; - } - return result; - case 'h': - return withoutSuffix ? 'ena ura' : 'eno uro'; - case 'hh': - if (number === 1) { - result += 'ura'; - } else if (number === 2) { - result += 'uri'; - } else if (number === 3 || number === 4) { - result += 'ure'; - } else { - result += 'ur'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dni'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mesec'; - } else if (number === 2) { - result += 'meseca'; - } else if (number === 3 || number === 4) { - result += 'mesece'; - } else { - result += 'mesecev'; - } - return result; - case 'yy': - if (number === 1) { - result += 'leto'; - } else if (number === 2) { - result += 'leti'; - } else if (number === 3 || number === 4) { - result += 'leta'; - } else { - result += 'let'; - } - return result; - } - } - - return moment.lang('sl', { - months : "januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"), - monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"), - weekdays : "nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"), - weekdaysShort : "ned._pon._tor._sre._čet._pet._sob.".split("_"), - weekdaysMin : "ne_po_to_sr_če_pe_so".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[danes ob] LT', - nextDay : '[jutri ob] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[v] [nedeljo] [ob] LT'; - case 3: - return '[v] [sredo] [ob] LT'; - case 6: - return '[v] [soboto] [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[v] dddd [ob] LT'; - } - }, - lastDay : '[včeraj ob] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[prejšnja] dddd [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prejšnji] dddd [ob] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "čez %s", - past : "%s nazaj", - s : "nekaj sekund", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "en dan", - dd : translate, - M : "en mesec", - MM : translate, - y : "eno leto", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Albanian (sq) -// author : Flakërim Ismani : https://github.com/flakerimi -// author: Menelion Elensúle: https://github.com/Oire (tests) -// author : Oerd Cukalla : https://github.com/oerd (fixes) - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('sq', { - months : "Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"), - monthsShort : "Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"), - weekdays : "E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"), - weekdaysShort : "Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"), - weekdaysMin : "D_H_Ma_Më_E_P_Sh".split("_"), - meridiem : function (hours, minutes, isLower) { - return hours < 12 ? 'PD' : 'MD'; - }, - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Sot në] LT', - nextDay : '[Nesër në] LT', - nextWeek : 'dddd [në] LT', - lastDay : '[Dje në] LT', - lastWeek : 'dddd [e kaluar në] LT', - sameElse : 'L' - }, - relativeTime : { - future : "në %s", - past : "%s më parë", - s : "disa sekonda", - m : "një minutë", - mm : "%d minuta", - h : "një orë", - hh : "%d orë", - d : "një ditë", - dd : "%d ditë", - M : "një muaj", - MM : "%d muaj", - y : "një vit", - yy : "%d vite" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Serbian-cyrillic (sr-cyr) -// author : Milan Janačković : https://github.com/milan-j - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - var translator = { - words: { //Different grammatical cases - m: ['један минут', 'једне минуте'], - mm: ['минут', 'минуте', 'минута'], - h: ['један сат', 'једног сата'], - hh: ['сат', 'сата', 'сати'], - dd: ['дан', 'дана', 'дана'], - MM: ['месец', 'месеца', 'месеци'], - yy: ['година', 'године', 'година'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - return moment.lang('sr-cyr', { - months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], - monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], - weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], - weekdaysShort: ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], - weekdaysMin: ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], - longDateFormat: { - LT: "H:mm", - L: "DD. MM. YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" - }, - calendar: { - sameDay: '[данас у] LT', - nextDay: '[сутра у] LT', - - nextWeek: function () { - switch (this.day()) { - case 0: - return '[у] [недељу] [у] LT'; - case 3: - return '[у] [среду] [у] LT'; - case 6: - return '[у] [суботу] [у] LT'; - case 1: - case 2: - case 4: - case 5: - return '[у] dddd [у] LT'; - } - }, - lastDay : '[јуче у] LT', - lastWeek : function () { - var lastWeekDays = [ - '[прошле] [недеље] [у] LT', - '[прошлог] [понедељка] [у] LT', - '[прошлог] [уторка] [у] LT', - '[прошле] [среде] [у] LT', - '[прошлог] [четвртка] [у] LT', - '[прошлог] [петка] [у] LT', - '[прошле] [суботе] [у] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : "за %s", - past : "пре %s", - s : "неколико секунди", - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : "дан", - dd : translator.translate, - M : "месец", - MM : translator.translate, - y : "годину", - yy : translator.translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Serbian-latin (sr) -// author : Milan Janačković : https://github.com/milan-j - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - var translator = { - words: { //Different grammatical cases - m: ['jedan minut', 'jedne minute'], - mm: ['minut', 'minute', 'minuta'], - h: ['jedan sat', 'jednog sata'], - hh: ['sat', 'sata', 'sati'], - dd: ['dan', 'dana', 'dana'], - MM: ['mesec', 'meseca', 'meseci'], - yy: ['godina', 'godine', 'godina'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - return moment.lang('sr', { - months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], - monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], - weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], - weekdaysShort: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], - weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], - longDateFormat: { - LT: "H:mm", - L: "DD. MM. YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" - }, - calendar: { - sameDay: '[danas u] LT', - nextDay: '[sutra u] LT', - - nextWeek: function () { - switch (this.day()) { - case 0: - return '[u] [nedelju] [u] LT'; - case 3: - return '[u] [sredu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[juče u] LT', - lastWeek : function () { - var lastWeekDays = [ - '[prošle] [nedelje] [u] LT', - '[prošlog] [ponedeljka] [u] LT', - '[prošlog] [utorka] [u] LT', - '[prošle] [srede] [u] LT', - '[prošlog] [četvrtka] [u] LT', - '[prošlog] [petka] [u] LT', - '[prošle] [subote] [u] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : "za %s", - past : "pre %s", - s : "nekoliko sekundi", - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : "dan", - dd : translator.translate, - M : "mesec", - MM : translator.translate, - y : "godinu", - yy : translator.translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : swedish (sv) -// author : Jens Alm : https://github.com/ulmus - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('sv', { - months : "januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), - weekdays : "söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"), - weekdaysShort : "sön_mån_tis_ons_tor_fre_lör".split("_"), - weekdaysMin : "sö_må_ti_on_to_fr_lö".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: '[Idag] LT', - nextDay: '[Imorgon] LT', - lastDay: '[Igår] LT', - nextWeek: 'dddd LT', - lastWeek: '[Förra] dddd[en] LT', - sameElse: 'L' - }, - relativeTime : { - future : "om %s", - past : "för %s sedan", - s : "några sekunder", - m : "en minut", - mm : "%d minuter", - h : "en timme", - hh : "%d timmar", - d : "en dag", - dd : "%d dagar", - M : "en månad", - MM : "%d månader", - y : "ett år", - yy : "%d år" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'e' : - (b === 1) ? 'a' : - (b === 2) ? 'a' : - (b === 3) ? 'e' : 'e'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : tamil (ta) -// author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - /*var symbolMap = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦' - }, - numberMap = { - '௧': '1', - '௨': '2', - '௩': '3', - '௪': '4', - '௫': '5', - '௬': '6', - '௭': '7', - '௮': '8', - '௯': '9', - '௦': '0' - }; */ - - return moment.lang('ta', { - months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split("_"), - monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split("_"), - weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split("_"), - weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split("_"), - weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[இன்று] LT', - nextDay : '[நாளை] LT', - nextWeek : 'dddd, LT', - lastDay : '[நேற்று] LT', - lastWeek : '[கடந்த வாரம்] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s இல்", - past : "%s முன்", - s : "ஒரு சில விநாடிகள்", - m : "ஒரு நிமிடம்", - mm : "%d நிமிடங்கள்", - h : "ஒரு மணி நேரம்", - hh : "%d மணி நேரம்", - d : "ஒரு நாள்", - dd : "%d நாட்கள்", - M : "ஒரு மாதம்", - MM : "%d மாதங்கள்", - y : "ஒரு வருடம்", - yy : "%d ஆண்டுகள்" - }, -/* preparse: function (string) { - return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - },*/ - ordinal : function (number) { - return number + 'வது'; - }, - - -// refer http://ta.wikipedia.org/s/1er1 - - meridiem : function (hour, minute, isLower) { - if (hour >= 6 && hour <= 10) { - return " காலை"; - } else if (hour >= 10 && hour <= 14) { - return " நண்பகல்"; - } else if (hour >= 14 && hour <= 18) { - return " எற்பாடு"; - } else if (hour >= 18 && hour <= 20) { - return " மாலை"; - } else if (hour >= 20 && hour <= 24) { - return " இரவு"; - } else if (hour >= 0 && hour <= 6) { - return " வைகறை"; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : thai (th) -// author : Kridsada Thanabulpong : https://github.com/sirn - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('th', { - months : "มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"), - monthsShort : "มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"), - weekdays : "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"), - weekdaysShort : "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"), // yes, three characters difference - weekdaysMin : "อา._จ._อ._พ._พฤ._ศ._ส.".split("_"), - longDateFormat : { - LT : "H นาฬิกา m นาที", - L : "YYYY/MM/DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY เวลา LT", - LLLL : "วันddddที่ D MMMM YYYY เวลา LT" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "ก่อนเที่ยง"; - } else { - return "หลังเที่ยง"; - } - }, - calendar : { - sameDay : '[วันนี้ เวลา] LT', - nextDay : '[พรุ่งนี้ เวลา] LT', - nextWeek : 'dddd[หน้า เวลา] LT', - lastDay : '[เมื่อวานนี้ เวลา] LT', - lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT', - sameElse : 'L' - }, - relativeTime : { - future : "อีก %s", - past : "%sที่แล้ว", - s : "ไม่กี่วินาที", - m : "1 นาที", - mm : "%d นาที", - h : "1 ชั่วโมง", - hh : "%d ชั่วโมง", - d : "1 วัน", - dd : "%d วัน", - M : "1 เดือน", - MM : "%d เดือน", - y : "1 ปี", - yy : "%d ปี" - } - }); -})); - -// moment.js language configuration -// language : Tagalog/Filipino (tl-ph) -// author : Dan Hagman - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('tl-ph', { - months : "Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"), - monthsShort : "Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"), - weekdays : "Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"), - weekdaysShort : "Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"), - weekdaysMin : "Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "MM/D/YYYY", - LL : "MMMM D, YYYY", - LLL : "MMMM D, YYYY LT", - LLLL : "dddd, MMMM DD, YYYY LT" - }, - calendar : { - sameDay: "[Ngayon sa] LT", - nextDay: '[Bukas sa] LT', - nextWeek: 'dddd [sa] LT', - lastDay: '[Kahapon sa] LT', - lastWeek: 'dddd [huling linggo] LT', - sameElse: 'L' - }, - relativeTime : { - future : "sa loob ng %s", - past : "%s ang nakalipas", - s : "ilang segundo", - m : "isang minuto", - mm : "%d minuto", - h : "isang oras", - hh : "%d oras", - d : "isang araw", - dd : "%d araw", - M : "isang buwan", - MM : "%d buwan", - y : "isang taon", - yy : "%d taon" - }, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : turkish (tr) -// authors : Erhan Gundogan : https://github.com/erhangundogan, -// Burak Yiğit Kaya: https://github.com/BYK - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - - var suffixes = { - 1: "'inci", - 5: "'inci", - 8: "'inci", - 70: "'inci", - 80: "'inci", - - 2: "'nci", - 7: "'nci", - 20: "'nci", - 50: "'nci", - - 3: "'üncü", - 4: "'üncü", - 100: "'üncü", - - 6: "'ncı", - - 9: "'uncu", - 10: "'uncu", - 30: "'uncu", - - 60: "'ıncı", - 90: "'ıncı" - }; - - return moment.lang('tr', { - months : "Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"), - monthsShort : "Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"), - weekdays : "Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"), - weekdaysShort : "Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"), - weekdaysMin : "Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[bugün saat] LT', - nextDay : '[yarın saat] LT', - nextWeek : '[haftaya] dddd [saat] LT', - lastDay : '[dün] LT', - lastWeek : '[geçen hafta] dddd [saat] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s sonra", - past : "%s önce", - s : "birkaç saniye", - m : "bir dakika", - mm : "%d dakika", - h : "bir saat", - hh : "%d saat", - d : "bir gün", - dd : "%d gün", - M : "bir ay", - MM : "%d ay", - y : "bir yıl", - yy : "%d yıl" - }, - ordinal : function (number) { - if (number === 0) { // special case for zero - return number + "'ıncı"; - } - var a = number % 10, - b = number % 100 - a, - c = number >= 100 ? 100 : null; - - return number + (suffixes[a] || suffixes[b] || suffixes[c]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Morocco Central Atlas Tamaziɣt in Latin (tzm-la) -// author : Abdel Said : https://github.com/abdelsaid - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('tzm-la', { - months : "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), - monthsShort : "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), - weekdays : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - weekdaysShort : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - weekdaysMin : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[asdkh g] LT", - nextDay: '[aska g] LT', - nextWeek: 'dddd [g] LT', - lastDay: '[assant g] LT', - lastWeek: 'dddd [g] LT', - sameElse: 'L' - }, - relativeTime : { - future : "dadkh s yan %s", - past : "yan %s", - s : "imik", - m : "minuḍ", - mm : "%d minuḍ", - h : "saɛa", - hh : "%d tassaɛin", - d : "ass", - dd : "%d ossan", - M : "ayowr", - MM : "%d iyyirn", - y : "asgas", - yy : "%d isgasn" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : Morocco Central Atlas Tamaziɣt (tzm) -// author : Abdel Said : https://github.com/abdelsaid - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('tzm', { - months : "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), - monthsShort : "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), - weekdays : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - weekdaysShort : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - weekdaysMin : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[ⴰⵙⴷⵅ ⴴ] LT", - nextDay: '[ⴰⵙⴽⴰ ⴴ] LT', - nextWeek: 'dddd [ⴴ] LT', - lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT', - lastWeek: 'dddd [ⴴ] LT', - sameElse: 'L' - }, - relativeTime : { - future : "ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s", - past : "ⵢⴰⵏ %s", - s : "ⵉⵎⵉⴽ", - m : "ⵎⵉⵏⵓⴺ", - mm : "%d ⵎⵉⵏⵓⴺ", - h : "ⵙⴰⵄⴰ", - hh : "%d ⵜⴰⵙⵙⴰⵄⵉⵏ", - d : "ⴰⵙⵙ", - dd : "%d oⵙⵙⴰⵏ", - M : "ⴰⵢoⵓⵔ", - MM : "%d ⵉⵢⵢⵉⵔⵏ", - y : "ⴰⵙⴳⴰⵙ", - yy : "%d ⵉⵙⴳⴰⵙⵏ" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : ukrainian (uk) -// author : zemlanin : https://github.com/zemlanin -// Author : Menelion Elensúle : https://github.com/Oire - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': 'хвилина_хвилини_хвилин', - 'hh': 'година_години_годин', - 'dd': 'день_дні_днів', - 'MM': 'місяць_місяці_місяців', - 'yy': 'рік_роки_років' - }; - if (key === 'm') { - return withoutSuffix ? 'хвилина' : 'хвилину'; - } - else if (key === 'h') { - return withoutSuffix ? 'година' : 'годину'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'), - 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') - }, - - nounCase = (/D[oD]? *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), - 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'), - 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_') - }, - - nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ? - 'accusative' : - ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ? - 'genitive' : - 'nominative'); - - return weekdays[nounCase][m.day()]; - } - - function processHoursFunction(str) { - return function () { - return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; - }; - } - - return moment.lang('uk', { - months : monthsCaseReplace, - monthsShort : "січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"), - weekdays : weekdaysCaseReplace, - weekdaysShort : "нд_пн_вт_ср_чт_пт_сб".split("_"), - weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY р.", - LLL : "D MMMM YYYY р., LT", - LLLL : "dddd, D MMMM YYYY р., LT" - }, - calendar : { - sameDay: processHoursFunction('[Сьогодні '), - nextDay: processHoursFunction('[Завтра '), - lastDay: processHoursFunction('[Вчора '), - nextWeek: processHoursFunction('[У] dddd ['), - lastWeek: function () { - switch (this.day()) { - case 0: - case 3: - case 5: - case 6: - return processHoursFunction('[Минулої] dddd [').call(this); - case 1: - case 2: - case 4: - return processHoursFunction('[Минулого] dddd [').call(this); - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "за %s", - past : "%s тому", - s : "декілька секунд", - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : "годину", - hh : relativeTimeWithPlural, - d : "день", - dd : relativeTimeWithPlural, - M : "місяць", - MM : relativeTimeWithPlural, - y : "рік", - yy : relativeTimeWithPlural - }, - - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "ночі"; - } else if (hour < 12) { - return "ранку"; - } else if (hour < 17) { - return "дня"; - } else { - return "вечора"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return number + '-й'; - case 'D': - return number + '-го'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : uzbek -// author : Sardor Muminov : https://github.com/muminoff - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('uz', { - months : "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), - monthsShort : "янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"), - weekdays : "Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"), - weekdaysShort : "Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"), - weekdaysMin : "Як_Ду_Се_Чо_Па_Жу_Ша".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "D MMMM YYYY, dddd LT" - }, - calendar : { - sameDay : '[Бугун соат] LT [да]', - nextDay : '[Эртага] LT [да]', - nextWeek : 'dddd [куни соат] LT [да]', - lastDay : '[Кеча соат] LT [да]', - lastWeek : '[Утган] dddd [куни соат] LT [да]', - sameElse : 'L' - }, - relativeTime : { - future : "Якин %s ичида", - past : "Бир неча %s олдин", - s : "фурсат", - m : "бир дакика", - mm : "%d дакика", - h : "бир соат", - hh : "%d соат", - d : "бир кун", - dd : "%d кун", - M : "бир ой", - MM : "%d ой", - y : "бир йил", - yy : "%d йил" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : vietnamese (vi) -// author : Bang Nguyen : https://github.com/bangnk - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('vi', { - months : "tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"), - monthsShort : "Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"), - weekdays : "chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"), - weekdaysShort : "CN_T2_T3_T4_T5_T6_T7".split("_"), - weekdaysMin : "CN_T2_T3_T4_T5_T6_T7".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM [năm] YYYY", - LLL : "D MMMM [năm] YYYY LT", - LLLL : "dddd, D MMMM [năm] YYYY LT", - l : "DD/M/YYYY", - ll : "D MMM YYYY", - lll : "D MMM YYYY LT", - llll : "ddd, D MMM YYYY LT" - }, - calendar : { - sameDay: "[Hôm nay lúc] LT", - nextDay: '[Ngày mai lúc] LT', - nextWeek: 'dddd [tuần tới lúc] LT', - lastDay: '[Hôm qua lúc] LT', - lastWeek: 'dddd [tuần rồi lúc] LT', - sameElse: 'L' - }, - relativeTime : { - future : "%s tới", - past : "%s trước", - s : "vài giây", - m : "một phút", - mm : "%d phút", - h : "một giờ", - hh : "%d giờ", - d : "một ngày", - dd : "%d ngày", - M : "một tháng", - MM : "%d tháng", - y : "một năm", - yy : "%d năm" - }, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : chinese -// author : suupic : https://github.com/suupic -// author : Zeno Zeng : https://github.com/zenozeng - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('zh-cn', { - months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), - weekdaysShort : "周日_周一_周二_周三_周四_周五_周六".split("_"), - weekdaysMin : "日_一_二_三_四_五_六".split("_"), - longDateFormat : { - LT : "Ah点mm", - L : "YYYY-MM-DD", - LL : "YYYY年MMMD日", - LLL : "YYYY年MMMD日LT", - LLLL : "YYYY年MMMD日ddddLT", - l : "YYYY-MM-DD", - ll : "YYYY年MMMD日", - lll : "YYYY年MMMD日LT", - llll : "YYYY年MMMD日ddddLT" - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return "凌晨"; - } else if (hm < 900) { - return "早上"; - } else if (hm < 1130) { - return "上午"; - } else if (hm < 1230) { - return "中午"; - } else if (hm < 1800) { - return "下午"; - } else { - return "晚上"; - } - }, - calendar : { - sameDay : function () { - return this.minutes() === 0 ? "[今天]Ah[点整]" : "[今天]LT"; - }, - nextDay : function () { - return this.minutes() === 0 ? "[明天]Ah[点整]" : "[明天]LT"; - }, - lastDay : function () { - return this.minutes() === 0 ? "[昨天]Ah[点整]" : "[昨天]LT"; - }, - nextWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]'; - return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm"; - }, - lastWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; - return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm"; - }, - sameElse : 'LL' - }, - ordinal : function (number, period) { - switch (period) { - case "d": - case "D": - case "DDD": - return number + "日"; - case "M": - return number + "月"; - case "w": - case "W": - return number + "周"; - default: - return number; - } - }, - relativeTime : { - future : "%s内", - past : "%s前", - s : "几秒", - m : "1分钟", - mm : "%d分钟", - h : "1小时", - hh : "%d小时", - d : "1天", - dd : "%d天", - M : "1个月", - MM : "%d个月", - y : "1年", - yy : "%d年" - }, - week : { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); - -// moment.js language configuration -// language : traditional chinese (zh-tw) -// author : Ben : https://github.com/ben-lin - -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(['moment'], factory); // AMD - } else if (typeof exports === 'object') { - module.exports = factory(require('../moment')); // Node - } else { - factory(window.moment); // Browser global - } -}(function (moment) { - return moment.lang('zh-tw', { - months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), - weekdaysShort : "週日_週一_週二_週三_週四_週五_週六".split("_"), - weekdaysMin : "日_一_二_三_四_五_六".split("_"), - longDateFormat : { - LT : "Ah點mm", - L : "YYYY年MMMD日", - LL : "YYYY年MMMD日", - LLL : "YYYY年MMMD日LT", - LLLL : "YYYY年MMMD日ddddLT", - l : "YYYY年MMMD日", - ll : "YYYY年MMMD日", - lll : "YYYY年MMMD日LT", - llll : "YYYY年MMMD日ddddLT" - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 900) { - return "早上"; - } else if (hm < 1130) { - return "上午"; - } else if (hm < 1230) { - return "中午"; - } else if (hm < 1800) { - return "下午"; - } else { - return "晚上"; - } - }, - calendar : { - sameDay : '[今天]LT', - nextDay : '[明天]LT', - nextWeek : '[下]ddddLT', - lastDay : '[昨天]LT', - lastWeek : '[上]ddddLT', - sameElse : 'L' - }, - ordinal : function (number, period) { - switch (period) { - case "d" : - case "D" : - case "DDD" : - return number + "日"; - case "M" : - return number + "月"; - case "w" : - case "W" : - return number + "週"; - default : - return number; - } - }, - relativeTime : { - future : "%s內", - past : "%s前", - s : "幾秒", - m : "一分鐘", - mm : "%d分鐘", - h : "一小時", - hh : "%d小時", - d : "一天", - dd : "%d天", - M : "一個月", - MM : "%d個月", - y : "一年", - yy : "%d年" - } - }); -})); diff --git a/vendors/moment/min/langs.min.js b/vendors/moment/min/langs.min.js deleted file mode 100644 index 6905df4d3..000000000 --- a/vendors/moment/min/langs.min.js +++ /dev/null @@ -1,3 +0,0 @@ -!function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("ar",{months:"يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"),monthsShort:"يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+e(d[c],a)}function c(a){switch(d(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function d(a){return a>9?d(a%10):a}function e(a,b){return 2===b?f(a):a}function f(a){var b={m:"v",b:"v",d:"z"};return void 0===b[a.charAt(0)]?a:b[a.charAt(0)]+a.substring(1)}return a.lang("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY LT",LLLL:"dddd, D [a viz] MMMM YYYY LT"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:b,h:"un eur",hh:"%d eur",d:"un devezh",dd:b,M:"ur miz",MM:b,y:"ur bloaz",yy:c},ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}return a.lang("bs",{months:"januar_februar_mart_april_maj_juni_juli_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:b,mm:b,h:b,hh:b,d:"dan",dd:b,M:"mjesec",MM:b,y:"godinu",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a){return a>1&&5>a&&1!==~~(a/10)}function c(a,c,d,e){var f=a+" ";switch(d){case"s":return c||e?"pár sekund":"pár sekundami";case"m":return c?"minuta":e?"minutu":"minutou";case"mm":return c||e?f+(b(a)?"minuty":"minut"):f+"minutami";break;case"h":return c?"hodina":e?"hodinu":"hodinou";case"hh":return c||e?f+(b(a)?"hodiny":"hodin"):f+"hodinami";break;case"d":return c||e?"den":"dnem";case"dd":return c||e?f+(b(a)?"dny":"dní"):f+"dny";break;case"M":return c||e?"měsíc":"měsícem";case"MM":return c||e?f+(b(a)?"měsíce":"měsíců"):f+"měsíci";break;case"y":return c||e?"rok":"rokem";case"yy":return c||e?f+(b(a)?"roky":"let"):f+"lety"}}var d="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),e="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_");return a.lang("cs",{months:d,monthsShort:e,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(d,e),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H.mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd D. MMMM YYYY LT"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("cv",{months:"кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"),monthsShort:"кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кĕç_эрн_шăм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кç_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]",LLL:"YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT",LLLL:"dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ĕнер] LT [сехетре]",nextWeek:"[Çитес] dddd LT [сехетре]",lastWeek:"[Иртнĕ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/çул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пĕр-ик çеккунт",m:"пĕр минут",mm:"%d минут",h:"пĕр сехет",hh:"%d сехет",d:"пĕр кун",dd:"%d кун",M:"пĕр уйăх",MM:"%d уйăх",y:"пĕр çул",yy:"%d çул"},ordinal:"%d-мĕш",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn àl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D. MMMM, YYYY LT"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c){var d={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?d[c][0]:d[c][1]}return a.lang("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm [Uhr]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:b,mm:"%d Minuten",h:b,hh:"%d Stunden",d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:"[την προηγούμενη] dddd [{}] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinal:function(a){return a+"η"},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY LT",LLLL:"dddd, D MMMM, YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY LT",LLLL:"dddd, [la] D[-an de] MMMM, YYYY LT"},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinal:"%da",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){var b="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),c="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return a.lang("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(a,d){return/-MMM-/.test(d)?c[a.month()]:b[a.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [del] YYYY",LLL:"D [de] MMMM [del] YYYY LT",LLLL:"dddd, D [de] MMMM [del] YYYY LT"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}return a.lang("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:"%d päeva",M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] LT",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] LT",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] LT",llll:"ddd, YYYY[ko] MMM D[a] LT"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){var b={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},c={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};return a.lang("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:function(a){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return c[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]}).replace(/,/g,"،")},ordinal:"%dم",week:{dow:6,doy:12}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,d,e){var f="";switch(d){case"s":return e?"muutaman sekunnin":"muutama sekunti";case"m":return e?"minuutin":"minuutti";case"mm":f=e?"minuutin":"minuuttia";break;case"h":return e?"tunnin":"tunti";case"hh":f=e?"tunnin":"tuntia";break;case"d":return e?"päivän":"päivä";case"dd":f=e?"päivän":"päivää";break;case"M":return e?"kuukauden":"kuukausi";case"MM":f=e?"kuukauden":"kuukautta";break;case"y":return e?"vuoden":"vuosi";case"yy":f=e?"vuoden":"vuotta"}return f=c(a,e)+" "+f}function c(a,b){return 10>a?b?e[a]:d[a]:a}var d="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),e=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",d[7],d[8],d[9]];return a.lang("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] LT",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] LT",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] LT",llll:"ddd, Do MMM YYYY, [klo] LT"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D. MMMM, YYYY LT"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return a+(1===a?"er":"")}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT" -},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:"%dº",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY LT",LLLL:"dddd, D [ב]MMMM YYYY LT",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY LT",llll:"ddd, D MMM YYYY LT"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a+" שנים"}}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},c={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return a.lang("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}return a.lang("hr",{months:"sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),monthsShort:"sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:b,mm:b,h:b,hh:b,d:"dan",dd:b,M:"mjesec",MM:b,y:"godinu",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function c(a){return(a?"":"[múlt] ")+"["+d[this.day()]+"] LT[-kor]"}var d="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");return a.lang("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D., LT",LLLL:"YYYY. MMMM D., dddd LT"},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return c.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return c.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b){var c={nominative:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_"),accusative:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function c(a){var b="հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_");return b[a.month()]}function d(a){var b="կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_");return b[a.day()]}return a.lang("hy-am",{months:b,monthsShort:c,weekdays:d,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., LT",LLLL:"dddd, D MMMM YYYY թ., LT"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] LT",LLLL:"dddd, D MMMM YYYY [pukul] LT"},meridiem:function(a){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a){return a%100===11?!0:a%10===1?!1:!0}function c(a,c,d,e){var f=a+" ";switch(d){case"s":return c||e?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return c?"mínúta":"mínútu";case"mm":return b(a)?f+(c||e?"mínútur":"mínútum"):c?f+"mínúta":f+"mínútu";case"hh":return b(a)?f+(c||e?"klukkustundir":"klukkustundum"):f+"klukkustund";case"d":return c?"dagur":e?"dag":"degi";case"dd":return b(a)?c?f+"dagar":f+(e?"daga":"dögum"):c?f+"dagur":f+(e?"dag":"degi");case"M":return c?"mánuður":e?"mánuð":"mánuði";case"MM":return b(a)?c?f+"mánuðir":f+(e?"mánuði":"mánuðum"):c?f+"mánuður":f+(e?"mánuð":"mánuði");case"y":return c||e?"ár":"ári";case"yy":return b(a)?f+(c||e?"ár":"árum"):f+(c||e?"ár":"ári")}}return a.lang("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] LT",LLLL:"dddd, D. MMMM YYYY [kl.] LT"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:c,m:c,mm:c,h:"klukkustund",hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("it",{months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"D_L_Ma_Me_G_V_S".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日LT",LLLL:"YYYY年M月D日LT dddd"},meridiem:function(a){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b){var c={nominative:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),accusative:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},d=/D[oD] *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function c(a,b){var c={nominative:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),accusative:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_")},d=/(წინა|შემდეგ)/.test(b)?"accusative":"nominative";return c[d][a.day()]}return a.lang("ka",{months:b,monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:c,weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[ថ្ងៃនៈ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 mm분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:function(a){return 12>a?"오전":"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:"%d일",meridiemParse:/(오전|오후)/,isPM:function(a){return"오후"===a}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c){var d={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],dd:[a+" Deeg",a+" Deeg"],M:["ee Mount","engem Mount"],MM:[a+" Méint",a+" Méint"],y:["ee Joer","engem Joer"],yy:[a+" Joer",a+" Joer"]};return b?d[c][0]:d[c][1]}function c(a){var b=a.substr(0,a.indexOf(" "));return g(b)?"a "+a:"an "+a}function d(a){var b=a.substr(0,a.indexOf(" "));return g(b)?"viru "+a:"virun "+a}function e(){var a=this.format("d");return f(a)?"[Leschte] dddd [um] LT":"[Leschten] dddd [um] LT"}function f(a){switch(a=parseInt(a,10)){case 0:case 1:case 3:case 5:case 6:return!0;default:return!1}}function g(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return g(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return g(a)}return a/=1e3,g(a)}return a.lang("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:e},relativeTime:{future:c,past:d,s:"e puer Sekonnen",m:b,mm:"%d Minutten",h:b,hh:"%d Stonnen",d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function c(a,b,c,d){return b?e(c)[0]:d?e(c)[1]:e(c)[2]}function d(a){return a%10===0||a>10&&20>a}function e(a){return h[a].split("_")}function f(a,b,f,g){var h=a+" ";return 1===a?h+c(a,b,f[0],g):b?h+(d(a)?e(f)[1]:e(f)[0]):g?h+e(f)[1]:h+(d(a)?e(f)[1]:e(f)[2])}function g(a,b){var c=-1===b.indexOf("dddd HH:mm"),d=i[a.weekday()];return c?d:d.substring(0,d.length-2)+"į"}var h={m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"},i="pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis_sekmadienis".split("_");return a.lang("lt",{months:"sausio_vasario_kovo_balandžio_gegužės_biržėlio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:g,weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], LT [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, LT [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], LT [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, LT [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:b,m:c,mm:f,h:c,hh:f,d:c,dd:f,M:c,MM:f,y:c,yy:f},ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c){var d=a.split("_");return c?b%10===1&&11!==b?d[2]:d[3]:b%10===1&&11!==b?d[0]:d[1]}function c(a,c,e){return a+" "+b(d[e],a,c)}var d={mm:"minūti_minūtes_minūte_minūtes",hh:"stundu_stundas_stunda_stundas",dd:"dienu_dienas_diena_dienas",MM:"mēnesi_mēnešus_mēnesis_mēneši",yy:"gadu_gadus_gads_gadi"};return a.lang("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, LT",LLLL:"YYYY. [gada] D. MMMM, dddd, LT"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"%s vēlāk",past:"%s agrāk",s:"dažas sekundes",m:"minūti",mm:c,h:"stundu",hh:c,d:"dienu",dd:c,M:"mēnesi",MM:c,y:"gadu",yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Во изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Во изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiem:function(a){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},c={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return a.lang("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%s नंतर",past:"%s पूर्वी",s:"सेकंद",m:"एक मिनिट",mm:"%d मिनिटे",h:"एक तास",hh:"%d तास",d:"एक दिवस",dd:"%d दिवस",M:"एक महिना",MM:"%d महिने",y:"एक वर्ष",yy:"%d वर्षे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] LT",LLLL:"dddd, D MMMM YYYY [pukul] LT"},meridiem:function(a){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"H.mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] LT",LLLL:"dddd D. MMMM YYYY [kl.] LT"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},c={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return a.lang("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आइ._सो._मङ्_बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 3>a?"राती":10>a?"बिहान":15>a?"दिउँसो":18>a?"बेलुका":20>a?"साँझ":"राती"},calendar:{sameDay:"[आज] LT",nextDay:"[भोली] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडी",s:"केही समय",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){var b="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),c="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_");return a.lang("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,d){return/-MMM-/.test(d)?c[a.month()]:b[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function c(a,c,d){var e=a+" ";switch(d){case"m":return c?"minuta":"minutę"; -case"mm":return e+(b(a)?"minuty":"minut");case"h":return c?"godzina":"godzinę";case"hh":return e+(b(a)?"godziny":"godzin");case"MM":return e+(b(a)?"miesiące":"miesięcy");case"yy":return e+(b(a)?"lata":"lat")}}var d="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),e="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");return a.lang("pl",{months:function(a,b){return/D MMMM/.test(b)?e[a.month()]:d[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"N_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:c,mm:c,h:c,hh:c,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:c,y:"rok",yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] LT",LLLL:"dddd, D [de] MMMM [de] YYYY [às] LT"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:"%dº"})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY LT",LLLL:"dddd, D [de] MMMM [de] YYYY LT"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]}return a.lang("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:b,h:"o oră",hh:b,d:"o zi",dd:b,M:"o lună",MM:b,y:"un an",yy:b},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function c(a,c,d){var e={mm:c?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===d?c?"минута":"минуту":a+" "+b(e[d],+a)}function d(a,b){var c={nominative:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),accusative:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function e(a,b){var c={nominative:"янв_фев_мар_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),accusative:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function f(a,b){var c={nominative:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),accusative:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_")},d=/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]}return a.lang("ru",{months:d,monthsShort:e,weekdays:f,weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., LT",LLLL:"dddd, D MMMM YYYY г., LT"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:c,mm:c,h:"час",hh:c,d:"день",dd:c,M:"месяц",MM:c,y:"год",yy:c},meridiem:function(a){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a){return a>1&&5>a}function c(a,c,d,e){var f=a+" ";switch(d){case"s":return c||e?"pár sekúnd":"pár sekundami";case"m":return c?"minúta":e?"minútu":"minútou";case"mm":return c||e?f+(b(a)?"minúty":"minút"):f+"minútami";break;case"h":return c?"hodina":e?"hodinu":"hodinou";case"hh":return c||e?f+(b(a)?"hodiny":"hodín"):f+"hodinami";break;case"d":return c||e?"deň":"dňom";case"dd":return c||e?f+(b(a)?"dni":"dní"):f+"dňami";break;case"M":return c||e?"mesiac":"mesiacom";case"MM":return c||e?f+(b(a)?"mesiace":"mesiacov"):f+"mesiacmi";break;case"y":return c||e?"rok":"rokom";case"yy":return c||e?f+(b(a)?"roky":"rokov"):f+"rokmi"}}var d="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),e="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");return a.lang("sk",{months:d,monthsShort:e,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(d,e),weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd D. MMMM YYYY LT"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b,c){var d=a+" ";switch(c){case"m":return b?"ena minuta":"eno minuto";case"mm":return d+=1===a?"minuta":2===a?"minuti":3===a||4===a?"minute":"minut";case"h":return b?"ena ura":"eno uro";case"hh":return d+=1===a?"ura":2===a?"uri":3===a||4===a?"ure":"ur";case"dd":return d+=1===a?"dan":"dni";case"MM":return d+=1===a?"mesec":2===a?"meseca":3===a||4===a?"mesece":"mesecev";case"yy":return d+=1===a?"leto":2===a?"leti":3===a||4===a?"leta":"let"}}return a.lang("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[prejšnja] dddd [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"%s nazaj",s:"nekaj sekund",m:b,mm:b,h:b,hh:b,d:"en dan",dd:b,M:"en mesec",MM:b,y:"eno leto",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiem:function(a){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){var b={words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,c,d){var e=b.words[d];return 1===d.length?c?e[0]:e[1]:a+" "+b.correctGrammaticalCase(a,e)}};return a.lang("sr-cyr",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:b.translate,mm:b.translate,h:b.translate,hh:b.translate,d:"дан",dd:b.translate,M:"месец",MM:b.translate,y:"годину",yy:b.translate},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){var b={words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,c,d){var e=b.words[d];return 1===d.length?c?e[0]:e[1]:a+" "+b.correctGrammaticalCase(a,e)}};return a.lang("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:b.translate,mm:b.translate,h:b.translate,hh:b.translate,d:"dan",dd:b.translate,M:"mesec",MM:b.translate,y:"godinu",yy:b.translate},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"dddd LT",lastWeek:"[Förra] dddd[en] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":3===b?"e":"e";return a+c},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinal:function(a){return a+"வது"},meridiem:function(a){return a>=6&&10>=a?" காலை":a>=10&&14>=a?" நண்பகல்":a>=14&&18>=a?" எற்பாடு":a>=18&&20>=a?" மாலை":a>=20&&24>=a?" இரவு":a>=0&&6>=a?" வைகறை":void 0},week:{dow:0,doy:6}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา LT",LLLL:"วันddddที่ D MMMM YYYY เวลา LT"},meridiem:function(a){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM DD, YYYY LT"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinal:function(a){return a},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){var b={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return a.lang("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){if(0===a)return a+"'ıncı";var c=a%10,d=a%100-c,e=a>=100?100:null;return a+(b[c]||b[d]||b[e])},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("tzm-la",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){function b(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function c(a,c,d){var e={mm:"хвилина_хвилини_хвилин",hh:"година_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===d?c?"хвилина":"хвилину":"h"===d?c?"година":"годину":a+" "+b(e[d],+a)}function d(a,b){var c={nominative:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),accusative:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_")},d=/D[oD]? *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function e(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function f(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}}return a.lang("uk",{months:d,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:e,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., LT",LLLL:"dddd, D MMMM YYYY р., LT"},calendar:{sameDay:f("[Сьогодні "),nextDay:f("[Завтра "),lastDay:f("[Вчора "),nextWeek:f("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return f("[Минулої] dddd [").call(this);case 1:case 2:case 4:return f("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:c,mm:c,h:"годину",hh:c,d:"день",dd:c,M:"місяць",MM:c,y:"рік",yy:c},meridiem:function(a){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("uz",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"D MMMM YYYY, dddd LT"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY LT",LLLL:"dddd, D MMMM [năm] YYYY LT",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY LT",llll:"ddd, D MMM YYYY LT"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinal:function(a){return a},week:{dow:1,doy:4}})}),function(a){"function"==typeof define&&define.amd?define(["moment"],a):"object"==typeof exports?module.exports=a(require("../moment")):a(window.moment)}(function(a){return a.lang("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日LT",LLLL:"YYYY年MMMD日ddddLT",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日LT",llll:"YYYY年MMMD日ddddLT"},meridiem:function(a,b){var c=100*a+b;return 600>c?"凌晨":900>c?"早上":1130>c?"上午":1230>c?"中午":1800>c?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()-b.unix()>=604800?"[下]":"[本]",0===this.minutes()?c+"dddAh点整":c+"dddAh点mm"},lastWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()c?"早上":1130>c?"上午":1230>c?"中午":1800>c?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}})}); \ No newline at end of file diff --git a/vendors/moment/min/moment-with-langs.js b/vendors/moment/min/moment-with-langs.js deleted file mode 100644 index 72687db99..000000000 --- a/vendors/moment/min/moment-with-langs.js +++ /dev/null @@ -1,7993 +0,0 @@ -//! moment.js -//! version : 2.6.0 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com - -(function (undefined) { - - /************************************ - Constants - ************************************/ - - var moment, - VERSION = "2.6.0", - // the global-scope this is NOT the global object in Node.js - globalScope = typeof global !== 'undefined' ? global : this, - oldGlobalMoment, - round = Math.round, - i, - - YEAR = 0, - MONTH = 1, - DATE = 2, - HOUR = 3, - MINUTE = 4, - SECOND = 5, - MILLISECOND = 6, - - // internal storage for language config files - languages = {}, - - // moment internal properties - momentProperties = { - _isAMomentObject: null, - _i : null, - _f : null, - _l : null, - _strict : null, - _isUTC : null, - _offset : null, // optional. Combine with _isUTC - _pf : null, - _lang : null // optional - }, - - // check for nodeJS - hasModule = (typeof module !== 'undefined' && module.exports), - - // ASP.NET json date format regex - aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, - aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, - - // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html - // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, - - // format tokens - formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g, - localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g, - - // parsing token regexes - parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 - parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 - parseTokenOneToFourDigits = /\d{1,4}/, // 0 - 9999 - parseTokenOneToSixDigits = /[+\-]?\d{1,6}/, // -999,999 - 999,999 - parseTokenDigits = /\d+/, // nonzero number of digits - parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic. - parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z - parseTokenT = /T/i, // T (ISO separator) - parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 - parseTokenOrdinal = /\d{1,2}/, - - //strict parsing regexes - parseTokenOneDigit = /\d/, // 0 - 9 - parseTokenTwoDigits = /\d\d/, // 00 - 99 - parseTokenThreeDigits = /\d{3}/, // 000 - 999 - parseTokenFourDigits = /\d{4}/, // 0000 - 9999 - parseTokenSixDigits = /[+-]?\d{6}/, // -999,999 - 999,999 - parseTokenSignedNumber = /[+-]?\d+/, // -inf - inf - - // iso 8601 regex - // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) - isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, - - isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', - - isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] - ], - - // iso time formats and regexes - isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] - ], - - // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"] - parseTimezoneChunker = /([\+\-]|\d\d)/gi, - - // getter and setter names - proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), - unitMillisecondFactors = { - 'Milliseconds' : 1, - 'Seconds' : 1e3, - 'Minutes' : 6e4, - 'Hours' : 36e5, - 'Days' : 864e5, - 'Months' : 2592e6, - 'Years' : 31536e6 - }, - - unitAliases = { - ms : 'millisecond', - s : 'second', - m : 'minute', - h : 'hour', - d : 'day', - D : 'date', - w : 'week', - W : 'isoWeek', - M : 'month', - Q : 'quarter', - y : 'year', - DDD : 'dayOfYear', - e : 'weekday', - E : 'isoWeekday', - gg: 'weekYear', - GG: 'isoWeekYear' - }, - - camelFunctions = { - dayofyear : 'dayOfYear', - isoweekday : 'isoWeekday', - isoweek : 'isoWeek', - weekyear : 'weekYear', - isoweekyear : 'isoWeekYear' - }, - - // format function strings - formatFunctions = {}, - - // tokens to ordinalize and pad - ordinalizeTokens = 'DDD w W M D d'.split(' '), - paddedTokens = 'M D H h m s w W'.split(' '), - - formatTokenFunctions = { - M : function () { - return this.month() + 1; - }, - MMM : function (format) { - return this.lang().monthsShort(this, format); - }, - MMMM : function (format) { - return this.lang().months(this, format); - }, - D : function () { - return this.date(); - }, - DDD : function () { - return this.dayOfYear(); - }, - d : function () { - return this.day(); - }, - dd : function (format) { - return this.lang().weekdaysMin(this, format); - }, - ddd : function (format) { - return this.lang().weekdaysShort(this, format); - }, - dddd : function (format) { - return this.lang().weekdays(this, format); - }, - w : function () { - return this.week(); - }, - W : function () { - return this.isoWeek(); - }, - YY : function () { - return leftZeroFill(this.year() % 100, 2); - }, - YYYY : function () { - return leftZeroFill(this.year(), 4); - }, - YYYYY : function () { - return leftZeroFill(this.year(), 5); - }, - YYYYYY : function () { - var y = this.year(), sign = y >= 0 ? '+' : '-'; - return sign + leftZeroFill(Math.abs(y), 6); - }, - gg : function () { - return leftZeroFill(this.weekYear() % 100, 2); - }, - gggg : function () { - return leftZeroFill(this.weekYear(), 4); - }, - ggggg : function () { - return leftZeroFill(this.weekYear(), 5); - }, - GG : function () { - return leftZeroFill(this.isoWeekYear() % 100, 2); - }, - GGGG : function () { - return leftZeroFill(this.isoWeekYear(), 4); - }, - GGGGG : function () { - return leftZeroFill(this.isoWeekYear(), 5); - }, - e : function () { - return this.weekday(); - }, - E : function () { - return this.isoWeekday(); - }, - a : function () { - return this.lang().meridiem(this.hours(), this.minutes(), true); - }, - A : function () { - return this.lang().meridiem(this.hours(), this.minutes(), false); - }, - H : function () { - return this.hours(); - }, - h : function () { - return this.hours() % 12 || 12; - }, - m : function () { - return this.minutes(); - }, - s : function () { - return this.seconds(); - }, - S : function () { - return toInt(this.milliseconds() / 100); - }, - SS : function () { - return leftZeroFill(toInt(this.milliseconds() / 10), 2); - }, - SSS : function () { - return leftZeroFill(this.milliseconds(), 3); - }, - SSSS : function () { - return leftZeroFill(this.milliseconds(), 3); - }, - Z : function () { - var a = -this.zone(), - b = "+"; - if (a < 0) { - a = -a; - b = "-"; - } - return b + leftZeroFill(toInt(a / 60), 2) + ":" + leftZeroFill(toInt(a) % 60, 2); - }, - ZZ : function () { - var a = -this.zone(), - b = "+"; - if (a < 0) { - a = -a; - b = "-"; - } - return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2); - }, - z : function () { - return this.zoneAbbr(); - }, - zz : function () { - return this.zoneName(); - }, - X : function () { - return this.unix(); - }, - Q : function () { - return this.quarter(); - } - }, - - lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin']; - - function defaultParsingFlags() { - // We need to deep clone this object, and es5 standard is not very - // helpful. - return { - empty : false, - unusedTokens : [], - unusedInput : [], - overflow : -2, - charsLeftOver : 0, - nullInput : false, - invalidMonth : null, - invalidFormat : false, - userInvalidated : false, - iso: false - }; - } - - function deprecate(msg, fn) { - var firstTime = true; - function printMsg() { - if (moment.suppressDeprecationWarnings === false && - typeof console !== 'undefined' && console.warn) { - console.warn("Deprecation warning: " + msg); - } - } - return extend(function () { - if (firstTime) { - printMsg(); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - function padToken(func, count) { - return function (a) { - return leftZeroFill(func.call(this, a), count); - }; - } - function ordinalizeToken(func, period) { - return function (a) { - return this.lang().ordinal(func.call(this, a), period); - }; - } - - while (ordinalizeTokens.length) { - i = ordinalizeTokens.pop(); - formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i); - } - while (paddedTokens.length) { - i = paddedTokens.pop(); - formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2); - } - formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3); - - - /************************************ - Constructors - ************************************/ - - function Language() { - - } - - // Moment prototype object - function Moment(config) { - checkOverflow(config); - extend(this, config); - } - - // Duration Constructor - function Duration(duration) { - var normalizedInput = normalizeObjectUnits(duration), - years = normalizedInput.year || 0, - quarters = normalizedInput.quarter || 0, - months = normalizedInput.month || 0, - weeks = normalizedInput.week || 0, - days = normalizedInput.day || 0, - hours = normalizedInput.hour || 0, - minutes = normalizedInput.minute || 0, - seconds = normalizedInput.second || 0, - milliseconds = normalizedInput.millisecond || 0; - - // representation for dateAddRemove - this._milliseconds = +milliseconds + - seconds * 1e3 + // 1000 - minutes * 6e4 + // 1000 * 60 - hours * 36e5; // 1000 * 60 * 60 - // Because of dateAddRemove treats 24 hours as different from a - // day when working around DST, we need to store them separately - this._days = +days + - weeks * 7; - // It is impossible translate months into days without knowing - // which months you are are talking about, so we have to store - // it separately. - this._months = +months + - quarters * 3 + - years * 12; - - this._data = {}; - - this._bubble(); - } - - /************************************ - Helpers - ************************************/ - - - function extend(a, b) { - for (var i in b) { - if (b.hasOwnProperty(i)) { - a[i] = b[i]; - } - } - - if (b.hasOwnProperty("toString")) { - a.toString = b.toString; - } - - if (b.hasOwnProperty("valueOf")) { - a.valueOf = b.valueOf; - } - - return a; - } - - function cloneMoment(m) { - var result = {}, i; - for (i in m) { - if (m.hasOwnProperty(i) && momentProperties.hasOwnProperty(i)) { - result[i] = m[i]; - } - } - - return result; - } - - function absRound(number) { - if (number < 0) { - return Math.ceil(number); - } else { - return Math.floor(number); - } - } - - // left zero fill a number - // see http://jsperf.com/left-zero-filling for performance comparison - function leftZeroFill(number, targetLength, forceSign) { - var output = '' + Math.abs(number), - sign = number >= 0; - - while (output.length < targetLength) { - output = '0' + output; - } - return (sign ? (forceSign ? '+' : '') : '-') + output; - } - - // helper function for _.addTime and _.subtractTime - function addOrSubtractDurationFromMoment(mom, duration, isAdding, updateOffset) { - var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; - updateOffset = updateOffset == null ? true : updateOffset; - - if (milliseconds) { - mom._d.setTime(+mom._d + milliseconds * isAdding); - } - if (days) { - rawSetter(mom, 'Date', rawGetter(mom, 'Date') + days * isAdding); - } - if (months) { - rawMonthSetter(mom, rawGetter(mom, 'Month') + months * isAdding); - } - if (updateOffset) { - moment.updateOffset(mom, days || months); - } - } - - // check if is an array - function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; - } - - function isDate(input) { - return Object.prototype.toString.call(input) === '[object Date]' || - input instanceof Date; - } - - // compare two arrays, return the number of differences - function compareArrays(array1, array2, dontConvert) { - var len = Math.min(array1.length, array2.length), - lengthDiff = Math.abs(array1.length - array2.length), - diffs = 0, - i; - for (i = 0; i < len; i++) { - if ((dontConvert && array1[i] !== array2[i]) || - (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { - diffs++; - } - } - return diffs + lengthDiff; - } - - function normalizeUnits(units) { - if (units) { - var lowered = units.toLowerCase().replace(/(.)s$/, '$1'); - units = unitAliases[units] || camelFunctions[lowered] || lowered; - } - return units; - } - - function normalizeObjectUnits(inputObject) { - var normalizedInput = {}, - normalizedProp, - prop; - - for (prop in inputObject) { - if (inputObject.hasOwnProperty(prop)) { - normalizedProp = normalizeUnits(prop); - if (normalizedProp) { - normalizedInput[normalizedProp] = inputObject[prop]; - } - } - } - - return normalizedInput; - } - - function makeList(field) { - var count, setter; - - if (field.indexOf('week') === 0) { - count = 7; - setter = 'day'; - } - else if (field.indexOf('month') === 0) { - count = 12; - setter = 'month'; - } - else { - return; - } - - moment[field] = function (format, index) { - var i, getter, - method = moment.fn._lang[field], - results = []; - - if (typeof format === 'number') { - index = format; - format = undefined; - } - - getter = function (i) { - var m = moment().utc().set(setter, i); - return method.call(moment.fn._lang, m, format || ''); - }; - - if (index != null) { - return getter(index); - } - else { - for (i = 0; i < count; i++) { - results.push(getter(i)); - } - return results; - } - }; - } - - function toInt(argumentForCoercion) { - var coercedNumber = +argumentForCoercion, - value = 0; - - if (coercedNumber !== 0 && isFinite(coercedNumber)) { - if (coercedNumber >= 0) { - value = Math.floor(coercedNumber); - } else { - value = Math.ceil(coercedNumber); - } - } - - return value; - } - - function daysInMonth(year, month) { - return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); - } - - function weeksInYear(year, dow, doy) { - return weekOfYear(moment([year, 11, 31 + dow - doy]), dow, doy).week; - } - - function daysInYear(year) { - return isLeapYear(year) ? 366 : 365; - } - - function isLeapYear(year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - } - - function checkOverflow(m) { - var overflow; - if (m._a && m._pf.overflow === -2) { - overflow = - m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : - m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : - m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR : - m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : - m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : - m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : - -1; - - if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { - overflow = DATE; - } - - m._pf.overflow = overflow; - } - } - - function isValid(m) { - if (m._isValid == null) { - m._isValid = !isNaN(m._d.getTime()) && - m._pf.overflow < 0 && - !m._pf.empty && - !m._pf.invalidMonth && - !m._pf.nullInput && - !m._pf.invalidFormat && - !m._pf.userInvalidated; - - if (m._strict) { - m._isValid = m._isValid && - m._pf.charsLeftOver === 0 && - m._pf.unusedTokens.length === 0; - } - } - return m._isValid; - } - - function normalizeLanguage(key) { - return key ? key.toLowerCase().replace('_', '-') : key; - } - - // Return a moment from input, that is local/utc/zone equivalent to model. - function makeAs(input, model) { - return model._isUTC ? moment(input).zone(model._offset || 0) : - moment(input).local(); - } - - /************************************ - Languages - ************************************/ - - - extend(Language.prototype, { - - set : function (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (typeof prop === 'function') { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - }, - - _months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - months : function (m) { - return this._months[m.month()]; - }, - - _monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - monthsShort : function (m) { - return this._monthsShort[m.month()]; - }, - - monthsParse : function (monthName) { - var i, mom, regex; - - if (!this._monthsParse) { - this._monthsParse = []; - } - - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - if (!this._monthsParse[i]) { - mom = moment.utc([2000, i]); - regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); - this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (this._monthsParse[i].test(monthName)) { - return i; - } - } - }, - - _weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdays : function (m) { - return this._weekdays[m.day()]; - }, - - _weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysShort : function (m) { - return this._weekdaysShort[m.day()]; - }, - - _weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - weekdaysMin : function (m) { - return this._weekdaysMin[m.day()]; - }, - - weekdaysParse : function (weekdayName) { - var i, mom, regex; - - if (!this._weekdaysParse) { - this._weekdaysParse = []; - } - - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - if (!this._weekdaysParse[i]) { - mom = moment([2000, 1]).day(i); - regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); - this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { - return i; - } - } - }, - - _longDateFormat : { - LT : "h:mm A", - L : "MM/DD/YYYY", - LL : "MMMM D YYYY", - LLL : "MMMM D YYYY LT", - LLLL : "dddd, MMMM D YYYY LT" - }, - longDateFormat : function (key) { - var output = this._longDateFormat[key]; - if (!output && this._longDateFormat[key.toUpperCase()]) { - output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) { - return val.slice(1); - }); - this._longDateFormat[key] = output; - } - return output; - }, - - isPM : function (input) { - // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays - // Using charAt should be more compatible. - return ((input + '').toLowerCase().charAt(0) === 'p'); - }, - - _meridiemParse : /[ap]\.?m?\.?/i, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'pm' : 'PM'; - } else { - return isLower ? 'am' : 'AM'; - } - }, - - _calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendar[key]; - return typeof output === 'function' ? output.apply(mom) : output; - }, - - _relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - relativeTime : function (number, withoutSuffix, string, isFuture) { - var output = this._relativeTime[string]; - return (typeof output === 'function') ? - output(number, withoutSuffix, string, isFuture) : - output.replace(/%d/i, number); - }, - pastFuture : function (diff, output) { - var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); - }, - - ordinal : function (number) { - return this._ordinal.replace("%d", number); - }, - _ordinal : "%d", - - preparse : function (string) { - return string; - }, - - postformat : function (string) { - return string; - }, - - week : function (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - }, - - _week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }, - - _invalidDate: 'Invalid date', - invalidDate: function () { - return this._invalidDate; - } - }); - - // Loads a language definition into the `languages` cache. The function - // takes a key and optionally values. If not in the browser and no values - // are provided, it will load the language file module. As a convenience, - // this function also returns the language values. - function loadLang(key, values) { - values.abbr = key; - if (!languages[key]) { - languages[key] = new Language(); - } - languages[key].set(values); - return languages[key]; - } - - // Remove a language from the `languages` cache. Mostly useful in tests. - function unloadLang(key) { - delete languages[key]; - } - - // Determines which language definition to use and returns it. - // - // With no parameters, it will return the global language. If you - // pass in a language key, such as 'en', it will return the - // definition for 'en', so long as 'en' has already been loaded using - // moment.lang. - function getLangDefinition(key) { - var i = 0, j, lang, next, split, - get = function (k) { - if (!languages[k] && hasModule) { - try { - require('./lang/' + k); - } catch (e) { } - } - return languages[k]; - }; - - if (!key) { - return moment.fn._lang; - } - - if (!isArray(key)) { - //short-circuit everything else - lang = get(key); - if (lang) { - return lang; - } - key = [key]; - } - - //pick the language from the array - //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each - //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - while (i < key.length) { - split = normalizeLanguage(key[i]).split('-'); - j = split.length; - next = normalizeLanguage(key[i + 1]); - next = next ? next.split('-') : null; - while (j > 0) { - lang = get(split.slice(0, j).join('-')); - if (lang) { - return lang; - } - if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { - //the next array item is better than a shallower substring of this one - break; - } - j--; - } - i++; - } - return moment.fn._lang; - } - - /************************************ - Formatting - ************************************/ - - - function removeFormattingTokens(input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|\]$/g, ""); - } - return input.replace(/\\/g, ""); - } - - function makeFormatFunction(format) { - var array = format.match(formattingTokens), i, length; - - for (i = 0, length = array.length; i < length; i++) { - if (formatTokenFunctions[array[i]]) { - array[i] = formatTokenFunctions[array[i]]; - } else { - array[i] = removeFormattingTokens(array[i]); - } - } - - return function (mom) { - var output = ""; - for (i = 0; i < length; i++) { - output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; - } - return output; - }; - } - - // format date using native date object - function formatMoment(m, format) { - - if (!m.isValid()) { - return m.lang().invalidDate(); - } - - format = expandFormat(format, m.lang()); - - if (!formatFunctions[format]) { - formatFunctions[format] = makeFormatFunction(format); - } - - return formatFunctions[format](m); - } - - function expandFormat(format, lang) { - var i = 5; - - function replaceLongDateFormatTokens(input) { - return lang.longDateFormat(input) || input; - } - - localFormattingTokens.lastIndex = 0; - while (i >= 0 && localFormattingTokens.test(format)) { - format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); - localFormattingTokens.lastIndex = 0; - i -= 1; - } - - return format; - } - - - /************************************ - Parsing - ************************************/ - - - // get the regex to find the next token - function getParseRegexForToken(token, config) { - var a, strict = config._strict; - switch (token) { - case 'Q': - return parseTokenOneDigit; - case 'DDDD': - return parseTokenThreeDigits; - case 'YYYY': - case 'GGGG': - case 'gggg': - return strict ? parseTokenFourDigits : parseTokenOneToFourDigits; - case 'Y': - case 'G': - case 'g': - return parseTokenSignedNumber; - case 'YYYYYY': - case 'YYYYY': - case 'GGGGG': - case 'ggggg': - return strict ? parseTokenSixDigits : parseTokenOneToSixDigits; - case 'S': - if (strict) { return parseTokenOneDigit; } - /* falls through */ - case 'SS': - if (strict) { return parseTokenTwoDigits; } - /* falls through */ - case 'SSS': - if (strict) { return parseTokenThreeDigits; } - /* falls through */ - case 'DDD': - return parseTokenOneToThreeDigits; - case 'MMM': - case 'MMMM': - case 'dd': - case 'ddd': - case 'dddd': - return parseTokenWord; - case 'a': - case 'A': - return getLangDefinition(config._l)._meridiemParse; - case 'X': - return parseTokenTimestampMs; - case 'Z': - case 'ZZ': - return parseTokenTimezone; - case 'T': - return parseTokenT; - case 'SSSS': - return parseTokenDigits; - case 'MM': - case 'DD': - case 'YY': - case 'GG': - case 'gg': - case 'HH': - case 'hh': - case 'mm': - case 'ss': - case 'ww': - case 'WW': - return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits; - case 'M': - case 'D': - case 'd': - case 'H': - case 'h': - case 'm': - case 's': - case 'w': - case 'W': - case 'e': - case 'E': - return parseTokenOneOrTwoDigits; - case 'Do': - return parseTokenOrdinal; - default : - a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), "i")); - return a; - } - } - - function timezoneMinutesFromString(string) { - string = string || ""; - var possibleTzMatches = (string.match(parseTokenTimezone) || []), - tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [], - parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0], - minutes = +(parts[1] * 60) + toInt(parts[2]); - - return parts[0] === '+' ? -minutes : minutes; - } - - // function to convert string input to date - function addTimeToArrayFromToken(token, input, config) { - var a, datePartArray = config._a; - - switch (token) { - // QUARTER - case 'Q': - if (input != null) { - datePartArray[MONTH] = (toInt(input) - 1) * 3; - } - break; - // MONTH - case 'M' : // fall through to MM - case 'MM' : - if (input != null) { - datePartArray[MONTH] = toInt(input) - 1; - } - break; - case 'MMM' : // fall through to MMMM - case 'MMMM' : - a = getLangDefinition(config._l).monthsParse(input); - // if we didn't find a month name, mark the date as invalid. - if (a != null) { - datePartArray[MONTH] = a; - } else { - config._pf.invalidMonth = input; - } - break; - // DAY OF MONTH - case 'D' : // fall through to DD - case 'DD' : - if (input != null) { - datePartArray[DATE] = toInt(input); - } - break; - case 'Do' : - if (input != null) { - datePartArray[DATE] = toInt(parseInt(input, 10)); - } - break; - // DAY OF YEAR - case 'DDD' : // fall through to DDDD - case 'DDDD' : - if (input != null) { - config._dayOfYear = toInt(input); - } - - break; - // YEAR - case 'YY' : - datePartArray[YEAR] = moment.parseTwoDigitYear(input); - break; - case 'YYYY' : - case 'YYYYY' : - case 'YYYYYY' : - datePartArray[YEAR] = toInt(input); - break; - // AM / PM - case 'a' : // fall through to A - case 'A' : - config._isPm = getLangDefinition(config._l).isPM(input); - break; - // 24 HOUR - case 'H' : // fall through to hh - case 'HH' : // fall through to hh - case 'h' : // fall through to hh - case 'hh' : - datePartArray[HOUR] = toInt(input); - break; - // MINUTE - case 'm' : // fall through to mm - case 'mm' : - datePartArray[MINUTE] = toInt(input); - break; - // SECOND - case 's' : // fall through to ss - case 'ss' : - datePartArray[SECOND] = toInt(input); - break; - // MILLISECOND - case 'S' : - case 'SS' : - case 'SSS' : - case 'SSSS' : - datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000); - break; - // UNIX TIMESTAMP WITH MS - case 'X': - config._d = new Date(parseFloat(input) * 1000); - break; - // TIMEZONE - case 'Z' : // fall through to ZZ - case 'ZZ' : - config._useUTC = true; - config._tzm = timezoneMinutesFromString(input); - break; - case 'w': - case 'ww': - case 'W': - case 'WW': - case 'd': - case 'dd': - case 'ddd': - case 'dddd': - case 'e': - case 'E': - token = token.substr(0, 1); - /* falls through */ - case 'gg': - case 'gggg': - case 'GG': - case 'GGGG': - case 'GGGGG': - token = token.substr(0, 2); - if (input) { - config._w = config._w || {}; - config._w[token] = input; - } - break; - } - } - - // convert an array to a date. - // the array should mirror the parameters below - // note: all values past the year are optional and will default to the lowest possible value. - // [year, month, day , hour, minute, second, millisecond] - function dateFromConfig(config) { - var i, date, input = [], currentDate, - yearToUse, fixYear, w, temp, lang, weekday, week; - - if (config._d) { - return; - } - - currentDate = currentDateArray(config); - - //compute day of the year from weeks and weekdays - if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { - fixYear = function (val) { - var intVal = parseInt(val, 10); - return val ? - (val.length < 3 ? (intVal > 68 ? 1900 + intVal : 2000 + intVal) : intVal) : - (config._a[YEAR] == null ? moment().weekYear() : config._a[YEAR]); - }; - - w = config._w; - if (w.GG != null || w.W != null || w.E != null) { - temp = dayOfYearFromWeeks(fixYear(w.GG), w.W || 1, w.E, 4, 1); - } - else { - lang = getLangDefinition(config._l); - weekday = w.d != null ? parseWeekday(w.d, lang) : - (w.e != null ? parseInt(w.e, 10) + lang._week.dow : 0); - - week = parseInt(w.w, 10) || 1; - - //if we're parsing 'd', then the low day numbers may be next week - if (w.d != null && weekday < lang._week.dow) { - week++; - } - - temp = dayOfYearFromWeeks(fixYear(w.gg), week, weekday, lang._week.doy, lang._week.dow); - } - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; - } - - //if the day of the year is set, figure out what it is - if (config._dayOfYear) { - yearToUse = config._a[YEAR] == null ? currentDate[YEAR] : config._a[YEAR]; - - if (config._dayOfYear > daysInYear(yearToUse)) { - config._pf._overflowDayOfYear = true; - } - - date = makeUTCDate(yearToUse, 0, config._dayOfYear); - config._a[MONTH] = date.getUTCMonth(); - config._a[DATE] = date.getUTCDate(); - } - - // Default to current date. - // * if no year, month, day of month are given, default to today - // * if day of month is given, default month and year - // * if month is given, default only year - // * if year is given, don't default anything - for (i = 0; i < 3 && config._a[i] == null; ++i) { - config._a[i] = input[i] = currentDate[i]; - } - - // Zero out whatever was not defaulted, including time - for (; i < 7; i++) { - config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; - } - - // add the offsets to the time to be parsed so that we can have a clean array for checking isValid - input[HOUR] += toInt((config._tzm || 0) / 60); - input[MINUTE] += toInt((config._tzm || 0) % 60); - - config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input); - } - - function dateFromObject(config) { - var normalizedInput; - - if (config._d) { - return; - } - - normalizedInput = normalizeObjectUnits(config._i); - config._a = [ - normalizedInput.year, - normalizedInput.month, - normalizedInput.day, - normalizedInput.hour, - normalizedInput.minute, - normalizedInput.second, - normalizedInput.millisecond - ]; - - dateFromConfig(config); - } - - function currentDateArray(config) { - var now = new Date(); - if (config._useUTC) { - return [ - now.getUTCFullYear(), - now.getUTCMonth(), - now.getUTCDate() - ]; - } else { - return [now.getFullYear(), now.getMonth(), now.getDate()]; - } - } - - // date from string and format string - function makeDateFromStringAndFormat(config) { - - config._a = []; - config._pf.empty = true; - - // This array is used to make a Date, either with `new Date` or `Date.UTC` - var lang = getLangDefinition(config._l), - string = '' + config._i, - i, parsedInput, tokens, token, skipped, - stringLength = string.length, - totalParsedInputLength = 0; - - tokens = expandFormat(config._f, lang).match(formattingTokens) || []; - - for (i = 0; i < tokens.length; i++) { - token = tokens[i]; - parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; - if (parsedInput) { - skipped = string.substr(0, string.indexOf(parsedInput)); - if (skipped.length > 0) { - config._pf.unusedInput.push(skipped); - } - string = string.slice(string.indexOf(parsedInput) + parsedInput.length); - totalParsedInputLength += parsedInput.length; - } - // don't parse if it's not a known token - if (formatTokenFunctions[token]) { - if (parsedInput) { - config._pf.empty = false; - } - else { - config._pf.unusedTokens.push(token); - } - addTimeToArrayFromToken(token, parsedInput, config); - } - else if (config._strict && !parsedInput) { - config._pf.unusedTokens.push(token); - } - } - - // add remaining unparsed input length to the string - config._pf.charsLeftOver = stringLength - totalParsedInputLength; - if (string.length > 0) { - config._pf.unusedInput.push(string); - } - - // handle am pm - if (config._isPm && config._a[HOUR] < 12) { - config._a[HOUR] += 12; - } - // if is 12 am, change hours to 0 - if (config._isPm === false && config._a[HOUR] === 12) { - config._a[HOUR] = 0; - } - - dateFromConfig(config); - checkOverflow(config); - } - - function unescapeFormat(s) { - return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { - return p1 || p2 || p3 || p4; - }); - } - - // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function regexpEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } - - // date from string and array of format strings - function makeDateFromStringAndArray(config) { - var tempConfig, - bestMoment, - - scoreToBeat, - i, - currentScore; - - if (config._f.length === 0) { - config._pf.invalidFormat = true; - config._d = new Date(NaN); - return; - } - - for (i = 0; i < config._f.length; i++) { - currentScore = 0; - tempConfig = extend({}, config); - tempConfig._pf = defaultParsingFlags(); - tempConfig._f = config._f[i]; - makeDateFromStringAndFormat(tempConfig); - - if (!isValid(tempConfig)) { - continue; - } - - // if there is any input that was not parsed add a penalty for that format - currentScore += tempConfig._pf.charsLeftOver; - - //or tokens - currentScore += tempConfig._pf.unusedTokens.length * 10; - - tempConfig._pf.score = currentScore; - - if (scoreToBeat == null || currentScore < scoreToBeat) { - scoreToBeat = currentScore; - bestMoment = tempConfig; - } - } - - extend(config, bestMoment || tempConfig); - } - - // date from iso format - function makeDateFromString(config) { - var i, l, - string = config._i, - match = isoRegex.exec(string); - - if (match) { - config._pf.iso = true; - for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - // match[5] should be "T" or undefined - config._f = isoDates[i][0] + (match[6] || " "); - break; - } - } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - config._f += isoTimes[i][0]; - break; - } - } - if (string.match(parseTokenTimezone)) { - config._f += "Z"; - } - makeDateFromStringAndFormat(config); - } - else { - moment.createFromInputFallback(config); - } - } - - function makeDateFromInput(config) { - var input = config._i, - matched = aspNetJsonRegex.exec(input); - - if (input === undefined) { - config._d = new Date(); - } else if (matched) { - config._d = new Date(+matched[1]); - } else if (typeof input === 'string') { - makeDateFromString(config); - } else if (isArray(input)) { - config._a = input.slice(0); - dateFromConfig(config); - } else if (isDate(input)) { - config._d = new Date(+input); - } else if (typeof(input) === 'object') { - dateFromObject(config); - } else if (typeof(input) === 'number') { - // from milliseconds - config._d = new Date(input); - } else { - moment.createFromInputFallback(config); - } - } - - function makeDate(y, m, d, h, M, s, ms) { - //can't just apply() to create a date: - //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply - var date = new Date(y, m, d, h, M, s, ms); - - //the date constructor doesn't accept years < 1970 - if (y < 1970) { - date.setFullYear(y); - } - return date; - } - - function makeUTCDate(y) { - var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { - date.setUTCFullYear(y); - } - return date; - } - - function parseWeekday(input, language) { - if (typeof input === 'string') { - if (!isNaN(input)) { - input = parseInt(input, 10); - } - else { - input = language.weekdaysParse(input); - if (typeof input !== 'number') { - return null; - } - } - } - return input; - } - - /************************************ - Relative Time - ************************************/ - - - // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) { - return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture); - } - - function relativeTime(milliseconds, withoutSuffix, lang) { - var seconds = round(Math.abs(milliseconds) / 1000), - minutes = round(seconds / 60), - hours = round(minutes / 60), - days = round(hours / 24), - years = round(days / 365), - args = seconds < 45 && ['s', seconds] || - minutes === 1 && ['m'] || - minutes < 45 && ['mm', minutes] || - hours === 1 && ['h'] || - hours < 22 && ['hh', hours] || - days === 1 && ['d'] || - days <= 25 && ['dd', days] || - days <= 45 && ['M'] || - days < 345 && ['MM', round(days / 30)] || - years === 1 && ['y'] || ['yy', years]; - args[2] = withoutSuffix; - args[3] = milliseconds > 0; - args[4] = lang; - return substituteTimeAgo.apply({}, args); - } - - - /************************************ - Week of Year - ************************************/ - - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - adjustedMoment = moment(mom).add('d', daysToDayOfWeek); - return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() - }; - } - - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var d = makeUTCDate(year, 0, 1).getUTCDay(), daysToAdd, dayOfYear; - - weekday = weekday != null ? weekday : firstDayOfWeek; - daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0); - dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1; - - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear - }; - } - - /************************************ - Top Level Functions - ************************************/ - - function makeMoment(config) { - var input = config._i, - format = config._f; - - if (input === null || (format === undefined && input === '')) { - return moment.invalid({nullInput: true}); - } - - if (typeof input === 'string') { - config._i = input = getLangDefinition().preparse(input); - } - - if (moment.isMoment(input)) { - config = cloneMoment(input); - - config._d = new Date(+input._d); - } else if (format) { - if (isArray(format)) { - makeDateFromStringAndArray(config); - } else { - makeDateFromStringAndFormat(config); - } - } else { - makeDateFromInput(config); - } - - return new Moment(config); - } - - moment = function (input, format, lang, strict) { - var c; - - if (typeof(lang) === "boolean") { - strict = lang; - lang = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c = {}; - c._isAMomentObject = true; - c._i = input; - c._f = format; - c._l = lang; - c._strict = strict; - c._isUTC = false; - c._pf = defaultParsingFlags(); - - return makeMoment(c); - }; - - moment.suppressDeprecationWarnings = false; - - moment.createFromInputFallback = deprecate( - "moment construction falls back to js Date. This is " + - "discouraged and will be removed in upcoming major " + - "release. Please refer to " + - "https://github.com/moment/moment/issues/1407 for more info.", - function (config) { - config._d = new Date(config._i); - }); - - // creating with utc - moment.utc = function (input, format, lang, strict) { - var c; - - if (typeof(lang) === "boolean") { - strict = lang; - lang = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c = {}; - c._isAMomentObject = true; - c._useUTC = true; - c._isUTC = true; - c._l = lang; - c._i = input; - c._f = format; - c._strict = strict; - c._pf = defaultParsingFlags(); - - return makeMoment(c).utc(); - }; - - // creating with unix timestamp (in seconds) - moment.unix = function (input) { - return moment(input * 1000); - }; - - // duration - moment.duration = function (input, key) { - var duration = input, - // matching against regexp is expensive, do it on demand - match = null, - sign, - ret, - parseIso; - - if (moment.isDuration(input)) { - duration = { - ms: input._milliseconds, - d: input._days, - M: input._months - }; - } else if (typeof input === 'number') { - duration = {}; - if (key) { - duration[key] = input; - } else { - duration.milliseconds = input; - } - } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) { - sign = (match[1] === "-") ? -1 : 1; - duration = { - y: 0, - d: toInt(match[DATE]) * sign, - h: toInt(match[HOUR]) * sign, - m: toInt(match[MINUTE]) * sign, - s: toInt(match[SECOND]) * sign, - ms: toInt(match[MILLISECOND]) * sign - }; - } else if (!!(match = isoDurationRegex.exec(input))) { - sign = (match[1] === "-") ? -1 : 1; - parseIso = function (inp) { - // We'd normally use ~~inp for this, but unfortunately it also - // converts floats to ints. - // inp may be undefined, so careful calling replace on it. - var res = inp && parseFloat(inp.replace(',', '.')); - // apply sign while we're at it - return (isNaN(res) ? 0 : res) * sign; - }; - duration = { - y: parseIso(match[2]), - M: parseIso(match[3]), - d: parseIso(match[4]), - h: parseIso(match[5]), - m: parseIso(match[6]), - s: parseIso(match[7]), - w: parseIso(match[8]) - }; - } - - ret = new Duration(duration); - - if (moment.isDuration(input) && input.hasOwnProperty('_lang')) { - ret._lang = input._lang; - } - - return ret; - }; - - // version number - moment.version = VERSION; - - // default format - moment.defaultFormat = isoFormat; - - // Plugins that add properties should also add the key here (null value), - // so we can properly clone ourselves. - moment.momentProperties = momentProperties; - - // This function will be called whenever a moment is mutated. - // It is intended to keep the offset in sync with the timezone. - moment.updateOffset = function () {}; - - // This function will load languages and then set the global language. If - // no arguments are passed in, it will simply return the current global - // language key. - moment.lang = function (key, values) { - var r; - if (!key) { - return moment.fn._lang._abbr; - } - if (values) { - loadLang(normalizeLanguage(key), values); - } else if (values === null) { - unloadLang(key); - key = 'en'; - } else if (!languages[key]) { - getLangDefinition(key); - } - r = moment.duration.fn._lang = moment.fn._lang = getLangDefinition(key); - return r._abbr; - }; - - // returns language data - moment.langData = function (key) { - if (key && key._lang && key._lang._abbr) { - key = key._lang._abbr; - } - return getLangDefinition(key); - }; - - // compare moment object - moment.isMoment = function (obj) { - return obj instanceof Moment || - (obj != null && obj.hasOwnProperty('_isAMomentObject')); - }; - - // for typechecking Duration objects - moment.isDuration = function (obj) { - return obj instanceof Duration; - }; - - for (i = lists.length - 1; i >= 0; --i) { - makeList(lists[i]); - } - - moment.normalizeUnits = function (units) { - return normalizeUnits(units); - }; - - moment.invalid = function (flags) { - var m = moment.utc(NaN); - if (flags != null) { - extend(m._pf, flags); - } - else { - m._pf.userInvalidated = true; - } - - return m; - }; - - moment.parseZone = function () { - return moment.apply(null, arguments).parseZone(); - }; - - moment.parseTwoDigitYear = function (input) { - return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); - }; - - /************************************ - Moment Prototype - ************************************/ - - - extend(moment.fn = Moment.prototype, { - - clone : function () { - return moment(this); - }, - - valueOf : function () { - return +this._d + ((this._offset || 0) * 60000); - }, - - unix : function () { - return Math.floor(+this / 1000); - }, - - toString : function () { - return this.clone().lang('en').format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); - }, - - toDate : function () { - return this._offset ? new Date(+this) : this._d; - }, - - toISOString : function () { - var m = moment(this).utc(); - if (0 < m.year() && m.year() <= 9999) { - return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - } else { - return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - } - }, - - toArray : function () { - var m = this; - return [ - m.year(), - m.month(), - m.date(), - m.hours(), - m.minutes(), - m.seconds(), - m.milliseconds() - ]; - }, - - isValid : function () { - return isValid(this); - }, - - isDSTShifted : function () { - - if (this._a) { - return this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0; - } - - return false; - }, - - parsingFlags : function () { - return extend({}, this._pf); - }, - - invalidAt: function () { - return this._pf.overflow; - }, - - utc : function () { - return this.zone(0); - }, - - local : function () { - this.zone(0); - this._isUTC = false; - return this; - }, - - format : function (inputString) { - var output = formatMoment(this, inputString || moment.defaultFormat); - return this.lang().postformat(output); - }, - - add : function (input, val) { - var dur; - // switch args to support add('s', 1) and add(1, 's') - if (typeof input === 'string') { - dur = moment.duration(+val, input); - } else { - dur = moment.duration(input, val); - } - addOrSubtractDurationFromMoment(this, dur, 1); - return this; - }, - - subtract : function (input, val) { - var dur; - // switch args to support subtract('s', 1) and subtract(1, 's') - if (typeof input === 'string') { - dur = moment.duration(+val, input); - } else { - dur = moment.duration(input, val); - } - addOrSubtractDurationFromMoment(this, dur, -1); - return this; - }, - - diff : function (input, units, asFloat) { - var that = makeAs(input, this), - zoneDiff = (this.zone() - that.zone()) * 6e4, - diff, output; - - units = normalizeUnits(units); - - if (units === 'year' || units === 'month') { - // average number of days in the months in the given dates - diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2 - // difference in months - output = ((this.year() - that.year()) * 12) + (this.month() - that.month()); - // adjust by taking difference in days, average number of days - // and dst in the given months. - output += ((this - moment(this).startOf('month')) - - (that - moment(that).startOf('month'))) / diff; - // same as above but with zones, to negate all dst - output -= ((this.zone() - moment(this).startOf('month').zone()) - - (that.zone() - moment(that).startOf('month').zone())) * 6e4 / diff; - if (units === 'year') { - output = output / 12; - } - } else { - diff = (this - that); - output = units === 'second' ? diff / 1e3 : // 1000 - units === 'minute' ? diff / 6e4 : // 1000 * 60 - units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60 - units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst - units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst - diff; - } - return asFloat ? output : absRound(output); - }, - - from : function (time, withoutSuffix) { - return moment.duration(this.diff(time)).lang(this.lang()._abbr).humanize(!withoutSuffix); - }, - - fromNow : function (withoutSuffix) { - return this.from(moment(), withoutSuffix); - }, - - calendar : function () { - // We want to compare the start of today, vs this. - // Getting start-of-today depends on whether we're zone'd or not. - var sod = makeAs(moment(), this).startOf('day'), - diff = this.diff(sod, 'days', true), - format = diff < -6 ? 'sameElse' : - diff < -1 ? 'lastWeek' : - diff < 0 ? 'lastDay' : - diff < 1 ? 'sameDay' : - diff < 2 ? 'nextDay' : - diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(this.lang().calendar(format, this)); - }, - - isLeapYear : function () { - return isLeapYear(this.year()); - }, - - isDST : function () { - return (this.zone() < this.clone().month(0).zone() || - this.zone() < this.clone().month(5).zone()); - }, - - day : function (input) { - var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); - if (input != null) { - input = parseWeekday(input, this.lang()); - return this.add({ d : input - day }); - } else { - return day; - } - }, - - month : makeAccessor('Month', true), - - startOf: function (units) { - units = normalizeUnits(units); - // the following switch intentionally omits break keywords - // to utilize falling through the cases. - switch (units) { - case 'year': - this.month(0); - /* falls through */ - case 'quarter': - case 'month': - this.date(1); - /* falls through */ - case 'week': - case 'isoWeek': - case 'day': - this.hours(0); - /* falls through */ - case 'hour': - this.minutes(0); - /* falls through */ - case 'minute': - this.seconds(0); - /* falls through */ - case 'second': - this.milliseconds(0); - /* falls through */ - } - - // weeks are a special case - if (units === 'week') { - this.weekday(0); - } else if (units === 'isoWeek') { - this.isoWeekday(1); - } - - // quarters are also special - if (units === 'quarter') { - this.month(Math.floor(this.month() / 3) * 3); - } - - return this; - }, - - endOf: function (units) { - units = normalizeUnits(units); - return this.startOf(units).add((units === 'isoWeek' ? 'week' : units), 1).subtract('ms', 1); - }, - - isAfter: function (input, units) { - units = typeof units !== 'undefined' ? units : 'millisecond'; - return +this.clone().startOf(units) > +moment(input).startOf(units); - }, - - isBefore: function (input, units) { - units = typeof units !== 'undefined' ? units : 'millisecond'; - return +this.clone().startOf(units) < +moment(input).startOf(units); - }, - - isSame: function (input, units) { - units = units || 'ms'; - return +this.clone().startOf(units) === +makeAs(input, this).startOf(units); - }, - - min: function (other) { - other = moment.apply(null, arguments); - return other < this ? this : other; - }, - - max: function (other) { - other = moment.apply(null, arguments); - return other > this ? this : other; - }, - - // keepTime = true means only change the timezone, without affecting - // the local hour. So 5:31:26 +0300 --[zone(2, true)]--> 5:31:26 +0200 - // It is possible that 5:31:26 doesn't exist int zone +0200, so we - // adjust the time as needed, to be valid. - // - // Keeping the time actually adds/subtracts (one hour) - // from the actual represented time. That is why we call updateOffset - // a second time. In case it wants us to change the offset again - // _changeInProgress == true case, then we have to adjust, because - // there is no such time in the given timezone. - zone : function (input, keepTime) { - var offset = this._offset || 0; - if (input != null) { - if (typeof input === "string") { - input = timezoneMinutesFromString(input); - } - if (Math.abs(input) < 16) { - input = input * 60; - } - this._offset = input; - this._isUTC = true; - if (offset !== input) { - if (!keepTime || this._changeInProgress) { - addOrSubtractDurationFromMoment(this, - moment.duration(offset - input, 'm'), 1, false); - } else if (!this._changeInProgress) { - this._changeInProgress = true; - moment.updateOffset(this, true); - this._changeInProgress = null; - } - } - } else { - return this._isUTC ? offset : this._d.getTimezoneOffset(); - } - return this; - }, - - zoneAbbr : function () { - return this._isUTC ? "UTC" : ""; - }, - - zoneName : function () { - return this._isUTC ? "Coordinated Universal Time" : ""; - }, - - parseZone : function () { - if (this._tzm) { - this.zone(this._tzm); - } else if (typeof this._i === 'string') { - this.zone(this._i); - } - return this; - }, - - hasAlignedHourOffset : function (input) { - if (!input) { - input = 0; - } - else { - input = moment(input).zone(); - } - - return (this.zone() - input) % 60 === 0; - }, - - daysInMonth : function () { - return daysInMonth(this.year(), this.month()); - }, - - dayOfYear : function (input) { - var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add("d", (input - dayOfYear)); - }, - - quarter : function (input) { - return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); - }, - - weekYear : function (input) { - var year = weekOfYear(this, this.lang()._week.dow, this.lang()._week.doy).year; - return input == null ? year : this.add("y", (input - year)); - }, - - isoWeekYear : function (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add("y", (input - year)); - }, - - week : function (input) { - var week = this.lang().week(this); - return input == null ? week : this.add("d", (input - week) * 7); - }, - - isoWeek : function (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add("d", (input - week) * 7); - }, - - weekday : function (input) { - var weekday = (this.day() + 7 - this.lang()._week.dow) % 7; - return input == null ? weekday : this.add("d", input - weekday); - }, - - isoWeekday : function (input) { - // behaves the same as moment#day except - // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) - // as a setter, sunday should belong to the previous week. - return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); - }, - - isoWeeksInYear : function () { - return weeksInYear(this.year(), 1, 4); - }, - - weeksInYear : function () { - var weekInfo = this._lang._week; - return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); - }, - - get : function (units) { - units = normalizeUnits(units); - return this[units](); - }, - - set : function (units, value) { - units = normalizeUnits(units); - if (typeof this[units] === 'function') { - this[units](value); - } - return this; - }, - - // If passed a language key, it will set the language for this - // instance. Otherwise, it will return the language configuration - // variables for this instance. - lang : function (key) { - if (key === undefined) { - return this._lang; - } else { - this._lang = getLangDefinition(key); - return this; - } - } - }); - - function rawMonthSetter(mom, value) { - var dayOfMonth; - - // TODO: Move this out of here! - if (typeof value === 'string') { - value = mom.lang().monthsParse(value); - // TODO: Another silent failure? - if (typeof value !== 'number') { - return mom; - } - } - - dayOfMonth = Math.min(mom.date(), - daysInMonth(mom.year(), value)); - mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); - return mom; - } - - function rawGetter(mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); - } - - function rawSetter(mom, unit, value) { - if (unit === 'Month') { - return rawMonthSetter(mom, value); - } else { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); - } - } - - function makeAccessor(unit, keepTime) { - return function (value) { - if (value != null) { - rawSetter(this, unit, value); - moment.updateOffset(this, keepTime); - return this; - } else { - return rawGetter(this, unit); - } - }; - } - - moment.fn.millisecond = moment.fn.milliseconds = makeAccessor('Milliseconds', false); - moment.fn.second = moment.fn.seconds = makeAccessor('Seconds', false); - moment.fn.minute = moment.fn.minutes = makeAccessor('Minutes', false); - // Setting the hour should keep the time, because the user explicitly - // specified which hour he wants. So trying to maintain the same hour (in - // a new timezone) makes sense. Adding/subtracting hours does not follow - // this rule. - moment.fn.hour = moment.fn.hours = makeAccessor('Hours', true); - // moment.fn.month is defined separately - moment.fn.date = makeAccessor('Date', true); - moment.fn.dates = deprecate("dates accessor is deprecated. Use date instead.", makeAccessor('Date', true)); - moment.fn.year = makeAccessor('FullYear', true); - moment.fn.years = deprecate("years accessor is deprecated. Use year instead.", makeAccessor('FullYear', true)); - - // add plural methods - moment.fn.days = moment.fn.day; - moment.fn.months = moment.fn.month; - moment.fn.weeks = moment.fn.week; - moment.fn.isoWeeks = moment.fn.isoWeek; - moment.fn.quarters = moment.fn.quarter; - - // add aliased format methods - moment.fn.toJSON = moment.fn.toISOString; - - /************************************ - Duration Prototype - ************************************/ - - - extend(moment.duration.fn = Duration.prototype, { - - _bubble : function () { - var milliseconds = this._milliseconds, - days = this._days, - months = this._months, - data = this._data, - seconds, minutes, hours, years; - - // The following code bubbles up values, see the tests for - // examples of what that means. - data.milliseconds = milliseconds % 1000; - - seconds = absRound(milliseconds / 1000); - data.seconds = seconds % 60; - - minutes = absRound(seconds / 60); - data.minutes = minutes % 60; - - hours = absRound(minutes / 60); - data.hours = hours % 24; - - days += absRound(hours / 24); - data.days = days % 30; - - months += absRound(days / 30); - data.months = months % 12; - - years = absRound(months / 12); - data.years = years; - }, - - weeks : function () { - return absRound(this.days() / 7); - }, - - valueOf : function () { - return this._milliseconds + - this._days * 864e5 + - (this._months % 12) * 2592e6 + - toInt(this._months / 12) * 31536e6; - }, - - humanize : function (withSuffix) { - var difference = +this, - output = relativeTime(difference, !withSuffix, this.lang()); - - if (withSuffix) { - output = this.lang().pastFuture(difference, output); - } - - return this.lang().postformat(output); - }, - - add : function (input, val) { - // supports only 2.0-style add(1, 's') or add(moment) - var dur = moment.duration(input, val); - - this._milliseconds += dur._milliseconds; - this._days += dur._days; - this._months += dur._months; - - this._bubble(); - - return this; - }, - - subtract : function (input, val) { - var dur = moment.duration(input, val); - - this._milliseconds -= dur._milliseconds; - this._days -= dur._days; - this._months -= dur._months; - - this._bubble(); - - return this; - }, - - get : function (units) { - units = normalizeUnits(units); - return this[units.toLowerCase() + 's'](); - }, - - as : function (units) { - units = normalizeUnits(units); - return this['as' + units.charAt(0).toUpperCase() + units.slice(1) + 's'](); - }, - - lang : moment.fn.lang, - - toIsoString : function () { - // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - var years = Math.abs(this.years()), - months = Math.abs(this.months()), - days = Math.abs(this.days()), - hours = Math.abs(this.hours()), - minutes = Math.abs(this.minutes()), - seconds = Math.abs(this.seconds() + this.milliseconds() / 1000); - - if (!this.asSeconds()) { - // this is the same as C#'s (Noda) and python (isodate)... - // but not other JS (goog.date) - return 'P0D'; - } - - return (this.asSeconds() < 0 ? '-' : '') + - 'P' + - (years ? years + 'Y' : '') + - (months ? months + 'M' : '') + - (days ? days + 'D' : '') + - ((hours || minutes || seconds) ? 'T' : '') + - (hours ? hours + 'H' : '') + - (minutes ? minutes + 'M' : '') + - (seconds ? seconds + 'S' : ''); - } - }); - - function makeDurationGetter(name) { - moment.duration.fn[name] = function () { - return this._data[name]; - }; - } - - function makeDurationAsGetter(name, factor) { - moment.duration.fn['as' + name] = function () { - return +this / factor; - }; - } - - for (i in unitMillisecondFactors) { - if (unitMillisecondFactors.hasOwnProperty(i)) { - makeDurationAsGetter(i, unitMillisecondFactors[i]); - makeDurationGetter(i.toLowerCase()); - } - } - - makeDurationAsGetter('Weeks', 6048e5); - moment.duration.fn.asMonths = function () { - return (+this - this.years() * 31536e6) / 2592e6 + this.years() * 12; - }; - - - /************************************ - Default Lang - ************************************/ - - - // Set default language, other languages will inherit from English. - moment.lang('en', { - ordinal : function (number) { - var b = number % 10, - output = (toInt(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - - // moment.js language configuration -// language : Moroccan Arabic (ar-ma) -// author : ElFadili Yassine : https://github.com/ElFadiliY -// author : Abdel Said : https://github.com/abdelsaid - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('ar-ma', { - months : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), - monthsShort : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"), - weekdays : "الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysShort : "احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"), - weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[اليوم على الساعة] LT", - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : "في %s", - past : "منذ %s", - s : "ثوان", - m : "دقيقة", - mm : "%d دقائق", - h : "ساعة", - hh : "%d ساعات", - d : "يوم", - dd : "%d أيام", - M : "شهر", - MM : "%d أشهر", - y : "سنة", - yy : "%d سنوات" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Arabic (ar) -// author : Abdel Said : https://github.com/abdelsaid -// changes in months, weekdays : Ahmed Elkhatib - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('ar', { - months : "يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"), - monthsShort : "يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"), - weekdays : "الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysShort : "الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"), - weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[اليوم على الساعة] LT", - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : "في %s", - past : "منذ %s", - s : "ثوان", - m : "دقيقة", - mm : "%d دقائق", - h : "ساعة", - hh : "%d ساعات", - d : "يوم", - dd : "%d أيام", - M : "شهر", - MM : "%d أشهر", - y : "سنة", - yy : "%d سنوات" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : bulgarian (bg) -// author : Krasen Borisov : https://github.com/kraz - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('bg', { - months : "януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"), - monthsShort : "янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"), - weekdays : "неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"), - weekdaysShort : "нед_пон_вто_сря_чет_пет_съб".split("_"), - weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"), - longDateFormat : { - LT : "H:mm", - L : "D.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Днес в] LT', - nextDay : '[Утре в] LT', - nextWeek : 'dddd [в] LT', - lastDay : '[Вчера в] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[В изминалата] dddd [в] LT'; - case 1: - case 2: - case 4: - case 5: - return '[В изминалия] dddd [в] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "след %s", - past : "преди %s", - s : "няколко секунди", - m : "минута", - mm : "%d минути", - h : "час", - hh : "%d часа", - d : "ден", - dd : "%d дни", - M : "месец", - MM : "%d месеца", - y : "година", - yy : "%d години" - }, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : breton (br) -// author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou - -(function (factory) { - factory(moment); -}(function (moment) { - function relativeTimeWithMutation(number, withoutSuffix, key) { - var format = { - 'mm': "munutenn", - 'MM': "miz", - 'dd': "devezh" - }; - return number + ' ' + mutation(format[key], number); - } - - function specialMutationForYears(number) { - switch (lastNumber(number)) { - case 1: - case 3: - case 4: - case 5: - case 9: - return number + ' bloaz'; - default: - return number + ' vloaz'; - } - } - - function lastNumber(number) { - if (number > 9) { - return lastNumber(number % 10); - } - return number; - } - - function mutation(text, number) { - if (number === 2) { - return softMutation(text); - } - return text; - } - - function softMutation(text) { - var mutationTable = { - 'm': 'v', - 'b': 'v', - 'd': 'z' - }; - if (mutationTable[text.charAt(0)] === undefined) { - return text; - } - return mutationTable[text.charAt(0)] + text.substring(1); - } - - return moment.lang('br', { - months : "Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"), - monthsShort : "Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"), - weekdays : "Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"), - weekdaysShort : "Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"), - weekdaysMin : "Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"), - longDateFormat : { - LT : "h[e]mm A", - L : "DD/MM/YYYY", - LL : "D [a viz] MMMM YYYY", - LLL : "D [a viz] MMMM YYYY LT", - LLLL : "dddd, D [a viz] MMMM YYYY LT" - }, - calendar : { - sameDay : '[Hiziv da] LT', - nextDay : '[Warc\'hoazh da] LT', - nextWeek : 'dddd [da] LT', - lastDay : '[Dec\'h da] LT', - lastWeek : 'dddd [paset da] LT', - sameElse : 'L' - }, - relativeTime : { - future : "a-benn %s", - past : "%s 'zo", - s : "un nebeud segondennoù", - m : "ur vunutenn", - mm : relativeTimeWithMutation, - h : "un eur", - hh : "%d eur", - d : "un devezh", - dd : relativeTimeWithMutation, - M : "ur miz", - MM : relativeTimeWithMutation, - y : "ur bloaz", - yy : specialMutationForYears - }, - ordinal : function (number) { - var output = (number === 1) ? 'añ' : 'vet'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : bosnian (bs) -// author : Nedim Cholich : https://github.com/frontyard -// based on (hr) translation by Bojan Marković - -(function (factory) { - factory(moment); -}(function (moment) { - - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - return moment.lang('bs', { - months : "januar_februar_mart_april_maj_juni_juli_avgust_septembar_oktobar_novembar_decembar".split("_"), - monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"), - weekdays : "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), - weekdaysShort : "ned._pon._uto._sri._čet._pet._sub.".split("_"), - weekdaysMin : "ne_po_ut_sr_če_pe_su".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "za %s", - past : "prije %s", - s : "par sekundi", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "dan", - dd : translate, - M : "mjesec", - MM : translate, - y : "godinu", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : catalan (ca) -// author : Juan G. Hurtado : https://github.com/juanghurtado - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('ca', { - months : "gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"), - monthsShort : "gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"), - weekdays : "diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"), - weekdaysShort : "dg._dl._dt._dc._dj._dv._ds.".split("_"), - weekdaysMin : "Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay : function () { - return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextDay : function () { - return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastDay : function () { - return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : "en %s", - past : "fa %s", - s : "uns segons", - m : "un minut", - mm : "%d minuts", - h : "una hora", - hh : "%d hores", - d : "un dia", - dd : "%d dies", - M : "un mes", - MM : "%d mesos", - y : "un any", - yy : "%d anys" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : czech (cs) -// author : petrbela : https://github.com/petrbela - -(function (factory) { - factory(moment); -}(function (moment) { - var months = "leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"), - monthsShort = "led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"); - - function plural(n) { - return (n > 1) && (n < 5) && (~~(n / 10) !== 1); - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minuty' : 'minut'); - } else { - return result + 'minutami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodin'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'den' : 'dnem'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dny' : 'dní'); - } else { - return result + 'dny'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'měsíce' : 'měsíců'); - } else { - return result + 'měsíci'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokem'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'let'); - } else { - return result + 'lety'; - } - break; - } - } - - return moment.lang('cs', { - months : months, - monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), - weekdays : "neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"), - weekdaysShort : "ne_po_út_st_čt_pá_so".split("_"), - weekdaysMin : "ne_po_út_st_čt_pá_so".split("_"), - longDateFormat : { - LT: "H.mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd D. MMMM YYYY LT" - }, - calendar : { - sameDay: "[dnes v] LT", - nextDay: '[zítra v] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v neděli v] LT'; - case 1: - case 2: - return '[v] dddd [v] LT'; - case 3: - return '[ve středu v] LT'; - case 4: - return '[ve čtvrtek v] LT'; - case 5: - return '[v pátek v] LT'; - case 6: - return '[v sobotu v] LT'; - } - }, - lastDay: '[včera v] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulou neděli v] LT'; - case 1: - case 2: - return '[minulé] dddd [v] LT'; - case 3: - return '[minulou středu v] LT'; - case 4: - case 5: - return '[minulý] dddd [v] LT'; - case 6: - return '[minulou sobotu v] LT'; - } - }, - sameElse: "L" - }, - relativeTime : { - future : "za %s", - past : "před %s", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : chuvash (cv) -// author : Anatoly Mironov : https://github.com/mirontoli - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('cv', { - months : "кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"), - monthsShort : "кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"), - weekdays : "вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"), - weekdaysShort : "выр_тун_ытл_юн_кĕç_эрн_шăм".split("_"), - weekdaysMin : "вр_тн_ыт_юн_кç_эр_шм".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD-MM-YYYY", - LL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]", - LLL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT", - LLLL : "dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT" - }, - calendar : { - sameDay: '[Паян] LT [сехетре]', - nextDay: '[Ыран] LT [сехетре]', - lastDay: '[Ĕнер] LT [сехетре]', - nextWeek: '[Çитес] dddd LT [сехетре]', - lastWeek: '[Иртнĕ] dddd LT [сехетре]', - sameElse: 'L' - }, - relativeTime : { - future : function (output) { - var affix = /сехет$/i.exec(output) ? "рен" : /çул$/i.exec(output) ? "тан" : "ран"; - return output + affix; - }, - past : "%s каялла", - s : "пĕр-ик çеккунт", - m : "пĕр минут", - mm : "%d минут", - h : "пĕр сехет", - hh : "%d сехет", - d : "пĕр кун", - dd : "%d кун", - M : "пĕр уйăх", - MM : "%d уйăх", - y : "пĕр çул", - yy : "%d çул" - }, - ordinal : '%d-мĕш', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Welsh (cy) -// author : Robert Allen - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang("cy", { - months: "Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"), - monthsShort: "Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"), - weekdays: "Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"), - weekdaysShort: "Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"), - weekdaysMin: "Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"), - // time formats are the same as en-gb - longDateFormat: { - LT: "HH:mm", - L: "DD/MM/YYYY", - LL: "D MMMM YYYY", - LLL: "D MMMM YYYY LT", - LLLL: "dddd, D MMMM YYYY LT" - }, - calendar: { - sameDay: '[Heddiw am] LT', - nextDay: '[Yfory am] LT', - nextWeek: 'dddd [am] LT', - lastDay: '[Ddoe am] LT', - lastWeek: 'dddd [diwethaf am] LT', - sameElse: 'L' - }, - relativeTime: { - future: "mewn %s", - past: "%s yn àl", - s: "ychydig eiliadau", - m: "munud", - mm: "%d munud", - h: "awr", - hh: "%d awr", - d: "diwrnod", - dd: "%d diwrnod", - M: "mis", - MM: "%d mis", - y: "blwyddyn", - yy: "%d flynedd" - }, - // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh - ordinal: function (number) { - var b = number, - output = '', - lookup = [ - '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed - 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed - ]; - - if (b > 20) { - if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) { - output = 'fed'; // not 30ain, 70ain or 90ain - } else { - output = 'ain'; - } - } else if (b > 0) { - output = lookup[b]; - } - - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : danish (da) -// author : Ulrik Nielsen : https://github.com/mrbase - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('da', { - months : "januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), - weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), - weekdaysShort : "søn_man_tir_ons_tor_fre_lør".split("_"), - weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D. MMMM, YYYY LT" - }, - calendar : { - sameDay : '[I dag kl.] LT', - nextDay : '[I morgen kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[I går kl.] LT', - lastWeek : '[sidste] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : "om %s", - past : "%s siden", - s : "få sekunder", - m : "et minut", - mm : "%d minutter", - h : "en time", - hh : "%d timer", - d : "en dag", - dd : "%d dage", - M : "en måned", - MM : "%d måneder", - y : "et år", - yy : "%d år" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : german (de) -// author : lluchs : https://github.com/lluchs -// author: Menelion Elensúle: https://github.com/Oire - -(function (factory) { - factory(moment); -}(function (moment) { - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eine Minute', 'einer Minute'], - 'h': ['eine Stunde', 'einer Stunde'], - 'd': ['ein Tag', 'einem Tag'], - 'dd': [number + ' Tage', number + ' Tagen'], - 'M': ['ein Monat', 'einem Monat'], - 'MM': [number + ' Monate', number + ' Monaten'], - 'y': ['ein Jahr', 'einem Jahr'], - 'yy': [number + ' Jahre', number + ' Jahren'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - return moment.lang('de', { - months : "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), - monthsShort : "Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), - weekdays : "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), - weekdaysShort : "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), - weekdaysMin : "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), - longDateFormat : { - LT: "HH:mm [Uhr]", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay: "[Heute um] LT", - sameElse: "L", - nextDay: '[Morgen um] LT', - nextWeek: 'dddd [um] LT', - lastDay: '[Gestern um] LT', - lastWeek: '[letzten] dddd [um] LT' - }, - relativeTime : { - future : "in %s", - past : "vor %s", - s : "ein paar Sekunden", - m : processRelativeTime, - mm : "%d Minuten", - h : processRelativeTime, - hh : "%d Stunden", - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : modern greek (el) -// author : Aggelos Karalias : https://github.com/mehiel - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('el', { - monthsNominativeEl : "Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"), - monthsGenitiveEl : "Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"), - months : function (momentToFormat, format) { - if (/D/.test(format.substring(0, format.indexOf("MMMM")))) { // if there is a day number before 'MMMM' - return this._monthsGenitiveEl[momentToFormat.month()]; - } else { - return this._monthsNominativeEl[momentToFormat.month()]; - } - }, - monthsShort : "Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"), - weekdays : "Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"), - weekdaysShort : "Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"), - weekdaysMin : "Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"), - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'μμ' : 'ΜΜ'; - } else { - return isLower ? 'πμ' : 'ΠΜ'; - } - }, - longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendarEl : { - sameDay : '[Σήμερα {}] LT', - nextDay : '[Αύριο {}] LT', - nextWeek : 'dddd [{}] LT', - lastDay : '[Χθες {}] LT', - lastWeek : '[την προηγούμενη] dddd [{}] LT', - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendarEl[key], - hours = mom && mom.hours(); - - return output.replace("{}", (hours % 12 === 1 ? "στη" : "στις")); - }, - relativeTime : { - future : "σε %s", - past : "%s πριν", - s : "δευτερόλεπτα", - m : "ένα λεπτό", - mm : "%d λεπτά", - h : "μία ώρα", - hh : "%d ώρες", - d : "μία μέρα", - dd : "%d μέρες", - M : "ένας μήνας", - MM : "%d μήνες", - y : "ένας χρόνος", - yy : "%d χρόνια" - }, - ordinal : function (number) { - return number + 'η'; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : australian english (en-au) - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('en-au', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : canadian english (en-ca) -// author : Jonathan Abourbih : https://github.com/jonbca - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('en-ca', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - longDateFormat : { - LT : "h:mm A", - L : "YYYY-MM-DD", - LL : "D MMMM, YYYY", - LLL : "D MMMM, YYYY LT", - LLLL : "dddd, D MMMM, YYYY LT" - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); -})); -// moment.js language configuration -// language : great britain english (en-gb) -// author : Chris Gedrim : https://github.com/chrisgedrim - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('en-gb', { - months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : esperanto (eo) -// author : Colin Dean : https://github.com/colindean -// komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko. -// Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('eo', { - months : "januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"), - weekdays : "Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"), - weekdaysShort : "Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D[-an de] MMMM, YYYY", - LLL : "D[-an de] MMMM, YYYY LT", - LLLL : "dddd, [la] D[-an de] MMMM, YYYY LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'p.t.m.' : 'P.T.M.'; - } else { - return isLower ? 'a.t.m.' : 'A.T.M.'; - } - }, - calendar : { - sameDay : '[Hodiaŭ je] LT', - nextDay : '[Morgaŭ je] LT', - nextWeek : 'dddd [je] LT', - lastDay : '[Hieraŭ je] LT', - lastWeek : '[pasinta] dddd [je] LT', - sameElse : 'L' - }, - relativeTime : { - future : "je %s", - past : "antaŭ %s", - s : "sekundoj", - m : "minuto", - mm : "%d minutoj", - h : "horo", - hh : "%d horoj", - d : "tago",//ne 'diurno', ĉar estas uzita por proksimumo - dd : "%d tagoj", - M : "monato", - MM : "%d monatoj", - y : "jaro", - yy : "%d jaroj" - }, - ordinal : "%da", - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : spanish (es) -// author : Julio Napurí : https://github.com/julionc - -(function (factory) { - factory(moment); -}(function (moment) { - var monthsShortDot = "ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"), - monthsShort = "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"); - - return moment.lang('es', { - months : "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShort[m.month()]; - } else { - return monthsShortDot[m.month()]; - } - }, - weekdays : "domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"), - weekdaysShort : "dom._lun._mar._mié._jue._vie._sáb.".split("_"), - weekdaysMin : "Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [del] YYYY", - LLL : "D [de] MMMM [del] YYYY LT", - LLLL : "dddd, D [de] MMMM [del] YYYY LT" - }, - calendar : { - sameDay : function () { - return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextDay : function () { - return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastDay : function () { - return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : "en %s", - past : "hace %s", - s : "unos segundos", - m : "un minuto", - mm : "%d minutos", - h : "una hora", - hh : "%d horas", - d : "un día", - dd : "%d días", - M : "un mes", - MM : "%d meses", - y : "un año", - yy : "%d años" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : estonian (et) -// author : Henry Kehlmann : https://github.com/madhenry -// improvements : Illimar Tambek : https://github.com/ragulka - -(function (factory) { - factory(moment); -}(function (moment) { - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'], - 'm' : ['ühe minuti', 'üks minut'], - 'mm': [number + ' minuti', number + ' minutit'], - 'h' : ['ühe tunni', 'tund aega', 'üks tund'], - 'hh': [number + ' tunni', number + ' tundi'], - 'd' : ['ühe päeva', 'üks päev'], - 'M' : ['kuu aja', 'kuu aega', 'üks kuu'], - 'MM': [number + ' kuu', number + ' kuud'], - 'y' : ['ühe aasta', 'aasta', 'üks aasta'], - 'yy': [number + ' aasta', number + ' aastat'] - }; - if (withoutSuffix) { - return format[key][2] ? format[key][2] : format[key][1]; - } - return isFuture ? format[key][0] : format[key][1]; - } - - return moment.lang('et', { - months : "jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"), - monthsShort : "jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"), - weekdays : "pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"), - weekdaysShort : "P_E_T_K_N_R_L".split("_"), - weekdaysMin : "P_E_T_K_N_R_L".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[Täna,] LT', - nextDay : '[Homme,] LT', - nextWeek : '[Järgmine] dddd LT', - lastDay : '[Eile,] LT', - lastWeek : '[Eelmine] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s pärast", - past : "%s tagasi", - s : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : '%d päeva', - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : euskara (eu) -// author : Eneko Illarramendi : https://github.com/eillarra - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('eu', { - months : "urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"), - monthsShort : "urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"), - weekdays : "igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"), - weekdaysShort : "ig._al._ar._az._og._ol._lr.".split("_"), - weekdaysMin : "ig_al_ar_az_og_ol_lr".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "YYYY[ko] MMMM[ren] D[a]", - LLL : "YYYY[ko] MMMM[ren] D[a] LT", - LLLL : "dddd, YYYY[ko] MMMM[ren] D[a] LT", - l : "YYYY-M-D", - ll : "YYYY[ko] MMM D[a]", - lll : "YYYY[ko] MMM D[a] LT", - llll : "ddd, YYYY[ko] MMM D[a] LT" - }, - calendar : { - sameDay : '[gaur] LT[etan]', - nextDay : '[bihar] LT[etan]', - nextWeek : 'dddd LT[etan]', - lastDay : '[atzo] LT[etan]', - lastWeek : '[aurreko] dddd LT[etan]', - sameElse : 'L' - }, - relativeTime : { - future : "%s barru", - past : "duela %s", - s : "segundo batzuk", - m : "minutu bat", - mm : "%d minutu", - h : "ordu bat", - hh : "%d ordu", - d : "egun bat", - dd : "%d egun", - M : "hilabete bat", - MM : "%d hilabete", - y : "urte bat", - yy : "%d urte" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Persian Language -// author : Ebrahim Byagowi : https://github.com/ebraminio - -(function (factory) { - factory(moment); -}(function (moment) { - var symbolMap = { - '1': '۱', - '2': '۲', - '3': '۳', - '4': '۴', - '5': '۵', - '6': '۶', - '7': '۷', - '8': '۸', - '9': '۹', - '0': '۰' - }, numberMap = { - '۱': '1', - '۲': '2', - '۳': '3', - '۴': '4', - '۵': '5', - '۶': '6', - '۷': '7', - '۸': '8', - '۹': '9', - '۰': '0' - }; - - return moment.lang('fa', { - months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'), - longDateFormat : { - LT : 'HH:mm', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY LT', - LLLL : 'dddd, D MMMM YYYY LT' - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "قبل از ظهر"; - } else { - return "بعد از ظهر"; - } - }, - calendar : { - sameDay : '[امروز ساعت] LT', - nextDay : '[فردا ساعت] LT', - nextWeek : 'dddd [ساعت] LT', - lastDay : '[دیروز ساعت] LT', - lastWeek : 'dddd [پیش] [ساعت] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'در %s', - past : '%s پیش', - s : 'چندین ثانیه', - m : 'یک دقیقه', - mm : '%d دقیقه', - h : 'یک ساعت', - hh : '%d ساعت', - d : 'یک روز', - dd : '%d روز', - M : 'یک ماه', - MM : '%d ماه', - y : 'یک سال', - yy : '%d سال' - }, - preparse: function (string) { - return string.replace(/[۰-۹]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - ordinal : '%dم', - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : finnish (fi) -// author : Tarmo Aidantausta : https://github.com/bleadof - -(function (factory) { - factory(moment); -}(function (moment) { - var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '), - numbersFuture = ['nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden', - numbersPast[7], numbersPast[8], numbersPast[9]]; - - function translate(number, withoutSuffix, key, isFuture) { - var result = ""; - switch (key) { - case 's': - return isFuture ? 'muutaman sekunnin' : 'muutama sekunti'; - case 'm': - return isFuture ? 'minuutin' : 'minuutti'; - case 'mm': - result = isFuture ? 'minuutin' : 'minuuttia'; - break; - case 'h': - return isFuture ? 'tunnin' : 'tunti'; - case 'hh': - result = isFuture ? 'tunnin' : 'tuntia'; - break; - case 'd': - return isFuture ? 'päivän' : 'päivä'; - case 'dd': - result = isFuture ? 'päivän' : 'päivää'; - break; - case 'M': - return isFuture ? 'kuukauden' : 'kuukausi'; - case 'MM': - result = isFuture ? 'kuukauden' : 'kuukautta'; - break; - case 'y': - return isFuture ? 'vuoden' : 'vuosi'; - case 'yy': - result = isFuture ? 'vuoden' : 'vuotta'; - break; - } - result = verbalNumber(number, isFuture) + " " + result; - return result; - } - - function verbalNumber(number, isFuture) { - return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number; - } - - return moment.lang('fi', { - months : "tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"), - monthsShort : "tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"), - weekdays : "sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"), - weekdaysShort : "su_ma_ti_ke_to_pe_la".split("_"), - weekdaysMin : "su_ma_ti_ke_to_pe_la".split("_"), - longDateFormat : { - LT : "HH.mm", - L : "DD.MM.YYYY", - LL : "Do MMMM[ta] YYYY", - LLL : "Do MMMM[ta] YYYY, [klo] LT", - LLLL : "dddd, Do MMMM[ta] YYYY, [klo] LT", - l : "D.M.YYYY", - ll : "Do MMM YYYY", - lll : "Do MMM YYYY, [klo] LT", - llll : "ddd, Do MMM YYYY, [klo] LT" - }, - calendar : { - sameDay : '[tänään] [klo] LT', - nextDay : '[huomenna] [klo] LT', - nextWeek : 'dddd [klo] LT', - lastDay : '[eilen] [klo] LT', - lastWeek : '[viime] dddd[na] [klo] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s päästä", - past : "%s sitten", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : "%d.", - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : faroese (fo) -// author : Ragnar Johannesen : https://github.com/ragnar123 - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('fo', { - months : "januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), - weekdays : "sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"), - weekdaysShort : "sun_mán_týs_mik_hós_frí_ley".split("_"), - weekdaysMin : "su_má_tý_mi_hó_fr_le".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D. MMMM, YYYY LT" - }, - calendar : { - sameDay : '[Í dag kl.] LT', - nextDay : '[Í morgin kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[Í gjár kl.] LT', - lastWeek : '[síðstu] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : "um %s", - past : "%s síðani", - s : "fá sekund", - m : "ein minutt", - mm : "%d minuttir", - h : "ein tími", - hh : "%d tímar", - d : "ein dagur", - dd : "%d dagar", - M : "ein mánaði", - MM : "%d mánaðir", - y : "eitt ár", - yy : "%d ár" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : canadian french (fr-ca) -// author : Jonathan Abourbih : https://github.com/jonbca - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('fr-ca', { - months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), - monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), - weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), - weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[Aujourd'hui à] LT", - nextDay: '[Demain à] LT', - nextWeek: 'dddd [à] LT', - lastDay: '[Hier à] LT', - lastWeek: 'dddd [dernier à] LT', - sameElse: 'L' - }, - relativeTime : { - future : "dans %s", - past : "il y a %s", - s : "quelques secondes", - m : "une minute", - mm : "%d minutes", - h : "une heure", - hh : "%d heures", - d : "un jour", - dd : "%d jours", - M : "un mois", - MM : "%d mois", - y : "un an", - yy : "%d ans" - }, - ordinal : function (number) { - return number + (number === 1 ? 'er' : ''); - } - }); -})); -// moment.js language configuration -// language : french (fr) -// author : John Fischer : https://github.com/jfroffice - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('fr', { - months : "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"), - monthsShort : "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"), - weekdays : "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), - weekdaysShort : "dim._lun._mar._mer._jeu._ven._sam.".split("_"), - weekdaysMin : "Di_Lu_Ma_Me_Je_Ve_Sa".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[Aujourd'hui à] LT", - nextDay: '[Demain à] LT', - nextWeek: 'dddd [à] LT', - lastDay: '[Hier à] LT', - lastWeek: 'dddd [dernier à] LT', - sameElse: 'L' - }, - relativeTime : { - future : "dans %s", - past : "il y a %s", - s : "quelques secondes", - m : "une minute", - mm : "%d minutes", - h : "une heure", - hh : "%d heures", - d : "un jour", - dd : "%d jours", - M : "un mois", - MM : "%d mois", - y : "un an", - yy : "%d ans" - }, - ordinal : function (number) { - return number + (number === 1 ? 'er' : ''); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : galician (gl) -// author : Juan G. Hurtado : https://github.com/juanghurtado - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('gl', { - months : "Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"), - monthsShort : "Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"), - weekdays : "Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"), - weekdaysShort : "Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"), - weekdaysMin : "Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay : function () { - return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextDay : function () { - return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextWeek : function () { - return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - lastDay : function () { - return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT'; - }, - lastWeek : function () { - return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : function (str) { - if (str === "uns segundos") { - return "nuns segundos"; - } - return "en " + str; - }, - past : "hai %s", - s : "uns segundos", - m : "un minuto", - mm : "%d minutos", - h : "unha hora", - hh : "%d horas", - d : "un día", - dd : "%d días", - M : "un mes", - MM : "%d meses", - y : "un ano", - yy : "%d anos" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Hebrew (he) -// author : Tomer Cohen : https://github.com/tomer -// author : Moshe Simantov : https://github.com/DevelopmentIL -// author : Tal Ater : https://github.com/TalAter - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('he', { - months : "ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"), - monthsShort : "ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"), - weekdays : "ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"), - weekdaysShort : "א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"), - weekdaysMin : "א_ב_ג_ד_ה_ו_ש".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [ב]MMMM YYYY", - LLL : "D [ב]MMMM YYYY LT", - LLLL : "dddd, D [ב]MMMM YYYY LT", - l : "D/M/YYYY", - ll : "D MMM YYYY", - lll : "D MMM YYYY LT", - llll : "ddd, D MMM YYYY LT" - }, - calendar : { - sameDay : '[היום ב־]LT', - nextDay : '[מחר ב־]LT', - nextWeek : 'dddd [בשעה] LT', - lastDay : '[אתמול ב־]LT', - lastWeek : '[ביום] dddd [האחרון בשעה] LT', - sameElse : 'L' - }, - relativeTime : { - future : "בעוד %s", - past : "לפני %s", - s : "מספר שניות", - m : "דקה", - mm : "%d דקות", - h : "שעה", - hh : function (number) { - if (number === 2) { - return "שעתיים"; - } - return number + " שעות"; - }, - d : "יום", - dd : function (number) { - if (number === 2) { - return "יומיים"; - } - return number + " ימים"; - }, - M : "חודש", - MM : function (number) { - if (number === 2) { - return "חודשיים"; - } - return number + " חודשים"; - }, - y : "שנה", - yy : function (number) { - if (number === 2) { - return "שנתיים"; - } - return number + " שנים"; - } - } - }); -})); -// moment.js language configuration -// language : hindi (hi) -// author : Mayank Singhal : https://github.com/mayanksinghal - -(function (factory) { - factory(moment); -}(function (moment) { - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - return moment.lang('hi', { - months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split("_"), - monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split("_"), - weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split("_"), - weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split("_"), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split("_"), - longDateFormat : { - LT : "A h:mm बजे", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[कल] LT', - nextWeek : 'dddd, LT', - lastDay : '[कल] LT', - lastWeek : '[पिछले] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s में", - past : "%s पहले", - s : "कुछ ही क्षण", - m : "एक मिनट", - mm : "%d मिनट", - h : "एक घंटा", - hh : "%d घंटे", - d : "एक दिन", - dd : "%d दिन", - M : "एक महीने", - MM : "%d महीने", - y : "एक वर्ष", - yy : "%d वर्ष" - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // Hindi notation for meridiems are quite fuzzy in practice. While there exists - // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi. - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "रात"; - } else if (hour < 10) { - return "सुबह"; - } else if (hour < 17) { - return "दोपहर"; - } else if (hour < 20) { - return "शाम"; - } else { - return "रात"; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : hrvatski (hr) -// author : Bojan Marković : https://github.com/bmarkovic - -// based on (sl) translation by Robert Sedovšek - -(function (factory) { - factory(moment); -}(function (moment) { - - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - return moment.lang('hr', { - months : "sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"), - monthsShort : "sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"), - weekdays : "nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"), - weekdaysShort : "ned._pon._uto._sri._čet._pet._sub.".split("_"), - weekdaysMin : "ne_po_ut_sr_če_pe_su".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "za %s", - past : "prije %s", - s : "par sekundi", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "dan", - dd : translate, - M : "mjesec", - MM : translate, - y : "godinu", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : hungarian (hu) -// author : Adam Brunner : https://github.com/adambrunner - -(function (factory) { - factory(moment); -}(function (moment) { - var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' '); - - function translate(number, withoutSuffix, key, isFuture) { - var num = number, - suffix; - - switch (key) { - case 's': - return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce'; - case 'm': - return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'mm': - return num + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'h': - return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'hh': - return num + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'd': - return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'dd': - return num + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'M': - return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'MM': - return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'y': - return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve'); - case 'yy': - return num + (isFuture || withoutSuffix ? ' év' : ' éve'); - } - - return ''; - } - - function week(isFuture) { - return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]'; - } - - return moment.lang('hu', { - months : "január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"), - monthsShort : "jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"), - weekdays : "vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"), - weekdaysShort : "vas_hét_kedd_sze_csüt_pén_szo".split("_"), - weekdaysMin : "v_h_k_sze_cs_p_szo".split("_"), - longDateFormat : { - LT : "H:mm", - L : "YYYY.MM.DD.", - LL : "YYYY. MMMM D.", - LLL : "YYYY. MMMM D., LT", - LLLL : "YYYY. MMMM D., dddd LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 12) { - return isLower === true ? 'de' : 'DE'; - } else { - return isLower === true ? 'du' : 'DU'; - } - }, - calendar : { - sameDay : '[ma] LT[-kor]', - nextDay : '[holnap] LT[-kor]', - nextWeek : function () { - return week.call(this, true); - }, - lastDay : '[tegnap] LT[-kor]', - lastWeek : function () { - return week.call(this, false); - }, - sameElse : 'L' - }, - relativeTime : { - future : "%s múlva", - past : "%s", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Armenian (hy-am) -// author : Armendarabyan : https://github.com/armendarabyan - -(function (factory) { - factory(moment); -}(function (moment) { - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'), - 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function monthsShortCaseReplace(m, format) { - var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'); - - return monthsShort[m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'); - - return weekdays[m.day()]; - } - - return moment.lang('hy-am', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), - weekdaysMin : "կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY թ.", - LLL : "D MMMM YYYY թ., LT", - LLLL : "dddd, D MMMM YYYY թ., LT" - }, - calendar : { - sameDay: '[այսօր] LT', - nextDay: '[վաղը] LT', - lastDay: '[երեկ] LT', - nextWeek: function () { - return 'dddd [օրը ժամը] LT'; - }, - lastWeek: function () { - return '[անցած] dddd [օրը ժամը] LT'; - }, - sameElse: 'L' - }, - relativeTime : { - future : "%s հետո", - past : "%s առաջ", - s : "մի քանի վայրկյան", - m : "րոպե", - mm : "%d րոպե", - h : "ժամ", - hh : "%d ժամ", - d : "օր", - dd : "%d օր", - M : "ամիս", - MM : "%d ամիս", - y : "տարի", - yy : "%d տարի" - }, - - meridiem : function (hour) { - if (hour < 4) { - return "գիշերվա"; - } else if (hour < 12) { - return "առավոտվա"; - } else if (hour < 17) { - return "ցերեկվա"; - } else { - return "երեկոյան"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'DDD': - case 'w': - case 'W': - case 'DDDo': - if (number === 1) { - return number + '-ին'; - } - return number + '-րդ'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Bahasa Indonesia (id) -// author : Mohammad Satrio Utomo : https://github.com/tyok -// reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('id', { - months : "Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"), - weekdays : "Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"), - weekdaysShort : "Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"), - weekdaysMin : "Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"), - longDateFormat : { - LT : "HH.mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY [pukul] LT", - LLLL : "dddd, D MMMM YYYY [pukul] LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'siang'; - } else if (hours < 19) { - return 'sore'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Besok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kemarin pukul] LT', - lastWeek : 'dddd [lalu pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : "dalam %s", - past : "%s yang lalu", - s : "beberapa detik", - m : "semenit", - mm : "%d menit", - h : "sejam", - hh : "%d jam", - d : "sehari", - dd : "%d hari", - M : "sebulan", - MM : "%d bulan", - y : "setahun", - yy : "%d tahun" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : icelandic (is) -// author : Hinrik Örn Sigurðsson : https://github.com/hinrik - -(function (factory) { - factory(moment); -}(function (moment) { - function plural(n) { - if (n % 100 === 11) { - return true; - } else if (n % 10 === 1) { - return false; - } - return true; - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - switch (key) { - case 's': - return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum'; - case 'm': - return withoutSuffix ? 'mínúta' : 'mínútu'; - case 'mm': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum'); - } else if (withoutSuffix) { - return result + 'mínúta'; - } - return result + 'mínútu'; - case 'hh': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum'); - } - return result + 'klukkustund'; - case 'd': - if (withoutSuffix) { - return 'dagur'; - } - return isFuture ? 'dag' : 'degi'; - case 'dd': - if (plural(number)) { - if (withoutSuffix) { - return result + 'dagar'; - } - return result + (isFuture ? 'daga' : 'dögum'); - } else if (withoutSuffix) { - return result + 'dagur'; - } - return result + (isFuture ? 'dag' : 'degi'); - case 'M': - if (withoutSuffix) { - return 'mánuður'; - } - return isFuture ? 'mánuð' : 'mánuði'; - case 'MM': - if (plural(number)) { - if (withoutSuffix) { - return result + 'mánuðir'; - } - return result + (isFuture ? 'mánuði' : 'mánuðum'); - } else if (withoutSuffix) { - return result + 'mánuður'; - } - return result + (isFuture ? 'mánuð' : 'mánuði'); - case 'y': - return withoutSuffix || isFuture ? 'ár' : 'ári'; - case 'yy': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); - } - return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); - } - } - - return moment.lang('is', { - months : "janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"), - monthsShort : "jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"), - weekdays : "sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"), - weekdaysShort : "sun_mán_þri_mið_fim_fös_lau".split("_"), - weekdaysMin : "Su_Má_Þr_Mi_Fi_Fö_La".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD/MM/YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY [kl.] LT", - LLLL : "dddd, D. MMMM YYYY [kl.] LT" - }, - calendar : { - sameDay : '[í dag kl.] LT', - nextDay : '[á morgun kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[í gær kl.] LT', - lastWeek : '[síðasta] dddd [kl.] LT', - sameElse : 'L' - }, - relativeTime : { - future : "eftir %s", - past : "fyrir %s síðan", - s : translate, - m : translate, - mm : translate, - h : "klukkustund", - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : italian (it) -// author : Lorenzo : https://github.com/aliem -// author: Mattia Larentis: https://github.com/nostalgiaz - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('it', { - months : "Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre".split("_"), - monthsShort : "Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"), - weekdays : "Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"), - weekdaysShort : "Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"), - weekdaysMin : "D_L_Ma_Me_G_V_S".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay: '[Oggi alle] LT', - nextDay: '[Domani alle] LT', - nextWeek: 'dddd [alle] LT', - lastDay: '[Ieri alle] LT', - lastWeek: '[lo scorso] dddd [alle] LT', - sameElse: 'L' - }, - relativeTime : { - future : function (s) { - return ((/^[0-9].+$/).test(s) ? "tra" : "in") + " " + s; - }, - past : "%s fa", - s : "alcuni secondi", - m : "un minuto", - mm : "%d minuti", - h : "un'ora", - hh : "%d ore", - d : "un giorno", - dd : "%d giorni", - M : "un mese", - MM : "%d mesi", - y : "un anno", - yy : "%d anni" - }, - ordinal: '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : japanese (ja) -// author : LI Long : https://github.com/baryon - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('ja', { - months : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"), - weekdaysShort : "日_月_火_水_木_金_土".split("_"), - weekdaysMin : "日_月_火_水_木_金_土".split("_"), - longDateFormat : { - LT : "Ah時m分", - L : "YYYY/MM/DD", - LL : "YYYY年M月D日", - LLL : "YYYY年M月D日LT", - LLLL : "YYYY年M月D日LT dddd" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "午前"; - } else { - return "午後"; - } - }, - calendar : { - sameDay : '[今日] LT', - nextDay : '[明日] LT', - nextWeek : '[来週]dddd LT', - lastDay : '[昨日] LT', - lastWeek : '[前週]dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s後", - past : "%s前", - s : "数秒", - m : "1分", - mm : "%d分", - h : "1時間", - hh : "%d時間", - d : "1日", - dd : "%d日", - M : "1ヶ月", - MM : "%dヶ月", - y : "1年", - yy : "%d年" - } - }); -})); -// moment.js language configuration -// language : Georgian (ka) -// author : Irakli Janiashvili : https://github.com/irakli-janiashvili - -(function (factory) { - factory(moment); -}(function (moment) { - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') - }, - - nounCase = (/D[oD] *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - 'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_') - }, - - nounCase = (/(წინა|შემდეგ)/).test(format) ? - 'accusative' : - 'nominative'; - - return weekdays[nounCase][m.day()]; - } - - return moment.lang('ka', { - months : monthsCaseReplace, - monthsShort : "იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"), - weekdays : weekdaysCaseReplace, - weekdaysShort : "კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"), - weekdaysMin : "კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"), - longDateFormat : { - LT : "h:mm A", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[დღეს] LT[-ზე]', - nextDay : '[ხვალ] LT[-ზე]', - lastDay : '[გუშინ] LT[-ზე]', - nextWeek : '[შემდეგ] dddd LT[-ზე]', - lastWeek : '[წინა] dddd LT-ზე', - sameElse : 'L' - }, - relativeTime : { - future : function (s) { - return (/(წამი|წუთი|საათი|წელი)/).test(s) ? - s.replace(/ი$/, "ში") : - s + "ში"; - }, - past : function (s) { - if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) { - return s.replace(/(ი|ე)$/, "ის წინ"); - } - if ((/წელი/).test(s)) { - return s.replace(/წელი$/, "წლის წინ"); - } - }, - s : "რამდენიმე წამი", - m : "წუთი", - mm : "%d წუთი", - h : "საათი", - hh : "%d საათი", - d : "დღე", - dd : "%d დღე", - M : "თვე", - MM : "%d თვე", - y : "წელი", - yy : "%d წელი" - }, - ordinal : function (number) { - if (number === 0) { - return number; - } - - if (number === 1) { - return number + "-ლი"; - } - - if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) { - return "მე-" + number; - } - - return number + "-ე"; - }, - week : { - dow : 1, - doy : 7 - } - }); -})); -// moment.js language configuration -// language : khmer (km) -// author : Kruy Vanna : https://github.com/kruyvanna - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('km', { - months: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), - monthsShort: "មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"), - weekdays: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - weekdaysShort: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - weekdaysMin: "អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"), - longDateFormat: { - LT: "HH:mm", - L: "DD/MM/YYYY", - LL: "D MMMM YYYY", - LLL: "D MMMM YYYY LT", - LLLL: "dddd, D MMMM YYYY LT" - }, - calendar: { - sameDay: '[ថ្ងៃនៈ ម៉ោង] LT', - nextDay: '[ស្អែក ម៉ោង] LT', - nextWeek: 'dddd [ម៉ោង] LT', - lastDay: '[ម្សិលមិញ ម៉ោង] LT', - lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', - sameElse: 'L' - }, - relativeTime: { - future: "%sទៀត", - past: "%sមុន", - s: "ប៉ុន្មានវិនាទី", - m: "មួយនាទី", - mm: "%d នាទី", - h: "មួយម៉ោង", - hh: "%d ម៉ោង", - d: "មួយថ្ងៃ", - dd: "%d ថ្ងៃ", - M: "មួយខែ", - MM: "%d ខែ", - y: "មួយឆ្នាំ", - yy: "%d ឆ្នាំ" - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : korean (ko) -// -// authors -// -// - Kyungwook, Park : https://github.com/kyungw00k -// - Jeeeyul Lee -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('ko', { - months : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), - monthsShort : "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), - weekdays : "일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"), - weekdaysShort : "일_월_화_수_목_금_토".split("_"), - weekdaysMin : "일_월_화_수_목_금_토".split("_"), - longDateFormat : { - LT : "A h시 mm분", - L : "YYYY.MM.DD", - LL : "YYYY년 MMMM D일", - LLL : "YYYY년 MMMM D일 LT", - LLLL : "YYYY년 MMMM D일 dddd LT" - }, - meridiem : function (hour, minute, isUpper) { - return hour < 12 ? '오전' : '오후'; - }, - calendar : { - sameDay : '오늘 LT', - nextDay : '내일 LT', - nextWeek : 'dddd LT', - lastDay : '어제 LT', - lastWeek : '지난주 dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s 후", - past : "%s 전", - s : "몇초", - ss : "%d초", - m : "일분", - mm : "%d분", - h : "한시간", - hh : "%d시간", - d : "하루", - dd : "%d일", - M : "한달", - MM : "%d달", - y : "일년", - yy : "%d년" - }, - ordinal : '%d일', - meridiemParse : /(오전|오후)/, - isPM : function (token) { - return token === "오후"; - } - }); -})); -// moment.js language configuration -// language : Luxembourgish (lb) -// author : mweimerskirch : https://github.com/mweimerskirch - -// Note: Luxembourgish has a very particular phonological rule ("Eifeler Regel") that causes the -// deletion of the final "n" in certain contexts. That's what the "eifelerRegelAppliesToWeekday" -// and "eifelerRegelAppliesToNumber" methods are meant for - -(function (factory) { - factory(moment); -}(function (moment) { - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eng Minutt', 'enger Minutt'], - 'h': ['eng Stonn', 'enger Stonn'], - 'd': ['een Dag', 'engem Dag'], - 'dd': [number + ' Deeg', number + ' Deeg'], - 'M': ['ee Mount', 'engem Mount'], - 'MM': [number + ' Méint', number + ' Méint'], - 'y': ['ee Joer', 'engem Joer'], - 'yy': [number + ' Joer', number + ' Joer'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - function processFutureTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return "a " + string; - } - return "an " + string; - } - - function processPastTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return "viru " + string; - } - return "virun " + string; - } - - function processLastWeek(string1) { - var weekday = this.format('d'); - if (eifelerRegelAppliesToWeekday(weekday)) { - return '[Leschte] dddd [um] LT'; - } - return '[Leschten] dddd [um] LT'; - } - - /** - * Returns true if the word before the given week day loses the "-n" ending. - * e.g. "Leschten Dënschdeg" but "Leschte Méindeg" - * - * @param weekday {integer} - * @returns {boolean} - */ - function eifelerRegelAppliesToWeekday(weekday) { - weekday = parseInt(weekday, 10); - switch (weekday) { - case 0: // Sonndeg - case 1: // Méindeg - case 3: // Mëttwoch - case 5: // Freideg - case 6: // Samschdeg - return true; - default: // 2 Dënschdeg, 4 Donneschdeg - return false; - } - } - - /** - * Returns true if the word before the given number loses the "-n" ending. - * e.g. "an 10 Deeg" but "a 5 Deeg" - * - * @param number {integer} - * @returns {boolean} - */ - function eifelerRegelAppliesToNumber(number) { - number = parseInt(number, 10); - if (isNaN(number)) { - return false; - } - if (number < 0) { - // Negative Number --> always true - return true; - } else if (number < 10) { - // Only 1 digit - if (4 <= number && number <= 7) { - return true; - } - return false; - } else if (number < 100) { - // 2 digits - var lastDigit = number % 10, firstDigit = number / 10; - if (lastDigit === 0) { - return eifelerRegelAppliesToNumber(firstDigit); - } - return eifelerRegelAppliesToNumber(lastDigit); - } else if (number < 10000) { - // 3 or 4 digits --> recursively check first digit - while (number >= 10) { - number = number / 10; - } - return eifelerRegelAppliesToNumber(number); - } else { - // Anything larger than 4 digits: recursively check first n-3 digits - number = number / 1000; - return eifelerRegelAppliesToNumber(number); - } - } - - return moment.lang('lb', { - months: "Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), - monthsShort: "Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"), - weekdays: "Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"), - weekdaysShort: "So._Mé._Dë._Më._Do._Fr._Sa.".split("_"), - weekdaysMin: "So_Mé_Dë_Më_Do_Fr_Sa".split("_"), - longDateFormat: { - LT: "H:mm [Auer]", - L: "DD.MM.YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" - }, - calendar: { - sameDay: "[Haut um] LT", - sameElse: "L", - nextDay: '[Muer um] LT', - nextWeek: 'dddd [um] LT', - lastDay: '[Gëschter um] LT', - lastWeek: processLastWeek - }, - relativeTime: { - future: processFutureTime, - past: processPastTime, - s: "e puer Sekonnen", - m: processRelativeTime, - mm: "%d Minutten", - h: processRelativeTime, - hh: "%d Stonnen", - d: processRelativeTime, - dd: processRelativeTime, - M: processRelativeTime, - MM: processRelativeTime, - y: processRelativeTime, - yy: processRelativeTime - }, - ordinal: '%d.', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Lithuanian (lt) -// author : Mindaugas Mozūras : https://github.com/mmozuras - -(function (factory) { - factory(moment); -}(function (moment) { - var units = { - "m" : "minutė_minutės_minutę", - "mm": "minutės_minučių_minutes", - "h" : "valanda_valandos_valandą", - "hh": "valandos_valandų_valandas", - "d" : "diena_dienos_dieną", - "dd": "dienos_dienų_dienas", - "M" : "mėnuo_mėnesio_mėnesį", - "MM": "mėnesiai_mėnesių_mėnesius", - "y" : "metai_metų_metus", - "yy": "metai_metų_metus" - }, - weekDays = "pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis_sekmadienis".split("_"); - - function translateSeconds(number, withoutSuffix, key, isFuture) { - if (withoutSuffix) { - return "kelios sekundės"; - } else { - return isFuture ? "kelių sekundžių" : "kelias sekundes"; - } - } - - function translateSingular(number, withoutSuffix, key, isFuture) { - return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); - } - - function special(number) { - return number % 10 === 0 || (number > 10 && number < 20); - } - - function forms(key) { - return units[key].split("_"); - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - if (number === 1) { - return result + translateSingular(number, withoutSuffix, key[0], isFuture); - } else if (withoutSuffix) { - return result + (special(number) ? forms(key)[1] : forms(key)[0]); - } else { - if (isFuture) { - return result + forms(key)[1]; - } else { - return result + (special(number) ? forms(key)[1] : forms(key)[2]); - } - } - } - - function relativeWeekDay(moment, format) { - var nominative = format.indexOf('dddd HH:mm') === -1, - weekDay = weekDays[moment.weekday()]; - - return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + "į"; - } - - return moment.lang("lt", { - months : "sausio_vasario_kovo_balandžio_gegužės_biržėlio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"), - monthsShort : "sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"), - weekdays : relativeWeekDay, - weekdaysShort : "Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"), - weekdaysMin : "S_P_A_T_K_Pn_Š".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "YYYY [m.] MMMM D [d.]", - LLL : "YYYY [m.] MMMM D [d.], LT [val.]", - LLLL : "YYYY [m.] MMMM D [d.], dddd, LT [val.]", - l : "YYYY-MM-DD", - ll : "YYYY [m.] MMMM D [d.]", - lll : "YYYY [m.] MMMM D [d.], LT [val.]", - llll : "YYYY [m.] MMMM D [d.], ddd, LT [val.]" - }, - calendar : { - sameDay : "[Šiandien] LT", - nextDay : "[Rytoj] LT", - nextWeek : "dddd LT", - lastDay : "[Vakar] LT", - lastWeek : "[Praėjusį] dddd LT", - sameElse : "L" - }, - relativeTime : { - future : "po %s", - past : "prieš %s", - s : translateSeconds, - m : translateSingular, - mm : translate, - h : translateSingular, - hh : translate, - d : translateSingular, - dd : translate, - M : translateSingular, - MM : translate, - y : translateSingular, - yy : translate - }, - ordinal : function (number) { - return number + '-oji'; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : latvian (lv) -// author : Kristaps Karlsons : https://github.com/skakri - -(function (factory) { - factory(moment); -}(function (moment) { - var units = { - 'mm': 'minūti_minūtes_minūte_minūtes', - 'hh': 'stundu_stundas_stunda_stundas', - 'dd': 'dienu_dienas_diena_dienas', - 'MM': 'mēnesi_mēnešus_mēnesis_mēneši', - 'yy': 'gadu_gadus_gads_gadi' - }; - - function format(word, number, withoutSuffix) { - var forms = word.split('_'); - if (withoutSuffix) { - return number % 10 === 1 && number !== 11 ? forms[2] : forms[3]; - } else { - return number % 10 === 1 && number !== 11 ? forms[0] : forms[1]; - } - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - return number + ' ' + format(units[key], number, withoutSuffix); - } - - return moment.lang('lv', { - months : "janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"), - weekdays : "svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"), - weekdaysShort : "Sv_P_O_T_C_Pk_S".split("_"), - weekdaysMin : "Sv_P_O_T_C_Pk_S".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "YYYY. [gada] D. MMMM", - LLL : "YYYY. [gada] D. MMMM, LT", - LLLL : "YYYY. [gada] D. MMMM, dddd, LT" - }, - calendar : { - sameDay : '[Šodien pulksten] LT', - nextDay : '[Rīt pulksten] LT', - nextWeek : 'dddd [pulksten] LT', - lastDay : '[Vakar pulksten] LT', - lastWeek : '[Pagājušā] dddd [pulksten] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s vēlāk", - past : "%s agrāk", - s : "dažas sekundes", - m : "minūti", - mm : relativeTimeWithPlural, - h : "stundu", - hh : relativeTimeWithPlural, - d : "dienu", - dd : relativeTimeWithPlural, - M : "mēnesi", - MM : relativeTimeWithPlural, - y : "gadu", - yy : relativeTimeWithPlural - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : macedonian (mk) -// author : Borislav Mickov : https://github.com/B0k0 - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('mk', { - months : "јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"), - monthsShort : "јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"), - weekdays : "недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"), - weekdaysShort : "нед_пон_вто_сре_чет_пет_саб".split("_"), - weekdaysMin : "нe_пo_вт_ср_че_пе_сa".split("_"), - longDateFormat : { - LT : "H:mm", - L : "D.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Денес во] LT', - nextDay : '[Утре во] LT', - nextWeek : 'dddd [во] LT', - lastDay : '[Вчера во] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[Во изминатата] dddd [во] LT'; - case 1: - case 2: - case 4: - case 5: - return '[Во изминатиот] dddd [во] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "после %s", - past : "пред %s", - s : "неколку секунди", - m : "минута", - mm : "%d минути", - h : "час", - hh : "%d часа", - d : "ден", - dd : "%d дена", - M : "месец", - MM : "%d месеци", - y : "година", - yy : "%d години" - }, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : malayalam (ml) -// author : Floyd Pink : https://github.com/floydpink - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('ml', { - months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split("_"), - monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split("_"), - weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split("_"), - weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split("_"), - weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split("_"), - longDateFormat : { - LT : "A h:mm -നു", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[ഇന്ന്] LT', - nextDay : '[നാളെ] LT', - nextWeek : 'dddd, LT', - lastDay : '[ഇന്നലെ] LT', - lastWeek : '[കഴിഞ്ഞ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s കഴിഞ്ഞ്", - past : "%s മുൻപ്", - s : "അൽപ നിമിഷങ്ങൾ", - m : "ഒരു മിനിറ്റ്", - mm : "%d മിനിറ്റ്", - h : "ഒരു മണിക്കൂർ", - hh : "%d മണിക്കൂർ", - d : "ഒരു ദിവസം", - dd : "%d ദിവസം", - M : "ഒരു മാസം", - MM : "%d മാസം", - y : "ഒരു വർഷം", - yy : "%d വർഷം" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "രാത്രി"; - } else if (hour < 12) { - return "രാവിലെ"; - } else if (hour < 17) { - return "ഉച്ച കഴിഞ്ഞ്"; - } else if (hour < 20) { - return "വൈകുന്നേരം"; - } else { - return "രാത്രി"; - } - } - }); -})); -// moment.js language configuration -// language : Marathi (mr) -// author : Harshad Kale : https://github.com/kalehv - -(function (factory) { - factory(moment); -}(function (moment) { - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - return moment.lang('mr', { - months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split("_"), - monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split("_"), - weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split("_"), - weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split("_"), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split("_"), - longDateFormat : { - LT : "A h:mm वाजता", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[उद्या] LT', - nextWeek : 'dddd, LT', - lastDay : '[काल] LT', - lastWeek: '[मागील] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s नंतर", - past : "%s पूर्वी", - s : "सेकंद", - m: "एक मिनिट", - mm: "%d मिनिटे", - h : "एक तास", - hh : "%d तास", - d : "एक दिवस", - dd : "%d दिवस", - M : "एक महिना", - MM : "%d महिने", - y : "एक वर्ष", - yy : "%d वर्षे" - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiem: function (hour, minute, isLower) - { - if (hour < 4) { - return "रात्री"; - } else if (hour < 10) { - return "सकाळी"; - } else if (hour < 17) { - return "दुपारी"; - } else if (hour < 20) { - return "सायंकाळी"; - } else { - return "रात्री"; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Bahasa Malaysia (ms-MY) -// author : Weldan Jamili : https://github.com/weldan - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('ms-my', { - months : "Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"), - monthsShort : "Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"), - weekdays : "Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"), - weekdaysShort : "Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"), - weekdaysMin : "Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"), - longDateFormat : { - LT : "HH.mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY [pukul] LT", - LLLL : "dddd, D MMMM YYYY [pukul] LT" - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'tengahari'; - } else if (hours < 19) { - return 'petang'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Esok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kelmarin pukul] LT', - lastWeek : 'dddd [lepas pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : "dalam %s", - past : "%s yang lepas", - s : "beberapa saat", - m : "seminit", - mm : "%d minit", - h : "sejam", - hh : "%d jam", - d : "sehari", - dd : "%d hari", - M : "sebulan", - MM : "%d bulan", - y : "setahun", - yy : "%d tahun" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : norwegian bokmål (nb) -// authors : Espen Hovlandsdal : https://github.com/rexxars -// Sigurd Gartmann : https://github.com/sigurdga - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('nb', { - months : "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"), - weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"), - weekdaysShort : "sø._ma._ti._on._to._fr._lø.".split("_"), - weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"), - longDateFormat : { - LT : "H.mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY [kl.] LT", - LLLL : "dddd D. MMMM YYYY [kl.] LT" - }, - calendar : { - sameDay: '[i dag kl.] LT', - nextDay: '[i morgen kl.] LT', - nextWeek: 'dddd [kl.] LT', - lastDay: '[i går kl.] LT', - lastWeek: '[forrige] dddd [kl.] LT', - sameElse: 'L' - }, - relativeTime : { - future : "om %s", - past : "for %s siden", - s : "noen sekunder", - m : "ett minutt", - mm : "%d minutter", - h : "en time", - hh : "%d timer", - d : "en dag", - dd : "%d dager", - M : "en måned", - MM : "%d måneder", - y : "ett år", - yy : "%d år" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : nepali/nepalese -// author : suvash : https://github.com/suvash - -(function (factory) { - factory(moment); -}(function (moment) { - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - return moment.lang('ne', { - months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split("_"), - monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split("_"), - weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split("_"), - weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split("_"), - weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split("_"), - longDateFormat : { - LT : "Aको h:mm बजे", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 3) { - return "राती"; - } else if (hour < 10) { - return "बिहान"; - } else if (hour < 15) { - return "दिउँसो"; - } else if (hour < 18) { - return "बेलुका"; - } else if (hour < 20) { - return "साँझ"; - } else { - return "राती"; - } - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[भोली] LT', - nextWeek : '[आउँदो] dddd[,] LT', - lastDay : '[हिजो] LT', - lastWeek : '[गएको] dddd[,] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%sमा", - past : "%s अगाडी", - s : "केही समय", - m : "एक मिनेट", - mm : "%d मिनेट", - h : "एक घण्टा", - hh : "%d घण्टा", - d : "एक दिन", - dd : "%d दिन", - M : "एक महिना", - MM : "%d महिना", - y : "एक बर्ष", - yy : "%d बर्ष" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : dutch (nl) -// author : Joris Röling : https://github.com/jjupiter - -(function (factory) { - factory(moment); -}(function (moment) { - var monthsShortWithDots = "jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"), - monthsShortWithoutDots = "jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"); - - return moment.lang('nl', { - months : "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShortWithoutDots[m.month()]; - } else { - return monthsShortWithDots[m.month()]; - } - }, - weekdays : "zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"), - weekdaysShort : "zo._ma._di._wo._do._vr._za.".split("_"), - weekdaysMin : "Zo_Ma_Di_Wo_Do_Vr_Za".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD-MM-YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: '[vandaag om] LT', - nextDay: '[morgen om] LT', - nextWeek: 'dddd [om] LT', - lastDay: '[gisteren om] LT', - lastWeek: '[afgelopen] dddd [om] LT', - sameElse: 'L' - }, - relativeTime : { - future : "over %s", - past : "%s geleden", - s : "een paar seconden", - m : "één minuut", - mm : "%d minuten", - h : "één uur", - hh : "%d uur", - d : "één dag", - dd : "%d dagen", - M : "één maand", - MM : "%d maanden", - y : "één jaar", - yy : "%d jaar" - }, - ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : norwegian nynorsk (nn) -// author : https://github.com/mechuwind - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('nn', { - months : "januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"), - monthsShort : "jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"), - weekdays : "sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"), - weekdaysShort : "sun_mån_tys_ons_tor_fre_lau".split("_"), - weekdaysMin : "su_må_ty_on_to_fr_lø".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: '[I dag klokka] LT', - nextDay: '[I morgon klokka] LT', - nextWeek: 'dddd [klokka] LT', - lastDay: '[I går klokka] LT', - lastWeek: '[Føregåande] dddd [klokka] LT', - sameElse: 'L' - }, - relativeTime : { - future : "om %s", - past : "for %s sidan", - s : "nokre sekund", - m : "eit minutt", - mm : "%d minutt", - h : "ein time", - hh : "%d timar", - d : "ein dag", - dd : "%d dagar", - M : "ein månad", - MM : "%d månader", - y : "eit år", - yy : "%d år" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : polish (pl) -// author : Rafal Hirsz : https://github.com/evoL - -(function (factory) { - factory(moment); -}(function (moment) { - var monthsNominative = "styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"), - monthsSubjective = "stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"); - - function plural(n) { - return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1); - } - - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'minuta' : 'minutę'; - case 'mm': - return result + (plural(number) ? 'minuty' : 'minut'); - case 'h': - return withoutSuffix ? 'godzina' : 'godzinę'; - case 'hh': - return result + (plural(number) ? 'godziny' : 'godzin'); - case 'MM': - return result + (plural(number) ? 'miesiące' : 'miesięcy'); - case 'yy': - return result + (plural(number) ? 'lata' : 'lat'); - } - } - - return moment.lang('pl', { - months : function (momentToFormat, format) { - if (/D MMMM/.test(format)) { - return monthsSubjective[momentToFormat.month()]; - } else { - return monthsNominative[momentToFormat.month()]; - } - }, - monthsShort : "sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"), - weekdays : "niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"), - weekdaysShort : "nie_pon_wt_śr_czw_pt_sb".split("_"), - weekdaysMin : "N_Pn_Wt_Śr_Cz_Pt_So".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay: '[Dziś o] LT', - nextDay: '[Jutro o] LT', - nextWeek: '[W] dddd [o] LT', - lastDay: '[Wczoraj o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[W zeszłą niedzielę o] LT'; - case 3: - return '[W zeszłą środę o] LT'; - case 6: - return '[W zeszłą sobotę o] LT'; - default: - return '[W zeszły] dddd [o] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "za %s", - past : "%s temu", - s : "kilka sekund", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "1 dzień", - dd : '%d dni', - M : "miesiąc", - MM : translate, - y : "rok", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : brazilian portuguese (pt-br) -// author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('pt-br', { - months : "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), - monthsShort : "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), - weekdays : "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), - weekdaysShort : "dom_seg_ter_qua_qui_sex_sáb".split("_"), - weekdaysMin : "dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [de] YYYY", - LLL : "D [de] MMMM [de] YYYY [às] LT", - LLLL : "dddd, D [de] MMMM [de] YYYY [às] LT" - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : "em %s", - past : "%s atrás", - s : "segundos", - m : "um minuto", - mm : "%d minutos", - h : "uma hora", - hh : "%d horas", - d : "um dia", - dd : "%d dias", - M : "um mês", - MM : "%d meses", - y : "um ano", - yy : "%d anos" - }, - ordinal : '%dº' - }); -})); -// moment.js language configuration -// language : portuguese (pt) -// author : Jefferson : https://github.com/jalex79 - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('pt', { - months : "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), - monthsShort : "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), - weekdays : "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), - weekdaysShort : "dom_seg_ter_qua_qui_sex_sáb".split("_"), - weekdaysMin : "dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D [de] MMMM [de] YYYY", - LLL : "D [de] MMMM [de] YYYY LT", - LLLL : "dddd, D [de] MMMM [de] YYYY LT" - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : "em %s", - past : "%s atrás", - s : "segundos", - m : "um minuto", - mm : "%d minutos", - h : "uma hora", - hh : "%d horas", - d : "um dia", - dd : "%d dias", - M : "um mês", - MM : "%d meses", - y : "um ano", - yy : "%d anos" - }, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : romanian (ro) -// author : Vlad Gurdiga : https://github.com/gurdiga -// author : Valentin Agachi : https://github.com/avaly - -(function (factory) { - factory(moment); -}(function (moment) { - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': 'minute', - 'hh': 'ore', - 'dd': 'zile', - 'MM': 'luni', - 'yy': 'ani' - }, - separator = ' '; - if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) { - separator = ' de '; - } - - return number + separator + format[key]; - } - - return moment.lang('ro', { - months : "ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"), - monthsShort : "ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"), - weekdays : "duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"), - weekdaysShort : "Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"), - weekdaysMin : "Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY H:mm", - LLLL : "dddd, D MMMM YYYY H:mm" - }, - calendar : { - sameDay: "[azi la] LT", - nextDay: '[mâine la] LT', - nextWeek: 'dddd [la] LT', - lastDay: '[ieri la] LT', - lastWeek: '[fosta] dddd [la] LT', - sameElse: 'L' - }, - relativeTime : { - future : "peste %s", - past : "%s în urmă", - s : "câteva secunde", - m : "un minut", - mm : relativeTimeWithPlural, - h : "o oră", - hh : relativeTimeWithPlural, - d : "o zi", - dd : relativeTimeWithPlural, - M : "o lună", - MM : relativeTimeWithPlural, - y : "un an", - yy : relativeTimeWithPlural - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : russian (ru) -// author : Viktorminator : https://github.com/Viktorminator -// Author : Menelion Elensúle : https://github.com/Oire - -(function (factory) { - factory(moment); -}(function (moment) { - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', - 'hh': 'час_часа_часов', - 'dd': 'день_дня_дней', - 'MM': 'месяц_месяца_месяцев', - 'yy': 'год_года_лет' - }; - if (key === 'm') { - return withoutSuffix ? 'минута' : 'минуту'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function monthsShortCaseReplace(m, format) { - var monthsShort = { - 'nominative': 'янв_фев_мар_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_') - }, - - nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return monthsShort[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_') - }, - - nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/).test(format) ? - 'accusative' : - 'nominative'; - - return weekdays[nounCase][m.day()]; - } - - return moment.lang('ru', { - months : monthsCaseReplace, - monthsShort : monthsShortCaseReplace, - weekdays : weekdaysCaseReplace, - weekdaysShort : "вс_пн_вт_ср_чт_пт_сб".split("_"), - weekdaysMin : "вс_пн_вт_ср_чт_пт_сб".split("_"), - monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i], - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY г.", - LLL : "D MMMM YYYY г., LT", - LLLL : "dddd, D MMMM YYYY г., LT" - }, - calendar : { - sameDay: '[Сегодня в] LT', - nextDay: '[Завтра в] LT', - lastDay: '[Вчера в] LT', - nextWeek: function () { - return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT'; - }, - lastWeek: function () { - switch (this.day()) { - case 0: - return '[В прошлое] dddd [в] LT'; - case 1: - case 2: - case 4: - return '[В прошлый] dddd [в] LT'; - case 3: - case 5: - case 6: - return '[В прошлую] dddd [в] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "через %s", - past : "%s назад", - s : "несколько секунд", - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : "час", - hh : relativeTimeWithPlural, - d : "день", - dd : relativeTimeWithPlural, - M : "месяц", - MM : relativeTimeWithPlural, - y : "год", - yy : relativeTimeWithPlural - }, - - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "ночи"; - } else if (hour < 12) { - return "утра"; - } else if (hour < 17) { - return "дня"; - } else { - return "вечера"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - return number + '-й'; - case 'D': - return number + '-го'; - case 'w': - case 'W': - return number + '-я'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : slovak (sk) -// author : Martin Minka : https://github.com/k2s -// based on work of petrbela : https://github.com/petrbela - -(function (factory) { - factory(moment); -}(function (moment) { - var months = "január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"), - monthsShort = "jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"); - - function plural(n) { - return (n > 1) && (n < 5); - } - - function translate(number, withoutSuffix, key, isFuture) { - var result = number + " "; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minúty' : 'minút'); - } else { - return result + 'minútami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodín'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'deň' : 'dňom'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dni' : 'dní'); - } else { - return result + 'dňami'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'mesiace' : 'mesiacov'); - } else { - return result + 'mesiacmi'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokom'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'rokov'); - } else { - return result + 'rokmi'; - } - break; - } - } - - return moment.lang('sk', { - months : months, - monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), - weekdays : "nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"), - weekdaysShort : "ne_po_ut_st_št_pi_so".split("_"), - weekdaysMin : "ne_po_ut_st_št_pi_so".split("_"), - longDateFormat : { - LT: "H:mm", - L : "DD.MM.YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd D. MMMM YYYY LT" - }, - calendar : { - sameDay: "[dnes o] LT", - nextDay: '[zajtra o] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v nedeľu o] LT'; - case 1: - case 2: - return '[v] dddd [o] LT'; - case 3: - return '[v stredu o] LT'; - case 4: - return '[vo štvrtok o] LT'; - case 5: - return '[v piatok o] LT'; - case 6: - return '[v sobotu o] LT'; - } - }, - lastDay: '[včera o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulú nedeľu o] LT'; - case 1: - case 2: - return '[minulý] dddd [o] LT'; - case 3: - return '[minulú stredu o] LT'; - case 4: - case 5: - return '[minulý] dddd [o] LT'; - case 6: - return '[minulú sobotu o] LT'; - } - }, - sameElse: "L" - }, - relativeTime : { - future : "za %s", - past : "pred %s", - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : slovenian (sl) -// author : Robert Sedovšek : https://github.com/sedovsek - -(function (factory) { - factory(moment); -}(function (moment) { - function translate(number, withoutSuffix, key) { - var result = number + " "; - switch (key) { - case 'm': - return withoutSuffix ? 'ena minuta' : 'eno minuto'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2) { - result += 'minuti'; - } else if (number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minut'; - } - return result; - case 'h': - return withoutSuffix ? 'ena ura' : 'eno uro'; - case 'hh': - if (number === 1) { - result += 'ura'; - } else if (number === 2) { - result += 'uri'; - } else if (number === 3 || number === 4) { - result += 'ure'; - } else { - result += 'ur'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dni'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mesec'; - } else if (number === 2) { - result += 'meseca'; - } else if (number === 3 || number === 4) { - result += 'mesece'; - } else { - result += 'mesecev'; - } - return result; - case 'yy': - if (number === 1) { - result += 'leto'; - } else if (number === 2) { - result += 'leti'; - } else if (number === 3 || number === 4) { - result += 'leta'; - } else { - result += 'let'; - } - return result; - } - } - - return moment.lang('sl', { - months : "januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"), - monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"), - weekdays : "nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"), - weekdaysShort : "ned._pon._tor._sre._čet._pet._sob.".split("_"), - weekdaysMin : "ne_po_to_sr_če_pe_so".split("_"), - longDateFormat : { - LT : "H:mm", - L : "DD. MM. YYYY", - LL : "D. MMMM YYYY", - LLL : "D. MMMM YYYY LT", - LLLL : "dddd, D. MMMM YYYY LT" - }, - calendar : { - sameDay : '[danes ob] LT', - nextDay : '[jutri ob] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[v] [nedeljo] [ob] LT'; - case 3: - return '[v] [sredo] [ob] LT'; - case 6: - return '[v] [soboto] [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[v] dddd [ob] LT'; - } - }, - lastDay : '[včeraj ob] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[prejšnja] dddd [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prejšnji] dddd [ob] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : "čez %s", - past : "%s nazaj", - s : "nekaj sekund", - m : translate, - mm : translate, - h : translate, - hh : translate, - d : "en dan", - dd : translate, - M : "en mesec", - MM : translate, - y : "eno leto", - yy : translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Albanian (sq) -// author : Flakërim Ismani : https://github.com/flakerimi -// author: Menelion Elensúle: https://github.com/Oire (tests) -// author : Oerd Cukalla : https://github.com/oerd (fixes) - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('sq', { - months : "Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"), - monthsShort : "Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"), - weekdays : "E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"), - weekdaysShort : "Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"), - weekdaysMin : "D_H_Ma_Më_E_P_Sh".split("_"), - meridiem : function (hours, minutes, isLower) { - return hours < 12 ? 'PD' : 'MD'; - }, - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[Sot në] LT', - nextDay : '[Nesër në] LT', - nextWeek : 'dddd [në] LT', - lastDay : '[Dje në] LT', - lastWeek : 'dddd [e kaluar në] LT', - sameElse : 'L' - }, - relativeTime : { - future : "në %s", - past : "%s më parë", - s : "disa sekonda", - m : "një minutë", - mm : "%d minuta", - h : "një orë", - hh : "%d orë", - d : "një ditë", - dd : "%d ditë", - M : "një muaj", - MM : "%d muaj", - y : "një vit", - yy : "%d vite" - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Serbian-cyrillic (sr-cyr) -// author : Milan Janačković : https://github.com/milan-j - -(function (factory) { - factory(moment); -}(function (moment) { - - var translator = { - words: { //Different grammatical cases - m: ['један минут', 'једне минуте'], - mm: ['минут', 'минуте', 'минута'], - h: ['један сат', 'једног сата'], - hh: ['сат', 'сата', 'сати'], - dd: ['дан', 'дана', 'дана'], - MM: ['месец', 'месеца', 'месеци'], - yy: ['година', 'године', 'година'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - return moment.lang('sr-cyr', { - months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], - monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], - weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], - weekdaysShort: ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], - weekdaysMin: ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], - longDateFormat: { - LT: "H:mm", - L: "DD. MM. YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" - }, - calendar: { - sameDay: '[данас у] LT', - nextDay: '[сутра у] LT', - - nextWeek: function () { - switch (this.day()) { - case 0: - return '[у] [недељу] [у] LT'; - case 3: - return '[у] [среду] [у] LT'; - case 6: - return '[у] [суботу] [у] LT'; - case 1: - case 2: - case 4: - case 5: - return '[у] dddd [у] LT'; - } - }, - lastDay : '[јуче у] LT', - lastWeek : function () { - var lastWeekDays = [ - '[прошле] [недеље] [у] LT', - '[прошлог] [понедељка] [у] LT', - '[прошлог] [уторка] [у] LT', - '[прошле] [среде] [у] LT', - '[прошлог] [четвртка] [у] LT', - '[прошлог] [петка] [у] LT', - '[прошле] [суботе] [у] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : "за %s", - past : "пре %s", - s : "неколико секунди", - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : "дан", - dd : translator.translate, - M : "месец", - MM : translator.translate, - y : "годину", - yy : translator.translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Serbian-latin (sr) -// author : Milan Janačković : https://github.com/milan-j - -(function (factory) { - factory(moment); -}(function (moment) { - - var translator = { - words: { //Different grammatical cases - m: ['jedan minut', 'jedne minute'], - mm: ['minut', 'minute', 'minuta'], - h: ['jedan sat', 'jednog sata'], - hh: ['sat', 'sata', 'sati'], - dd: ['dan', 'dana', 'dana'], - MM: ['mesec', 'meseca', 'meseci'], - yy: ['godina', 'godine', 'godina'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - return moment.lang('sr', { - months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], - monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], - weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], - weekdaysShort: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], - weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], - longDateFormat: { - LT: "H:mm", - L: "DD. MM. YYYY", - LL: "D. MMMM YYYY", - LLL: "D. MMMM YYYY LT", - LLLL: "dddd, D. MMMM YYYY LT" - }, - calendar: { - sameDay: '[danas u] LT', - nextDay: '[sutra u] LT', - - nextWeek: function () { - switch (this.day()) { - case 0: - return '[u] [nedelju] [u] LT'; - case 3: - return '[u] [sredu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[juče u] LT', - lastWeek : function () { - var lastWeekDays = [ - '[prošle] [nedelje] [u] LT', - '[prošlog] [ponedeljka] [u] LT', - '[prošlog] [utorka] [u] LT', - '[prošle] [srede] [u] LT', - '[prošlog] [četvrtka] [u] LT', - '[prošlog] [petka] [u] LT', - '[prošle] [subote] [u] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : "za %s", - past : "pre %s", - s : "nekoliko sekundi", - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : "dan", - dd : translator.translate, - M : "mesec", - MM : translator.translate, - y : "godinu", - yy : translator.translate - }, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : swedish (sv) -// author : Jens Alm : https://github.com/ulmus - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('sv', { - months : "januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"), - monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), - weekdays : "söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"), - weekdaysShort : "sön_mån_tis_ons_tor_fre_lör".split("_"), - weekdaysMin : "sö_må_ti_on_to_fr_lö".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "YYYY-MM-DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: '[Idag] LT', - nextDay: '[Imorgon] LT', - lastDay: '[Igår] LT', - nextWeek: 'dddd LT', - lastWeek: '[Förra] dddd[en] LT', - sameElse: 'L' - }, - relativeTime : { - future : "om %s", - past : "för %s sedan", - s : "några sekunder", - m : "en minut", - mm : "%d minuter", - h : "en timme", - hh : "%d timmar", - d : "en dag", - dd : "%d dagar", - M : "en månad", - MM : "%d månader", - y : "ett år", - yy : "%d år" - }, - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'e' : - (b === 1) ? 'a' : - (b === 2) ? 'a' : - (b === 3) ? 'e' : 'e'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : tamil (ta) -// author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 - -(function (factory) { - factory(moment); -}(function (moment) { - /*var symbolMap = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦' - }, - numberMap = { - '௧': '1', - '௨': '2', - '௩': '3', - '௪': '4', - '௫': '5', - '௬': '6', - '௭': '7', - '௮': '8', - '௯': '9', - '௦': '0' - }; */ - - return moment.lang('ta', { - months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split("_"), - monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split("_"), - weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split("_"), - weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split("_"), - weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY, LT", - LLLL : "dddd, D MMMM YYYY, LT" - }, - calendar : { - sameDay : '[இன்று] LT', - nextDay : '[நாளை] LT', - nextWeek : 'dddd, LT', - lastDay : '[நேற்று] LT', - lastWeek : '[கடந்த வாரம்] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s இல்", - past : "%s முன்", - s : "ஒரு சில விநாடிகள்", - m : "ஒரு நிமிடம்", - mm : "%d நிமிடங்கள்", - h : "ஒரு மணி நேரம்", - hh : "%d மணி நேரம்", - d : "ஒரு நாள்", - dd : "%d நாட்கள்", - M : "ஒரு மாதம்", - MM : "%d மாதங்கள்", - y : "ஒரு வருடம்", - yy : "%d ஆண்டுகள்" - }, -/* preparse: function (string) { - return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - },*/ - ordinal : function (number) { - return number + 'வது'; - }, - - -// refer http://ta.wikipedia.org/s/1er1 - - meridiem : function (hour, minute, isLower) { - if (hour >= 6 && hour <= 10) { - return " காலை"; - } else if (hour >= 10 && hour <= 14) { - return " நண்பகல்"; - } else if (hour >= 14 && hour <= 18) { - return " எற்பாடு"; - } else if (hour >= 18 && hour <= 20) { - return " மாலை"; - } else if (hour >= 20 && hour <= 24) { - return " இரவு"; - } else if (hour >= 0 && hour <= 6) { - return " வைகறை"; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : thai (th) -// author : Kridsada Thanabulpong : https://github.com/sirn - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('th', { - months : "มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"), - monthsShort : "มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"), - weekdays : "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"), - weekdaysShort : "อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"), // yes, three characters difference - weekdaysMin : "อา._จ._อ._พ._พฤ._ศ._ส.".split("_"), - longDateFormat : { - LT : "H นาฬิกา m นาที", - L : "YYYY/MM/DD", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY เวลา LT", - LLLL : "วันddddที่ D MMMM YYYY เวลา LT" - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return "ก่อนเที่ยง"; - } else { - return "หลังเที่ยง"; - } - }, - calendar : { - sameDay : '[วันนี้ เวลา] LT', - nextDay : '[พรุ่งนี้ เวลา] LT', - nextWeek : 'dddd[หน้า เวลา] LT', - lastDay : '[เมื่อวานนี้ เวลา] LT', - lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT', - sameElse : 'L' - }, - relativeTime : { - future : "อีก %s", - past : "%sที่แล้ว", - s : "ไม่กี่วินาที", - m : "1 นาที", - mm : "%d นาที", - h : "1 ชั่วโมง", - hh : "%d ชั่วโมง", - d : "1 วัน", - dd : "%d วัน", - M : "1 เดือน", - MM : "%d เดือน", - y : "1 ปี", - yy : "%d ปี" - } - }); -})); -// moment.js language configuration -// language : Tagalog/Filipino (tl-ph) -// author : Dan Hagman - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('tl-ph', { - months : "Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"), - monthsShort : "Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"), - weekdays : "Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"), - weekdaysShort : "Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"), - weekdaysMin : "Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "MM/D/YYYY", - LL : "MMMM D, YYYY", - LLL : "MMMM D, YYYY LT", - LLLL : "dddd, MMMM DD, YYYY LT" - }, - calendar : { - sameDay: "[Ngayon sa] LT", - nextDay: '[Bukas sa] LT', - nextWeek: 'dddd [sa] LT', - lastDay: '[Kahapon sa] LT', - lastWeek: 'dddd [huling linggo] LT', - sameElse: 'L' - }, - relativeTime : { - future : "sa loob ng %s", - past : "%s ang nakalipas", - s : "ilang segundo", - m : "isang minuto", - mm : "%d minuto", - h : "isang oras", - hh : "%d oras", - d : "isang araw", - dd : "%d araw", - M : "isang buwan", - MM : "%d buwan", - y : "isang taon", - yy : "%d taon" - }, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : turkish (tr) -// authors : Erhan Gundogan : https://github.com/erhangundogan, -// Burak Yiğit Kaya: https://github.com/BYK - -(function (factory) { - factory(moment); -}(function (moment) { - - var suffixes = { - 1: "'inci", - 5: "'inci", - 8: "'inci", - 70: "'inci", - 80: "'inci", - - 2: "'nci", - 7: "'nci", - 20: "'nci", - 50: "'nci", - - 3: "'üncü", - 4: "'üncü", - 100: "'üncü", - - 6: "'ncı", - - 9: "'uncu", - 10: "'uncu", - 30: "'uncu", - - 60: "'ıncı", - 90: "'ıncı" - }; - - return moment.lang('tr', { - months : "Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"), - monthsShort : "Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"), - weekdays : "Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"), - weekdaysShort : "Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"), - weekdaysMin : "Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd, D MMMM YYYY LT" - }, - calendar : { - sameDay : '[bugün saat] LT', - nextDay : '[yarın saat] LT', - nextWeek : '[haftaya] dddd [saat] LT', - lastDay : '[dün] LT', - lastWeek : '[geçen hafta] dddd [saat] LT', - sameElse : 'L' - }, - relativeTime : { - future : "%s sonra", - past : "%s önce", - s : "birkaç saniye", - m : "bir dakika", - mm : "%d dakika", - h : "bir saat", - hh : "%d saat", - d : "bir gün", - dd : "%d gün", - M : "bir ay", - MM : "%d ay", - y : "bir yıl", - yy : "%d yıl" - }, - ordinal : function (number) { - if (number === 0) { // special case for zero - return number + "'ıncı"; - } - var a = number % 10, - b = number % 100 - a, - c = number >= 100 ? 100 : null; - - return number + (suffixes[a] || suffixes[b] || suffixes[c]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Morocco Central Atlas Tamaziɣt in Latin (tzm-la) -// author : Abdel Said : https://github.com/abdelsaid - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('tzm-la', { - months : "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), - monthsShort : "innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"), - weekdays : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - weekdaysShort : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - weekdaysMin : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[asdkh g] LT", - nextDay: '[aska g] LT', - nextWeek: 'dddd [g] LT', - lastDay: '[assant g] LT', - lastWeek: 'dddd [g] LT', - sameElse: 'L' - }, - relativeTime : { - future : "dadkh s yan %s", - past : "yan %s", - s : "imik", - m : "minuḍ", - mm : "%d minuḍ", - h : "saɛa", - hh : "%d tassaɛin", - d : "ass", - dd : "%d ossan", - M : "ayowr", - MM : "%d iyyirn", - y : "asgas", - yy : "%d isgasn" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : Morocco Central Atlas Tamaziɣt (tzm) -// author : Abdel Said : https://github.com/abdelsaid - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('tzm', { - months : "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), - monthsShort : "ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"), - weekdays : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - weekdaysShort : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - weekdaysMin : "ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D MMMM YYYY LT" - }, - calendar : { - sameDay: "[ⴰⵙⴷⵅ ⴴ] LT", - nextDay: '[ⴰⵙⴽⴰ ⴴ] LT', - nextWeek: 'dddd [ⴴ] LT', - lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT', - lastWeek: 'dddd [ⴴ] LT', - sameElse: 'L' - }, - relativeTime : { - future : "ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s", - past : "ⵢⴰⵏ %s", - s : "ⵉⵎⵉⴽ", - m : "ⵎⵉⵏⵓⴺ", - mm : "%d ⵎⵉⵏⵓⴺ", - h : "ⵙⴰⵄⴰ", - hh : "%d ⵜⴰⵙⵙⴰⵄⵉⵏ", - d : "ⴰⵙⵙ", - dd : "%d oⵙⵙⴰⵏ", - M : "ⴰⵢoⵓⵔ", - MM : "%d ⵉⵢⵢⵉⵔⵏ", - y : "ⴰⵙⴳⴰⵙ", - yy : "%d ⵉⵙⴳⴰⵙⵏ" - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : ukrainian (uk) -// author : zemlanin : https://github.com/zemlanin -// Author : Menelion Elensúle : https://github.com/Oire - -(function (factory) { - factory(moment); -}(function (moment) { - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': 'хвилина_хвилини_хвилин', - 'hh': 'година_години_годин', - 'dd': 'день_дні_днів', - 'MM': 'місяць_місяці_місяців', - 'yy': 'рік_роки_років' - }; - if (key === 'm') { - return withoutSuffix ? 'хвилина' : 'хвилину'; - } - else if (key === 'h') { - return withoutSuffix ? 'година' : 'годину'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - - function monthsCaseReplace(m, format) { - var months = { - 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'), - 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_') - }, - - nounCase = (/D[oD]? *MMMM?/).test(format) ? - 'accusative' : - 'nominative'; - - return months[nounCase][m.month()]; - } - - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), - 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'), - 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_') - }, - - nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ? - 'accusative' : - ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ? - 'genitive' : - 'nominative'); - - return weekdays[nounCase][m.day()]; - } - - function processHoursFunction(str) { - return function () { - return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; - }; - } - - return moment.lang('uk', { - months : monthsCaseReplace, - monthsShort : "січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"), - weekdays : weekdaysCaseReplace, - weekdaysShort : "нд_пн_вт_ср_чт_пт_сб".split("_"), - weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD.MM.YYYY", - LL : "D MMMM YYYY р.", - LLL : "D MMMM YYYY р., LT", - LLLL : "dddd, D MMMM YYYY р., LT" - }, - calendar : { - sameDay: processHoursFunction('[Сьогодні '), - nextDay: processHoursFunction('[Завтра '), - lastDay: processHoursFunction('[Вчора '), - nextWeek: processHoursFunction('[У] dddd ['), - lastWeek: function () { - switch (this.day()) { - case 0: - case 3: - case 5: - case 6: - return processHoursFunction('[Минулої] dddd [').call(this); - case 1: - case 2: - case 4: - return processHoursFunction('[Минулого] dddd [').call(this); - } - }, - sameElse: 'L' - }, - relativeTime : { - future : "за %s", - past : "%s тому", - s : "декілька секунд", - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : "годину", - hh : relativeTimeWithPlural, - d : "день", - dd : relativeTimeWithPlural, - M : "місяць", - MM : relativeTimeWithPlural, - y : "рік", - yy : relativeTimeWithPlural - }, - - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return "ночі"; - } else if (hour < 12) { - return "ранку"; - } else if (hour < 17) { - return "дня"; - } else { - return "вечора"; - } - }, - - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return number + '-й'; - case 'D': - return number + '-го'; - default: - return number; - } - }, - - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : uzbek -// author : Sardor Muminov : https://github.com/muminoff - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('uz', { - months : "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), - monthsShort : "янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"), - weekdays : "Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"), - weekdaysShort : "Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"), - weekdaysMin : "Як_Ду_Се_Чо_Па_Жу_Ша".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "D MMMM YYYY, dddd LT" - }, - calendar : { - sameDay : '[Бугун соат] LT [да]', - nextDay : '[Эртага] LT [да]', - nextWeek : 'dddd [куни соат] LT [да]', - lastDay : '[Кеча соат] LT [да]', - lastWeek : '[Утган] dddd [куни соат] LT [да]', - sameElse : 'L' - }, - relativeTime : { - future : "Якин %s ичида", - past : "Бир неча %s олдин", - s : "фурсат", - m : "бир дакика", - mm : "%d дакика", - h : "бир соат", - hh : "%d соат", - d : "бир кун", - dd : "%d кун", - M : "бир ой", - MM : "%d ой", - y : "бир йил", - yy : "%d йил" - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : vietnamese (vi) -// author : Bang Nguyen : https://github.com/bangnk - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('vi', { - months : "tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"), - monthsShort : "Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"), - weekdays : "chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"), - weekdaysShort : "CN_T2_T3_T4_T5_T6_T7".split("_"), - weekdaysMin : "CN_T2_T3_T4_T5_T6_T7".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM [năm] YYYY", - LLL : "D MMMM [năm] YYYY LT", - LLLL : "dddd, D MMMM [năm] YYYY LT", - l : "DD/M/YYYY", - ll : "D MMM YYYY", - lll : "D MMM YYYY LT", - llll : "ddd, D MMM YYYY LT" - }, - calendar : { - sameDay: "[Hôm nay lúc] LT", - nextDay: '[Ngày mai lúc] LT', - nextWeek: 'dddd [tuần tới lúc] LT', - lastDay: '[Hôm qua lúc] LT', - lastWeek: 'dddd [tuần rồi lúc] LT', - sameElse: 'L' - }, - relativeTime : { - future : "%s tới", - past : "%s trước", - s : "vài giây", - m : "một phút", - mm : "%d phút", - h : "một giờ", - hh : "%d giờ", - d : "một ngày", - dd : "%d ngày", - M : "một tháng", - MM : "%d tháng", - y : "một năm", - yy : "%d năm" - }, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : chinese -// author : suupic : https://github.com/suupic -// author : Zeno Zeng : https://github.com/zenozeng - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('zh-cn', { - months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), - weekdaysShort : "周日_周一_周二_周三_周四_周五_周六".split("_"), - weekdaysMin : "日_一_二_三_四_五_六".split("_"), - longDateFormat : { - LT : "Ah点mm", - L : "YYYY-MM-DD", - LL : "YYYY年MMMD日", - LLL : "YYYY年MMMD日LT", - LLLL : "YYYY年MMMD日ddddLT", - l : "YYYY-MM-DD", - ll : "YYYY年MMMD日", - lll : "YYYY年MMMD日LT", - llll : "YYYY年MMMD日ddddLT" - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return "凌晨"; - } else if (hm < 900) { - return "早上"; - } else if (hm < 1130) { - return "上午"; - } else if (hm < 1230) { - return "中午"; - } else if (hm < 1800) { - return "下午"; - } else { - return "晚上"; - } - }, - calendar : { - sameDay : function () { - return this.minutes() === 0 ? "[今天]Ah[点整]" : "[今天]LT"; - }, - nextDay : function () { - return this.minutes() === 0 ? "[明天]Ah[点整]" : "[明天]LT"; - }, - lastDay : function () { - return this.minutes() === 0 ? "[昨天]Ah[点整]" : "[昨天]LT"; - }, - nextWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]'; - return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm"; - }, - lastWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; - return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm"; - }, - sameElse : 'LL' - }, - ordinal : function (number, period) { - switch (period) { - case "d": - case "D": - case "DDD": - return number + "日"; - case "M": - return number + "月"; - case "w": - case "W": - return number + "周"; - default: - return number; - } - }, - relativeTime : { - future : "%s内", - past : "%s前", - s : "几秒", - m : "1分钟", - mm : "%d分钟", - h : "1小时", - hh : "%d小时", - d : "1天", - dd : "%d天", - M : "1个月", - MM : "%d个月", - y : "1年", - yy : "%d年" - }, - week : { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); -})); -// moment.js language configuration -// language : traditional chinese (zh-tw) -// author : Ben : https://github.com/ben-lin - -(function (factory) { - factory(moment); -}(function (moment) { - return moment.lang('zh-tw', { - months : "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), - monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), - weekdays : "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), - weekdaysShort : "週日_週一_週二_週三_週四_週五_週六".split("_"), - weekdaysMin : "日_一_二_三_四_五_六".split("_"), - longDateFormat : { - LT : "Ah點mm", - L : "YYYY年MMMD日", - LL : "YYYY年MMMD日", - LLL : "YYYY年MMMD日LT", - LLLL : "YYYY年MMMD日ddddLT", - l : "YYYY年MMMD日", - ll : "YYYY年MMMD日", - lll : "YYYY年MMMD日LT", - llll : "YYYY年MMMD日ddddLT" - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 900) { - return "早上"; - } else if (hm < 1130) { - return "上午"; - } else if (hm < 1230) { - return "中午"; - } else if (hm < 1800) { - return "下午"; - } else { - return "晚上"; - } - }, - calendar : { - sameDay : '[今天]LT', - nextDay : '[明天]LT', - nextWeek : '[下]ddddLT', - lastDay : '[昨天]LT', - lastWeek : '[上]ddddLT', - sameElse : 'L' - }, - ordinal : function (number, period) { - switch (period) { - case "d" : - case "D" : - case "DDD" : - return number + "日"; - case "M" : - return number + "月"; - case "w" : - case "W" : - return number + "週"; - default : - return number; - } - }, - relativeTime : { - future : "%s內", - past : "%s前", - s : "幾秒", - m : "一分鐘", - mm : "%d分鐘", - h : "一小時", - hh : "%d小時", - d : "一天", - dd : "%d天", - M : "一個月", - MM : "%d個月", - y : "一年", - yy : "%d年" - } - }); -})); - - moment.lang('en'); - - - /************************************ - Exposing Moment - ************************************/ - - function makeGlobal(shouldDeprecate) { - /*global ender:false */ - if (typeof ender !== 'undefined') { - return; - } - oldGlobalMoment = globalScope.moment; - if (shouldDeprecate) { - globalScope.moment = deprecate( - "Accessing Moment through the global scope is " + - "deprecated, and will be removed in an upcoming " + - "release.", - moment); - } else { - globalScope.moment = moment; - } - } - - // CommonJS module is defined - if (hasModule) { - module.exports = moment; - } else if (typeof define === "function" && define.amd) { - define("moment", function (require, exports, module) { - if (module.config && module.config() && module.config().noGlobal === true) { - // release the global variable - globalScope.moment = oldGlobalMoment; - } - - return moment; - }); - makeGlobal(true); - } else { - makeGlobal(); - } -}).call(this); diff --git a/vendors/moment/min/moment-with-langs.min.js b/vendors/moment/min/moment-with-langs.min.js deleted file mode 100644 index 7982a4d3d..000000000 --- a/vendors/moment/min/moment-with-langs.min.js +++ /dev/null @@ -1,9 +0,0 @@ -//! moment.js -//! version : 2.6.0 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com -(function(a){function b(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function c(a,b){function c(){ib.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}var d=!0;return i(function(){return d&&(c(),d=!1),b.apply(this,arguments)},b)}function d(a,b){return function(c){return l(a.call(this,c),b)}}function e(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function f(){}function g(a){y(a),i(this,a)}function h(a){var b=r(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._bubble()}function i(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return b.hasOwnProperty("toString")&&(a.toString=b.toString),b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf),a}function j(a){var b,c={};for(b in a)a.hasOwnProperty(b)&&wb.hasOwnProperty(b)&&(c[b]=a[b]);return c}function k(a){return 0>a?Math.ceil(a):Math.floor(a)}function l(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.lengthd;d++)(c&&a[d]!==b[d]||!c&&t(a[d])!==t(b[d]))&&g++;return g+f}function q(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=Zb[a]||$b[b]||b}return a}function r(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&(b=q(c),b&&(d[b]=a[c]));return d}function s(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}ib[b]=function(e,f){var g,h,i=ib.fn._lang[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=ib().utc().set(d,a);return i.call(ib.fn._lang,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function t(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function u(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function v(a,b,c){return $(ib([a,11,31+b-c]),b,c).week}function w(a){return x(a)?366:365}function x(a){return a%4===0&&a%100!==0||a%400===0}function y(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[pb]<0||a._a[pb]>11?pb:a._a[qb]<1||a._a[qb]>u(a._a[ob],a._a[pb])?qb:a._a[rb]<0||a._a[rb]>23?rb:a._a[sb]<0||a._a[sb]>59?sb:a._a[tb]<0||a._a[tb]>59?tb:a._a[ub]<0||a._a[ub]>999?ub:-1,a._pf._overflowDayOfYear&&(ob>b||b>qb)&&(b=qb),a._pf.overflow=b)}function z(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function A(a){return a?a.toLowerCase().replace("_","-"):a}function B(a,b){return b._isUTC?ib(a).zone(b._offset||0):ib(a).local()}function C(a,b){return b.abbr=a,vb[a]||(vb[a]=new f),vb[a].set(b),vb[a]}function D(a){delete vb[a]}function E(a){var b,c,d,e,f=0,g=function(a){if(!vb[a]&&xb)try{require("./lang/"+a)}catch(b){}return vb[a]};if(!a)return ib.fn._lang;if(!n(a)){if(c=g(a))return c;a=[a]}for(;f0;){if(c=g(e.slice(0,b).join("-")))return c;if(d&&d.length>=b&&p(e,d,!0)>=b-1)break;b--}f++}return ib.fn._lang}function F(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function G(a){var b,c,d=a.match(Bb);for(b=0,c=d.length;c>b;b++)d[b]=cc[d[b]]?cc[d[b]]:F(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function H(a,b){return a.isValid()?(b=I(b,a.lang()),_b[b]||(_b[b]=G(b)),_b[b](a)):a.lang().invalidDate()}function I(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Cb.lastIndex=0;d>=0&&Cb.test(a);)a=a.replace(Cb,c),Cb.lastIndex=0,d-=1;return a}function J(a,b){var c,d=b._strict;switch(a){case"Q":return Nb;case"DDDD":return Pb;case"YYYY":case"GGGG":case"gggg":return d?Qb:Fb;case"Y":case"G":case"g":return Sb;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?Rb:Gb;case"S":if(d)return Nb;case"SS":if(d)return Ob;case"SSS":if(d)return Pb;case"DDD":return Eb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Ib;case"a":case"A":return E(b._l)._meridiemParse;case"X":return Lb;case"Z":case"ZZ":return Jb;case"T":return Kb;case"SSSS":return Hb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?Ob:Db;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Db;case"Do":return Mb;default:return c=new RegExp(R(Q(a.replace("\\","")),"i"))}}function K(a){a=a||"";var b=a.match(Jb)||[],c=b[b.length-1]||[],d=(c+"").match(Xb)||["-",0,0],e=+(60*d[1])+t(d[2]);return"+"===d[0]?-e:e}function L(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[pb]=3*(t(b)-1));break;case"M":case"MM":null!=b&&(e[pb]=t(b)-1);break;case"MMM":case"MMMM":d=E(c._l).monthsParse(b),null!=d?e[pb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[qb]=t(b));break;case"Do":null!=b&&(e[qb]=t(parseInt(b,10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=t(b));break;case"YY":e[ob]=ib.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[ob]=t(b);break;case"a":case"A":c._isPm=E(c._l).isPM(b);break;case"H":case"HH":case"h":case"hh":e[rb]=t(b);break;case"m":case"mm":e[sb]=t(b);break;case"s":case"ss":e[tb]=t(b);break;case"S":case"SS":case"SSS":case"SSSS":e[ub]=t(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=K(b);break;case"w":case"ww":case"W":case"WW":case"d":case"dd":case"ddd":case"dddd":case"e":case"E":a=a.substr(0,1);case"gg":case"gggg":case"GG":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=b)}}function M(a){var b,c,d,e,f,g,h,i,j,k,l=[];if(!a._d){for(d=O(a),a._w&&null==a._a[qb]&&null==a._a[pb]&&(f=function(b){var c=parseInt(b,10);return b?b.length<3?c>68?1900+c:2e3+c:c:null==a._a[ob]?ib().weekYear():a._a[ob]},g=a._w,null!=g.GG||null!=g.W||null!=g.E?h=_(f(g.GG),g.W||1,g.E,4,1):(i=E(a._l),j=null!=g.d?X(g.d,i):null!=g.e?parseInt(g.e,10)+i._week.dow:0,k=parseInt(g.w,10)||1,null!=g.d&&jw(e)&&(a._pf._overflowDayOfYear=!0),c=W(e,0,a._dayOfYear),a._a[pb]=c.getUTCMonth(),a._a[qb]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=l[b]=d[b];for(;7>b;b++)a._a[b]=l[b]=null==a._a[b]?2===b?1:0:a._a[b];l[rb]+=t((a._tzm||0)/60),l[sb]+=t((a._tzm||0)%60),a._d=(a._useUTC?W:V).apply(null,l)}}function N(a){var b;a._d||(b=r(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],M(a))}function O(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function P(a){a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=E(a._l),h=""+a._i,i=h.length,j=0;for(d=I(a._f,g).match(Bb)||[],b=0;b0&&a._pf.unusedInput.push(f),h=h.slice(h.indexOf(c)+c.length),j+=c.length),cc[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),L(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=i-j,h.length>0&&a._pf.unusedInput.push(h),a._isPm&&a._a[rb]<12&&(a._a[rb]+=12),a._isPm===!1&&12===a._a[rb]&&(a._a[rb]=0),M(a),y(a)}function Q(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function R(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function S(a){var c,d,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;fg)&&(e=g,d=c));i(a,d||c)}function T(a){var b,c,d=a._i,e=Tb.exec(d);if(e){for(a._pf.iso=!0,b=0,c=Vb.length;c>b;b++)if(Vb[b][1].exec(d)){a._f=Vb[b][0]+(e[6]||" ");break}for(b=0,c=Wb.length;c>b;b++)if(Wb[b][1].exec(d)){a._f+=Wb[b][0];break}d.match(Jb)&&(a._f+="Z"),P(a)}else ib.createFromInputFallback(a)}function U(b){var c=b._i,d=yb.exec(c);c===a?b._d=new Date:d?b._d=new Date(+d[1]):"string"==typeof c?T(b):n(c)?(b._a=c.slice(0),M(b)):o(c)?b._d=new Date(+c):"object"==typeof c?N(b):"number"==typeof c?b._d=new Date(c):ib.createFromInputFallback(b)}function V(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function W(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function X(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function Y(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Z(a,b,c){var d=nb(Math.abs(a)/1e3),e=nb(d/60),f=nb(e/60),g=nb(f/24),h=nb(g/365),i=45>d&&["s",d]||1===e&&["m"]||45>e&&["mm",e]||1===f&&["h"]||22>f&&["hh",f]||1===g&&["d"]||25>=g&&["dd",g]||45>=g&&["M"]||345>g&&["MM",nb(g/30)]||1===h&&["y"]||["yy",h];return i[2]=b,i[3]=a>0,i[4]=c,Y.apply({},i)}function $(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=ib(a).add("d",f),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function _(a,b,c,d,e){var f,g,h=W(a,0,1).getUTCDay();return c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:w(a-1)+g}}function ab(b){var c=b._i,d=b._f;return null===c||d===a&&""===c?ib.invalid({nullInput:!0}):("string"==typeof c&&(b._i=c=E().preparse(c)),ib.isMoment(c)?(b=j(c),b._d=new Date(+c._d)):d?n(d)?S(b):P(b):U(b),new g(b))}function bb(a,b){var c;return"string"==typeof b&&(b=a.lang().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),u(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function cb(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function db(a,b,c){return"Month"===b?bb(a,c):a._d["set"+(a._isUTC?"UTC":"")+b](c)}function eb(a,b){return function(c){return null!=c?(db(this,a,c),ib.updateOffset(this,b),this):cb(this,a)}}function fb(a){ib.duration.fn[a]=function(){return this._data[a]}}function gb(a,b){ib.duration.fn["as"+a]=function(){return+this/b}}function hb(a){"undefined"==typeof ender&&(jb=mb.moment,mb.moment=a?c("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",ib):ib)}for(var ib,jb,kb,lb="2.6.0",mb="undefined"!=typeof global?global:this,nb=Math.round,ob=0,pb=1,qb=2,rb=3,sb=4,tb=5,ub=6,vb={},wb={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},xb="undefined"!=typeof module&&module.exports,yb=/^\/?Date\((\-?\d+)/i,zb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Ab=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Bb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,Cb=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Db=/\d\d?/,Eb=/\d{1,3}/,Fb=/\d{1,4}/,Gb=/[+\-]?\d{1,6}/,Hb=/\d+/,Ib=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Jb=/Z|[\+\-]\d\d:?\d\d/gi,Kb=/T/i,Lb=/[\+\-]?\d+(\.\d{1,3})?/,Mb=/\d{1,2}/,Nb=/\d/,Ob=/\d\d/,Pb=/\d{3}/,Qb=/\d{4}/,Rb=/[+-]?\d{6}/,Sb=/[+-]?\d+/,Tb=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ub="YYYY-MM-DDTHH:mm:ssZ",Vb=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Wb=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Xb=/([\+\-]|\d\d)/gi,Yb=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),Zb={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},$b={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},_b={},ac="DDD w W M D d".split(" "),bc="M D H h m s w W".split(" "),cc={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return l(this.year()%100,2)},YYYY:function(){return l(this.year(),4)},YYYYY:function(){return l(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+l(Math.abs(a),6)},gg:function(){return l(this.weekYear()%100,2)},gggg:function(){return l(this.weekYear(),4)},ggggg:function(){return l(this.weekYear(),5)},GG:function(){return l(this.isoWeekYear()%100,2)},GGGG:function(){return l(this.isoWeekYear(),4)},GGGGG:function(){return l(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return t(this.milliseconds()/100)},SS:function(){return l(t(this.milliseconds()/10),2)},SSS:function(){return l(this.milliseconds(),3)},SSSS:function(){return l(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+l(t(a/60),2)+":"+l(t(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+l(t(a/60),2)+l(t(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},dc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];ac.length;)kb=ac.pop(),cc[kb+"o"]=e(cc[kb],kb);for(;bc.length;)kb=bc.pop(),cc[kb+kb]=d(cc[kb],2);for(cc.DDDD=d(cc.DDD,3),i(f.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=ib.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=ib([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return $(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),ib=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=c,g._f=d,g._l=e,g._strict=f,g._isUTC=!1,g._pf=b(),ab(g)},ib.suppressDeprecationWarnings=!1,ib.createFromInputFallback=c("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i)}),ib.utc=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=c,g._f=d,g._strict=f,g._pf=b(),ab(g).utc()},ib.unix=function(a){return ib(1e3*a)},ib.duration=function(a,b){var c,d,e,f=a,g=null;return ib.isDuration(a)?f={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(f={},b?f[b]=a:f.milliseconds=a):(g=zb.exec(a))?(c="-"===g[1]?-1:1,f={y:0,d:t(g[qb])*c,h:t(g[rb])*c,m:t(g[sb])*c,s:t(g[tb])*c,ms:t(g[ub])*c}):(g=Ab.exec(a))&&(c="-"===g[1]?-1:1,e=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*c},f={y:e(g[2]),M:e(g[3]),d:e(g[4]),h:e(g[5]),m:e(g[6]),s:e(g[7]),w:e(g[8])}),d=new h(f),ib.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d},ib.version=lb,ib.defaultFormat=Ub,ib.momentProperties=wb,ib.updateOffset=function(){},ib.lang=function(a,b){var c;return a?(b?C(A(a),b):null===b?(D(a),a="en"):vb[a]||E(a),c=ib.duration.fn._lang=ib.fn._lang=E(a),c._abbr):ib.fn._lang._abbr},ib.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),E(a)},ib.isMoment=function(a){return a instanceof g||null!=a&&a.hasOwnProperty("_isAMomentObject")},ib.isDuration=function(a){return a instanceof h},kb=dc.length-1;kb>=0;--kb)s(dc[kb]);ib.normalizeUnits=function(a){return q(a)},ib.invalid=function(a){var b=ib.utc(0/0);return null!=a?i(b._pf,a):b._pf.userInvalidated=!0,b},ib.parseZone=function(){return ib.apply(null,arguments).parseZone()},ib.parseTwoDigitYear=function(a){return t(a)+(t(a)>68?1900:2e3)},i(ib.fn=g.prototype,{clone:function(){return ib(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=ib(this).utc();return 00:!1},parsingFlags:function(){return i({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){var b=H(this,a||ib.defaultFormat);return this.lang().postformat(b)},add:function(a,b){var c;return c="string"==typeof a?ib.duration(+b,a):ib.duration(a,b),m(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?ib.duration(+b,a):ib.duration(a,b),m(this,c,-1),this},diff:function(a,b,c){var d,e,f=B(a,this),g=6e4*(this.zone()-f.zone());return b=q(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-ib(this).startOf("month")-(f-ib(f).startOf("month")))/d,e-=6e4*(this.zone()-ib(this).startOf("month").zone()-(f.zone()-ib(f).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:k(e)},from:function(a,b){return ib.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(ib(),a)},calendar:function(){var a=B(ib(),this).startOf("day"),b=this.diff(a,"days",!0),c=-6>b?"sameElse":-1>b?"lastWeek":0>b?"lastDay":1>b?"sameDay":2>b?"nextDay":7>b?"nextWeek":"sameElse";return this.format(this.lang().calendar(c,this))},isLeapYear:function(){return x(this.year())},isDST:function(){return this.zone()+ib(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+ib(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+B(a,this).startOf(b)},min:function(a){return a=ib.apply(null,arguments),this>a?this:a},max:function(a){return a=ib.apply(null,arguments),a>this?this:a},zone:function(a,b){var c=this._offset||0;return null==a?this._isUTC?c:this._d.getTimezoneOffset():("string"==typeof a&&(a=K(a)),Math.abs(a)<16&&(a=60*a),this._offset=a,this._isUTC=!0,c!==a&&(!b||this._changeInProgress?m(this,ib.duration(c-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,ib.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?ib(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return u(this.year(),this.month())},dayOfYear:function(a){var b=nb((ib(this).startOf("day")-ib(this).startOf("year"))/864e5)+1;return null==a?b:this.add("d",a-b)},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=$(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=$(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=$(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return v(this.year(),1,4)},weeksInYear:function(){var a=this._lang._week;return v(this.year(),a.dow,a.doy)},get:function(a){return a=q(a),this[a]()},set:function(a,b){return a=q(a),"function"==typeof this[a]&&this[a](b),this},lang:function(b){return b===a?this._lang:(this._lang=E(b),this)}}),ib.fn.millisecond=ib.fn.milliseconds=eb("Milliseconds",!1),ib.fn.second=ib.fn.seconds=eb("Seconds",!1),ib.fn.minute=ib.fn.minutes=eb("Minutes",!1),ib.fn.hour=ib.fn.hours=eb("Hours",!0),ib.fn.date=eb("Date",!0),ib.fn.dates=c("dates accessor is deprecated. Use date instead.",eb("Date",!0)),ib.fn.year=eb("FullYear",!0),ib.fn.years=c("years accessor is deprecated. Use year instead.",eb("FullYear",!0)),ib.fn.days=ib.fn.day,ib.fn.months=ib.fn.month,ib.fn.weeks=ib.fn.week,ib.fn.isoWeeks=ib.fn.isoWeek,ib.fn.quarters=ib.fn.quarter,ib.fn.toJSON=ib.fn.toISOString,i(ib.duration.fn=h.prototype,{_bubble:function(){var a,b,c,d,e=this._milliseconds,f=this._days,g=this._months,h=this._data;h.milliseconds=e%1e3,a=k(e/1e3),h.seconds=a%60,b=k(a/60),h.minutes=b%60,c=k(b/60),h.hours=c%24,f+=k(c/24),h.days=f%30,g+=k(f/30),h.months=g%12,d=k(g/12),h.years=d},weeks:function(){return k(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*t(this._months/12)},humanize:function(a){var b=+this,c=Z(b,!a,this.lang());return a&&(c=this.lang().pastFuture(b,c)),this.lang().postformat(c)},add:function(a,b){var c=ib.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=ib.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=q(a),this[a.toLowerCase()+"s"]()},as:function(a){return a=q(a),this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:ib.fn.lang,toIsoString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"}});for(kb in Yb)Yb.hasOwnProperty(kb)&&(gb(kb,Yb[kb]),fb(kb.toLowerCase()));gb("Weeks",6048e5),ib.duration.fn.asMonths=function(){return(+this-31536e6*this.years())/2592e6+12*this.years()},ib.lang("en",{ordinal:function(a){var b=a%10,c=1===t(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),function(a){a(ib)}(function(a){return a.lang("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})}),function(a){a(ib)}(function(a){return a.lang("ar",{months:"يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"),monthsShort:"يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})}),function(a){a(ib)}(function(a){return a.lang("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(b){function c(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+f(d[c],a)}function d(a){switch(e(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function e(a){return a>9?e(a%10):a}function f(a,b){return 2===b?g(a):a}function g(b){var c={m:"v",b:"v",d:"z"};return c[b.charAt(0)]===a?b:c[b.charAt(0)]+b.substring(1)}return b.lang("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY LT",LLLL:"dddd, D [a viz] MMMM YYYY LT"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:c,h:"un eur",hh:"%d eur",d:"un devezh",dd:c,M:"ur miz",MM:c,y:"ur bloaz",yy:d},ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){function b(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci"; -case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}return a.lang("bs",{months:"januar_februar_mart_april_maj_juni_juli_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:b,mm:b,h:b,hh:b,d:"dan",dd:b,M:"mjesec",MM:b,y:"godinu",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){function b(a){return a>1&&5>a&&1!==~~(a/10)}function c(a,c,d,e){var f=a+" ";switch(d){case"s":return c||e?"pár sekund":"pár sekundami";case"m":return c?"minuta":e?"minutu":"minutou";case"mm":return c||e?f+(b(a)?"minuty":"minut"):f+"minutami";break;case"h":return c?"hodina":e?"hodinu":"hodinou";case"hh":return c||e?f+(b(a)?"hodiny":"hodin"):f+"hodinami";break;case"d":return c||e?"den":"dnem";case"dd":return c||e?f+(b(a)?"dny":"dní"):f+"dny";break;case"M":return c||e?"měsíc":"měsícem";case"MM":return c||e?f+(b(a)?"měsíce":"měsíců"):f+"měsíci";break;case"y":return c||e?"rok":"rokem";case"yy":return c||e?f+(b(a)?"roky":"let"):f+"lety"}}var d="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),e="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_");return a.lang("cs",{months:d,monthsShort:e,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(d,e),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H.mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd D. MMMM YYYY LT"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("cv",{months:"кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"),monthsShort:"кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кĕç_эрн_шăм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кç_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]",LLL:"YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT",LLLL:"dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ĕнер] LT [сехетре]",nextWeek:"[Çитес] dddd LT [сехетре]",lastWeek:"[Иртнĕ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/çул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пĕр-ик çеккунт",m:"пĕр минут",mm:"%d минут",h:"пĕр сехет",hh:"%d сехет",d:"пĕр кун",dd:"%d кун",M:"пĕр уйăх",MM:"%d уйăх",y:"пĕр çул",yy:"%d çул"},ordinal:"%d-мĕш",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn àl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D. MMMM, YYYY LT"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){function b(a,b,c){var d={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?d[c][0]:d[c][1]}return a.lang("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm [Uhr]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:b,mm:"%d Minuten",h:b,hh:"%d Stunden",d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:"[την προηγούμενη] dddd [{}] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinal:function(a){return a+"η"},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY LT",LLLL:"dddd, D MMMM, YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}})}),function(a){a(ib)}(function(a){return a.lang("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY LT",LLLL:"dddd, [la] D[-an de] MMMM, YYYY LT"},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinal:"%da",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){var b="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),c="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return a.lang("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(a,d){return/-MMM-/.test(d)?c[a.month()]:b[a.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [del] YYYY",LLL:"D [de] MMMM [del] YYYY LT",LLLL:"dddd, D [de] MMMM [del] YYYY LT"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){function b(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}return a.lang("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:"%d päeva",M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] LT",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] LT",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] LT",llll:"ddd, YYYY[ko] MMM D[a] LT"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){var b={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},c={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};return a.lang("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:function(a){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return c[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]}).replace(/,/g,"،")},ordinal:"%dم",week:{dow:6,doy:12}})}),function(a){a(ib)}(function(a){function b(a,b,d,e){var f="";switch(d){case"s":return e?"muutaman sekunnin":"muutama sekunti";case"m":return e?"minuutin":"minuutti";case"mm":f=e?"minuutin":"minuuttia";break;case"h":return e?"tunnin":"tunti";case"hh":f=e?"tunnin":"tuntia";break;case"d":return e?"päivän":"päivä";case"dd":f=e?"päivän":"päivää";break;case"M":return e?"kuukauden":"kuukausi";case"MM":f=e?"kuukauden":"kuukautta";break;case"y":return e?"vuoden":"vuosi";case"yy":f=e?"vuoden":"vuotta"}return f=c(a,e)+" "+f}function c(a,b){return 10>a?b?e[a]:d[a]:a}var d="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),e=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",d[7],d[8],d[9]];return a.lang("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] LT",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] LT",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] LT",llll:"ddd, Do MMM YYYY, [klo] LT"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D. MMMM, YYYY LT"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return a+(1===a?"er":"")}})}),function(a){a(ib)}(function(a){return a.lang("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:"%dº",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY LT",LLLL:"dddd, D [ב]MMMM YYYY LT",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY LT",llll:"ddd, D MMM YYYY LT"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a+" שנים"}}})}),function(a){a(ib)}(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},c={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return a.lang("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}})}),function(a){a(ib)}(function(a){function b(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}return a.lang("hr",{months:"sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),monthsShort:"sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:b,mm:b,h:b,hh:b,d:"dan",dd:b,M:"mjesec",MM:b,y:"godinu",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){function b(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function c(a){return(a?"":"[múlt] ")+"["+d[this.day()]+"] LT[-kor]"}var d="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");return a.lang("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D., LT",LLLL:"YYYY. MMMM D., dddd LT"},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return c.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return c.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){function b(a,b){var c={nominative:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_"),accusative:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function c(a){var b="հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_");return b[a.month()]}function d(a){var b="կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_");return b[a.day()]}return a.lang("hy-am",{months:b,monthsShort:c,weekdays:d,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., LT",LLLL:"dddd, D MMMM YYYY թ., LT"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] LT",LLLL:"dddd, D MMMM YYYY [pukul] LT"},meridiem:function(a){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam" -},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){function b(a){return a%100===11?!0:a%10===1?!1:!0}function c(a,c,d,e){var f=a+" ";switch(d){case"s":return c||e?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return c?"mínúta":"mínútu";case"mm":return b(a)?f+(c||e?"mínútur":"mínútum"):c?f+"mínúta":f+"mínútu";case"hh":return b(a)?f+(c||e?"klukkustundir":"klukkustundum"):f+"klukkustund";case"d":return c?"dagur":e?"dag":"degi";case"dd":return b(a)?c?f+"dagar":f+(e?"daga":"dögum"):c?f+"dagur":f+(e?"dag":"degi");case"M":return c?"mánuður":e?"mánuð":"mánuði";case"MM":return b(a)?c?f+"mánuðir":f+(e?"mánuði":"mánuðum"):c?f+"mánuður":f+(e?"mánuð":"mánuði");case"y":return c||e?"ár":"ári";case"yy":return b(a)?f+(c||e?"ár":"árum"):f+(c||e?"ár":"ári")}}return a.lang("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] LT",LLLL:"dddd, D. MMMM YYYY [kl.] LT"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:c,m:c,mm:c,h:"klukkustund",hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("it",{months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"D_L_Ma_Me_G_V_S".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日LT",LLLL:"YYYY年M月D日LT dddd"},meridiem:function(a){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}),function(a){a(ib)}(function(a){function b(a,b){var c={nominative:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),accusative:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},d=/D[oD] *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function c(a,b){var c={nominative:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),accusative:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_")},d=/(წინა|შემდეგ)/.test(b)?"accusative":"nominative";return c[d][a.day()]}return a.lang("ka",{months:b,monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:c,weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[ថ្ងៃនៈ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 mm분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:function(a){return 12>a?"오전":"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:"%d일",meridiemParse:/(오전|오후)/,isPM:function(a){return"오후"===a}})}),function(a){a(ib)}(function(a){function b(a,b,c){var d={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],dd:[a+" Deeg",a+" Deeg"],M:["ee Mount","engem Mount"],MM:[a+" Méint",a+" Méint"],y:["ee Joer","engem Joer"],yy:[a+" Joer",a+" Joer"]};return b?d[c][0]:d[c][1]}function c(a){var b=a.substr(0,a.indexOf(" "));return g(b)?"a "+a:"an "+a}function d(a){var b=a.substr(0,a.indexOf(" "));return g(b)?"viru "+a:"virun "+a}function e(){var a=this.format("d");return f(a)?"[Leschte] dddd [um] LT":"[Leschten] dddd [um] LT"}function f(a){switch(a=parseInt(a,10)){case 0:case 1:case 3:case 5:case 6:return!0;default:return!1}}function g(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return g(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return g(a)}return a/=1e3,g(a)}return a.lang("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:e},relativeTime:{future:c,past:d,s:"e puer Sekonnen",m:b,mm:"%d Minutten",h:b,hh:"%d Stonnen",d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){function b(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function c(a,b,c,d){return b?e(c)[0]:d?e(c)[1]:e(c)[2]}function d(a){return a%10===0||a>10&&20>a}function e(a){return h[a].split("_")}function f(a,b,f,g){var h=a+" ";return 1===a?h+c(a,b,f[0],g):b?h+(d(a)?e(f)[1]:e(f)[0]):g?h+e(f)[1]:h+(d(a)?e(f)[1]:e(f)[2])}function g(a,b){var c=-1===b.indexOf("dddd HH:mm"),d=i[a.weekday()];return c?d:d.substring(0,d.length-2)+"į"}var h={m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"},i="pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis_sekmadienis".split("_");return a.lang("lt",{months:"sausio_vasario_kovo_balandžio_gegužės_biržėlio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:g,weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], LT [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, LT [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], LT [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, LT [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:b,m:c,mm:f,h:c,hh:f,d:c,dd:f,M:c,MM:f,y:c,yy:f},ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){function b(a,b,c){var d=a.split("_");return c?b%10===1&&11!==b?d[2]:d[3]:b%10===1&&11!==b?d[0]:d[1]}function c(a,c,e){return a+" "+b(d[e],a,c)}var d={mm:"minūti_minūtes_minūte_minūtes",hh:"stundu_stundas_stunda_stundas",dd:"dienu_dienas_diena_dienas",MM:"mēnesi_mēnešus_mēnesis_mēneši",yy:"gadu_gadus_gads_gadi"};return a.lang("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, LT",LLLL:"YYYY. [gada] D. MMMM, dddd, LT"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"%s vēlāk",past:"%s agrāk",s:"dažas sekundes",m:"minūti",mm:c,h:"stundu",hh:c,d:"dienu",dd:c,M:"mēnesi",MM:c,y:"gadu",yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Во изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Во изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiem:function(a){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}})}),function(a){a(ib)}(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},c={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return a.lang("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%s नंतर",past:"%s पूर्वी",s:"सेकंद",m:"एक मिनिट",mm:"%d मिनिटे",h:"एक तास",hh:"%d तास",d:"एक दिवस",dd:"%d दिवस",M:"एक महिना",MM:"%d महिने",y:"एक वर्ष",yy:"%d वर्षे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}),function(a){a(ib)}(function(a){return a.lang("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] LT",LLLL:"dddd, D MMMM YYYY [pukul] LT"},meridiem:function(a){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"H.mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] LT",LLLL:"dddd D. MMMM YYYY [kl.] LT"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},c={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};return a.lang("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आइ._सो._मङ्_बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return c[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 3>a?"राती":10>a?"बिहान":15>a?"दिउँसो":18>a?"बेलुका":20>a?"साँझ":"राती"},calendar:{sameDay:"[आज] LT",nextDay:"[भोली] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडी",s:"केही समय",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){var b="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),c="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_");return a.lang("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,d){return/-MMM-/.test(d)?c[a.month()]:b[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){function b(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function c(a,c,d){var e=a+" ";switch(d){case"m":return c?"minuta":"minutę";case"mm":return e+(b(a)?"minuty":"minut");case"h":return c?"godzina":"godzinę";case"hh":return e+(b(a)?"godziny":"godzin");case"MM":return e+(b(a)?"miesiące":"miesięcy");case"yy":return e+(b(a)?"lata":"lat")}}var d="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),e="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");return a.lang("pl",{months:function(a,b){return/D MMMM/.test(b)?e[a.month()]:d[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"N_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:c,mm:c,h:c,hh:c,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:c,y:"rok",yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] LT",LLLL:"dddd, D [de] MMMM [de] YYYY [às] LT"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:"%dº"})}),function(a){a(ib)}(function(a){return a.lang("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY LT",LLLL:"dddd, D [de] MMMM [de] YYYY LT"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:"%dº",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){function b(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]}return a.lang("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:b,h:"o oră",hh:b,d:"o zi",dd:b,M:"o lună",MM:b,y:"un an",yy:b},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){function b(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function c(a,c,d){var e={mm:c?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===d?c?"минута":"минуту":a+" "+b(e[d],+a)}function d(a,b){var c={nominative:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),accusative:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function e(a,b){var c={nominative:"янв_фев_мар_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),accusative:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function f(a,b){var c={nominative:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),accusative:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_")},d=/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]}return a.lang("ru",{months:d,monthsShort:e,weekdays:f,weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., LT",LLLL:"dddd, D MMMM YYYY г., LT"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:c,mm:c,h:"час",hh:c,d:"день",dd:c,M:"месяц",MM:c,y:"год",yy:c},meridiem:function(a){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){function b(a){return a>1&&5>a}function c(a,c,d,e){var f=a+" ";switch(d){case"s":return c||e?"pár sekúnd":"pár sekundami";case"m":return c?"minúta":e?"minútu":"minútou";case"mm":return c||e?f+(b(a)?"minúty":"minút"):f+"minútami";break;case"h":return c?"hodina":e?"hodinu":"hodinou";case"hh":return c||e?f+(b(a)?"hodiny":"hodín"):f+"hodinami";break;case"d":return c||e?"deň":"dňom";case"dd":return c||e?f+(b(a)?"dni":"dní"):f+"dňami";break;case"M":return c||e?"mesiac":"mesiacom";case"MM":return c||e?f+(b(a)?"mesiace":"mesiacov"):f+"mesiacmi";break;case"y":return c||e?"rok":"rokom";case"yy":return c||e?f+(b(a)?"roky":"rokov"):f+"rokmi"}}var d="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),e="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");return a.lang("sk",{months:d,monthsShort:e,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(d,e),weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd D. MMMM YYYY LT"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){function b(a,b,c){var d=a+" ";switch(c){case"m":return b?"ena minuta":"eno minuto";case"mm":return d+=1===a?"minuta":2===a?"minuti":3===a||4===a?"minute":"minut";case"h":return b?"ena ura":"eno uro";case"hh":return d+=1===a?"ura":2===a?"uri":3===a||4===a?"ure":"ur";case"dd":return d+=1===a?"dan":"dni";case"MM":return d+=1===a?"mesec":2===a?"meseca":3===a||4===a?"mesece":"mesecev";case"yy":return d+=1===a?"leto":2===a?"leti":3===a||4===a?"leta":"let"}}return a.lang("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[prejšnja] dddd [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"%s nazaj",s:"nekaj sekund",m:b,mm:b,h:b,hh:b,d:"en dan",dd:b,M:"en mesec",MM:b,y:"eno leto",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiem:function(a){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinal:"%d.",week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){var b={words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2] -},translate:function(a,c,d){var e=b.words[d];return 1===d.length?c?e[0]:e[1]:a+" "+b.correctGrammaticalCase(a,e)}};return a.lang("sr-cyr",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:b.translate,mm:b.translate,h:b.translate,hh:b.translate,d:"дан",dd:b.translate,M:"месец",MM:b.translate,y:"годину",yy:b.translate},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){var b={words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,c,d){var e=b.words[d];return 1===d.length?c?e[0]:e[1]:a+" "+b.correctGrammaticalCase(a,e)}};return a.lang("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:b.translate,mm:b.translate,h:b.translate,hh:b.translate,d:"dan",dd:b.translate,M:"mesec",MM:b.translate,y:"godinu",yy:b.translate},ordinal:"%d.",week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"dddd LT",lastWeek:"[Förra] dddd[en] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":3===b?"e":"e";return a+c},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinal:function(a){return a+"வது"},meridiem:function(a){return a>=6&&10>=a?" காலை":a>=10&&14>=a?" நண்பகல்":a>=14&&18>=a?" எற்பாடு":a>=18&&20>=a?" மாலை":a>=20&&24>=a?" இரவு":a>=0&&6>=a?" வைகறை":void 0},week:{dow:0,doy:6}})}),function(a){a(ib)}(function(a){return a.lang("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา LT",LLLL:"วันddddที่ D MMMM YYYY เวลา LT"},meridiem:function(a){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}),function(a){a(ib)}(function(a){return a.lang("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM DD, YYYY LT"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinal:function(a){return a},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){var b={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return a.lang("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){if(0===a)return a+"'ıncı";var c=a%10,d=a%100-c,e=a>=100?100:null;return a+(b[c]||b[d]||b[e])},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("tzm-la",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}),function(a){a(ib)}(function(a){return a.lang("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}),function(a){a(ib)}(function(a){function b(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function c(a,c,d){var e={mm:"хвилина_хвилини_хвилин",hh:"година_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===d?c?"хвилина":"хвилину":"h"===d?c?"година":"годину":a+" "+b(e[d],+a)}function d(a,b){var c={nominative:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),accusative:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_")},d=/D[oD]? *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function e(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function f(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}}return a.lang("uk",{months:d,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:e,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., LT",LLLL:"dddd, D MMMM YYYY р., LT"},calendar:{sameDay:f("[Сьогодні "),nextDay:f("[Завтра "),lastDay:f("[Вчора "),nextWeek:f("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return f("[Минулої] dddd [").call(this);case 1:case 2:case 4:return f("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:c,mm:c,h:"годину",hh:c,d:"день",dd:c,M:"місяць",MM:c,y:"рік",yy:c},meridiem:function(a){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("uz",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"D MMMM YYYY, dddd LT"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}),function(a){a(ib)}(function(a){return a.lang("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY LT",LLLL:"dddd, D MMMM [năm] YYYY LT",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY LT",llll:"ddd, D MMM YYYY LT"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinal:function(a){return a},week:{dow:1,doy:4}})}),function(a){a(ib)}(function(a){return a.lang("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日LT",LLLL:"YYYY年MMMD日ddddLT",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日LT",llll:"YYYY年MMMD日ddddLT"},meridiem:function(a,b){var c=100*a+b;return 600>c?"凌晨":900>c?"早上":1130>c?"上午":1230>c?"中午":1800>c?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()-b.unix()>=604800?"[下]":"[本]",0===this.minutes()?c+"dddAh点整":c+"dddAh点mm"},lastWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()c?"早上":1130>c?"上午":1230>c?"中午":1800>c?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}})}),ib.lang("en"),xb?module.exports=ib:"function"==typeof define&&define.amd?(define("moment",function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(mb.moment=jb),ib}),hb(!0)):hb()}).call(this); \ No newline at end of file diff --git a/vendors/moment/min/moment.min.js b/vendors/moment/min/moment.min.js deleted file mode 100644 index 3fe82adf1..000000000 --- a/vendors/moment/min/moment.min.js +++ /dev/null @@ -1,6 +0,0 @@ -//! moment.js -//! version : 2.6.0 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com -(function(a){function b(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function c(a,b){function c(){ib.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}var d=!0;return i(function(){return d&&(c(),d=!1),b.apply(this,arguments)},b)}function d(a,b){return function(c){return l(a.call(this,c),b)}}function e(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function f(){}function g(a){y(a),i(this,a)}function h(a){var b=r(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._bubble()}function i(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return b.hasOwnProperty("toString")&&(a.toString=b.toString),b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf),a}function j(a){var b,c={};for(b in a)a.hasOwnProperty(b)&&wb.hasOwnProperty(b)&&(c[b]=a[b]);return c}function k(a){return 0>a?Math.ceil(a):Math.floor(a)}function l(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.lengthd;d++)(c&&a[d]!==b[d]||!c&&t(a[d])!==t(b[d]))&&g++;return g+f}function q(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=Zb[a]||$b[b]||b}return a}function r(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&(b=q(c),b&&(d[b]=a[c]));return d}function s(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}ib[b]=function(e,f){var g,h,i=ib.fn._lang[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=ib().utc().set(d,a);return i.call(ib.fn._lang,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function t(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function u(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function v(a,b,c){return $(ib([a,11,31+b-c]),b,c).week}function w(a){return x(a)?366:365}function x(a){return a%4===0&&a%100!==0||a%400===0}function y(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[pb]<0||a._a[pb]>11?pb:a._a[qb]<1||a._a[qb]>u(a._a[ob],a._a[pb])?qb:a._a[rb]<0||a._a[rb]>23?rb:a._a[sb]<0||a._a[sb]>59?sb:a._a[tb]<0||a._a[tb]>59?tb:a._a[ub]<0||a._a[ub]>999?ub:-1,a._pf._overflowDayOfYear&&(ob>b||b>qb)&&(b=qb),a._pf.overflow=b)}function z(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function A(a){return a?a.toLowerCase().replace("_","-"):a}function B(a,b){return b._isUTC?ib(a).zone(b._offset||0):ib(a).local()}function C(a,b){return b.abbr=a,vb[a]||(vb[a]=new f),vb[a].set(b),vb[a]}function D(a){delete vb[a]}function E(a){var b,c,d,e,f=0,g=function(a){if(!vb[a]&&xb)try{require("./lang/"+a)}catch(b){}return vb[a]};if(!a)return ib.fn._lang;if(!n(a)){if(c=g(a))return c;a=[a]}for(;f0;){if(c=g(e.slice(0,b).join("-")))return c;if(d&&d.length>=b&&p(e,d,!0)>=b-1)break;b--}f++}return ib.fn._lang}function F(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function G(a){var b,c,d=a.match(Bb);for(b=0,c=d.length;c>b;b++)d[b]=cc[d[b]]?cc[d[b]]:F(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function H(a,b){return a.isValid()?(b=I(b,a.lang()),_b[b]||(_b[b]=G(b)),_b[b](a)):a.lang().invalidDate()}function I(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Cb.lastIndex=0;d>=0&&Cb.test(a);)a=a.replace(Cb,c),Cb.lastIndex=0,d-=1;return a}function J(a,b){var c,d=b._strict;switch(a){case"Q":return Nb;case"DDDD":return Pb;case"YYYY":case"GGGG":case"gggg":return d?Qb:Fb;case"Y":case"G":case"g":return Sb;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?Rb:Gb;case"S":if(d)return Nb;case"SS":if(d)return Ob;case"SSS":if(d)return Pb;case"DDD":return Eb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Ib;case"a":case"A":return E(b._l)._meridiemParse;case"X":return Lb;case"Z":case"ZZ":return Jb;case"T":return Kb;case"SSSS":return Hb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?Ob:Db;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Db;case"Do":return Mb;default:return c=new RegExp(R(Q(a.replace("\\","")),"i"))}}function K(a){a=a||"";var b=a.match(Jb)||[],c=b[b.length-1]||[],d=(c+"").match(Xb)||["-",0,0],e=+(60*d[1])+t(d[2]);return"+"===d[0]?-e:e}function L(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[pb]=3*(t(b)-1));break;case"M":case"MM":null!=b&&(e[pb]=t(b)-1);break;case"MMM":case"MMMM":d=E(c._l).monthsParse(b),null!=d?e[pb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[qb]=t(b));break;case"Do":null!=b&&(e[qb]=t(parseInt(b,10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=t(b));break;case"YY":e[ob]=ib.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[ob]=t(b);break;case"a":case"A":c._isPm=E(c._l).isPM(b);break;case"H":case"HH":case"h":case"hh":e[rb]=t(b);break;case"m":case"mm":e[sb]=t(b);break;case"s":case"ss":e[tb]=t(b);break;case"S":case"SS":case"SSS":case"SSSS":e[ub]=t(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=K(b);break;case"w":case"ww":case"W":case"WW":case"d":case"dd":case"ddd":case"dddd":case"e":case"E":a=a.substr(0,1);case"gg":case"gggg":case"GG":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=b)}}function M(a){var b,c,d,e,f,g,h,i,j,k,l=[];if(!a._d){for(d=O(a),a._w&&null==a._a[qb]&&null==a._a[pb]&&(f=function(b){var c=parseInt(b,10);return b?b.length<3?c>68?1900+c:2e3+c:c:null==a._a[ob]?ib().weekYear():a._a[ob]},g=a._w,null!=g.GG||null!=g.W||null!=g.E?h=_(f(g.GG),g.W||1,g.E,4,1):(i=E(a._l),j=null!=g.d?X(g.d,i):null!=g.e?parseInt(g.e,10)+i._week.dow:0,k=parseInt(g.w,10)||1,null!=g.d&&jw(e)&&(a._pf._overflowDayOfYear=!0),c=W(e,0,a._dayOfYear),a._a[pb]=c.getUTCMonth(),a._a[qb]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=l[b]=d[b];for(;7>b;b++)a._a[b]=l[b]=null==a._a[b]?2===b?1:0:a._a[b];l[rb]+=t((a._tzm||0)/60),l[sb]+=t((a._tzm||0)%60),a._d=(a._useUTC?W:V).apply(null,l)}}function N(a){var b;a._d||(b=r(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],M(a))}function O(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function P(a){a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=E(a._l),h=""+a._i,i=h.length,j=0;for(d=I(a._f,g).match(Bb)||[],b=0;b0&&a._pf.unusedInput.push(f),h=h.slice(h.indexOf(c)+c.length),j+=c.length),cc[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),L(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=i-j,h.length>0&&a._pf.unusedInput.push(h),a._isPm&&a._a[rb]<12&&(a._a[rb]+=12),a._isPm===!1&&12===a._a[rb]&&(a._a[rb]=0),M(a),y(a)}function Q(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function R(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function S(a){var c,d,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;fg)&&(e=g,d=c));i(a,d||c)}function T(a){var b,c,d=a._i,e=Tb.exec(d);if(e){for(a._pf.iso=!0,b=0,c=Vb.length;c>b;b++)if(Vb[b][1].exec(d)){a._f=Vb[b][0]+(e[6]||" ");break}for(b=0,c=Wb.length;c>b;b++)if(Wb[b][1].exec(d)){a._f+=Wb[b][0];break}d.match(Jb)&&(a._f+="Z"),P(a)}else ib.createFromInputFallback(a)}function U(b){var c=b._i,d=yb.exec(c);c===a?b._d=new Date:d?b._d=new Date(+d[1]):"string"==typeof c?T(b):n(c)?(b._a=c.slice(0),M(b)):o(c)?b._d=new Date(+c):"object"==typeof c?N(b):"number"==typeof c?b._d=new Date(c):ib.createFromInputFallback(b)}function V(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function W(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function X(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function Y(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Z(a,b,c){var d=nb(Math.abs(a)/1e3),e=nb(d/60),f=nb(e/60),g=nb(f/24),h=nb(g/365),i=45>d&&["s",d]||1===e&&["m"]||45>e&&["mm",e]||1===f&&["h"]||22>f&&["hh",f]||1===g&&["d"]||25>=g&&["dd",g]||45>=g&&["M"]||345>g&&["MM",nb(g/30)]||1===h&&["y"]||["yy",h];return i[2]=b,i[3]=a>0,i[4]=c,Y.apply({},i)}function $(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=ib(a).add("d",f),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function _(a,b,c,d,e){var f,g,h=W(a,0,1).getUTCDay();return c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:w(a-1)+g}}function ab(b){var c=b._i,d=b._f;return null===c||d===a&&""===c?ib.invalid({nullInput:!0}):("string"==typeof c&&(b._i=c=E().preparse(c)),ib.isMoment(c)?(b=j(c),b._d=new Date(+c._d)):d?n(d)?S(b):P(b):U(b),new g(b))}function bb(a,b){var c;return"string"==typeof b&&(b=a.lang().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),u(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function cb(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function db(a,b,c){return"Month"===b?bb(a,c):a._d["set"+(a._isUTC?"UTC":"")+b](c)}function eb(a,b){return function(c){return null!=c?(db(this,a,c),ib.updateOffset(this,b),this):cb(this,a)}}function fb(a){ib.duration.fn[a]=function(){return this._data[a]}}function gb(a,b){ib.duration.fn["as"+a]=function(){return+this/b}}function hb(a){"undefined"==typeof ender&&(jb=mb.moment,mb.moment=a?c("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",ib):ib)}for(var ib,jb,kb,lb="2.6.0",mb="undefined"!=typeof global?global:this,nb=Math.round,ob=0,pb=1,qb=2,rb=3,sb=4,tb=5,ub=6,vb={},wb={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},xb="undefined"!=typeof module&&module.exports,yb=/^\/?Date\((\-?\d+)/i,zb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Ab=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Bb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,Cb=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Db=/\d\d?/,Eb=/\d{1,3}/,Fb=/\d{1,4}/,Gb=/[+\-]?\d{1,6}/,Hb=/\d+/,Ib=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Jb=/Z|[\+\-]\d\d:?\d\d/gi,Kb=/T/i,Lb=/[\+\-]?\d+(\.\d{1,3})?/,Mb=/\d{1,2}/,Nb=/\d/,Ob=/\d\d/,Pb=/\d{3}/,Qb=/\d{4}/,Rb=/[+-]?\d{6}/,Sb=/[+-]?\d+/,Tb=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ub="YYYY-MM-DDTHH:mm:ssZ",Vb=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Wb=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Xb=/([\+\-]|\d\d)/gi,Yb=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),Zb={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},$b={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},_b={},ac="DDD w W M D d".split(" "),bc="M D H h m s w W".split(" "),cc={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return l(this.year()%100,2)},YYYY:function(){return l(this.year(),4)},YYYYY:function(){return l(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+l(Math.abs(a),6)},gg:function(){return l(this.weekYear()%100,2)},gggg:function(){return l(this.weekYear(),4)},ggggg:function(){return l(this.weekYear(),5)},GG:function(){return l(this.isoWeekYear()%100,2)},GGGG:function(){return l(this.isoWeekYear(),4)},GGGGG:function(){return l(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return t(this.milliseconds()/100)},SS:function(){return l(t(this.milliseconds()/10),2)},SSS:function(){return l(this.milliseconds(),3)},SSSS:function(){return l(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+l(t(a/60),2)+":"+l(t(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+l(t(a/60),2)+l(t(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},dc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];ac.length;)kb=ac.pop(),cc[kb+"o"]=e(cc[kb],kb);for(;bc.length;)kb=bc.pop(),cc[kb+kb]=d(cc[kb],2);for(cc.DDDD=d(cc.DDD,3),i(f.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=ib.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=ib([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return $(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),ib=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=c,g._f=d,g._l=e,g._strict=f,g._isUTC=!1,g._pf=b(),ab(g)},ib.suppressDeprecationWarnings=!1,ib.createFromInputFallback=c("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i)}),ib.utc=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=c,g._f=d,g._strict=f,g._pf=b(),ab(g).utc()},ib.unix=function(a){return ib(1e3*a)},ib.duration=function(a,b){var c,d,e,f=a,g=null;return ib.isDuration(a)?f={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(f={},b?f[b]=a:f.milliseconds=a):(g=zb.exec(a))?(c="-"===g[1]?-1:1,f={y:0,d:t(g[qb])*c,h:t(g[rb])*c,m:t(g[sb])*c,s:t(g[tb])*c,ms:t(g[ub])*c}):(g=Ab.exec(a))&&(c="-"===g[1]?-1:1,e=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*c},f={y:e(g[2]),M:e(g[3]),d:e(g[4]),h:e(g[5]),m:e(g[6]),s:e(g[7]),w:e(g[8])}),d=new h(f),ib.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d},ib.version=lb,ib.defaultFormat=Ub,ib.momentProperties=wb,ib.updateOffset=function(){},ib.lang=function(a,b){var c;return a?(b?C(A(a),b):null===b?(D(a),a="en"):vb[a]||E(a),c=ib.duration.fn._lang=ib.fn._lang=E(a),c._abbr):ib.fn._lang._abbr},ib.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),E(a)},ib.isMoment=function(a){return a instanceof g||null!=a&&a.hasOwnProperty("_isAMomentObject")},ib.isDuration=function(a){return a instanceof h},kb=dc.length-1;kb>=0;--kb)s(dc[kb]);ib.normalizeUnits=function(a){return q(a)},ib.invalid=function(a){var b=ib.utc(0/0);return null!=a?i(b._pf,a):b._pf.userInvalidated=!0,b},ib.parseZone=function(){return ib.apply(null,arguments).parseZone()},ib.parseTwoDigitYear=function(a){return t(a)+(t(a)>68?1900:2e3)},i(ib.fn=g.prototype,{clone:function(){return ib(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=ib(this).utc();return 00:!1},parsingFlags:function(){return i({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){var b=H(this,a||ib.defaultFormat);return this.lang().postformat(b)},add:function(a,b){var c;return c="string"==typeof a?ib.duration(+b,a):ib.duration(a,b),m(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?ib.duration(+b,a):ib.duration(a,b),m(this,c,-1),this},diff:function(a,b,c){var d,e,f=B(a,this),g=6e4*(this.zone()-f.zone());return b=q(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-ib(this).startOf("month")-(f-ib(f).startOf("month")))/d,e-=6e4*(this.zone()-ib(this).startOf("month").zone()-(f.zone()-ib(f).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:k(e)},from:function(a,b){return ib.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(ib(),a)},calendar:function(){var a=B(ib(),this).startOf("day"),b=this.diff(a,"days",!0),c=-6>b?"sameElse":-1>b?"lastWeek":0>b?"lastDay":1>b?"sameDay":2>b?"nextDay":7>b?"nextWeek":"sameElse";return this.format(this.lang().calendar(c,this))},isLeapYear:function(){return x(this.year())},isDST:function(){return this.zone()+ib(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+ib(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+B(a,this).startOf(b)},min:function(a){return a=ib.apply(null,arguments),this>a?this:a},max:function(a){return a=ib.apply(null,arguments),a>this?this:a},zone:function(a,b){var c=this._offset||0;return null==a?this._isUTC?c:this._d.getTimezoneOffset():("string"==typeof a&&(a=K(a)),Math.abs(a)<16&&(a=60*a),this._offset=a,this._isUTC=!0,c!==a&&(!b||this._changeInProgress?m(this,ib.duration(c-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,ib.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?ib(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return u(this.year(),this.month())},dayOfYear:function(a){var b=nb((ib(this).startOf("day")-ib(this).startOf("year"))/864e5)+1;return null==a?b:this.add("d",a-b)},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=$(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=$(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=$(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return v(this.year(),1,4)},weeksInYear:function(){var a=this._lang._week;return v(this.year(),a.dow,a.doy)},get:function(a){return a=q(a),this[a]()},set:function(a,b){return a=q(a),"function"==typeof this[a]&&this[a](b),this},lang:function(b){return b===a?this._lang:(this._lang=E(b),this)}}),ib.fn.millisecond=ib.fn.milliseconds=eb("Milliseconds",!1),ib.fn.second=ib.fn.seconds=eb("Seconds",!1),ib.fn.minute=ib.fn.minutes=eb("Minutes",!1),ib.fn.hour=ib.fn.hours=eb("Hours",!0),ib.fn.date=eb("Date",!0),ib.fn.dates=c("dates accessor is deprecated. Use date instead.",eb("Date",!0)),ib.fn.year=eb("FullYear",!0),ib.fn.years=c("years accessor is deprecated. Use year instead.",eb("FullYear",!0)),ib.fn.days=ib.fn.day,ib.fn.months=ib.fn.month,ib.fn.weeks=ib.fn.week,ib.fn.isoWeeks=ib.fn.isoWeek,ib.fn.quarters=ib.fn.quarter,ib.fn.toJSON=ib.fn.toISOString,i(ib.duration.fn=h.prototype,{_bubble:function(){var a,b,c,d,e=this._milliseconds,f=this._days,g=this._months,h=this._data;h.milliseconds=e%1e3,a=k(e/1e3),h.seconds=a%60,b=k(a/60),h.minutes=b%60,c=k(b/60),h.hours=c%24,f+=k(c/24),h.days=f%30,g+=k(f/30),h.months=g%12,d=k(g/12),h.years=d},weeks:function(){return k(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*t(this._months/12)},humanize:function(a){var b=+this,c=Z(b,!a,this.lang());return a&&(c=this.lang().pastFuture(b,c)),this.lang().postformat(c)},add:function(a,b){var c=ib.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=ib.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=q(a),this[a.toLowerCase()+"s"]()},as:function(a){return a=q(a),this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:ib.fn.lang,toIsoString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"}});for(kb in Yb)Yb.hasOwnProperty(kb)&&(gb(kb,Yb[kb]),fb(kb.toLowerCase()));gb("Weeks",6048e5),ib.duration.fn.asMonths=function(){return(+this-31536e6*this.years())/2592e6+12*this.years()},ib.lang("en",{ordinal:function(a){var b=a%10,c=1===t(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),xb?module.exports=ib:"function"==typeof define&&define.amd?(define("moment",function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(mb.moment=jb),ib}),hb(!0)):hb()}).call(this); \ No newline at end of file diff --git a/vendors/moment/moment.js b/vendors/moment/moment.js deleted file mode 100644 index 257ee7ec1..000000000 --- a/vendors/moment/moment.js +++ /dev/null @@ -1,2489 +0,0 @@ -//! moment.js -//! version : 2.6.0 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com - -(function (undefined) { - - /************************************ - Constants - ************************************/ - - var moment, - VERSION = "2.6.0", - // the global-scope this is NOT the global object in Node.js - globalScope = typeof global !== 'undefined' ? global : this, - oldGlobalMoment, - round = Math.round, - i, - - YEAR = 0, - MONTH = 1, - DATE = 2, - HOUR = 3, - MINUTE = 4, - SECOND = 5, - MILLISECOND = 6, - - // internal storage for language config files - languages = {}, - - // moment internal properties - momentProperties = { - _isAMomentObject: null, - _i : null, - _f : null, - _l : null, - _strict : null, - _isUTC : null, - _offset : null, // optional. Combine with _isUTC - _pf : null, - _lang : null // optional - }, - - // check for nodeJS - hasModule = (typeof module !== 'undefined' && module.exports), - - // ASP.NET json date format regex - aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, - aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, - - // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html - // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, - - // format tokens - formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g, - localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g, - - // parsing token regexes - parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 - parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 - parseTokenOneToFourDigits = /\d{1,4}/, // 0 - 9999 - parseTokenOneToSixDigits = /[+\-]?\d{1,6}/, // -999,999 - 999,999 - parseTokenDigits = /\d+/, // nonzero number of digits - parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic. - parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z - parseTokenT = /T/i, // T (ISO separator) - parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 - parseTokenOrdinal = /\d{1,2}/, - - //strict parsing regexes - parseTokenOneDigit = /\d/, // 0 - 9 - parseTokenTwoDigits = /\d\d/, // 00 - 99 - parseTokenThreeDigits = /\d{3}/, // 000 - 999 - parseTokenFourDigits = /\d{4}/, // 0000 - 9999 - parseTokenSixDigits = /[+-]?\d{6}/, // -999,999 - 999,999 - parseTokenSignedNumber = /[+-]?\d+/, // -inf - inf - - // iso 8601 regex - // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) - isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, - - isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', - - isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] - ], - - // iso time formats and regexes - isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] - ], - - // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"] - parseTimezoneChunker = /([\+\-]|\d\d)/gi, - - // getter and setter names - proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), - unitMillisecondFactors = { - 'Milliseconds' : 1, - 'Seconds' : 1e3, - 'Minutes' : 6e4, - 'Hours' : 36e5, - 'Days' : 864e5, - 'Months' : 2592e6, - 'Years' : 31536e6 - }, - - unitAliases = { - ms : 'millisecond', - s : 'second', - m : 'minute', - h : 'hour', - d : 'day', - D : 'date', - w : 'week', - W : 'isoWeek', - M : 'month', - Q : 'quarter', - y : 'year', - DDD : 'dayOfYear', - e : 'weekday', - E : 'isoWeekday', - gg: 'weekYear', - GG: 'isoWeekYear' - }, - - camelFunctions = { - dayofyear : 'dayOfYear', - isoweekday : 'isoWeekday', - isoweek : 'isoWeek', - weekyear : 'weekYear', - isoweekyear : 'isoWeekYear' - }, - - // format function strings - formatFunctions = {}, - - // tokens to ordinalize and pad - ordinalizeTokens = 'DDD w W M D d'.split(' '), - paddedTokens = 'M D H h m s w W'.split(' '), - - formatTokenFunctions = { - M : function () { - return this.month() + 1; - }, - MMM : function (format) { - return this.lang().monthsShort(this, format); - }, - MMMM : function (format) { - return this.lang().months(this, format); - }, - D : function () { - return this.date(); - }, - DDD : function () { - return this.dayOfYear(); - }, - d : function () { - return this.day(); - }, - dd : function (format) { - return this.lang().weekdaysMin(this, format); - }, - ddd : function (format) { - return this.lang().weekdaysShort(this, format); - }, - dddd : function (format) { - return this.lang().weekdays(this, format); - }, - w : function () { - return this.week(); - }, - W : function () { - return this.isoWeek(); - }, - YY : function () { - return leftZeroFill(this.year() % 100, 2); - }, - YYYY : function () { - return leftZeroFill(this.year(), 4); - }, - YYYYY : function () { - return leftZeroFill(this.year(), 5); - }, - YYYYYY : function () { - var y = this.year(), sign = y >= 0 ? '+' : '-'; - return sign + leftZeroFill(Math.abs(y), 6); - }, - gg : function () { - return leftZeroFill(this.weekYear() % 100, 2); - }, - gggg : function () { - return leftZeroFill(this.weekYear(), 4); - }, - ggggg : function () { - return leftZeroFill(this.weekYear(), 5); - }, - GG : function () { - return leftZeroFill(this.isoWeekYear() % 100, 2); - }, - GGGG : function () { - return leftZeroFill(this.isoWeekYear(), 4); - }, - GGGGG : function () { - return leftZeroFill(this.isoWeekYear(), 5); - }, - e : function () { - return this.weekday(); - }, - E : function () { - return this.isoWeekday(); - }, - a : function () { - return this.lang().meridiem(this.hours(), this.minutes(), true); - }, - A : function () { - return this.lang().meridiem(this.hours(), this.minutes(), false); - }, - H : function () { - return this.hours(); - }, - h : function () { - return this.hours() % 12 || 12; - }, - m : function () { - return this.minutes(); - }, - s : function () { - return this.seconds(); - }, - S : function () { - return toInt(this.milliseconds() / 100); - }, - SS : function () { - return leftZeroFill(toInt(this.milliseconds() / 10), 2); - }, - SSS : function () { - return leftZeroFill(this.milliseconds(), 3); - }, - SSSS : function () { - return leftZeroFill(this.milliseconds(), 3); - }, - Z : function () { - var a = -this.zone(), - b = "+"; - if (a < 0) { - a = -a; - b = "-"; - } - return b + leftZeroFill(toInt(a / 60), 2) + ":" + leftZeroFill(toInt(a) % 60, 2); - }, - ZZ : function () { - var a = -this.zone(), - b = "+"; - if (a < 0) { - a = -a; - b = "-"; - } - return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2); - }, - z : function () { - return this.zoneAbbr(); - }, - zz : function () { - return this.zoneName(); - }, - X : function () { - return this.unix(); - }, - Q : function () { - return this.quarter(); - } - }, - - lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin']; - - function defaultParsingFlags() { - // We need to deep clone this object, and es5 standard is not very - // helpful. - return { - empty : false, - unusedTokens : [], - unusedInput : [], - overflow : -2, - charsLeftOver : 0, - nullInput : false, - invalidMonth : null, - invalidFormat : false, - userInvalidated : false, - iso: false - }; - } - - function deprecate(msg, fn) { - var firstTime = true; - function printMsg() { - if (moment.suppressDeprecationWarnings === false && - typeof console !== 'undefined' && console.warn) { - console.warn("Deprecation warning: " + msg); - } - } - return extend(function () { - if (firstTime) { - printMsg(); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - function padToken(func, count) { - return function (a) { - return leftZeroFill(func.call(this, a), count); - }; - } - function ordinalizeToken(func, period) { - return function (a) { - return this.lang().ordinal(func.call(this, a), period); - }; - } - - while (ordinalizeTokens.length) { - i = ordinalizeTokens.pop(); - formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i); - } - while (paddedTokens.length) { - i = paddedTokens.pop(); - formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2); - } - formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3); - - - /************************************ - Constructors - ************************************/ - - function Language() { - - } - - // Moment prototype object - function Moment(config) { - checkOverflow(config); - extend(this, config); - } - - // Duration Constructor - function Duration(duration) { - var normalizedInput = normalizeObjectUnits(duration), - years = normalizedInput.year || 0, - quarters = normalizedInput.quarter || 0, - months = normalizedInput.month || 0, - weeks = normalizedInput.week || 0, - days = normalizedInput.day || 0, - hours = normalizedInput.hour || 0, - minutes = normalizedInput.minute || 0, - seconds = normalizedInput.second || 0, - milliseconds = normalizedInput.millisecond || 0; - - // representation for dateAddRemove - this._milliseconds = +milliseconds + - seconds * 1e3 + // 1000 - minutes * 6e4 + // 1000 * 60 - hours * 36e5; // 1000 * 60 * 60 - // Because of dateAddRemove treats 24 hours as different from a - // day when working around DST, we need to store them separately - this._days = +days + - weeks * 7; - // It is impossible translate months into days without knowing - // which months you are are talking about, so we have to store - // it separately. - this._months = +months + - quarters * 3 + - years * 12; - - this._data = {}; - - this._bubble(); - } - - /************************************ - Helpers - ************************************/ - - - function extend(a, b) { - for (var i in b) { - if (b.hasOwnProperty(i)) { - a[i] = b[i]; - } - } - - if (b.hasOwnProperty("toString")) { - a.toString = b.toString; - } - - if (b.hasOwnProperty("valueOf")) { - a.valueOf = b.valueOf; - } - - return a; - } - - function cloneMoment(m) { - var result = {}, i; - for (i in m) { - if (m.hasOwnProperty(i) && momentProperties.hasOwnProperty(i)) { - result[i] = m[i]; - } - } - - return result; - } - - function absRound(number) { - if (number < 0) { - return Math.ceil(number); - } else { - return Math.floor(number); - } - } - - // left zero fill a number - // see http://jsperf.com/left-zero-filling for performance comparison - function leftZeroFill(number, targetLength, forceSign) { - var output = '' + Math.abs(number), - sign = number >= 0; - - while (output.length < targetLength) { - output = '0' + output; - } - return (sign ? (forceSign ? '+' : '') : '-') + output; - } - - // helper function for _.addTime and _.subtractTime - function addOrSubtractDurationFromMoment(mom, duration, isAdding, updateOffset) { - var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; - updateOffset = updateOffset == null ? true : updateOffset; - - if (milliseconds) { - mom._d.setTime(+mom._d + milliseconds * isAdding); - } - if (days) { - rawSetter(mom, 'Date', rawGetter(mom, 'Date') + days * isAdding); - } - if (months) { - rawMonthSetter(mom, rawGetter(mom, 'Month') + months * isAdding); - } - if (updateOffset) { - moment.updateOffset(mom, days || months); - } - } - - // check if is an array - function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; - } - - function isDate(input) { - return Object.prototype.toString.call(input) === '[object Date]' || - input instanceof Date; - } - - // compare two arrays, return the number of differences - function compareArrays(array1, array2, dontConvert) { - var len = Math.min(array1.length, array2.length), - lengthDiff = Math.abs(array1.length - array2.length), - diffs = 0, - i; - for (i = 0; i < len; i++) { - if ((dontConvert && array1[i] !== array2[i]) || - (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { - diffs++; - } - } - return diffs + lengthDiff; - } - - function normalizeUnits(units) { - if (units) { - var lowered = units.toLowerCase().replace(/(.)s$/, '$1'); - units = unitAliases[units] || camelFunctions[lowered] || lowered; - } - return units; - } - - function normalizeObjectUnits(inputObject) { - var normalizedInput = {}, - normalizedProp, - prop; - - for (prop in inputObject) { - if (inputObject.hasOwnProperty(prop)) { - normalizedProp = normalizeUnits(prop); - if (normalizedProp) { - normalizedInput[normalizedProp] = inputObject[prop]; - } - } - } - - return normalizedInput; - } - - function makeList(field) { - var count, setter; - - if (field.indexOf('week') === 0) { - count = 7; - setter = 'day'; - } - else if (field.indexOf('month') === 0) { - count = 12; - setter = 'month'; - } - else { - return; - } - - moment[field] = function (format, index) { - var i, getter, - method = moment.fn._lang[field], - results = []; - - if (typeof format === 'number') { - index = format; - format = undefined; - } - - getter = function (i) { - var m = moment().utc().set(setter, i); - return method.call(moment.fn._lang, m, format || ''); - }; - - if (index != null) { - return getter(index); - } - else { - for (i = 0; i < count; i++) { - results.push(getter(i)); - } - return results; - } - }; - } - - function toInt(argumentForCoercion) { - var coercedNumber = +argumentForCoercion, - value = 0; - - if (coercedNumber !== 0 && isFinite(coercedNumber)) { - if (coercedNumber >= 0) { - value = Math.floor(coercedNumber); - } else { - value = Math.ceil(coercedNumber); - } - } - - return value; - } - - function daysInMonth(year, month) { - return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); - } - - function weeksInYear(year, dow, doy) { - return weekOfYear(moment([year, 11, 31 + dow - doy]), dow, doy).week; - } - - function daysInYear(year) { - return isLeapYear(year) ? 366 : 365; - } - - function isLeapYear(year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - } - - function checkOverflow(m) { - var overflow; - if (m._a && m._pf.overflow === -2) { - overflow = - m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : - m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : - m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR : - m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : - m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : - m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : - -1; - - if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { - overflow = DATE; - } - - m._pf.overflow = overflow; - } - } - - function isValid(m) { - if (m._isValid == null) { - m._isValid = !isNaN(m._d.getTime()) && - m._pf.overflow < 0 && - !m._pf.empty && - !m._pf.invalidMonth && - !m._pf.nullInput && - !m._pf.invalidFormat && - !m._pf.userInvalidated; - - if (m._strict) { - m._isValid = m._isValid && - m._pf.charsLeftOver === 0 && - m._pf.unusedTokens.length === 0; - } - } - return m._isValid; - } - - function normalizeLanguage(key) { - return key ? key.toLowerCase().replace('_', '-') : key; - } - - // Return a moment from input, that is local/utc/zone equivalent to model. - function makeAs(input, model) { - return model._isUTC ? moment(input).zone(model._offset || 0) : - moment(input).local(); - } - - /************************************ - Languages - ************************************/ - - - extend(Language.prototype, { - - set : function (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (typeof prop === 'function') { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - }, - - _months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - months : function (m) { - return this._months[m.month()]; - }, - - _monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - monthsShort : function (m) { - return this._monthsShort[m.month()]; - }, - - monthsParse : function (monthName) { - var i, mom, regex; - - if (!this._monthsParse) { - this._monthsParse = []; - } - - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - if (!this._monthsParse[i]) { - mom = moment.utc([2000, i]); - regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); - this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (this._monthsParse[i].test(monthName)) { - return i; - } - } - }, - - _weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdays : function (m) { - return this._weekdays[m.day()]; - }, - - _weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysShort : function (m) { - return this._weekdaysShort[m.day()]; - }, - - _weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - weekdaysMin : function (m) { - return this._weekdaysMin[m.day()]; - }, - - weekdaysParse : function (weekdayName) { - var i, mom, regex; - - if (!this._weekdaysParse) { - this._weekdaysParse = []; - } - - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - if (!this._weekdaysParse[i]) { - mom = moment([2000, 1]).day(i); - regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); - this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { - return i; - } - } - }, - - _longDateFormat : { - LT : "h:mm A", - L : "MM/DD/YYYY", - LL : "MMMM D YYYY", - LLL : "MMMM D YYYY LT", - LLLL : "dddd, MMMM D YYYY LT" - }, - longDateFormat : function (key) { - var output = this._longDateFormat[key]; - if (!output && this._longDateFormat[key.toUpperCase()]) { - output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) { - return val.slice(1); - }); - this._longDateFormat[key] = output; - } - return output; - }, - - isPM : function (input) { - // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays - // Using charAt should be more compatible. - return ((input + '').toLowerCase().charAt(0) === 'p'); - }, - - _meridiemParse : /[ap]\.?m?\.?/i, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'pm' : 'PM'; - } else { - return isLower ? 'am' : 'AM'; - } - }, - - _calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendar[key]; - return typeof output === 'function' ? output.apply(mom) : output; - }, - - _relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - relativeTime : function (number, withoutSuffix, string, isFuture) { - var output = this._relativeTime[string]; - return (typeof output === 'function') ? - output(number, withoutSuffix, string, isFuture) : - output.replace(/%d/i, number); - }, - pastFuture : function (diff, output) { - var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); - }, - - ordinal : function (number) { - return this._ordinal.replace("%d", number); - }, - _ordinal : "%d", - - preparse : function (string) { - return string; - }, - - postformat : function (string) { - return string; - }, - - week : function (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - }, - - _week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }, - - _invalidDate: 'Invalid date', - invalidDate: function () { - return this._invalidDate; - } - }); - - // Loads a language definition into the `languages` cache. The function - // takes a key and optionally values. If not in the browser and no values - // are provided, it will load the language file module. As a convenience, - // this function also returns the language values. - function loadLang(key, values) { - values.abbr = key; - if (!languages[key]) { - languages[key] = new Language(); - } - languages[key].set(values); - return languages[key]; - } - - // Remove a language from the `languages` cache. Mostly useful in tests. - function unloadLang(key) { - delete languages[key]; - } - - // Determines which language definition to use and returns it. - // - // With no parameters, it will return the global language. If you - // pass in a language key, such as 'en', it will return the - // definition for 'en', so long as 'en' has already been loaded using - // moment.lang. - function getLangDefinition(key) { - var i = 0, j, lang, next, split, - get = function (k) { - if (!languages[k] && hasModule) { - try { - require('./lang/' + k); - } catch (e) { } - } - return languages[k]; - }; - - if (!key) { - return moment.fn._lang; - } - - if (!isArray(key)) { - //short-circuit everything else - lang = get(key); - if (lang) { - return lang; - } - key = [key]; - } - - //pick the language from the array - //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each - //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - while (i < key.length) { - split = normalizeLanguage(key[i]).split('-'); - j = split.length; - next = normalizeLanguage(key[i + 1]); - next = next ? next.split('-') : null; - while (j > 0) { - lang = get(split.slice(0, j).join('-')); - if (lang) { - return lang; - } - if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { - //the next array item is better than a shallower substring of this one - break; - } - j--; - } - i++; - } - return moment.fn._lang; - } - - /************************************ - Formatting - ************************************/ - - - function removeFormattingTokens(input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|\]$/g, ""); - } - return input.replace(/\\/g, ""); - } - - function makeFormatFunction(format) { - var array = format.match(formattingTokens), i, length; - - for (i = 0, length = array.length; i < length; i++) { - if (formatTokenFunctions[array[i]]) { - array[i] = formatTokenFunctions[array[i]]; - } else { - array[i] = removeFormattingTokens(array[i]); - } - } - - return function (mom) { - var output = ""; - for (i = 0; i < length; i++) { - output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; - } - return output; - }; - } - - // format date using native date object - function formatMoment(m, format) { - - if (!m.isValid()) { - return m.lang().invalidDate(); - } - - format = expandFormat(format, m.lang()); - - if (!formatFunctions[format]) { - formatFunctions[format] = makeFormatFunction(format); - } - - return formatFunctions[format](m); - } - - function expandFormat(format, lang) { - var i = 5; - - function replaceLongDateFormatTokens(input) { - return lang.longDateFormat(input) || input; - } - - localFormattingTokens.lastIndex = 0; - while (i >= 0 && localFormattingTokens.test(format)) { - format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); - localFormattingTokens.lastIndex = 0; - i -= 1; - } - - return format; - } - - - /************************************ - Parsing - ************************************/ - - - // get the regex to find the next token - function getParseRegexForToken(token, config) { - var a, strict = config._strict; - switch (token) { - case 'Q': - return parseTokenOneDigit; - case 'DDDD': - return parseTokenThreeDigits; - case 'YYYY': - case 'GGGG': - case 'gggg': - return strict ? parseTokenFourDigits : parseTokenOneToFourDigits; - case 'Y': - case 'G': - case 'g': - return parseTokenSignedNumber; - case 'YYYYYY': - case 'YYYYY': - case 'GGGGG': - case 'ggggg': - return strict ? parseTokenSixDigits : parseTokenOneToSixDigits; - case 'S': - if (strict) { return parseTokenOneDigit; } - /* falls through */ - case 'SS': - if (strict) { return parseTokenTwoDigits; } - /* falls through */ - case 'SSS': - if (strict) { return parseTokenThreeDigits; } - /* falls through */ - case 'DDD': - return parseTokenOneToThreeDigits; - case 'MMM': - case 'MMMM': - case 'dd': - case 'ddd': - case 'dddd': - return parseTokenWord; - case 'a': - case 'A': - return getLangDefinition(config._l)._meridiemParse; - case 'X': - return parseTokenTimestampMs; - case 'Z': - case 'ZZ': - return parseTokenTimezone; - case 'T': - return parseTokenT; - case 'SSSS': - return parseTokenDigits; - case 'MM': - case 'DD': - case 'YY': - case 'GG': - case 'gg': - case 'HH': - case 'hh': - case 'mm': - case 'ss': - case 'ww': - case 'WW': - return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits; - case 'M': - case 'D': - case 'd': - case 'H': - case 'h': - case 'm': - case 's': - case 'w': - case 'W': - case 'e': - case 'E': - return parseTokenOneOrTwoDigits; - case 'Do': - return parseTokenOrdinal; - default : - a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), "i")); - return a; - } - } - - function timezoneMinutesFromString(string) { - string = string || ""; - var possibleTzMatches = (string.match(parseTokenTimezone) || []), - tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [], - parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0], - minutes = +(parts[1] * 60) + toInt(parts[2]); - - return parts[0] === '+' ? -minutes : minutes; - } - - // function to convert string input to date - function addTimeToArrayFromToken(token, input, config) { - var a, datePartArray = config._a; - - switch (token) { - // QUARTER - case 'Q': - if (input != null) { - datePartArray[MONTH] = (toInt(input) - 1) * 3; - } - break; - // MONTH - case 'M' : // fall through to MM - case 'MM' : - if (input != null) { - datePartArray[MONTH] = toInt(input) - 1; - } - break; - case 'MMM' : // fall through to MMMM - case 'MMMM' : - a = getLangDefinition(config._l).monthsParse(input); - // if we didn't find a month name, mark the date as invalid. - if (a != null) { - datePartArray[MONTH] = a; - } else { - config._pf.invalidMonth = input; - } - break; - // DAY OF MONTH - case 'D' : // fall through to DD - case 'DD' : - if (input != null) { - datePartArray[DATE] = toInt(input); - } - break; - case 'Do' : - if (input != null) { - datePartArray[DATE] = toInt(parseInt(input, 10)); - } - break; - // DAY OF YEAR - case 'DDD' : // fall through to DDDD - case 'DDDD' : - if (input != null) { - config._dayOfYear = toInt(input); - } - - break; - // YEAR - case 'YY' : - datePartArray[YEAR] = moment.parseTwoDigitYear(input); - break; - case 'YYYY' : - case 'YYYYY' : - case 'YYYYYY' : - datePartArray[YEAR] = toInt(input); - break; - // AM / PM - case 'a' : // fall through to A - case 'A' : - config._isPm = getLangDefinition(config._l).isPM(input); - break; - // 24 HOUR - case 'H' : // fall through to hh - case 'HH' : // fall through to hh - case 'h' : // fall through to hh - case 'hh' : - datePartArray[HOUR] = toInt(input); - break; - // MINUTE - case 'm' : // fall through to mm - case 'mm' : - datePartArray[MINUTE] = toInt(input); - break; - // SECOND - case 's' : // fall through to ss - case 'ss' : - datePartArray[SECOND] = toInt(input); - break; - // MILLISECOND - case 'S' : - case 'SS' : - case 'SSS' : - case 'SSSS' : - datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000); - break; - // UNIX TIMESTAMP WITH MS - case 'X': - config._d = new Date(parseFloat(input) * 1000); - break; - // TIMEZONE - case 'Z' : // fall through to ZZ - case 'ZZ' : - config._useUTC = true; - config._tzm = timezoneMinutesFromString(input); - break; - case 'w': - case 'ww': - case 'W': - case 'WW': - case 'd': - case 'dd': - case 'ddd': - case 'dddd': - case 'e': - case 'E': - token = token.substr(0, 1); - /* falls through */ - case 'gg': - case 'gggg': - case 'GG': - case 'GGGG': - case 'GGGGG': - token = token.substr(0, 2); - if (input) { - config._w = config._w || {}; - config._w[token] = input; - } - break; - } - } - - // convert an array to a date. - // the array should mirror the parameters below - // note: all values past the year are optional and will default to the lowest possible value. - // [year, month, day , hour, minute, second, millisecond] - function dateFromConfig(config) { - var i, date, input = [], currentDate, - yearToUse, fixYear, w, temp, lang, weekday, week; - - if (config._d) { - return; - } - - currentDate = currentDateArray(config); - - //compute day of the year from weeks and weekdays - if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { - fixYear = function (val) { - var intVal = parseInt(val, 10); - return val ? - (val.length < 3 ? (intVal > 68 ? 1900 + intVal : 2000 + intVal) : intVal) : - (config._a[YEAR] == null ? moment().weekYear() : config._a[YEAR]); - }; - - w = config._w; - if (w.GG != null || w.W != null || w.E != null) { - temp = dayOfYearFromWeeks(fixYear(w.GG), w.W || 1, w.E, 4, 1); - } - else { - lang = getLangDefinition(config._l); - weekday = w.d != null ? parseWeekday(w.d, lang) : - (w.e != null ? parseInt(w.e, 10) + lang._week.dow : 0); - - week = parseInt(w.w, 10) || 1; - - //if we're parsing 'd', then the low day numbers may be next week - if (w.d != null && weekday < lang._week.dow) { - week++; - } - - temp = dayOfYearFromWeeks(fixYear(w.gg), week, weekday, lang._week.doy, lang._week.dow); - } - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; - } - - //if the day of the year is set, figure out what it is - if (config._dayOfYear) { - yearToUse = config._a[YEAR] == null ? currentDate[YEAR] : config._a[YEAR]; - - if (config._dayOfYear > daysInYear(yearToUse)) { - config._pf._overflowDayOfYear = true; - } - - date = makeUTCDate(yearToUse, 0, config._dayOfYear); - config._a[MONTH] = date.getUTCMonth(); - config._a[DATE] = date.getUTCDate(); - } - - // Default to current date. - // * if no year, month, day of month are given, default to today - // * if day of month is given, default month and year - // * if month is given, default only year - // * if year is given, don't default anything - for (i = 0; i < 3 && config._a[i] == null; ++i) { - config._a[i] = input[i] = currentDate[i]; - } - - // Zero out whatever was not defaulted, including time - for (; i < 7; i++) { - config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; - } - - // add the offsets to the time to be parsed so that we can have a clean array for checking isValid - input[HOUR] += toInt((config._tzm || 0) / 60); - input[MINUTE] += toInt((config._tzm || 0) % 60); - - config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input); - } - - function dateFromObject(config) { - var normalizedInput; - - if (config._d) { - return; - } - - normalizedInput = normalizeObjectUnits(config._i); - config._a = [ - normalizedInput.year, - normalizedInput.month, - normalizedInput.day, - normalizedInput.hour, - normalizedInput.minute, - normalizedInput.second, - normalizedInput.millisecond - ]; - - dateFromConfig(config); - } - - function currentDateArray(config) { - var now = new Date(); - if (config._useUTC) { - return [ - now.getUTCFullYear(), - now.getUTCMonth(), - now.getUTCDate() - ]; - } else { - return [now.getFullYear(), now.getMonth(), now.getDate()]; - } - } - - // date from string and format string - function makeDateFromStringAndFormat(config) { - - config._a = []; - config._pf.empty = true; - - // This array is used to make a Date, either with `new Date` or `Date.UTC` - var lang = getLangDefinition(config._l), - string = '' + config._i, - i, parsedInput, tokens, token, skipped, - stringLength = string.length, - totalParsedInputLength = 0; - - tokens = expandFormat(config._f, lang).match(formattingTokens) || []; - - for (i = 0; i < tokens.length; i++) { - token = tokens[i]; - parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; - if (parsedInput) { - skipped = string.substr(0, string.indexOf(parsedInput)); - if (skipped.length > 0) { - config._pf.unusedInput.push(skipped); - } - string = string.slice(string.indexOf(parsedInput) + parsedInput.length); - totalParsedInputLength += parsedInput.length; - } - // don't parse if it's not a known token - if (formatTokenFunctions[token]) { - if (parsedInput) { - config._pf.empty = false; - } - else { - config._pf.unusedTokens.push(token); - } - addTimeToArrayFromToken(token, parsedInput, config); - } - else if (config._strict && !parsedInput) { - config._pf.unusedTokens.push(token); - } - } - - // add remaining unparsed input length to the string - config._pf.charsLeftOver = stringLength - totalParsedInputLength; - if (string.length > 0) { - config._pf.unusedInput.push(string); - } - - // handle am pm - if (config._isPm && config._a[HOUR] < 12) { - config._a[HOUR] += 12; - } - // if is 12 am, change hours to 0 - if (config._isPm === false && config._a[HOUR] === 12) { - config._a[HOUR] = 0; - } - - dateFromConfig(config); - checkOverflow(config); - } - - function unescapeFormat(s) { - return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { - return p1 || p2 || p3 || p4; - }); - } - - // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function regexpEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } - - // date from string and array of format strings - function makeDateFromStringAndArray(config) { - var tempConfig, - bestMoment, - - scoreToBeat, - i, - currentScore; - - if (config._f.length === 0) { - config._pf.invalidFormat = true; - config._d = new Date(NaN); - return; - } - - for (i = 0; i < config._f.length; i++) { - currentScore = 0; - tempConfig = extend({}, config); - tempConfig._pf = defaultParsingFlags(); - tempConfig._f = config._f[i]; - makeDateFromStringAndFormat(tempConfig); - - if (!isValid(tempConfig)) { - continue; - } - - // if there is any input that was not parsed add a penalty for that format - currentScore += tempConfig._pf.charsLeftOver; - - //or tokens - currentScore += tempConfig._pf.unusedTokens.length * 10; - - tempConfig._pf.score = currentScore; - - if (scoreToBeat == null || currentScore < scoreToBeat) { - scoreToBeat = currentScore; - bestMoment = tempConfig; - } - } - - extend(config, bestMoment || tempConfig); - } - - // date from iso format - function makeDateFromString(config) { - var i, l, - string = config._i, - match = isoRegex.exec(string); - - if (match) { - config._pf.iso = true; - for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - // match[5] should be "T" or undefined - config._f = isoDates[i][0] + (match[6] || " "); - break; - } - } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - config._f += isoTimes[i][0]; - break; - } - } - if (string.match(parseTokenTimezone)) { - config._f += "Z"; - } - makeDateFromStringAndFormat(config); - } - else { - moment.createFromInputFallback(config); - } - } - - function makeDateFromInput(config) { - var input = config._i, - matched = aspNetJsonRegex.exec(input); - - if (input === undefined) { - config._d = new Date(); - } else if (matched) { - config._d = new Date(+matched[1]); - } else if (typeof input === 'string') { - makeDateFromString(config); - } else if (isArray(input)) { - config._a = input.slice(0); - dateFromConfig(config); - } else if (isDate(input)) { - config._d = new Date(+input); - } else if (typeof(input) === 'object') { - dateFromObject(config); - } else if (typeof(input) === 'number') { - // from milliseconds - config._d = new Date(input); - } else { - moment.createFromInputFallback(config); - } - } - - function makeDate(y, m, d, h, M, s, ms) { - //can't just apply() to create a date: - //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply - var date = new Date(y, m, d, h, M, s, ms); - - //the date constructor doesn't accept years < 1970 - if (y < 1970) { - date.setFullYear(y); - } - return date; - } - - function makeUTCDate(y) { - var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { - date.setUTCFullYear(y); - } - return date; - } - - function parseWeekday(input, language) { - if (typeof input === 'string') { - if (!isNaN(input)) { - input = parseInt(input, 10); - } - else { - input = language.weekdaysParse(input); - if (typeof input !== 'number') { - return null; - } - } - } - return input; - } - - /************************************ - Relative Time - ************************************/ - - - // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) { - return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture); - } - - function relativeTime(milliseconds, withoutSuffix, lang) { - var seconds = round(Math.abs(milliseconds) / 1000), - minutes = round(seconds / 60), - hours = round(minutes / 60), - days = round(hours / 24), - years = round(days / 365), - args = seconds < 45 && ['s', seconds] || - minutes === 1 && ['m'] || - minutes < 45 && ['mm', minutes] || - hours === 1 && ['h'] || - hours < 22 && ['hh', hours] || - days === 1 && ['d'] || - days <= 25 && ['dd', days] || - days <= 45 && ['M'] || - days < 345 && ['MM', round(days / 30)] || - years === 1 && ['y'] || ['yy', years]; - args[2] = withoutSuffix; - args[3] = milliseconds > 0; - args[4] = lang; - return substituteTimeAgo.apply({}, args); - } - - - /************************************ - Week of Year - ************************************/ - - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - adjustedMoment = moment(mom).add('d', daysToDayOfWeek); - return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() - }; - } - - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var d = makeUTCDate(year, 0, 1).getUTCDay(), daysToAdd, dayOfYear; - - weekday = weekday != null ? weekday : firstDayOfWeek; - daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0); - dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1; - - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear - }; - } - - /************************************ - Top Level Functions - ************************************/ - - function makeMoment(config) { - var input = config._i, - format = config._f; - - if (input === null || (format === undefined && input === '')) { - return moment.invalid({nullInput: true}); - } - - if (typeof input === 'string') { - config._i = input = getLangDefinition().preparse(input); - } - - if (moment.isMoment(input)) { - config = cloneMoment(input); - - config._d = new Date(+input._d); - } else if (format) { - if (isArray(format)) { - makeDateFromStringAndArray(config); - } else { - makeDateFromStringAndFormat(config); - } - } else { - makeDateFromInput(config); - } - - return new Moment(config); - } - - moment = function (input, format, lang, strict) { - var c; - - if (typeof(lang) === "boolean") { - strict = lang; - lang = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c = {}; - c._isAMomentObject = true; - c._i = input; - c._f = format; - c._l = lang; - c._strict = strict; - c._isUTC = false; - c._pf = defaultParsingFlags(); - - return makeMoment(c); - }; - - moment.suppressDeprecationWarnings = false; - - moment.createFromInputFallback = deprecate( - "moment construction falls back to js Date. This is " + - "discouraged and will be removed in upcoming major " + - "release. Please refer to " + - "https://github.com/moment/moment/issues/1407 for more info.", - function (config) { - config._d = new Date(config._i); - }); - - // creating with utc - moment.utc = function (input, format, lang, strict) { - var c; - - if (typeof(lang) === "boolean") { - strict = lang; - lang = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c = {}; - c._isAMomentObject = true; - c._useUTC = true; - c._isUTC = true; - c._l = lang; - c._i = input; - c._f = format; - c._strict = strict; - c._pf = defaultParsingFlags(); - - return makeMoment(c).utc(); - }; - - // creating with unix timestamp (in seconds) - moment.unix = function (input) { - return moment(input * 1000); - }; - - // duration - moment.duration = function (input, key) { - var duration = input, - // matching against regexp is expensive, do it on demand - match = null, - sign, - ret, - parseIso; - - if (moment.isDuration(input)) { - duration = { - ms: input._milliseconds, - d: input._days, - M: input._months - }; - } else if (typeof input === 'number') { - duration = {}; - if (key) { - duration[key] = input; - } else { - duration.milliseconds = input; - } - } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) { - sign = (match[1] === "-") ? -1 : 1; - duration = { - y: 0, - d: toInt(match[DATE]) * sign, - h: toInt(match[HOUR]) * sign, - m: toInt(match[MINUTE]) * sign, - s: toInt(match[SECOND]) * sign, - ms: toInt(match[MILLISECOND]) * sign - }; - } else if (!!(match = isoDurationRegex.exec(input))) { - sign = (match[1] === "-") ? -1 : 1; - parseIso = function (inp) { - // We'd normally use ~~inp for this, but unfortunately it also - // converts floats to ints. - // inp may be undefined, so careful calling replace on it. - var res = inp && parseFloat(inp.replace(',', '.')); - // apply sign while we're at it - return (isNaN(res) ? 0 : res) * sign; - }; - duration = { - y: parseIso(match[2]), - M: parseIso(match[3]), - d: parseIso(match[4]), - h: parseIso(match[5]), - m: parseIso(match[6]), - s: parseIso(match[7]), - w: parseIso(match[8]) - }; - } - - ret = new Duration(duration); - - if (moment.isDuration(input) && input.hasOwnProperty('_lang')) { - ret._lang = input._lang; - } - - return ret; - }; - - // version number - moment.version = VERSION; - - // default format - moment.defaultFormat = isoFormat; - - // Plugins that add properties should also add the key here (null value), - // so we can properly clone ourselves. - moment.momentProperties = momentProperties; - - // This function will be called whenever a moment is mutated. - // It is intended to keep the offset in sync with the timezone. - moment.updateOffset = function () {}; - - // This function will load languages and then set the global language. If - // no arguments are passed in, it will simply return the current global - // language key. - moment.lang = function (key, values) { - var r; - if (!key) { - return moment.fn._lang._abbr; - } - if (values) { - loadLang(normalizeLanguage(key), values); - } else if (values === null) { - unloadLang(key); - key = 'en'; - } else if (!languages[key]) { - getLangDefinition(key); - } - r = moment.duration.fn._lang = moment.fn._lang = getLangDefinition(key); - return r._abbr; - }; - - // returns language data - moment.langData = function (key) { - if (key && key._lang && key._lang._abbr) { - key = key._lang._abbr; - } - return getLangDefinition(key); - }; - - // compare moment object - moment.isMoment = function (obj) { - return obj instanceof Moment || - (obj != null && obj.hasOwnProperty('_isAMomentObject')); - }; - - // for typechecking Duration objects - moment.isDuration = function (obj) { - return obj instanceof Duration; - }; - - for (i = lists.length - 1; i >= 0; --i) { - makeList(lists[i]); - } - - moment.normalizeUnits = function (units) { - return normalizeUnits(units); - }; - - moment.invalid = function (flags) { - var m = moment.utc(NaN); - if (flags != null) { - extend(m._pf, flags); - } - else { - m._pf.userInvalidated = true; - } - - return m; - }; - - moment.parseZone = function () { - return moment.apply(null, arguments).parseZone(); - }; - - moment.parseTwoDigitYear = function (input) { - return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); - }; - - /************************************ - Moment Prototype - ************************************/ - - - extend(moment.fn = Moment.prototype, { - - clone : function () { - return moment(this); - }, - - valueOf : function () { - return +this._d + ((this._offset || 0) * 60000); - }, - - unix : function () { - return Math.floor(+this / 1000); - }, - - toString : function () { - return this.clone().lang('en').format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); - }, - - toDate : function () { - return this._offset ? new Date(+this) : this._d; - }, - - toISOString : function () { - var m = moment(this).utc(); - if (0 < m.year() && m.year() <= 9999) { - return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - } else { - return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - } - }, - - toArray : function () { - var m = this; - return [ - m.year(), - m.month(), - m.date(), - m.hours(), - m.minutes(), - m.seconds(), - m.milliseconds() - ]; - }, - - isValid : function () { - return isValid(this); - }, - - isDSTShifted : function () { - - if (this._a) { - return this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0; - } - - return false; - }, - - parsingFlags : function () { - return extend({}, this._pf); - }, - - invalidAt: function () { - return this._pf.overflow; - }, - - utc : function () { - return this.zone(0); - }, - - local : function () { - this.zone(0); - this._isUTC = false; - return this; - }, - - format : function (inputString) { - var output = formatMoment(this, inputString || moment.defaultFormat); - return this.lang().postformat(output); - }, - - add : function (input, val) { - var dur; - // switch args to support add('s', 1) and add(1, 's') - if (typeof input === 'string') { - dur = moment.duration(+val, input); - } else { - dur = moment.duration(input, val); - } - addOrSubtractDurationFromMoment(this, dur, 1); - return this; - }, - - subtract : function (input, val) { - var dur; - // switch args to support subtract('s', 1) and subtract(1, 's') - if (typeof input === 'string') { - dur = moment.duration(+val, input); - } else { - dur = moment.duration(input, val); - } - addOrSubtractDurationFromMoment(this, dur, -1); - return this; - }, - - diff : function (input, units, asFloat) { - var that = makeAs(input, this), - zoneDiff = (this.zone() - that.zone()) * 6e4, - diff, output; - - units = normalizeUnits(units); - - if (units === 'year' || units === 'month') { - // average number of days in the months in the given dates - diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2 - // difference in months - output = ((this.year() - that.year()) * 12) + (this.month() - that.month()); - // adjust by taking difference in days, average number of days - // and dst in the given months. - output += ((this - moment(this).startOf('month')) - - (that - moment(that).startOf('month'))) / diff; - // same as above but with zones, to negate all dst - output -= ((this.zone() - moment(this).startOf('month').zone()) - - (that.zone() - moment(that).startOf('month').zone())) * 6e4 / diff; - if (units === 'year') { - output = output / 12; - } - } else { - diff = (this - that); - output = units === 'second' ? diff / 1e3 : // 1000 - units === 'minute' ? diff / 6e4 : // 1000 * 60 - units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60 - units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst - units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst - diff; - } - return asFloat ? output : absRound(output); - }, - - from : function (time, withoutSuffix) { - return moment.duration(this.diff(time)).lang(this.lang()._abbr).humanize(!withoutSuffix); - }, - - fromNow : function (withoutSuffix) { - return this.from(moment(), withoutSuffix); - }, - - calendar : function () { - // We want to compare the start of today, vs this. - // Getting start-of-today depends on whether we're zone'd or not. - var sod = makeAs(moment(), this).startOf('day'), - diff = this.diff(sod, 'days', true), - format = diff < -6 ? 'sameElse' : - diff < -1 ? 'lastWeek' : - diff < 0 ? 'lastDay' : - diff < 1 ? 'sameDay' : - diff < 2 ? 'nextDay' : - diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(this.lang().calendar(format, this)); - }, - - isLeapYear : function () { - return isLeapYear(this.year()); - }, - - isDST : function () { - return (this.zone() < this.clone().month(0).zone() || - this.zone() < this.clone().month(5).zone()); - }, - - day : function (input) { - var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); - if (input != null) { - input = parseWeekday(input, this.lang()); - return this.add({ d : input - day }); - } else { - return day; - } - }, - - month : makeAccessor('Month', true), - - startOf: function (units) { - units = normalizeUnits(units); - // the following switch intentionally omits break keywords - // to utilize falling through the cases. - switch (units) { - case 'year': - this.month(0); - /* falls through */ - case 'quarter': - case 'month': - this.date(1); - /* falls through */ - case 'week': - case 'isoWeek': - case 'day': - this.hours(0); - /* falls through */ - case 'hour': - this.minutes(0); - /* falls through */ - case 'minute': - this.seconds(0); - /* falls through */ - case 'second': - this.milliseconds(0); - /* falls through */ - } - - // weeks are a special case - if (units === 'week') { - this.weekday(0); - } else if (units === 'isoWeek') { - this.isoWeekday(1); - } - - // quarters are also special - if (units === 'quarter') { - this.month(Math.floor(this.month() / 3) * 3); - } - - return this; - }, - - endOf: function (units) { - units = normalizeUnits(units); - return this.startOf(units).add((units === 'isoWeek' ? 'week' : units), 1).subtract('ms', 1); - }, - - isAfter: function (input, units) { - units = typeof units !== 'undefined' ? units : 'millisecond'; - return +this.clone().startOf(units) > +moment(input).startOf(units); - }, - - isBefore: function (input, units) { - units = typeof units !== 'undefined' ? units : 'millisecond'; - return +this.clone().startOf(units) < +moment(input).startOf(units); - }, - - isSame: function (input, units) { - units = units || 'ms'; - return +this.clone().startOf(units) === +makeAs(input, this).startOf(units); - }, - - min: function (other) { - other = moment.apply(null, arguments); - return other < this ? this : other; - }, - - max: function (other) { - other = moment.apply(null, arguments); - return other > this ? this : other; - }, - - // keepTime = true means only change the timezone, without affecting - // the local hour. So 5:31:26 +0300 --[zone(2, true)]--> 5:31:26 +0200 - // It is possible that 5:31:26 doesn't exist int zone +0200, so we - // adjust the time as needed, to be valid. - // - // Keeping the time actually adds/subtracts (one hour) - // from the actual represented time. That is why we call updateOffset - // a second time. In case it wants us to change the offset again - // _changeInProgress == true case, then we have to adjust, because - // there is no such time in the given timezone. - zone : function (input, keepTime) { - var offset = this._offset || 0; - if (input != null) { - if (typeof input === "string") { - input = timezoneMinutesFromString(input); - } - if (Math.abs(input) < 16) { - input = input * 60; - } - this._offset = input; - this._isUTC = true; - if (offset !== input) { - if (!keepTime || this._changeInProgress) { - addOrSubtractDurationFromMoment(this, - moment.duration(offset - input, 'm'), 1, false); - } else if (!this._changeInProgress) { - this._changeInProgress = true; - moment.updateOffset(this, true); - this._changeInProgress = null; - } - } - } else { - return this._isUTC ? offset : this._d.getTimezoneOffset(); - } - return this; - }, - - zoneAbbr : function () { - return this._isUTC ? "UTC" : ""; - }, - - zoneName : function () { - return this._isUTC ? "Coordinated Universal Time" : ""; - }, - - parseZone : function () { - if (this._tzm) { - this.zone(this._tzm); - } else if (typeof this._i === 'string') { - this.zone(this._i); - } - return this; - }, - - hasAlignedHourOffset : function (input) { - if (!input) { - input = 0; - } - else { - input = moment(input).zone(); - } - - return (this.zone() - input) % 60 === 0; - }, - - daysInMonth : function () { - return daysInMonth(this.year(), this.month()); - }, - - dayOfYear : function (input) { - var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add("d", (input - dayOfYear)); - }, - - quarter : function (input) { - return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); - }, - - weekYear : function (input) { - var year = weekOfYear(this, this.lang()._week.dow, this.lang()._week.doy).year; - return input == null ? year : this.add("y", (input - year)); - }, - - isoWeekYear : function (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add("y", (input - year)); - }, - - week : function (input) { - var week = this.lang().week(this); - return input == null ? week : this.add("d", (input - week) * 7); - }, - - isoWeek : function (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add("d", (input - week) * 7); - }, - - weekday : function (input) { - var weekday = (this.day() + 7 - this.lang()._week.dow) % 7; - return input == null ? weekday : this.add("d", input - weekday); - }, - - isoWeekday : function (input) { - // behaves the same as moment#day except - // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) - // as a setter, sunday should belong to the previous week. - return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); - }, - - isoWeeksInYear : function () { - return weeksInYear(this.year(), 1, 4); - }, - - weeksInYear : function () { - var weekInfo = this._lang._week; - return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); - }, - - get : function (units) { - units = normalizeUnits(units); - return this[units](); - }, - - set : function (units, value) { - units = normalizeUnits(units); - if (typeof this[units] === 'function') { - this[units](value); - } - return this; - }, - - // If passed a language key, it will set the language for this - // instance. Otherwise, it will return the language configuration - // variables for this instance. - lang : function (key) { - if (key === undefined) { - return this._lang; - } else { - this._lang = getLangDefinition(key); - return this; - } - } - }); - - function rawMonthSetter(mom, value) { - var dayOfMonth; - - // TODO: Move this out of here! - if (typeof value === 'string') { - value = mom.lang().monthsParse(value); - // TODO: Another silent failure? - if (typeof value !== 'number') { - return mom; - } - } - - dayOfMonth = Math.min(mom.date(), - daysInMonth(mom.year(), value)); - mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); - return mom; - } - - function rawGetter(mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); - } - - function rawSetter(mom, unit, value) { - if (unit === 'Month') { - return rawMonthSetter(mom, value); - } else { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); - } - } - - function makeAccessor(unit, keepTime) { - return function (value) { - if (value != null) { - rawSetter(this, unit, value); - moment.updateOffset(this, keepTime); - return this; - } else { - return rawGetter(this, unit); - } - }; - } - - moment.fn.millisecond = moment.fn.milliseconds = makeAccessor('Milliseconds', false); - moment.fn.second = moment.fn.seconds = makeAccessor('Seconds', false); - moment.fn.minute = moment.fn.minutes = makeAccessor('Minutes', false); - // Setting the hour should keep the time, because the user explicitly - // specified which hour he wants. So trying to maintain the same hour (in - // a new timezone) makes sense. Adding/subtracting hours does not follow - // this rule. - moment.fn.hour = moment.fn.hours = makeAccessor('Hours', true); - // moment.fn.month is defined separately - moment.fn.date = makeAccessor('Date', true); - moment.fn.dates = deprecate("dates accessor is deprecated. Use date instead.", makeAccessor('Date', true)); - moment.fn.year = makeAccessor('FullYear', true); - moment.fn.years = deprecate("years accessor is deprecated. Use year instead.", makeAccessor('FullYear', true)); - - // add plural methods - moment.fn.days = moment.fn.day; - moment.fn.months = moment.fn.month; - moment.fn.weeks = moment.fn.week; - moment.fn.isoWeeks = moment.fn.isoWeek; - moment.fn.quarters = moment.fn.quarter; - - // add aliased format methods - moment.fn.toJSON = moment.fn.toISOString; - - /************************************ - Duration Prototype - ************************************/ - - - extend(moment.duration.fn = Duration.prototype, { - - _bubble : function () { - var milliseconds = this._milliseconds, - days = this._days, - months = this._months, - data = this._data, - seconds, minutes, hours, years; - - // The following code bubbles up values, see the tests for - // examples of what that means. - data.milliseconds = milliseconds % 1000; - - seconds = absRound(milliseconds / 1000); - data.seconds = seconds % 60; - - minutes = absRound(seconds / 60); - data.minutes = minutes % 60; - - hours = absRound(minutes / 60); - data.hours = hours % 24; - - days += absRound(hours / 24); - data.days = days % 30; - - months += absRound(days / 30); - data.months = months % 12; - - years = absRound(months / 12); - data.years = years; - }, - - weeks : function () { - return absRound(this.days() / 7); - }, - - valueOf : function () { - return this._milliseconds + - this._days * 864e5 + - (this._months % 12) * 2592e6 + - toInt(this._months / 12) * 31536e6; - }, - - humanize : function (withSuffix) { - var difference = +this, - output = relativeTime(difference, !withSuffix, this.lang()); - - if (withSuffix) { - output = this.lang().pastFuture(difference, output); - } - - return this.lang().postformat(output); - }, - - add : function (input, val) { - // supports only 2.0-style add(1, 's') or add(moment) - var dur = moment.duration(input, val); - - this._milliseconds += dur._milliseconds; - this._days += dur._days; - this._months += dur._months; - - this._bubble(); - - return this; - }, - - subtract : function (input, val) { - var dur = moment.duration(input, val); - - this._milliseconds -= dur._milliseconds; - this._days -= dur._days; - this._months -= dur._months; - - this._bubble(); - - return this; - }, - - get : function (units) { - units = normalizeUnits(units); - return this[units.toLowerCase() + 's'](); - }, - - as : function (units) { - units = normalizeUnits(units); - return this['as' + units.charAt(0).toUpperCase() + units.slice(1) + 's'](); - }, - - lang : moment.fn.lang, - - toIsoString : function () { - // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - var years = Math.abs(this.years()), - months = Math.abs(this.months()), - days = Math.abs(this.days()), - hours = Math.abs(this.hours()), - minutes = Math.abs(this.minutes()), - seconds = Math.abs(this.seconds() + this.milliseconds() / 1000); - - if (!this.asSeconds()) { - // this is the same as C#'s (Noda) and python (isodate)... - // but not other JS (goog.date) - return 'P0D'; - } - - return (this.asSeconds() < 0 ? '-' : '') + - 'P' + - (years ? years + 'Y' : '') + - (months ? months + 'M' : '') + - (days ? days + 'D' : '') + - ((hours || minutes || seconds) ? 'T' : '') + - (hours ? hours + 'H' : '') + - (minutes ? minutes + 'M' : '') + - (seconds ? seconds + 'S' : ''); - } - }); - - function makeDurationGetter(name) { - moment.duration.fn[name] = function () { - return this._data[name]; - }; - } - - function makeDurationAsGetter(name, factor) { - moment.duration.fn['as' + name] = function () { - return +this / factor; - }; - } - - for (i in unitMillisecondFactors) { - if (unitMillisecondFactors.hasOwnProperty(i)) { - makeDurationAsGetter(i, unitMillisecondFactors[i]); - makeDurationGetter(i.toLowerCase()); - } - } - - makeDurationAsGetter('Weeks', 6048e5); - moment.duration.fn.asMonths = function () { - return (+this - this.years() * 31536e6) / 2592e6 + this.years() * 12; - }; - - - /************************************ - Default Lang - ************************************/ - - - // Set default language, other languages will inherit from English. - moment.lang('en', { - ordinal : function (number) { - var b = number % 10, - output = (toInt(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - - /* EMBED_LANGUAGES */ - - /************************************ - Exposing Moment - ************************************/ - - function makeGlobal(shouldDeprecate) { - /*global ender:false */ - if (typeof ender !== 'undefined') { - return; - } - oldGlobalMoment = globalScope.moment; - if (shouldDeprecate) { - globalScope.moment = deprecate( - "Accessing Moment through the global scope is " + - "deprecated, and will be removed in an upcoming " + - "release.", - moment); - } else { - globalScope.moment = moment; - } - } - - // CommonJS module is defined - if (hasModule) { - module.exports = moment; - } else if (typeof define === "function" && define.amd) { - define("moment", function (require, exports, module) { - if (module.config && module.config() && module.config().noGlobal === true) { - // release the global variable - globalScope.moment = oldGlobalMoment; - } - - return moment; - }); - makeGlobal(true); - } else { - makeGlobal(); - } -}).call(this); diff --git a/vendors/moment/package.js b/vendors/moment/package.js deleted file mode 100644 index aba8d502e..000000000 --- a/vendors/moment/package.js +++ /dev/null @@ -1,11 +0,0 @@ -var profile = { - resourceTags: { - ignore: function(filename, mid){ - // only include moment/moment - return mid != "moment/moment"; - }, - amd: function(filename, mid){ - return /\.js$/.test(filename); - } - } -}; diff --git a/vendors/moment/package.json b/vendors/moment/package.json deleted file mode 100644 index 66cfcda1a..000000000 --- a/vendors/moment/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "moment", - "version": "2.6.0", - "description": "Parse, manipulate, and display dates.", - "homepage": "http://momentjs.com", - "author": "Iskren Ivov Chernev (https://github.com/ichernev)", - "contributors": [ - "Tim Wood (http://timwoodcreates.com/)", - "Rocky Meza (http://rockymeza.com)", - "Matt Johnson (http://codeofmatt.com)", - "Isaac Cambron (http://isaaccambron.com)" - ], - "keywords": [ - "moment", - "date", - "time", - "parse", - "format", - "validate", - "i18n", - "l10n", - "ender" - ], - "main": "./moment.js", - "engines": { - "node": "*" - }, - "repository": { - "type": "git", - "url": "https://github.com/moment/moment.git" - }, - "bugs": { - "url": "https://github.com/moment/moment/issues" - }, - "licenses" : [ - { - "type" : "MIT" - } - ], - "devDependencies": { - "uglify-js": "latest", - "grunt": "latest", - "nodeunit": "latest", - "grunt-contrib-jshint": "latest", - "grunt-contrib-nodeunit": "latest", - "grunt-contrib-concat": "latest", - "grunt-contrib-uglify": "latest", - "grunt-contrib-watch": "latest", - "grunt-env": "latest", - "grunt-karma": "latest", - "load-grunt-tasks": "latest", - "karma": "latest", - "karma-chrome-launcher": "latest", - "karma-firefox-launcher": "latest", - "karma-nodeunit": "latest", - "karma-sauce-launcher": "latest" - }, - "scripts": { - "test": "grunt test:node" - }, - "ender": "./ender.js", - "dojoBuild": "package.js", - "jspm": { - "files": ["moment.js", "lang"], - "map": { - "moment": "./moment" - }, - "buildConfig": { - "uglify": true - } - } -} diff --git a/vendors/moment/readme.md b/vendors/moment/readme.md deleted file mode 100644 index 254a9116e..000000000 --- a/vendors/moment/readme.md +++ /dev/null @@ -1,368 +0,0 @@ -A lightweight javascript date library for parsing, validating, manipulating, and formatting dates. - -# [Documentation](http://momentjs.com/docs/) - -Upgrading to 2.0.0 -================== - -There are a number of small backwards incompatible changes with version 2.0.0. - -[See them and their descriptions here](https://gist.github.com/timrwood/e72f2eef320ed9e37c51#backwards-incompatible-changes) - -Changed language ordinal method to return the number + ordinal instead of just the ordinal. - -Changed two digit year parsing cutoff to match strptime. - -Removed `moment#sod` and `moment#eod` in favor of `moment#startOf` and `moment#endOf`. - -Removed `moment.humanizeDuration()` in favor of `moment.duration().humanize()`. - -Removed the lang data objects from the top level namespace. - -Duplicate `Date` passed to `moment()` instead of referencing it. - -Travis Build Status -=================== - -Develop [![Build Status](https://travis-ci.org/moment/moment.png?branch=develop)](https://travis-ci.org/moment/moment) - -Master [![Build Status](https://travis-ci.org/moment/moment.png?branch=master)](https://travis-ci.org/moment/moment) - -For developers -============== - -You need [node](http://nodejs.org/), use [nvm](https://github.com/creationix/nvm) or [nenv](https://github.com/ryuone/nenv) to install it. - -Then, in your shell - -```bash -git clone https://github.com/moment/moment.git -cd moment -npm install -g grunt-cli -npm install -git checkout develop # all patches against develop branch, please! -grunt # this runs tests and jshint -``` - -Changelog -========= - -### 2.6.0 [See changelog](https://gist.github.com/ichernev/10544682) - -* languages - * [#1529](https://github.com/moment/moment/issues/1529) Serbian-Cyrillic (sr-cyr) - * [#1544](https://github.com/moment/moment/issues/1544), [#1546](https://github.com/moment/moment/issues/1546) Khmer Cambodia (km) - -* features - * [#1419](https://github.com/moment/moment/issues/1419), [#1468](https://github.com/moment/moment/issues/1468), [#1467](https://github.com/moment/moment/issues/1467), [#1546](https://github.com/moment/moment/issues/1546) better handling of timezone-d moments around DST - * [#1462](https://github.com/moment/moment/issues/1462) add weeksInYear and isoWeeksInYear - * [#1475](https://github.com/moment/moment/issues/1475) support ordinal parsing - * [#1499](https://github.com/moment/moment/issues/1499) composer support - * [#1577](https://github.com/moment/moment/issues/1577), [#1604](https://github.com/moment/moment/issues/1604) put Date parsing in moment.createFromInputFallback so it can be properly deprecated and controlled in the future - * [#1545](https://github.com/moment/moment/issues/1545) extract two-digit year parsing in moment.parseTwoDigitYear, so it can be overwritten - * [#1590](https://github.com/moment/moment/issues/1590) (see [#1574](https://github.com/moment/moment/issues/1574)) set AMD global before module definition to better support non AMD module dependencies used in AMD environment - * [#1589](https://github.com/moment/moment/issues/1589) remove global in Node.JS environment (was not working before, nobody complained, was scheduled for removal anyway) - * [#1586](https://github.com/moment/moment/issues/1586) support quarter setting and parsing - -* 18 bugs fixed - -### 2.5.1 - -* languages - * [#1392](https://github.com/moment/moment/issues/1392) Armenian (hy-am) - -* bugfixes - * [#1429](https://github.com/moment/moment/issues/1429) fixes [#1423](https://github.com/moment/moment/issues/1423) weird chrome-32 bug with js object creation - * [#1421](https://github.com/moment/moment/issues/1421) remove html entities from Welsh - * [#1418](https://github.com/moment/moment/issues/1418) fixes [#1401](https://github.com/moment/moment/issues/1401) improved non-padded tokens in strict matching - * [#1417](https://github.com/moment/moment/issues/1417) fixes [#1404](https://github.com/moment/moment/issues/1404) handle buggy moment object created by property cloning - * [#1398](https://github.com/moment/moment/issues/1398) fixes [#1397](https://github.com/moment/moment/issues/1397) fix Arabic-like week number parsing - * [#1396](https://github.com/moment/moment/issues/1396) add leftZeroFill(4) to GGGG and gggg formats - * [#1373](https://github.com/moment/moment/issues/1373) use lowercase for months and days in Catalan - -* testing - * [#1374](https://github.com/moment/moment/issues/1374) run tests on multiple browser/os combos via SauceLabs and Travis - -### 2.5.0 [See changelog](https://gist.github.com/ichernev/8104451) - -* New languages - * Luxemburish (lb) [1247](https://github.com/moment/moment/issues/1247) - * Serbian (rs) [1319](https://github.com/moment/moment/issues/1319) - * Tamil (ta) [1324](https://github.com/moment/moment/issues/1324) - * Macedonian (mk) [1337](https://github.com/moment/moment/issues/1337) - -* Features - * [1311](https://github.com/moment/moment/issues/1311) Add quarter getter and format token `Q` - * [1303](https://github.com/moment/moment/issues/1303) strict parsing now respects number of digits per token (fix [1196](https://github.com/moment/moment/issues/1196)) - * 0d30bb7 add jspm support - * [1347](https://github.com/moment/moment/issues/1347) improve zone parsing - * [1362](https://github.com/moment/moment/issues/1362) support merideam parsing in Korean - -* 22 bugfixes - -### 2.4.0 - -* **Deprecate** globally exported moment, will be removed in next major -* New languages - * Farose (fo) [#1206](https://github.com/moment/moment/issues/1206) - * Tagalog/Filipino (tl-ph) [#1197](https://github.com/moment/moment/issues/1197) - * Welsh (cy) [#1215](https://github.com/moment/moment/issues/1215) -* Bugfixes - * properly handle Z at the end of iso RegExp [#1187](https://github.com/moment/moment/issues/1187) - * chinese meridian time improvements [#1076](https://github.com/moment/moment/issues/1076) - * fix language tests [#1177](https://github.com/moment/moment/issues/1177) - * remove some failing tests (that should have never existed :)) - [#1185](https://github.com/moment/moment/issues/1185) - [#1183](https://github.com/moment/moment/issues/1183) - * handle russian noun cases in weird cases [#1195](https://github.com/moment/moment/issues/1195) - -### 2.3.1 - -Removed a trailing comma [1169] and fixed a bug with `months`, `weekdays` getters [#1171](https://github.com/moment/moment/issues/1171). - -### 2.3.0 [See changelog](https://gist.github.com/ichernev/6864354) - -Changed isValid, added strict parsing. -Week tokens parsing. - -### 2.2.1 - -Fixed bug in string prototype test. -Updated authors and contributors. - -### 2.2.0 [See changelog](https://gist.github.com/ichernev/00f837a9baf46a3565e4) - -Added bower support. - -Language files now use UMD. - -Creating moment defaults to current date/month/year. - -Added a bundle of moment and all language files. - -### 2.1.0 [See changelog](https://gist.github.com/timrwood/b8c2d90d528eddb53ab5) - -Added better week support. - -Added ability to set offset with `moment#zone`. - -Added ability to set month or weekday from a string. - -Added `moment#min` and `moment#max` - -### 2.0.0 [See changelog](https://gist.github.com/timrwood/e72f2eef320ed9e37c51) - -Added short form localized tokens. - -Added ability to define language a string should be parsed in. - -Added support for reversed add/subtract arguments. - -Added support for `endOf('week')` and `startOf('week')`. - -Fixed the logic for `moment#diff(Moment, 'months')` and `moment#diff(Moment, 'years')` - -`moment#diff` now floors instead of rounds. - -Normalized `moment#toString`. - -Added `isSame`, `isAfter`, and `isBefore` methods. - -Added better week support. - -Added `moment#toJSON` - -Bugfix: Fixed parsing of first century dates - -Bugfix: Parsing 10Sep2001 should work as expected - -Bugfix: Fixed wierdness with `moment.utc()` parsing. - -Changed language ordinal method to return the number + ordinal instead of just the ordinal. - -Changed two digit year parsing cutoff to match strptime. - -Removed `moment#sod` and `moment#eod` in favor of `moment#startOf` and `moment#endOf`. - -Removed `moment.humanizeDuration()` in favor of `moment.duration().humanize()`. - -Removed the lang data objects from the top level namespace. - -Duplicate `Date` passed to `moment()` instead of referencing it. - -### 1.7.2 [See discussion](https://github.com/timrwood/moment/issues/456) - -Bugfixes - -### 1.7.1 [See discussion](https://github.com/timrwood/moment/issues/384) - -Bugfixes - -### 1.7.0 [See discussion](https://github.com/timrwood/moment/issues/288) - -Added `moment.fn.endOf()` and `moment.fn.startOf()`. - -Added validation via `moment.fn.isValid()`. - -Made formatting method 3x faster. http://jsperf.com/momentjs-cached-format-functions - -Add support for month/weekday callbacks in `moment.fn.format()` - -Added instance specific languages. - -Added two letter weekday abbreviations with the formatting token `dd`. - -Various language updates. - -Various bugfixes. - -### 1.6.0 [See discussion](https://github.com/timrwood/moment/pull/268) - -Added Durations. - -Revamped parser to support parsing non-separated strings (YYYYMMDD vs YYYY-MM-DD). - -Added support for millisecond parsing and formatting tokens (S SS SSS) - -Added a getter for `moment.lang()` - -Various bugfixes. - -There are a few things deprecated in the 1.6.0 release. - -1. The format tokens `z` and `zz` (timezone abbreviations like EST CST MST etc) will no longer be supported. Due to inconsistent browser support, we are unable to consistently produce this value. See [this issue](https://github.com/timrwood/moment/issues/162) for more background. - -2. The method `moment.fn.native` is deprecated in favor of `moment.fn.toDate`. There continue to be issues with Google Closure Compiler throwing errors when using `native`, even in valid instances. - -3. The way to customize am/pm strings is being changed. This would only affect you if you created a custom language file. For more information, see [this issue](https://github.com/timrwood/moment/pull/222). - -### 1.5.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=10&page=1&state=closed) - -Added UTC mode. - -Added automatic ISO8601 parsing. - -Various bugfixes. - -### 1.4.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=8&state=closed) - -Added `moment.fn.toDate` as a replacement for `moment.fn.native`. - -Added `moment.fn.sod` and `moment.fn.eod` to get the start and end of day. - -Various bugfixes. - -### 1.3.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=7&state=closed) - -Added support for parsing month names in the current language. - -Added escape blocks for parsing tokens. - -Added `moment.fn.calendar` to format strings like 'Today 2:30 PM', 'Tomorrow 1:25 AM', and 'Last Sunday 4:30 AM'. - -Added `moment.fn.day` as a setter. - -Various bugfixes - -### 1.2.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=4&state=closed) - -Added timezones to parser and formatter. - -Added `moment.fn.isDST`. - -Added `moment.fn.zone` to get the timezone offset in minutes. - -### 1.1.2 [See milestone](https://github.com/timrwood/moment/issues?milestone=6&state=closed) - -Various bugfixes - -### 1.1.1 [See milestone](https://github.com/timrwood/moment/issues?milestone=5&state=closed) - -Added time specific diffs (months, days, hours, etc) - -### 1.1.0 - -Added `moment.fn.format` localized masks. 'L LL LLL LLLL' [issue 29](https://github.com/timrwood/moment/pull/29) - -Fixed [issue 31](https://github.com/timrwood/moment/pull/31). - -### 1.0.1 - -Added `moment.version` to get the current version. - -Removed `window !== undefined` when checking if module exists to support browserify. [issue 25](https://github.com/timrwood/moment/pull/25) - -### 1.0.0 - -Added convenience methods for getting and setting date parts. - -Added better support for `moment.add()`. - -Added better lang support in NodeJS. - -Renamed library from underscore.date to Moment.js - -### 0.6.1 - -Added Portuguese, Italian, and French language support - -### 0.6.0 - -Added _date.lang() support. -Added support for passing multiple formats to try to parse a date. _date("07-10-1986", ["MM-DD-YYYY", "YYYY-MM-DD"]); -Made parse from string and single format 25% faster. - -### 0.5.2 - -Bugfix for [issue 8](https://github.com/timrwood/underscore.date/pull/8) and [issue 9](https://github.com/timrwood/underscore.date/pull/9). - -### 0.5.1 - -Bugfix for [issue 5](https://github.com/timrwood/underscore.date/pull/5). - -### 0.5.0 - -Dropped the redundant `_date.date()` in favor of `_date()`. -Removed `_date.now()`, as it is a duplicate of `_date()` with no parameters. -Removed `_date.isLeapYear(yearNumber)`. Use `_date([yearNumber]).isLeapYear()` instead. -Exposed customization options through the `_date.relativeTime`, `_date.weekdays`, `_date.weekdaysShort`, `_date.months`, `_date.monthsShort`, and `_date.ordinal` variables instead of the `_date.customize()` function. - -### 0.4.1 - -Added date input formats for input strings. - -### 0.4.0 - -Added underscore.date to npm. Removed dependencies on underscore. - -### 0.3.2 - -Added `'z'` and `'zz'` to `_.date().format()`. Cleaned up some redundant code to trim off some bytes. - -### 0.3.1 - -Cleaned up the namespace. Moved all date manipulation and display functions to the _.date() object. - -### 0.3.0 - -Switched to the Underscore methodology of not mucking with the native objects' prototypes. -Made chaining possible. - -### 0.2.1 - -Changed date names to be a more pseudo standardized 'dddd, MMMM Do YYYY, h:mm:ss a'. -Added `Date.prototype` functions `add`, `subtract`, `isdst`, and `isleapyear`. - -### 0.2.0 - -Changed function names to be more concise. -Changed date format from php date format to custom format. - -### 0.1.0 - -Initial release - -License -======= - -Moment.js is freely distributable under the terms of the MIT license. diff --git a/vendors/opentip/opentip-jquery.js b/vendors/opentip/opentip-jquery.js deleted file mode 100644 index 2ded5e292..000000000 --- a/vendors/opentip/opentip-jquery.js +++ /dev/null @@ -1,1793 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -/* -# -# Opentip v2.4.6 -# -# More info at [www.opentip.org](http://www.opentip.org) -# -# Copyright (c) 2012, Matias Meno -# Graphics by Tjandra Mayerhold -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -*/ - -var Opentip, firstAdapter, i, mouseMoved, mousePosition, mousePositionObservers, position, vendors, _i, _len, _ref, - __slice = [].slice, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - __hasProp = {}.hasOwnProperty; - -Opentip = (function() { - - Opentip.prototype.STICKS_OUT_TOP = 1; - - Opentip.prototype.STICKS_OUT_BOTTOM = 2; - - Opentip.prototype.STICKS_OUT_LEFT = 1; - - Opentip.prototype.STICKS_OUT_RIGHT = 2; - - Opentip.prototype["class"] = { - container: "opentip-container", - opentip: "opentip", - header: "ot-header", - content: "ot-content", - loadingIndicator: "ot-loading-indicator", - close: "ot-close", - goingToHide: "ot-going-to-hide", - hidden: "ot-hidden", - hiding: "ot-hiding", - goingToShow: "ot-going-to-show", - showing: "ot-showing", - visible: "ot-visible", - loading: "ot-loading", - ajaxError: "ot-ajax-error", - fixed: "ot-fixed", - showEffectPrefix: "ot-show-effect-", - hideEffectPrefix: "ot-hide-effect-", - stylePrefix: "style-" - }; - - function Opentip(element, content, title, options) { - var elementsOpentips, hideTrigger, methodToBind, optionSources, prop, styleName, _i, _j, _len, _len1, _ref, _ref1, _ref2, _tmpStyle, - _this = this; - this.id = ++Opentip.lastId; - this.debug("Creating Opentip."); - Opentip.tips.push(this); - this.adapter = Opentip.adapter; - elementsOpentips = this.adapter.data(element, "opentips") || []; - elementsOpentips.push(this); - this.adapter.data(element, "opentips", elementsOpentips); - this.triggerElement = this.adapter.wrap(element); - if (this.triggerElement.length > 1) { - throw new Error("You can't call Opentip on multiple elements."); - } - if (this.triggerElement.length < 1) { - throw new Error("Invalid element."); - } - this.loaded = false; - this.loading = false; - this.visible = false; - this.waitingToShow = false; - this.waitingToHide = false; - this.currentPosition = { - left: 0, - top: 0 - }; - this.dimensions = { - width: 100, - height: 50 - }; - this.content = ""; - this.redraw = true; - this.currentObservers = { - showing: false, - visible: false, - hiding: false, - hidden: false - }; - options = this.adapter.clone(options); - if (typeof content === "object") { - options = content; - content = title = void 0; - } else if (typeof title === "object") { - options = title; - title = void 0; - } - if (title != null) { - options.title = title; - } - if (content != null) { - this.setContent(content); - } - if (options["extends"] == null) { - if (options.style != null) { - options["extends"] = options.style; - } else { - options["extends"] = Opentip.defaultStyle; - } - } - optionSources = [options]; - _tmpStyle = options; - while (_tmpStyle["extends"]) { - styleName = _tmpStyle["extends"]; - _tmpStyle = Opentip.styles[styleName]; - if (_tmpStyle == null) { - throw new Error("Invalid style: " + styleName); - } - optionSources.unshift(_tmpStyle); - if (!((_tmpStyle["extends"] != null) || styleName === "standard")) { - _tmpStyle["extends"] = "standard"; - } - } - options = (_ref = this.adapter).extend.apply(_ref, [{}].concat(__slice.call(optionSources))); - options.hideTriggers = (function() { - var _i, _len, _ref1, _results; - _ref1 = options.hideTriggers; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - hideTrigger = _ref1[_i]; - _results.push(hideTrigger); - } - return _results; - })(); - if (options.hideTrigger && options.hideTriggers.length === 0) { - options.hideTriggers.push(options.hideTrigger); - } - _ref1 = ["tipJoint", "targetJoint", "stem"]; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - prop = _ref1[_i]; - if (options[prop] && typeof options[prop] === "string") { - options[prop] = new Opentip.Joint(options[prop]); - } - } - if (options.ajax && (options.ajax === true || !options.ajax)) { - if (this.adapter.tagName(this.triggerElement) === "A") { - options.ajax = this.adapter.attr(this.triggerElement, "href"); - } else { - options.ajax = false; - } - } - if (options.showOn === "click" && this.adapter.tagName(this.triggerElement) === "A") { - this.adapter.observe(this.triggerElement, "click", function(e) { - e.preventDefault(); - e.stopPropagation(); - return e.stopped = true; - }); - } - if (options.target) { - options.fixed = true; - } - if (options.stem === true) { - options.stem = new Opentip.Joint(options.tipJoint); - } - if (options.target === true) { - options.target = this.triggerElement; - } else if (options.target) { - options.target = this.adapter.wrap(options.target); - } - this.currentStem = options.stem; - if (options.delay == null) { - options.delay = options.showOn === "mouseover" ? 0.2 : 0; - } - if (options.targetJoint == null) { - options.targetJoint = new Opentip.Joint(options.tipJoint).flip(); - } - this.showTriggers = []; - this.showTriggersWhenVisible = []; - this.hideTriggers = []; - if (options.showOn && options.showOn !== "creation") { - this.showTriggers.push({ - element: this.triggerElement, - event: options.showOn - }); - } - if (options.ajaxCache != null) { - options.cache = options.ajaxCache; - delete options.ajaxCache; - } - this.options = options; - this.bound = {}; - _ref2 = ["prepareToShow", "prepareToHide", "show", "hide", "reposition"]; - for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { - methodToBind = _ref2[_j]; - this.bound[methodToBind] = (function(methodToBind) { - return function() { - return _this[methodToBind].apply(_this, arguments); - }; - })(methodToBind); - } - this.adapter.domReady(function() { - _this.activate(); - if (_this.options.showOn === "creation") { - return _this.prepareToShow(); - } - }); - } - - Opentip.prototype._setup = function() { - var hideOn, hideTrigger, hideTriggerElement, i, _i, _j, _len, _len1, _ref, _ref1, _results; - this.debug("Setting up the tooltip."); - this._buildContainer(); - this.hideTriggers = []; - _ref = this.options.hideTriggers; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - hideTrigger = _ref[i]; - hideTriggerElement = null; - hideOn = this.options.hideOn instanceof Array ? this.options.hideOn[i] : this.options.hideOn; - if (typeof hideTrigger === "string") { - switch (hideTrigger) { - case "trigger": - hideOn = hideOn || "mouseout"; - hideTriggerElement = this.triggerElement; - break; - case "tip": - hideOn = hideOn || "mouseover"; - hideTriggerElement = this.container; - break; - case "target": - hideOn = hideOn || "mouseover"; - hideTriggerElement = this.options.target; - break; - case "closeButton": - break; - default: - throw new Error("Unknown hide trigger: " + hideTrigger + "."); - } - } else { - hideOn = hideOn || "mouseover"; - hideTriggerElement = this.adapter.wrap(hideTrigger); - } - if (hideTriggerElement) { - this.hideTriggers.push({ - element: hideTriggerElement, - event: hideOn, - original: hideTrigger - }); - } - } - _ref1 = this.hideTriggers; - _results = []; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - hideTrigger = _ref1[_j]; - _results.push(this.showTriggersWhenVisible.push({ - element: hideTrigger.element, - event: "mouseover" - })); - } - return _results; - }; - - Opentip.prototype._buildContainer = function() { - this.container = this.adapter.create("
    "); - this.adapter.css(this.container, { - position: "absolute" - }); - if (this.options.ajax) { - this.adapter.addClass(this.container, this["class"].loading); - } - if (this.options.fixed) { - this.adapter.addClass(this.container, this["class"].fixed); - } - if (this.options.showEffect) { - this.adapter.addClass(this.container, "" + this["class"].showEffectPrefix + this.options.showEffect); - } - if (this.options.hideEffect) { - return this.adapter.addClass(this.container, "" + this["class"].hideEffectPrefix + this.options.hideEffect); - } - }; - - Opentip.prototype._buildElements = function() { - var headerElement, titleElement; - this.tooltipElement = this.adapter.create("
    "); - this.backgroundCanvas = this.adapter.wrap(document.createElement("canvas")); - this.adapter.css(this.backgroundCanvas, { - position: "absolute" - }); - if (typeof G_vmlCanvasManager !== "undefined" && G_vmlCanvasManager !== null) { - G_vmlCanvasManager.initElement(this.adapter.unwrap(this.backgroundCanvas)); - } - headerElement = this.adapter.find(this.tooltipElement, "." + this["class"].header); - if (this.options.title) { - titleElement = this.adapter.create("

    "); - this.adapter.update(titleElement, this.options.title, this.options.escapeTitle); - this.adapter.append(headerElement, titleElement); - } - if (this.options.ajax && !this.loaded) { - this.adapter.append(this.tooltipElement, this.adapter.create("
    ")); - } - if (__indexOf.call(this.options.hideTriggers, "closeButton") >= 0) { - this.closeButtonElement = this.adapter.create("Close"); - this.adapter.append(headerElement, this.closeButtonElement); - } - this.adapter.append(this.container, this.backgroundCanvas); - this.adapter.append(this.container, this.tooltipElement); - this.adapter.append(document.body, this.container); - this._newContent = true; - return this.redraw = true; - }; - - Opentip.prototype.setContent = function(content) { - this.content = content; - this._newContent = true; - if (typeof this.content === "function") { - this._contentFunction = this.content; - this.content = ""; - } else { - this._contentFunction = null; - } - if (this.visible) { - return this._updateElementContent(); - } - }; - - Opentip.prototype._updateElementContent = function() { - var contentDiv; - if (this._newContent || (!this.options.cache && this._contentFunction)) { - contentDiv = this.adapter.find(this.container, "." + this["class"].content); - if (contentDiv != null) { - if (this._contentFunction) { - this.debug("Executing content function."); - this.content = this._contentFunction(this); - } - this.adapter.update(contentDiv, this.content, this.options.escapeContent); - } - this._newContent = false; - } - this._storeAndLockDimensions(); - return this.reposition(); - }; - - Opentip.prototype._storeAndLockDimensions = function() { - var prevDimension; - if (!this.container) { - return; - } - prevDimension = this.dimensions; - this.adapter.css(this.container, { - width: "auto", - left: "0px", - top: "0px" - }); - this.dimensions = this.adapter.dimensions(this.container); - this.dimensions.width += 1; - this.adapter.css(this.container, { - width: "" + this.dimensions.width + "px", - top: "" + this.currentPosition.top + "px", - left: "" + this.currentPosition.left + "px" - }); - if (!this._dimensionsEqual(this.dimensions, prevDimension)) { - this.redraw = true; - return this._draw(); - } - }; - - Opentip.prototype.activate = function() { - return this._setupObservers("hidden", "hiding"); - }; - - Opentip.prototype.deactivate = function() { - this.debug("Deactivating tooltip."); - this.hide(); - return this._setupObservers("-showing", "-visible", "-hidden", "-hiding"); - }; - - Opentip.prototype._setupObservers = function() { - var observeOrStop, removeObserver, state, states, trigger, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, - _this = this; - states = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - for (_i = 0, _len = states.length; _i < _len; _i++) { - state = states[_i]; - removeObserver = false; - if (state.charAt(0) === "-") { - removeObserver = true; - state = state.substr(1); - } - if (this.currentObservers[state] === !removeObserver) { - continue; - } - this.currentObservers[state] = !removeObserver; - observeOrStop = function() { - var args, _ref, _ref1; - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - if (removeObserver) { - return (_ref = _this.adapter).stopObserving.apply(_ref, args); - } else { - return (_ref1 = _this.adapter).observe.apply(_ref1, args); - } - }; - switch (state) { - case "showing": - _ref = this.hideTriggers; - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - trigger = _ref[_j]; - observeOrStop(trigger.element, trigger.event, this.bound.prepareToHide); - } - observeOrStop((document.onresize != null ? document : window), "resize", this.bound.reposition); - observeOrStop(window, "scroll", this.bound.reposition); - break; - case "visible": - _ref1 = this.showTriggersWhenVisible; - for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { - trigger = _ref1[_k]; - observeOrStop(trigger.element, trigger.event, this.bound.prepareToShow); - } - break; - case "hiding": - _ref2 = this.showTriggers; - for (_l = 0, _len3 = _ref2.length; _l < _len3; _l++) { - trigger = _ref2[_l]; - observeOrStop(trigger.element, trigger.event, this.bound.prepareToShow); - } - break; - case "hidden": - break; - default: - throw new Error("Unknown state: " + state); - } - } - return null; - }; - - Opentip.prototype.prepareToShow = function() { - this._abortHiding(); - this._abortShowing(); - if (this.visible) { - return; - } - this.debug("Showing in " + this.options.delay + "s."); - if (this.container == null) { - this._setup(); - } - if (this.options.group) { - Opentip._abortShowingGroup(this.options.group, this); - } - this.preparingToShow = true; - this._setupObservers("-hidden", "-hiding", "showing"); - this._followMousePosition(); - if (this.options.fixed && !this.options.target) { - this.initialMousePosition = mousePosition; - } - this.reposition(); - return this._showTimeoutId = this.setTimeout(this.bound.show, this.options.delay || 0); - }; - - Opentip.prototype.show = function() { - var _this = this; - this._abortHiding(); - if (this.visible) { - return; - } - this._clearTimeouts(); - if (!this._triggerElementExists()) { - return this.deactivate(); - } - this.debug("Showing now."); - if (this.container == null) { - this._setup(); - } - if (this.options.group) { - Opentip._hideGroup(this.options.group, this); - } - this.visible = true; - this.preparingToShow = false; - if (this.tooltipElement == null) { - this._buildElements(); - } - this._updateElementContent(); - if (this.options.ajax && (!this.loaded || !this.options.cache)) { - this._loadAjax(); - } - this._searchAndActivateCloseButtons(); - this._startEnsureTriggerElement(); - this.adapter.css(this.container, { - zIndex: Opentip.lastZIndex++ - }); - this._setupObservers("-hidden", "-hiding", "-showing", "-visible", "showing", "visible"); - if (this.options.fixed && !this.options.target) { - this.initialMousePosition = mousePosition; - } - this.reposition(); - this.adapter.removeClass(this.container, this["class"].hiding); - this.adapter.removeClass(this.container, this["class"].hidden); - this.adapter.addClass(this.container, this["class"].goingToShow); - this.setCss3Style(this.container, { - transitionDuration: "0s" - }); - this.defer(function() { - var delay; - if (!_this.visible || _this.preparingToHide) { - return; - } - _this.adapter.removeClass(_this.container, _this["class"].goingToShow); - _this.adapter.addClass(_this.container, _this["class"].showing); - delay = 0; - if (_this.options.showEffect && _this.options.showEffectDuration) { - delay = _this.options.showEffectDuration; - } - _this.setCss3Style(_this.container, { - transitionDuration: "" + delay + "s" - }); - _this._visibilityStateTimeoutId = _this.setTimeout(function() { - _this.adapter.removeClass(_this.container, _this["class"].showing); - return _this.adapter.addClass(_this.container, _this["class"].visible); - }, delay); - return _this._activateFirstInput(); - }); - return this._draw(); - }; - - Opentip.prototype._abortShowing = function() { - if (this.preparingToShow) { - this.debug("Aborting showing."); - this._clearTimeouts(); - this._stopFollowingMousePosition(); - this.preparingToShow = false; - return this._setupObservers("-showing", "-visible", "hiding", "hidden"); - } - }; - - Opentip.prototype.prepareToHide = function() { - this._abortShowing(); - this._abortHiding(); - if (!this.visible) { - return; - } - this.debug("Hiding in " + this.options.hideDelay + "s"); - this.preparingToHide = true; - this._setupObservers("-showing", "visible", "-hidden", "hiding"); - return this._hideTimeoutId = this.setTimeout(this.bound.hide, this.options.hideDelay); - }; - - Opentip.prototype.hide = function() { - var _this = this; - this._abortShowing(); - if (!this.visible) { - return; - } - this._clearTimeouts(); - this.debug("Hiding!"); - this.visible = false; - this.preparingToHide = false; - this._stopEnsureTriggerElement(); - this._setupObservers("-showing", "-visible", "-hiding", "-hidden", "hiding", "hidden"); - if (!this.options.fixed) { - this._stopFollowingMousePosition(); - } - if (!this.container) { - return; - } - this.adapter.removeClass(this.container, this["class"].visible); - this.adapter.removeClass(this.container, this["class"].showing); - this.adapter.addClass(this.container, this["class"].goingToHide); - this.setCss3Style(this.container, { - transitionDuration: "0s" - }); - return this.defer(function() { - var hideDelay; - _this.adapter.removeClass(_this.container, _this["class"].goingToHide); - _this.adapter.addClass(_this.container, _this["class"].hiding); - hideDelay = 0; - if (_this.options.hideEffect && _this.options.hideEffectDuration) { - hideDelay = _this.options.hideEffectDuration; - } - _this.setCss3Style(_this.container, { - transitionDuration: "" + hideDelay + "s" - }); - return _this._visibilityStateTimeoutId = _this.setTimeout(function() { - _this.adapter.removeClass(_this.container, _this["class"].hiding); - _this.adapter.addClass(_this.container, _this["class"].hidden); - _this.setCss3Style(_this.container, { - transitionDuration: "0s" - }); - if (_this.options.removeElementsOnHide) { - _this.debug("Removing HTML elements."); - _this.adapter.remove(_this.container); - delete _this.container; - return delete _this.tooltipElement; - } - }, hideDelay); - }); - }; - - Opentip.prototype._abortHiding = function() { - if (this.preparingToHide) { - this.debug("Aborting hiding."); - this._clearTimeouts(); - this.preparingToHide = false; - return this._setupObservers("-hiding", "showing", "visible"); - } - }; - - Opentip.prototype.reposition = function() { - var position, stem, _ref, - _this = this; - position = this.getPosition(); - if (position == null) { - return; - } - stem = this.options.stem; - if (this.options.containInViewport) { - _ref = this._ensureViewportContainment(position), position = _ref.position, stem = _ref.stem; - } - if (this._positionsEqual(position, this.currentPosition)) { - return; - } - if (!(!this.options.stem || stem.eql(this.currentStem))) { - this.redraw = true; - } - this.currentPosition = position; - this.currentStem = stem; - this._draw(); - this.adapter.css(this.container, { - left: "" + position.left + "px", - top: "" + position.top + "px" - }); - return this.defer(function() { - var rawContainer, redrawFix; - rawContainer = _this.adapter.unwrap(_this.container); - rawContainer.style.visibility = "hidden"; - redrawFix = rawContainer.offsetHeight; - return rawContainer.style.visibility = "visible"; - }); - }; - - Opentip.prototype.getPosition = function(tipJoint, targetJoint, stem) { - var additionalHorizontal, additionalVertical, offsetDistance, position, stemLength, targetDimensions, targetPosition, unwrappedTarget, _ref; - if (!this.container) { - return; - } - if (tipJoint == null) { - tipJoint = this.options.tipJoint; - } - if (targetJoint == null) { - targetJoint = this.options.targetJoint; - } - position = {}; - if (this.options.target) { - targetPosition = this.adapter.offset(this.options.target); - targetDimensions = this.adapter.dimensions(this.options.target); - position = targetPosition; - if (targetJoint.right) { - unwrappedTarget = this.adapter.unwrap(this.options.target); - if (unwrappedTarget.getBoundingClientRect != null) { - position.left = unwrappedTarget.getBoundingClientRect().right + ((_ref = window.pageXOffset) != null ? _ref : document.body.scrollLeft); - } else { - position.left += targetDimensions.width; - } - } else if (targetJoint.center) { - position.left += Math.round(targetDimensions.width / 2); - } - if (targetJoint.bottom) { - position.top += targetDimensions.height; - } else if (targetJoint.middle) { - position.top += Math.round(targetDimensions.height / 2); - } - if (this.options.borderWidth) { - if (this.options.tipJoint.left) { - position.left += this.options.borderWidth; - } - if (this.options.tipJoint.right) { - position.left -= this.options.borderWidth; - } - if (this.options.tipJoint.top) { - position.top += this.options.borderWidth; - } else if (this.options.tipJoint.bottom) { - position.top -= this.options.borderWidth; - } - } - } else { - if (this.initialMousePosition) { - position = { - top: this.initialMousePosition.y, - left: this.initialMousePosition.x - }; - } else { - position = { - top: mousePosition.y, - left: mousePosition.x - }; - } - } - if (this.options.autoOffset) { - stemLength = this.options.stem ? this.options.stemLength : 0; - offsetDistance = stemLength && this.options.fixed ? 2 : 10; - additionalHorizontal = tipJoint.middle && !this.options.fixed ? 15 : 0; - additionalVertical = tipJoint.center && !this.options.fixed ? 15 : 0; - if (tipJoint.right) { - position.left -= offsetDistance + additionalHorizontal; - } else if (tipJoint.left) { - position.left += offsetDistance + additionalHorizontal; - } - if (tipJoint.bottom) { - position.top -= offsetDistance + additionalVertical; - } else if (tipJoint.top) { - position.top += offsetDistance + additionalVertical; - } - if (stemLength) { - if (stem == null) { - stem = this.options.stem; - } - if (stem.right) { - position.left -= stemLength; - } else if (stem.left) { - position.left += stemLength; - } - if (stem.bottom) { - position.top -= stemLength; - } else if (stem.top) { - position.top += stemLength; - } - } - } - position.left += this.options.offset[0]; - position.top += this.options.offset[1]; - if (tipJoint.right) { - position.left -= this.dimensions.width; - } else if (tipJoint.center) { - position.left -= Math.round(this.dimensions.width / 2); - } - if (tipJoint.bottom) { - position.top -= this.dimensions.height; - } else if (tipJoint.middle) { - position.top -= Math.round(this.dimensions.height / 2); - } - return position; - }; - - Opentip.prototype._ensureViewportContainment = function(position) { - var needsRepositioning, newSticksOut, originals, revertedX, revertedY, scrollOffset, stem, sticksOut, targetJoint, tipJoint, viewportDimensions, viewportPosition; - stem = this.options.stem; - originals = { - position: position, - stem: stem - }; - if (!(this.visible && position)) { - return originals; - } - sticksOut = this._sticksOut(position); - if (!(sticksOut[0] || sticksOut[1])) { - return originals; - } - tipJoint = new Opentip.Joint(this.options.tipJoint); - if (this.options.targetJoint) { - targetJoint = new Opentip.Joint(this.options.targetJoint); - } - scrollOffset = this.adapter.scrollOffset(); - viewportDimensions = this.adapter.viewportDimensions(); - viewportPosition = [position.left - scrollOffset[0], position.top - scrollOffset[1]]; - needsRepositioning = false; - if (viewportDimensions.width >= this.dimensions.width) { - if (sticksOut[0]) { - needsRepositioning = true; - switch (sticksOut[0]) { - case this.STICKS_OUT_LEFT: - tipJoint.setHorizontal("left"); - if (this.options.targetJoint) { - targetJoint.setHorizontal("right"); - } - break; - case this.STICKS_OUT_RIGHT: - tipJoint.setHorizontal("right"); - if (this.options.targetJoint) { - targetJoint.setHorizontal("left"); - } - } - } - } - if (viewportDimensions.height >= this.dimensions.height) { - if (sticksOut[1]) { - needsRepositioning = true; - switch (sticksOut[1]) { - case this.STICKS_OUT_TOP: - tipJoint.setVertical("top"); - if (this.options.targetJoint) { - targetJoint.setVertical("bottom"); - } - break; - case this.STICKS_OUT_BOTTOM: - tipJoint.setVertical("bottom"); - if (this.options.targetJoint) { - targetJoint.setVertical("top"); - } - } - } - } - if (!needsRepositioning) { - return originals; - } - if (this.options.stem) { - stem = tipJoint; - } - position = this.getPosition(tipJoint, targetJoint, stem); - newSticksOut = this._sticksOut(position); - revertedX = false; - revertedY = false; - if (newSticksOut[0] && (newSticksOut[0] !== sticksOut[0])) { - revertedX = true; - tipJoint.setHorizontal(this.options.tipJoint.horizontal); - if (this.options.targetJoint) { - targetJoint.setHorizontal(this.options.targetJoint.horizontal); - } - } - if (newSticksOut[1] && (newSticksOut[1] !== sticksOut[1])) { - revertedY = true; - tipJoint.setVertical(this.options.tipJoint.vertical); - if (this.options.targetJoint) { - targetJoint.setVertical(this.options.targetJoint.vertical); - } - } - if (revertedX && revertedY) { - return originals; - } - if (revertedX || revertedY) { - if (this.options.stem) { - stem = tipJoint; - } - position = this.getPosition(tipJoint, targetJoint, stem); - } - return { - position: position, - stem: stem - }; - }; - - Opentip.prototype._sticksOut = function(position) { - var positionOffset, scrollOffset, sticksOut, viewportDimensions; - scrollOffset = this.adapter.scrollOffset(); - viewportDimensions = this.adapter.viewportDimensions(); - positionOffset = [position.left - scrollOffset[0], position.top - scrollOffset[1]]; - sticksOut = [false, false]; - if (positionOffset[0] < 0) { - sticksOut[0] = this.STICKS_OUT_LEFT; - } else if (positionOffset[0] + this.dimensions.width > viewportDimensions.width) { - sticksOut[0] = this.STICKS_OUT_RIGHT; - } - if (positionOffset[1] < 0) { - sticksOut[1] = this.STICKS_OUT_TOP; - } else if (positionOffset[1] + this.dimensions.height > viewportDimensions.height) { - sticksOut[1] = this.STICKS_OUT_BOTTOM; - } - return sticksOut; - }; - - Opentip.prototype._draw = function() { - var backgroundCanvas, bulge, canvasDimensions, canvasPosition, closeButton, closeButtonInner, closeButtonOuter, ctx, drawCorner, drawLine, hb, position, stemBase, stemLength, _i, _len, _ref, _ref1, _ref2, - _this = this; - if (!(this.backgroundCanvas && this.redraw)) { - return; - } - this.debug("Drawing background."); - this.redraw = false; - if (this.currentStem) { - _ref = ["top", "right", "bottom", "left"]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - position = _ref[_i]; - this.adapter.removeClass(this.container, "stem-" + position); - } - this.adapter.addClass(this.container, "stem-" + this.currentStem.horizontal); - this.adapter.addClass(this.container, "stem-" + this.currentStem.vertical); - } - closeButtonInner = [0, 0]; - closeButtonOuter = [0, 0]; - if (__indexOf.call(this.options.hideTriggers, "closeButton") >= 0) { - closeButton = new Opentip.Joint(((_ref1 = this.currentStem) != null ? _ref1.toString() : void 0) === "top right" ? "top left" : "top right"); - closeButtonInner = [this.options.closeButtonRadius + this.options.closeButtonOffset[0], this.options.closeButtonRadius + this.options.closeButtonOffset[1]]; - closeButtonOuter = [this.options.closeButtonRadius - this.options.closeButtonOffset[0], this.options.closeButtonRadius - this.options.closeButtonOffset[1]]; - } - canvasDimensions = this.adapter.clone(this.dimensions); - canvasPosition = [0, 0]; - if (this.options.borderWidth) { - canvasDimensions.width += this.options.borderWidth * 2; - canvasDimensions.height += this.options.borderWidth * 2; - canvasPosition[0] -= this.options.borderWidth; - canvasPosition[1] -= this.options.borderWidth; - } - if (this.options.shadow) { - canvasDimensions.width += this.options.shadowBlur * 2; - canvasDimensions.width += Math.max(0, this.options.shadowOffset[0] - this.options.shadowBlur * 2); - canvasDimensions.height += this.options.shadowBlur * 2; - canvasDimensions.height += Math.max(0, this.options.shadowOffset[1] - this.options.shadowBlur * 2); - canvasPosition[0] -= Math.max(0, this.options.shadowBlur - this.options.shadowOffset[0]); - canvasPosition[1] -= Math.max(0, this.options.shadowBlur - this.options.shadowOffset[1]); - } - bulge = { - left: 0, - right: 0, - top: 0, - bottom: 0 - }; - if (this.currentStem) { - if (this.currentStem.left) { - bulge.left = this.options.stemLength; - } else if (this.currentStem.right) { - bulge.right = this.options.stemLength; - } - if (this.currentStem.top) { - bulge.top = this.options.stemLength; - } else if (this.currentStem.bottom) { - bulge.bottom = this.options.stemLength; - } - } - if (closeButton) { - if (closeButton.left) { - bulge.left = Math.max(bulge.left, closeButtonOuter[0]); - } else if (closeButton.right) { - bulge.right = Math.max(bulge.right, closeButtonOuter[0]); - } - if (closeButton.top) { - bulge.top = Math.max(bulge.top, closeButtonOuter[1]); - } else if (closeButton.bottom) { - bulge.bottom = Math.max(bulge.bottom, closeButtonOuter[1]); - } - } - canvasDimensions.width += bulge.left + bulge.right; - canvasDimensions.height += bulge.top + bulge.bottom; - canvasPosition[0] -= bulge.left; - canvasPosition[1] -= bulge.top; - if (this.currentStem && this.options.borderWidth) { - _ref2 = this._getPathStemMeasures(this.options.stemBase, this.options.stemLength, this.options.borderWidth), stemLength = _ref2.stemLength, stemBase = _ref2.stemBase; - } - backgroundCanvas = this.adapter.unwrap(this.backgroundCanvas); - backgroundCanvas.width = canvasDimensions.width; - backgroundCanvas.height = canvasDimensions.height; - this.adapter.css(this.backgroundCanvas, { - width: "" + backgroundCanvas.width + "px", - height: "" + backgroundCanvas.height + "px", - left: "" + canvasPosition[0] + "px", - top: "" + canvasPosition[1] + "px" - }); - ctx = backgroundCanvas.getContext("2d"); - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.clearRect(0, 0, backgroundCanvas.width, backgroundCanvas.height); - ctx.beginPath(); - ctx.fillStyle = this._getColor(ctx, this.dimensions, this.options.background, this.options.backgroundGradientHorizontal); - ctx.lineJoin = "miter"; - ctx.miterLimit = 500; - hb = this.options.borderWidth / 2; - if (this.options.borderWidth) { - ctx.strokeStyle = this.options.borderColor; - ctx.lineWidth = this.options.borderWidth; - } else { - stemLength = this.options.stemLength; - stemBase = this.options.stemBase; - } - if (stemBase == null) { - stemBase = 0; - } - drawLine = function(length, stem, first) { - if (first) { - ctx.moveTo(Math.max(stemBase, _this.options.borderRadius, closeButtonInner[0]) + 1 - hb, -hb); - } - if (stem) { - ctx.lineTo(length / 2 - stemBase / 2, -hb); - ctx.lineTo(length / 2, -stemLength - hb); - return ctx.lineTo(length / 2 + stemBase / 2, -hb); - } - }; - drawCorner = function(stem, closeButton, i) { - var angle1, angle2, innerWidth, offset; - if (stem) { - ctx.lineTo(-stemBase + hb, 0 - hb); - ctx.lineTo(stemLength + hb, -stemLength - hb); - return ctx.lineTo(hb, stemBase - hb); - } else if (closeButton) { - offset = _this.options.closeButtonOffset; - innerWidth = closeButtonInner[0]; - if (i % 2 !== 0) { - offset = [offset[1], offset[0]]; - innerWidth = closeButtonInner[1]; - } - angle1 = Math.acos(offset[1] / _this.options.closeButtonRadius); - angle2 = Math.acos(offset[0] / _this.options.closeButtonRadius); - ctx.lineTo(-innerWidth + hb, -hb); - return ctx.arc(hb - offset[0], -hb + offset[1], _this.options.closeButtonRadius, -(Math.PI / 2 + angle1), angle2, false); - } else { - ctx.lineTo(-_this.options.borderRadius + hb, -hb); - return ctx.quadraticCurveTo(hb, -hb, hb, _this.options.borderRadius - hb); - } - }; - ctx.translate(-canvasPosition[0], -canvasPosition[1]); - ctx.save(); - (function() { - var cornerStem, i, lineLength, lineStem, positionIdx, positionX, positionY, rotation, _j, _ref3, _results; - _results = []; - for (i = _j = 0, _ref3 = Opentip.positions.length / 2; 0 <= _ref3 ? _j < _ref3 : _j > _ref3; i = 0 <= _ref3 ? ++_j : --_j) { - positionIdx = i * 2; - positionX = i === 0 || i === 3 ? 0 : _this.dimensions.width; - positionY = i < 2 ? 0 : _this.dimensions.height; - rotation = (Math.PI / 2) * i; - lineLength = i % 2 === 0 ? _this.dimensions.width : _this.dimensions.height; - lineStem = new Opentip.Joint(Opentip.positions[positionIdx]); - cornerStem = new Opentip.Joint(Opentip.positions[positionIdx + 1]); - ctx.save(); - ctx.translate(positionX, positionY); - ctx.rotate(rotation); - drawLine(lineLength, lineStem.eql(_this.currentStem), i === 0); - ctx.translate(lineLength, 0); - drawCorner(cornerStem.eql(_this.currentStem), cornerStem.eql(closeButton), i); - _results.push(ctx.restore()); - } - return _results; - })(); - ctx.closePath(); - ctx.save(); - if (this.options.shadow) { - ctx.shadowColor = this.options.shadowColor; - ctx.shadowBlur = this.options.shadowBlur; - ctx.shadowOffsetX = this.options.shadowOffset[0]; - ctx.shadowOffsetY = this.options.shadowOffset[1]; - } - ctx.fill(); - ctx.restore(); - if (this.options.borderWidth) { - ctx.stroke(); - } - ctx.restore(); - if (closeButton) { - return (function() { - var crossCenter, crossHeight, crossWidth, hcs, linkCenter; - crossWidth = crossHeight = _this.options.closeButtonRadius * 2; - if (closeButton.toString() === "top right") { - linkCenter = [_this.dimensions.width - _this.options.closeButtonOffset[0], _this.options.closeButtonOffset[1]]; - crossCenter = [linkCenter[0] + hb, linkCenter[1] - hb]; - } else { - linkCenter = [_this.options.closeButtonOffset[0], _this.options.closeButtonOffset[1]]; - crossCenter = [linkCenter[0] - hb, linkCenter[1] - hb]; - } - ctx.translate(crossCenter[0], crossCenter[1]); - hcs = _this.options.closeButtonCrossSize / 2; - ctx.save(); - ctx.beginPath(); - ctx.strokeStyle = _this.options.closeButtonCrossColor; - ctx.lineWidth = _this.options.closeButtonCrossLineWidth; - ctx.lineCap = "round"; - ctx.moveTo(-hcs, -hcs); - ctx.lineTo(hcs, hcs); - ctx.stroke(); - ctx.beginPath(); - ctx.moveTo(hcs, -hcs); - ctx.lineTo(-hcs, hcs); - ctx.stroke(); - ctx.restore(); - return _this.adapter.css(_this.closeButtonElement, { - left: "" + (linkCenter[0] - hcs - _this.options.closeButtonLinkOverscan) + "px", - top: "" + (linkCenter[1] - hcs - _this.options.closeButtonLinkOverscan) + "px", - width: "" + (_this.options.closeButtonCrossSize + _this.options.closeButtonLinkOverscan * 2) + "px", - height: "" + (_this.options.closeButtonCrossSize + _this.options.closeButtonLinkOverscan * 2) + "px" - }); - })(); - } - }; - - Opentip.prototype._getPathStemMeasures = function(outerStemBase, outerStemLength, borderWidth) { - var angle, distanceBetweenTips, halfAngle, hb, rhombusSide, stemBase, stemLength; - hb = borderWidth / 2; - halfAngle = Math.atan((outerStemBase / 2) / outerStemLength); - angle = halfAngle * 2; - rhombusSide = hb / Math.sin(angle); - distanceBetweenTips = 2 * rhombusSide * Math.cos(halfAngle); - stemLength = hb + outerStemLength - distanceBetweenTips; - if (stemLength < 0) { - throw new Error("Sorry but your stemLength / stemBase ratio is strange."); - } - stemBase = (Math.tan(halfAngle) * stemLength) * 2; - return { - stemLength: stemLength, - stemBase: stemBase - }; - }; - - Opentip.prototype._getColor = function(ctx, dimensions, color, horizontal) { - var colorStop, gradient, i, _i, _len; - if (horizontal == null) { - horizontal = false; - } - if (typeof color === "string") { - return color; - } - if (horizontal) { - gradient = ctx.createLinearGradient(0, 0, dimensions.width, 0); - } else { - gradient = ctx.createLinearGradient(0, 0, 0, dimensions.height); - } - for (i = _i = 0, _len = color.length; _i < _len; i = ++_i) { - colorStop = color[i]; - gradient.addColorStop(colorStop[0], colorStop[1]); - } - return gradient; - }; - - Opentip.prototype._searchAndActivateCloseButtons = function() { - var element, _i, _len, _ref; - _ref = this.adapter.findAll(this.container, "." + this["class"].close); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - element = _ref[_i]; - this.hideTriggers.push({ - element: this.adapter.wrap(element), - event: "click" - }); - } - if (this.currentObservers.showing) { - this._setupObservers("-showing", "showing"); - } - if (this.currentObservers.visible) { - return this._setupObservers("-visible", "visible"); - } - }; - - Opentip.prototype._activateFirstInput = function() { - var input; - input = this.adapter.unwrap(this.adapter.find(this.container, "input, textarea")); - return input != null ? typeof input.focus === "function" ? input.focus() : void 0 : void 0; - }; - - Opentip.prototype._followMousePosition = function() { - if (!this.options.fixed) { - return Opentip._observeMousePosition(this.bound.reposition); - } - }; - - Opentip.prototype._stopFollowingMousePosition = function() { - if (!this.options.fixed) { - return Opentip._stopObservingMousePosition(this.bound.reposition); - } - }; - - Opentip.prototype._clearShowTimeout = function() { - return clearTimeout(this._showTimeoutId); - }; - - Opentip.prototype._clearHideTimeout = function() { - return clearTimeout(this._hideTimeoutId); - }; - - Opentip.prototype._clearTimeouts = function() { - clearTimeout(this._visibilityStateTimeoutId); - this._clearShowTimeout(); - return this._clearHideTimeout(); - }; - - Opentip.prototype._triggerElementExists = function() { - var el; - el = this.adapter.unwrap(this.triggerElement); - while (el.parentNode) { - if (el.parentNode.tagName === "BODY") { - return true; - } - el = el.parentNode; - } - return false; - }; - - Opentip.prototype._loadAjax = function() { - var _this = this; - if (this.loading) { - return; - } - this.loaded = false; - this.loading = true; - this.adapter.addClass(this.container, this["class"].loading); - this.setContent(""); - this.debug("Loading content from " + this.options.ajax); - return this.adapter.ajax({ - url: this.options.ajax, - method: this.options.ajaxMethod, - onSuccess: function(responseText) { - _this.debug("Loading successful."); - _this.adapter.removeClass(_this.container, _this["class"].loading); - return _this.setContent(responseText); - }, - onError: function(error) { - var message; - message = _this.options.ajaxErrorMessage; - _this.debug(message, error); - _this.setContent(message); - return _this.adapter.addClass(_this.container, _this["class"].ajaxError); - }, - onComplete: function() { - _this.adapter.removeClass(_this.container, _this["class"].loading); - _this.loading = false; - _this.loaded = true; - _this._searchAndActivateCloseButtons(); - _this._activateFirstInput(); - return _this.reposition(); - } - }); - }; - - Opentip.prototype._ensureTriggerElement = function() { - if (!this._triggerElementExists()) { - this.deactivate(); - return this._stopEnsureTriggerElement(); - } - }; - - Opentip.prototype._ensureTriggerElementInterval = 1000; - - Opentip.prototype._startEnsureTriggerElement = function() { - var _this = this; - return this._ensureTriggerElementTimeoutId = setInterval((function() { - return _this._ensureTriggerElement(); - }), this._ensureTriggerElementInterval); - }; - - Opentip.prototype._stopEnsureTriggerElement = function() { - return clearInterval(this._ensureTriggerElementTimeoutId); - }; - - return Opentip; - -})(); - -vendors = ["khtml", "ms", "o", "moz", "webkit"]; - -Opentip.prototype.setCss3Style = function(element, styles) { - var prop, value, vendor, vendorProp, _results; - element = this.adapter.unwrap(element); - _results = []; - for (prop in styles) { - if (!__hasProp.call(styles, prop)) continue; - value = styles[prop]; - if (element.style[prop] != null) { - _results.push(element.style[prop] = value); - } else { - _results.push((function() { - var _i, _len, _results1; - _results1 = []; - for (_i = 0, _len = vendors.length; _i < _len; _i++) { - vendor = vendors[_i]; - vendorProp = "" + (this.ucfirst(vendor)) + (this.ucfirst(prop)); - if (element.style[vendorProp] != null) { - _results1.push(element.style[vendorProp] = value); - } else { - _results1.push(void 0); - } - } - return _results1; - }).call(this)); - } - } - return _results; -}; - -Opentip.prototype.defer = function(func) { - return setTimeout(func, 0); -}; - -Opentip.prototype.setTimeout = function(func, seconds) { - return setTimeout(func, seconds ? seconds * 1000 : 0); -}; - -Opentip.prototype.ucfirst = function(string) { - if (string == null) { - return ""; - } - return string.charAt(0).toUpperCase() + string.slice(1); -}; - -Opentip.prototype.dasherize = function(string) { - return string.replace(/([A-Z])/g, function(_, character) { - return "-" + (character.toLowerCase()); - }); -}; - -mousePositionObservers = []; - -mousePosition = { - x: 0, - y: 0 -}; - -mouseMoved = function(e) { - var observer, _i, _len, _results; - mousePosition = Opentip.adapter.mousePosition(e); - _results = []; - for (_i = 0, _len = mousePositionObservers.length; _i < _len; _i++) { - observer = mousePositionObservers[_i]; - _results.push(observer()); - } - return _results; -}; - -Opentip.followMousePosition = function() { - return Opentip.adapter.observe(document.body, "mousemove", mouseMoved); -}; - -Opentip._observeMousePosition = function(observer) { - return mousePositionObservers.push(observer); -}; - -Opentip._stopObservingMousePosition = function(removeObserver) { - var observer; - return mousePositionObservers = (function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = mousePositionObservers.length; _i < _len; _i++) { - observer = mousePositionObservers[_i]; - if (observer !== removeObserver) { - _results.push(observer); - } - } - return _results; - })(); -}; - -Opentip.Joint = (function() { - - function Joint(pointerString) { - if (pointerString == null) { - return; - } - if (pointerString instanceof Opentip.Joint) { - pointerString = pointerString.toString(); - } - this.set(pointerString); - this; - - } - - Joint.prototype.set = function(string) { - string = string.toLowerCase(); - this.setHorizontal(string); - this.setVertical(string); - return this; - }; - - Joint.prototype.setHorizontal = function(string) { - var i, valid, _i, _j, _len, _len1, _results; - valid = ["left", "center", "right"]; - for (_i = 0, _len = valid.length; _i < _len; _i++) { - i = valid[_i]; - if (~string.indexOf(i)) { - this.horizontal = i.toLowerCase(); - } - } - if (this.horizontal == null) { - this.horizontal = "center"; - } - _results = []; - for (_j = 0, _len1 = valid.length; _j < _len1; _j++) { - i = valid[_j]; - _results.push(this[i] = this.horizontal === i ? i : void 0); - } - return _results; - }; - - Joint.prototype.setVertical = function(string) { - var i, valid, _i, _j, _len, _len1, _results; - valid = ["top", "middle", "bottom"]; - for (_i = 0, _len = valid.length; _i < _len; _i++) { - i = valid[_i]; - if (~string.indexOf(i)) { - this.vertical = i.toLowerCase(); - } - } - if (this.vertical == null) { - this.vertical = "middle"; - } - _results = []; - for (_j = 0, _len1 = valid.length; _j < _len1; _j++) { - i = valid[_j]; - _results.push(this[i] = this.vertical === i ? i : void 0); - } - return _results; - }; - - Joint.prototype.eql = function(pointer) { - return (pointer != null) && this.horizontal === pointer.horizontal && this.vertical === pointer.vertical; - }; - - Joint.prototype.flip = function() { - var flippedIndex, positionIdx; - positionIdx = Opentip.position[this.toString(true)]; - flippedIndex = (positionIdx + 4) % 8; - this.set(Opentip.positions[flippedIndex]); - return this; - }; - - Joint.prototype.toString = function(camelized) { - var horizontal, vertical; - if (camelized == null) { - camelized = false; - } - vertical = this.vertical === "middle" ? "" : this.vertical; - horizontal = this.horizontal === "center" ? "" : this.horizontal; - if (vertical && horizontal) { - if (camelized) { - horizontal = Opentip.prototype.ucfirst(horizontal); - } else { - horizontal = " " + horizontal; - } - } - return "" + vertical + horizontal; - }; - - return Joint; - -})(); - -Opentip.prototype._positionsEqual = function(posA, posB) { - return (posA != null) && (posB != null) && posA.left === posB.left && posA.top === posB.top; -}; - -Opentip.prototype._dimensionsEqual = function(dimA, dimB) { - return (dimA != null) && (dimB != null) && dimA.width === dimB.width && dimA.height === dimB.height; -}; - -Opentip.prototype.debug = function() { - var args; - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - if (Opentip.debug && ((typeof console !== "undefined" && console !== null ? console.debug : void 0) != null)) { - args.unshift("#" + this.id + " |"); - return console.debug.apply(console, args); - } -}; - -Opentip.findElements = function() { - var adapter, content, element, optionName, optionValue, options, _i, _len, _ref, _results; - adapter = Opentip.adapter; - _ref = adapter.findAll(document.body, "[data-ot]"); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - element = _ref[_i]; - options = {}; - content = adapter.data(element, "ot"); - if (content === "" || content === "true" || content === "yes") { - content = adapter.attr(element, "title"); - adapter.attr(element, "title", ""); - } - content = content || ""; - for (optionName in Opentip.styles.standard) { - optionValue = adapter.data(element, "ot" + (Opentip.prototype.ucfirst(optionName))); - if (optionValue != null) { - if (optionValue === "yes" || optionValue === "true" || optionValue === "on") { - optionValue = true; - } else if (optionValue === "no" || optionValue === "false" || optionValue === "off") { - optionValue = false; - } - options[optionName] = optionValue; - } - } - _results.push(new Opentip(element, content, options)); - } - return _results; -}; - -Opentip.version = "2.4.6"; - -Opentip.debug = false; - -Opentip.lastId = 0; - -Opentip.lastZIndex = 100; - -Opentip.tips = []; - -Opentip._abortShowingGroup = function(group, originatingOpentip) { - var opentip, _i, _len, _ref, _results; - _ref = Opentip.tips; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - opentip = _ref[_i]; - if (opentip !== originatingOpentip && opentip.options.group === group) { - _results.push(opentip._abortShowing()); - } else { - _results.push(void 0); - } - } - return _results; -}; - -Opentip._hideGroup = function(group, originatingOpentip) { - var opentip, _i, _len, _ref, _results; - _ref = Opentip.tips; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - opentip = _ref[_i]; - if (opentip !== originatingOpentip && opentip.options.group === group) { - _results.push(opentip.hide()); - } else { - _results.push(void 0); - } - } - return _results; -}; - -Opentip.adapters = {}; - -Opentip.adapter = null; - -firstAdapter = true; - -Opentip.addAdapter = function(adapter) { - Opentip.adapters[adapter.name] = adapter; - if (firstAdapter) { - Opentip.adapter = adapter; - adapter.domReady(Opentip.findElements); - adapter.domReady(Opentip.followMousePosition); - return firstAdapter = false; - } -}; - -Opentip.positions = ["top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "topLeft"]; - -Opentip.position = {}; - -_ref = Opentip.positions; -for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - position = _ref[i]; - Opentip.position[position] = i; -} - -Opentip.styles = { - standard: { - "extends": null, - title: void 0, - escapeTitle: true, - escapeContent: false, - className: "standard", - stem: true, - delay: null, - hideDelay: 0.1, - fixed: false, - showOn: "mouseover", - hideTrigger: "trigger", - hideTriggers: [], - hideOn: null, - removeElementsOnHide: false, - offset: [0, 0], - containInViewport: true, - autoOffset: true, - showEffect: "appear", - hideEffect: "fade", - showEffectDuration: 0.3, - hideEffectDuration: 0.2, - stemLength: 5, - stemBase: 8, - tipJoint: "top left", - target: null, - targetJoint: null, - cache: true, - ajax: false, - ajaxMethod: "GET", - ajaxErrorMessage: "There was a problem downloading the content.", - group: null, - style: null, - background: "#fff18f", - backgroundGradientHorizontal: false, - closeButtonOffset: [5, 5], - closeButtonRadius: 7, - closeButtonCrossSize: 4, - closeButtonCrossColor: "#d2c35b", - closeButtonCrossLineWidth: 1.5, - closeButtonLinkOverscan: 6, - borderRadius: 5, - borderWidth: 1, - borderColor: "#f2e37b", - shadow: true, - shadowBlur: 10, - shadowOffset: [3, 3], - shadowColor: "rgba(0, 0, 0, 0.1)" - }, - glass: { - "extends": "standard", - className: "glass", - background: [[0, "rgba(252, 252, 252, 0.8)"], [0.5, "rgba(255, 255, 255, 0.8)"], [0.5, "rgba(250, 250, 250, 0.9)"], [1, "rgba(245, 245, 245, 0.9)"]], - borderColor: "#eee", - closeButtonCrossColor: "rgba(0, 0, 0, 0.2)", - borderRadius: 15, - closeButtonRadius: 10, - closeButtonOffset: [8, 8] - }, - dark: { - "extends": "standard", - className: "dark", - borderRadius: 13, - borderColor: "#444", - closeButtonCrossColor: "rgba(240, 240, 240, 1)", - shadowColor: "rgba(0, 0, 0, 0.3)", - shadowOffset: [2, 2], - background: [[0, "rgba(30, 30, 30, 0.7)"], [0.5, "rgba(30, 30, 30, 0.8)"], [0.5, "rgba(10, 10, 10, 0.8)"], [1, "rgba(10, 10, 10, 0.9)"]] - }, - alert: { - "extends": "standard", - className: "alert", - borderRadius: 1, - borderColor: "#AE0D11", - closeButtonCrossColor: "rgba(255, 255, 255, 1)", - shadowColor: "rgba(0, 0, 0, 0.3)", - shadowOffset: [2, 2], - background: [[0, "rgba(203, 15, 19, 0.7)"], [0.5, "rgba(203, 15, 19, 0.8)"], [0.5, "rgba(189, 14, 18, 0.8)"], [1, "rgba(179, 14, 17, 0.9)"]] - } -}; - -Opentip.defaultStyle = "standard"; - -if (typeof module !== "undefined" && module !== null) { - module.exports = Opentip; -} else { - window.Opentip = Opentip; -} - - -// Generated by CoffeeScript 1.4.0 -var __slice = [].slice; - -(function($) { - var Adapter; - $.fn.opentip = function(content, title, options) { - return new Opentip(this, content, title, options); - }; - Adapter = (function() { - - function Adapter() {} - - Adapter.prototype.name = "jquery"; - - Adapter.prototype.domReady = function(callback) { - return $(callback); - }; - - Adapter.prototype.create = function(html) { - return $(html); - }; - - Adapter.prototype.wrap = function(element) { - element = $(element); - if (element.length > 1) { - throw new Error("Multiple elements provided."); - } - return element; - }; - - Adapter.prototype.unwrap = function(element) { - return $(element)[0]; - }; - - Adapter.prototype.tagName = function(element) { - return this.unwrap(element).tagName; - }; - - Adapter.prototype.attr = function() { - var args, element, _ref; - element = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - return (_ref = $(element)).attr.apply(_ref, args); - }; - - Adapter.prototype.data = function() { - var args, element, _ref; - element = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - return (_ref = $(element)).data.apply(_ref, args); - }; - - Adapter.prototype.find = function(element, selector) { - return $(element).find(selector).get(0); - }; - - Adapter.prototype.findAll = function(element, selector) { - return $(element).find(selector); - }; - - Adapter.prototype.update = function(element, content, escape) { - element = $(element); - if (escape) { - return element.text(content); - } else { - return element.html(content); - } - }; - - Adapter.prototype.append = function(element, child) { - return $(element).append(child); - }; - - Adapter.prototype.remove = function(element) { - return $(element).remove(); - }; - - Adapter.prototype.addClass = function(element, className) { - return $(element).addClass(className); - }; - - Adapter.prototype.removeClass = function(element, className) { - return $(element).removeClass(className); - }; - - Adapter.prototype.css = function(element, properties) { - return $(element).css(properties); - }; - - Adapter.prototype.dimensions = function(element) { - return { - width: $(element).outerWidth(), - height: $(element).outerHeight() - }; - }; - - Adapter.prototype.scrollOffset = function() { - return [window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop]; - }; - - Adapter.prototype.viewportDimensions = function() { - return { - width: document.documentElement.clientWidth, - height: document.documentElement.clientHeight - }; - }; - - Adapter.prototype.mousePosition = function(e) { - if (e == null) { - return null; - } - return { - x: e.pageX, - y: e.pageY - }; - }; - - Adapter.prototype.offset = function(element) { - var offset; - offset = $(element).offset(); - return { - left: offset.left, - top: offset.top - }; - }; - - Adapter.prototype.observe = function(element, eventName, observer) { - return $(element).bind(eventName, observer); - }; - - Adapter.prototype.stopObserving = function(element, eventName, observer) { - return $(element).unbind(eventName, observer); - }; - - Adapter.prototype.ajax = function(options) { - var _ref, _ref1; - if (options.url == null) { - throw new Error("No url provided"); - } - return $.ajax({ - url: options.url, - type: (_ref = (_ref1 = options.method) != null ? _ref1.toUpperCase() : void 0) != null ? _ref : "GET" - }).done(function(content) { - return typeof options.onSuccess === "function" ? options.onSuccess(content) : void 0; - }).fail(function(request) { - return typeof options.onError === "function" ? options.onError("Server responded with status " + request.status) : void 0; - }).always(function() { - return typeof options.onComplete === "function" ? options.onComplete() : void 0; - }); - }; - - Adapter.prototype.clone = function(object) { - return $.extend({}, object); - }; - - Adapter.prototype.extend = function() { - var sources, target; - target = arguments[0], sources = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - return $.extend.apply($, [target].concat(__slice.call(sources))); - }; - - return Adapter; - - })(); - return Opentip.addAdapter(new Adapter); -})(jQuery); diff --git a/vendors/opentip/opentip-jquery.min.js b/vendors/opentip/opentip-jquery.min.js deleted file mode 100644 index 3ab9f5a60..000000000 --- a/vendors/opentip/opentip-jquery.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// Opentip v2.4.6 -// Copyright (c) 2009-2012 -// www.opentip.org -// MIT Licensed -var Opentip,firstAdapter,i,mouseMoved,mousePosition,mousePositionObservers,position,vendors,_i,_len,_ref,__slice=[].slice,__indexOf=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(e in this&&this[e]===t)return e;return-1},__hasProp={}.hasOwnProperty;for(Opentip=function(){function t(e,i,o,s){var n,r,a,h,p,d,l,u,c,g,f,m,v,b,w=this;if(this.id=++t.lastId,this.debug("Creating Opentip."),t.tips.push(this),this.adapter=t.adapter,n=this.adapter.data(e,"opentips")||[],n.push(this),this.adapter.data(e,"opentips",n),this.triggerElement=this.adapter.wrap(e),this.triggerElement.length>1)throw Error("You can't call Opentip on multiple elements.");if(1>this.triggerElement.length)throw Error("Invalid element.");this.loaded=!1,this.loading=!1,this.visible=!1,this.waitingToShow=!1,this.waitingToHide=!1,this.currentPosition={left:0,top:0},this.dimensions={width:100,height:50},this.content="",this.redraw=!0,this.currentObservers={showing:!1,visible:!1,hiding:!1,hidden:!1},s=this.adapter.clone(s),typeof i=="object"?(s=i,i=o=void 0):typeof o=="object"&&(s=o,o=void 0),o!=null&&(s.title=o),i!=null&&this.setContent(i),s["extends"]==null&&(s["extends"]=s.style!=null?s.style:t.defaultStyle),h=[s],b=s;while(b["extends"]){if(d=b["extends"],b=t.styles[d],b==null)throw Error("Invalid style: "+d);h.unshift(b),b["extends"]==null&&d!=="standard"&&(b["extends"]="standard")}for(s=(f=this.adapter).extend.apply(f,[{}].concat(__slice.call(h))),s.hideTriggers=function(){var t,e,i,o;for(i=s.hideTriggers,o=[],t=0,e=i.length;e>t;t++)r=i[t],o.push(r);return o}(),s.hideTrigger&&s.hideTriggers.length===0&&s.hideTriggers.push(s.hideTrigger),m=["tipJoint","targetJoint","stem"],l=0,c=m.length;c>l;l++)p=m[l],s[p]&&typeof s[p]=="string"&&(s[p]=new t.Joint(s[p]));for(!s.ajax||s.ajax!==!0&&s.ajax||(s.ajax=this.adapter.tagName(this.triggerElement)==="A"?this.adapter.attr(this.triggerElement,"href"):!1),s.showOn==="click"&&this.adapter.tagName(this.triggerElement)==="A"&&this.adapter.observe(this.triggerElement,"click",function(t){return t.preventDefault(),t.stopPropagation(),t.stopped=!0}),s.target&&(s.fixed=!0),s.stem===!0&&(s.stem=new t.Joint(s.tipJoint)),s.target===!0?s.target=this.triggerElement:s.target&&(s.target=this.adapter.wrap(s.target)),this.currentStem=s.stem,s.delay==null&&(s.delay=s.showOn==="mouseover"?.2:0),s.targetJoint==null&&(s.targetJoint=new t.Joint(s.tipJoint).flip()),this.showTriggers=[],this.showTriggersWhenVisible=[],this.hideTriggers=[],s.showOn&&s.showOn!=="creation"&&this.showTriggers.push({element:this.triggerElement,event:s.showOn}),s.ajaxCache!=null&&(s.cache=s.ajaxCache,delete s.ajaxCache),this.options=s,this.bound={},v=["prepareToShow","prepareToHide","show","hide","reposition"],u=0,g=v.length;g>u;u++)a=v[u],this.bound[a]=function(t){return function(){return w[t].apply(w,arguments)}}(a);this.adapter.domReady(function(){return w.activate(),w.options.showOn==="creation"?w.prepareToShow():void 0})}return t.prototype.STICKS_OUT_TOP=1,t.prototype.STICKS_OUT_BOTTOM=2,t.prototype.STICKS_OUT_LEFT=1,t.prototype.STICKS_OUT_RIGHT=2,t.prototype["class"]={container:"opentip-container",opentip:"opentip",header:"ot-header",content:"ot-content",loadingIndicator:"ot-loading-indicator",close:"ot-close",goingToHide:"ot-going-to-hide",hidden:"ot-hidden",hiding:"ot-hiding",goingToShow:"ot-going-to-show",showing:"ot-showing",visible:"ot-visible",loading:"ot-loading",ajaxError:"ot-ajax-error",fixed:"ot-fixed",showEffectPrefix:"ot-show-effect-",hideEffectPrefix:"ot-hide-effect-",stylePrefix:"style-"},t.prototype._setup=function(){var t,e,i,o,s,n,r,a,h,p,d;for(this.debug("Setting up the tooltip."),this._buildContainer(),this.hideTriggers=[],h=this.options.hideTriggers,o=s=0,r=h.length;r>s;o=++s){if(e=h[o],i=null,t=this.options.hideOn instanceof Array?this.options.hideOn[o]:this.options.hideOn,typeof e=="string")switch(e){case"trigger":t=t||"mouseout",i=this.triggerElement;break;case"tip":t=t||"mouseover",i=this.container;break;case"target":t=t||"mouseover",i=this.options.target;break;case"closeButton":break;default:throw Error("Unknown hide trigger: "+e+".")}else t=t||"mouseover",i=this.adapter.wrap(e);i&&this.hideTriggers.push({element:i,event:t,original:e})}for(p=this.hideTriggers,d=[],n=0,a=p.length;a>n;n++)e=p[n],d.push(this.showTriggersWhenVisible.push({element:e.element,event:"mouseover"}));return d},t.prototype._buildContainer=function(){return this.container=this.adapter.create('
    '),this.adapter.css(this.container,{position:"absolute"}),this.options.ajax&&this.adapter.addClass(this.container,this["class"].loading),this.options.fixed&&this.adapter.addClass(this.container,this["class"].fixed),this.options.showEffect&&this.adapter.addClass(this.container,""+this["class"].showEffectPrefix+this.options.showEffect),this.options.hideEffect?this.adapter.addClass(this.container,""+this["class"].hideEffectPrefix+this.options.hideEffect):void 0},t.prototype._buildElements=function(){var t,e;return this.tooltipElement=this.adapter.create('
    '),this.backgroundCanvas=this.adapter.wrap(document.createElement("canvas")),this.adapter.css(this.backgroundCanvas,{position:"absolute"}),typeof G_vmlCanvasManager!="undefined"&&G_vmlCanvasManager!==null&&G_vmlCanvasManager.initElement(this.adapter.unwrap(this.backgroundCanvas)),t=this.adapter.find(this.tooltipElement,"."+this["class"].header),this.options.title&&(e=this.adapter.create("

    "),this.adapter.update(e,this.options.title,this.options.escapeTitle),this.adapter.append(t,e)),this.options.ajax&&!this.loaded&&this.adapter.append(this.tooltipElement,this.adapter.create('
    ')),__indexOf.call(this.options.hideTriggers,"closeButton")>=0&&(this.closeButtonElement=this.adapter.create('Close'),this.adapter.append(t,this.closeButtonElement)),this.adapter.append(this.container,this.backgroundCanvas),this.adapter.append(this.container,this.tooltipElement),this.adapter.append(document.body,this.container),this._newContent=!0,this.redraw=!0},t.prototype.setContent=function(t){return this.content=t,this._newContent=!0,typeof this.content=="function"?(this._contentFunction=this.content,this.content=""):this._contentFunction=null,this.visible?this._updateElementContent():void 0},t.prototype._updateElementContent=function(){var t;return(this._newContent||!this.options.cache&&this._contentFunction)&&(t=this.adapter.find(this.container,"."+this["class"].content),t!=null&&(this._contentFunction&&(this.debug("Executing content function."),this.content=this._contentFunction(this)),this.adapter.update(t,this.content,this.options.escapeContent)),this._newContent=!1),this._storeAndLockDimensions(),this.reposition()},t.prototype._storeAndLockDimensions=function(){var t;if(this.container)return t=this.dimensions,this.adapter.css(this.container,{width:"auto",left:"0px",top:"0px"}),this.dimensions=this.adapter.dimensions(this.container),this.dimensions.width+=1,this.adapter.css(this.container,{width:""+this.dimensions.width+"px",top:""+this.currentPosition.top+"px",left:""+this.currentPosition.left+"px"}),this._dimensionsEqual(this.dimensions,t)?void 0:(this.redraw=!0,this._draw())},t.prototype.activate=function(){return this._setupObservers("hidden","hiding")},t.prototype.deactivate=function(){return this.debug("Deactivating tooltip."),this.hide(),this._setupObservers("-showing","-visible","-hidden","-hiding")},t.prototype._setupObservers=function(){var t,e,i,o,s,n,r,a,h,p,d,l,u,c,g,f,m=this;for(o=arguments.length>=1?__slice.call(arguments,0):[],n=0,p=o.length;p>n;n++)if(i=o[n],e=!1,i.charAt(0)==="-"&&(e=!0,i=i.substr(1)),this.currentObservers[i]!==!e)switch(this.currentObservers[i]=!e,t=function(){var t,i,o;return t=arguments.length>=1?__slice.call(arguments,0):[],e?(i=m.adapter).stopObserving.apply(i,t):(o=m.adapter).observe.apply(o,t)},i){case"showing":for(c=this.hideTriggers,r=0,d=c.length;d>r;r++)s=c[r],t(s.element,s.event,this.bound.prepareToHide);t(document.onresize!=null?document:window,"resize",this.bound.reposition),t(window,"scroll",this.bound.reposition);break;case"visible":for(g=this.showTriggersWhenVisible,a=0,l=g.length;l>a;a++)s=g[a],t(s.element,s.event,this.bound.prepareToShow);break;case"hiding":for(f=this.showTriggers,h=0,u=f.length;u>h;h++)s=f[h],t(s.element,s.event,this.bound.prepareToShow);break;case"hidden":break;default:throw Error("Unknown state: "+i)}return null},t.prototype.prepareToShow=function(){return this._abortHiding(),this._abortShowing(),this.visible?void 0:(this.debug("Showing in "+this.options.delay+"s."),this.container==null&&this._setup(),this.options.group&&t._abortShowingGroup(this.options.group,this),this.preparingToShow=!0,this._setupObservers("-hidden","-hiding","showing"),this._followMousePosition(),this.options.fixed&&!this.options.target&&(this.initialMousePosition=mousePosition),this.reposition(),this._showTimeoutId=this.setTimeout(this.bound.show,this.options.delay||0))},t.prototype.show=function(){var e=this;return this._abortHiding(),this.visible?void 0:(this._clearTimeouts(),this._triggerElementExists()?(this.debug("Showing now."),this.container==null&&this._setup(),this.options.group&&t._hideGroup(this.options.group,this),this.visible=!0,this.preparingToShow=!1,this.tooltipElement==null&&this._buildElements(),this._updateElementContent(),!this.options.ajax||this.loaded&&this.options.cache||this._loadAjax(),this._searchAndActivateCloseButtons(),this._startEnsureTriggerElement(),this.adapter.css(this.container,{zIndex:t.lastZIndex++}),this._setupObservers("-hidden","-hiding","-showing","-visible","showing","visible"),this.options.fixed&&!this.options.target&&(this.initialMousePosition=mousePosition),this.reposition(),this.adapter.removeClass(this.container,this["class"].hiding),this.adapter.removeClass(this.container,this["class"].hidden),this.adapter.addClass(this.container,this["class"].goingToShow),this.setCss3Style(this.container,{transitionDuration:"0s"}),this.defer(function(){var t;if(e.visible&&!e.preparingToHide)return e.adapter.removeClass(e.container,e["class"].goingToShow),e.adapter.addClass(e.container,e["class"].showing),t=0,e.options.showEffect&&e.options.showEffectDuration&&(t=e.options.showEffectDuration),e.setCss3Style(e.container,{transitionDuration:""+t+"s"}),e._visibilityStateTimeoutId=e.setTimeout(function(){return e.adapter.removeClass(e.container,e["class"].showing),e.adapter.addClass(e.container,e["class"].visible)},t),e._activateFirstInput()}),this._draw()):this.deactivate())},t.prototype._abortShowing=function(){return this.preparingToShow?(this.debug("Aborting showing."),this._clearTimeouts(),this._stopFollowingMousePosition(),this.preparingToShow=!1,this._setupObservers("-showing","-visible","hiding","hidden")):void 0},t.prototype.prepareToHide=function(){return this._abortShowing(),this._abortHiding(),this.visible?(this.debug("Hiding in "+this.options.hideDelay+"s"),this.preparingToHide=!0,this._setupObservers("-showing","visible","-hidden","hiding"),this._hideTimeoutId=this.setTimeout(this.bound.hide,this.options.hideDelay)):void 0},t.prototype.hide=function(){var t=this;return this._abortShowing(),this.visible&&(this._clearTimeouts(),this.debug("Hiding!"),this.visible=!1,this.preparingToHide=!1,this._stopEnsureTriggerElement(),this._setupObservers("-showing","-visible","-hiding","-hidden","hiding","hidden"),this.options.fixed||this._stopFollowingMousePosition(),this.container)?(this.adapter.removeClass(this.container,this["class"].visible),this.adapter.removeClass(this.container,this["class"].showing),this.adapter.addClass(this.container,this["class"].goingToHide),this.setCss3Style(this.container,{transitionDuration:"0s"}),this.defer(function(){var e;return t.adapter.removeClass(t.container,t["class"].goingToHide),t.adapter.addClass(t.container,t["class"].hiding),e=0,t.options.hideEffect&&t.options.hideEffectDuration&&(e=t.options.hideEffectDuration),t.setCss3Style(t.container,{transitionDuration:""+e+"s"}),t._visibilityStateTimeoutId=t.setTimeout(function(){return t.adapter.removeClass(t.container,t["class"].hiding),t.adapter.addClass(t.container,t["class"].hidden),t.setCss3Style(t.container,{transitionDuration:"0s"}),t.options.removeElementsOnHide?(t.debug("Removing HTML elements."),t.adapter.remove(t.container),delete t.container,delete t.tooltipElement):void 0},e)})):void 0},t.prototype._abortHiding=function(){return this.preparingToHide?(this.debug("Aborting hiding."),this._clearTimeouts(),this.preparingToHide=!1,this._setupObservers("-hiding","showing","visible")):void 0},t.prototype.reposition=function(){var t,e,i,o=this;return t=this.getPosition(),t==null||(e=this.options.stem,this.options.containInViewport&&(i=this._ensureViewportContainment(t),t=i.position,e=i.stem),this._positionsEqual(t,this.currentPosition))?void 0:(this.options.stem&&!e.eql(this.currentStem)&&(this.redraw=!0),this.currentPosition=t,this.currentStem=e,this._draw(),this.adapter.css(this.container,{left:""+t.left+"px",top:""+t.top+"px"}),this.defer(function(){var t,e;return t=o.adapter.unwrap(o.container),t.style.visibility="hidden",e=t.offsetHeight,t.style.visibility="visible"}))},t.prototype.getPosition=function(t,e,i){var o,s,n,r,a,h,p,d,l;if(this.container)return t==null&&(t=this.options.tipJoint),e==null&&(e=this.options.targetJoint),r={},this.options.target?(p=this.adapter.offset(this.options.target),h=this.adapter.dimensions(this.options.target),r=p,e.right?(d=this.adapter.unwrap(this.options.target),d.getBoundingClientRect!=null?r.left=d.getBoundingClientRect().right+((l=window.pageXOffset)!=null?l:document.body.scrollLeft):r.left+=h.width):e.center&&(r.left+=Math.round(h.width/2)),e.bottom?r.top+=h.height:e.middle&&(r.top+=Math.round(h.height/2)),this.options.borderWidth&&(this.options.tipJoint.left&&(r.left+=this.options.borderWidth),this.options.tipJoint.right&&(r.left-=this.options.borderWidth),this.options.tipJoint.top?r.top+=this.options.borderWidth:this.options.tipJoint.bottom&&(r.top-=this.options.borderWidth))):r=this.initialMousePosition?{top:this.initialMousePosition.y,left:this.initialMousePosition.x}:{top:mousePosition.y,left:mousePosition.x},this.options.autoOffset&&(a=this.options.stem?this.options.stemLength:0,n=a&&this.options.fixed?2:10,o=t.middle&&!this.options.fixed?15:0,s=t.center&&!this.options.fixed?15:0,t.right?r.left-=n+o:t.left&&(r.left+=n+o),t.bottom?r.top-=n+s:t.top&&(r.top+=n+s),a&&(i==null&&(i=this.options.stem),i.right?r.left-=a:i.left&&(r.left+=a),i.bottom?r.top-=a:i.top&&(r.top+=a))),r.left+=this.options.offset[0],r.top+=this.options.offset[1],t.right?r.left-=this.dimensions.width:t.center&&(r.left-=Math.round(this.dimensions.width/2)),t.bottom?r.top-=this.dimensions.height:t.middle&&(r.top-=Math.round(this.dimensions.height/2)),r},t.prototype._ensureViewportContainment=function(e){var i,o,s,n,r,a,h,p,d,l,u,c;if(h=this.options.stem,s={position:e,stem:h},!this.visible||!e)return s;if(p=this._sticksOut(e),!p[0]&&!p[1])return s;if(l=new t.Joint(this.options.tipJoint),this.options.targetJoint&&(d=new t.Joint(this.options.targetJoint)),a=this.adapter.scrollOffset(),u=this.adapter.viewportDimensions(),c=[e.left-a[0],e.top-a[1]],i=!1,u.width>=this.dimensions.width&&p[0])switch(i=!0,p[0]){case this.STICKS_OUT_LEFT:l.setHorizontal("left"),this.options.targetJoint&&d.setHorizontal("right");break;case this.STICKS_OUT_RIGHT:l.setHorizontal("right"),this.options.targetJoint&&d.setHorizontal("left")}if(u.height>=this.dimensions.height&&p[1])switch(i=!0,p[1]){case this.STICKS_OUT_TOP:l.setVertical("top"),this.options.targetJoint&&d.setVertical("bottom");break;case this.STICKS_OUT_BOTTOM:l.setVertical("bottom"),this.options.targetJoint&&d.setVertical("top")}return i?(this.options.stem&&(h=l),e=this.getPosition(l,d,h),o=this._sticksOut(e),n=!1,r=!1,o[0]&&o[0]!==p[0]&&(n=!0,l.setHorizontal(this.options.tipJoint.horizontal),this.options.targetJoint&&d.setHorizontal(this.options.targetJoint.horizontal)),o[1]&&o[1]!==p[1]&&(r=!0,l.setVertical(this.options.tipJoint.vertical),this.options.targetJoint&&d.setVertical(this.options.targetJoint.vertical)),n&&r?s:((n||r)&&(this.options.stem&&(h=l),e=this.getPosition(l,d,h)),{position:e,stem:h})):s},t.prototype._sticksOut=function(t){var e,i,o,s;return i=this.adapter.scrollOffset(),s=this.adapter.viewportDimensions(),e=[t.left-i[0],t.top-i[1]],o=[!1,!1],0>e[0]?o[0]=this.STICKS_OUT_LEFT:e[0]+this.dimensions.width>s.width&&(o[0]=this.STICKS_OUT_RIGHT),0>e[1]?o[1]=this.STICKS_OUT_TOP:e[1]+this.dimensions.height>s.height&&(o[1]=this.STICKS_OUT_BOTTOM),o},t.prototype._draw=function(){var e,i,o,s,n,r,a,h,p,d,l,u,c,g,f,m,v,b,w,_=this;if(this.backgroundCanvas&&this.redraw){if(this.debug("Drawing background."),this.redraw=!1,this.currentStem){for(v=["top","right","bottom","left"],f=0,m=v.length;m>f;f++)u=v[f],this.adapter.removeClass(this.container,"stem-"+u);this.adapter.addClass(this.container,"stem-"+this.currentStem.horizontal),this.adapter.addClass(this.container,"stem-"+this.currentStem.vertical)}return r=[0,0],a=[0,0],__indexOf.call(this.options.hideTriggers,"closeButton")>=0&&(n=new t.Joint(((b=this.currentStem)!=null?b+"":void 0)==="top right"?"top left":"top right"),r=[this.options.closeButtonRadius+this.options.closeButtonOffset[0],this.options.closeButtonRadius+this.options.closeButtonOffset[1]],a=[this.options.closeButtonRadius-this.options.closeButtonOffset[0],this.options.closeButtonRadius-this.options.closeButtonOffset[1]]),o=this.adapter.clone(this.dimensions),s=[0,0],this.options.borderWidth&&(o.width+=this.options.borderWidth*2,o.height+=this.options.borderWidth*2,s[0]-=this.options.borderWidth,s[1]-=this.options.borderWidth),this.options.shadow&&(o.width+=this.options.shadowBlur*2,o.width+=Math.max(0,this.options.shadowOffset[0]-this.options.shadowBlur*2),o.height+=this.options.shadowBlur*2,o.height+=Math.max(0,this.options.shadowOffset[1]-this.options.shadowBlur*2),s[0]-=Math.max(0,this.options.shadowBlur-this.options.shadowOffset[0]),s[1]-=Math.max(0,this.options.shadowBlur-this.options.shadowOffset[1])),i={left:0,right:0,top:0,bottom:0},this.currentStem&&(this.currentStem.left?i.left=this.options.stemLength:this.currentStem.right&&(i.right=this.options.stemLength),this.currentStem.top?i.top=this.options.stemLength:this.currentStem.bottom&&(i.bottom=this.options.stemLength)),n&&(n.left?i.left=Math.max(i.left,a[0]):n.right&&(i.right=Math.max(i.right,a[0])),n.top?i.top=Math.max(i.top,a[1]):n.bottom&&(i.bottom=Math.max(i.bottom,a[1]))),o.width+=i.left+i.right,o.height+=i.top+i.bottom,s[0]-=i.left,s[1]-=i.top,this.currentStem&&this.options.borderWidth&&(w=this._getPathStemMeasures(this.options.stemBase,this.options.stemLength,this.options.borderWidth),g=w.stemLength,c=w.stemBase),e=this.adapter.unwrap(this.backgroundCanvas),e.width=o.width,e.height=o.height,this.adapter.css(this.backgroundCanvas,{width:""+e.width+"px",height:""+e.height+"px",left:""+s[0]+"px",top:""+s[1]+"px"}),h=e.getContext("2d"),h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,e.width,e.height),h.beginPath(),h.fillStyle=this._getColor(h,this.dimensions,this.options.background,this.options.backgroundGradientHorizontal),h.lineJoin="miter",h.miterLimit=500,l=this.options.borderWidth/2,this.options.borderWidth?(h.strokeStyle=this.options.borderColor,h.lineWidth=this.options.borderWidth):(g=this.options.stemLength,c=this.options.stemBase),c==null&&(c=0),d=function(t,e,i){return i&&h.moveTo(Math.max(c,_.options.borderRadius,r[0])+1-l,-l),e?(h.lineTo(t/2-c/2,-l),h.lineTo(t/2,-g-l),h.lineTo(t/2+c/2,-l)):void 0},p=function(t,e,i){var o,s,n,a;return t?(h.lineTo(-c+l,0-l),h.lineTo(g+l,-g-l),h.lineTo(l,c-l)):e?(a=_.options.closeButtonOffset,n=r[0],i%2!==0&&(a=[a[1],a[0]],n=r[1]),o=Math.acos(a[1]/_.options.closeButtonRadius),s=Math.acos(a[0]/_.options.closeButtonRadius),h.lineTo(-n+l,-l),h.arc(l-a[0],-l+a[1],_.options.closeButtonRadius,-(Math.PI/2+o),s,!1)):(h.lineTo(-_.options.borderRadius+l,-l),h.quadraticCurveTo(l,-l,l,_.options.borderRadius-l))},h.translate(-s[0],-s[1]),h.save(),function(){var e,i,o,s,r,a,l,u,c,g,f;for(f=[],i=c=0,g=t.positions.length/2;g>=0?g>c:c>g;i=g>=0?++c:--c)r=i*2,a=i===0||i===3?0:_.dimensions.width,l=2>i?0:_.dimensions.height,u=Math.PI/2*i,o=i%2===0?_.dimensions.width:_.dimensions.height,s=new t.Joint(t.positions[r]),e=new t.Joint(t.positions[r+1]),h.save(),h.translate(a,l),h.rotate(u),d(o,s.eql(_.currentStem),i===0),h.translate(o,0),p(e.eql(_.currentStem),e.eql(n),i),f.push(h.restore());return f}(),h.closePath(),h.save(),this.options.shadow&&(h.shadowColor=this.options.shadowColor,h.shadowBlur=this.options.shadowBlur,h.shadowOffsetX=this.options.shadowOffset[0],h.shadowOffsetY=this.options.shadowOffset[1]),h.fill(),h.restore(),this.options.borderWidth&&h.stroke(),h.restore(),n?function(){var t,e,i,o,s;return i=e=_.options.closeButtonRadius*2,n+""=="top right"?(s=[_.dimensions.width-_.options.closeButtonOffset[0],_.options.closeButtonOffset[1]],t=[s[0]+l,s[1]-l]):(s=[_.options.closeButtonOffset[0],_.options.closeButtonOffset[1]],t=[s[0]-l,s[1]-l]),h.translate(t[0],t[1]),o=_.options.closeButtonCrossSize/2,h.save(),h.beginPath(),h.strokeStyle=_.options.closeButtonCrossColor,h.lineWidth=_.options.closeButtonCrossLineWidth,h.lineCap="round",h.moveTo(-o,-o),h.lineTo(o,o),h.stroke(),h.beginPath(),h.moveTo(o,-o),h.lineTo(-o,o),h.stroke(),h.restore(),_.adapter.css(_.closeButtonElement,{left:""+(s[0]-o-_.options.closeButtonLinkOverscan)+"px",top:""+(s[1]-o-_.options.closeButtonLinkOverscan)+"px",width:""+(_.options.closeButtonCrossSize+_.options.closeButtonLinkOverscan*2)+"px",height:""+(_.options.closeButtonCrossSize+_.options.closeButtonLinkOverscan*2)+"px"})}():void 0}},t.prototype._getPathStemMeasures=function(t,e,i){var o,s,n,r,a,h,p;if(r=i/2,n=Math.atan(t/2/e),o=n*2,a=r/Math.sin(o),s=2*a*Math.cos(n),p=r+e-s,0>p)throw Error("Sorry but your stemLength / stemBase ratio is strange.");return h=Math.tan(n)*p*2,{stemLength:p,stemBase:h}},t.prototype._getColor=function(t,e,i,o){var s,n,r,a,h;if(o==null&&(o=!1),typeof i=="string")return i;for(n=o?t.createLinearGradient(0,0,e.width,0):t.createLinearGradient(0,0,0,e.height),r=a=0,h=i.length;h>a;r=++a)s=i[r],n.addColorStop(s[0],s[1]);return n},t.prototype._searchAndActivateCloseButtons=function(){var t,e,i,o;for(o=this.adapter.findAll(this.container,"."+this["class"].close),e=0,i=o.length;i>e;e++)t=o[e],this.hideTriggers.push({element:this.adapter.wrap(t),event:"click"});return this.currentObservers.showing&&this._setupObservers("-showing","showing"),this.currentObservers.visible?this._setupObservers("-visible","visible"):void 0},t.prototype._activateFirstInput=function(){var t;return t=this.adapter.unwrap(this.adapter.find(this.container,"input, textarea")),t!=null?typeof t.focus=="function"?t.focus():void 0:void 0},t.prototype._followMousePosition=function(){return this.options.fixed?void 0:t._observeMousePosition(this.bound.reposition)},t.prototype._stopFollowingMousePosition=function(){return this.options.fixed?void 0:t._stopObservingMousePosition(this.bound.reposition)},t.prototype._clearShowTimeout=function(){return clearTimeout(this._showTimeoutId)},t.prototype._clearHideTimeout=function(){return clearTimeout(this._hideTimeoutId)},t.prototype._clearTimeouts=function(){return clearTimeout(this._visibilityStateTimeoutId),this._clearShowTimeout(),this._clearHideTimeout()},t.prototype._triggerElementExists=function(){var t;t=this.adapter.unwrap(this.triggerElement);while(t.parentNode){if(t.parentNode.tagName==="BODY")return!0;t=t.parentNode}return!1},t.prototype._loadAjax=function(){var t=this;if(!this.loading)return this.loaded=!1,this.loading=!0,this.adapter.addClass(this.container,this["class"].loading),this.setContent(""),this.debug("Loading content from "+this.options.ajax),this.adapter.ajax({url:this.options.ajax,method:this.options.ajaxMethod,onSuccess:function(e){return t.debug("Loading successful."),t.adapter.removeClass(t.container,t["class"].loading),t.setContent(e)},onError:function(e){var i;return i=t.options.ajaxErrorMessage,t.debug(i,e),t.setContent(i),t.adapter.addClass(t.container,t["class"].ajaxError)},onComplete:function(){return t.adapter.removeClass(t.container,t["class"].loading),t.loading=!1,t.loaded=!0,t._searchAndActivateCloseButtons(),t._activateFirstInput(),t.reposition()}})},t.prototype._ensureTriggerElement=function(){return this._triggerElementExists()?void 0:(this.deactivate(),this._stopEnsureTriggerElement())},t.prototype._ensureTriggerElementInterval=1e3,t.prototype._startEnsureTriggerElement=function(){var t=this;return this._ensureTriggerElementTimeoutId=setInterval(function(){return t._ensureTriggerElement()},this._ensureTriggerElementInterval)},t.prototype._stopEnsureTriggerElement=function(){return clearInterval(this._ensureTriggerElementTimeoutId)},t}(),vendors=["khtml","ms","o","moz","webkit"],Opentip.prototype.setCss3Style=function(t,e){var i,o,s,n,r;t=this.adapter.unwrap(t),r=[];for(i in e)__hasProp.call(e,i)&&(o=e[i],t.style[i]!=null?r.push(t.style[i]=o):r.push(function(){var e,r,a;for(a=[],e=0,r=vendors.length;r>e;e++)s=vendors[e],n=""+this.ucfirst(s)+this.ucfirst(i),t.style[n]!=null?a.push(t.style[n]=o):a.push(void 0);return a}.call(this)));return r},Opentip.prototype.defer=function(t){return setTimeout(t,0)},Opentip.prototype.setTimeout=function(t,e){return setTimeout(t,e?e*1e3:0)},Opentip.prototype.ucfirst=function(t){return t==null?"":t.charAt(0).toUpperCase()+t.slice(1)},Opentip.prototype.dasherize=function(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})},mousePositionObservers=[],mousePosition={x:0,y:0},mouseMoved=function(t){var e,i,o,s;for(mousePosition=Opentip.adapter.mousePosition(t),s=[],i=0,o=mousePositionObservers.length;o>i;i++)e=mousePositionObservers[i],s.push(e());return s},Opentip.followMousePosition=function(){return Opentip.adapter.observe(document.body,"mousemove",mouseMoved)},Opentip._observeMousePosition=function(t){return mousePositionObservers.push(t)},Opentip._stopObservingMousePosition=function(t){var e;return mousePositionObservers=function(){var i,o,s;for(s=[],i=0,o=mousePositionObservers.length;o>i;i++)e=mousePositionObservers[i],e!==t&&s.push(e);return s}()},Opentip.Joint=function(){function t(t){t!=null&&(t instanceof Opentip.Joint&&(t+=""),this.set(t))}return t.prototype.set=function(t){return t=t.toLowerCase(),this.setHorizontal(t),this.setVertical(t),this},t.prototype.setHorizontal=function(t){var e,i,o,s,n,r,a;for(i=["left","center","right"],o=0,n=i.length;n>o;o++)e=i[o],~t.indexOf(e)&&(this.horizontal=e.toLowerCase());for(this.horizontal==null&&(this.horizontal="center"),a=[],s=0,r=i.length;r>s;s++)e=i[s],a.push(this[e]=this.horizontal===e?e:void 0);return a},t.prototype.setVertical=function(t){var e,i,o,s,n,r,a;for(i=["top","middle","bottom"],o=0,n=i.length;n>o;o++)e=i[o],~t.indexOf(e)&&(this.vertical=e.toLowerCase());for(this.vertical==null&&(this.vertical="middle"),a=[],s=0,r=i.length;r>s;s++)e=i[s],a.push(this[e]=this.vertical===e?e:void 0);return a},t.prototype.eql=function(t){return t!=null&&this.horizontal===t.horizontal&&this.vertical===t.vertical},t.prototype.flip=function(){var t,e;return e=Opentip.position[this.toString(!0)],t=(e+4)%8,this.set(Opentip.positions[t]),this},t.prototype.toString=function(t){var e,i;return t==null&&(t=!1),i=this.vertical==="middle"?"":this.vertical,e=this.horizontal==="center"?"":this.horizontal,i&&e&&(e=t?Opentip.prototype.ucfirst(e):" "+e),""+i+e},t}(),Opentip.prototype._positionsEqual=function(t,e){return t!=null&&e!=null&&t.left===e.left&&t.top===e.top},Opentip.prototype._dimensionsEqual=function(t,e){return t!=null&&e!=null&&t.width===e.width&&t.height===e.height},Opentip.prototype.debug=function(){var t;return t=arguments.length>=1?__slice.call(arguments,0):[],Opentip.debug&&(typeof console!="undefined"&&console!==null?console.debug:void 0)!=null?(t.unshift("#"+this.id+" |"),console.debug.apply(console,t)):void 0},Opentip.findElements=function(){var t,e,i,o,s,n,r,a,h,p;for(t=Opentip.adapter,h=t.findAll(document.body,"[data-ot]"),p=[],r=0,a=h.length;a>r;r++){i=h[r],n={},e=t.data(i,"ot"),(e===""||e==="true"||e==="yes")&&(e=t.attr(i,"title"),t.attr(i,"title","")),e=e||"";for(o in Opentip.styles.standard)s=t.data(i,"ot"+Opentip.prototype.ucfirst(o)),s!=null&&(s==="yes"||s==="true"||s==="on"?s=!0:(s==="no"||s==="false"||s==="off")&&(s=!1),n[o]=s);p.push(new Opentip(i,e,n))}return p},Opentip.version="2.4.6",Opentip.debug=!1,Opentip.lastId=0,Opentip.lastZIndex=100,Opentip.tips=[],Opentip._abortShowingGroup=function(t,e){var i,o,s,n,r;for(n=Opentip.tips,r=[],o=0,s=n.length;s>o;o++)i=n[o],i!==e&&i.options.group===t?r.push(i._abortShowing()):r.push(void 0);return r},Opentip._hideGroup=function(t,e){var i,o,s,n,r;for(n=Opentip.tips,r=[],o=0,s=n.length;s>o;o++)i=n[o],i!==e&&i.options.group===t?r.push(i.hide()):r.push(void 0);return r},Opentip.adapters={},Opentip.adapter=null,firstAdapter=!0,Opentip.addAdapter=function(t){return Opentip.adapters[t.name]=t,firstAdapter?(Opentip.adapter=t,t.domReady(Opentip.findElements),t.domReady(Opentip.followMousePosition),firstAdapter=!1):void 0},Opentip.positions=["top","topRight","right","bottomRight","bottom","bottomLeft","left","topLeft"],Opentip.position={},_ref=Opentip.positions,i=_i=0,_len=_ref.length;_len>_i;i=++_i)position=_ref[i],Opentip.position[position]=i;Opentip.styles={standard:{"extends":null,title:void 0,escapeTitle:!0,escapeContent:!1,className:"standard",stem:!0,delay:null,hideDelay:.1,fixed:!1,showOn:"mouseover",hideTrigger:"trigger",hideTriggers:[],hideOn:null,removeElementsOnHide:!1,offset:[0,0],containInViewport:!0,autoOffset:!0,showEffect:"appear",hideEffect:"fade",showEffectDuration:.3,hideEffectDuration:.2,stemLength:5,stemBase:8,tipJoint:"top left",target:null,targetJoint:null,cache:!0,ajax:!1,ajaxMethod:"GET",ajaxErrorMessage:"There was a problem downloading the content.",group:null,style:null,background:"#fff18f",backgroundGradientHorizontal:!1,closeButtonOffset:[5,5],closeButtonRadius:7,closeButtonCrossSize:4,closeButtonCrossColor:"#d2c35b",closeButtonCrossLineWidth:1.5,closeButtonLinkOverscan:6,borderRadius:5,borderWidth:1,borderColor:"#f2e37b",shadow:!0,shadowBlur:10,shadowOffset:[3,3],shadowColor:"rgba(0, 0, 0, 0.1)"},glass:{"extends":"standard",className:"glass",background:[[0,"rgba(252, 252, 252, 0.8)"],[.5,"rgba(255, 255, 255, 0.8)"],[.5,"rgba(250, 250, 250, 0.9)"],[1,"rgba(245, 245, 245, 0.9)"]],borderColor:"#eee",closeButtonCrossColor:"rgba(0, 0, 0, 0.2)",borderRadius:15,closeButtonRadius:10,closeButtonOffset:[8,8]},dark:{"extends":"standard",className:"dark",borderRadius:13,borderColor:"#444",closeButtonCrossColor:"rgba(240, 240, 240, 1)",shadowColor:"rgba(0, 0, 0, 0.3)",shadowOffset:[2,2],background:[[0,"rgba(30, 30, 30, 0.7)"],[.5,"rgba(30, 30, 30, 0.8)"],[.5,"rgba(10, 10, 10, 0.8)"],[1,"rgba(10, 10, 10, 0.9)"]]},alert:{"extends":"standard",className:"alert",borderRadius:1,borderColor:"#AE0D11",closeButtonCrossColor:"rgba(255, 255, 255, 1)",shadowColor:"rgba(0, 0, 0, 0.3)",shadowOffset:[2,2],background:[[0,"rgba(203, 15, 19, 0.7)"],[.5,"rgba(203, 15, 19, 0.8)"],[.5,"rgba(189, 14, 18, 0.8)"],[1,"rgba(179, 14, 17, 0.9)"]]}},Opentip.defaultStyle="standard",typeof module!="undefined"&&module!==null?module.exports=Opentip:window.Opentip=Opentip;var __slice=[].slice;(function(t){var e;return t.fn.opentip=function(t,e,i){return new Opentip(this,t,e,i)},e=function(){function e(){}return e.prototype.name="jquery",e.prototype.domReady=function(e){return t(e)},e.prototype.create=function(e){return t(e)},e.prototype.wrap=function(e){if(e=t(e),e.length>1)throw Error("Multiple elements provided.");return e},e.prototype.unwrap=function(e){return t(e)[0] -},e.prototype.tagName=function(t){return this.unwrap(t).tagName},e.prototype.attr=function(){var e,i,o;return i=arguments[0],e=arguments.length>=2?__slice.call(arguments,1):[],(o=t(i)).attr.apply(o,e)},e.prototype.data=function(){var e,i,o;return i=arguments[0],e=arguments.length>=2?__slice.call(arguments,1):[],(o=t(i)).data.apply(o,e)},e.prototype.find=function(e,i){return t(e).find(i).get(0)},e.prototype.findAll=function(e,i){return t(e).find(i)},e.prototype.update=function(e,i,o){return e=t(e),o?e.text(i):e.html(i)},e.prototype.append=function(e,i){return t(e).append(i)},e.prototype.remove=function(e){return t(e).remove()},e.prototype.addClass=function(e,i){return t(e).addClass(i)},e.prototype.removeClass=function(e,i){return t(e).removeClass(i)},e.prototype.css=function(e,i){return t(e).css(i)},e.prototype.dimensions=function(e){return{width:t(e).outerWidth(),height:t(e).outerHeight()}},e.prototype.scrollOffset=function(){return[window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop]},e.prototype.viewportDimensions=function(){return{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}},e.prototype.mousePosition=function(t){return t==null?null:{x:t.pageX,y:t.pageY}},e.prototype.offset=function(e){var i;return i=t(e).offset(),{left:i.left,top:i.top}},e.prototype.observe=function(e,i,o){return t(e).bind(i,o)},e.prototype.stopObserving=function(e,i,o){return t(e).unbind(i,o)},e.prototype.ajax=function(e){var i,o;if(e.url==null)throw Error("No url provided");return t.ajax({url:e.url,type:(i=(o=e.method)!=null?o.toUpperCase():void 0)!=null?i:"GET"}).done(function(t){return typeof e.onSuccess=="function"?e.onSuccess(t):void 0}).fail(function(t){return typeof e.onError=="function"?e.onError("Server responded with status "+t.status):void 0}).always(function(){return typeof e.onComplete=="function"?e.onComplete():void 0})},e.prototype.clone=function(e){return t.extend({},e)},e.prototype.extend=function(){var e,i;return i=arguments[0],e=arguments.length>=2?__slice.call(arguments,1):[],t.extend.apply(t,[i].concat(__slice.call(e)))},e}(),Opentip.addAdapter(new e)})(jQuery) \ No newline at end of file diff --git a/vendors/opentip/opentip.css b/vendors/opentip/opentip.css deleted file mode 100644 index 5088f37a0..000000000 --- a/vendors/opentip/opentip.css +++ /dev/null @@ -1,278 +0,0 @@ -.opentip-container, -.opentip-container * { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.opentip-container { - position: absolute; - max-width: 300px; - z-index: 100; - -webkit-transition: -webkit-transform 1s ease-in-out; - -moz-transition: -moz-transform 1s ease-in-out; - -o-transition: -o-transform 1s ease-in-out; - -ms-transition: -ms-transform 1s ease-in-out; - transition: transform 1s ease-in-out; - pointer-events: none; - -webkit-transform: translateX(0) translateY(0); - -moz-transform: translateX(0) translateY(0); - -o-transform: translateX(0) translateY(0); - -ms-transform: translateX(0) translateY(0); - transform: translateX(0) translateY(0); -} -.opentip-container.ot-fixed.ot-hidden.stem-top.stem-center, -.opentip-container.ot-fixed.ot-going-to-show.stem-top.stem-center, -.opentip-container.ot-fixed.ot-hiding.stem-top.stem-center { - -webkit-transform: translateY(-5px); - -moz-transform: translateY(-5px); - -o-transform: translateY(-5px); - -ms-transform: translateY(-5px); - transform: translateY(-5px); -} -.opentip-container.ot-fixed.ot-hidden.stem-top.stem-right, -.opentip-container.ot-fixed.ot-going-to-show.stem-top.stem-right, -.opentip-container.ot-fixed.ot-hiding.stem-top.stem-right { - -webkit-transform: translateY(-5px) translateX(5px); - -moz-transform: translateY(-5px) translateX(5px); - -o-transform: translateY(-5px) translateX(5px); - -ms-transform: translateY(-5px) translateX(5px); - transform: translateY(-5px) translateX(5px); -} -.opentip-container.ot-fixed.ot-hidden.stem-middle.stem-right, -.opentip-container.ot-fixed.ot-going-to-show.stem-middle.stem-right, -.opentip-container.ot-fixed.ot-hiding.stem-middle.stem-right { - -webkit-transform: translateX(5px); - -moz-transform: translateX(5px); - -o-transform: translateX(5px); - -ms-transform: translateX(5px); - transform: translateX(5px); -} -.opentip-container.ot-fixed.ot-hidden.stem-bottom.stem-right, -.opentip-container.ot-fixed.ot-going-to-show.stem-bottom.stem-right, -.opentip-container.ot-fixed.ot-hiding.stem-bottom.stem-right { - -webkit-transform: translateY(5px) translateX(5px); - -moz-transform: translateY(5px) translateX(5px); - -o-transform: translateY(5px) translateX(5px); - -ms-transform: translateY(5px) translateX(5px); - transform: translateY(5px) translateX(5px); -} -.opentip-container.ot-fixed.ot-hidden.stem-bottom.stem-center, -.opentip-container.ot-fixed.ot-going-to-show.stem-bottom.stem-center, -.opentip-container.ot-fixed.ot-hiding.stem-bottom.stem-center { - -webkit-transform: translateY(5px); - -moz-transform: translateY(5px); - -o-transform: translateY(5px); - -ms-transform: translateY(5px); - transform: translateY(5px); -} -.opentip-container.ot-fixed.ot-hidden.stem-bottom.stem-left, -.opentip-container.ot-fixed.ot-going-to-show.stem-bottom.stem-left, -.opentip-container.ot-fixed.ot-hiding.stem-bottom.stem-left { - -webkit-transform: translateY(5px) translateX(-5px); - -moz-transform: translateY(5px) translateX(-5px); - -o-transform: translateY(5px) translateX(-5px); - -ms-transform: translateY(5px) translateX(-5px); - transform: translateY(5px) translateX(-5px); -} -.opentip-container.ot-fixed.ot-hidden.stem-middle.stem-left, -.opentip-container.ot-fixed.ot-going-to-show.stem-middle.stem-left, -.opentip-container.ot-fixed.ot-hiding.stem-middle.stem-left { - -webkit-transform: translateX(-5px); - -moz-transform: translateX(-5px); - -o-transform: translateX(-5px); - -ms-transform: translateX(-5px); - transform: translateX(-5px); -} -.opentip-container.ot-fixed.ot-hidden.stem-top.stem-left, -.opentip-container.ot-fixed.ot-going-to-show.stem-top.stem-left, -.opentip-container.ot-fixed.ot-hiding.stem-top.stem-left { - -webkit-transform: translateY(-5px) translateX(-5px); - -moz-transform: translateY(-5px) translateX(-5px); - -o-transform: translateY(-5px) translateX(-5px); - -ms-transform: translateY(-5px) translateX(-5px); - transform: translateY(-5px) translateX(-5px); -} -.opentip-container.ot-fixed .opentip { - pointer-events: auto; -} -.opentip-container.ot-hidden { - display: none; -} -.opentip-container .opentip { - position: relative; - font-size: 13px; - line-height: 120%; - padding: 9px 14px; - color: #4f4b47; - text-shadow: -1px -1px 0px rgba(255,255,255,0.2); -} -.opentip-container .opentip .header { - margin: 0; - padding: 0; -} -.opentip-container .opentip .ot-close { - pointer-events: auto; - display: block; - position: absolute; - top: -12px; - left: 60px; - color: rgba(0,0,0,0.5); - background: rgba(0,0,0,0); - text-decoration: none; -} -.opentip-container .opentip .ot-close span { - display: none; -} -.opentip-container .opentip .ot-loading-indicator { - display: none; -} -.opentip-container.ot-loading .ot-loading-indicator { - width: 30px; - height: 30px; - font-size: 30px; - line-height: 30px; - font-weight: bold; - display: block; -} -.opentip-container.ot-loading .ot-loading-indicator span { - display: block; - -webkit-animation: otloading 2s linear infinite; - -moz-animation: otloading 2s linear infinite; - -o-animation: otloading 2s linear infinite; - -ms-animation: otloading 2s linear infinite; - animation: otloading 2s linear infinite; - text-align: center; -} -.opentip-container.style-dark .opentip, -.opentip-container.style-alert .opentip { - color: #f8f8f8; - text-shadow: 1px 1px 0px rgba(0,0,0,0.2); -} -.opentip-container.style-glass .opentip { - padding: 15px 25px; - color: #317cc5; - text-shadow: 1px 1px 8px rgba(0,94,153,0.3); -} -.opentip-container.ot-hide-effect-fade { - -webkit-transition: -webkit-transform 0.5s ease-in-out, opacity 1s ease-in-out; - -moz-transition: -moz-transform 0.5s ease-in-out, opacity 1s ease-in-out; - -o-transition: -o-transform 0.5s ease-in-out, opacity 1s ease-in-out; - -ms-transition: -ms-transform 0.5s ease-in-out, opacity 1s ease-in-out; - transition: transform 0.5s ease-in-out, opacity 1s ease-in-out; - opacity: 1; - -ms-filter: none; - filter: none; -} -.opentip-container.ot-hide-effect-fade.ot-hiding { - opacity: 0; - filter: alpha(opacity=0); - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; -} -.opentip-container.ot-show-effect-appear.ot-going-to-show, -.opentip-container.ot-show-effect-appear.ot-showing { - -webkit-transition: -webkit-transform 0.5s ease-in-out, opacity 1s ease-in-out; - -moz-transition: -moz-transform 0.5s ease-in-out, opacity 1s ease-in-out; - -o-transition: -o-transform 0.5s ease-in-out, opacity 1s ease-in-out; - -ms-transition: -ms-transform 0.5s ease-in-out, opacity 1s ease-in-out; - transition: transform 0.5s ease-in-out, opacity 1s ease-in-out; -} -.opentip-container.ot-show-effect-appear.ot-going-to-show { - opacity: 0; - filter: alpha(opacity=0); - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; -} -.opentip-container.ot-show-effect-appear.ot-showing { - opacity: 1; - -ms-filter: none; - filter: none; -} -.opentip-container.ot-show-effect-appear.ot-visible { - opacity: 1; - -ms-filter: none; - filter: none; -} -@-moz-keyframes otloading { - 0% { - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -o-transform: rotate(0deg); - -ms-transform: rotate(0deg); - transform: rotate(0deg); - } - - 100% { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@-webkit-keyframes otloading { - 0% { - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -o-transform: rotate(0deg); - -ms-transform: rotate(0deg); - transform: rotate(0deg); - } - - 100% { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@-o-keyframes otloading { - 0% { - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -o-transform: rotate(0deg); - -ms-transform: rotate(0deg); - transform: rotate(0deg); - } - - 100% { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@-ms-keyframes otloading { - 0% { - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -o-transform: rotate(0deg); - -ms-transform: rotate(0deg); - transform: rotate(0deg); - } - - 100% { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@keyframes otloading { - 0% { - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -o-transform: rotate(0deg); - -ms-transform: rotate(0deg); - transform: rotate(0deg); - } - - 100% { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); - } -} diff --git a/vendors/photoswipe/default-skin/default-skin.css b/vendors/photoswipe/default-skin/default-skin.css deleted file mode 100644 index 7b29b1ba5..000000000 --- a/vendors/photoswipe/default-skin/default-skin.css +++ /dev/null @@ -1,418 +0,0 @@ -/** - * Default PhotoSwipe UI CSS file, http://photoswipe.com - * @author Dmitry Semenov - */ -.pswp__ui { - -webkit-font-smoothing: auto; - visibility: visible; - opacity: 1; - z-index: 1050; } - -.pswp__top-bar { - position: absolute; - left: 0; - top: 0; - height: 44px; - width: 100%; } - -/** - * Loading indicator, aka preloader. - * You can play with preloader is here: http://codepen.io/dimsemenov/pen/yyBWoR - */ -.pswp__preloader { - width: 44px; - height: 44px; - position: absolute; - top: 0; - left: 50%; - margin-left: -22px; - z-index: 20; - opacity: 0; - position: relative; - -webkit-transition: opacity 0.25s ease-out; - transition: opacity 0.25s ease-out; - will-change: opacity; } - -.pswp__preloader__icn { - width: 20px; - height: 20px; - margin: 12px; } - -.pswp__preloader--active { - opacity: 1; } - .pswp__preloader--active .pswp__preloader__icn { - background: url(preloader.gif) 0 0 no-repeat; } - -.pswp--css_animation .pswp__preloader--active { - opacity: 1; } - .pswp--css_animation .pswp__preloader--active .pswp__preloader__icn { - -webkit-animation: clockwise 500ms linear infinite; - animation: clockwise 500ms linear infinite; } - .pswp--css_animation .pswp__preloader--active .pswp__preloader__donut { - -webkit-animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; - animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; } -.pswp--css_animation .pswp__preloader__icn { - background: none; - opacity: 0.75; - width: 14px; - height: 14px; - position: absolute; - left: 15px; - top: 15px; - margin: 0; } -.pswp--css_animation .pswp__preloader__cut { - position: relative; - width: 7px; - height: 14px; - overflow: hidden; } -.pswp--css_animation .pswp__preloader__donut { - box-sizing: border-box; - width: 14px; - height: 14px; - border: 2px solid white; - border-radius: 50%; - border-left-color: transparent; - border-bottom-color: transparent; - position: absolute; - top: 0; - left: 0; - background: none; - margin: 0; } - -@-webkit-keyframes clockwise { - 0% { - -webkit-transform: rotate(0deg); } - - 100% { - -webkit-transform: rotate(360deg); } } - -@keyframes clockwise { - 0% { - transform: rotate(0deg); } - - 100% { - transform: rotate(360deg); } } - -@-webkit-keyframes donut-rotate { - 0% { - -webkit-transform: rotate(0); } - - 50% { - -webkit-transform: rotate(-140deg); } - - 100% { - -webkit-transform: rotate(0); } } - -@keyframes donut-rotate { - 0% { - transform: rotate(0); } - - 50% { - transform: rotate(-140deg); } - - 100% { - transform: rotate(0); } } - -.pswp__error-msg { - position: absolute; - left: 0; - top: 50%; - width: 100%; - text-align: center; - color: white; - font-size: 14px; - line-height: 16px; - margin-top: -8px; - color: white; - opacity: 0.7; } - -.pswp__error-msg a { - color: white; - text-decoration: underline; } - -.pswp__button { - width: 44px; - height: 44px; - position: relative; - background: none; - cursor: pointer; - overflow: visible; - border: 0; - -webkit-appearance: none; - display: block; - outline: none; - padding: 0; - margin: 0; - -webkit-box-shadow: none; - box-shadow: none; - float: right; - opacity: 0.75; - -webkit-transition: opacity 0.25s; - transition: opacity 0.25s; } - .pswp__button:focus, .pswp__button:hover { - opacity: 1; } - .pswp__button:active { - opacity: 0.9; } - .pswp__button::-moz-focus-inner { - padding: 0; - border: 0; } - -.pswp--animated-in .pswp__button { - -webkit-transition: opacity 0.25s; - transition: opacity 0.25s; } - -.pswp__ui--over-close .pswp__button--close { - opacity: 1; } - -.pswp__button, .pswp__button--arrow--left:before, .pswp__button--arrow--right:before { - background: url(default-skin.png) 0 0 no-repeat; - background-size: 264px 88px; - width: 44px; - height: 44px; } - -@media (-webkit-min-device-pixel-ratio: 1.1), (min-resolution: 105dpi), (min-resolution: 1.1dppx) { - .pswp--svg .pswp__button, .pswp--svg .pswp__button--arrow--left:before, .pswp--svg .pswp__button--arrow--right:before { - background-image: url(default-skin.svg); } - .pswp--svg .pswp__button--arrow--left, .pswp--svg .pswp__button--arrow--right { - background: none; } } - -.pswp__counter, .pswp__share-modal { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; } - -.pswp__share-modal { - display: block; - background: rgba(0, 0, 0, 0.5); - width: 100%; - height: 100%; - top: 0; - left: 0; - padding: 10px; - position: absolute; - z-index: 1450; - opacity: 0; - -webkit-transition: opacity 0.25s ease-out; - transition: opacity 0.25s ease-out; - will-change: opacity; - -webkit-backface-visibility: hidden; } - -.pswp__share-modal--hidden { - display: none; } - -.pswp__share-tooltip { - z-index: 1550; - position: absolute; - background: white; - top: 56px; - border-radius: 2px; - display: block; - width: auto; - right: 44px; - -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25); - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25); - -webkit-transform: translateY(6px); - transform: translateY(6px); - -webkit-transition: -webkit-transform 0.25s; - transition: transform 0.25s; - will-change: transform; - -webkit-backface-visibility: hidden; } - .pswp__share-tooltip a { - display: block; - padding: 8px 12px; - color: black; - text-decoration: none; - font-size: 14px; - line-height: 18px; } - .pswp__share-tooltip a:hover { - text-decoration: none; - color: black; } - -.pswp__share-modal--fade-in { - opacity: 1; } - .pswp__share-modal--fade-in .pswp__share-tooltip { - -webkit-transform: translateY(0); - transform: translateY(0); } - -.pswp--touch .pswp__share-tooltip a { - padding: 16px 12px; } - -a.pswp__share--facebook:before { - content: ''; - display: block; - width: 0; - height: 0; - position: absolute; - top: -12px; - right: 15px; - border: 6px solid rgba(0, 0, 0, 0); - border-bottom-color: white; - -webkit-pointer-events: none; - -moz-pointer-events: none; - pointer-events: none; } -a.pswp__share--facebook:hover { - background: #3e5c9a; - color: white; } - a.pswp__share--facebook:hover:before { - border-bottom-color: #3e5c9a; } - -a.pswp__share--twitter:hover { - background: #55acee; - color: white; } - -a.pswp__share--pinterest:hover { - background: #cccccc; - color: #ce272d; } - -a.pswp__share--download:hover { - background: #dddddd; } - -.pswp__button--close { - background-position: 0 -44px; } - -.pswp__button--share { - background-position: -44px -44px; } - -.pswp__button--fs { - display: none; } - -.pswp--supports-fs .pswp__button--fs { - display: block; } - -.pswp--fs .pswp__button--fs { - background-position: -44px 0; } - -.pswp__button--zoom { - display: none; - background-position: -88px 0; } - -.pswp--zoom-allowed .pswp__button--zoom { - display: block; } - -.pswp--zoomed-in .pswp__button--zoom { - background-position: -132px 0; } - -.pswp__button--arrow--left, .pswp__button--arrow--right { - background: none; - top: 50%; - margin-top: -50px; - width: 70px; - height: 100px; - position: absolute; } - -.pswp__top-bar, .pswp__button--arrow--left, .pswp__button--arrow--right { - -webkit-backface-visibility: hidden; - will-change: opacity; } - -.pswp--touch .pswp__button--arrow--left, .pswp--touch .pswp__button--arrow--right { - visibility: hidden; } - -.pswp__button--arrow--left { - left: 0; } - -.pswp__button--arrow--right { - right: 0; } - -.pswp__button--arrow--left:before, .pswp__button--arrow--right:before { - content: ''; - top: 35px; - background-color: rgba(0, 0, 0, 0.3); - height: 30px; - width: 32px; - position: absolute; } - -.pswp__button--arrow--left:before { - left: 6px; - background-position: -138px -44px; } - -.pswp__button--arrow--right:before { - right: 6px; - background-position: -94px -44px; } - -.pswp__counter { - position: absolute; - left: 0; - top: 0; - height: 44px; - font-size: 13px; - line-height: 44px; - color: white; - opacity: 0.75; - padding: 0 10px; } - -@media screen and (max-width: 1024px) { - .pswp_scroll-wrap { - top: 0; - bottom: 0; } - .pswp__caption { - margin-top: 0; } - .pswp__preloader { - position: relative; - left: auto; - top: auto; - margin: 0; - float: right; } } - -.pswp__caption { - position: absolute; - left: 0; - bottom: 0; - color: white; - width: 100%; - min-height: 44px; } - .pswp__caption small { - font-size: 11px; - color: #bbbbbb; } - -.pswp__caption__center { - text-align: left; - max-width: 420px; - margin: 0 auto; - color: white; - font-size: 13px; - padding: 10px; - line-height: 20px; - color: #cccccc; } - -.pswp__caption--empty { - display: none; } - -.pswp__caption--fake { - visibility: hidden; } - -.pswp__bg, .pswp__caption, .pswp__top-bar, .pswp--has_mouse .pswp__button--arrow--left, .pswp--has_mouse .pswp__button--arrow--right { - will-change: opacity; - -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); - transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); } - -.pswp--animated-in .pswp__bg, .pswp--animated-in .pswp__zoom-wrap { - -webkit-transition: none; - transition: none; } - -.pswp--has_mouse .pswp__button--arrow--left, .pswp--has_mouse .pswp__button--arrow--right { - visibility: visible; } - -.pswp__top-bar, .pswp__caption { - background-color: rgba(0, 0, 0, 0.5); } - -.pswp__ui--fit .pswp__top-bar, .pswp__ui--fit .pswp__caption { - background-color: rgba(0, 0, 0, 0.3); } - -.pswp__ui--hidden .pswp__top-bar, .pswp__ui--hidden .pswp__caption, .pswp__ui--hidden .pswp__button--arrow--left, .pswp__ui--hidden .pswp__button--arrow--right { - opacity: 0; } - -.pswp__ui--idle .pswp__top-bar { - opacity: 0; } -.pswp__ui--idle .pswp__button--arrow--left, .pswp__ui--idle .pswp__button--arrow--right { - opacity: 0; } - -.pswp__ui--hidden .pswp__top-bar, .pswp__ui--hidden .pswp__caption, .pswp__ui--hidden .pswp__bg, .pswp__ui--hidden .pswp__button--arrow--left, .pswp__ui--hidden .pswp__button--arrow--right { - opacity: 0.001; } - -.pswp__element--disabled { - display: none !important; } - -.pswp--minimal--dark .pswp__top-bar { - background: none; } -.pswp--minimal--dark .pswp__button--arrow--left, .pswp--minimal--dark .pswp__button--arrow--right { - background: none; } diff --git a/vendors/photoswipe/default-skin/default-skin.png b/vendors/photoswipe/default-skin/default-skin.png deleted file mode 100644 index d74959689..000000000 Binary files a/vendors/photoswipe/default-skin/default-skin.png and /dev/null differ diff --git a/vendors/photoswipe/default-skin/default-skin.svg b/vendors/photoswipe/default-skin/default-skin.svg deleted file mode 100644 index 61f52f102..000000000 --- a/vendors/photoswipe/default-skin/default-skin.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - default-skin 2 - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendors/photoswipe/default-skin/preloader.gif b/vendors/photoswipe/default-skin/preloader.gif deleted file mode 100644 index 7cdc671db..000000000 Binary files a/vendors/photoswipe/default-skin/preloader.gif and /dev/null differ diff --git a/vendors/photoswipe/photoswipe-ui-default.js b/vendors/photoswipe/photoswipe-ui-default.js deleted file mode 100644 index 51738dc54..000000000 --- a/vendors/photoswipe/photoswipe-ui-default.js +++ /dev/null @@ -1,824 +0,0 @@ -/*! PhotoSwipe Default UI - 4.0.0 - 2014-12-04 -* http://photoswipe.com -* Copyright (c) 2014 Dmitry Semenov; */ -/** -* -* UI on top of main sliding area (caption, arrows, close button, etc.). -* Built just using public methods/properties of PhotoSwipe. -* -*/ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - define(factory); - } else if (typeof exports === 'object') { - module.exports = factory; - } else { - root.PhotoSwipeUI_Default = factory(); - } -})(this, function () { - - 'use strict'; - - - -var PhotoSwipeUI_Default = - function(pswp, framework) { - var ui = this; - var _overlayUIUpdated = false, - _controlsVisible = true, - _fullscrenAPI, - _controls, - _captionContainer, - _fakeCaptionContainer, - _indexIndicator, - _shareButton, - _shareModal, - _shareModalHidden = true, - _initalCloseOnScrollValue, - _isIdle, - - _loadingIndicator, - _loadingIndicatorHidden, - _loadingIndicatorTimeout, - - _options = { - barsSize: {top:44, bottom:'auto'}, - closeElClasses: ['item', 'caption', 'zoom-wrap', 'ui', 'top-bar'], - timeToIdle: 4000, - timeToIdleOutside: 1000, - loadingIndicatorDelay: 1000, // 2s - - addCaptionHTMLFn: function(item, captionEl, isFake) { - if(!item.title) { - captionEl.children[0].innerHTML = ''; - return false; - } - captionEl.children[0].innerHTML = item.title; - return true; - }, - - closeEl:true, - captionEl: true, - fullscreenEl: true, - zoomEl: true, - shareEl: true, - counterEl: true, - arrowEl: true, - preloaderEl: true, - - tapToClose: false, - tapToToggleControls: true, - - shareButtons: [ - {id:'facebook', label:'Share on Facebook', url:'https://www.facebook.com/sharer/sharer.php?u={{url}}'}, - {id:'twitter', label:'Tweet', url:'https://twitter.com/intent/tweet?text={{text}}&url={{url}}'}, - {id:'pinterest', label:'Pin it', url:'http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}'}, - {id:'download', label:'Download image', url:'{{raw_image_url}}', download:true} - ], - indexIndicatorSep: ' / ' - - }, - _blockControlsTap, - _blockControlsTapTimeout; - - - - - var _onControlsTap = function(e) { - - - if(_blockControlsTap) { - return true; - } - - - e = e || window.event; - - - var target = e.target || e.srcElement, - uiElement, - clickedClass = target.className, - found; - - for(var i = 0; i < _uiElements.length; i++) { - uiElement = _uiElements[i]; - if(uiElement.onTap && clickedClass.indexOf('pswp__' + uiElement.name ) > -1 ) { - uiElement.onTap(); - found = true; - - } - } - - if(found) { - if(e.stopPropagation) { - e.stopPropagation(); - } - _blockControlsTap = true; - _blockControlsTapTimeout = setTimeout(function() { - _blockControlsTap = false; - }, 30 ); - } - - }, - _fitControlsInViewport = function() { - return !pswp.likelyTouchDevice || pswp.options.mouseUsed || screen.width > 1200; - }, - _toggleShareModal = function() { - - _shareModalHidden = !_shareModalHidden; - - - if(!_shareModalHidden) { - framework[ (_shareModalHidden ? 'add' : 'remove') + 'Class'](_shareModal, 'pswp__share-modal--hidden'); - setTimeout(function() { - if(!_shareModalHidden) { - framework.addClass(_shareModal, 'pswp__share-modal--fade-in'); - } - }, 30); - } else { - framework.removeClass(_shareModal, 'pswp__share-modal--fade-in'); - setTimeout(function() { - if(_shareModalHidden) { - framework[ (_shareModalHidden ? 'add' : 'remove') + 'Class'](_shareModal, 'pswp__share-modal--hidden'); - } - }, 300); - } - - if(!_shareModalHidden) { - _updateShareURLs(); - } - return false; - }, - _openWindowPopup = function(e) { - e = e || window.event; - var target = e.target || e.srcElement; - - if(!target.href) { - return false; - } - - if( target.hasAttribute('download') ) { - return true; - } - - //if( !pswp.options.mouseUsed ) { - // target.setAttribute('target', '_self'); - // return true; - //} - - window.open(target.href, "pswp_share", "scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left=" + (window.screen ? Math.round(screen.width / 2 - 275) : 100) ); - if(!_shareModalHidden) { - _toggleShareModal(); - } - - - - return false; - }, - _updateShareURLs = function() { - var shareButtonOut = '', - shareButtonData, - shareURL; - - for(var i = 0; i < pswp.options.shareButtons.length; i++) { - shareButtonData = pswp.options.shareButtons[i]; - - shareURL = shareButtonData.url.replace('{{url}}', encodeURIComponent(window.location.href) ) - .replace('{{image_url}}', encodeURIComponent(pswp.currItem.src || '') ) - .replace('{{raw_image_url}}', pswp.currItem.src || '' ) - .replace('{{text}}', encodeURIComponent(pswp.currItem.title || '') ); - - shareButtonOut += ''; - } - _shareModal.children[0].innerHTML = shareButtonOut; - _shareModal.children[0].onclick = _openWindowPopup; - - }, - _hasCloseClass = function(target) { - for(var i = 0; i < pswp.options.closeElClasses.length; i++) { - if( framework.hasClass(target, 'pswp__' + pswp.options.closeElClasses[i]) ) { - return true; - } - } - }, - _idleInterval, - _idleTimer, - _idleIncrement = 0, - _onIdleMouseMove = function() { - clearTimeout(_idleTimer); - _idleIncrement = 0; - if(_isIdle) { - ui.setIdle(false); - } - }, - _onMouseLeaveWindow = function(e) { - e = e ? e : window.event; - var from = e.relatedTarget || e.toElement; - if (!from || from.nodeName == "HTML") { - clearTimeout(_idleTimer); - _idleTimer = setTimeout(function() { - ui.setIdle(true); - }, pswp.options.timeToIdleOutside); - } - }, - _toggleLoadingIndicator = function(hide) { - - if( /*pswp.likelyTouchDevice*/ _loadingIndicatorHidden !== hide ) { - framework[ (hide ? 'remove' : 'add') + 'Class' ](_loadingIndicator, 'pswp__preloader--active'); - _loadingIndicatorHidden = hide; - } - }; - - - - var _uiElements = [ - { - name: 'caption', - option: 'captionEl', - onInit: function(el) { - _captionContainer = el; - } - }, - { - name: 'share-modal', - option: 'shareEl', - onInit: function(el) { - _shareModal = el; - }, - onTap: function() { - _toggleShareModal(); - } - }, - { - name: 'button--share', - option: 'shareEl', - onInit: function(el) { - _shareButton = el; - }, - onTap: function() { - _toggleShareModal(); - } - }, - { - name: 'button--zoom', - option: 'zoomEl', - onTap: pswp.toggleDesktopZoom - }, - { - name: 'counter', - option: 'counterEl', - onInit: function(el) { - _indexIndicator = el; - } - }, - { - name: 'button--close', - option: 'closeEl', - onTap: pswp.close - }, - { - name: 'button--arrow--left', - option: 'arrowEl', - onTap: pswp.prev - }, - { - name: 'button--arrow--right', - option: 'arrowEl', - onTap: pswp.next - }, - { - name: 'button--fs', - option: 'fullscreenEl', - onTap: function() { - if(_fullscrenAPI.isFullscreen()) { - _fullscrenAPI.exit(); - } else { - _fullscrenAPI.enter(); - } - } - }, - { - name: 'preloader', - option: 'preloaderEl', - onInit: function(el) { - _loadingIndicator = el; - } - } - - ]; - - - - - - ui.init = function() { - //return; - - - //window.pswp = pswp; - - framework.extend(pswp.options, _options, true); - _controls = pswp.scrollWrap.children[1];//pswp.template.children[2]; - - - - var _listen = pswp.listen; - - - // Hide controls on vertical drag - _listen('onVerticalDrag', function(now) { - - if(_controlsVisible && now < 0.95) { - ui.hideControls(); - } else if(!_controlsVisible && now >= 0.95) { - ui.showControls(); - } - - }); - - // Hide controls when pinching to close - var pinchControlsHidden; - _listen('onPinchClose' , function(now) { - if(_controlsVisible && now < 0.9) { - ui.hideControls(); - pinchControlsHidden = true; - } else if(pinchControlsHidden && !_controlsVisible && now > 0.9) { - ui.showControls(); - } - }); - _listen('zoomGestureEnded', function() { - pinchControlsHidden = false; - if(pinchControlsHidden && !_controlsVisible) { - ui.showControls(); - } - - }); - - _listen('beforeChange', ui.update); - - - // - // _listen('zoomGestureStarted', function() { - - // if(pswp.options.tapToToggleControls ) { - // ui.hideControls(); - // } - - // }); - - // _listen('zoomGestureEnded', function() { - - // if(pswp.options.tapToToggleControls && pswp.getZoomLevel() <= pswp.currItem.fitRatio ) { - // ui.showControls(); - // } - - // }); - - _listen('doubleTap', function(point) { - - //pswp.toggleDesktopZoom(point); - // toggleDesktopZoom - - - - var initialZoomLevel = pswp.currItem.initialZoomLevel; - if(pswp.getZoomLevel() !== initialZoomLevel) { - pswp.zoomTo(initialZoomLevel, point, 333); - } else { - pswp.zoomTo(pswp.currItem.doubleTapZoom, point, 333); - } - }); - - - - - - - _listen('bindEvents', function() { - framework.bind(_controls, 'pswpTap click', _onControlsTap); - framework.bind(pswp.scrollWrap, 'pswpTap', ui.onGlobalTap); - - if(!pswp.likelyTouchDevice) { - framework.bind(pswp.scrollWrap, 'mouseover', ui.onMouseOver); - } - - - }); - - - if(pswp.options.timeToIdle) { - _listen('mouseUsed', function() { - - framework.bind(document, 'mousemove', _onIdleMouseMove); - framework.bind(document, 'mouseout', _onMouseLeaveWindow); - - _idleInterval = setInterval(function() { - _idleIncrement++; - if(_idleIncrement === 2) { - ui.setIdle(true); - } - }, pswp.options.timeToIdle / 2); - }); - } - - - - _listen('preventDragEvent', function(e, isDown, preventObj) { - var t = e.target || e.srcElement; - if(t && t.className && e.type.indexOf('mouse') > -1 && ( t.className.indexOf('__caption') > 0 || (/(SMALL|STRONG|EM)/i).test(t.tagName) ) ) { - preventObj.prevent = false; - } - }); - - - _listen('unbindEvents', function() { - if(!_shareModalHidden) { - _toggleShareModal(); - } - - if(_idleInterval) { - clearInterval(_idleInterval); - } - framework.unbind(document, 'mouseout', _onMouseLeaveWindow); - framework.unbind(document, 'mousemove', _onIdleMouseMove); - framework.unbind(_controls, 'pswpTap click', _onControlsTap); - framework.unbind(pswp.scrollWrap, 'pswpTap', ui.onGlobalTap); - framework.unbind(pswp.scrollWrap, 'mouseover', ui.onMouseOver); - - if(_fullscrenAPI) { - framework.unbind(document, _fullscrenAPI.eventK, ui.updateFullscreen); - if(_fullscrenAPI.isFullscreen()) { - _options.hideAnimationDuration = 0; - _fullscrenAPI.exit(); - } - _fullscrenAPI = null; - } - }); - - - _listen('destroy', function() { - - - if(pswp.options.captionEl) { - if(_fakeCaptionContainer) { - _controls.removeChild(_fakeCaptionContainer); - } - - framework.removeClass(_captionContainer, 'pswp__caption--empty'); - } - - - if(_shareModal) { - _shareModal.children[0].onclick = null; - } - framework.removeClass(_controls, 'pswp__ui--over-close'); - framework.addClass( _controls, 'pswp__ui--hidden'); - ui.setIdle(false); - - }); - - - if(!pswp.options.showAnimationDuration) { - framework.removeClass( _controls, 'pswp__ui--hidden'); - } - _listen('initialZoomIn', function() { - if(pswp.options.showAnimationDuration) { - framework.removeClass( _controls, 'pswp__ui--hidden'); - } - }); - _listen('initialZoomOut', function() { - framework.addClass( _controls, 'pswp__ui--hidden'); - }); - - - - _listen('parseVerticalMargin', function(item) { - var gap = item.vGap; - // if(pswp.options.customGap) { - // gap.top = pswp.options.customGap.top; - // gap.bottom = pswp.options.customGap.bottom; - // return; - // } - if( _fitControlsInViewport() /* !pswp.likelyTouchDevice || pswp.options.mouseUsed || screen.width > 1200 */ /* pswp.viewportSize.y > 800 */) { - - var bars = pswp.options.barsSize; - if(pswp.options.captionEl && bars.bottom === 'auto') { - if(!_fakeCaptionContainer) { - _fakeCaptionContainer = framework.createEl('pswp__caption pswp__caption--fake'); - _fakeCaptionContainer.appendChild( framework.createEl('pswp__caption__center') ); - _controls.insertBefore(_fakeCaptionContainer, _captionContainer); - framework.addClass(_controls, 'pswp__ui--fit'); - } - if( pswp.options.addCaptionHTMLFn(item, _fakeCaptionContainer, true) ) { - - var captionSize = _fakeCaptionContainer.clientHeight; - gap.bottom = parseInt(captionSize,10) || 44; - } else { - gap.bottom = bars.top; // if no caption, set size of bottom gap to size of top - } - } else { - gap.bottom = bars.bottom; - } - - // height of top bar is static, no need to calculate it - gap.top = bars.top; - } else { - gap.top = gap.bottom = 0; - } - }); - - - - var item, - classAttr, - uiElement; - - - - var loopThroughChildElements = function(sChildren) { - var l = sChildren.length; - for(var i = 0; i < l; i++) { - item = sChildren[i]; - classAttr = item.className; - - for(var a = 0; a < _uiElements.length; a++) { - uiElement = _uiElements[a]; - - - if(classAttr.indexOf('pswp__' + uiElement.name) > -1 ) { - - if( pswp.options[uiElement.option] ) { // if element is not disabled from options - - framework.removeClass(item, 'pswp__element--disabled'); - if(uiElement.onInit) { - uiElement.onInit(item); - } - - //item.style.display = 'block'; - } else { - framework.addClass(item, 'pswp__element--disabled'); - //item.style.display = 'none'; - } - - - - } - } - } - }; - loopThroughChildElements(_controls.children); - loopThroughChildElements(_controls.children[0].children); - - - if(pswp.options.shareEl && _shareButton && _shareModal) { - _shareModalHidden = true; - } - - - if(pswp.options.fullscreenEl) { - if(!_fullscrenAPI) { - _fullscrenAPI = ui.getFullscreenAPI(); - } - if(_fullscrenAPI) { - framework.bind(document, _fullscrenAPI.eventK, ui.updateFullscreen); - ui.updateFullscreen(); - framework.addClass(pswp.template, 'pswp--supports-fs'); - } else { - framework.removeClass(pswp.template, 'pswp--supports-fs'); - } - } - - - - - // Setup loading indicator - if(pswp.options.preloaderEl) { - - _toggleLoadingIndicator(true); - - _listen('beforeChange', function() { - - clearTimeout(_loadingIndicatorTimeout); - - // display loading indicator with delay - _loadingIndicatorTimeout = setTimeout(function() { - - if(pswp.currItem && pswp.currItem.loading) { - - if( !pswp.allowProgressiveImg() || (pswp.currItem.img && !pswp.currItem.img.naturalWidth) ) { - _toggleLoadingIndicator(false); // show preloader if progressive loading is not enabled, or image width is not defined yet (because of slow connection) - // items-controller.js function allowProgressiveImg - } - - } else { - _toggleLoadingIndicator(true); // hide preloader - } - - }, pswp.options.loadingIndicatorDelay); - - }); - _listen('imageLoadComplete', function(index, item) { - if(pswp.currItem === item) { - _toggleLoadingIndicator(true); - } - }); - - } - - - - - - }; - - ui.setIdle = function(isIdle) { - _isIdle = isIdle; - framework[ (isIdle ? 'add' : 'remove') + 'Class' ](_controls, 'pswp__ui--idle'); - }; - - ui.update = function() { - // Don't update UI if it's hidden - if(_controlsVisible && pswp.currItem) { - - - ui.updateIndexIndicator(); - - if(pswp.options.captionEl) { - pswp.options.addCaptionHTMLFn(pswp.currItem, _captionContainer); - - if(!pswp.currItem.title) { - framework.addClass(_captionContainer, 'pswp__caption--empty'); - } else { - framework.removeClass(_captionContainer, 'pswp__caption--empty'); - } - } - - _overlayUIUpdated = true; - - - } else { - _overlayUIUpdated = false; - } - }; - ui.updateFullscreen = function() { - framework[ (_fullscrenAPI.isFullscreen() ? 'add' : 'remove') + 'Class' ](pswp.template, 'pswp--fs'); - }; - ui.updateIndexIndicator = function() { - if(pswp.options.counterEl) { - // +1, because human-friendly index starts from one. - _indexIndicator.innerHTML = (pswp.getCurrentIndex()+1) + pswp.options.indexIndicatorSep + pswp.options.getNumItemsFn(); - } - - }; - - ui.onGlobalTap = function(e) { - e = e || window.event; - var target = e.target || e.srcElement; - - - if(_blockControlsTap) { - return; - } - - // if(e.detail.pointerType !== 'touch' && framework.hasClass(target, 'pswp__img') ) { - - - if(e.detail && e.detail.pointerType === 'mouse') { - - // close gallery if clicked outside of the image - if(_hasCloseClass(target)) { - pswp.close(); - } - - if(framework.hasClass(target, 'pswp__img')) { - if(pswp.getZoomLevel() === 1 && pswp.getZoomLevel() <= pswp.currItem.fitRatio) { - pswp.close(); - } else { - pswp.toggleDesktopZoom(e.detail.releasePoint); - } - } - - } else { - - // tap anywhere (except buttons) to toggle visibility of controls - - if(pswp.options.tapToToggleControls) { - if(_controlsVisible) { - ui.hideControls(); - } else { - ui.showControls(); - } - } - - // tap to close gallery - if(pswp.options.tapToClose && (framework.hasClass(target, 'pswp__img') || _hasCloseClass(target)) ) { - pswp.close(); - return; - } - - } - - - - }; - ui.onMouseOver = function(e) { - e = e || window.event; - var target = e.target || e.srcElement; - - // apply class when mouse is over an element that should close the gallery - if(_hasCloseClass(target)) { - framework.addClass(_controls, 'pswp__ui--over-close'); - } else { - framework.removeClass(_controls, 'pswp__ui--over-close'); - } - - // if(_overImage) { - - // } - }; - - ui.hideControls = function() { - framework.addClass(_controls,'pswp__ui--hidden'); - _controlsVisible = false; - }; - - ui.showControls = function() { - _controlsVisible = true; - if(!_overlayUIUpdated) { - ui.update(); - } - framework.removeClass(_controls,'pswp__ui--hidden'); - }; - - ui.supportsFullscreen = function() { - var d = document; - return !!(d.exitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen || d.msExitFullscreen); - }; - - ui.getFullscreenAPI = function() { - var dE = document.documentElement, - api, - tF = 'fullscreenchange'; - - if (dE.requestFullscreen) { - api = { - enterK: 'requestFullscreen', - exitK: 'exitFullscreen', - elementK: 'fullscreenElement', - eventK: tF - }; - - } else if(dE.mozRequestFullScreen ) { - api = { - enterK: 'mozRequestFullScreen', - exitK: 'mozCancelFullScreen', - elementK: 'mozFullScreenElement', - eventK: 'moz' + tF - }; - - - - } else if(dE.webkitRequestFullscreen) { - api = { - enterK: 'webkitRequestFullscreen', - exitK: 'webkitExitFullscreen', - elementK: 'webkitFullscreenElement', - eventK: 'webkit' + tF - }; - - } else if(dE.msRequestFullscreen) { - api = { - enterK: 'msRequestFullscreen', - exitK: 'msExitFullscreen', - elementK: 'msFullscreenElement', - eventK: 'MSFullscreenChange' - }; - } - - if(api) { - api.enter = function() { - // disable close-on-scroll in fullscreen - _initalCloseOnScrollValue = pswp.options.closeOnScroll; - pswp.options.closeOnScroll = false; - - return pswp.template[this.enterK]( Element.ALLOW_KEYBOARD_INPUT ); - }; - api.exit = function() { - pswp.options.closeOnScroll = _initalCloseOnScrollValue; - - return document[this.exitK](); - - }; - api.isFullscreen = function() { return document[this.elementK]; }; - } - - return api; - }; - - - -}; -return PhotoSwipeUI_Default; - - -}); diff --git a/vendors/photoswipe/photoswipe-ui-default.min.js b/vendors/photoswipe/photoswipe-ui-default.min.js deleted file mode 100644 index 87bd2e1a4..000000000 --- a/vendors/photoswipe/photoswipe-ui-default.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! PhotoSwipe Default UI - 4.0.0 - 2014-12-04 -* http://photoswipe.com -* Copyright (c) 2014 Dmitry Semenov; */ -(function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t:e.PhotoSwipeUI_Default=t()})(this,function(){"use strict";var e=function(e,t){var n,o,i,a,r,l,s,u,c,d,p,m,f,h,v,y,x=this,w=!1,g=!0,b=!0,I={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(e,t){return e.title?(t.children[0].innerHTML=e.title,!0):(t.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],indexIndicatorSep:" / "},C=function(e){if(f)return!0;e=e||window.event;for(var t,n,o=e.target||e.srcElement,i=o.className,a=0;Z.length>a;a++)t=Z[a],t.onTap&&i.indexOf("pswp__"+t.name)>-1&&(t.onTap(),n=!0);n&&(e.stopPropagation&&e.stopPropagation(),f=!0,h=setTimeout(function(){f=!1},30))},T=function(){return!e.likelyTouchDevice||e.options.mouseUsed||screen.width>1200},E=function(){return b=!b,b?(t.removeClass(s,"pswp__share-modal--fade-in"),setTimeout(function(){b&&t[(b?"add":"remove")+"Class"](s,"pswp__share-modal--hidden")},300)):(t[(b?"add":"remove")+"Class"](s,"pswp__share-modal--hidden"),setTimeout(function(){b||t.addClass(s,"pswp__share-modal--fade-in")},30)),b||D(),!1},_=function(e){e=e||window.event;var t=e.target||e.srcElement;return t.href?t.hasAttribute("download")?!0:(window.open(t.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),b||E(),!1):!1},D=function(){for(var t,n,o="",i=0;e.options.shareButtons.length>i;i++)t=e.options.shareButtons[i],n=t.url.replace("{{url}}",encodeURIComponent(window.location.href)).replace("{{image_url}}",encodeURIComponent(e.currItem.src||"")).replace("{{raw_image_url}}",e.currItem.src||"").replace("{{text}}",encodeURIComponent(e.currItem.title||"")),o+='";s.children[0].innerHTML=o,s.children[0].onclick=_},k=function(n){for(var o=0;e.options.closeElClasses.length>o;o++)if(t.hasClass(n,"pswp__"+e.options.closeElClasses[o]))return!0},M=0,F=function(){clearTimeout(y),M=0,c&&x.setIdle(!1)},S=function(t){t=t?t:window.event;var n=t.relatedTarget||t.toElement;n&&"HTML"!=n.nodeName||(clearTimeout(y),y=setTimeout(function(){x.setIdle(!0)},e.options.timeToIdleOutside))},O=function(e){p!==e&&(t[(e?"remove":"add")+"Class"](d,"pswp__preloader--active"),p=e)},Z=[{name:"caption",option:"captionEl",onInit:function(e){i=e}},{name:"share-modal",option:"shareEl",onInit:function(e){s=e},onTap:function(){E()}},{name:"button--share",option:"shareEl",onInit:function(e){l=e},onTap:function(){E()}},{name:"button--zoom",option:"zoomEl",onTap:e.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){r=e}},{name:"button--close",option:"closeEl",onTap:e.close},{name:"button--arrow--left",option:"arrowEl",onTap:e.prev},{name:"button--arrow--right",option:"arrowEl",onTap:e.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){n.isFullscreen()?n.exit():n.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){d=e}}];x.init=function(){t.extend(e.options,I,!0),o=e.scrollWrap.children[1];var r=e.listen;r("onVerticalDrag",function(e){g&&.95>e?x.hideControls():!g&&e>=.95&&x.showControls()});var u;r("onPinchClose",function(e){g&&.9>e?(x.hideControls(),u=!0):u&&!g&&e>.9&&x.showControls()}),r("zoomGestureEnded",function(){u=!1,u&&!g&&x.showControls()}),r("beforeChange",x.update),r("doubleTap",function(t){var n=e.currItem.initialZoomLevel;e.getZoomLevel()!==n?e.zoomTo(n,t,333):e.zoomTo(e.currItem.doubleTapZoom,t,333)}),r("bindEvents",function(){t.bind(o,"pswpTap click",C),t.bind(e.scrollWrap,"pswpTap",x.onGlobalTap),e.likelyTouchDevice||t.bind(e.scrollWrap,"mouseover",x.onMouseOver)}),e.options.timeToIdle&&r("mouseUsed",function(){t.bind(document,"mousemove",F),t.bind(document,"mouseout",S),v=setInterval(function(){M++,2===M&&x.setIdle(!0)},e.options.timeToIdle/2)}),r("preventDragEvent",function(e,t,n){var o=e.target||e.srcElement;o&&o.className&&e.type.indexOf("mouse")>-1&&(o.className.indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(o.tagName))&&(n.prevent=!1)}),r("unbindEvents",function(){b||E(),v&&clearInterval(v),t.unbind(document,"mouseout",S),t.unbind(document,"mousemove",F),t.unbind(o,"pswpTap click",C),t.unbind(e.scrollWrap,"pswpTap",x.onGlobalTap),t.unbind(e.scrollWrap,"mouseover",x.onMouseOver),n&&(t.unbind(document,n.eventK,x.updateFullscreen),n.isFullscreen()&&(I.hideAnimationDuration=0,n.exit()),n=null)}),r("destroy",function(){e.options.captionEl&&(a&&o.removeChild(a),t.removeClass(i,"pswp__caption--empty")),s&&(s.children[0].onclick=null),t.removeClass(o,"pswp__ui--over-close"),t.addClass(o,"pswp__ui--hidden"),x.setIdle(!1)}),e.options.showAnimationDuration||t.removeClass(o,"pswp__ui--hidden"),r("initialZoomIn",function(){e.options.showAnimationDuration&&t.removeClass(o,"pswp__ui--hidden")}),r("initialZoomOut",function(){t.addClass(o,"pswp__ui--hidden")}),r("parseVerticalMargin",function(n){var r=n.vGap;if(T()){var l=e.options.barsSize;if(e.options.captionEl&&"auto"===l.bottom)if(a||(a=t.createEl("pswp__caption pswp__caption--fake"),a.appendChild(t.createEl("pswp__caption__center")),o.insertBefore(a,i),t.addClass(o,"pswp__ui--fit")),e.options.addCaptionHTMLFn(n,a,!0)){var s=a.clientHeight;r.bottom=parseInt(s,10)||44}else r.bottom=l.top;else r.bottom=l.bottom;r.top=l.top}else r.top=r.bottom=0});var c,d,p,f=function(n){for(var o=n.length,i=0;o>i;i++){c=n[i],d=c.className;for(var a=0;Z.length>a;a++)p=Z[a],d.indexOf("pswp__"+p.name)>-1&&(e.options[p.option]?(t.removeClass(c,"pswp__element--disabled"),p.onInit&&p.onInit(c)):t.addClass(c,"pswp__element--disabled"))}};f(o.children),f(o.children[0].children),e.options.shareEl&&l&&s&&(b=!0),e.options.fullscreenEl&&(n||(n=x.getFullscreenAPI()),n?(t.bind(document,n.eventK,x.updateFullscreen),x.updateFullscreen(),t.addClass(e.template,"pswp--supports-fs")):t.removeClass(e.template,"pswp--supports-fs")),e.options.preloaderEl&&(O(!0),r("beforeChange",function(){clearTimeout(m),m=setTimeout(function(){e.currItem&&e.currItem.loading?(!e.allowProgressiveImg()||e.currItem.img&&!e.currItem.img.naturalWidth)&&O(!1):O(!0)},e.options.loadingIndicatorDelay)}),r("imageLoadComplete",function(t,n){e.currItem===n&&O(!0)}))},x.setIdle=function(e){c=e,t[(e?"add":"remove")+"Class"](o,"pswp__ui--idle")},x.update=function(){g&&e.currItem?(x.updateIndexIndicator(),e.options.captionEl&&(e.options.addCaptionHTMLFn(e.currItem,i),e.currItem.title?t.removeClass(i,"pswp__caption--empty"):t.addClass(i,"pswp__caption--empty")),w=!0):w=!1},x.updateFullscreen=function(){t[(n.isFullscreen()?"add":"remove")+"Class"](e.template,"pswp--fs")},x.updateIndexIndicator=function(){e.options.counterEl&&(r.innerHTML=e.getCurrentIndex()+1+e.options.indexIndicatorSep+e.options.getNumItemsFn())},x.onGlobalTap=function(n){n=n||window.event;var o=n.target||n.srcElement;if(!f)if(n.detail&&"mouse"===n.detail.pointerType)k(o)&&e.close(),t.hasClass(o,"pswp__img")&&(1===e.getZoomLevel()&&e.getZoomLevel()<=e.currItem.fitRatio?e.close():e.toggleDesktopZoom(n.detail.releasePoint));else if(e.options.tapToToggleControls&&(g?x.hideControls():x.showControls()),e.options.tapToClose&&(t.hasClass(o,"pswp__img")||k(o)))return e.close(),void 0},x.onMouseOver=function(e){e=e||window.event;var n=e.target||e.srcElement;k(n)?t.addClass(o,"pswp__ui--over-close"):t.removeClass(o,"pswp__ui--over-close")},x.hideControls=function(){t.addClass(o,"pswp__ui--hidden"),g=!1},x.showControls=function(){g=!0,w||x.update(),t.removeClass(o,"pswp__ui--hidden")},x.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},x.getFullscreenAPI=function(){var t,n=document.documentElement,o="fullscreenchange";return n.requestFullscreen?t={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:o}:n.mozRequestFullScreen?t={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+o}:n.webkitRequestFullscreen?t={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+o}:n.msRequestFullscreen&&(t={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),t&&(t.enter=function(){return u=e.options.closeOnScroll,e.options.closeOnScroll=!1,e.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},t.exit=function(){return e.options.closeOnScroll=u,document[this.exitK]()},t.isFullscreen=function(){return document[this.elementK]}),t}};return e}); \ No newline at end of file diff --git a/vendors/photoswipe/photoswipe.css b/vendors/photoswipe/photoswipe.css deleted file mode 100644 index 310462620..000000000 --- a/vendors/photoswipe/photoswipe.css +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Core PhotoSwipe CSS file, http://photoswipe.com - * @author Dmitry Semenov - */ -.pswp { - display: none; - position: absolute; - width: 100%; - height: 100%; - left: 0; - top: 0; - overflow: hidden; - -ms-touch-action: none; - z-index: 500; - -webkit-text-size-adjust: 100%; - -webkit-backface-visibility: hidden; - outline: none; } - .pswp * { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - .pswp img { - max-width: none; } - -.pswp--animate_opacity { - opacity: 0; - will-change: opacity; - -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); - transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); } - -.pswp--open { - display: block; } - -.pswp--zoom-allowed .pswp__img { - cursor: -webkit-zoom-in; - cursor: -moz-zoom-in; - cursor: zoom-in; } - -.pswp--zoomed-in .pswp__img { - cursor: -webkit-grab; - cursor: -moz-grab; - cursor: grap; } - -.pswp--dragging .pswp__img { - cursor: -webkit-grabbing; - cursor: -moz-grabbing; - cursor: grabbing; } - -.pswp__bg { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - background: black; - opacity: 0; - -webkit-backface-visibility: hidden; - will-change: opacity; } - -.pswp__scroll-wrap { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - -webkit-backface-visibility: hidden; - will-change: transform; } - -.pswp__container, .pswp__zoom-wrap { - -ms-touch-action: none; - touch-action: none; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; } - -.pswp__container, .pswp__img { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - -webkit-touch-callout: none; } - -.pswp__zoom-wrap { - position: absolute; - width: 100%; - -webkit-transform-origin: left top; - -moz-transform-origin: left top; - -ms-transform-origin: left top; - transform-origin: left top; - -webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1); - transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); } - -.pswp__container, .pswp__zoom-wrap { - -webkit-backface-visibility: hidden; - will-change: transform; } - -.pswp__item { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - overflow: hidden; } - -.pswp__img { - position: absolute; - width: auto; - height: auto; - -webkit-transition: opacity 0.15s; - transition: opacity 0.15s; } - -.pswp__img--placeholder { - -webkit-backface-visibility: hidden; } - -.pswp__img--placeholder--blank { - background: #222222; } - -.pswp--ie .pswp__img { - width: 100%; - height: 100%; - left: 0; - top: 0; } diff --git a/vendors/photoswipe/photoswipe.js b/vendors/photoswipe/photoswipe.js deleted file mode 100644 index c791d9599..000000000 --- a/vendors/photoswipe/photoswipe.js +++ /dev/null @@ -1,3644 +0,0 @@ -/*! PhotoSwipe - v4.0.0 - 2014-12-04 -* http://photoswipe.com -* Copyright (c) 2014 Dmitry Semenov; */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - define(factory); - } else if (typeof exports === 'object') { - module.exports = factory; - } else { - root.PhotoSwipe = factory(); - } -})(this, function () { - - 'use strict'; - var PhotoSwipe = function(template, UiClass, items, options){ - -/*>>framework-bridge*/ -/** - * - * Set of generic functions used by gallery. - * - * You're free to modify anything here as long as functionality is kept. - * - */ -var framework = { - features: null, - - bind: function(target, type, listener, unbind) { - - var methodName = (unbind ? 'remove' : 'add') + 'EventListener'; - type = type.split(' '); - for(var i = 0; i < type.length; i++) { - if(type[i]) { - target[methodName]( type[i], listener, false); - } - } - - }, - isArray: function(obj) { - return (obj instanceof Array); - }, - createEl: function(classes, tag) { - var el = document.createElement(tag || 'div'); - if(classes) { - el.className = classes; - } - return el; - }, - getScrollY: function() { - var yOffset = window.pageYOffset; - return yOffset !== undefined ? yOffset : document.documentElement.scrollTop; - }, - unbind: function(target, type, listener) { - framework.bind(target,type,listener,true); - }, - removeClass: function(el, className) { - var reg = new RegExp('(\\s|^)' + className + '(\\s|$)'); - el.className = el.className.replace(reg, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); - }, - addClass: function(el, className) { - if( !framework.hasClass(el,className) ) { - el.className += (el.className ? ' ' : '') + className; - } - }, - hasClass: function(el, className) { - return el.className && new RegExp('(^|\\s)' + className + '(\\s|$)').test(el.className); - }, - - arraySearch: function(array, value, key) { - var i = array.length; - while(i--) { - if(array[i][key] === value) { - return i; - } - } - return -1; - }, - // getOffset: function(el) { - // // http://stackoverflow.com/a/11396681/331460 - // var bodyRect = document.body.getBoundingClientRect(), - // elemRect = el.getBoundingClientRect(); - - // return { x: elemRect.left - bodyRect.left, y: elemRect.top - bodyRect.top }; - // }, - extend: function(o1, o2, preventOverwrite) { - for (var prop in o2) { - if (o2.hasOwnProperty(prop)) { - if(preventOverwrite && o1.hasOwnProperty(prop)) { - continue; - } - o1[prop] = o2[prop]; - } - } - }, - easing: { - sine: { - out: function(k) { - return Math.sin(k * (Math.PI / 2)); - }, - inOut: function(k) { - return - (Math.cos(Math.PI * k) - 1) / 2; - } - }, - cubic: { - out: function(k) { - return --k * k * k + 1; - } - } - // elastic: { - // out: function ( k ) { - - // var s, a = 0.1, p = 0.4; - // if ( k === 0 ) return 0; - // if ( k === 1 ) return 1; - // if ( !a || a < 1 ) { a = 1; s = p / 4; } - // else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI ); - // return ( a * Math.pow( 2, - 10 * k) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) + 1 ); - - // }, - // }, - // back: { - // out: function ( k ) { - - // var s = 1.70158; - // return --k * k * ( ( s + 1 ) * k + s ) + 1; - - // } - // } - }, - - /** - * - * @return {object} - * - * { - * raf : request animation frame function - * caf : cancel animation frame function - * transfrom : transform property key (with vendor), or null if not supported - * oldIE : IE8 or below - * } - * - */ - detectFeatures: function() { - if(framework.features) { - return framework.features; - } - var helperEl = framework.createEl(), - helperStyle = helperEl.style, - vendor = '', - features = {}; - - // IE8 and below - features.oldIE = document.all && !document.addEventListener; - - features.touch = 'ontouchstart' in window; - - if(window.requestAnimationFrame) { - features.raf = window.requestAnimationFrame; - features.caf = window.cancelAnimationFrame; - } - - - features.pointerEvent = navigator.pointerEnabled || navigator.msPointerEnabled; - - - - if(!features.pointerEvent) { // fix false-positive detection of old Android (IE11 ua string contains "Android 4.0") - - var ua = navigator.userAgent; - // Detect if device is iPhone or iPod and if it's older than iOS 8 - // http://stackoverflow.com/a/14223920 - // This detection is made because of buggy top/bottom toolbars that don't trigger window.resize event when appear. - // For more info refer to _isFixedPosition variable in core.js - if (/iP(hone|od)/.test(navigator.platform)) { - var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/); - v = parseInt(v[1], 10); - if(v >= 1 && v < 8 ) { - features.isOldIOSPhone = true; - } - } - // Detect old Android (before KitKat) - // due to bugs related to position:fixed - // http://stackoverflow.com/questions/7184573/pick-up-the-android-version-in-the-browser-by-javascript - var match = ua.match(/Android\s([0-9\.]*)/); - var androidversion = match ? match[1] : 0; - androidversion = parseFloat(androidversion); - if(androidversion >= 1 && androidversion < 4.4 ) { - features.isOldAndroid = true; - } else if(androidversion >= 5) { - features.isNewAndroid = true; // Lollipop - } - features.isMobileOpera = /opera mini|opera mobi/i.test(ua); - - // p.s. yes, yes, UA sniffing is bad, propose your solution for above bugs. - - } - - - - - - - var styleChecks = ['transform', 'perspective', 'animationName'], - vendors = ['', 'webkit','Moz','ms','O'], - styleCheckItem, - styleName; - - for(var i = 0; i < 4; i++) { - vendor = vendors[i]; - - for(var a = 0; a < 3; a++) { - styleCheckItem = styleChecks[a]; - - // uppercase first letter of property name, if vendor is present - styleName = vendor + (vendor ? styleCheckItem.charAt(0).toUpperCase() + styleCheckItem.slice(1) : styleCheckItem); - - if(!features[styleCheckItem] && styleName in helperStyle ) { - features[styleCheckItem] = styleName; - } - } - - if(vendor && !features.raf) { - vendor = vendor.toLowerCase(); - features.raf = window[vendor+'RequestAnimationFrame']; - if(features.raf) { - features.caf = window[vendor+'CancelAnimationFrame'] || window[vendor+'CancelRequestAnimationFrame']; - } - } - - } - - - - - if(!features.raf) { - var lastTime = 0; - features.raf = function(fn) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { fn(currTime + timeToCall); }, timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - features.caf = function(id) { clearTimeout(id); }; - } - - // Detect SVG support - features.svg = !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect; - - framework.features = features; - - return features; - - } -}; - -framework.detectFeatures(); - -// Override add event listener for old versions of IE -if(framework.features.oldIE) { - framework.bind = function(target, type, listener, unbind) { - // if ( !framework.isArray(type) ) { - // type = [type]; - // } - type = type.split(' '); - - var methodName = (unbind ? 'detach' : 'attach') + 'Event', - evName; - for(var i = 0; i < type.length; i++) { - evName = type[i]; - if(evName) { - - if(typeof listener == "object" && listener.handleEvent) { - if(!unbind) { - - listener['oldIE' + evName] = function() { - listener.handleEvent.call(listener); - }; - - } else { - if(!listener['oldIE' + evName]) { - return false; - } - - } - - target[methodName]( 'on' + evName, listener['oldIE' + evName]); - } else { - target[methodName]( 'on' + evName, listener); - } - - - } - } - }; -} - - - - -/*>>framework-bridge*/ - -/*>>core*/ -//function(template, UiClass, items, options) - -/* Core module. Contains swipe and pinch-zoom logic. */ - - -var self = this; - - -/** - * Static vars, don't change unless you know what you're doing. - */ -var DOUBLE_TAP_RADIUS = 25, - NUM_HOLDERS = 3; - -/** - * Options - */ -var _options = { - allowPanToNext:true, // Allow navigation to next/prev item when current item is zoomed (using swipe gesture). Option is always false on non-touch devices. - spacing: 0.12, // Spacing ratio between slides (during swipe). For example, 0.12 will render as a 12% of sliding viewport. - bgOpacity: 1, - - mouseUsed: false, - loop: true, - pinchToClose: true, - - closeOnScroll: true, - closeOnVerticalDrag: true, - - hideAnimationDuration: 333, - showAnimationDuration: 333, - showHideOpacity: false, - - focus: true, - - escKey: true, - arrowKeys: true, - - mainScrollEndFriction: 0.35, - panEndFriction: 0.35, - - // not fully implemented yet - scaleMode: 'fit', // TODO - modal: true, // TODO - alwaysFadeIn: false // TODO -}; -framework.extend(_options, options); - - - -/** - * Private helper variables & functions - */ - -var _getEmptyPoint = function() { return {x:0,y:0}; }; - -var _isOpen, - _isDestroying, - _closedByScroll, - _currentItemIndex, - _containerStyle, - _containerShiftIndex, - _lastReleaseTime = 0, - _currPanDist = _getEmptyPoint(), - _startPanOffset = _getEmptyPoint(), - _panOffset = _getEmptyPoint(), - _centerPoint = _getEmptyPoint(), - - _upMoveEvents, // drag move, drag end & drag cancel events array - _downEvents, // drag start events array - _globalEventHandlers, - - - _viewportSize = {}, - - _currZoomLevel, - _startZoomLevel, - - _translatePrefix, - _translateSufix, - - _updateSizeInterval, - - - - _currPositionIndex = 0, - _currZoomedItemIndex = 0, - _slideSize = _getEmptyPoint(), // size of slide area, including spacing - - - _scrollChanged, - - _itemHolders, - _prevItemIndex, - _indexDiff = 0, // difference of indexes since last content update - - _dragStartEvent, - _dragMoveEvent, - _dragEndEvent, - _dragCancelEvent, - _transformKey, - _pointerEventEnabled, - _isFixedPosition = true, - _likelyTouchDevice, - _modules = [], - - _requestAF, - _cancelAF, - _initalClassName, - _initalWindowScrollY, - _oldIE, - _currentWindowScrollY, - _features, - _windowVisibleSize = {}, - - // Registers PhotoSWipe module (History, Controller ...) - _registerModule = function(name, module) { - framework.extend(self, module.publicMethods); - _modules.push(name); - }, - - _getLoopedId = function(index) { - var numSlides = _getNumItems(); - if(index > numSlides - 1) { - return index - numSlides; - } else if(index < 0) { - return numSlides + index; - } - return index; - }, - - - // Micro bind/trigger - _listeners = {}, - _listen = function(name, fn) { - if(!_listeners[name]) { - _listeners[name] = []; - } - return _listeners[name].push(fn); - }, - _shout = function(name) { - console.log(name); - var listeners = _listeners[name]; - - if(listeners) { - var args = Array.prototype.slice.call(arguments); - args.shift(); - - for(var i = 0; i < listeners.length; i++) { - listeners[i].apply(self, args); - } - } - }, - - _getCurrentTime = function() { - return new Date().getTime(); - }, - _applyBgOpacity = function(opacity) { - _bgOpacity = opacity; - self.bg.style.opacity = opacity * _options.bgOpacity; - }, - - _applyZoomTransform = function(styleObj,x,y,zoom) { - styleObj[_transformKey] = _translatePrefix + x + 'px, ' + y + 'px' + _translateSufix + ' scale(' + zoom + ')';;//'scale3d(' + zoom + ',' + zoom + ',1)';//' scale(' + zoom + ')'; - }, - _applyCurrentZoomPan = function() { - if(_currZoomElementStyle) { - _applyZoomTransform(_currZoomElementStyle, _panOffset.x, _panOffset.y, _currZoomLevel); - } - }, - _applyZoomPanToItem = function(item) { - _applyZoomTransform(item.container.style, item.initialPosition.x, item.initialPosition.y, item.initialZoomLevel); - }, - _setTranslateX = function(x, elStyle) { - elStyle[_transformKey] = _translatePrefix + x + 'px, 0px' + _translateSufix; - }, - - _moveMainScroll = function(x, dragging) { - - if(!_options.loop && dragging) { - var newSlideIndexOffset = _currentItemIndex + (_slideSize.x * _currPositionIndex - x)/_slideSize.x; // if of current item during scroll (float) - var delta = Math.round(x - _mainScrollPos.x); - - if( (newSlideIndexOffset < 0 && delta > 0) || - (newSlideIndexOffset >= _getNumItems()-1 && delta < 0) ) { - x = _mainScrollPos.x + delta * _options.mainScrollEndFriction; - } - } - - _mainScrollPos.x = x; - _setTranslateX(x, _containerStyle); - }, - - _calculateZoomLevel = function(touchesDistance) { - return 1 / _startPointsDistance * touchesDistance * _startZoomLevel; - }, - _calculatePanOffset = function(axis, zoomLevel) { - var m = _midZoomPoint[axis] - _offset[axis]; - return _startPanOffset[axis] + _currPanDist[axis] + m - m * ( zoomLevel / _startZoomLevel ); - }, - _isEqualPoints = function(p1, p2) { - return p1.x === p2.x && p1.y === p2.y; - }, - _isNearbyPoints = function(touch0, touch1) { - return (Math.abs(touch0.x - touch1.x) < DOUBLE_TAP_RADIUS && Math.abs(touch0.y - touch1.y) < DOUBLE_TAP_RADIUS); - }, - _equalizePoints = function(p1, p2) { - p1.x = p2.x; - p1.y = p2.y; - if(p2.id) { - p1.id = p2.id; - } - }, - _bindEvents = function() { - framework.bind(document, 'keydown keyup', self); - - if(!_options.mouseUsed) { - framework.bind(document, 'mousemove', _onFirstMouseMove); - } - - framework.bind(window, 'resize scroll', self); - - _shout('bindEvents'); - }, - _unbindEvents = function() { - framework.unbind(window, 'resize', self); - framework.unbind(window, 'scroll', _globalEventHandlers.scroll); - framework.unbind(document, 'keydown keyup', self); - framework.unbind(document, 'mousemove', _onFirstMouseMove); - - if(_isDragging) { - framework.unbind(window, _upMoveEvents, self); - } - - _shout('unbindEvents'); - }, - - - _mouseMoveTimeout = null, - _onFirstMouseMove = function(e) { - // Wait until mouse move event is fired at least twice during 100ms - // We do this, because some mobile browsers trigger it on touchstart - if(_mouseMoveTimeout ) { - framework.unbind(document, 'mousemove', _onFirstMouseMove); - framework.addClass(template, 'pswp--has_mouse'); - _options.mouseUsed = true; - _shout('mouseUsed'); - } - _mouseMoveTimeout = setTimeout(function() { - _mouseMoveTimeout = null; - }, 100); - }, - - _calculatePanBounds = function(zoomLevel, update) { - var bounds = _calculateItemSize( self.currItem, _viewportSize, zoomLevel ); - if(update) { - _currPanBounds = bounds; - } - return bounds; - }, - - // Return true if offset is out of the bounds - _isOutOfBounds = function(axis, destPanBounds, destPanOffset, destZoomLevel) { - if(destZoomLevel === self.currItem.initialZoomLevel) { - destPanOffset[axis] = self.currItem.initialPosition[axis]; - return true; - } else { - destPanOffset[axis] = _calculatePanOffset(axis, destZoomLevel); - - if(destPanOffset[axis] > destPanBounds.min[axis]) { - destPanOffset[axis] = destPanBounds.min[axis]; - return true; - } else if(destPanOffset[axis] < destPanBounds.max[axis] ) { - destPanOffset[axis] = destPanBounds.max[axis]; - return true; - } - } - return false; - }; - - - - - - -// Micro animation engine -var _animations = {}, - _numAnimations = 0, - _stopAnimation = function(name) { - if(_animations[name]) { - if(_animations[name].raf) { - _cancelAF( _animations[name].raf ); - } - _numAnimations--; - delete _animations[name]; - } - }, - _registerStartAnimation = function(name) { - if(_animations[name]) { - _stopAnimation(name); - } - if(!_animations[name]) { - _numAnimations++; - _animations[name] = {}; - } - }, - _stopAllAnimations = function() { - for (var prop in _animations) { - - if( _animations.hasOwnProperty( prop ) ) { - _stopAnimation(prop); - } - - } - }, - _animateProp = function(name, b, endProp, d, easingFn, onUpdate, onComplete) { - var startAnimTime = _getCurrentTime(), t; - _registerStartAnimation(name); - - var animloop = function(){ - if ( _animations[name] ) { - - t = _getCurrentTime() - startAnimTime; // time diff - //b - beginning (start prop) - //d - anim duration - - if ( t >= d ) { - _stopAnimation(name); - onUpdate(endProp); - if(onComplete) { - onComplete(); - } - return; - } - onUpdate( (endProp - b) * easingFn(t/d) + b ); - - _animations[name].raf = _requestAF(animloop); - } - }; - animloop(); - }, - - - - - _showOrHideTimeout, - /** - * Function manages open/close transitions of gallery - */ - _showOrHide = function(item, img, out, completeFn) { - - if(_showOrHideTimeout) { - clearTimeout(_showOrHideTimeout); - } - - _initialZoomRunning = true; - _initialContentSet = true; - - var thumbBounds; // dimensions of small thumbnail ({x:,y:,w:}), height is optional, as calculated based on large image - if(item.initialLayout) { - thumbBounds = item.initialLayout; - item.initialLayout = null; - } else { - thumbBounds = _options.getThumbBoundsFn && _options.getThumbBoundsFn(_currentItemIndex); - } - - - var complete = function() { - - _stopAnimation('initialZoom'); - if(!out) { - _applyBgOpacity(1); - if(img) { - img.style.display = 'block'; - } - framework.addClass(template, 'pswp--animated-in'); - _shout('initialZoomInEnd'); - } - if(completeFn) { - completeFn(); - } - _initialZoomRunning = false; - }; - - var duration = out ? _options.hideAnimationDuration : _options.showAnimationDuration; - - - - // if bounds aren't provided, just open gallery without animation - if(!thumbBounds || thumbBounds.x === undefined || !duration ) { - _shout('initialZoom' + (out ? 'Out' : 'In') ); - - _currZoomLevel = item.initialZoomLevel; - _equalizePoints(_panOffset, item.initialPosition ); - _applyCurrentZoomPan(); - - - // if(_options.showHideDuration) { - // if(!out) { - // complete(); - // } - // // simple opacity transition - // _showOrHideTimeout = setTimeout(function() { - // if(_options.showHideOpacity) { - // template.style.opacity = out ? 0 : 1; - // } - - // if(out) { - // _showOrHideTimeout = setTimeout(function() { - // complete(); - // }, _options.showHideDuration + 20); - // } - - // }, out ? 15 : 50); - // } else { - // no transition - template.style.opacity = out ? 0 : 1; - _applyBgOpacity(1); - complete(); - //} - - return false; - } - - - - // apply hw-acceleration to image - if(item.miniImg) { - item.miniImg.style.webkitBackfaceVisibility = 'hidden'; - } - - if(!out) { - _currZoomLevel = thumbBounds.w / item.w; - _panOffset.x = thumbBounds.x; - _panOffset.y = thumbBounds.y - _initalWindowScrollY; - - if(_options.showHideOpacity) { - template.style.opacity = 0.001; - template.style.webkitBackfaceVisibility = 'hidden'; - //template.style.webkitTransition = 'opacity 0.3s linear'; - } - _applyCurrentZoomPan(); - } - - _registerStartAnimation('initialZoom'); - - - if(out && !_closedByScroll) { - framework.removeClass(template, 'pswp--animated-in'); - } - - - _showOrHideTimeout = setTimeout(function() { - - _shout('initialZoom' + (out ? 'Out' : 'In') ); - - - if(!out) { - - // "in" animation always uses CSS transitions (instead of rAF) - // CSS transition works faster here, as we may also want to animate other things, like ui on top of sliding area, which can be animated just via CSS - _currZoomLevel = item.initialZoomLevel; - _equalizePoints(_panOffset, item.initialPosition ); - _applyCurrentZoomPan(); - _applyBgOpacity(1); - - if(_options.showHideOpacity) { - template.style.opacity = 1; - } else { - _applyBgOpacity(1); - } - - _showOrHideTimeout = setTimeout(complete, duration + 20); - } else { - - // "out" animation uses rAF only when PhotoSwipe is closed by browser scroll, to recalculate position - var destZoomLevel = thumbBounds.w / item.w, - initialPanOffset = { - x: _panOffset.x, - y: _panOffset.y - }, - initialZoomLevel = _currZoomLevel, - scrollY = _initalWindowScrollY, - initalBgOpacity = _bgOpacity, - onUpdate = function(now) { - if(_scrollChanged) { - scrollY = framework.getScrollY(); - _scrollChanged = false; - } - - if(now === 1) { - _currZoomLevel = destZoomLevel; - _panOffset.x = thumbBounds.x; - _panOffset.y = thumbBounds.y - scrollY; - if(_closedByScroll) { - complete(); - } - } else { - _currZoomLevel = (destZoomLevel - initialZoomLevel) * now + initialZoomLevel; - _panOffset.x = (thumbBounds.x - initialPanOffset.x) * now + initialPanOffset.x; - _panOffset.y = (thumbBounds.y - scrollY - initialPanOffset.y) * now + initialPanOffset.y; - } - - _applyCurrentZoomPan(); - if(_options.showHideOpacity) { - template.style.opacity = 1 - now; - } else { - _applyBgOpacity( initalBgOpacity - now * initalBgOpacity ); - } - - //_applyBgOpacity( initalBgOpacity - now * initalBgOpacity ); - }; - - if(_closedByScroll) { - _animateProp('initialZoom', 0, 1, duration, framework.easing.cubic.out/*sine.inOut*/, onUpdate); - } else { - onUpdate(1); - _showOrHideTimeout = setTimeout(complete, duration + 20); - } - } - - }, out ? 25 : 90); // Main purpose of this delay is to give browser time to paint and - // create composite layers of PhotoSwipe UI parts (background, controls, caption, arrows). - // Which avoids lag at the beginning of scale transition. - - - - return true; - }; - - - -var publicMethods = { - - // make a few local variables and functions public - shout: _shout, - listen: _listen, - viewportSize: _viewportSize, - options: _options, - - isMainScrollAnimating: function() { - return _mainScrollAnimating; - }, - getZoomLevel: function() { - return _currZoomLevel; - }, - getCurrentIndex: function() { - return _currentItemIndex; - }, - isDragging: function() { - return _isDragging; - }, - isZooming: function() { - return _isZooming; - }, - applyZoomPan: function(zoomLevel,panX,panY) { - _panOffset.x = panX; - _panOffset.y = panY; - _currZoomLevel = zoomLevel; - _applyCurrentZoomPan(); - }, - - init: function() { - if(_isOpen || _isDestroying) return; - - - var i; - - self.framework = framework; // basic function - self.template = template; // root DOM element of PhotoSwipe - self.bg = template.children[0]; - - _initalClassName = template.className; - _isOpen = true; - - _features = framework.detectFeatures(); - _requestAF = _features.raf; - _cancelAF = _features.caf; - _transformKey = _features.transform; - _oldIE = _features.oldIE; - - self.scrollWrap = template.children[1]; - self.container = self.scrollWrap.children[0]; - _containerStyle = self.container.style; // for fast access - - - if(!_transformKey) { - // Override zoom/pan/move functions in case old browser is used (most likely IE) - - _transformKey = 'left'; - framework.addClass(template, 'pswp--ie'); - - _setTranslateX = function(x, elStyle) { - elStyle.left = x + 'px'; - }; - _applyZoomPanToItem = function(item) { - - var s = item.container.style, - w = item.fitRatio * item.w, - h = item.fitRatio * item.h; - - s.width = w + 'px'; - s.height = h + 'px'; - s.left = item.initialPosition.x + 'px'; - s.top = item.initialPosition.y + 'px'; - - }; - _applyCurrentZoomPan = function() { - if(_currZoomElementStyle) { - - var s = _currZoomElementStyle; - var item = self.currItem; - - - var w = item.fitRatio * item.w; - var h = item.fitRatio * item.h; - - s.width = w + 'px'; - s.height = h + 'px'; - - - s.left = _panOffset.x + 'px'; - s.top = _panOffset.y + 'px'; - } - - }; - } else { - // setup 3d transforms - var allow3dTransform = _features.perspective && !_likelyTouchDevice; - _translatePrefix = 'translate' + (allow3dTransform ? '3d(' : '('); - _translateSufix = _features.perspective ? ', 0px)' : ')'; - } - - - // helper function that builds touch/pointer/mouse events - var addEventNames = function(pref, down, move, up, cancel) { - _dragStartEvent = pref + down; - _dragMoveEvent = pref + move; - _dragEndEvent = pref + up; - if(cancel) { - _dragCancelEvent = pref + cancel; - } else { - _dragCancelEvent = ''; - } - }; - - // Objects that hold slides (there are only 3 in DOM) - _itemHolders = [ - {el:self.container.children[0] , wrap:0, index: -1}, - {el:self.container.children[1] , wrap:0, index: -1}, - {el:self.container.children[2] , wrap:0, index: -1} - ]; - - // hide nearby item holders until initial zoom animation finishes (to avoid extra Paints) - _itemHolders[0].el.style.display = _itemHolders[2].el.style.display = 'none'; - - - - _pointerEventEnabled = _features.pointerEvent; - if(_pointerEventEnabled && _features.touch) { - // we don't need touch events, if browser supports pointer events - _features.touch = false; - } - - if(_pointerEventEnabled) { - if(navigator.pointerEnabled) { - addEventNames( 'pointer', 'down', 'move', 'up', 'cancel' ); - } else { - // IE10 pointer events are case-sensitive - addEventNames( 'MSPointer', 'Down', 'Move', 'Up', 'Cancel'); - } - } else if(_features.touch) { - addEventNames('touch', 'start', 'move', 'end', 'cancel'); - _likelyTouchDevice = true; - } else { - addEventNames('mouse', 'down', 'move', 'up'); - } - - _upMoveEvents = _dragMoveEvent + ' ' + _dragEndEvent + ' ' + _dragCancelEvent; - _downEvents = _dragStartEvent; - - if(_pointerEventEnabled && !_likelyTouchDevice) { - _likelyTouchDevice = (navigator.maxTouchPoints > 1) || (navigator.msMaxTouchPoints > 1); - } - self.likelyTouchDevice = _likelyTouchDevice; // make variable public - - // disable show/hide effects on old browsers that don't support CSS animations or transforms (like IE8-9), - // old IOS, Android and Opera mobile. Blackberry seems to work fine, even older models. - if(!_features.animationName || !_features.transform || _features.isOldIOSPhone || _features.isOldAndroid || _features.isMobileOpera ) { - _options.showAnimationDuration = _options.hideAnimationDuration = 0; - } - - for(i = 0; i < _modules.length; i++) { - self['init' + _modules[i]](); - } - - if(UiClass) { - var ui = self.ui = new UiClass(self, framework); - ui.init(); - } - - if(!_likelyTouchDevice) { - // don't allow pan to next slide from zoomed state on Desktop - _options.allowPanToNext = false; - } - - // Setup events - _globalEventHandlers = { - resize: self.updateSize, - scroll: function() { - - _scrollChanged = true; - - // "close" on scroll works only on desktop devices, or when mouse is used - if(_options.closeOnScroll && _isOpen && (!self.likelyTouchDevice || _options.mouseUsed) ) { - - if(Math.abs(framework.getScrollY() - _initalWindowScrollY) > 2) { // if scrolled for more than 2px - _closedByScroll = true; - self.close(); - } - - } - }, - keyup: function(e) { - if(_options.escKey && e.keyCode === 27) { // esc key - self.close(); - } - }, - keydown: function(e) { - if(_options.arrowKeys) { - if(e.keyCode === 37) { - self.prev(); - } else if(e.keyCode === 39) { - self.next(); - } - } - } - }; - _globalEventHandlers[_dragStartEvent] = _onDragStart; - _globalEventHandlers[_dragMoveEvent] = _onDragMove; - _globalEventHandlers[_dragEndEvent] = _onDragRelease; // the Kraken - - - if(_dragCancelEvent) { - _globalEventHandlers[_dragCancelEvent] = _globalEventHandlers[_dragEndEvent]; - } - - - // Bind mouse events on device with detected hardware touch support, in case it supports multiple types of input. - if(_features.touch) { - _downEvents += ' mousedown'; - _upMoveEvents += 'mousemove mouseup'; - _globalEventHandlers.mousedown = _globalEventHandlers[_dragStartEvent]; - _globalEventHandlers.mousemove = _globalEventHandlers[_dragMoveEvent]; - _globalEventHandlers.mouseup = _globalEventHandlers[_dragEndEvent]; - } - - _shout('firstUpdate'); - _currentItemIndex = _currentItemIndex || _options.index || 0; - // validate index - if( isNaN(_currentItemIndex) || _currentItemIndex < 0 || _currentItemIndex >= _getNumItems() ) { - _currentItemIndex = 0; - } - self.currItem = _getItemAt( _currentItemIndex ); - - - if(_features.isOldIOSPhone || _features.isOldAndroid) { - _isFixedPosition = false; - } - - if(_options.modal) { - template.setAttribute('aria-hidden', 'false'); - if(!_isFixedPosition) { - template.style.position = 'absolute'; - template.style.top = framework.getScrollY() + 'px'; - } else { - template.style.position = 'fixed'; - } - } - - if(_currentWindowScrollY === undefined) { - _shout('initialLayout'); - _currentWindowScrollY = _initalWindowScrollY = framework.getScrollY(); - } - - // add classes to root element of PhotoSwipe - var rootClasses = 'pswp--open '; - if(_options.mainClass) { - rootClasses += _options.mainClass + ' '; - } - if(_options.showHideOpacity) { - rootClasses += 'pswp--animate_opacity '; - } - rootClasses += _likelyTouchDevice ? 'pswp--touch' : 'pswp--notouch'; - rootClasses += _features.animationName ? ' pswp--css_animation' : ''; - rootClasses += _features.svg ? ' pswp--svg' : ''; - framework.addClass(template, rootClasses); - - self.updateSize(); - - - // initial update - _containerShiftIndex = -1; - _indexDiff = null; - for(i = 0; i < NUM_HOLDERS; i++) { - _setTranslateX( (i+_containerShiftIndex) * _slideSize.x, _itemHolders[i].el.style); - } - - - - if(!_oldIE) { - framework.bind(self.scrollWrap, _downEvents, self); // no dragging for old IE - } - - _listen('initialZoomInEnd', function() { - self.setContent(_itemHolders[0], _currentItemIndex-1); - self.setContent(_itemHolders[2], _currentItemIndex+1); - - _itemHolders[0].el.style.display = _itemHolders[2].el.style.display = 'block'; - - if(_options.focus) { - // focus causes layout, which causes lag during animation, that's why we delay it till the initial zoom transition ends - template.focus(); - } - - - _bindEvents(); - }); - - self.setContent(_itemHolders[1], _currentItemIndex); - - self.updateCurrItem(); - - _shout('afterInit'); - - if(!_isFixedPosition) { - // On all versions of iOS lower than 8.0, we check size of viewport every second - // This is done to detect when Safari top & bottom bars appear, as this action doesn't trigger any events (like resize). - // On iOS8 they fixed this. - // 10 Nov 2014: iOS 7 usage ~40%. iOS 8 usage 56%. - _updateSizeInterval = setInterval(function() { - if(!_numAnimations && !_isDragging && !_isZooming && (_currZoomLevel === self.currItem.initialZoomLevel) ) { - self.updateSize(); - } - }, 1000); - } - - framework.addClass(template, 'pswp--visible'); - }, - - // Closes the gallery, then destroy it - close: function() { - if(!_isOpen) return; - - _isOpen = false; - _isDestroying = true; - _shout('close'); - _unbindEvents(); - - _showOrHide( self.currItem, null, true, self.destroy); - }, - - // destroys gallery (unbinds events, cleans up intervals and timeouts to avoid memory leaks) - destroy: function() { - _shout('destroy'); - - if(_showOrHideTimeout) { - clearTimeout(_showOrHideTimeout); - } - - if(_options.modal) { - template.setAttribute('aria-hidden', 'true'); - template.className = _initalClassName; - } - - if(_updateSizeInterval) { - clearInterval(_updateSizeInterval); - } - - framework.unbind(self.scrollWrap, _downEvents, self); - - // we unbind lost event at the end, as closing animation may depend on it - framework.unbind(window, 'scroll', self); - - _stopDragUpdateLoop(); - - _stopAllAnimations(); - - _listeners = null; - }, - - // TODO: pan via mousemove instead of drag? - // mouseMovePan: function(x,y) { - // - // if(!isMouseMoving) { - // forceRenderMovement = true; - // isMouseMoving = true; - // } - // // 60 px is the starting coordinate - // // e.g. if width of window is 1024px, mouse move will work from 60px to 964px (1024 - 60) - // var DIST = 60; - // var percentX = 1 - x / (_viewportSize.x - DIST*2) + DIST/(_viewportSize.x-DIST*2), - // percentY = 1 - y / (_viewportSize.y - DIST*2) + DIST/(_viewportSize.y-DIST*2); - // mouseMovePos.x = (_currPanBounds.min.x - _currPanBounds.max.x) * percentX - _currPanBounds.min.x; - // mouseMovePos.y = (_currPanBounds.min.y - _currPanBounds.max.y) * percentY - _currPanBounds.min.y; - // }, - - /** - * Pan image to position - * @param {Number} x - * @param {Number} y - * @param {Boolean} force Will ignore bounds if set to true. - */ - panTo: function(x,y,force) { - if(!force) { - if(x > _currPanBounds.min.x) { - x = _currPanBounds.min.x; - } else if(x < _currPanBounds.max.x) { - x = _currPanBounds.max.x; - } - - if(y > _currPanBounds.min.y) { - y = _currPanBounds.min.y; - } else if(y < _currPanBounds.max.y) { - y = _currPanBounds.max.y; - } - } - - _panOffset.x = x; - _panOffset.y = y; - _applyCurrentZoomPan(); - }, - - handleEvent: function (e) { - e = e || window.event; - if(_globalEventHandlers[e.type]) { - _globalEventHandlers[e.type](e); - } - }, - - - goTo: function(index) { - - index = _getLoopedId(index); - - var diff = index - _currentItemIndex; - _indexDiff = diff; - - _currentItemIndex = index; - self.currItem = _getItemAt( _currentItemIndex ); - _currPositionIndex -= diff; - - _moveMainScroll(_slideSize.x * _currPositionIndex); - - - _stopAllAnimations(); - _mainScrollAnimating = false; - - self.updateCurrItem(); - }, - next: function() { - self.goTo( _currentItemIndex + 1); - }, - prev: function() { - self.goTo( _currentItemIndex - 1); - }, - - updateCurrItem: function(beforeAnimation) { - - if(_indexDiff === 0) { - return; - } - - var diffAbs = Math.abs(_indexDiff), - tempHolder; - - if(beforeAnimation && diffAbs < 2) { - return; - } - - - self.currItem = _getItemAt( _currentItemIndex ); - - _shout('beforeChange', _indexDiff); - - if(diffAbs >= NUM_HOLDERS) { - _containerShiftIndex += _indexDiff + (_indexDiff > 0 ? -NUM_HOLDERS : NUM_HOLDERS); - diffAbs = NUM_HOLDERS; - } - for(var i = 0; i < diffAbs; i++) { - if(_indexDiff > 0) { - tempHolder = _itemHolders.shift(); - _itemHolders[NUM_HOLDERS-1] = tempHolder; // move first to last - - _containerShiftIndex++; - _setTranslateX( (_containerShiftIndex+2) * _slideSize.x, tempHolder.el.style); - self.setContent(tempHolder, _currentItemIndex - diffAbs + i + 1 + 1); - } else { - tempHolder = _itemHolders.pop(); - _itemHolders.unshift( tempHolder ); // move last to first - - _containerShiftIndex--; - _setTranslateX( _containerShiftIndex * _slideSize.x, tempHolder.el.style); - self.setContent(tempHolder, _currentItemIndex + diffAbs - i - 1 - 1); - } - - } - - // reset zoom/pan on previous item - if(_currZoomElementStyle && Math.abs(_indexDiff) === 1) { - - var prevItem = _getItemAt(_prevItemIndex); - if(prevItem.initialZoomLevel !== _currZoomLevel) { - _calculateItemSize(prevItem , _viewportSize ); - _applyZoomPanToItem( prevItem ); - - } - - } - - // itemHolder[1] is middle (current) item - if(_itemHolders[1].el.children.length) { - var zoomElement = _itemHolders[1].el.children[0]; - if( framework.hasClass(zoomElement, 'pswp__zoom-wrap') ) { - _currZoomElementStyle = zoomElement.style; - } else { - _currZoomElementStyle = null; - } - } else { - _currZoomElementStyle = null; - } - - // reset diff after update - _indexDiff = 0; - - _currPanBounds = self.currItem.bounds; - _startZoomLevel = _currZoomLevel = self.currItem.initialZoomLevel; - - _panOffset.x = _currPanBounds.center.x; - _panOffset.y = _currPanBounds.center.y; - - _prevItemIndex = _currentItemIndex; - - _shout('afterChange'); - }, - - - - - updateSize: function(force) { - - if(!_isFixedPosition) { - var windowScrollY = framework.getScrollY(); - if(_currentWindowScrollY !== windowScrollY) { - template.style.top = windowScrollY + 'px'; - _currentWindowScrollY = windowScrollY; - } - if(!force && _windowVisibleSize.x === window.innerWidth && _windowVisibleSize.y === window.innerHeight) { - return; - } - _windowVisibleSize.x = window.innerWidth; - _windowVisibleSize.y = window.innerHeight; - - //template.style.width = _windowVisibleSize.x + 'px'; - template.style.height = _windowVisibleSize.y + 'px'; - } - - _viewportSize.x = self.scrollWrap.clientWidth; - _viewportSize.y = self.scrollWrap.clientHeight; - - - _offset = {x:0,y:_currentWindowScrollY};//framework.getOffset(template); - - _slideSize.x = _viewportSize.x + Math.round(_viewportSize.x * _options.spacing); - _slideSize.y = _viewportSize.y; - - _moveMainScroll(_slideSize.x * _currPositionIndex); - - // don't re-calculate size on inital size update - if(_containerShiftIndex !== undefined) { - for(var i = 0; i < NUM_HOLDERS; i++) { - _setTranslateX( (i+_containerShiftIndex) * _slideSize.x, _itemHolders[i].el.style); - - // update zoom level on items - var index = _getLoopedId( _currentItemIndex - 1 + i ); - var item = _getItemAt(index); - if(item && item.container) { - _calculateItemSize(item, _viewportSize); - _applyZoomPanToItem( item ); - } - - } - } - - _startZoomLevel = _currZoomLevel = self.currItem.initialZoomLevel; - _currPanBounds = self.currItem.bounds; - - if(_currPanBounds) { - _panOffset.x = _currPanBounds.center.x; - _panOffset.y = _currPanBounds.center.y; - _applyCurrentZoomPan(); - } - - _shout('resize'); - }, - - //Zoom current item to - zoomTo: function(destZoomLevel, centerPoint, speed, easingFn, updateFn) { - - // if(destZoomLevel == 'fit') { - // destZoomLevel = self.currItem.fitRatio; - // } else if(destZoomLevel == 'fill') { - // destZoomLevel = self.currItem.fillRatio; - // } - - if(centerPoint) { - _startZoomLevel = _currZoomLevel; - _midZoomPoint.x = Math.abs(centerPoint.x) - _panOffset.x ; - _midZoomPoint.y = Math.abs(centerPoint.y) - _panOffset.y ; - _equalizePoints(_startPanOffset, _panOffset); - } - - var destPanBounds = _calculatePanBounds(destZoomLevel, false), - destPanOffset = {}; - - _isOutOfBounds('x', destPanBounds, destPanOffset, destZoomLevel), - _isOutOfBounds('y', destPanBounds, destPanOffset, destZoomLevel); - - var initialZoomLevel = _currZoomLevel; - var initialPanOffset = { - x: _panOffset.x, - y: _panOffset.y - }; - - //_startZoomLevel = destZoomLevel; - var onUpdate = function(now) { - if(now === 1) { - _currZoomLevel = destZoomLevel; - _panOffset.x = destPanOffset.x; - _panOffset.y = destPanOffset.y; - } else { - _currZoomLevel = (destZoomLevel - initialZoomLevel) * now + initialZoomLevel; - _panOffset.x = (destPanOffset.x - initialPanOffset.x) * now + initialPanOffset.x; - _panOffset.y = (destPanOffset.y - initialPanOffset.y) * now + initialPanOffset.y; - } - - if(updateFn) { - updateFn(now); - } - - _applyCurrentZoomPan(); - }; - - if(speed) { - _animateProp('customZoomTo', 0, 1, speed, easingFn || framework.easing.sine.inOut, onUpdate); - } else { - onUpdate(1); - } - } - - -}; - - - - - - -/*>>core*/ - -/*>>down-move-up-handlers*/ -/** - * Mouse/touch/pointer event handlers. - * - * separated from @core.js for readability - */ - -var MIN_SWIPE_DISTANCE = 30, - DIRECTION_CHECK_OFFSET = 10; // amount of pixels to drag to determine direction of swipe - -var _gestureStartTime, - _gestureCheckSpeedTime, - - // pool of objects that are used during dragging of zooming - p = {}, // first point - p2 = {}, // second point (for zoom gesture) - delta = {}, - - - _currPoint = {}, - _startPoint = {}, - - _currPointers = [], - _startMainScrollPos = {}, - - _releaseAnimData, - - _posPoints = [], // array of points during dragging, used to determine type of gesture - - _isZoomingIn, - - _tempPoint = {}, - - _verticalDragInitiated, - - _isDragging, // at least one pointer is down - _isMultitouch, // at least two _pointers are down - _zoomStarted, // zoom level changed during zoom gesture - _moved, - _dragAnimFrame, - _mainScrollShifted, - _currentPoints, // array of current touch points - _isZooming, - _currPointsDistance, - _startPointsDistance, - _currPanBounds, - _mainScrollPos = _getEmptyPoint(), - _currZoomElementStyle, - _mainScrollAnimating, // true, if animation after swipe gesture is running - _midZoomPoint = _getEmptyPoint(), - _currCenterPoint = _getEmptyPoint(), - _direction, - _offset, - _isFirstMove, - _opacityChanged, - _bgOpacity, - _wasOverInitialZoom, - - _calculatePointsDistance = function(p1, p2) { - _tempPoint.x = Math.abs( p1.x - p2.x ); - _tempPoint.y = Math.abs( p1.y - p2.y ); - return Math.sqrt(_tempPoint.x * _tempPoint.x + _tempPoint.y * _tempPoint.y); - }, - - - _stopDragUpdateLoop = function() { - if(_dragAnimFrame) { - _cancelAF(_dragAnimFrame); - _dragAnimFrame = null; - } - }, - _dragUpdateLoop = function() { - if(_isDragging) { - _dragAnimFrame = _requestAF(_dragUpdateLoop); - _renderMovement(); - } - }, - _canPan = function() { - return !(_options.scaleMode === 'fit' && _currZoomLevel === self.currItem.initialZoomLevel); - }, - _preventObj = {}, - _preventDefaultEventBehavior = function(e, isDown) { - - _preventObj.prevent = e.target.tagName !== 'A'; - _shout('preventDragEvent', e, isDown, _preventObj); - return _preventObj.prevent; - - }, - _convertTouchToPoint = function(touch, p) { - p.x = touch.pageX; - p.y = touch.pageY; - p.id = touch.identifier; - return p; - }, - _findCenterOfPoints = function(p1, p2, pCenter) { - pCenter.x = (p1.x + p2.x) * 0.5; - pCenter.y = (p1.y + p2.y) * 0.5; - }, - _pushPosPoint = function(time, x, y) { - if(time - _gestureCheckSpeedTime > 50) { - var o = _posPoints.length > 2 ? _posPoints.shift() : {}; - o.x = x; - o.y = y; - _posPoints.push(o); - _gestureCheckSpeedTime = time; - } - }, - - _calculateVerticalDragOpacityRatio = function() { - var yOffset = _panOffset.y - self.currItem.initialPosition.y; // difference between initial and current position - return 1 - Math.abs( yOffset / (_viewportSize.y / 2) ); - }, - - - // points pool, reused during touch events - _ePoint1 = {}, - _ePoint2 = {}, - _tempPointsArr = [], - _tempCounter, - _getTouchPoints = function(e) { - // clean up previous points, without recreating array - while(_tempPointsArr.length > 0) { - _tempPointsArr.pop(); - } - - if(!_pointerEventEnabled) { - if(e.type.indexOf('touch') > -1) { - - if(e.touches && e.touches.length > 0) { - _tempPointsArr[0] = _convertTouchToPoint(e.touches[0], _ePoint1); - if(e.touches.length > 1) { - _tempPointsArr[1] = _convertTouchToPoint(e.touches[1], _ePoint2); - } - } - - } else { - _ePoint1.x = e.pageX; - _ePoint1.y = e.pageY; - _ePoint1.id = ''; - _tempPointsArr[0] = _ePoint1;//_ePoint1; - } - } else { - _tempCounter = 0; - // we can use forEach, as pointer events are supported only in modern browsers - _currPointers.forEach(function(p) { - if(_tempCounter === 0) { - _tempPointsArr[0] = p; - } else if(_tempCounter === 1) { - _tempPointsArr[1] = p; - } - _tempCounter++; - - }); - } - return _tempPointsArr; - }, - - _panOrMoveMainScroll = function(axis, delta) { - - - var panFriction; - - var overDiff = 0; - var newOffset = _panOffset[axis] + delta[axis]; - var startOverDiff; - var dir = delta[axis] > 0; - - - var newMainScrollPosition = _mainScrollPos.x + delta.x; - var mainScrollDiff = _mainScrollPos.x - _startMainScrollPos.x; - - - - // calculate fdistance over the bounds and friction - if(newOffset > _currPanBounds.min[axis] || newOffset < _currPanBounds.max[axis]) { - panFriction = _options.panEndFriction; - // Linear increasing of friction, so at 1/4 of viewport it's at max value. Looks not as nice as was expected. Left for history. - // panFriction = (1 - (_panOffset[axis] + delta[axis] + panBounds.min[axis]) / (_viewportSize[axis] / 4) ); - } else { - panFriction = 1; - } - - - newOffset = _panOffset[axis] + delta[axis] * panFriction; - - - - var newPanPos; - var newMainScrollPos; - - - // move main scroll or start panning - if(_options.allowPanToNext || _currZoomLevel === self.currItem.initialZoomLevel) { - - - if(!_currZoomElementStyle) { - - newMainScrollPos = newMainScrollPosition; - - } else if(_direction === 'h' && axis === 'x' && !_zoomStarted ) { - - if(dir) { - if(newOffset > _currPanBounds.min[axis]) { - panFriction = _options.panEndFriction; - overDiff = _currPanBounds.min[axis] - newOffset; - startOverDiff = _currPanBounds.min[axis] - _startPanOffset[axis]; - } - - // drag right - if( (startOverDiff <= 0 || mainScrollDiff < 0) && _getNumItems() > 1 ) { - newMainScrollPos = newMainScrollPosition; - if(mainScrollDiff < 0 && newMainScrollPosition > _startMainScrollPos.x) { - newMainScrollPos = _startMainScrollPos.x; - } - } else { - if(_currPanBounds.min.x !== _currPanBounds.max.x) { - newPanPos = newOffset; - } - - } - - } else { - - if(newOffset < _currPanBounds.max[axis] ) { - panFriction =_options.panEndFriction; - overDiff = newOffset - _currPanBounds.max[axis]; - startOverDiff = _startPanOffset[axis] - _currPanBounds.max[axis]; - } - - if( (startOverDiff <= 0 || mainScrollDiff > 0) && _getNumItems() > 1 ) { - newMainScrollPos = newMainScrollPosition; - - if(mainScrollDiff > 0 && newMainScrollPosition < _startMainScrollPos.x) { - newMainScrollPos = _startMainScrollPos.x; - } - - } else { - if(_currPanBounds.min.x !== _currPanBounds.max.x) { - newPanPos = newOffset; - } - } - - } - - - // - } - - if(axis === 'x') { - - if(newMainScrollPos !== undefined) { - _moveMainScroll(newMainScrollPos, true); - - - if(newMainScrollPos === _startMainScrollPos.x) { - _mainScrollShifted = false; - } else { - _mainScrollShifted = true; - } - - } - - if(_currPanBounds.min.x !== _currPanBounds.max.x) { - - if(newPanPos !== undefined) { - _panOffset.x = newPanPos; - } else if(!_mainScrollShifted) { - _panOffset.x += delta.x * panFriction; - } - - } //else { - // return true; - //} - - return newMainScrollPos !== undefined; - } - - } - - // if(!_mainScrollAnimating) { - // _panOffset[axis] = newOffset; - - if(!_mainScrollAnimating) { - - if(!_mainScrollShifted) { - - //if(_currPanBounds.min.x !== _currPanBounds.max.x && _currPanBounds.min.y !== _currPanBounds.max.y) { - // _panOffset[axis] += delta[axis] * panFriction; - //} - - - //if(_currPanBounds.min[axis] !== _currPanBounds.max[axis] ) { - if(_currZoomLevel > self.currItem.fitRatio) { - _panOffset[axis] += delta[axis] * panFriction; - - } - - // if(_currPanBounds.min.y !== _currPanBounds.max.y ) { - // _panOffset.y += delta.y * panFriction; - // } - } - - - } - - - // } - - // if(axis{ - // _panOffset.y = _panOffset.y + delta.y * panFriction; - // } - - }, - - - /** - * Pointerdown/touchstart/mousedown handler - */ - _onDragStart = function(e) { - - - if(_initialZoomRunning) { - e.preventDefault(); - return; - } - - - - - if(_preventDefaultEventBehavior(e, true)) { - e.preventDefault(); - } - - - - _shout('pointerDown'); - - if(_pointerEventEnabled) { - var pointerIndex = framework.arraySearch(_currPointers, e.pointerId, 'id'); - if(pointerIndex < 0) { - pointerIndex = _currPointers.length; - } - _currPointers[pointerIndex] = {x:e.pageX, y:e.pageY, id: e.pointerId}; - } - - - - var startPointsList = _getTouchPoints(e), - numPoints = startPointsList.length; - - _currentPoints = null; - - _stopAllAnimations(); - - // init drag - if(!_isDragging || numPoints === 1) { - - - - _isDragging = _isFirstMove = true; - framework.bind(window, _upMoveEvents, self); - - _isZoomingIn = _wasOverInitialZoom = _opacityChanged = _verticalDragInitiated = _mainScrollShifted = _moved = _isMultitouch = _zoomStarted = false; - _direction = null; - - _shout('firstTouchStart', startPointsList); - - _equalizePoints(_startPanOffset, _panOffset); - - _currPanDist.x = _currPanDist.y = 0; - _equalizePoints(_currPoint, startPointsList[0]); - _equalizePoints(_startPoint, _currPoint); - - //_equalizePoints(_startMainScrollPos, _mainScrollPos); - _startMainScrollPos.x = _slideSize.x * _currPositionIndex; - - _posPoints = [{ - x: _currPoint.x, - y: _currPoint.y - }]; - - _gestureCheckSpeedTime = _gestureStartTime = _getCurrentTime(); - - //_mainScrollAnimationEnd(true); - _calculatePanBounds( _currZoomLevel, true ); - - // Start rendering - _stopDragUpdateLoop(); - _dragUpdateLoop(); - - } - - // init zoom - if(!_isZooming && numPoints > 1 && !_mainScrollAnimating && !_mainScrollShifted) { - _startZoomLevel = _currZoomLevel; - _zoomStarted = false; // true if zoom changed at least once - - _isZooming = _isMultitouch = true; - _currPanDist.y = _currPanDist.x = 0; - - _equalizePoints(_startPanOffset, _panOffset); - - _equalizePoints(p, startPointsList[0]); - _equalizePoints(p2, startPointsList[1]); - - _findCenterOfPoints(p, p2, _currCenterPoint); - - _midZoomPoint.x = Math.abs(_currCenterPoint.x) - _panOffset.x; - _midZoomPoint.y = Math.abs(_currCenterPoint.y) - _panOffset.y; - _currPointsDistance = _startPointsDistance = _calculatePointsDistance(p, p2); - } - - - }, - /** - * Pointermove/touchmove/mousemove handler - */ - _onDragMove = function(e) { - - e.preventDefault(); - - if(_pointerEventEnabled) { - var pointerIndex = framework.arraySearch(_currPointers, e.pointerId, 'id'); - if(pointerIndex > -1) { - var p = _currPointers[pointerIndex]; - p.x = e.pageX; - p.y = e.pageY; - } - } - - if(_isDragging) { - var touchesList = _getTouchPoints(e); - if(!_direction && !_moved && !_isZooming) { - var diff = Math.abs(touchesList[0].x - _currPoint.x) - Math.abs(touchesList[0].y - _currPoint.y); - // check the direction of movement - if(Math.abs(diff) >= DIRECTION_CHECK_OFFSET) { - _direction = diff > 0 ? 'h' : 'v'; - _currentPoints = touchesList; - } - } else { - _currentPoints = touchesList; - } - } - - // if(_direction === 'h' || !_direction) { - // e.preventDefault(); - // } else { - - // } - }, - // - _renderMovement = function() { - - if(!_currentPoints) { - return; - } - - var numPoints = _currentPoints.length; - - if(numPoints === 0) { - return; - } - - _equalizePoints(p, _currentPoints[0]); - - delta.x = p.x - _currPoint.x; - delta.y = p.y - _currPoint.y; - - - - if(_isZooming && numPoints > 1) { - // Handle behaviour for more than 1 point - - - _currPoint.x = p.x; - _currPoint.y = p.y; - - - // check if one of two points changed - if( !delta.x && !delta.y && _isEqualPoints(_currentPoints[1], p2) ) { - return; - } - - _equalizePoints(p2, _currentPoints[1]); - - - if(!_zoomStarted) { - _zoomStarted = true; - _shout('zoomGestureStarted'); - } - - - - // Distance between two points - var pointsDistance = _calculatePointsDistance(p,p2); - - var zoomLevel = _calculateZoomLevel(pointsDistance); - - - // slightly over the of initial zoom level - if(zoomLevel > self.currItem.initialZoomLevel + self.currItem.initialZoomLevel / 15) { - _wasOverInitialZoom = true; - } - - // Apply the friction if zoom level is out of the bounds - var zoomFriction = 1; - if ( zoomLevel < self.currItem.minZoom ) { - - if(_options.pinchToClose && !_wasOverInitialZoom && _startZoomLevel <= self.currItem.initialZoomLevel) { - // fade out background if zooming out - var minusDiff = self.currItem.minZoom - zoomLevel; - var percent = 1 - minusDiff / (self.currItem.minZoom / 1.2); - _applyBgOpacity(percent); - _shout('onPinchClose', percent) - _opacityChanged = true; - } else { - - // 0.35 - extra zoom level below the min. E.g. if min is x1, real min will be 1 - 0.35 = 0.65 - zoomFriction = (self.currItem.minZoom - zoomLevel) / (self.currItem.minZoom /*0.35*/); - if(zoomFriction > 1) { - zoomFriction = 1; - } - zoomLevel = self.currItem.minZoom - (zoomFriction) * (self.currItem.minZoom / 3); - - } - - } else if ( zoomLevel > self.currItem.maxZoom ) { - // 1.5 - extra zoom level above the max. E.g. if max is x6, real max 6 + 1.5 = 7.5 - zoomFriction = (zoomLevel - self.currItem.maxZoom) / ( self.currItem.minZoom * 6 /* 1.5 */ ); - if(zoomFriction > 1) { - zoomFriction = 1; - } - zoomLevel = self.currItem.maxZoom + (zoomFriction) * (self.currItem.minZoom); - } - - if(zoomFriction !== 1) { - - if(zoomFriction < 0) { - zoomFriction = 0; - } - - } - - // distance between touch points after friction is applied - _currPointsDistance = pointsDistance; - - // _centerPoint - The point in the middle of two pointers - _findCenterOfPoints(p, p2, _centerPoint); - - - - - - // paning with two pointers pressed - _currPanDist.x += _centerPoint.x - _currCenterPoint.x; - _currPanDist.y += _centerPoint.y - _currCenterPoint.y; - _equalizePoints(_currCenterPoint, _centerPoint); - - _panOffset.x = _calculatePanOffset('x', zoomLevel); - _panOffset.y = _calculatePanOffset('y', zoomLevel); - - _isZoomingIn = zoomLevel > _currZoomLevel; - - _currZoomLevel = zoomLevel; - - _applyCurrentZoomPan(); - - } else { - - // handle behavior for one point (dragging or panning) - - // return if direction wasn't detected, or panning isn't possible - // if(!_direction || (_direction === 'v' && !_canPan()) ) { - // return; - // } - - if(!_direction) { - return; - } - - - - // var verticalSwipe = false; - // if(_direction === 'v') { - // if(_options.vSwipeToClose) { - - // verticalSwipe = true; - // //return; - // } else if(!_canPan()) { - // return; - // } - // } - - - if(_isFirstMove) { - _isFirstMove = false; - - // - if( Math.abs(delta.x) >= DIRECTION_CHECK_OFFSET) { - delta.x -= _currentPoints[0].x - _startPoint.x; - } - - if( Math.abs(delta.y) >= DIRECTION_CHECK_OFFSET) { - delta.y -= _currentPoints[0].y - _startPoint.y; - } - } - - - - - _currPoint.x = p.x; - _currPoint.y = p.y; - - - - // do nothing if pointers position hasn't changed - if(delta.x === 0 && delta.y === 0) { - return; - } - - - - if(_direction === 'v' && _options.closeOnVerticalDrag) { - if(!_canPan()) { - - _currPanDist.y += delta.y; - _panOffset.y += delta.y; - - //var yOffset = _panOffset.y - self.currItem.initialPosition.y; // difference between initial and current position - var opacityRatio = _calculateVerticalDragOpacityRatio(); //1 - Math.abs( yOffset / (_viewportSize.y / 2) ); - - //if(opacityRatio === 1) { - _verticalDragInitiated = true; - //} - _shout('onVerticalDrag', opacityRatio); - - _applyBgOpacity(opacityRatio); - _applyCurrentZoomPan(); - return ; - } - } - - _pushPosPoint(_getCurrentTime(), p.x, p.y); - - _moved = true; - - // if(verticalSwipe) { - // _panOffset.y += delta.y; - // var yOffsetDiff = Math.abs(_panOffset.y - self.currItem.initialPosition.y); - // var bgOpacity = 1 - Math.min(yOffsetDiff,450)/450; - // _shout('onVerticalDrag', bgOpacity); - // _applyBgOpacity(bgOpacity); - // //template.style.opacity = bgOpacity; - // _applyCurrentZoomPan(); - // return; - // } - - // if(_mainScrollShifted) { - // _moveMainScrollBy(delta); - // return; - // } - - _currPanBounds = self.currItem.bounds; - - var mainScrollChanged = _panOrMoveMainScroll('x', delta); - if(!mainScrollChanged) { - _panOrMoveMainScroll('y', delta); - } - //if(!_mainScrollShifted) { - - _applyCurrentZoomPan(); - //} - - - - } - - }, - - /** - * Pointerup/pointercancel/touchend/touchcancel/mouseup event handler - */ - _onDragRelease = function(e) { - - _shout('pointerUp'); - - if(_preventDefaultEventBehavior(e, false)) { - e.preventDefault(); - } - - var releasePoint; - - if(_pointerEventEnabled) { - var pointerIndex = framework.arraySearch(_currPointers, e.pointerId, 'id'); - if(pointerIndex > -1) { - releasePoint = _currPointers.splice(pointerIndex, 1)[0]; - - if(navigator.pointerEnabled) { - releasePoint.type = e.pointerType || 'mouse'; - } else { - - var MSPOINTER_TYPES = { - 4: 'mouse', /* event.MSPOINTER_TYPE_MOUSE */ - 2: 'touch', /* event.MSPOINTER_TYPE_TOUCH */ - 3: 'pen' /* event.MSPOINTER_TYPE_PEN */ - }; - releasePoint.type = MSPOINTER_TYPES[e.pointerType]; - if(!releasePoint.type) { - releasePoint.type = e.pointerType || 'mouse'; - } - - } - - } - } - - var touchList = _getTouchPoints(e), - gestureType, - numPoints = touchList.length; - - - if(e.type === 'mouseup') { - numPoints = 0; - } - - - - // Do nothing if there were 3 touch points or more - if(numPoints === 2) { - _currentPoints = null; - return true; - } - - // if second pointer released - if(numPoints === 1) { - _equalizePoints(_startPoint, touchList[0]); - } - - - // pointer hasn't moved, send "tap release" point - if(numPoints === 0 && !_direction && !_mainScrollAnimating) { - if(!releasePoint) { - if(e.type === 'mouseup') { - releasePoint = {x: e.pageX, y: e.pageY, type:'mouse'}; - } else if(e.changedTouches && e.changedTouches[0]) { - releasePoint = {x: e.changedTouches[0].pageX, y: e.changedTouches[0].pageY, type:'touch'}; - } - } - _shout('touchRelease', e, releasePoint); - } - - - - // Difference in time between releasing of two last touch points (zoom gesture) - var releaseTimeDiff = -1; - - // Gesture completed, no pointers left - if(numPoints === 0) { - _isDragging = false; - framework.unbind(window, _upMoveEvents, self); - - _stopDragUpdateLoop(); - - if(_isZooming) { - // Two points released at the same time - releaseTimeDiff = 0; - } else if(_lastReleaseTime !== -1) { - releaseTimeDiff = _getCurrentTime() - _lastReleaseTime; - } - } - _lastReleaseTime = numPoints === 1 ? _getCurrentTime() : -1; - - if(releaseTimeDiff !== -1 && releaseTimeDiff < 150) { - gestureType = 'zoom'; - } else { - gestureType = 'swipe'; - } - - - - - if(_isZooming && numPoints < 2) { - _isZooming = false; - - - // Only second point released - if(numPoints === 1) { - gestureType = 'zoomPointerUp'; - } - _shout('zoomGestureEnded'); - } - - - - _currentPoints = null; - if(!_moved && !_zoomStarted && !_mainScrollAnimating && !_verticalDragInitiated) { - // nothing to animate - return; - } - - _stopAllAnimations(); - - - if(!_releaseAnimData) { - _releaseAnimData = _initDragReleaseAnimationData(); - } - - _releaseAnimData.calculateSwipeSpeed('x'); - - - if(_verticalDragInitiated) { - - var opacityRatio = _calculateVerticalDragOpacityRatio(); - - if(opacityRatio < 0.6) { - self.close(); - } else { - //_panOffset.y = self.currItem.initialPosition.y; - //animateProp('verticalDrag', _mainScrollPos.x, animateToX, finishAnimDuration, framework.easing.cubic.out); - - var initalPanY = _panOffset.y, - initialBgOpacity = _bgOpacity; - - _animateProp('verticalDrag', 0, 1,/*_panOffset.y, self.currItem.initialPosition.y,*/ 300, framework.easing.cubic.out, function(now) { - - _panOffset.y = (self.currItem.initialPosition.y - initalPanY) * now + initalPanY; - - _applyBgOpacity( (1 - initialBgOpacity) * now + initialBgOpacity ); - _applyCurrentZoomPan(); - }); - - _shout('onVerticalDrag', 1); - } - - - - return; - } - - - // main scroll - if( (_mainScrollShifted || _mainScrollAnimating) && numPoints === 0) { - var itemChanged = _finishSwipeMainScrollGesture(gestureType, _releaseAnimData); - if(itemChanged) { - return; - } - gestureType = 'zoomPointerUp'; - } - - - // prevent zoom/pan animation when main scroll animation runs - if(_mainScrollAnimating) { - return; - } - - - // Complete simple zoom gesture (reset zoom level if it's out of the bounds) - if(gestureType !== 'swipe') { - _completeZoomGesture(); - return; - } - - // Complete pan gesture if main scroll is not shifted, and it's possible to pan current image - if(!_mainScrollShifted && _currZoomLevel > self.currItem.fitRatio) { - _completePanGesture(_releaseAnimData); - } - }, - - - /** - * Returns object with data & functions for drag release - * It's created only once and then reused - * @return {Object} - */ - _initDragReleaseAnimationData = function() { - // temp local vars - var lastFlickDuration, - tempReleasePos; - - // s = this - var s = { - lastFlickOffset: {}, - lastFlickDist: {}, - lastFlickSpeed: {}, - slowDownRatio: {}, - slowDownRatioReverse: {}, - speedDecelerationRatio: {}, - speedDecelerationRatioAbs: {}, - distanceOffset: {}, - backAnimDestination: {}, - backAnimStarted: {}, - calculateSwipeSpeed: function(axis) { - - - if( _posPoints.length > 1) { - lastFlickDuration = _getCurrentTime() - _gestureCheckSpeedTime + 50; - tempReleasePos = _posPoints[_posPoints.length-2][axis]; - } else { - lastFlickDuration = _getCurrentTime() - _gestureStartTime; // total gesture duration - tempReleasePos = _startPoint[axis]; - } - s.lastFlickOffset[axis] = _currPoint[axis] - tempReleasePos; - s.lastFlickDist[axis] = Math.abs(s.lastFlickOffset[axis]); - if(s.lastFlickDist[axis] > 20) { - s.lastFlickSpeed[axis] = s.lastFlickOffset[axis] / lastFlickDuration; - } else { - s.lastFlickSpeed[axis] = 0; - } - if( Math.abs(s.lastFlickSpeed[axis]) < 0.1 ) { - s.lastFlickSpeed[axis] = 0; - } - - s.slowDownRatio[axis] = 0.95; - s.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis]; - s.speedDecelerationRatio[axis] = 1; - }, - - calculateOverBoundsAnimOffset: function(axis, speed) { - if(!s.backAnimStarted[axis]) { - - if(_panOffset[axis] > _currPanBounds.min[axis]) { - s.backAnimDestination[axis] = _currPanBounds.min[axis]; - - } else if(_panOffset[axis] < _currPanBounds.max[axis]) { - s.backAnimDestination[axis] = _currPanBounds.max[axis]; - } - - if(s.backAnimDestination[axis] !== undefined) { - s.slowDownRatio[axis] = 0.7; - s.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis]; - if(s.speedDecelerationRatioAbs[axis] < 0.05) { - s.lastFlickSpeed[axis] = 0; - s.backAnimStarted[axis] = true; - _animateProp('bounceZoomPan'+axis,_panOffset[axis], s.backAnimDestination[axis], speed || 300, framework.easing.sine.out, function(pos) { - _panOffset[axis] = pos; - _applyCurrentZoomPan(); - }); - - } - } - } - }, - - // Reduces the speed by slowDownRatio (per 10ms) - calculateAnimOffset: function(axis) { - if(!s.backAnimStarted[axis]) { - s.speedDecelerationRatio[axis] = s.speedDecelerationRatio[axis] * (s.slowDownRatio[axis] + s.slowDownRatioReverse[axis] - s.slowDownRatioReverse[axis] * s.timeDiff / 10); - s.speedDecelerationRatioAbs[axis] = Math.abs(s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis]); - s.distanceOffset[axis] = s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis] * s.timeDiff; - _panOffset[axis] += s.distanceOffset[axis]; - } - }, - - panAnimLoop: function() { - if ( _animations.zoomPan ) { - _animations.zoomPan.raf = _requestAF(s.panAnimLoop); - - s.now = _getCurrentTime(); - s.timeDiff = s.now - s.lastNow; - s.lastNow = s.now; - - s.calculateAnimOffset('x'); - s.calculateAnimOffset('y'); - - _applyCurrentZoomPan(); - - s.calculateOverBoundsAnimOffset('x'); - s.calculateOverBoundsAnimOffset('y'); - - - if (s.speedDecelerationRatioAbs.x < 0.05 && s.speedDecelerationRatioAbs.y < 0.05) { - _stopAnimation('zoomPan'); - return; - } - } - - } - }; - return s; - }, - - _completePanGesture = function(animData) { - // calculate swipe speed for Y axis (paanning) - animData.calculateSwipeSpeed('y'); - - _currPanBounds = self.currItem.bounds; - - animData.backAnimDestination = {}; - animData.backAnimStarted = {}; - - // Avoid acceleration animation if speed is too low - if(Math.abs(animData.lastFlickSpeed.x) <= 0.05 && Math.abs(animData.lastFlickSpeed.y) <= 0.05 ) { - animData.speedDecelerationRatioAbs.x = animData.speedDecelerationRatioAbs.y = 0; - - // Run pan drag release animation. E.g. if you drag image and release finger without momentum. - animData.calculateOverBoundsAnimOffset('x'); - animData.calculateOverBoundsAnimOffset('y'); - return true; - } - - // Animation loop that controls the acceleration after pan gesture ends - _registerStartAnimation('zoomPan'); - animData.lastNow = _getCurrentTime(); - animData.panAnimLoop(); - }, - - - _finishSwipeMainScrollGesture = function(gestureType, _releaseAnimData) { - var itemChanged; - if(!_mainScrollAnimating) { - _currZoomedItemIndex = _currentItemIndex; - } - - - - var itemsDiff; - - if(gestureType === 'swipe') { - var totalShiftDist = _currPoint.x - _startPoint.x; - - // if container is shifted for more than MIN_SWIPE_DISTANCE, and last flick gesture was in right direction - if(totalShiftDist > MIN_SWIPE_DISTANCE && (_releaseAnimData.lastFlickDist.x < 10 || _releaseAnimData.lastFlickOffset.x > 20) ) { - // go to prev item - itemsDiff = -1; - } else if(totalShiftDist < -MIN_SWIPE_DISTANCE && (_releaseAnimData.lastFlickDist.x < 10 || _releaseAnimData.lastFlickOffset.x < -20) ) { - - itemsDiff = 1; - } - } - - var nextCircle; - - if(itemsDiff) { - - _currentItemIndex += itemsDiff; - - if(_currentItemIndex < 0) { - _currentItemIndex = _options.loop ? _getNumItems()-1 : 0; - nextCircle = true; - } else if(_currentItemIndex >= _getNumItems()) { - _currentItemIndex = _options.loop ? 0 : _getNumItems()-1; - nextCircle = true; - } - - if(!nextCircle || _options.loop) { - _indexDiff += itemsDiff; - _currPositionIndex -= itemsDiff; - itemChanged = true; - } - - - - } - - var animateToX = _slideSize.x * _currPositionIndex; - var animateToDist = Math.abs( animateToX - _mainScrollPos.x ); - var finishAnimDuration; - - - if(!itemChanged && animateToX > _mainScrollPos.x !== _releaseAnimData.lastFlickSpeed.x > 0) { - finishAnimDuration = 333; // return to current speed (e.g. when dragging from slide #0 to #-1) - } else { - finishAnimDuration = Math.abs(_releaseAnimData.lastFlickSpeed.x) > 0 ? animateToDist / Math.abs(_releaseAnimData.lastFlickSpeed.x) : 333; - finishAnimDuration = Math.min(finishAnimDuration, 400); - finishAnimDuration = Math.max(finishAnimDuration, 250); - } - - if(_currZoomedItemIndex === _currentItemIndex) { - itemChanged = false; - } - - _mainScrollAnimating = true; - - - - - _animateProp('mainScroll', _mainScrollPos.x, animateToX, finishAnimDuration, framework.easing.cubic.out, - _moveMainScroll, - function() { - _stopAllAnimations(); - _mainScrollAnimating = false; - _currZoomedItemIndex = -1; - - if(itemChanged || _currZoomedItemIndex !== _currentItemIndex) { - self.updateCurrItem(); - } - - _shout('mainScrollAnimComplete'); - } - ); - - - if(itemChanged) { - self.updateCurrItem(true); - } - - return itemChanged; - }, - - /** - * Resets zoom if it's out of bounds - */ - _completeZoomGesture = function() { - var destZoomLevel = _currZoomLevel; - - if ( _currZoomLevel < self.currItem.minZoom ) { - destZoomLevel = self.currItem.minZoom; - } else if ( _currZoomLevel > self.currItem.maxZoom ) { - destZoomLevel = self.currItem.maxZoom; - } - - var destOpacity = 1, - onUpdate, - initialOpacity = _bgOpacity; - - if(_opacityChanged && !_isZoomingIn && !_wasOverInitialZoom && _currZoomLevel < self.currItem.minZoom) { - _closedByScroll = true; - self.close(); - return true; - } - - if(_opacityChanged) { - onUpdate = function(now) { - - _applyBgOpacity( (destOpacity - initialOpacity) * now + initialOpacity ); - - }; - } - - - self.zoomTo(destZoomLevel, 0, 300, framework.easing.cubic.out, onUpdate); - return true; - }; - - - -/*>>down-move-up-handlers*/ - -/*>>items-controller*/ -/** -* -* Controller manages gallery items, their dimensions, and their content. -* -*/ - -var _items, - _tempPanAreaSize = {}, - _tempRealElSize = {}, - _imagesToAppendPool = [], - _initialContentSet, - _initialZoomRunning, - _controllerDefaultOptions = { - index: 0, - errorMsg: '
    The image could not be loaded.
    ', - forceProgressiveLoading: false, // TODO - preload: [1,1], - getNumItemsFn: function() { - return _items.length; - } - }; - - -var _getItemAt, - _getNumItems, - _initialIsLoop, - _calculateItemSize = function(item, viewportSize, zoomLevel) { - - if (item.src) { - var isInitial = !zoomLevel; - - if(isInitial) { - if(!item.vGap) { - item.vGap = {top:0,bottom:0}; - } - // allows overriding vertical margin for individual items - _shout('parseVerticalMargin', item); - } - - - _tempPanAreaSize.x = viewportSize.x; - _tempPanAreaSize.y = viewportSize.y - item.vGap.top - item.vGap.bottom; - - if (isInitial) { - var hRatio = _tempPanAreaSize.x / item.w; - var vRatio = _tempPanAreaSize.y / item.h; - - item.fitRatio = hRatio < vRatio ? hRatio : vRatio; - item.fillRatio = hRatio > vRatio ? hRatio : vRatio; - - var scaleMode = _options.scaleMode; - - if (scaleMode == 'orig') { - zoomLevel = 1; - } else if (scaleMode == 'fit') { - zoomLevel = item.fitRatio; - } else if (scaleMode == 'fill') { - zoomLevel = item.fillRatio; - } - - if (zoomLevel > 1) { - zoomLevel = 1; - } - item.initialZoomLevel = zoomLevel; - item.maxZoom = 2; - item.doubleTapZoom = zoomLevel * 2 > 1 ? zoomLevel * 2 : 1; - item.minZoom = zoomLevel; - - if(!item.bounds) { - item.bounds = { center:{}, max:{}, min:{} }; // reuse bounds object - } - - - } - - if(!zoomLevel) { - return; - } - - - _tempRealElSize.x = item.w * zoomLevel; - _tempRealElSize.y = item.h * zoomLevel; - - - var bounds = item.bounds; - - // position of element when it's centered - bounds.center.x = Math.round((_tempPanAreaSize.x - _tempRealElSize.x) / 2); - bounds.center.y = Math.round((_tempPanAreaSize.y - _tempRealElSize.y) / 2) + item.vGap.top; - - - // maximum pan position - bounds.max.x = (_tempRealElSize.x > _tempPanAreaSize.x) ? Math.round(_tempPanAreaSize.x - _tempRealElSize.x) : bounds.center.x; - bounds.max.y = (_tempRealElSize.y > _tempPanAreaSize.y) ? Math.round(_tempPanAreaSize.y - _tempRealElSize.y) + item.vGap.top : bounds.center.y; - - // minimum pan position - bounds.min.x = (_tempRealElSize.x > _tempPanAreaSize.x) ? 0 : bounds.center.x; - bounds.min.y = (_tempRealElSize.y > _tempPanAreaSize.y) ? item.vGap.top : bounds.center.y; - - if (isInitial && zoomLevel === item.initialZoomLevel) { - item.initialPosition = bounds.center; - } - - return bounds; - } else { - // has no img TODO - } - - return false; - }, - - - - - _appendImage = function(index, item, baseDiv, img, preventAnimation, keepPlaceholder) { - var animate; - - // fade in loaded image only when current holder is active, or might be visible - if(!preventAnimation && (_likelyTouchDevice || _options.alwaysFadeIn) && (index === _currentItemIndex || self.isMainScrollAnimating() || (self.isDragging() && !self.isZooming()) ) ) { - animate = true; - } - - if(img) { - if(animate) { - img.style.opacity = 0; - } - - item.imageAppended = true; - - baseDiv.appendChild(img); - - - - if(animate) { - setTimeout(function() { - img.style.opacity = 1; - if(keepPlaceholder) { - setTimeout(function() { - // hide image placeholder "behind" - if(item && item.loaded && item.placeholder) { - item.placeholder.style.display = 'none'; - item.placeholder = null; - } - }, 500); - } - - }, 50); - } - } - }, - - - - _preloadImage = function(item) { - item.loading = true; - item.loaded = false; - var img = item.img = framework.createEl('pswp__img', 'img'); - var onComplete = function() { - item.loading = false; - item.loaded = true; - - if(item.loadComplete) { - item.loadComplete(item); - } else { - item.img = null; // no need to store image object - } - img.onload = img.onerror = null; - img = null; - }; - img.onload = onComplete; - img.onerror = function() { - item.loadError = true; - onComplete(); - }; - - - img.src = item.src;// + '?a=' + Math.random(); - - return img; - }, - _displayError = function(item, holder) { - if(item.loadError) { - holder.el.innerHTML = _options.errorMsg.replace('%url%', item.src ); - return true; - } - }, - _appendImagesPool = function() { - if(_imagesToAppendPool.length) { - var poolItem; - - for(var i = 0; i < _imagesToAppendPool.length; i++) { - poolItem = _imagesToAppendPool[i]; - if( poolItem.holder.index === poolItem.index ) { - _appendImage(poolItem.index, poolItem.item, poolItem.baseDiv, poolItem.img); - } - } - _imagesToAppendPool = []; - } - }; - - - -_registerModule('Controller', { - - publicMethods: { - - lazyLoadItem: function(index) { - index = _getLoopedId(index); - var item = _getItemAt(index); - - if(!item || item.loaded || item.loading) { - return; - } - - _shout('gettingData', index, item); - _preloadImage(item); - }, - initController: function() { - framework.extend(_options, _controllerDefaultOptions, true); - self.items = _items = items; - _getItemAt = self.getItemAt; - _getNumItems = _options.getNumItemsFn; //self.getNumItems; - - - - _initialIsLoop = _options.loop; - if(_getNumItems() < 3) { - _options.loop = false; // disable loop if less then 3 items - } - - _listen('beforeChange', function(diff) { - - var p = _options.preload, - isNext = diff === null ? true : (diff > 0), - preloadBefore = Math.min(p[0], _getNumItems() ), - preloadAfter = Math.min(p[1], _getNumItems() ), - i; - - - for(i = 1; i <= (isNext ? preloadAfter : preloadBefore); i++) { - self.lazyLoadItem(_currentItemIndex+i); - } - for(i = 1; i <= (isNext ? preloadBefore : preloadAfter); i++) { - self.lazyLoadItem(_currentItemIndex-i); - } - }); - - _listen('initialLayout', function() { - self.currItem.initialLayout = _options.getThumbBoundsFn && _options.getThumbBoundsFn(_currentItemIndex); - }); - - _listen('mainScrollAnimComplete', _appendImagesPool); - _listen('initialZoomInEnd', _appendImagesPool); - - - - _listen('destroy', function() { - var item; - for(var i = 0; i < _items.length; i++) { - item = _items[i]; - // remove reference to DOM elements, for GC - if(item.container) { - item.container = null; - } - if(item.placeholder) { - item.placeholder = null; - } - if(item.img) { - item.img = null; - } - if(item.preloader) { - item.preloader = null; - } - if(item.loadError) { - item.loaded = item.loadError = false; - } - } - _imagesToAppendPool = null; - }); - }, - - - getItemAt: function(index) { - if (index >= 0) { - return _items[index]; - } - return false; - }, - - - - allowProgressiveImg: function() { - - // 1. Progressive image loading isn't working on webkit/blink when hw-acceleration (e.g. translateZ) is applied to IMG element. - // That's why in PhotoSwipe parent element gets zoom transform, not image itself. - // - // 2. Progressive image loading sometimes blinks in webkit/blink when applying animation to parent element. - // That's why it's disabled on touch devices (mainly because of swipe transition) - // - // 3. Progressive image loading sometimes doesn't work in IE (up to 11). - - // Don't allow progressive loading on non-large touch devices - return _options.forceProgressiveLoading || !_likelyTouchDevice || _options.mouseUsed || screen.width > 1200; // 1200 to eliminate touch devices with large screen (like Chromebook Pixel) - }, - - setContent: function(holder, index) { - - if(_options.loop) { - index = _getLoopedId(index); - } - - var item = self.getItemAt(index), - img; - - - if(item) { - - // allow to override data - _shout('gettingData', index, item); - -// holder.setAttribute('data-pswp-id', index); - holder.index = index; - - if( _displayError(item, holder) ) { - item.initialPosition.x = item.initialPosition.y = 0; - item.initialZoomLevel = item.maxZoom = item.minZoom = 1; - _currZoomElementStyle = null; - item.w = 50; - item.h = 50; - _applyZoomPanToItem(item); - return; - } - - - // base container DIV is created only once for each of 3 holders - var baseDiv;// = (prevItem && prevItem.container) ? prevItem.container : framework.createEl('pswp__zoom-wrap'); - // if(prevItem && prevItem.container) { - // baseDiv = prevItem.container; - // if(baseDiv.parentNode) { - // baseDiv.parentNode.removeChild(baseDiv); - // } - // baseDiv.innerHTML = ''; - // prevItem.container = null; - // } else { - // baseDiv = framework.createEl('pswp__zoom-wrap'); - // } - // if(!holder.wrap) { - // holder.wrap = framework.createEl('pswp__zoom-wrap'); - // } else { - - // holder.removeChild(holder.wrap); - // holder.wrap.innerHTML = ''; - // } - baseDiv = framework.createEl('pswp__zoom-wrap');//holder.wrap; - - // allow to override image source, size, etc. - // if(_options.assignItemData) { - // _options.assignItemData(item); - // } - - - // if(prevItem) { - // prevItem.container = null; - // baseDiv.parentNode.removeChild(baseDiv); - // baseDiv.innerHTML = ''; - // } - - item.container = baseDiv; - - if(!item.loaded) { - - item.loadComplete = function(item) { - - // gallery closed before image finished loading - if(!_isOpen) { - return; - } - - // if(!_initialZoomRunning && item.placeholder) { - // item.placeholder.style.display = 'none'; - // } - - if(!img) { - img = item.img; - } - // Apply hw-acceleration only after image is loaded. - // This is webkit progressive image loading bugfix. - // https://bugs.webkit.org/show_bug.cgi?id=108630 - // https://code.google.com/p/chromium/issues/detail?id=404547 - img.style.webkitBackfaceVisibility = 'hidden'; - - - - // check if holder hasn't changed while image was loading - if( holder.index === index ) { - if( _displayError(item, holder) ) { - return; - } - if( !item.imageAppended /*_likelyTouchDevice*/ ) { - if(_mainScrollAnimating || _initialZoomRunning) { - _imagesToAppendPool.push({item:item, baseDiv:baseDiv, img:img, index:index, holder:holder}); - } else { - _appendImage(index, item, baseDiv, img, _mainScrollAnimating || _initialZoomRunning); - } - } else { - // remove preloader & mini-img - if(!_initialZoomRunning && item.placeholder) { - item.placeholder.style.display = 'none'; - item.placeholder = null; - } - } - } - - item.loadComplete = null; - - _shout('imageLoadComplete', index, item); - }; - - - - img = item.img; - - if(framework.features.transform) { - - var placeholder = framework.createEl('pswp__img pswp__img--placeholder' + (item.msrc ? '' : ' pswp__img--placeholder--blank') , item.msrc ? 'img' : ''); - if(item.msrc) { - placeholder.src = item.msrc; - } - - placeholder.style.width = item.w + 'px'; - placeholder.style.height = item.h + 'px'; - - baseDiv.appendChild(placeholder); - item.placeholder = placeholder; - - } - - - if( self.allowProgressiveImg() ) { - // just append image - if(!_initialContentSet /*&& index === _currentItemIndex*/) { - _imagesToAppendPool.push({item:item, baseDiv:baseDiv, img:img, index:index, holder:holder}); - } else { - _appendImage(index, item, baseDiv, img, true, true); - } - } - - if(!item.loading) { - _preloadImage(item); - } - - - - - - } else { - // image object is created every time, due to bugs of image loading & delay when switching images - img = framework.createEl('pswp__img', 'img'); - img.style.webkitBackfaceVisibility = 'hidden'; - img.style.opacity = 1; - img.src = item.src; - _appendImage(index, item, baseDiv, img, true); - } - - _calculateItemSize(item, _viewportSize); - - - if(!_initialContentSet && index === _currentItemIndex) { - _currZoomElementStyle = baseDiv.style; - _showOrHide(item, img); - } else { - _applyZoomPanToItem(item); - } - - holder.el.innerHTML = ''; - holder.el.appendChild(baseDiv); - - } else { - holder.el.innerHTML = ''; - } - - } - - - - - - - } -}); - - - -// TODO: use webworker to lazy-load images? -// -// var blob = new Blob([ ""+ -// " onmessage = function(e) {"+ -// " var urls = e.data,"+ -// " done = urls.length,"+ -// " onload = function () {"+ -// " if (--done === 0) {"+ -// " self.postMessage('Done!');"+ -// " self.close();"+ -// " }"+ -// " };"+ - -// " urls.forEach(function (url) {"+ -// " var xhr = new XMLHttpRequest();"+ -// " xhr.responseType = 'blob';"+ -// " xhr.onload = xhr.onerror = onload;"+ -// " xhr.open('GET', url, true);"+ -// " xhr.send();"+ -// " });"+ -// " }" ]); - -// var blobURL = window.URL.createObjectURL(blob); - -// var imgs = []; -// for(var i = 0; i < items.length; i++) { -// imgs.push(items[i].src); -// } - -// _worker = new Worker(blobURL); -// _worker.onmessage = function(e) { -// }; -// _worker.postMessage(imgs); - - // for(var i = 0; i < items.length; i++) { - // var img = new Image(); - // img.src = items[i].src; - // } - - -/*>>items-controller*/ - -/*>>tap*/ -/* Module dispatches tap event (pswpTap), and manages double-tap */ - - -var tapTimer, - tapReleasePoint = {}, - _dispatchTapEvent = function(origEvent, releasePoint, pointerType) { - - - var evt = document.createEvent( 'CustomEvent' ); - evt.initCustomEvent( 'pswpTap', true, true, {origEvent:origEvent, target:origEvent.target, releasePoint: releasePoint, pointerType:pointerType || 'touch'} ); - origEvent.target.dispatchEvent( evt ); - - }; - -_registerModule('Tap', { - - publicMethods: { - - initTap: function() { - _listen('firstTouchStart', self.onTapStart); - _listen('touchRelease', self.onTapRelease); - _listen('destroy', function() { - tapReleasePoint = {}; - tapTimer = null; - }); - }, - onTapStart: function(touchList) { - - if(touchList.length > 1) { - clearTimeout(tapTimer); - tapTimer = null; - } - }, - onTapRelease: function(e, releasePoint) { - - if(!releasePoint) { - return; - } - - if(!_moved && !_isMultitouch && !_numAnimations) { - - var p0 = releasePoint; - if(tapTimer) { - clearTimeout(tapTimer); - tapTimer = null; - - // Check if taped on the same place - if ( _isNearbyPoints(p0, tapReleasePoint) ) { - //self.onDoubleTap(p0); - _shout('doubleTap', p0); - return; - } - } - - var clickedTagName = e.target.tagName.toLowerCase(); - - if(releasePoint.type === 'mouse') { - _dispatchTapEvent(e, releasePoint, 'mouse'); - return; - } - - // avoid double tap delay on buttons and elements that have class pswp__single-tap - if(clickedTagName === 'button' || framework.hasClass(e.target, 'pswp__single-tap') ) { - //_shout('tap', data); - _dispatchTapEvent(e, releasePoint); - return; - } - - - - _equalizePoints(tapReleasePoint, p0); - - tapTimer = setTimeout(function() { - _dispatchTapEvent(e, releasePoint); - tapTimer = null; - }, 300); - } - } - - } -}); - - -/*>>tap*/ - -/*>>desktop-zoom*/ -/** - * Zooming image on desktop and paning it with mouse wheel or trackpad. - */ - -var _wheelDelta; - // _trackpadSwipeThrottleTimeout, - // _trackpadSwipePrev, - // _trackpadLastEventTime, - // _trackpadRunning, - // _trackpadLastActionTime, - // _trackpadDir; - //_didAction; - -_registerModule('DesktopZoom', { - - publicMethods: { - handleMouseWheel: function(e) { - - if(_currZoomLevel <= self.currItem.fitRatio) { - return true; - } - e.preventDefault(); - e.stopPropagation(); // allow just one event to fire - - // https://developer.mozilla.org/en-US/docs/Web/Events/wheel - _wheelDelta.x = 0; - - if('deltaX' in e) { - _wheelDelta.x = e.deltaX; - _wheelDelta.y = e.deltaY; - } else if('wheelDelta' in e) { - if(e.wheelDeltaX) { - _wheelDelta.x = -0.16 * e.wheelDeltaX; - } - if(e.wheelDeltaY) { - _wheelDelta.y = -0.16 * e.wheelDeltaY; - } else { - _wheelDelta.y = -0.16 * e.wheelDelta; - } - } else if('detail' in e) { - _wheelDelta.y = e.detail; - } else { - return; - } - - - // TODO: use rAF instead of mousewheel? - _calculatePanBounds(_currZoomLevel, true); - self.panTo(_panOffset.x - _wheelDelta.x, _panOffset.y - _wheelDelta.y); - - - // Experimental attempt to implement touchpad swipe gesture. - // Didn't work as good as expected due to enreliable deceleration speed across different touchpads. - // left for history - // - // if(!_trackpadDir) { - // if(!_wheelDelta.y) { - // _trackpadDir = 'x'; - // } else { - // if(Math.abs(_wheelDelta.y - _wheelDelta.x) > 10) { - // _trackpadDir = _wheelDelta.y > _wheelDelta.x ? 'y' : 'x'; - // } - // } - // } - // if(!_trackpadDir) { - // return; - // } - // var delta = _wheelDelta[_trackpadDir]; - // if(delta && Math.abs(delta) > 10) { - - // var timeDiff = _getCurrentTime() - _trackpadLastEventTime; - // _trackpadLastEventTime = _getCurrentTime(); - - // if(timeDiff < 200 && _trackpadSwipePrev === (delta > 0)) { - // return; - // } - - // _trackpadSwipePrev = (delta > 0); - // self[_trackpadSwipePrev ? 'next' : 'prev' ](); - // } - }, - toggleDesktopZoom: function(centerPoint) { - - centerPoint = centerPoint || {x:_viewportSize.x/2, y:_viewportSize.y/2 + _initalWindowScrollY }; - var zoomOut = _currZoomLevel === 1; - - self.mouseZoomedIn = !zoomOut; - - - self.zoomTo(zoomOut ? self.currItem.initialZoomLevel : 1, centerPoint, 333); - framework[ (!zoomOut ? 'add' : 'remove') + 'Class'](template, 'pswp--zoomed-in'); - }, - setupDesktopZoom: function(onInit) { - - _wheelDelta = {}; - var events = 'wheel mousewheel DOMMouseScroll'; - - - _listen('bindEvents', function() { - framework.bind(template, events, self.handleMouseWheel); - }); - _listen('unbindEvents', function() { - if(_wheelDelta) { - framework.unbind(template, events, self.handleMouseWheel); - } - }); - - self.mouseZoomedIn = false; - - var hasDraggingClass, - updateZoomable = function() { - if(self.mouseZoomedIn) { - framework.removeClass(template, 'pswp--zoomed-in'); - self.mouseZoomedIn = false; - } - if(_currZoomLevel < 1) { - framework.addClass(template, 'pswp--zoom-allowed'); - } else { - framework.removeClass(template, 'pswp--zoom-allowed'); - } - removeDraggingClass(); - }, - removeDraggingClass = function() { - if(hasDraggingClass) { - framework.removeClass(template, 'pswp--dragging'); - hasDraggingClass = false; - } - }; - - _listen('resize' , updateZoomable); - _listen('afterChange' , updateZoomable); - _listen('pointerDown', function() { - if(self.mouseZoomedIn) { - hasDraggingClass = true; - framework.addClass(template, 'pswp--dragging'); - } - }); - _listen('pointerUp', removeDraggingClass); - - if(!onInit) { - updateZoomable(); - } - - }, - initDesktopZoom: function() { - - if(_oldIE) { - // no zoom for old IE (<=8) - return; - } - - if(_likelyTouchDevice) { - _listen('mouseUsed', function() { - self.setupDesktopZoom(); - }); - } else { - self.setupDesktopZoom(true); - } - - - - - } - - } -}); - - -/*>>desktop-zoom*/ - -/*>>history*/ -/* Hisotry module (back button to close gallery, unique URL for each slide) */ - -var _historyDefaultOptions = { - history: true, - galleryUID: 1 -}; - -var _historyUpdateTimeout, - _hashChangeTimeout, - _hashAnimCheckTimeout, - _hashChangedByScript, - _hashChangedByHistory, - _hashReseted, - _initialHash, - _historyChanged, - _closedFromURL, - _urlChangedOnce, - _windowLoc, - _getHash = function() { - return _windowLoc.hash.substring(1); - }, - _cleanHistoryTimeouts = function() { - - if(_historyUpdateTimeout) { - clearTimeout(_historyUpdateTimeout); - } - - if(_hashAnimCheckTimeout) { - clearTimeout(_hashAnimCheckTimeout); - } - }, - - // pid - Picture index - // gid - Gallery index - _parseItemIndexFromURL = function() { - var hash = _getHash(), - params = {}; - - if(hash.length < 5) { // pid=1 - return params; - } - - var vars = hash.split('&'); - for (var i = 0; i < vars.length; i++) { - if(!vars[i]) { - continue; - } - var pair = vars[i].split('='); - if(pair.length < 2) { - continue; - } - params[pair[0]] = pair[1]; - } - params.pid = parseInt(params.pid,10)-1; - if( params.pid < 0 ) { - params.pid = 0; - } - return params; - }, - _updateHash = function() { - - if(_hashAnimCheckTimeout) { - clearTimeout(_hashAnimCheckTimeout); - } - - - if(_numAnimations || _isDragging) { - // changing browser URL forces layout/paint in some browsers, which causes noticable lag during animation - // that's why we update hash only when no animations running - _hashAnimCheckTimeout = setTimeout(_updateHash, 500); - return; - } - - if(_hashChangedByScript) { - clearTimeout(_hashChangeTimeout); - } else { - _hashChangedByScript = true; - } - - - var newHash = _initialHash + '&' + 'gid=' + _options.galleryUID + '&' + 'pid=' + (_currentItemIndex + 1); - - if(!_historyChanged) { - if(_windowLoc.hash.indexOf(newHash) === -1) { - _urlChangedOnce = true; - } - _windowLoc.hash = newHash; - // first time - add new hisory record, then just replace - } else { - var newURL = _windowLoc.href.split('#')[0] + '#' + newHash; - - _windowLoc.replace( newURL ); - } - - - _historyChanged = true; - _hashChangeTimeout = setTimeout(function() { - _hashChangedByScript = false; - }, 60); - }; - - - - - -_registerModule('History', { - - - - publicMethods: { - initHistory: function() { - - framework.extend(_options, _historyDefaultOptions, true); - - if( !_options.history ) { - return; - } - - - _windowLoc = window.location; - _urlChangedOnce = false; - _closedFromURL = false; - _historyChanged = false; - _initialHash = _getHash(); - - - if(_initialHash.indexOf('gid=') > -1) { - _initialHash = _initialHash.split('&gid=')[0]; - _initialHash = _initialHash.split('?gid=')[0]; - } - - - _listen('afterChange', self.updateURL); - _listen('unbindEvents', function() { - framework.unbind(window, 'hashchange', self.onHashChange); - }); - - - var returnToOriginal = function() { - _hashReseted = true; - if(!_closedFromURL) { - - if(_urlChangedOnce) { - history.back(); - } else { - if(_initialHash) { - _windowLoc.hash = _initialHash; - } else { - if ('pushState' in history) { - // remove hash from url without refreshing it or scrolling to top - history.pushState("", document.title, _windowLoc.pathname + _windowLoc.search); - } else { - _windowLoc.hash = ""; - } - } - } - - } - - _cleanHistoryTimeouts(); - }; - - - _listen('unbindEvents', function() { - if(_closedByScroll) { - // if PhotoSwipe is closed by scroll, we go "back" before the closing animation starts - // this is done to keep the scroll position - returnToOriginal(); - } - }); - _listen('destroy', function() { - if(!_hashReseted) { - returnToOriginal(); - } - }); - _listen('firstUpdate', function() { - _currentItemIndex = _parseItemIndexFromURL().pid; - }); - - - - - var index = _initialHash.indexOf('pid='); - if(index > -1) { - _initialHash = _initialHash.substring(0, index); - if(_initialHash.slice(-1) === '&') { - _initialHash = _initialHash.slice(0, -1); - } - } - - - setTimeout(function() { - if(_isOpen) { // hasn't destroyed yet - framework.bind(window, 'hashchange', self.onHashChange); - } - }, 40); - - }, - onHashChange: function() { - - if(_getHash() === _initialHash) { - _closedFromURL = true; - self.close(); - return; - } - if(!_hashChangedByScript) { - _hashChangedByHistory = true; - self.goTo( _parseItemIndexFromURL().pid ); - _hashChangedByHistory = false; - } - - }, - updateURL: function() { - - // Delay the update of URL, to avoid lag during transition, - // and to not to trigger actions like "refresh page sound" or "blinking favicon" to often - - _cleanHistoryTimeouts(); - - - if(_hashChangedByHistory) { - return; - } - - if(!_historyChanged) { - _updateHash(); // first time - } else { - _historyUpdateTimeout = setTimeout(_updateHash, 800); - } - } - - } -}); - - -/*>>history*/ - framework.extend(self, publicMethods); }; - return PhotoSwipe; -}); \ No newline at end of file diff --git a/vendors/photoswipe/photoswipe.min.js b/vendors/photoswipe/photoswipe.min.js deleted file mode 100644 index 010f435c6..000000000 --- a/vendors/photoswipe/photoswipe.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! PhotoSwipe - v4.0.0 - 2014-12-04 -* http://photoswipe.com -* Copyright (c) 2014 Dmitry Semenov; */ -(function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t:e.PhotoSwipe=t()})(this,function(){"use strict";var e=function(e,t,n,i){var o={features:null,bind:function(e,t,n,i){var o=(i?"remove":"add")+"EventListener";t=t.split(" ");for(var a=0;t.length>a;a++)t[a]&&e[o](t[a],n,!1)},isArray:function(e){return e instanceof Array},createEl:function(e,t){var n=document.createElement(t||"div");return e&&(n.className=e),n},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,n){o.bind(e,t,n,!0)},removeClass:function(e,t){var n=RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){o.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},hasClass:function(e,t){return e.className&&RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},arraySearch:function(e,t,n){for(var i=e.length;i--;)if(e[i][n]===t)return i;return-1},extend:function(e,t,n){for(var i in t)if(t.hasOwnProperty(i)){if(n&&e.hasOwnProperty(i))continue;e[i]=t[i]}},easing:{sine:{out:function(e){return Math.sin(e*(Math.PI/2))},inOut:function(e){return-(Math.cos(Math.PI*e)-1)/2}},cubic:{out:function(e){return--e*e*e+1}}},detectFeatures:function(){if(o.features)return o.features;var e=o.createEl(),t=e.style,n="",i={};if(i.oldIE=document.all&&!document.addEventListener,i.touch="ontouchstart"in window,window.requestAnimationFrame&&(i.raf=window.requestAnimationFrame,i.caf=window.cancelAnimationFrame),i.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled,!i.pointerEvent){var a=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var r=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);r=parseInt(r[1],10),r>=1&&8>r&&(i.isOldIOSPhone=!0)}var l=a.match(/Android\s([0-9\.]*)/),s=l?l[1]:0;s=parseFloat(s),s>=1&&4.4>s?i.isOldAndroid=!0:s>=5&&(i.isNewAndroid=!0),i.isMobileOpera=/opera mini|opera mobi/i.test(a)}for(var c,u,d=["transform","perspective","animationName"],m=["","webkit","Moz","ms","O"],p=0;4>p;p++){n=m[p];for(var f=0;3>f;f++)c=d[f],u=n+(n?c.charAt(0).toUpperCase()+c.slice(1):c),!i[c]&&u in t&&(i[c]=u);n&&!i.raf&&(n=n.toLowerCase(),i.raf=window[n+"RequestAnimationFrame"],i.raf&&(i.caf=window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"]))}if(!i.raf){var h=0;i.raf=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-h)),i=window.setTimeout(function(){e(t+n)},n);return h=t+n,i},i.caf=function(e){clearTimeout(e)}}return i.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,o.features=i,i}};o.detectFeatures(),o.features.oldIE&&(o.bind=function(e,t,n,i){t=t.split(" ");for(var o,a=(i?"detach":"attach")+"Event",r=0;t.length>r;r++)if(o=t[r])if("object"==typeof n&&n.handleEvent){if(i){if(!n["oldIE"+o])return!1}else n["oldIE"+o]=function(){n.handleEvent.call(n)};e[a]("on"+o,n["oldIE"+o])}else e[a]("on"+o,n)});var a=this,r=25,l=3,s={allowPanToNext:!0,spacing:.12,bgOpacity:1,mouseUsed:!1,loop:!0,pinchToClose:!0,closeOnScroll:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:!1,focus:!0,escKey:!0,arrowKeys:!0,mainScrollEndFriction:.35,panEndFriction:.35,scaleMode:"fit",modal:!0,alwaysFadeIn:!1};o.extend(s,i);var c,u,d,m,p,f,h,y,v,x,g,w,b,I,D,T,M,k,C,S,Z,A,O,E,R,F,P,L,z,N,_,U,H,Y,B,W,V,G,X,q,K,$,j,J,Q,et,tt,nt,it,ot,at,rt,lt,st,ct,ut,dt,mt,pt,ft,ht,yt,vt,xt=function(){return{x:0,y:0}},gt=0,wt=xt(),bt=xt(),It=xt(),Dt=xt(),Tt={},Mt=0,kt=0,Ct=xt(),St=0,Zt=!0,At=[],Ot={},Et=function(e,t){o.extend(a,t.publicMethods),At.push(e)},Rt=function(e){var t=yt();return e>t-1?e-t:0>e?t+e:e},Ft={},Pt=function(e,t){return Ft[e]||(Ft[e]=[]),Ft[e].push(t)},Lt=function(e){var t=Ft[e];if(t){var n=Array.prototype.slice.call(arguments);n.shift();for(var i=0;t.length>i;i++)t[i].apply(a,n)}},zt=function(){return(new Date).getTime()},Nt=function(e){ct=e,a.bg.style.opacity=e*s.bgOpacity},_t=function(e,t,n,i){e[A]=w+t+"px, "+n+"px"+b+" scale("+i+")"},Ut=function(){it&&_t(it,It.x,It.y,x)},Ht=function(e){_t(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel)},Yt=function(e,t){t[A]=w+e+"px, 0px"+b},Bt=function(e,t){if(!s.loop&&t){var n=m+(Ct.x*Mt-e)/Ct.x,i=Math.round(e-bn.x);(0>n&&i>0||n>=yt()-1&&0>i)&&(e=bn.x+i*s.mainScrollEndFriction)}bn.x=e,Yt(e,p)},Wt=function(e){return 1/tt*e*g},Vt=function(e,t){var n=In[e]-rt[e];return bt[e]+wt[e]+n-n*(t/g)},Gt=function(e,t){return e.x===t.x&&e.y===t.y},Xt=function(e,t){return r>Math.abs(e.x-t.x)&&r>Math.abs(e.y-t.y)},qt=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Kt=function(){o.bind(document,"keydown keyup",a),s.mouseUsed||o.bind(document,"mousemove",Jt),o.bind(window,"resize scroll",a),Lt("bindEvents")},$t=function(){o.unbind(window,"resize",a),o.unbind(window,"scroll",v.scroll),o.unbind(document,"keydown keyup",a),o.unbind(document,"mousemove",Jt),G&&o.unbind(window,h,a),Lt("unbindEvents")},jt=null,Jt=function(){jt&&(o.unbind(document,"mousemove",Jt),o.addClass(e,"pswp--has_mouse"),s.mouseUsed=!0,Lt("mouseUsed")),jt=setTimeout(function(){jt=null},100)},Qt=function(e,t){var n=jn(a.currItem,Tt,e);return t&&(nt=n),n},en=function(e,t,n,i){return i===a.currItem.initialZoomLevel?(n[e]=a.currItem.initialPosition[e],!0):(n[e]=Vt(e,i),n[e]>t.min[e]?(n[e]=t.min[e],!0):n[e]=i)return on(e),a(n),r&&r(),void 0;a((n-t)*o(l/i)+t),tn[e].raf=R(c)}};c()},sn=function(t,n,i,a){U&&clearTimeout(U),ft=!0,pt=!0;var r;t.initialLayout?(r=t.initialLayout,t.initialLayout=null):r=s.getThumbBoundsFn&&s.getThumbBoundsFn(m);var l=function(){on("initialZoom"),i||(Nt(1),n&&(n.style.display="block"),o.addClass(e,"pswp--animated-in"),Lt("initialZoomInEnd")),a&&a(),ft=!1},c=i?s.hideAnimationDuration:s.showAnimationDuration;return r&&void 0!==r.x&&c?(t.miniImg&&(t.miniImg.style.webkitBackfaceVisibility="hidden"),i||(x=r.w/t.w,It.x=r.x,It.y=r.y-L,s.showHideOpacity&&(e.style.opacity=.001,e.style.webkitBackfaceVisibility="hidden"),Ut()),an("initialZoom"),i&&!d&&o.removeClass(e,"pswp--animated-in"),U=setTimeout(function(){if(Lt("initialZoom"+(i?"Out":"In")),i){var n=r.w/t.w,a={x:It.x,y:It.y},u=x,m=L,p=ct,f=function(t){D&&(m=o.getScrollY(),D=!1),1===t?(x=n,It.x=r.x,It.y=r.y-m,d&&l()):(x=(n-u)*t+u,It.x=(r.x-a.x)*t+a.x,It.y=(r.y-m-a.y)*t+a.y),Ut(),s.showHideOpacity?e.style.opacity=1-t:Nt(p-t*p)};d?ln("initialZoom",0,1,c,o.easing.cubic.out,f):(f(1),U=setTimeout(l,c+20))}else x=t.initialZoomLevel,qt(It,t.initialPosition),Ut(),Nt(1),s.showHideOpacity?e.style.opacity=1:Nt(1),U=setTimeout(l,c+20)},i?25:90),!0):(Lt("initialZoom"+(i?"Out":"In")),x=t.initialZoomLevel,qt(It,t.initialPosition),Ut(),e.style.opacity=i?0:1,Nt(1),l(),!1)},cn={shout:Lt,listen:Pt,viewportSize:Tt,options:s,isMainScrollAnimating:function(){return ot},getZoomLevel:function(){return x},getCurrentIndex:function(){return m},isDragging:function(){return G},isZooming:function(){return Q},applyZoomPan:function(e,t,n){It.x=t,It.y=n,x=e,Ut()},init:function(){if(!c&&!u){var n;if(a.framework=o,a.template=e,a.bg=e.children[0],P=e.className,c=!0,_=o.detectFeatures(),R=_.raf,F=_.caf,A=_.transform,z=_.oldIE,a.scrollWrap=e.children[1],a.container=a.scrollWrap.children[0],p=a.container.style,A){var i=_.perspective&&!E;w="translate"+(i?"3d(":"("),b=_.perspective?", 0px)":")"}else A="left",o.addClass(e,"pswp--ie"),Yt=function(e,t){t.left=e+"px"},Ht=function(e){var t=e.container.style,n=e.fitRatio*e.w,i=e.fitRatio*e.h;t.width=n+"px",t.height=i+"px",t.left=e.initialPosition.x+"px",t.top=e.initialPosition.y+"px"},Ut=function(){if(it){var e=it,t=a.currItem,n=t.fitRatio*t.w,i=t.fitRatio*t.h;e.width=n+"px",e.height=i+"px",e.left=It.x+"px",e.top=It.y+"px"}};var r=function(e,t,n,i,o){k=e+t,C=e+n,S=e+i,Z=o?e+o:""};for(T=[{el:a.container.children[0],wrap:0,index:-1},{el:a.container.children[1],wrap:0,index:-1},{el:a.container.children[2],wrap:0,index:-1}],T[0].el.style.display=T[2].el.style.display="none",O=_.pointerEvent,O&&_.touch&&(_.touch=!1),O?navigator.pointerEnabled?r("pointer","down","move","up","cancel"):r("MSPointer","Down","Move","Up","Cancel"):_.touch?(r("touch","start","move","end","cancel"),E=!0):r("mouse","down","move","up"),h=C+" "+S+" "+Z,y=k,O&&!E&&(E=navigator.maxTouchPoints>1||navigator.msMaxTouchPoints>1),a.likelyTouchDevice=E,(!_.animationName||!_.transform||_.isOldIOSPhone||_.isOldAndroid||_.isMobileOpera)&&(s.showAnimationDuration=s.hideAnimationDuration=0),n=0;At.length>n;n++)a["init"+At[n]]();if(t){var g=a.ui=new t(a,o);g.init()}E||(s.allowPanToNext=!1),v={resize:a.updateSize,scroll:function(){D=!0,s.closeOnScroll&&c&&(!a.likelyTouchDevice||s.mouseUsed)&&Math.abs(o.getScrollY()-L)>2&&(d=!0,a.close())},keyup:function(e){s.escKey&&27===e.keyCode&&a.close()},keydown:function(e){s.arrowKeys&&(37===e.keyCode?a.prev():39===e.keyCode&&a.next())}},v[k]=_n,v[C]=Un,v[S]=Yn,Z&&(v[Z]=v[S]),_.touch&&(y+=" mousedown",h+="mousemove mouseup",v.mousedown=v[k],v.mousemove=v[C],v.mouseup=v[S]),Lt("firstUpdate"),m=m||s.index||0,(isNaN(m)||0>m||m>=yt())&&(m=0),a.currItem=ht(m),(_.isOldIOSPhone||_.isOldAndroid)&&(Zt=!1),s.modal&&(e.setAttribute("aria-hidden","false"),Zt?e.style.position="fixed":(e.style.position="absolute",e.style.top=o.getScrollY()+"px")),void 0===N&&(Lt("initialLayout"),N=L=o.getScrollY());var M="pswp--open ";for(s.mainClass&&(M+=s.mainClass+" "),s.showHideOpacity&&(M+="pswp--animate_opacity "),M+=E?"pswp--touch":"pswp--notouch",M+=_.animationName?" pswp--css_animation":"",M+=_.svg?" pswp--svg":"",o.addClass(e,M),a.updateSize(),f=-1,St=null,n=0;l>n;n++)Yt((n+f)*Ct.x,T[n].el.style);z||o.bind(a.scrollWrap,y,a),Pt("initialZoomInEnd",function(){a.setContent(T[0],m-1),a.setContent(T[2],m+1),T[0].el.style.display=T[2].el.style.display="block",s.focus&&e.focus(),Kt()}),a.setContent(T[1],m),a.updateCurrItem(),Lt("afterInit"),Zt||(I=setInterval(function(){nn||G||Q||x!==a.currItem.initialZoomLevel||a.updateSize()},1e3)),o.addClass(e,"pswp--visible")}},close:function(){c&&(c=!1,u=!0,Lt("close"),$t(),sn(a.currItem,null,!0,a.destroy))},destroy:function(){Lt("destroy"),U&&clearTimeout(U),s.modal&&(e.setAttribute("aria-hidden","true"),e.className=P),I&&clearInterval(I),o.unbind(a.scrollWrap,y,a),o.unbind(window,"scroll",a),Mn(),rn(),Ft=null},panTo:function(e,t,n){n||(e>nt.min.x?e=nt.min.x:nt.max.x>e&&(e=nt.max.x),t>nt.min.y?t=nt.min.y:nt.max.y>t&&(t=nt.max.y)),It.x=e,It.y=t,Ut()},handleEvent:function(e){e=e||window.event,v[e.type]&&v[e.type](e)},goTo:function(e){e=Rt(e);var t=e-m;St=t,m=e,a.currItem=ht(m),Mt-=t,Bt(Ct.x*Mt),rn(),ot=!1,a.updateCurrItem()},next:function(){a.goTo(m+1)},prev:function(){a.goTo(m-1)},updateCurrItem:function(e){if(0!==St){var t,n=Math.abs(St);if(!(e&&2>n)){a.currItem=ht(m),Lt("beforeChange",St),n>=l&&(f+=St+(St>0?-l:l),n=l);for(var i=0;n>i;i++)St>0?(t=T.shift(),T[l-1]=t,f++,Yt((f+2)*Ct.x,t.el.style),a.setContent(t,m-n+i+1+1)):(t=T.pop(),T.unshift(t),f--,Yt(f*Ct.x,t.el.style),a.setContent(t,m+n-i-1-1));if(it&&1===Math.abs(St)){var r=ht(M);r.initialZoomLevel!==x&&(jn(r,Tt),Ht(r))}if(T[1].el.children.length){var s=T[1].el.children[0];it=o.hasClass(s,"pswp__zoom-wrap")?s.style:null}else it=null;St=0,nt=a.currItem.bounds,g=x=a.currItem.initialZoomLevel,It.x=nt.center.x,It.y=nt.center.y,M=m,Lt("afterChange")}}},updateSize:function(t){if(!Zt){var n=o.getScrollY();if(N!==n&&(e.style.top=n+"px",N=n),!t&&Ot.x===window.innerWidth&&Ot.y===window.innerHeight)return;Ot.x=window.innerWidth,Ot.y=window.innerHeight,e.style.height=Ot.y+"px"}if(Tt.x=a.scrollWrap.clientWidth,Tt.y=a.scrollWrap.clientHeight,rt={x:0,y:N},Ct.x=Tt.x+Math.round(Tt.x*s.spacing),Ct.y=Tt.y,Bt(Ct.x*Mt),void 0!==f)for(var i=0;l>i;i++){Yt((i+f)*Ct.x,T[i].el.style);var r=Rt(m-1+i),c=ht(r);c&&c.container&&(jn(c,Tt),Ht(c))}g=x=a.currItem.initialZoomLevel,nt=a.currItem.bounds,nt&&(It.x=nt.center.x,It.y=nt.center.y,Ut()),Lt("resize")},zoomTo:function(e,t,n,i,a){t&&(g=x,In.x=Math.abs(t.x)-It.x,In.y=Math.abs(t.y)-It.y,qt(bt,It));var r=Qt(e,!1),l={};en("x",r,l,e),en("y",r,l,e);var s=x,c={x:It.x,y:It.y},u=function(t){1===t?(x=e,It.x=l.x,It.y=l.y):(x=(e-s)*t+s,It.x=(l.x-c.x)*t+c.x,It.y=(l.y-c.y)*t+c.y),a&&a(t),Ut()};n?ln("customZoomTo",0,1,n,i||o.easing.sine.inOut,u):u(1)}},un=30,dn=10,mn={},pn={},fn={},hn={},yn={},vn=[],xn={},gn=[],wn={},bn=xt(),In=xt(),Dn=xt(),Tn=function(e,t){return wn.x=Math.abs(e.x-t.x),wn.y=Math.abs(e.y-t.y),Math.sqrt(wn.x*wn.x+wn.y*wn.y)},Mn=function(){$&&(F($),$=null)},kn=function(){G&&($=R(kn),Hn())},Cn=function(){return!("fit"===s.scaleMode&&x===a.currItem.initialZoomLevel)},Sn={},Zn=function(e,t){return Sn.prevent="A"!==e.target.tagName,Lt("preventDragEvent",e,t,Sn),Sn.prevent},An=function(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t},On=function(e,t,n){n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y)},En=function(e,t,n){if(e-Y>50){var i=gn.length>2?gn.shift():{};i.x=t,i.y=n,gn.push(i),Y=e}},Rn=function(){var e=It.y-a.currItem.initialPosition.y;return 1-Math.abs(e/(Tt.y/2))},Fn={},Pn={},Ln=[],zn=function(e){for(;Ln.length>0;)Ln.pop();return O?(dt=0,vn.forEach(function(e){0===dt?Ln[0]=e:1===dt&&(Ln[1]=e),dt++})):e.type.indexOf("touch")>-1?e.touches&&e.touches.length>0&&(Ln[0]=An(e.touches[0],Fn),e.touches.length>1&&(Ln[1]=An(e.touches[1],Pn))):(Fn.x=e.pageX,Fn.y=e.pageY,Fn.id="",Ln[0]=Fn),Ln},Nn=function(e,t){var n,i,o=0,r=It[e]+t[e],l=t[e]>0,c=bn.x+t.x,u=bn.x-xn.x;n=r>nt.min[e]||nt.max[e]>r?s.panEndFriction:1,r=It[e]+t[e]*n;var d,m;return!s.allowPanToNext&&x!==a.currItem.initialZoomLevel||(it?"h"!==at||"x"!==e||q||(l?(r>nt.min[e]&&(n=s.panEndFriction,o=nt.min[e]-r,i=nt.min[e]-bt[e]),(0>=i||0>u)&&yt()>1?(m=c,0>u&&c>xn.x&&(m=xn.x)):nt.min.x!==nt.max.x&&(d=r)):(nt.max[e]>r&&(n=s.panEndFriction,o=r-nt.max[e],i=bt[e]-nt.max[e]),(0>=i||u>0)&&yt()>1?(m=c,u>0&&xn.x>c&&(m=xn.x)):nt.min.x!==nt.max.x&&(d=r))):m=c,"x"!==e)?(ot||j||x>a.currItem.fitRatio&&(It[e]+=t[e]*n),void 0):(void 0!==m&&(Bt(m,!0),j=m===xn.x?!1:!0),nt.min.x!==nt.max.x&&(void 0!==d?It.x=d:j||(It.x+=t.x*n)),void 0!==m)},_n=function(e){if(ft)return e.preventDefault(),void 0;if(Zn(e,!0)&&e.preventDefault(),Lt("pointerDown"),O){var t=o.arraySearch(vn,e.pointerId,"id");0>t&&(t=vn.length),vn[t]={x:e.pageX,y:e.pageY,id:e.pointerId}}var n=zn(e),i=n.length;J=null,rn(),G&&1!==i||(G=lt=!0,o.bind(window,h,a),W=ut=st=V=j=K=X=q=!1,at=null,Lt("firstTouchStart",n),qt(bt,It),wt.x=wt.y=0,qt(hn,n[0]),qt(yn,hn),xn.x=Ct.x*Mt,gn=[{x:hn.x,y:hn.y}],Y=H=zt(),Qt(x,!0),Mn(),kn()),!Q&&i>1&&!ot&&!j&&(g=x,q=!1,Q=X=!0,wt.y=wt.x=0,qt(bt,It),qt(mn,n[0]),qt(pn,n[1]),On(mn,pn,Dn),In.x=Math.abs(Dn.x)-It.x,In.y=Math.abs(Dn.y)-It.y,et=tt=Tn(mn,pn))},Un=function(e){if(e.preventDefault(),O){var t=o.arraySearch(vn,e.pointerId,"id");if(t>-1){var n=vn[t];n.x=e.pageX,n.y=e.pageY}}if(G){var i=zn(e);if(at||K||Q)J=i;else{var a=Math.abs(i[0].x-hn.x)-Math.abs(i[0].y-hn.y);Math.abs(a)>=dn&&(at=a>0?"h":"v",J=i)}}},Hn=function(){if(J){var e=J.length;if(0!==e)if(qt(mn,J[0]),fn.x=mn.x-hn.x,fn.y=mn.y-hn.y,Q&&e>1){if(hn.x=mn.x,hn.y=mn.y,!fn.x&&!fn.y&&Gt(J[1],pn))return;qt(pn,J[1]),q||(q=!0,Lt("zoomGestureStarted"));var t=Tn(mn,pn),n=Wt(t);n>a.currItem.initialZoomLevel+a.currItem.initialZoomLevel/15&&(ut=!0);var i=1;if(a.currItem.minZoom>n)if(s.pinchToClose&&!ut&&a.currItem.initialZoomLevel>=g){var o=a.currItem.minZoom-n,r=1-o/(a.currItem.minZoom/1.2);Nt(r),Lt("onPinchClose",r),st=!0}else i=(a.currItem.minZoom-n)/a.currItem.minZoom,i>1&&(i=1),n=a.currItem.minZoom-i*(a.currItem.minZoom/3);else n>a.currItem.maxZoom&&(i=(n-a.currItem.maxZoom)/(6*a.currItem.minZoom),i>1&&(i=1),n=a.currItem.maxZoom+i*a.currItem.minZoom);1!==i&&0>i&&(i=0),et=t,On(mn,pn,Dt),wt.x+=Dt.x-Dn.x,wt.y+=Dt.y-Dn.y,qt(Dn,Dt),It.x=Vt("x",n),It.y=Vt("y",n),W=n>x,x=n,Ut()}else{if(!at)return;if(lt&&(lt=!1,Math.abs(fn.x)>=dn&&(fn.x-=J[0].x-yn.x),Math.abs(fn.y)>=dn&&(fn.y-=J[0].y-yn.y)),hn.x=mn.x,hn.y=mn.y,0===fn.x&&0===fn.y)return;if("v"===at&&s.closeOnVerticalDrag&&!Cn()){wt.y+=fn.y,It.y+=fn.y;var l=Rn();return V=!0,Lt("onVerticalDrag",l),Nt(l),Ut(),void 0}En(zt(),mn.x,mn.y),K=!0,nt=a.currItem.bounds;var c=Nn("x",fn);c||Nn("y",fn),Ut()}}},Yn=function(e){Lt("pointerUp"),Zn(e,!1)&&e.preventDefault();var t;if(O){var n=o.arraySearch(vn,e.pointerId,"id");if(n>-1)if(t=vn.splice(n,1)[0],navigator.pointerEnabled)t.type=e.pointerType||"mouse";else{var i={4:"mouse",2:"touch",3:"pen"};t.type=i[e.pointerType],t.type||(t.type=e.pointerType||"mouse")}}var r,l=zn(e),s=l.length;if("mouseup"===e.type&&(s=0),2===s)return J=null,!0;1===s&&qt(yn,l[0]),0!==s||at||ot||(t||("mouseup"===e.type?t={x:e.pageX,y:e.pageY,type:"mouse"}:e.changedTouches&&e.changedTouches[0]&&(t={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,type:"touch"})),Lt("touchRelease",e,t));var c=-1;if(0===s&&(G=!1,o.unbind(window,h,a),Mn(),Q?c=0:-1!==gt&&(c=zt()-gt)),gt=1===s?zt():-1,r=-1!==c&&150>c?"zoom":"swipe",Q&&2>s&&(Q=!1,1===s&&(r="zoomPointerUp"),Lt("zoomGestureEnded")),J=null,K||q||ot||V)if(rn(),B||(B=Bn()),B.calculateSwipeSpeed("x"),V){var u=Rn();if(.6>u)a.close();else{var d=It.y,m=ct;ln("verticalDrag",0,1,300,o.easing.cubic.out,function(e){It.y=(a.currItem.initialPosition.y-d)*e+d,Nt((1-m)*e+m),Ut()}),Lt("onVerticalDrag",1)}}else{if((j||ot)&&0===s){var p=Vn(r,B);if(p)return;r="zoomPointerUp"}if(!ot)return"swipe"!==r?(Gn(),void 0):(!j&&x>a.currItem.fitRatio&&Wn(B),void 0)}},Bn=function(){var e,t,n={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(i){gn.length>1?(e=zt()-Y+50,t=gn[gn.length-2][i]):(e=zt()-H,t=yn[i]),n.lastFlickOffset[i]=hn[i]-t,n.lastFlickDist[i]=Math.abs(n.lastFlickOffset[i]),n.lastFlickSpeed[i]=n.lastFlickDist[i]>20?n.lastFlickOffset[i]/e:0,.1>Math.abs(n.lastFlickSpeed[i])&&(n.lastFlickSpeed[i]=0),n.slowDownRatio[i]=.95,n.slowDownRatioReverse[i]=1-n.slowDownRatio[i],n.speedDecelerationRatio[i]=1},calculateOverBoundsAnimOffset:function(e,t){n.backAnimStarted[e]||(It[e]>nt.min[e]?n.backAnimDestination[e]=nt.min[e]:It[e]n.speedDecelerationRatioAbs[e]&&(n.lastFlickSpeed[e]=0,n.backAnimStarted[e]=!0,ln("bounceZoomPan"+e,It[e],n.backAnimDestination[e],t||300,o.easing.sine.out,function(t){It[e]=t,Ut()}))))},calculateAnimOffset:function(e){n.backAnimStarted[e]||(n.speedDecelerationRatio[e]=n.speedDecelerationRatio[e]*(n.slowDownRatio[e]+n.slowDownRatioReverse[e]-n.slowDownRatioReverse[e]*n.timeDiff/10),n.speedDecelerationRatioAbs[e]=Math.abs(n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]),n.distanceOffset[e]=n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]*n.timeDiff,It[e]+=n.distanceOffset[e])},panAnimLoop:function(){return tn.zoomPan&&(tn.zoomPan.raf=R(n.panAnimLoop),n.now=zt(),n.timeDiff=n.now-n.lastNow,n.lastNow=n.now,n.calculateAnimOffset("x"),n.calculateAnimOffset("y"),Ut(),n.calculateOverBoundsAnimOffset("x"),n.calculateOverBoundsAnimOffset("y"),.05>n.speedDecelerationRatioAbs.x&&.05>n.speedDecelerationRatioAbs.y)?(on("zoomPan"),void 0):void 0}};return n},Wn=function(e){return e.calculateSwipeSpeed("y"),nt=a.currItem.bounds,e.backAnimDestination={},e.backAnimStarted={},.05>=Math.abs(e.lastFlickSpeed.x)&&.05>=Math.abs(e.lastFlickSpeed.y)?(e.speedDecelerationRatioAbs.x=e.speedDecelerationRatioAbs.y=0,e.calculateOverBoundsAnimOffset("x"),e.calculateOverBoundsAnimOffset("y"),!0):(an("zoomPan"),e.lastNow=zt(),e.panAnimLoop(),void 0)},Vn=function(e,t){var n;ot||(kt=m);var i;if("swipe"===e){var r=hn.x-yn.x;r>un&&(10>t.lastFlickDist.x||t.lastFlickOffset.x>20)?i=-1:-un>r&&(10>t.lastFlickDist.x||-20>t.lastFlickOffset.x)&&(i=1)}var l;i&&(m+=i,0>m?(m=s.loop?yt()-1:0,l=!0):m>=yt()&&(m=s.loop?0:yt()-1,l=!0),(!l||s.loop)&&(St+=i,Mt-=i,n=!0));var c,u=Ct.x*Mt,d=Math.abs(u-bn.x);return n||u>bn.x==t.lastFlickSpeed.x>0?(c=Math.abs(t.lastFlickSpeed.x)>0?d/Math.abs(t.lastFlickSpeed.x):333,c=Math.min(c,400),c=Math.max(c,250)):c=333,kt===m&&(n=!1),ot=!0,ln("mainScroll",bn.x,u,c,o.easing.cubic.out,Bt,function(){rn(),ot=!1,kt=-1,(n||kt!==m)&&a.updateCurrItem(),Lt("mainScrollAnimComplete")}),n&&a.updateCurrItem(!0),n},Gn=function(){var e=x;a.currItem.minZoom>x?e=a.currItem.minZoom:x>a.currItem.maxZoom&&(e=a.currItem.maxZoom);var t,n=1,i=ct;return st&&!W&&!ut&&a.currItem.minZoom>x?(d=!0,a.close(),!0):(st&&(t=function(e){Nt((n-i)*e+i)}),a.zoomTo(e,0,300,o.easing.cubic.out,t),!0)},Xn={},qn={},Kn=[],$n={index:0,errorMsg:'
    The image could not be loaded.
    ',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return mt.length}},jn=function(e,t,n){if(e.src){var i=!n;if(i&&(e.vGap||(e.vGap={top:0,bottom:0}),Lt("parseVerticalMargin",e)),Xn.x=t.x,Xn.y=t.y-e.vGap.top-e.vGap.bottom,i){var o=Xn.x/e.w,a=Xn.y/e.h;e.fitRatio=a>o?o:a,e.fillRatio=o>a?o:a;var r=s.scaleMode;"orig"==r?n=1:"fit"==r?n=e.fitRatio:"fill"==r&&(n=e.fillRatio),n>1&&(n=1),e.initialZoomLevel=n,e.maxZoom=2,e.doubleTapZoom=2*n>1?2*n:1,e.minZoom=n,e.bounds||(e.bounds={center:{},max:{},min:{}})}if(!n)return;qn.x=e.w*n,qn.y=e.h*n;var l=e.bounds;return l.center.x=Math.round((Xn.x-qn.x)/2),l.center.y=Math.round((Xn.y-qn.y)/2)+e.vGap.top,l.max.x=qn.x>Xn.x?Math.round(Xn.x-qn.x):l.center.x,l.max.y=qn.y>Xn.y?Math.round(Xn.y-qn.y)+e.vGap.top:l.center.y,l.min.x=qn.x>Xn.x?0:l.center.x,l.min.y=qn.y>Xn.y?e.vGap.top:l.center.y,i&&n===e.initialZoomLevel&&(e.initialPosition=l.center),l}return!1},Jn=function(e,t,n,i,o,r){var l;!o&&(E||s.alwaysFadeIn)&&(e===m||a.isMainScrollAnimating()||a.isDragging()&&!a.isZooming())&&(l=!0),i&&(l&&(i.style.opacity=0),t.imageAppended=!0,n.appendChild(i),l&&setTimeout(function(){i.style.opacity=1,r&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500)},50))},Qn=function(e){e.loading=!0,e.loaded=!1;var t=e.img=o.createEl("pswp__img","img"),n=function(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,t.onload=t.onerror=null,t=null};return t.onload=n,t.onerror=function(){e.loadError=!0,n()},t.src=e.src,t},ei=function(e,t){return e.loadError?(t.el.innerHTML=s.errorMsg.replace("%url%",e.src),!0):void 0},ti=function(){if(Kn.length){for(var e,t=0;Kn.length>t;t++)e=Kn[t],e.holder.index===e.index&&Jn(e.index,e.item,e.baseDiv,e.img);Kn=[]}};Et("Controller",{publicMethods:{lazyLoadItem:function(e){e=Rt(e);var t=ht(e);!t||t.loaded||t.loading||(Lt("gettingData",e,t),Qn(t))},initController:function(){o.extend(s,$n,!0),a.items=mt=n,ht=a.getItemAt,yt=s.getNumItemsFn,vt=s.loop,3>yt()&&(s.loop=!1),Pt("beforeChange",function(e){var t,n=s.preload,i=null===e?!0:e>0,o=Math.min(n[0],yt()),r=Math.min(n[1],yt());for(t=1;(i?r:o)>=t;t++)a.lazyLoadItem(m+t);for(t=1;(i?o:r)>=t;t++)a.lazyLoadItem(m-t)}),Pt("initialLayout",function(){a.currItem.initialLayout=s.getThumbBoundsFn&&s.getThumbBoundsFn(m)}),Pt("mainScrollAnimComplete",ti),Pt("initialZoomInEnd",ti),Pt("destroy",function(){for(var e,t=0;mt.length>t;t++)e=mt[t],e.container&&(e.container=null),e.placeholder&&(e.placeholder=null),e.img&&(e.img=null),e.preloader&&(e.preloader=null),e.loadError&&(e.loaded=e.loadError=!1);Kn=null})},getItemAt:function(e){return e>=0?mt[e]:!1},allowProgressiveImg:function(){return s.forceProgressiveLoading||!E||s.mouseUsed||screen.width>1200},setContent:function(e,t){s.loop&&(t=Rt(t));var n,i=a.getItemAt(t);if(i){if(Lt("gettingData",t,i),e.index=t,ei(i,e))return i.initialPosition.x=i.initialPosition.y=0,i.initialZoomLevel=i.maxZoom=i.minZoom=1,it=null,i.w=50,i.h=50,Ht(i),void 0;var r;if(r=o.createEl("pswp__zoom-wrap"),i.container=r,i.loaded)n=o.createEl("pswp__img","img"),n.style.webkitBackfaceVisibility="hidden",n.style.opacity=1,n.src=i.src,Jn(t,i,r,n,!0);else{if(i.loadComplete=function(i){if(c){if(n||(n=i.img),n.style.webkitBackfaceVisibility="hidden",e.index===t){if(ei(i,e))return;i.imageAppended?!ft&&i.placeholder&&(i.placeholder.style.display="none",i.placeholder=null):ot||ft?Kn.push({item:i,baseDiv:r,img:n,index:t,holder:e}):Jn(t,i,r,n,ot||ft)}i.loadComplete=null,Lt("imageLoadComplete",t,i)}},n=i.img,o.features.transform){var l=o.createEl("pswp__img pswp__img--placeholder"+(i.msrc?"":" pswp__img--placeholder--blank"),i.msrc?"img":"");i.msrc&&(l.src=i.msrc),l.style.width=i.w+"px",l.style.height=i.h+"px",r.appendChild(l),i.placeholder=l}a.allowProgressiveImg()&&(pt?Jn(t,i,r,n,!0,!0):Kn.push({item:i,baseDiv:r,img:n,index:t,holder:e})),i.loading||Qn(i)}jn(i,Tt),pt||t!==m?Ht(i):(it=r.style,sn(i,n)),e.el.innerHTML="",e.el.appendChild(r)}else e.el.innerHTML=""}}});var ni,ii={},oi=function(e,t,n){var i=document.createEvent("CustomEvent");i.initCustomEvent("pswpTap",!0,!0,{origEvent:e,target:e.target,releasePoint:t,pointerType:n||"touch"}),e.target.dispatchEvent(i)};Et("Tap",{publicMethods:{initTap:function(){Pt("firstTouchStart",a.onTapStart),Pt("touchRelease",a.onTapRelease),Pt("destroy",function(){ii={},ni=null})},onTapStart:function(e){e.length>1&&(clearTimeout(ni),ni=null)},onTapRelease:function(e,t){if(t&&!K&&!X&&!nn){var n=t;if(ni&&(clearTimeout(ni),ni=null,Xt(n,ii)))return Lt("doubleTap",n),void 0;var i=e.target.tagName.toLowerCase();if("mouse"===t.type)return oi(e,t,"mouse"),void 0;if("button"===i||o.hasClass(e.target,"pswp__single-tap"))return oi(e,t),void 0;qt(ii,n),ni=setTimeout(function(){oi(e,t),ni=null},300)}}}});var ai;Et("DesktopZoom",{publicMethods:{handleMouseWheel:function(e){if(a.currItem.fitRatio>=x)return!0;if(e.preventDefault(),e.stopPropagation(),ai.x=0,"deltaX"in e)ai.x=e.deltaX,ai.y=e.deltaY;else if("wheelDelta"in e)e.wheelDeltaX&&(ai.x=-.16*e.wheelDeltaX),ai.y=e.wheelDeltaY?-.16*e.wheelDeltaY:-.16*e.wheelDelta;else{if(!("detail"in e))return;ai.y=e.detail}Qt(x,!0),a.panTo(It.x-ai.x,It.y-ai.y)},toggleDesktopZoom:function(t){t=t||{x:Tt.x/2,y:Tt.y/2+L};var n=1===x;a.mouseZoomedIn=!n,a.zoomTo(n?a.currItem.initialZoomLevel:1,t,333),o[(n?"remove":"add")+"Class"](e,"pswp--zoomed-in")},setupDesktopZoom:function(t){ai={};var n="wheel mousewheel DOMMouseScroll";Pt("bindEvents",function(){o.bind(e,n,a.handleMouseWheel)}),Pt("unbindEvents",function(){ai&&o.unbind(e,n,a.handleMouseWheel)}),a.mouseZoomedIn=!1;var i,r=function(){a.mouseZoomedIn&&(o.removeClass(e,"pswp--zoomed-in"),a.mouseZoomedIn=!1),1>x?o.addClass(e,"pswp--zoom-allowed"):o.removeClass(e,"pswp--zoom-allowed"),l()},l=function(){i&&(o.removeClass(e,"pswp--dragging"),i=!1)};Pt("resize",r),Pt("afterChange",r),Pt("pointerDown",function(){a.mouseZoomedIn&&(i=!0,o.addClass(e,"pswp--dragging"))}),Pt("pointerUp",l),t||r()},initDesktopZoom:function(){z||(E?Pt("mouseUsed",function(){a.setupDesktopZoom()}):a.setupDesktopZoom(!0))}}});var ri,li,si,ci,ui,di,mi,pi,fi,hi,yi,vi={history:!0,galleryUID:1},xi=function(){return yi.hash.substring(1)},gi=function(){ri&&clearTimeout(ri),si&&clearTimeout(si)},wi=function(){var e=xi(),t={};if(5>e.length)return t;for(var n=e.split("&"),i=0;n.length>i;i++)if(n[i]){var o=n[i].split("=");2>o.length||(t[o[0]]=o[1])}return t.pid=parseInt(t.pid,10)-1,0>t.pid&&(t.pid=0),t},bi=function(){if(si&&clearTimeout(si),nn||G)return si=setTimeout(bi,500),void 0;ci?clearTimeout(li):ci=!0;var e=mi+"&"+"gid="+s.galleryUID+"&"+"pid="+(m+1);if(pi){var t=yi.href.split("#")[0]+"#"+e;yi.replace(t)}else-1===yi.hash.indexOf(e)&&(hi=!0),yi.hash=e;pi=!0,li=setTimeout(function(){ci=!1},60)};Et("History",{publicMethods:{initHistory:function(){if(o.extend(s,vi,!0),s.history){yi=window.location,hi=!1,fi=!1,pi=!1,mi=xi(),mi.indexOf("gid=")>-1&&(mi=mi.split("&gid=")[0],mi=mi.split("?gid=")[0]),Pt("afterChange",a.updateURL),Pt("unbindEvents",function(){o.unbind(window,"hashchange",a.onHashChange)});var e=function(){di=!0,fi||(hi?history.back():mi?yi.hash=mi:"pushState"in history?history.pushState("",document.title,yi.pathname+yi.search):yi.hash=""),gi()};Pt("unbindEvents",function(){d&&e()}),Pt("destroy",function(){di||e()}),Pt("firstUpdate",function(){m=wi().pid});var t=mi.indexOf("pid=");t>-1&&(mi=mi.substring(0,t),"&"===mi.slice(-1)&&(mi=mi.slice(0,-1))),setTimeout(function(){c&&o.bind(window,"hashchange",a.onHashChange)},40)}},onHashChange:function(){return xi()===mi?(fi=!0,a.close(),void 0):(ci||(ui=!0,a.goTo(wi().pid),ui=!1),void 0)},updateURL:function(){gi(),ui||(pi?ri=setTimeout(bi,800):bi())}}}),o.extend(a,cn)};return e}); \ No newline at end of file diff --git a/vendors/progress.js/LICENSE b/vendors/progress.js/LICENSE deleted file mode 100644 index 5d0d36c67..000000000 --- a/vendors/progress.js/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Afshin Mehrabani (afshin.meh@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendors/progress.js/README.md b/vendors/progress.js/README.md deleted file mode 100644 index d58950751..000000000 --- a/vendors/progress.js/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# ProgressJS - -> ProgressJs is a JavaScript and CSS3 library which helps developers create and manage progress bars for every object on the page. - -## How To Use - -1) Include `progress.js` and `progressjs.css` in the page (use the minified version from `minified` folder for production) - -2) Execute the following JavaScript code in the page: - -```javascript -//to set progress-bar for whole page -progressJs().start(); -//or for specific element -progressJs("#targetElement").start(); -``` - - -Use other methods to increase, decrease or set an auto-increase function for your progress-bar. Furthermore, you can change the template using `setOption` method. - -## API - -Check the API and method usage with example here: https://github.com/usablica/progress.js/wiki/API - -## Build - -First, you should install `nodejs` and `npm`, then run this command: `npm install` to install all dependencies. - -Now you can run this command to minify all the static resources: - - make build - -## Roadmap -- Add `example` folder and provide examples -- More browser compatibility + mobile/tablet device support -- Add more templates - -## Release History - * **v0.1.0** - 2014-02-14 - - First version - - Increase, decrease and auto-increase functions - - Ability to design and add templates - -## Author -**Afshin Mehrabani** - -- [Twitter](https://twitter.com/afshinmeh) -- [Github](https://github.com/afshinm) -- [Personal page](http://afshinm.name/) - -## License -> Copyright (C) 2012 Afshin Mehrabani (afshin.meh@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/vendors/progress.js/minified/progress.min.js b/vendors/progress.js/minified/progress.min.js deleted file mode 100644 index 8b60282c8..000000000 --- a/vendors/progress.js/minified/progress.min.js +++ /dev/null @@ -1,11 +0,0 @@ -(function(l,e){"object"===typeof exports?e(exports):"function"===typeof define&&define.amd?define(["exports"],e):e(l)})(this,function(l){function e(a){this._targetElement="undefined"!=typeof a.length?a:[a];"undefined"===typeof window._progressjsId&&(window._progressjsId=1);"undefined"===typeof window._progressjsIntervals&&(window._progressjsIntervals={});this._options={theme:"blue",overlayMode:!1,considerTransition:!0}}function m(a,c){var d=this;100<=c&&(c=100);a.hasAttribute("data-progressjs")&& -setTimeout(function(){"undefined"!=typeof d._onProgressCallback&&d._onProgressCallback.call(d,a,c);var b=h(a);if (b){b.style.width=parseInt(c)+"%";}var b=b?b.querySelector(".progressjs-percent"):null,g=b?parseInt(b.innerHTML.replace("%","")):0,e=parseInt(c),j=function(a,b,c){var d=Math.abs(b-c);3>d?k=30:20>d?k=20:intervanIn=1;0!=b-c&&(setTimeout(function(){j(a,b,c)},k))},f=!0;g>e&&(f=!1);var k=10;j(b,g,e)},50)}function h(a){a=parseInt(a.getAttribute("data-progressjs"));return document.querySelector('.progressjs-container > .progressjs-progress[data-progressjs="'+ -a+'"] > .progressjs-inner')}function p(a){for(var c=0,d=this._targetElement.length;cparseInt(e.style.width.replace("%",""))&&(m.call(this,b,100),l=500);(function(a,b){setTimeout(function(){a.parentNode.className+=" progressjs-end";setTimeout(function(){a.parentNode.parentNode.removeChild(a.parentNode);b.removeAttribute("data-progressjs")},1E3)},l)})(e,b)}if(window._progressjsIntervals[a])try{clearInterval(window._progressjsIntervals[a]),window._progressjsIntervals[a]=null,delete window._progressjsIntervals[a]}catch(j){}}return this}, -onbeforeend:function(a){if("function"===typeof a)this._onBeforeEndCallback=a;else throw Error("Provided callback for onbeforeend was not a function");return this},onbeforestart:function(a){if("function"===typeof a)this._onBeforeStartCallback=a;else throw Error("Provided callback for onbeforestart was not a function");return this},onprogress:function(a){if("function"===typeof a)this._onProgressCallback=a;else throw Error("Provided callback for onprogress was not a function");return this}};return l.progressJs= -n}); diff --git a/vendors/progress.js/minified/progressjs.min.css b/vendors/progress.js/minified/progressjs.min.css deleted file mode 100644 index 9ac739e84..000000000 --- a/vendors/progress.js/minified/progressjs.min.css +++ /dev/null @@ -1 +0,0 @@ -.progressjs-inner{width:0}.progressjs-progress{z-index:9999999}.progressjs-theme-blue .progressjs-inner{height:2px;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db}.progressjs-theme-blue.progressjs-end{-webkit-transition:opacity .2s ease-out;-moz-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;transition:opacity .2s ease-out;opacity:0}.progressjs-theme-blue .progressjs-percent{display:none}.progressjs-theme-blueOverlay{background-color:white;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.progressjs-theme-blueOverlay .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db}.progressjs-theme-blueOverlay.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlay .progressjs-percent{display:none}.progressjs-theme-blueOverlay{background-color:white;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.progressjs-theme-blueOverlay .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db}.progressjs-theme-blueOverlay.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlay .progressjs-percent{display:none}.progressjs-theme-blueOverlayRadius{background-color:white;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out;border-radius:5px}.progressjs-theme-blueOverlayRadius .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db;border-radius:5px}.progressjs-theme-blueOverlayRadius.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlayRadius .progressjs-percent{display:none}.progressjs-theme-blueOverlayRadiusHalfOpacity{background-color:white;opacity:.5;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out;border-radius:5px}.progressjs-theme-blueOverlayRadiusHalfOpacity .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db;border-radius:5px}.progressjs-theme-blueOverlayRadiusHalfOpacity.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlayRadiusHalfOpacity .progressjs-percent{display:none}.progressjs-theme-blueOverlayRadiusWithPercentBar{background-color:white;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out;border-radius:5px}.progressjs-theme-blueOverlayRadiusWithPercentBar .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db;border-radius:5px}.progressjs-theme-blueOverlayRadiusWithPercentBar.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlayRadiusWithPercentBar .progressjs-percent{width:70px;text-align:center;height:40px;position:absolute;right:50%;margin-right:-35px;top:50%;margin-top:-20px;font-size:30px;opacity:.5}.progressjs-theme-blackRadiusInputs{height:10px;border-radius:10px;overflow:hidden}.progressjs-theme-blackRadiusInputs .progressjs-inner{height:2px;-webkit-transition:all 1s ease-out;-moz-transition:all 1s ease-out;-o-transition:all 1s ease-out;transition:all 1s ease-out;background-color:#34495e}.progressjs-theme-blackRadiusInputs.progressjs-end{-webkit-transition:opacity .2s ease-out;-moz-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;transition:opacity .2s ease-out;opacity:0}.progressjs-theme-blackRadiusInputs .progressjs-percent{display:none} \ No newline at end of file diff --git a/vendors/progress.js/package.json b/vendors/progress.js/package.json deleted file mode 100644 index 4172afc9c..000000000 --- a/vendors/progress.js/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "Progress.js", - "description": "Themeable HTML5 progress bar library", - "version": "0.1.0", - "author": "Afshin Mehrabani ", - "repository": { - "type": "git", - "url": "https://github.com/usablica/progress.js" - }, - "devDependencies": { - "node-minify": "*" - }, - "engine": [ - "node >=0.1.90" - ], - "main": "src/progress.js" -} \ No newline at end of file diff --git a/vendors/progress.js/src/progress.js b/vendors/progress.js/src/progress.js deleted file mode 100644 index 40f50f37f..000000000 --- a/vendors/progress.js/src/progress.js +++ /dev/null @@ -1,574 +0,0 @@ -/** - * Progress.js v0.1.0 - * https://github.com/usablica/progress.js - * MIT licensed - * - * Copyright (C) 2013 usabli.ca - Afshin Mehrabani (@afshinmeh) - */ - -(function (root, factory) { - if (typeof exports === 'object') { - // CommonJS - factory(exports); - } else if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['exports'], factory); - } else { - // Browser globals - factory(root); - } -} (this, function (exports) { - //Default config/variables - var VERSION = '0.1.0'; - - /** - * ProgressJs main class - * - * @class ProgressJs - */ - function ProgressJs(obj) { - - if (typeof obj.length != 'undefined') { - this._targetElement = obj; - } else { - this._targetElement = [obj]; - } - - if (typeof window._progressjsId === 'undefined') - window._progressjsId = 1; - - if (typeof window._progressjsIntervals === 'undefined') - window._progressjsIntervals = {}; - - this._options = { - //progress bar theme - theme: 'blue', - //overlay mode makes an overlay layer in the target element - overlayMode: false, - //to consider CSS3 transitions in events - considerTransition: true - }; - } - - /** - * Start progress for specific element(s) - * - * @api private - * @method _createContainer - */ - function _startProgress() { - - //call onBeforeStart callback - if (typeof this._onBeforeStartCallback != 'undefined') { - this._onBeforeStartCallback.call(this); - } - - //create the container for progress bar - _createContainer.call(this); - - for (var i = 0, elmsLength = this._targetElement.length; i < elmsLength; i++) { - _setProgress.call(this, this._targetElement[i]); - } - } - - /** - * Set progress bar for specific element - * - * @api private - * @method _setProgress - * @param {Object} targetElement - */ - function _setProgress(targetElement) { - - //if the target element already as `data-progressjs`, ignore the init - if (targetElement.hasAttribute("data-progressjs")) - return; - - //get target element position - var targetElementOffset = _getOffset.call(this, targetElement); - - targetElement.setAttribute("data-progressjs", window._progressjsId); - - var progressElementContainer = document.createElement('div'); - progressElementContainer.className = 'progressjs-progress progressjs-theme-' + this._options.theme; - - - //set the position percent elements, it depends on targetElement tag - if (targetElement.tagName.toLowerCase() === 'body') { - progressElementContainer.style.position = 'fixed'; - } else { - progressElementContainer.style.position = 'absolute'; - } - - progressElementContainer.setAttribute("data-progressjs", window._progressjsId); - var progressElement = document.createElement("div"); - progressElement.className = "progressjs-inner"; - - //create an element for current percent of progress bar - var progressPercentElement = document.createElement('div'); - progressPercentElement.className = "progressjs-percent"; - progressPercentElement.innerHTML = "1%"; - - progressElement.appendChild(progressPercentElement); - - if (this._options.overlayMode && targetElement.tagName.toLowerCase() === 'body') { - //if we have `body` for target element and also overlay mode is enable, we should use a different - //position for progress bar container element - progressElementContainer.style.left = 0; - progressElementContainer.style.right = 0; - progressElementContainer.style.top = 0; - progressElementContainer.style.bottom = 0; - } else { - //set progress bar container size and offset - progressElementContainer.style.left = targetElementOffset.left + 'px'; - progressElementContainer.style.top = targetElementOffset.top + 'px'; - //if targetElement is body set to percent so it scales with browser resize - if (targetElement.nodeName == 'BODY') { - progressElementContainer.style.width = '100%'; - } else { - progressElementContainer.style.width = targetElementOffset.width + 'px'; - } - - if (this._options.overlayMode) { - progressElementContainer.style.height = targetElementOffset.height + 'px'; - } - } - - progressElementContainer.appendChild(progressElement); - - //append the element to container - var container = document.querySelector('.progressjs-container'); - container.appendChild(progressElementContainer); - - _setPercentFor(targetElement, 1); - - //and increase the progressId - ++window._progressjsId; - } - - /** - * Set percent for all elements - * - * @api private - * @method _setPercent - * @param {Number} percent - */ - function _setPercent(percent) { - for (var i = 0, elmsLength = this._targetElement.length; i < elmsLength; i++) { - _setPercentFor.call(this, this._targetElement[i], percent); - } - } - - /** - * Set percent for specific element - * - * @api private - * @method _setPercentFor - * @param {Object} targetElement - * @param {Number} percent - */ - function _setPercentFor(targetElement, percent) { - var self = this; - - //prevent overflow! - if (percent >= 100) - percent = 100; - - if (targetElement.hasAttribute("data-progressjs")) { - //setTimeout for better CSS3 animation applying in some cases - setTimeout(function() { - - //call the onprogress callback - if (typeof self._onProgressCallback != 'undefined') { - self._onProgressCallback.call(self, targetElement, percent); - } - - var percentElement = _getPercentElement(targetElement); - percentElement.style.width = parseInt(percent) + '%'; - - var percentElement = percentElement.querySelector(".progressjs-percent"); - var existingPercent = parseInt(percentElement.innerHTML.replace('%', '')); - - //start increase/decrease the percent element with animation - (function(percentElement, existingPercent, currentPercent) { - - var increasement = true; - if (existingPercent > currentPercent) { - increasement = false; - } - - var intervalIn = 10; - function changePercentTimer(percentElement, existingPercent, currentPercent) { - //calculate the distance between two percents - var distance = Math.abs(existingPercent - currentPercent); - if (distance < 3) { - intervalIn = 30; - } else if (distance < 20) { - intervalIn = 20; - } else { - intervanIn = 1; - } - - if ((existingPercent - currentPercent) != 0) { - //set the percent - percentElement.innerHTML = (increasement ? (++existingPercent) : (--existingPercent)) + '%'; - setTimeout(function() { changePercentTimer(percentElement, existingPercent, currentPercent); }, intervalIn); - } - } - - changePercentTimer(percentElement, existingPercent, currentPercent); - - })(percentElement, existingPercent, parseInt(percent)); - - }, 50); - } - } - - /** - * Get the progress bar element - * - * @api private - * @method _getPercentElement - * @param {Object} targetElement - */ - function _getPercentElement(targetElement) { - var progressjsId = parseInt(targetElement.getAttribute('data-progressjs')); - return document.querySelector('.progressjs-container > .progressjs-progress[data-progressjs="' + progressjsId + '"] > .progressjs-inner'); - } - - /** - * Auto increase the progress bar every X milliseconds - * - * @api private - * @method _autoIncrease - * @param {Number} size - * @param {Number} millisecond - */ - function _autoIncrease(size, millisecond) { - var self = this; - - var target = this._targetElement[0]; - if(!target) return; - var progressjsId = parseInt(target.getAttribute('data-progressjs')); - - if (typeof window._progressjsIntervals[progressjsId] != 'undefined') { - clearInterval(window._progressjsIntervals[progressjsId]); - } - window._progressjsIntervals[progressjsId] = setInterval(function() { - _increasePercent.call(self, size); - }, millisecond); - } - - /** - * Increase the size of progress bar - * - * @api private - * @method _increasePercent - * @param {Number} size - */ - function _increasePercent(size) { - for (var i = 0, elmsLength = this._targetElement.length; i < elmsLength; i++) { - var currentElement = this._targetElement[i]; - if (currentElement.hasAttribute('data-progressjs')) { - var percentElement = _getPercentElement(currentElement); - var existingPercent = parseInt(percentElement.style.width.replace('%', '')); - if (existingPercent) { - _setPercentFor.call(this, currentElement, existingPercent + (size || 1)); - } - } - } - } - - /** - * Close and remove progress bar - * - * @api private - * @method _end - */ - function _end() { - - //call onBeforeEnd callback - if (typeof this._onBeforeEndCallback != 'undefined') { - if (this._options.considerTransition === true) { - //we can safety assume that all layers would be the same, so `this._targetElement[0]` is the same as `this._targetElement[1]` - _getPercentElement(this._targetElement[0]).addEventListener(whichTransitionEvent(), this._onBeforeEndCallback, false); - } else { - this._onBeforeEndCallback.call(this); - } - } - - var target = this._targetElement[0]; - if(!target) return; - var progressjsId = parseInt(target.getAttribute('data-progressjs')); - - for (var i = 0, elmsLength = this._targetElement.length; i < elmsLength; i++) { - var currentElement = this._targetElement[i]; - var percentElement = _getPercentElement(currentElement); - - if (!percentElement) - return; - - var existingPercent = parseInt(percentElement.style.width.replace('%', '')); - - var timeoutSec = 1; - if (existingPercent < 100) { - _setPercentFor.call(this, currentElement, 100); - timeoutSec = 500; - } - - //I believe I should handle this situation with eventListener and `transitionend` event but I'm not sure - //about compatibility with IEs. Should be fixed in further versions. - (function(percentElement, currentElement) { - setTimeout(function() { - percentElement.parentNode.className += " progressjs-end"; - - setTimeout(function() { - //remove the percent element from page - percentElement.parentNode.parentNode.removeChild(percentElement.parentNode); - //and remove the attribute - currentElement.removeAttribute("data-progressjs"); - }, 1000); - }, timeoutSec); - })(percentElement, currentElement); - } - - //clean the setInterval for autoIncrease function - if (window._progressjsIntervals[progressjsId]) { - //`delete` keyword has some problems in IE - try { - clearInterval(window._progressjsIntervals[progressjsId]); - window._progressjsIntervals[progressjsId] = null; - delete window._progressjsIntervals[progressjsId]; - } catch(ex) { } - } - } - - /** - * Remove progress bar without finishing - * - * @api private - * @method _kill - */ - function _kill() { - var target = this._targetElement[0]; - if(!target) return; - var progressjsId = parseInt(target.getAttribute('data-progressjs')); - - for (var i = 0, elmsLength = this._targetElement.length; i < elmsLength; i++) { - var currentElement = this._targetElement[i]; - var percentElement = _getPercentElement(currentElement); - - if (!percentElement) - return; - - //I believe I should handle this situation with eventListener and `transitionend` event but I'm not sure - //about compatibility with IEs. Should be fixed in further versions. - (function(percentElement, currentElement) { - percentElement.parentNode.className += " progressjs-end"; - - setTimeout(function() { - //remove the percent element from page - percentElement.parentNode.parentNode.removeChild(percentElement.parentNode); - //and remove the attribute - currentElement.removeAttribute("data-progressjs"); - }, 1000); - })(percentElement, currentElement); - } - - //clean the setInterval for autoIncrease function - if (window._progressjsIntervals[progressjsId]) { - //`delete` keyword has some problems in IE - try { - clearInterval(window._progressjsIntervals[progressjsId]); - window._progressjsIntervals[progressjsId] = null; - delete window._progressjsIntervals[progressjsId]; - } catch(ex) { } - } - } - - /** - * Create the progress bar container - * - * @api private - * @method _createContainer - */ - function _createContainer() { - //first check if we have an container already, we don't need to create it again - if (!document.querySelector(".progressjs-container")) { - var containerElement = document.createElement("div"); - containerElement.className = "progressjs-container"; - document.body.appendChild(containerElement); - } - } - - /** - * Get an element position on the page - * Thanks to `meouw`: http://stackoverflow.com/a/442474/375966 - * - * @api private - * @method _getOffset - * @param {Object} element - * @returns Element's position info - */ - function _getOffset(element) { - var elementPosition = {}; - - if (element.tagName.toLowerCase() === 'body') { - //set width - elementPosition.width = element.clientWidth; - //set height - elementPosition.height = element.clientHeight; - } else { - //set width - elementPosition.width = element.offsetWidth; - //set height - elementPosition.height = element.offsetHeight; - } - - //calculate element top and left - var _x = 0; - var _y = 0; - while (element && !isNaN(element.offsetLeft) && !isNaN(element.offsetTop)) { - _x += element.offsetLeft; - _y += element.offsetTop; - element = element.offsetParent; - } - //set top - elementPosition.top = _y; - //set left - elementPosition.left = _x; - - return elementPosition; - } - - /** - * Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1 - * via: http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically - * - * @param obj1 - * @param obj2 - * @returns obj3 a new object based on obj1 and obj2 - */ - function _mergeOptions(obj1, obj2) { - var obj3 = {}; - for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; } - for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; } - return obj3; - } - - var progressJs = function (targetElm) { - if (typeof (targetElm) === 'object') { - //Ok, create a new instance - return new ProgressJs(targetElm); - - } else if (typeof (targetElm) === 'string') { - //select the target element with query selector - var targetElement = document.querySelectorAll(targetElm); - - if (targetElement) { - return new ProgressJs(targetElement); - } else { - throw new Error('There is no element with given selector.'); - } - } else { - return new ProgressJs(document.body); - } - }; - - /** - * Get correct transition callback - * Thanks @webinista: http://stackoverflow.com/a/9090128/375966 - * - * @returns transition name - */ - function whichTransitionEvent() { - var t; - var el = document.createElement('fakeelement'); - var transitions = { - 'transition': 'transitionend', - 'OTransition': 'oTransitionEnd', - 'MozTransition': 'transitionend', - 'WebkitTransition': 'webkitTransitionEnd' - } - - for (t in transitions) { - if (el.style[t] !== undefined) { - return transitions[t]; - } - } - } - - /** - * Current ProgressJs version - * - * @property version - * @type String - */ - progressJs.version = VERSION; - - //Prototype - progressJs.fn = ProgressJs.prototype = { - clone: function () { - return new ProgressJs(this); - }, - setOption: function(option, value) { - this._options[option] = value; - return this; - }, - setOptions: function(options) { - this._options = _mergeOptions(this._options, options); - return this; - }, - start: function() { - _startProgress.call(this); - return this; - }, - set: function(percent) { - _setPercent.call(this, percent); - return this; - }, - increase: function(size) { - _increasePercent.call(this, size); - return this; - }, - autoIncrease: function(size, millisecond) { - _autoIncrease.call(this, size, millisecond); - return this; - }, - end: function() { - _end.call(this); - return this; - }, - kill: function() { - _kill.call(this); - return this; - }, - onbeforeend: function(providedCallback) { - if (typeof (providedCallback) === 'function') { - this._onBeforeEndCallback = providedCallback; - } else { - throw new Error('Provided callback for onbeforeend was not a function'); - } - return this; - }, - onbeforestart: function(providedCallback) { - if (typeof (providedCallback) === 'function') { - this._onBeforeStartCallback = providedCallback; - } else { - throw new Error('Provided callback for onbeforestart was not a function'); - } - return this; - }, - onprogress: function(providedCallback) { - if (typeof (providedCallback) === 'function') { - this._onProgressCallback = providedCallback; - } else { - throw new Error('Provided callback for onprogress was not a function'); - } - return this; - } - }; - - exports.progressJs = progressJs; - return progressJs; -})); diff --git a/vendors/progress.js/src/progressjs.css b/vendors/progress.js/src/progressjs.css deleted file mode 100644 index 892bd6fbd..000000000 --- a/vendors/progress.js/src/progressjs.css +++ /dev/null @@ -1,181 +0,0 @@ -.progressjs-inner { - width: 0; -} -.progressjs-progress { - z-index: 9999999; -} - -/* blue theme, like iOS 7 progress bar */ -.progressjs-theme-blue .progressjs-inner { - height: 2px; - -webkit-transition: all 0.3s ease-out; - -moz-transition: all 0.3s ease-out; - -o-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; - background-color: #3498db; -} -.progressjs-theme-blue.progressjs-end { - -webkit-transition: opacity 0.2s ease-out; - -moz-transition: opacity 0.2s ease-out; - -o-transition: opacity 0.2s ease-out; - transition: opacity 0.2s ease-out; - opacity: 0; -} -.progressjs-theme-blue .progressjs-percent { - display: none; -} - -/* blue theme with overlay layer, no percent bar */ -.progressjs-theme-blueOverlay { - background-color: white; - -webkit-transition: all 0.2s ease-out; - -moz-transition: all 0.2s ease-out; - -o-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; -} -.progressjs-theme-blueOverlay .progressjs-inner { - height: 100%; - -webkit-transition: all 0.3s ease-out; - -moz-transition: all 0.3s ease-out; - -o-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; - background-color: #3498db; -} -.progressjs-theme-blueOverlay.progressjs-end { - opacity: 0 !important; -} -.progressjs-theme-blueOverlay .progressjs-percent { - display: none; -} - -/* blue theme with overlay layer, no percent bar */ -.progressjs-theme-blueOverlay { - background-color: white; - -webkit-transition: all 0.2s ease-out; - -moz-transition: all 0.2s ease-out; - -o-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; -} -.progressjs-theme-blueOverlay .progressjs-inner { - height: 100%; - -webkit-transition: all 0.3s ease-out; - -moz-transition: all 0.3s ease-out; - -o-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; - background-color: #3498db; -} -.progressjs-theme-blueOverlay.progressjs-end { - opacity: 0 !important; -} -.progressjs-theme-blueOverlay .progressjs-percent { - display: none; -} - -/* Blue theme with border radius and overlay layer */ -.progressjs-theme-blueOverlayRadius { - background-color: white; - -webkit-transition: all 0.2s ease-out; - -moz-transition: all 0.2s ease-out; - -o-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; - border-radius: 5px; -} -.progressjs-theme-blueOverlayRadius .progressjs-inner { - height: 100%; - -webkit-transition: all 0.3s ease-out; - -moz-transition: all 0.3s ease-out; - -o-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; - background-color: #3498db; - border-radius: 5px; -} -.progressjs-theme-blueOverlayRadius.progressjs-end { - opacity: 0 !important; -} -.progressjs-theme-blueOverlayRadius .progressjs-percent { - display: none; -} - -/* Blue theme with border radius and overlay layer */ -.progressjs-theme-blueOverlayRadiusHalfOpacity { - background-color: white; - opacity: 0.5; - -webkit-transition: all 0.2s ease-out; - -moz-transition: all 0.2s ease-out; - -o-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; - border-radius: 5px; -} -.progressjs-theme-blueOverlayRadiusHalfOpacity .progressjs-inner { - height: 100%; - -webkit-transition: all 0.3s ease-out; - -moz-transition: all 0.3s ease-out; - -o-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; - background-color: #3498db; - border-radius: 5px; -} -.progressjs-theme-blueOverlayRadiusHalfOpacity.progressjs-end { - opacity: 0 !important; -} -.progressjs-theme-blueOverlayRadiusHalfOpacity .progressjs-percent { - display: none; -} - -/* Blue theme with border radius, overlay layer and percent bar */ -.progressjs-theme-blueOverlayRadiusWithPercentBar { - background-color: white; - -webkit-transition: all 0.2s ease-out; - -moz-transition: all 0.2s ease-out; - -o-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; - border-radius: 5px; -} -.progressjs-theme-blueOverlayRadiusWithPercentBar .progressjs-inner { - height: 100%; - -webkit-transition: all 0.3s ease-out; - -moz-transition: all 0.3s ease-out; - -o-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; - background-color: #3498db; - border-radius: 5px; -} -.progressjs-theme-blueOverlayRadiusWithPercentBar.progressjs-end { - opacity: 0 !important; -} -.progressjs-theme-blueOverlayRadiusWithPercentBar .progressjs-percent { - width: 70px; - text-align: center; - height: 40px; - position: absolute; - right: 50%; - margin-right: -35px; - top: 50%; - margin-top: -20px; - font-size: 30px; - opacity: .5; -} - -.progressjs-theme-blackRadiusInputs { - height: 10px; - border-radius: 10px; - overflow: hidden; -} -.progressjs-theme-blackRadiusInputs .progressjs-inner { - height: 2px; - -webkit-transition: all 1s ease-out; - -moz-transition: all 1s ease-out; - -o-transition: all 1s ease-out; - transition: all 1s ease-out; - background-color: #34495e; -} -.progressjs-theme-blackRadiusInputs.progressjs-end { - -webkit-transition: opacity 0.2s ease-out; - -moz-transition: opacity 0.2s ease-out; - -o-transition: opacity 0.2s ease-out; - transition: opacity 0.2s ease-out; - opacity: 0; -} -.progressjs-theme-blackRadiusInputs .progressjs-percent { - display: none; -} \ No newline at end of file diff --git a/vendors/queue/LICENSE b/vendors/queue/LICENSE deleted file mode 100644 index cde4728a2..000000000 --- a/vendors/queue/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2012, Michael Bostock -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* The name Michael Bostock may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendors/queue/README.md b/vendors/queue/README.md deleted file mode 100644 index 3a78534bd..000000000 --- a/vendors/queue/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# queue.js - -**Queue.js** is yet another asynchronous helper library for JavaScript. Think of it as a minimalist version of [Async.js](https://github.com/caolan/async) that allows fine-tuning over parallelism. Or, think of it as a version of [TameJs](https://github.com/maxtaco/tamejs/) that does not use code generation. - -For example, if you wanted to stat two files in parallel: - -```js -queue() - .defer(fs.stat, __dirname + "/../Makefile") - .defer(fs.stat, __dirname + "/../package.json") - .await(function(error, file1, file2) { console.log(file1, file2); }); -``` - -Or, if you wanted to run a bazillion asynchronous tasks (here represented as an array of closures) serially: - -```js -var q = queue(1); -tasks.forEach(function(t) { q.defer(t); }); -q.awaitAll(function(error, results) { console.log("all done!"); }); -``` - -Queue.js can be run inside Node.js or in a browser. - -## Installation - -In a browser, you can use the official hosted copy on [d3js.org](http://d3js.org): - -```html - -``` - -Queue.js supports the asynchronous module definition (AMD) API. For example, if you use [RequireJS](http://requirejs.org/), you may load as follows: - -```js -require.config({paths: {queue: "http://d3js.org/queue.v1.min"}}); - -require(["queue"], function(queue) { - console.log(queue.version); -}); -``` - -In Node, use [NPM](http://npmjs.org) to install: - -```bash -npm install queue-async -``` - -And then `require("queue-async")`. (The package name is [queue-async](https://npmjs.org/package/queue-async) because the name “queue” was already taken.) - -## API Reference - -### queue([parallelism]) - -Constructs a new queue with the specified *parallelism*. If *parallelism* is not specified, the queue has infinite parallelism. Otherwise, *parallelism* is a positive integer. For example, if *parallelism* is 1, then all tasks will be run in series. If *parallelism* is 3, then at most three tasks will be allowed to proceed concurrently; this is useful, for example, when loading resources in a web browser. - -### queue.defer(task[, arguments…]) - -Adds the specified asynchronous *task* function to the queue, with any optional *arguments*. The *task* will be called with the specified optional arguments and an additional callback argument; the callback must then be invoked by the task when it has finished. The task must invoke the callback with two arguments: the error, if any, and the result of the task. For example: - -```js -function simpleTask(callback) { - setTimeout(function() { - callback(null, {answer: 42}); - }, 250); -} -``` - -If an error occurs, any tasks that were scheduled *but not yet started* will not run. For a serial queue (of *parallelism* 1), this means that a task will only run if all previous tasks succeed. For a queue with higher parallelism, only the first error that occurs is reported to the await callback, and tasks that were started before the error occurred will continue to run; note, however, that their results will not be reported to the await callback. - -Tasks can only be deferred before the *await* callback is set. If a task is deferred after the await callback is set, the behavior of the queue is undefined. - -### queue.await(callback) -### queue.awaitAll(callback) - -Sets the *callback* to be invoked when all deferred tasks have finished. - -The first argument to the *callback* is the first error that occurred, or null if no error occurred. If an error occurred, there are no additional arguments to the callback. Otherwise, the *await* callback is passed each result as an additional separate argument, while the *awaitAll* callback is passed a single array of results as the second argument. - -If all tasks complete before the *await* or *awaitAll* callback is set, the callback will be invoked immediately. This method should only be called once, after any tasks have been deferred. If the await callback is set multiple times, or set before a task is deferred, the behavior of the queue is undefined. - -## Callbacks - -The callbacks follow the Node.js convention where the first argument is an optional error object and the second argument is the result of the task. Queue.js does not support asynchronous functions that return multiple results; however, you can homogenize such functions by wrapping them and converting multiple results into a single object or array. diff --git a/vendors/queue/queue.js b/vendors/queue/queue.js deleted file mode 100644 index cf7cec873..000000000 --- a/vendors/queue/queue.js +++ /dev/null @@ -1,80 +0,0 @@ -(function() { - var slice = [].slice; - - function queue(parallelism) { - var q, - tasks = [], - started = 0, // number of tasks that have been started (and perhaps finished) - active = 0, // number of tasks currently being executed (started but not finished) - remaining = 0, // number of tasks not yet finished - popping, // inside a synchronous task callback? - error = null, - await = noop, - all; - - if (!parallelism) parallelism = Infinity; - - function pop() { - while (popping = started < tasks.length && active < parallelism) { - var i = started++, - t = tasks[i], - a = slice.call(t, 1); - a.push(callback(i)); - ++active; - t[0].apply(null, a); - } - } - - function callback(i) { - return function(e, r) { - --active; - if (error != null) return; - if (e != null) { - error = e; // ignore new tasks and squelch active callbacks - started = remaining = NaN; // stop queued tasks from starting - notify(); - } else { - tasks[i] = r; - if (--remaining) popping || pop(); - else notify(); - } - }; - } - - function notify() { - if (error != null) await(error); - else if (all) await(error, tasks); - else await.apply(null, [error].concat(tasks)); - } - - return q = { - defer: function() { - if (!error) { - tasks.push(arguments); - ++remaining; - pop(); - } - return q; - }, - await: function(f) { - await = f; - all = false; - if (!remaining) notify(); - return q; - }, - awaitAll: function(f) { - await = f; - all = true; - if (!remaining) notify(); - return q; - } - }; - } - - function noop() {} - - queue.version = "1.0.7"; - if (typeof define === "function" && define.amd) define(function() { return queue; }); - else if (typeof module === "object" && module.exports) module.exports = queue; - else this.queue = queue; -})(); diff --git a/vendors/queue/queue.min.js b/vendors/queue/queue.min.js deleted file mode 100644 index 8fad987cb..000000000 --- a/vendors/queue/queue.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){function n(n){function e(){for(;i=ap;){var u=a++,e=c[u],o=t.call(e,1);o.push(l(u)),++p,e[0].apply(null,o)}}function l(n){return function(u,t){--p,null==s&&(null!=u?(s=u,a=d=0/0,o()):(c[n]=t,--d?i||e():o()))}}function o(){null!=s?m(s):f?m(s,c):m.apply(null,[s].concat(c))}var r,i,f,c=[],a=0,p=0,d=0,s=null,m=u;return n||(n=1/0),r={defer:function(){return s||(c.push(arguments),++d,e()),r},await:function(n){return m=n,f=!1,d||o(),r},awaitAll:function(n){return m=n,f=!0,d||o(),r}}}function u(){}var t=[].slice;n.version="1.0.7","function"==typeof define&&define.amd?define(function(){return n}):"object"==typeof module&&module.exports?module.exports=n:this.queue=n}(); \ No newline at end of file diff --git a/vendors/simple-pace/LICENSE b/vendors/simple-pace/LICENSE deleted file mode 100644 index ba350e5db..000000000 --- a/vendors/simple-pace/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2013 RainLoop Team - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendors/simple-pace/simple-pace-1.0.min.js b/vendors/simple-pace/simple-pace-1.0.min.js deleted file mode 100644 index f4451c7a5..000000000 --- a/vendors/simple-pace/simple-pace-1.0.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! RainLoop Simple Pace v1.0 (c) 2013 RainLoop Team; Licensed under MIT */ -!function(e){function s(){var s=this;s.el=null,s.done=!1,s.progress=0,s.addInterval=0,s.addSpeed=3,s.stopProgress=100,s.interval=e.setInterval(function(){var t=s.build();t&&e.clearInterval(s.interval)},100)}if(s.prototype.startAddInterval=function(){var s=this;s.stopAddInterval(),s.addInterval=e.setInterval(function(){0s.progress&&s.add(s.addSpeed)},500)},s.prototype.stopAddInterval=function(){e.clearInterval(this.addInterval),this.addInterval=0},s.prototype.build=function(){if(null===this.el){var e=document.querySelector("body");e&&(this.el=document.createElement("div"),this.el.className="simple-pace simple-pace-active",this.el.innerHTML='
    ',e.firstChild?e.insertBefore(this.el,e.firstChild):e.appendChild(this.el))}return this.el},s.prototype.reset=function(){return this.progress=0,this.render()},s.prototype.update=function(s){var t=e.parseInt(s,10);return t>this.progress&&(this.progress=t,this.progress=100this.progress?0:this.progress),this.render()},s.prototype.add=function(s){return this.progress+=e.parseInt(s,10),this.progress=100this.progress?0:this.progress,this.render()},s.prototype.setSpeed=function(e,s){this.addSpeed=e,this.stopProgress=s||100},s.prototype.render=function(){var s=this.build();s&&s.children&&s.children[0]&&s.children[0].setAttribute("style","width:"+this.progress+"%"),100!==this.progress||this.done?100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),s.className=s.className.replace("simple-pace-inactive",""),s.className+=" simple-pace-inactive"):100>this.progress&&!this.done&&0===this.addInterval&&this.startAddInterval():(this.done=!0,this.stopAddInterval(),e.setTimeout(function(){s.className=s.className.replace("simple-pace-active",""),s.className+=" simple-pace-inactive"},500))},!e.SimplePace){var t=new s;e.SimplePace={sleep:function(){t.setSpeed(2,95)},set:function(e){t.update(e)},add:function(e){t.add(e)}}}}(window); \ No newline at end of file diff --git a/vendors/simple-pace/simple-pace.js b/vendors/simple-pace/simple-pace.js deleted file mode 100644 index 316109cdb..000000000 --- a/vendors/simple-pace/simple-pace.js +++ /dev/null @@ -1,142 +0,0 @@ -/*! RainLoop Simple Pace v1.0 (c) 2013 RainLoop Team; Licensed under MIT */ -(function (window) { - - /** - * @constructor - */ - function Bar() { - var self = this; - - self.el = null; - self.done = false; - self.progress = 0; - self.addInterval = 0; - self.addSpeed = 3; - self.stopProgress = 100; - self.interval = window.setInterval(function () { - var oEl = self.build(); - if (oEl) - { - window.clearInterval(self.interval); - } - }, 100); - } - - Bar.prototype.startAddInterval = function () { - var self = this; - self.stopAddInterval(); - self.addInterval = window.setInterval(function () { - if (0 < self.progress && self.stopProgress > self.progress) - { - self.add(self.addSpeed); - } - }, 500); - }; - - Bar.prototype.stopAddInterval = function () { - window.clearInterval(this.addInterval); - this.addInterval = 0; - }; - - Bar.prototype.build = function () { - if (null === this.el) - { - var oTargetElement = document.querySelector('body'); - if (oTargetElement) - { - this.el = document.createElement('div'); - this.el.className = 'simple-pace simple-pace-active'; - this.el.innerHTML = '
    '; - - if (oTargetElement.firstChild) - { - oTargetElement.insertBefore(this.el, oTargetElement.firstChild); - } - else - { - oTargetElement.appendChild(this.el); - } - } - } - - return this.el; - }; - - Bar.prototype.reset = function () { - this.progress = 0; - return this.render(); - }; - - Bar.prototype.update = function (iProg) { - var iP = window.parseInt(iProg, 10); - if (iP > this.progress) - { - this.progress = iP; - this.progress = 100 < this.progress ? 100 : this.progress; - this.progress = 0 > this.progress ? 0 : this.progress; - } - - return this.render(); - }; - - Bar.prototype.add = function (iProg) { - this.progress += window.parseInt(iProg, 10); - this.progress = 100 < this.progress ? 100 : this.progress; - this.progress = 0 > this.progress ? 0 : this.progress; - - return this.render(); - }; - - Bar.prototype.setSpeed = function (iSpeed, iStopProgress) { - this.addSpeed = iSpeed; - this.stopProgress = iStopProgress || 100; - }; - - Bar.prototype.render = function () { - var oEl = this.build(); - if (oEl && oEl.children && oEl.children[0]) - { - oEl.children[0].setAttribute('style', 'width:' + this.progress + '%'); - } - - if (100 === this.progress && !this.done) - { - this.done = true; - this.stopAddInterval(); - - window.setTimeout(function () { - oEl.className = oEl.className.replace('simple-pace-active', ''); - oEl.className += ' simple-pace-inactive'; - }, 500); - } - else if (100 > this.progress && this.done) - { - this.done = false; - this.startAddInterval(); - - oEl.className = oEl.className.replace('simple-pace-inactive', ''); - oEl.className += ' simple-pace-inactive'; - } - else if (100 > this.progress && !this.done && 0 === this.addInterval) - { - this.startAddInterval(); - } - }; - - if (!window['SimplePace']) - { - var oBar = new Bar(); - window['SimplePace'] = { - 'sleep': function () { - oBar.setSpeed(2, 95); - }, - 'set': function (iValue) { - oBar.update(iValue); - }, - 'add': function (iValue) { - oBar.add(iValue); - } - }; - } -}(window)); - diff --git a/vendors/simple-pace/styles.css b/vendors/simple-pace/styles.css deleted file mode 100644 index cdf28dc21..000000000 --- a/vendors/simple-pace/styles.css +++ /dev/null @@ -1,71 +0,0 @@ -.simple-pace { - -webkit-pointer-events: none; - pointer-events: none; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; -} - -.simple-pace-inactive { - display: none; -} - -.simple-pace .simple-pace-progress { - background-color: #939595; - position: fixed; - z-index: 2000; - top: 0; - left: 0; - height: 3px; - overflow: hidden; - - -webkit-transition: width .5s; - -moz-transition: width .5s; - -o-transition: width .5s; - transition: width .5s; -} - -.simple-pace .simple-pace-progress-inner { - position: absolute; - top: 0; - left: 0; - right: -32px; - bottom: 0; - - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.3)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.3)), color-stop(0.75, rgba(255, 255, 255, 0.3)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); - -webkit-background-size: 32px 32px; - -moz-background-size: 32px 32px; - -o-background-size: 32px 32px; - background-size: 32px 32px; - - -webkit-animation: simple-pace-stripe-animation 500ms linear infinite; - -moz-animation: simple-pace-stripe-animation 500ms linear infinite; - -ms-animation: simple-pace-stripe-animation 500ms linear infinite; - -o-animation: simple-pace-stripe-animation 500ms linear infinite; - animation: simple-pace-stripe-animation 500ms linear infinite; -} - -@-webkit-keyframes simple-pace-stripe-animation { - 0% { -webkit-transform: none; transform: none; } - 100% { -webkit-transform: translate(-32px, 0); transform: translate(-32px, 0); } -} -@-moz-keyframes simple-pace-stripe-animation { - 0% { -moz-transform: none; transform: none; } - 100% { -moz-transform: translate(-32px, 0); transform: translate(-32px, 0); } -} -@-o-keyframes simple-pace-stripe-animation { - 0% { -o-transform: none; transform: none; } - 100% { -o-transform: translate(-32px, 0); transform: translate(-32px, 0); } -} -@-ms-keyframes simple-pace-stripe-animation { - 0% { -ms-transform: none; transform: none; } - 100% { -ms-transform: translate(-32px, 0); transform: translate(-32px, 0); } -} -@keyframes simple-pace-stripe-animation { - 0% { transform: none; transform: none; } - 100% { transform: translate(-32px, 0); transform: translate(-32px, 0); } -} \ No newline at end of file diff --git a/vendors/ssm/CNAME b/vendors/ssm/CNAME deleted file mode 100644 index 352b9d41b..000000000 --- a/vendors/ssm/CNAME +++ /dev/null @@ -1 +0,0 @@ -www.simplestatemanager.com \ No newline at end of file diff --git a/vendors/ssm/README.md b/vendors/ssm/README.md deleted file mode 100644 index 5733dce3b..000000000 --- a/vendors/ssm/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# Simple State Manager - -[![Build Status](https://travis-ci.org/SimpleStateManager/SimpleStateManager.png?branch=master)](https://travis-ci.org/SimpleStateManager/SimpleStateManager) - -Simple State Manager (SSM for short) is a javascript state manager for responsive websites. It is built to be light weight, has no dependencies (except javascript of course) and aims to be really easy to simply drop into your project ready to use. - -As a state manager, SSM allows you to target different javascript towards different states of your site. It allows you to define as many states as your site requires and allows you to have independent Enter, Leave and Resize events for each of the states. - -##Getting started - -To get started with SSM the first step is to include it in your project, you can do this in two ways - -* Download and add the ssm.js (or ssm.min.js) file to your site -* Use Bower to add to your project using bower install SimpleStateManager - -##Documentation -Documentation can be found at http://www.simplestatemanager.com - -##Release Log - -###2.1.0 - December 23, 2013 -* Added config option API which allows you to add your own SimpleStateManager config options along with the test to see if they are valid -* Rewrote how testing of minWidth and maxWidth is handled to use the new config option API -* Added new unit tests to improve code coverage - -###2.0.3 - October 7, 2013 -* Fixed issue where browser width was not updated correctly - -###2.0.2 - September 26, 2013 -* Fixed issue where leave events fired incorrectly - -###2.0.1 - September 18, 2013 -* Fixed issue where ssm.js could not be placed in the head of the document - -###2.0.0 - September 13, 2013 -* Major API changes to all states mangement methods, please read through the new API documention if upgrading -* Ability to overlap your states -* Debug mode removed - replaced with a new debug tool (currently early alpha) which will continue to be expanded to allow better responsive debugging -* Define min-width and max-width values for each state -* Easier to extend SSM (it is now encouraged) - -###1.3.0 - August 10, 2013 -* Added .removeStates method -* Added unit tests using QUnit -* Integrated Travis CI - -###1.2.0 - August 9, 2013 -* Added .getState method - -###1.1.0 - August 9, 2013 -* Added .removeAllStates method - -###1.0.2 - August 6, 2013 -* AMD Support -* Replaced Debounce with timeout -* New Site - -###1.0.1 - Jun 24, 2013 -* Added Debounce to SSM (Thanks Kevin) - -###1.0.0 - Jun 22, 2013 -* Initial release - -## Planned Features - -* Improve documentation - -## License - -License: MIT (http://www.opensource.org/licenses/mit-license.php) diff --git a/vendors/ssm/bower.json b/vendors/ssm/bower.json deleted file mode 100644 index a51b097f3..000000000 --- a/vendors/ssm/bower.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "SimpleStateManager", - "version": "2.1.0", - "main": "src/ssm.js", - "ignore": [ - "**/.*", - "node_modules", - "components" - ], - "devDependencies": { - "sass-bootstrap": "~2.3.2", - "jquery": "~1.10.2", - "modernizr": "~2.6.2", - "respond": "~1.3.0" - } -} diff --git a/vendors/ssm/eslint.json b/vendors/ssm/eslint.json deleted file mode 100644 index b40eec27c..000000000 --- a/vendors/ssm/eslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "rules": { - "no-use-before-define": 0, - "strict": 2 - } -} \ No newline at end of file diff --git a/vendors/ssm/package.json b/vendors/ssm/package.json deleted file mode 100644 index fb070f4f9..000000000 --- a/vendors/ssm/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "SimpleStateManager", - "description": "SimpleStateManager ==================", - "version": "2.1.0", - "main": "src/ssm.js", - "scripts": { - "test": "grunt travis --verbose" - }, - "repository": { - "type": "git", - "url": "https://jonathan-fielding@github.com/jonathan-fielding/SimpleStateManager.git" - }, - "keywords": [ - "Responsive", - "State", - "Resize" - ], - "author": "Jonathan Fielding", - "contributors": [ - { - "name": "Iszak Bryan", - "url": "http://iszak.net/" - }, - { - "name": "Jonathan Fielding", - "url": "http://www.jonathanfielding.com" - } - ], - "license": "MIT", - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-qunit": "~0.2.2", - "grunt-contrib-watch": "~0.5.2", - "grunt-contrib-uglify": "~0.2.2", - "grunt-cli": "~0.1.6", - "grunt-contrib-compass": "~0.5.0", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-jshint": "~0.7.2" - } -} diff --git a/vendors/ssm/ssm.js b/vendors/ssm/ssm.js deleted file mode 100644 index eadc12c76..000000000 --- a/vendors/ssm/ssm.js +++ /dev/null @@ -1,348 +0,0 @@ -/*global window document clearTimeout setTimeout */ - -;(function (window, document, undefined) { - "use strict"; - - var ssm = {}, - states = [], - browserWidth = 0, - currentStates = [], - resizeTimeout = 10, - resizeTimer = null, - configOptions = []; - - var browserResizeDebounce = function () { - clearTimeout(resizeTimer); - resizeTimer = setTimeout(browserResizeWrapper, resizeTimeout); - }; - - //Added wrapper for the resize method - var browserResizeWrapper = function() { - browserWidth = getWidth(); - browserResize(browserWidth); - }; - - var browserResize = function (localBrowserWidth) { - var totalStates = states.length, - totalConfigOptions = configOptions.length, - leaveMethods = [], - resizeMethods = [], - enterMethods = [], - validState = true, - tempObj = ssm; - - for (var i = 0; i < totalStates; i++) { - - validState = true; - tempObj.state = states[i]; - tempObj.browserWidth = localBrowserWidth; - - for (var j = 0; j < totalConfigOptions; j++) { - tempObj.callback = configOptions[j].test; - if(tempObj.callback() === false){ - validState = false; - break; - } - } - - if(validState){ - - if(objectInArray(currentStates, states[i])){ - resizeMethods.push(states[i].onResize); - } - else{ - currentStates.push(states[i]); - enterMethods.push(states[i].onEnter); - } - } - else{ - if(objectInArray(currentStates, states[i])){ - leaveMethods.push(states[i].onLeave); - currentStates = removeObjectInArray(currentStates,states[i]); - } - } - } - - fireAllMethodsInArray(leaveMethods); - fireAllMethodsInArray(enterMethods); - fireAllMethodsInArray(resizeMethods); - }; - - ssm.browserResize = browserResize; - - ssm.getBrowserWidth = function(){ - return browserWidth; - }; - - //Add a new state - ssm.addState = function (options) { - //Setting sensible defaults for a state - //Max width is set to 99999 for comparative purposes, is bigger than any display on market - var defaultOptions = { - id: makeID(), - minWidth: 0, - maxWidth: 99999, - onEnter: function () {}, - onLeave: function () {}, - onResize: function () {} - }; - - //Merge options with defaults - options = mergeOptions(defaultOptions, options); - - //Add state to the master states array - states.push(options); - - //Sort - states = sortByKey(states, "minWidth"); - - return this; - }; - - //Allow updating of an already added state - ssm.updateState = function (stateId, options) { - for (var i = states.length - 1; i >= 0; i--) { - if (states[i].id === stateId) { - states[i] = mergeOptions(states[i], options); - } - } - - return this; - }; - - //Find and remove the state from the array - ssm.removeState = function (stateId) { - for (var i = states.length - 1; i >= 0; i--) { - if (states[i].id === stateId) { - states.splice(i, 1); - } - } - - return this; - }; - - //Remove multiple states from an array - ssm.removeStates = function (statesArray) { - for (var i = statesArray.length - 1; i >= 0; i--) { - ssm.removeState(statesArray[i]); - } - - return this; - }; - - //Find and remove the state from the array - ssm.removeAllStates = function () { - states = currentStates = []; - - return this; - }; - - //Add multiple states from an array - ssm.addStates = function (statesArray) { - for (var i = statesArray.length - 1; i >= 0; i--) { - ssm.addState(statesArray[i]); - } - - return this; - }; - - ssm.getStates = function(idArr){ - var idCount = null, returnArr = []; - - if(typeof(idArr) === "undefined"){ - return states; - } - else{ - idCount = idArr.length; - - for (var i = 0; i < idCount; i++) { - returnArr.push(getStateByID(idArr[i])); - } - - return returnArr; - } - }; - - ssm.addConfigOption = function(options){ - var defaultOptions = { - name: "", - test: null - }; - - //Merge options with defaults - options = mergeOptions(defaultOptions, options); - - if(options.name !== "" && options.test !== null){ - configOptions.push(options); - } - }; - - ssm.getConfigOption = function(name){ - if(typeof name === "string"){ - for (var i = configOptions.length - 1; i >= 0; i--) { - if(configOptions[i].name === name){ - return configOptions[i]; - } - } - } - else{ - return configOptions; - } - }; - - ssm.removeConfigOption = function(name){ - for (var i = configOptions.length - 1; i >= 0; i--) { - if (configOptions[i].name === name) { - configOptions.splice(i, 1); - } - } - }; - - ssm.getCurrentStates = function(){ - return currentStates; - }; - - //Change the timeout before firing the resize function - ssm.setResizeTimeout = function (milliSeconds) { - resizeTimeout = milliSeconds; - }; - - //Change the timeout before firing the resize function - ssm.getResizeTimeout = function () { - return resizeTimeout; - }; - - ssm.ready = function () { - //Update browser width - browserWidth = getWidth(); - - //Attach event for resizing - if (window.attachEvent) { - window.attachEvent("onresize", browserResizeDebounce); - } else if (window.addEventListener) { - window.addEventListener("resize", browserResizeDebounce, true); - } - - browserResize(browserWidth); - - return this; - }; - - var makeID = function () { - var text = ""; - var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - - for (var i = 0; i < 10; i++) { - text += possible.charAt(Math.floor(Math.random() * possible.length)); - } - return text; - }; - - var getWidth = function () { - var x = 0; - if (typeof(document.body.clientWidth) === "number") { - // newest gen browsers - x = document.body.clientWidth; - } - else if( typeof( window.innerWidth ) === "number" ) { - //Non-IE - x = window.innerWidth; - } - else if( document.documentElement && document.documentElement.clientWidth ) { - //IE 6+ in 'standards compliant mode' - x = document.documentElement.clientWidth; - } - - return x; - }; - - - var mergeOptions = function (obj1, obj2) { - var obj3 = {}; - - for (var attrname in obj1) { - obj3[attrname] = obj1[attrname]; - } - - for (var attrname2 in obj2) { - obj3[attrname2] = obj2[attrname2]; - } - - return obj3; - }; - - - var sortByKey = function (array, key) { - return array.sort(function (a, b) { - var x = a[key]; - var y = b[key]; - return ((x < y) ? -1 : ((x > y) ? 1 : 0)); - }); - }; - - //Method to get a state based on the ID - var getStateByID = function(id){ - for (var i = states.length - 1; i >= 0; i--) { - if(states[i].id === id){ - return states[i]; - } - } - }; - - var objectInArray = function(arr, obj){ - for (var i = 0; i < arr.length; i++) { - if(arr[i] === obj){ - return true; - } - } - }; - - var removeObjectInArray = function(arr,obj){ - var length = arr.length; - - for (var i = 0; i < length; i++) { - if (arr[i] === obj) { - arr.splice(i, 1); - } - } - - return arr; - }; - - var fireAllMethodsInArray = function(arr){ - var arrLength = arr.length; - - for (var i = 0; i < arrLength; i++) { - arr[i](); - } - }; - - //define the built in methods (required for compatabilty) - ssm.addConfigOption({name:"minWidth", test: function(){ - if(typeof this.state.minWidth === "number" && this.state.minWidth <= this.browserWidth){ - return true; - } - else{ - return false; - } - }}); - - ssm.addConfigOption({name:"maxWidth", test: function(){ - if(typeof this.state.maxWidth === "number" && this.state.maxWidth >= this.browserWidth){ - return true; - } - else{ - return false; - } - }}); - - //Expose Simple State Manager - window.ssm = ssm; - - if (typeof window.define === "function" && window.define.amd) { - window.define("ssm", [], function () { - return window.ssm; - }); - } - -})(window, document); \ No newline at end of file diff --git a/vendors/ssm/ssm.min.js b/vendors/ssm/ssm.min.js deleted file mode 100644 index 39963445a..000000000 --- a/vendors/ssm/ssm.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! SimpleStateManager | license: MIT | version: 2.1.0 | build date: 2013-12-23 */ -!function(a,b){"use strict";var c={},d=[],e=0,f=[],g=10,h=null,i=[],j=function(){clearTimeout(h),h=setTimeout(k,g)},k=function(){e=n(),l(e)},l=function(a){for(var b=d.length,e=i.length,g=[],h=[],j=[],k=!0,l=c,m=0;b>m;m++){k=!0,l.state=d[m],l.browserWidth=a;for(var n=0;e>n;n++)if(l.callback=i[n].test,l.callback()===!1){k=!1;break}k?r(f,d[m])?h.push(d[m].onResize):(f.push(d[m]),j.push(d[m].onEnter)):r(f,d[m])&&(g.push(d[m].onLeave),f=s(f,d[m]))}t(g),t(j),t(h)};c.browserResize=l,c.getBrowserWidth=function(){return e},c.addState=function(a){var b={id:m(),minWidth:0,maxWidth:99999,onEnter:function(){},onLeave:function(){},onResize:function(){}};return a=o(b,a),d.push(a),d=p(d,"minWidth"),this},c.updateState=function(a,b){for(var c=d.length-1;c>=0;c--)d[c].id===a&&(d[c]=o(d[c],b));return this},c.removeState=function(a){for(var b=d.length-1;b>=0;b--)d[b].id===a&&d.splice(b,1);return this},c.removeStates=function(a){for(var b=a.length-1;b>=0;b--)c.removeState(a[b]);return this},c.removeAllStates=function(){return d=f=[],this},c.addStates=function(a){for(var b=a.length-1;b>=0;b--)c.addState(a[b]);return this},c.getStates=function(a){var b=null,c=[];if("undefined"==typeof a)return d;b=a.length;for(var e=0;b>e;e++)c.push(q(a[e]));return c},c.addConfigOption=function(a){var b={name:"",test:null};a=o(b,a),""!==a.name&&null!==a.test&&i.push(a)},c.getConfigOption=function(a){if("string"!=typeof a)return i;for(var b=i.length-1;b>=0;b--)if(i[b].name===a)return i[b]},c.removeConfigOption=function(a){for(var b=i.length-1;b>=0;b--)i[b].name===a&&i.splice(b,1)},c.getCurrentStates=function(){return f},c.setResizeTimeout=function(a){g=a},c.getResizeTimeout=function(){return g},c.ready=function(){return e=n(),a.attachEvent?a.attachEvent("onresize",j):a.addEventListener&&a.addEventListener("resize",j,!0),l(e),this};var m=function(){for(var a="",b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",c=0;10>c;c++)a+=b.charAt(Math.floor(Math.random()*b.length));return a},n=function(){var c=0;return"number"==typeof b.body.clientWidth?c=b.body.clientWidth:"number"==typeof a.innerWidth?c=a.innerWidth:b.documentElement&&b.documentElement.clientWidth&&(c=b.documentElement.clientWidth),c},o=function(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c},p=function(a,b){return a.sort(function(a,c){var d=a[b],e=c[b];return e>d?-1:d>e?1:0})},q=function(a){for(var b=d.length-1;b>=0;b--)if(d[b].id===a)return d[b]},r=function(a,b){for(var c=0;cd;d++)a[d]===b&&a.splice(d,1);return a},t=function(a){for(var b=a.length,c=0;b>c;c++)a[c]()};c.addConfigOption({name:"minWidth",test:function(){return"number"==typeof this.state.minWidth&&this.state.minWidth<=this.browserWidth?!0:!1}}),c.addConfigOption({name:"maxWidth",test:function(){return"number"==typeof this.state.maxWidth&&this.state.maxWidth>=this.browserWidth?!0:!1}}),a.ssm=c,"function"==typeof a.define&&a.define.amd&&a.define("ssm",[],function(){return a.ssm})}(window,document); \ No newline at end of file diff --git a/vendors/svg4everybody/.editorconfig b/vendors/svg4everybody/.editorconfig deleted file mode 100644 index b96bee0f5..000000000 --- a/vendors/svg4everybody/.editorconfig +++ /dev/null @@ -1,4 +0,0 @@ -[*] -end_of_line = lf -indent_style = tab -insert_final_newline = true diff --git a/vendors/svg4everybody/.jshintrc b/vendors/svg4everybody/.jshintrc deleted file mode 100644 index 154c2e761..000000000 --- a/vendors/svg4everybody/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "strict": false -} diff --git a/vendors/svg4everybody/LICENSE.md b/vendors/svg4everybody/LICENSE.md deleted file mode 100644 index 565f84e33..000000000 --- a/vendors/svg4everybody/LICENSE.md +++ /dev/null @@ -1,15 +0,0 @@ -# CC0 1.0 Universal License - -Public Domain Dedication - -The person(s) who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. - -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. - -In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights. - -Unless expressly stated otherwise, the person(s) who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law. - -When using or citing the work, you should not imply endorsement by the author or the affirmer. - -This is a [human-readable summary of the Legal Code](https://creativecommons.org/publicdomain/zero/1.0/) ([read the full text](https://creativecommons.org/publicdomain/zero/1.0/legalcode)). diff --git a/vendors/svg4everybody/README.md b/vendors/svg4everybody/README.md deleted file mode 100644 index 91ce31d0f..000000000 --- a/vendors/svg4everybody/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# SVG for Everybody - -[SVG for Everybody] is a script that adds [external spritemaps] support to otherwise [SVG-capable browsers]. - -To use **svg4everybody**, include the script in your document. - -```html - -``` - -To support IE6-8 as well, include the legacy script instead. - -```html - -``` - -The IE6-8 script needs to be included in the `` in order to shiv the **svg** and **use** elements. - -If running the standard script in IE9-11, be sure to set [X-UA-Compatible] higher than IE8. This can be done with a response header or the following meta tag. - -```html - -``` - -## Usage - -**spritemap.svg:** -```html - - CodePen - YouTube - Twitter - -``` - -This spritemap works fine in **Chrome**, **Firefox**, and **Opera**. [SVG for Everybody] polyfills the experience in **IE9-11**. - -```html - - - -``` - -![3 SVG logos](http://i.imgur.com/87Npdzn.png) - -Older browsers falls back to PNG images. - -```html - - - -``` - -Fallback PNGs point to the same location as their corresponding SVGs, only with the `#` hash replaced by a `.` dot, and with an appended `.png` extension. - -## Readability and accessibility - -Within your spritemap, each sprite may use a `` element to identify itself. - -```html -<symbol id="codepen"><title>CodePen -``` - -When this sprite is used, its title will be read aloud in [JAWS](http://www.freedomscientific.com/products/fs/JAWS-product-page.asp) and [NVDA](http://www.nvaccess.org/). Then, within your document, each sprite may use a `title` attribute to identify itself. - -```html - -``` - -This title will be read aloud in [VoiceOver](http://www.apple.com/accessibility/osx/voiceover/) and [NVDA](http://www.nvaccess.org/). At present, the `title` attribute is the only way to properly read aloud an SVG in VoiceOver. - -For maximum compatibility, both the `title` attribute in the document and the `title` element in the SVG should be used. - -ARIA roles may be used to provide even more accessibility. `role="presentation"` should be used when a sprite decorates other content. - -```html - Find me on Twitter -``` - -Alternatively, `role="img"` should be used when a sprite necessitates its own description. - -```html - -``` - -### Futher reading - -- [Tips for creating accessible SVG](https://www.sitepoint.com/tips-accessible-svg/) -- [Using ARIA to enhance SVG accessibility](http://blog.paciellogroup.com/2013/12/using-aria-enhance-svg-accessibility/) -- [SVG symbol a good choice for icons](http://css-tricks.com/svg-symbol-good-choice-icons/) -- [Implementing inline SVG Icons](https://kartikprabhu.com/article/inline-svg-icons) - -## Smaller SVGs - -SVG files, especially exported from various editors, usually contains a lot of redundant and useless information such as editor metadata, comments, hidden elements, default or non-optimal values and other stuff that can be safely removed or converted without affecting SVG rendering result. - -Use a tool like [SVGO](https://github.com/svg/svgo) to optimize SVG spritemaps. - -```sh -$ [sudo] npm install -g svgo -$ svgo spritemap.svg -``` - -[external spritemaps]: http://css-tricks.com/svg-sprites-use-better-icon-fonts/##Browser+Support -[SVG-capable browsers]: http://caniuse.com/svg -[SVG for Everybody]: https://github.com/jonathantneal/svg4everybody -[X-UA-Compatible]: http://www.modern.ie/en-us/performance/how-to-use-x-ua-compatible diff --git a/vendors/svg4everybody/bower.json b/vendors/svg4everybody/bower.json deleted file mode 100644 index 28de08c26..000000000 --- a/vendors/svg4everybody/bower.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "svg4everybody", - "homepage": "https://github.com/jonathantneal/svg4everybody", - "authors": [ - "Jonathan Neal " - ], - "description": "Use external SVG spritemaps today.", - "main": ["svg4everybody.js", "svg4everybody.legacy.js"], - "keywords": [ - "svg", - "spritemaps", - "polyfill", - "ie" - ], - "repository": { - "type": "git", - "url": "git@github.com:jonathantneal/svg4everybody.git" - }, - "license": "CC0 1.0" -} diff --git a/vendors/svg4everybody/package.json b/vendors/svg4everybody/package.json deleted file mode 100644 index 2ebbeb0ce..000000000 --- a/vendors/svg4everybody/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name" : "svg4everybody", - "description" : "Use external SVG spritemaps in any browser", - "keywords" : ["svg", "sprites", "spritemaps", "symbol", "defs", "oldie", "ie8", "ie9", "safari", "external", "icon", "fallback"], - "author" : "Jonathan Neal (http://jonathantneal.com)", - "contributors" : [], - "dependencies" : [], - "main": "svg4everybody.js", - "homepage": "https://github.com/jonathantneal/svg4everybody", - "bugs": { - "url": "https://github.com/jonathantneal/svg4everybody/issues" - }, - "repository" : { - "type": "git", - "url": "git@github.com:jonathantneal/svg4everybody.git" - }, - "version" : "1.0.0" -} diff --git a/vendors/svg4everybody/svg4everybody.js b/vendors/svg4everybody/svg4everybody.js deleted file mode 100644 index 41f8ab788..000000000 --- a/vendors/svg4everybody/svg4everybody.js +++ /dev/null @@ -1,84 +0,0 @@ -/*! svg4everybody v1.0.0 | github.com/jonathantneal/svg4everybody */ -(function (document, uses, requestAnimationFrame, CACHE, IE9TO11) { - function embed(svg, g) { - if (g) { - var - viewBox = g.getAttribute('viewBox'), - fragment = document.createDocumentFragment(), - clone = g.cloneNode(true); - - if (viewBox) { - svg.setAttribute('viewBox', viewBox); - } - - while (clone.childNodes.length) { - fragment.appendChild(clone.childNodes[0]); - } - - svg.appendChild(fragment); - } - } - - function onload() { - var xhr = this, x = document.createElement('x'), s = xhr.s; - - x.innerHTML = xhr.responseText; - - xhr.onload = function () { - s.splice(0).map(function (array) { - embed(array[0], x.querySelector('#' + array[1].replace(/(\W)/g, '\\$1'))); - }); - }; - - xhr.onload(); - } - - function onframe() { - var use; - - while ((use = uses[0])) { - var - svg = use.parentNode, - url = use.getAttribute('xlink:href').split('#'), - url_root = url[0], - url_hash = url[1]; - - svg.removeChild(use); - - if (url_root.length) { - var xhr = CACHE[url_root] = CACHE[url_root] || new XMLHttpRequest(); - - if (!xhr.s) { - xhr.s = []; - - xhr.open('GET', url_root); - - xhr.onload = onload; - - xhr.send(); - } - - xhr.s.push([svg, url_hash]); - - if (xhr.readyState === 4) { - xhr.onload(); - } - - } else { - embed(svg, document.getElementById(url_hash)); - } - } - - requestAnimationFrame(onframe); - } - - if (IE9TO11) { - onframe(); - } -})( - document, - document.getElementsByTagName('use'), - window.requestAnimationFrame || window.setTimeout, - {}, - /Trident\/[567]\b/.test(navigator.userAgent) || /Edge\/12/.test(navigator.userAgent) || (navigator.userAgent.match(/AppleWebKit\/(\d+)/) || [])[1] < 538 -); diff --git a/vendors/svg4everybody/svg4everybody.legacy.js b/vendors/svg4everybody/svg4everybody.legacy.js deleted file mode 100644 index 193a7eea4..000000000 --- a/vendors/svg4everybody/svg4everybody.legacy.js +++ /dev/null @@ -1,97 +0,0 @@ -/*! svg4everybody v1.0.0 | github.com/jonathantneal/svg4everybody */ -(function (document, uses, requestAnimationFrame, CACHE, LTEIE8, IE9TO11) { - function embed(svg, g) { - if (g) { - var - viewBox = g.getAttribute('viewBox'), - fragment = document.createDocumentFragment(), - clone = g.cloneNode(true); - - if (viewBox) { - svg.setAttribute('viewBox', viewBox); - } - - while (clone.childNodes.length) { - fragment.appendChild(clone.childNodes[0]); - } - - svg.appendChild(fragment); - } - } - - function onload() { - var xhr = this, x = document.createElement('x'), s = xhr.s; - - x.innerHTML = xhr.responseText; - - xhr.onload = function () { - s.splice(0).map(function (array) { - embed(array[0], x.querySelector('#' + array[1].replace(/(\W)/g, '\\$1'))); - }); - }; - - xhr.onload(); - } - - function onframe() { - var use; - - while ((use = uses[0])) { - if (LTEIE8) { - var img = new Image(), src, q; - - src = use.getAttribute('xlink:href'); - q = (/\?[^#]+/.exec(src) || [''])[0]; - img.src = src.replace(/\?[^#]+/, '').replace('#', '.').replace(/^\./, '') + '.png' + q; - - use.parentNode.replaceChild(img, use); - } else { - var - svg = use.parentNode, - url = use.getAttribute('xlink:href').split('#'), - url_root = url[0], - url_hash = url[1]; - - svg.removeChild(use); - - if (url_root.length) { - var xhr = CACHE[url_root] = CACHE[url_root] || new XMLHttpRequest(); - - if (!xhr.s) { - xhr.s = []; - - xhr.open('GET', url_root); - - xhr.onload = onload; - - xhr.send(); - } - - xhr.s.push([svg, url_hash]); - - if (xhr.readyState === 4) { - xhr.onload(); - } - - } else { - embed(svg, document.getElementById(url_hash)); - } - } - } - - requestAnimationFrame(onframe); - } - - if (LTEIE8 || IE9TO11) { - onframe(); - } -})( - document, - document.getElementsByTagName('use'), - window.requestAnimationFrame || window.setTimeout, - {}, - /MSIE\s[1-8]\b/.test(navigator.userAgent), - /Trident\/[567]\b/.test(navigator.userAgent) || /Edge\/12/.test(navigator.userAgent) || (navigator.userAgent.match(/AppleWebKit\/(\d+)/) || [])[1] < 538, - document.createElement('svg'), - document.createElement('use') -); diff --git a/vendors/tinycon/LICENSE b/vendors/tinycon/LICENSE deleted file mode 100644 index fdb4f08c8..000000000 --- a/vendors/tinycon/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Tom Moor - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendors/tinycon/README.md b/vendors/tinycon/README.md deleted file mode 100644 index 80dac2627..000000000 --- a/vendors/tinycon/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# Tinycon - -A small library for manipulating the favicon, in particular adding alert bubbles and changing images. Tinycon gracefully falls back to a number in title approach for browers that don't support canvas or dynamic favicons. - - - -See the Live Demo here. - -## Documentation - -Tinycon adds a single object to the global namespace and does not require initialisation. - -### Basic Usage - -```javascript -Tinycon.setBubble(6); -``` - -### Options - -Tinycon can take a range of options to customise the look - -* width: the width of the alert bubble -* height: the height of the alert bubble -* font: a css string to use for the fontface (recommended to leave this) -* colour: the foreground font colour -* background: the alert bubble background colour -* fallback: should we fallback to a number in brackets for browsers that don't support canvas/dynamic favicons? Boolean, or use the string 'force' to ensure a title update even in supported browsers. -* abbreviate: should tinycon shrink large numbers such as 1000 to an abbreviated version (1k). Boolean, defaults to true - -```javascript -Tinycon.setOptions({ - width: 7, - height: 9, - font: '10px arial', - colour: '#ffffff', - background: '#549A2F', - fallback: true -}); -``` - -### AMD support - -Tinycon can also be used as an asynchronous module. - -```javascript -require([ - 'tinycon.js' -], function (T) { - - T.setOptions({ - width: 7, - height: 9, - font: '10px arial', - colour: '#ffffff', - background: '#549A2F', - fallback: true - }); - - T.setBubble(7); - -}); -``` - -## Browser Support - -Tinycon has been tested to work completely in the following browsers. Older versions may be supported, but haven't been tested: - -* Chrome 15+ -* Firefox 9+ -* Opera 11+ - -Currently the library degrades to title update: - -* Internet Explorer 9 -* Safari 5 - - -## License / Credits - -Tinycon is released under the MIT license. It is simple and easy to understand and places almost no restrictions on what you can do with Tinycon. -[More Information](http://en.wikipedia.org/wiki/MIT_License) - -Tinycon was inspired by [Notificon](https://github.com/makeable/Notificon) - - -## Download - -Releases are available for download from -[GitHub](http://github.com/tommoor/tinycon/downloads). diff --git a/vendors/tinycon/tinycon.js b/vendors/tinycon/tinycon.js deleted file mode 100644 index 3955fb3c7..000000000 --- a/vendors/tinycon/tinycon.js +++ /dev/null @@ -1,279 +0,0 @@ -/*! - * Tinycon - A small library for manipulating the Favicon - * Tom Moor, http://tommoor.com - * Copyright (c) 2012 Tom Moor - * @license MIT Licensed - * @version 0.6.3 - */ - -(function(){ - - var Tinycon = {}; - var currentFavicon = null; - var originalFavicon = null; - var faviconImage = null; - var canvas = null; - var options = {}; - var r = window.devicePixelRatio || 1; - var size = 16 * r; - var defaults = { - width: 7, - height: 9, - font: 10 * r + 'px arial', - colour: '#ffffff', - background: '#F03D25', - fallback: true, - crossOrigin: true, - abbreviate: true - }; - - var ua = (function () { - var agent = navigator.userAgent.toLowerCase(); - // New function has access to 'agent' via closure - return function (browser) { - return agent.indexOf(browser) !== -1; - }; - }()); - - var browser = { - ie: ua('msie'), - chrome: ua('chrome'), - webkit: ua('chrome') || ua('safari'), - safari: ua('safari') && !ua('chrome'), - mozilla: ua('mozilla') && !ua('chrome') && !ua('safari') - }; - - // private methods - var getFaviconTag = function(){ - - var links = document.getElementsByTagName('link'); - - for(var i=0, len=links.length; i < len; i++) { - if ((links[i].getAttribute('rel') || '').match(/\bicon\b/)) { - return links[i]; - } - } - - return false; - }; - - var removeFaviconTag = function(){ - - var links = document.getElementsByTagName('link'); - var head = document.getElementsByTagName('head')[0]; - - for(var i=0, len=links.length; i < len; i++) { - var exists = (typeof(links[i]) !== 'undefined'); - if (exists && (links[i].getAttribute('rel') || '').match(/\bicon\b/)) { - head.removeChild(links[i]); - } - } - }; - - var getCurrentFavicon = function(){ - - if (!originalFavicon || !currentFavicon) { - var tag = getFaviconTag(); - originalFavicon = currentFavicon = tag ? tag.getAttribute('href') : '/favicon.ico'; - } - - return currentFavicon; - }; - - var getCanvas = function (){ - - if (!canvas) { - canvas = document.createElement("canvas"); - canvas.width = size; - canvas.height = size; - } - - return canvas; - }; - - var setFaviconTag = function(url){ - removeFaviconTag(); - - var link = document.createElement('link'); - link.type = 'image/x-icon'; - link.rel = 'icon'; - link.href = url; - document.getElementsByTagName('head')[0].appendChild(link); - }; - - var log = function(message){ - if (window.console) window.console.log(message); - }; - - var drawFavicon = function(label, colour) { - - // fallback to updating the browser title if unsupported - if (!getCanvas().getContext || browser.ie || browser.safari || options.fallback === 'force') { - return updateTitle(label); - } - - var context = getCanvas().getContext("2d"); - var colour = colour || '#000000'; - var src = getCurrentFavicon(); - - faviconImage = document.createElement('img'); - faviconImage.onload = function() { - - // clear canvas - context.clearRect(0, 0, size, size); - - // draw the favicon - context.drawImage(faviconImage, 0, 0, faviconImage.width, faviconImage.height, 0, 0, size, size); - - // draw bubble over the top - if ((label + '').length > 0) drawBubble(context, label, colour); - - // refresh tag in page - refreshFavicon(); - }; - - // allow cross origin resource requests if the image is not a data:uri - // as detailed here: https://github.com/mrdoob/three.js/issues/1305 - if (!src.match(/^data/) && options.crossOrigin) { - faviconImage.crossOrigin = 'anonymous'; - } - - faviconImage.src = src; - }; - - var updateTitle = function(label) { - - if (options.fallback) { - // Grab the current title that we can prefix with the label - var originalTitle = document.title; - - // Strip out the old label if there is one - if (originalTitle[0] === '(') { - originalTitle = originalTitle.slice(originalTitle.indexOf(' ')); - } - - if ((label + '').length > 0) { - document.title = '(' + label + ') ' + originalTitle; - } else { - document.title = originalTitle; - } - } - }; - - var drawBubble = function(context, label, colour) { - - // automatic abbreviation for long (>2 digits) numbers - if (typeof label == 'number' && label > 99 && options.abbreviate) { - label = abbreviateNumber(label); - } - - // bubble needs to be larger for double digits - var len = (label + '').length-1; - - var width = options.width * r + (6 * r * len), - height = options.height * r; - - var top = size - height, - left = size - width - r, - bottom = 16 * r, - right = 16 * r, - radius = 2 * r; - - // webkit seems to render fonts lighter than firefox - context.font = (browser.webkit ? 'bold ' : '') + options.font; - context.fillStyle = options.background; - context.strokeStyle = options.background; - context.lineWidth = r; - - // bubble - context.beginPath(); - context.moveTo(left + radius, top); - context.quadraticCurveTo(left, top, left, top + radius); - context.lineTo(left, bottom - radius); - context.quadraticCurveTo(left, bottom, left + radius, bottom); - context.lineTo(right - radius, bottom); - context.quadraticCurveTo(right, bottom, right, bottom - radius); - context.lineTo(right, top + radius); - context.quadraticCurveTo(right, top, right - radius, top); - context.closePath(); - context.fill(); - - // bottom shadow - context.beginPath(); - context.strokeStyle = "rgba(0,0,0,0.3)"; - context.moveTo(left + radius / 2.0, bottom); - context.lineTo(right - radius / 2.0, bottom); - context.stroke(); - - // label - context.fillStyle = options.colour; - context.textAlign = "right"; - context.textBaseline = "top"; - - // unfortunately webkit/mozilla are a pixel different in text positioning - context.fillText(label, r === 2 ? 29 : 15, browser.mozilla ? 7*r : 6*r); - }; - - var refreshFavicon = function(){ - // check support - if (!getCanvas().getContext) return; - - setFaviconTag(getCanvas().toDataURL()); - }; - - var abbreviateNumber = function(label) { - var metricPrefixes = [ - ['G', 1000000000], - ['M', 1000000], - ['k', 1000] - ]; - - for(var i = 0; i < metricPrefixes.length; ++i) { - if (label >= metricPrefixes[i][1]) { - label = round(label / metricPrefixes[i][1]) + metricPrefixes[i][0]; - break; - } - } - - return label; - }; - - var round = function (value, precision) { - var number = new Number(value); - return number.toFixed(precision); - }; - - // public methods - Tinycon.setOptions = function(custom){ - options = {}; - - for(var key in defaults){ - options[key] = custom.hasOwnProperty(key) ? custom[key] : defaults[key]; - } - return this; - }; - - Tinycon.setImage = function(url){ - currentFavicon = url; - refreshFavicon(); - return this; - }; - - Tinycon.setBubble = function(label, colour) { - label = label || ''; - drawFavicon(label, colour); - return this; - }; - - Tinycon.reset = function(){ - setFaviconTag(originalFavicon); - }; - - Tinycon.setOptions(defaults); - window.Tinycon = Tinycon; - - if(typeof define === 'function' && define.amd) { - define(Tinycon); - } - -})(); diff --git a/vendors/tinycon/tinycon.min.js b/vendors/tinycon/tinycon.min.js deleted file mode 100644 index 283f511ca..000000000 --- a/vendors/tinycon/tinycon.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - Tinycon - A small library for manipulating the Favicon - Tom Moor, http://tommoor.com - Copyright (c) 2012 Tom Moor - @license MIT Licensed - @version 0.6.3 -*/ -(function(){var Tinycon={};var currentFavicon=null;var originalFavicon=null;var faviconImage=null;var canvas=null;var options={};var r=window.devicePixelRatio||1;var size=16*r;var defaults={width:7,height:9,font:10*r+'px arial',colour:'#ffffff',background:'#F03D25',fallback:true,crossOrigin:true,abbreviate:true};var ua=(function(){var agent=navigator.userAgent.toLowerCase();return function(browser){return agent.indexOf(browser)!==-1}}());var browser={ie:ua('msie'),chrome:ua('chrome'),webkit:ua('chrome')||ua('safari'),safari:ua('safari')&&!ua('chrome'),mozilla:ua('mozilla')&&!ua('chrome')&&!ua('safari')};var getFaviconTag=function(){var links=document.getElementsByTagName('link');for(var i=0,len=links.length;i0)drawBubble(context,label,colour);refreshFavicon()};if(!src.match(/^data/)&&options.crossOrigin){faviconImage.crossOrigin='anonymous'}faviconImage.src=src};var updateTitle=function(label){if(options.fallback){var originalTitle=document.title;if(originalTitle[0]==='('){originalTitle=originalTitle.slice(originalTitle.indexOf(' '))}if((label+'').length>0){document.title='('+label+') '+originalTitle}else{document.title=originalTitle}}};var drawBubble=function(context,label,colour){if(typeof label=='number'&&label>99&&options.abbreviate){label=abbreviateNumber(label)}var len=(label+'').length-1;var width=options.width*r+(6*r*len),height=options.height*r;var top=size-height,left=size-width-r,bottom=16*r,right=16*r,radius=2*r;context.font=(browser.webkit?'bold ':'')+options.font;context.fillStyle=options.background;context.strokeStyle=options.background;context.lineWidth=r;context.beginPath();context.moveTo(left+radius,top);context.quadraticCurveTo(left,top,left,top+radius);context.lineTo(left,bottom-radius);context.quadraticCurveTo(left,bottom,left+radius,bottom);context.lineTo(right-radius,bottom);context.quadraticCurveTo(right,bottom,right,bottom-radius);context.lineTo(right,top+radius);context.quadraticCurveTo(right,top,right-radius,top);context.closePath();context.fill();context.beginPath();context.strokeStyle="rgba(0,0,0,0.3)";context.moveTo(left+radius/2.0,bottom);context.lineTo(right-radius/2.0,bottom);context.stroke();context.fillStyle=options.colour;context.textAlign="right";context.textBaseline="top";context.fillText(label,r===2?29:15,browser.mozilla?7*r:6*r)};var refreshFavicon=function(){if(!getCanvas().getContext)return;setFaviconTag(getCanvas().toDataURL())};var abbreviateNumber=function(label){var metricPrefixes=[['G',1000000000],['M',1000000],['k',1000]];for(var i=0;i=metricPrefixes[i][1]){label=round(label/metricPrefixes[i][1])+metricPrefixes[i][0];break}}return label};var round=function(value,precision){var number=new Number(value);return number.toFixed(precision)};Tinycon.setOptions=function(custom){options={};for(var key in defaults){options[key]=custom.hasOwnProperty(key)?custom[key]:defaults[key]}return this};Tinycon.setImage=function(url){currentFavicon=url;refreshFavicon();return this};Tinycon.setBubble=function(label,colour){label=label||'';drawFavicon(label,colour);return this};Tinycon.reset=function(){setFaviconTag(originalFavicon)};Tinycon.setOptions(defaults);window.Tinycon=Tinycon;if(typeof define==='function'&&define.amd){define(Tinycon)}})(); \ No newline at end of file diff --git a/vendors/underscore/1.5.2/underscore-min.js b/vendors/underscore/1.5.2/underscore-min.js deleted file mode 100644 index da2258fd4..000000000 --- a/vendors/underscore/1.5.2/underscore-min.js +++ /dev/null @@ -1,5 +0,0 @@ -// Underscore.js 1.5.2 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?(this._wrapped=n,void 0):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.5.2";var A=j.each=j.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},j.findWhere=function(n,t){return j.where(n,t,!0)},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>e.computed&&(e={value:n,computed:a})}),e.value},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;ae||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={},i=null==r?j.identity:k(r);return A(t,function(r,a){var o=i.call(e,r,a,t);n(u,o,r)}),u}};j.groupBy=F(function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])=0})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:new Date,a=null,i=n.apply(e,u)};return function(){var l=new Date;o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u)):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o;return function(){i=this,u=arguments,a=new Date;var c=function(){var l=new Date-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u)))},l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u)),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=w||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var I={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};I.unescape=j.invert(I.escape);var T={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return I[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file diff --git a/vendors/underscore/1.5.2/underscore-min.map b/vendors/underscore/1.5.2/underscore-min.map deleted file mode 100644 index 4fbe0ba3c..000000000 --- a/vendors/underscore/1.5.2/underscore-min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"underscore-min.js","sources":["underscore.js"],"names":["root","this","previousUnderscore","_","breaker","ArrayProto","Array","prototype","ObjProto","Object","FuncProto","Function","push","slice","concat","toString","hasOwnProperty","nativeForEach","forEach","nativeMap","map","nativeReduce","reduce","nativeReduceRight","reduceRight","nativeFilter","filter","nativeEvery","every","nativeSome","some","nativeIndexOf","indexOf","nativeLastIndexOf","lastIndexOf","nativeIsArray","isArray","nativeKeys","keys","nativeBind","bind","obj","_wrapped","exports","module","VERSION","each","iterator","context","length","i","call","collect","results","value","index","list","reduceError","foldl","inject","memo","initial","arguments","TypeError","foldr","find","detect","result","any","select","reject","all","identity","contains","include","target","invoke","method","args","isFunc","isFunction","apply","pluck","key","where","attrs","first","isEmpty","findWhere","max","Math","Infinity","computed","min","shuffle","rand","shuffled","random","sample","n","guard","lookupIterator","sortBy","criteria","sort","left","right","a","b","group","behavior","groupBy","has","indexBy","countBy","sortedIndex","array","low","high","mid","toArray","values","size","head","take","last","rest","tail","drop","compact","flatten","input","shallow","output","isArguments","without","difference","uniq","unique","isSorted","seen","union","intersection","item","other","zip","object","from","hasIndex","range","start","stop","step","ceil","idx","ctor","func","bound","self","partial","bindAll","funcs","Error","f","memoize","hasher","delay","wait","setTimeout","defer","throttle","options","timeout","previous","later","leading","Date","now","remaining","clearTimeout","trailing","debounce","immediate","timestamp","callNow","once","ran","wrap","wrapper","compose","after","times","pairs","invert","functions","methods","names","extend","source","prop","pick","copy","omit","defaults","clone","isObject","tap","interceptor","eq","aStack","bStack","className","String","global","multiline","ignoreCase","aCtor","constructor","bCtor","pop","isEqual","isString","isElement","nodeType","name","isFinite","isNaN","parseFloat","isNumber","isBoolean","isNull","isUndefined","noConflict","accum","floor","entityMap","escape","&","<",">","\"","'","unescape","entityRegexes","RegExp","join","string","replace","match","property","mixin","idCounter","uniqueId","prefix","id","templateSettings","evaluate","interpolate","noMatch","escapes","\\","\r","\n","\t","
","
","escaper","template","text","data","settings","render","matcher","offset","variable","e","chain","_chain"],"mappings":";;;;CAKA,WAME,GAAIA,GAAOC,KAGPC,EAAqBF,EAAKG,EAG1BC,KAGAC,EAAaC,MAAMC,UAAWC,EAAWC,OAAOF,UAAWG,EAAYC,SAASJ,UAIlFK,EAAmBP,EAAWO,KAC9BC,EAAmBR,EAAWQ,MAC9BC,EAAmBT,EAAWS,OAC9BC,EAAmBP,EAASO,SAC5BC,EAAmBR,EAASQ,eAK5BC,EAAqBZ,EAAWa,QAChCC,EAAqBd,EAAWe,IAChCC,EAAqBhB,EAAWiB,OAChCC,EAAqBlB,EAAWmB,YAChCC,EAAqBpB,EAAWqB,OAChCC,EAAqBtB,EAAWuB,MAChCC,EAAqBxB,EAAWyB,KAChCC,EAAqB1B,EAAW2B,QAChCC,EAAqB5B,EAAW6B,YAChCC,EAAqB7B,MAAM8B,QAC3BC,EAAqB5B,OAAO6B,KAC5BC,EAAqB7B,EAAU8B,KAG7BrC,EAAI,SAASsC,GACf,MAAIA,aAAetC,GAAUsC,EACvBxC,eAAgBE,IACtBF,KAAKyC,SAAWD,EAAhBxC,QADiC,GAAIE,GAAEsC,GAQlB,oBAAZE,UACa,mBAAXC,SAA0BA,OAAOD,UAC1CA,QAAUC,OAAOD,QAAUxC,GAE7BwC,QAAQxC,EAAIA,GAEZH,EAAKG,EAAIA,EAIXA,EAAE0C,QAAU,OAQZ,IAAIC,GAAO3C,EAAE2C,KAAO3C,EAAEe,QAAU,SAASuB,EAAKM,EAAUC,GACtD,GAAW,MAAPP,EACJ,GAAIxB,GAAiBwB,EAAIvB,UAAYD,EACnCwB,EAAIvB,QAAQ6B,EAAUC,OACjB,IAAIP,EAAIQ,UAAYR,EAAIQ,QAC7B,IAAK,GAAIC,GAAI,EAAGD,EAASR,EAAIQ,OAAYA,EAAJC,EAAYA,IAC/C,GAAIH,EAASI,KAAKH,EAASP,EAAIS,GAAIA,EAAGT,KAASrC,EAAS,WAI1D,KAAK,GADDkC,GAAOnC,EAAEmC,KAAKG,GACTS,EAAI,EAAGD,EAASX,EAAKW,OAAYA,EAAJC,EAAYA,IAChD,GAAIH,EAASI,KAAKH,EAASP,EAAIH,EAAKY,IAAKZ,EAAKY,GAAIT,KAASrC,EAAS,OAO1ED,GAAEiB,IAAMjB,EAAEiD,QAAU,SAASX,EAAKM,EAAUC,GAC1C,GAAIK,KACJ,OAAW,OAAPZ,EAAoBY,EACpBlC,GAAasB,EAAIrB,MAAQD,EAAkBsB,EAAIrB,IAAI2B,EAAUC,IACjEF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/BH,EAAQzC,KAAKmC,EAASI,KAAKH,EAASM,EAAOC,EAAOC,MAE7CH,GAGT,IAAII,GAAc,6CAIlBtD,GAAEmB,OAASnB,EAAEuD,MAAQvD,EAAEwD,OAAS,SAASlB,EAAKM,EAAUa,EAAMZ,GAC5D,GAAIa,GAAUC,UAAUb,OAAS,CAEjC,IADW,MAAPR,IAAaA,MACbpB,GAAgBoB,EAAInB,SAAWD,EAEjC,MADI2B,KAASD,EAAW5C,EAAEqC,KAAKO,EAAUC,IAClCa,EAAUpB,EAAInB,OAAOyB,EAAUa,GAAQnB,EAAInB,OAAOyB,EAU3D,IARAD,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC1BK,EAIHD,EAAOb,EAASI,KAAKH,EAASY,EAAMN,EAAOC,EAAOC,IAHlDI,EAAON,EACPO,GAAU,MAKTA,EAAS,KAAM,IAAIE,WAAUN,EAClC,OAAOG,IAKTzD,EAAEqB,YAAcrB,EAAE6D,MAAQ,SAASvB,EAAKM,EAAUa,EAAMZ,GACtD,GAAIa,GAAUC,UAAUb,OAAS,CAEjC,IADW,MAAPR,IAAaA,MACblB,GAAqBkB,EAAIjB,cAAgBD,EAE3C,MADIyB,KAASD,EAAW5C,EAAEqC,KAAKO,EAAUC,IAClCa,EAAUpB,EAAIjB,YAAYuB,EAAUa,GAAQnB,EAAIjB,YAAYuB,EAErE,IAAIE,GAASR,EAAIQ,MACjB,IAAIA,KAAYA,EAAQ,CACtB,GAAIX,GAAOnC,EAAEmC,KAAKG,EAClBQ,GAASX,EAAKW,OAWhB,GATAH,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/BD,EAAQjB,EAAOA,IAAOW,KAAYA,EAC7BY,EAIHD,EAAOb,EAASI,KAAKH,EAASY,EAAMnB,EAAIc,GAAQA,EAAOC,IAHvDI,EAAOnB,EAAIc,GACXM,GAAU,MAKTA,EAAS,KAAM,IAAIE,WAAUN,EAClC,OAAOG,IAITzD,EAAE8D,KAAO9D,EAAE+D,OAAS,SAASzB,EAAKM,EAAUC,GAC1C,GAAImB,EAOJ,OANAC,GAAI3B,EAAK,SAASa,EAAOC,EAAOC,GAC9B,MAAIT,GAASI,KAAKH,EAASM,EAAOC,EAAOC,IACvCW,EAASb,GACF,GAFT,SAKKa,GAMThE,EAAEuB,OAASvB,EAAEkE,OAAS,SAAS5B,EAAKM,EAAUC,GAC5C,GAAIK,KACJ,OAAW,OAAPZ,EAAoBY,EACpB5B,GAAgBgB,EAAIf,SAAWD,EAAqBgB,EAAIf,OAAOqB,EAAUC,IAC7EF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC3BT,EAASI,KAAKH,EAASM,EAAOC,EAAOC,IAAOH,EAAQzC,KAAK0C,KAExDD,IAITlD,EAAEmE,OAAS,SAAS7B,EAAKM,EAAUC,GACjC,MAAO7C,GAAEuB,OAAOe,EAAK,SAASa,EAAOC,EAAOC,GAC1C,OAAQT,EAASI,KAAKH,EAASM,EAAOC,EAAOC,IAC5CR,IAML7C,EAAEyB,MAAQzB,EAAEoE,IAAM,SAAS9B,EAAKM,EAAUC,GACxCD,IAAaA,EAAW5C,EAAEqE,SAC1B,IAAIL,IAAS,CACb,OAAW,OAAP1B,EAAoB0B,EACpBxC,GAAec,EAAIb,QAAUD,EAAoBc,EAAIb,MAAMmB,EAAUC,IACzEF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,OAAMW,EAASA,GAAUpB,EAASI,KAAKH,EAASM,EAAOC,EAAOC,IAA9D,OAA6EpD,MAEtE+D,GAMX,IAAIC,GAAMjE,EAAE2B,KAAO3B,EAAEiE,IAAM,SAAS3B,EAAKM,EAAUC,GACjDD,IAAaA,EAAW5C,EAAEqE,SAC1B,IAAIL,IAAS,CACb,OAAW,OAAP1B,EAAoB0B,EACpBtC,GAAcY,EAAIX,OAASD,EAAmBY,EAAIX,KAAKiB,EAAUC,IACrEF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,MAAIW,KAAWA,EAASpB,EAASI,KAAKH,EAASM,EAAOC,EAAOC,IAAepD,EAA5E,WAEO+D,GAKXhE,GAAEsE,SAAWtE,EAAEuE,QAAU,SAASjC,EAAKkC,GACrC,MAAW,OAAPlC,GAAoB,EACpBV,GAAiBU,EAAIT,UAAYD,EAAsBU,EAAIT,QAAQ2C,KAAY,EAC5EP,EAAI3B,EAAK,SAASa,GACvB,MAAOA,KAAUqB,KAKrBxE,EAAEyE,OAAS,SAASnC,EAAKoC,GACvB,GAAIC,GAAOjE,EAAMsC,KAAKW,UAAW,GAC7BiB,EAAS5E,EAAE6E,WAAWH,EAC1B,OAAO1E,GAAEiB,IAAIqB,EAAK,SAASa,GACzB,OAAQyB,EAASF,EAASvB,EAAMuB,IAASI,MAAM3B,EAAOwB,MAK1D3E,EAAE+E,MAAQ,SAASzC,EAAK0C,GACtB,MAAOhF,GAAEiB,IAAIqB,EAAK,SAASa,GAAQ,MAAOA,GAAM6B,MAKlDhF,EAAEiF,MAAQ,SAAS3C,EAAK4C,EAAOC,GAC7B,MAAInF,GAAEoF,QAAQF,GAAeC,MAAa,MACnCnF,EAAEmF,EAAQ,OAAS,UAAU7C,EAAK,SAASa,GAChD,IAAK,GAAI6B,KAAOE,GACd,GAAIA,EAAMF,KAAS7B,EAAM6B,GAAM,OAAO,CAExC,QAAO,KAMXhF,EAAEqF,UAAY,SAAS/C,EAAK4C,GAC1B,MAAOlF,GAAEiF,MAAM3C,EAAK4C,GAAO,IAM7BlF,EAAEsF,IAAM,SAAShD,EAAKM,EAAUC,GAC9B,IAAKD,GAAY5C,EAAEiC,QAAQK,IAAQA,EAAI,MAAQA,EAAI,IAAMA,EAAIQ,OAAS,MACpE,MAAOyC,MAAKD,IAAIR,MAAMS,KAAMjD,EAE9B,KAAKM,GAAY5C,EAAEoF,QAAQ9C,GAAM,OAAQkD,GACzC,IAAIxB,IAAUyB,UAAYD,IAAUrC,OAAQqC,IAK5C,OAJA7C,GAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,GAAIoC,GAAW7C,EAAWA,EAASI,KAAKH,EAASM,EAAOC,EAAOC,GAAQF,CACvEsC,GAAWzB,EAAOyB,WAAazB,GAAUb,MAAQA,EAAOsC,SAAWA,MAE9DzB,EAAOb,OAIhBnD,EAAE0F,IAAM,SAASpD,EAAKM,EAAUC,GAC9B,IAAKD,GAAY5C,EAAEiC,QAAQK,IAAQA,EAAI,MAAQA,EAAI,IAAMA,EAAIQ,OAAS,MACpE,MAAOyC,MAAKG,IAAIZ,MAAMS,KAAMjD,EAE9B,KAAKM,GAAY5C,EAAEoF,QAAQ9C,GAAM,MAAOkD,IACxC,IAAIxB,IAAUyB,SAAWD,IAAUrC,MAAOqC,IAK1C,OAJA7C,GAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,GAAIoC,GAAW7C,EAAWA,EAASI,KAAKH,EAASM,EAAOC,EAAOC,GAAQF,CACvEsC,GAAWzB,EAAOyB,WAAazB,GAAUb,MAAQA,EAAOsC,SAAWA,MAE9DzB,EAAOb,OAKhBnD,EAAE2F,QAAU,SAASrD,GACnB,GAAIsD,GACAxC,EAAQ,EACRyC,IAMJ,OALAlD,GAAKL,EAAK,SAASa,GACjByC,EAAO5F,EAAE8F,OAAO1C,KAChByC,EAASzC,EAAQ,GAAKyC,EAASD,GAC/BC,EAASD,GAAQzC,IAEZ0C,GAMT7F,EAAE+F,OAAS,SAASzD,EAAK0D,EAAGC,GAC1B,MAAItC,WAAUb,OAAS,GAAKmD,EACnB3D,EAAItC,EAAE8F,OAAOxD,EAAIQ,OAAS,IAE5B9C,EAAE2F,QAAQrD,GAAK5B,MAAM,EAAG6E,KAAKD,IAAI,EAAGU,IAI7C,IAAIE,GAAiB,SAAS/C,GAC5B,MAAOnD,GAAE6E,WAAW1B,GAASA,EAAQ,SAASb,GAAM,MAAOA,GAAIa,IAIjEnD,GAAEmG,OAAS,SAAS7D,EAAKa,EAAON,GAC9B,GAAID,GAAWsD,EAAe/C,EAC9B,OAAOnD,GAAE+E,MAAM/E,EAAEiB,IAAIqB,EAAK,SAASa,EAAOC,EAAOC,GAC/C,OACEF,MAAOA,EACPC,MAAOA,EACPgD,SAAUxD,EAASI,KAAKH,EAASM,EAAOC,EAAOC,MAEhDgD,KAAK,SAASC,EAAMC,GACrB,GAAIC,GAAIF,EAAKF,SACTK,EAAIF,EAAMH,QACd,IAAII,IAAMC,EAAG,CACX,GAAID,EAAIC,GAAKD,QAAW,GAAG,MAAO,EAClC,IAAQC,EAAJD,GAASC,QAAW,GAAG,OAAQ,EAErC,MAAOH,GAAKlD,MAAQmD,EAAMnD,QACxB,SAIN,IAAIsD,GAAQ,SAASC,GACnB,MAAO,UAASrE,EAAKa,EAAON,GAC1B,GAAImB,MACApB,EAAoB,MAATO,EAAgBnD,EAAEqE,SAAW6B,EAAe/C,EAK3D,OAJAR,GAAKL,EAAK,SAASa,EAAOC,GACxB,GAAI4B,GAAMpC,EAASI,KAAKH,EAASM,EAAOC,EAAOd,EAC/CqE,GAAS3C,EAAQgB,EAAK7B,KAEjBa,GAMXhE,GAAE4G,QAAUF,EAAM,SAAS1C,EAAQgB,EAAK7B,IACrCnD,EAAE6G,IAAI7C,EAAQgB,GAAOhB,EAAOgB,GAAQhB,EAAOgB,OAAYvE,KAAK0C,KAK/DnD,EAAE8G,QAAUJ,EAAM,SAAS1C,EAAQgB,EAAK7B,GACtCa,EAAOgB,GAAO7B,IAMhBnD,EAAE+G,QAAUL,EAAM,SAAS1C,EAAQgB,GACjChF,EAAE6G,IAAI7C,EAAQgB,GAAOhB,EAAOgB,KAAShB,EAAOgB,GAAO,IAKrDhF,EAAEgH,YAAc,SAASC,EAAO3E,EAAKM,EAAUC,GAC7CD,EAAuB,MAAZA,EAAmB5C,EAAEqE,SAAW6B,EAAetD,EAG1D,KAFA,GAAIO,GAAQP,EAASI,KAAKH,EAASP,GAC/B4E,EAAM,EAAGC,EAAOF,EAAMnE,OACbqE,EAAND,GAAY,CACjB,GAAIE,GAAOF,EAAMC,IAAU,CAC3BvE,GAASI,KAAKH,EAASoE,EAAMG,IAAQjE,EAAQ+D,EAAME,EAAM,EAAID,EAAOC,EAEtE,MAAOF,IAITlH,EAAEqH,QAAU,SAAS/E,GACnB,MAAKA,GACDtC,EAAEiC,QAAQK,GAAa5B,EAAMsC,KAAKV,GAClCA,EAAIQ,UAAYR,EAAIQ,OAAe9C,EAAEiB,IAAIqB,EAAKtC,EAAEqE,UAC7CrE,EAAEsH,OAAOhF,OAIlBtC,EAAEuH,KAAO,SAASjF,GAChB,MAAW,OAAPA,EAAoB,EAChBA,EAAIQ,UAAYR,EAAIQ,OAAUR,EAAIQ,OAAS9C,EAAEmC,KAAKG,GAAKQ,QASjE9C,EAAEmF,MAAQnF,EAAEwH,KAAOxH,EAAEyH,KAAO,SAASR,EAAOjB,EAAGC,GAC7C,MAAa,OAATgB,MAA2B,GAClB,MAALjB,GAAcC,EAAQgB,EAAM,GAAKvG,EAAMsC,KAAKiE,EAAO,EAAGjB,IAOhEhG,EAAE0D,QAAU,SAASuD,EAAOjB,EAAGC,GAC7B,MAAOvF,GAAMsC,KAAKiE,EAAO,EAAGA,EAAMnE,QAAgB,MAALkD,GAAcC,EAAQ,EAAID,KAKzEhG,EAAE0H,KAAO,SAAST,EAAOjB,EAAGC,GAC1B,MAAa,OAATgB,MAA2B,GACrB,MAALjB,GAAcC,EACVgB,EAAMA,EAAMnE,OAAS,GAErBpC,EAAMsC,KAAKiE,EAAO1B,KAAKD,IAAI2B,EAAMnE,OAASkD,EAAG,KAQxDhG,EAAE2H,KAAO3H,EAAE4H,KAAO5H,EAAE6H,KAAO,SAASZ,EAAOjB,EAAGC,GAC5C,MAAOvF,GAAMsC,KAAKiE,EAAa,MAALjB,GAAcC,EAAQ,EAAID,IAItDhG,EAAE8H,QAAU,SAASb,GACnB,MAAOjH,GAAEuB,OAAO0F,EAAOjH,EAAEqE,UAI3B,IAAI0D,GAAU,SAASC,EAAOC,EAASC,GACrC,MAAID,IAAWjI,EAAEyB,MAAMuG,EAAOhI,EAAEiC,SACvBtB,EAAOmE,MAAMoD,EAAQF,IAE9BrF,EAAKqF,EAAO,SAAS7E,GACfnD,EAAEiC,QAAQkB,IAAUnD,EAAEmI,YAAYhF,GACpC8E,EAAUxH,EAAKqE,MAAMoD,EAAQ/E,GAAS4E,EAAQ5E,EAAO8E,EAASC,GAE9DA,EAAOzH,KAAK0C,KAGT+E,GAITlI,GAAE+H,QAAU,SAASd,EAAOgB,GAC1B,MAAOF,GAAQd,EAAOgB,OAIxBjI,EAAEoI,QAAU,SAASnB,GACnB,MAAOjH,GAAEqI,WAAWpB,EAAOvG,EAAMsC,KAAKW,UAAW,KAMnD3D,EAAEsI,KAAOtI,EAAEuI,OAAS,SAAStB,EAAOuB,EAAU5F,EAAUC,GAClD7C,EAAE6E,WAAW2D,KACf3F,EAAUD,EACVA,EAAW4F,EACXA,GAAW,EAEb,IAAI9E,GAAUd,EAAW5C,EAAEiB,IAAIgG,EAAOrE,EAAUC,GAAWoE,EACvD/D,KACAuF,IAOJ,OANA9F,GAAKe,EAAS,SAASP,EAAOC,IACxBoF,EAAapF,GAASqF,EAAKA,EAAK3F,OAAS,KAAOK,EAAUnD,EAAEsE,SAASmE,EAAMtF,MAC7EsF,EAAKhI,KAAK0C,GACVD,EAAQzC,KAAKwG,EAAM7D,OAGhBF,GAKTlD,EAAE0I,MAAQ,WACR,MAAO1I,GAAEsI,KAAKtI,EAAE+H,QAAQpE,WAAW,KAKrC3D,EAAE2I,aAAe,SAAS1B,GACxB,GAAIU,GAAOjH,EAAMsC,KAAKW,UAAW,EACjC,OAAO3D,GAAEuB,OAAOvB,EAAEsI,KAAKrB,GAAQ,SAAS2B,GACtC,MAAO5I,GAAEyB,MAAMkG,EAAM,SAASkB,GAC5B,MAAO7I,GAAE6B,QAAQgH,EAAOD,IAAS,OAOvC5I,EAAEqI,WAAa,SAASpB,GACtB,GAAIU,GAAOhH,EAAOmE,MAAM5E,EAAYQ,EAAMsC,KAAKW,UAAW,GAC1D,OAAO3D,GAAEuB,OAAO0F,EAAO,SAAS9D,GAAQ,OAAQnD,EAAEsE,SAASqD,EAAMxE,MAKnEnD,EAAE8I,IAAM,WAGN,IAAK,GAFDhG,GAAS9C,EAAEsF,IAAItF,EAAE+E,MAAMpB,UAAW,UAAUhD,OAAO,IACnDuC,EAAU,GAAI/C,OAAM2C,GACfC,EAAI,EAAOD,EAAJC,EAAYA,IAC1BG,EAAQH,GAAK/C,EAAE+E,MAAMpB,UAAW,GAAKZ,EAEvC,OAAOG,IAMTlD,EAAE+I,OAAS,SAAS1F,EAAMiE,GACxB,GAAY,MAARjE,EAAc,QAElB,KAAK,GADDW,MACKjB,EAAI,EAAGD,EAASO,EAAKP,OAAYA,EAAJC,EAAYA,IAC5CuE,EACFtD,EAAOX,EAAKN,IAAMuE,EAAOvE,GAEzBiB,EAAOX,EAAKN,GAAG,IAAMM,EAAKN,GAAG,EAGjC,OAAOiB,IASThE,EAAE6B,QAAU,SAASoF,EAAO2B,EAAMJ,GAChC,GAAa,MAATvB,EAAe,OAAQ,CAC3B,IAAIlE,GAAI,EAAGD,EAASmE,EAAMnE,MAC1B,IAAI0F,EAAU,CACZ,GAAuB,gBAAZA,GAIT,MADAzF,GAAI/C,EAAEgH,YAAYC,EAAO2B,GAClB3B,EAAMlE,KAAO6F,EAAO7F,GAAK,CAHhCA,GAAgB,EAAXyF,EAAejD,KAAKD,IAAI,EAAGxC,EAAS0F,GAAYA,EAMzD,GAAI5G,GAAiBqF,EAAMpF,UAAYD,EAAe,MAAOqF,GAAMpF,QAAQ+G,EAAMJ,EACjF,MAAW1F,EAAJC,EAAYA,IAAK,GAAIkE,EAAMlE,KAAO6F,EAAM,MAAO7F,EACtD,QAAQ,GAIV/C,EAAE+B,YAAc,SAASkF,EAAO2B,EAAMI,GACpC,GAAa,MAAT/B,EAAe,OAAQ,CAC3B,IAAIgC,GAAmB,MAARD,CACf,IAAIlH,GAAqBmF,EAAMlF,cAAgBD,EAC7C,MAAOmH,GAAWhC,EAAMlF,YAAY6G,EAAMI,GAAQ/B,EAAMlF,YAAY6G,EAGtE,KADA,GAAI7F,GAAKkG,EAAWD,EAAO/B,EAAMnE,OAC1BC,KAAK,GAAIkE,EAAMlE,KAAO6F,EAAM,MAAO7F,EAC1C,QAAQ,GAMV/C,EAAEkJ,MAAQ,SAASC,EAAOC,EAAMC,GAC1B1F,UAAUb,QAAU,IACtBsG,EAAOD,GAAS,EAChBA,EAAQ,GAEVE,EAAO1F,UAAU,IAAM,CAMvB,KAJA,GAAIb,GAASyC,KAAKD,IAAIC,KAAK+D,MAAMF,EAAOD,GAASE,GAAO,GACpDE,EAAM,EACNL,EAAQ,GAAI/I,OAAM2C,GAEVA,EAANyG,GACJL,EAAMK,KAASJ,EACfA,GAASE,CAGX,OAAOH,GAOT,IAAIM,GAAO,YAKXxJ,GAAEqC,KAAO,SAASoH,EAAM5G,GACtB,GAAI8B,GAAM+E,CACV,IAAItH,GAAcqH,EAAKpH,OAASD,EAAY,MAAOA,GAAW0C,MAAM2E,EAAM/I,EAAMsC,KAAKW,UAAW,GAChG,KAAK3D,EAAE6E,WAAW4E,GAAO,KAAM,IAAI7F,UAEnC,OADAe,GAAOjE,EAAMsC,KAAKW,UAAW,GACtB+F,EAAQ,WACb,KAAM5J,eAAgB4J,IAAQ,MAAOD,GAAK3E,MAAMjC,EAAS8B,EAAKhE,OAAOD,EAAMsC,KAAKW,YAChF6F,GAAKpJ,UAAYqJ,EAAKrJ,SACtB,IAAIuJ,GAAO,GAAIH,EACfA,GAAKpJ,UAAY,IACjB,IAAI4D,GAASyF,EAAK3E,MAAM6E,EAAMhF,EAAKhE,OAAOD,EAAMsC,KAAKW,YACrD,OAAIrD,QAAO0D,KAAYA,EAAeA,EAC/B2F,IAMX3J,EAAE4J,QAAU,SAASH,GACnB,GAAI9E,GAAOjE,EAAMsC,KAAKW,UAAW,EACjC,OAAO,YACL,MAAO8F,GAAK3E,MAAMhF,KAAM6E,EAAKhE,OAAOD,EAAMsC,KAAKW,eAMnD3D,EAAE6J,QAAU,SAASvH,GACnB,GAAIwH,GAAQpJ,EAAMsC,KAAKW,UAAW,EAClC,IAAqB,IAAjBmG,EAAMhH,OAAc,KAAM,IAAIiH,OAAM,wCAExC,OADApH,GAAKmH,EAAO,SAASE,GAAK1H,EAAI0H,GAAKhK,EAAEqC,KAAKC,EAAI0H,GAAI1H,KAC3CA,GAITtC,EAAEiK,QAAU,SAASR,EAAMS,GACzB,GAAIzG,KAEJ,OADAyG,KAAWA,EAASlK,EAAEqE,UACf,WACL,GAAIW,GAAMkF,EAAOpF,MAAMhF,KAAM6D,UAC7B,OAAO3D,GAAE6G,IAAIpD,EAAMuB,GAAOvB,EAAKuB,GAAQvB,EAAKuB,GAAOyE,EAAK3E,MAAMhF,KAAM6D,aAMxE3D,EAAEmK,MAAQ,SAASV,EAAMW,GACvB,GAAIzF,GAAOjE,EAAMsC,KAAKW,UAAW,EACjC,OAAO0G,YAAW,WAAY,MAAOZ,GAAK3E,MAAM,KAAMH,IAAUyF,IAKlEpK,EAAEsK,MAAQ,SAASb,GACjB,MAAOzJ,GAAEmK,MAAMrF,MAAM9E,GAAIyJ,EAAM,GAAG9I,OAAOD,EAAMsC,KAAKW,UAAW,MAQjE3D,EAAEuK,SAAW,SAASd,EAAMW,EAAMI,GAChC,GAAI3H,GAAS8B,EAAMX,EACfyG,EAAU,KACVC,EAAW,CACfF,KAAYA,KACZ,IAAIG,GAAQ,WACVD,EAAWF,EAAQI,WAAY,EAAQ,EAAI,GAAIC,MAC/CJ,EAAU,KACVzG,EAASyF,EAAK3E,MAAMjC,EAAS8B,GAE/B,OAAO,YACL,GAAImG,GAAM,GAAID,KACTH,IAAYF,EAAQI,WAAY,IAAOF,EAAWI,EACvD,IAAIC,GAAYX,GAAQU,EAAMJ,EAW9B,OAVA7H,GAAU/C,KACV6E,EAAOhB,UACU,GAAboH,GACFC,aAAaP,GACbA,EAAU,KACVC,EAAWI,EACX9G,EAASyF,EAAK3E,MAAMjC,EAAS8B,IACnB8F,GAAWD,EAAQS,YAAa,IAC1CR,EAAUJ,WAAWM,EAAOI,IAEvB/G,IAQXhE,EAAEkL,SAAW,SAASzB,EAAMW,EAAMe,GAChC,GAAIV,GAAS9F,EAAM9B,EAASuI,EAAWpH,CACvC,OAAO,YACLnB,EAAU/C,KACV6E,EAAOhB,UACPyH,EAAY,GAAIP,KAChB,IAAIF,GAAQ,WACV,GAAIjD,GAAO,GAAKmD,MAAUO,CACfhB,GAAP1C,EACF+C,EAAUJ,WAAWM,EAAOP,EAAO1C,IAEnC+C,EAAU,KACLU,IAAWnH,EAASyF,EAAK3E,MAAMjC,EAAS8B,MAG7C0G,EAAUF,IAAcV,CAK5B,OAJKA,KACHA,EAAUJ,WAAWM,EAAOP,IAE1BiB,IAASrH,EAASyF,EAAK3E,MAAMjC,EAAS8B,IACnCX,IAMXhE,EAAEsL,KAAO,SAAS7B,GAChB,GAAiBhG,GAAb8H,GAAM,CACV,OAAO,YACL,MAAIA,GAAY9H,GAChB8H,GAAM,EACN9H,EAAOgG,EAAK3E,MAAMhF,KAAM6D,WACxB8F,EAAO,KACAhG,KAOXzD,EAAEwL,KAAO,SAAS/B,EAAMgC,GACtB,MAAO,YACL,GAAI9G,IAAQ8E,EAEZ,OADAhJ,GAAKqE,MAAMH,EAAMhB,WACV8H,EAAQ3G,MAAMhF,KAAM6E,KAM/B3E,EAAE0L,QAAU,WACV,GAAI5B,GAAQnG,SACZ,OAAO,YAEL,IAAK,GADDgB,GAAOhB,UACFZ,EAAI+G,EAAMhH,OAAS,EAAGC,GAAK,EAAGA,IACrC4B,GAAQmF,EAAM/G,GAAG+B,MAAMhF,KAAM6E,GAE/B,OAAOA,GAAK,KAKhB3E,EAAE2L,MAAQ,SAASC,EAAOnC,GACxB,MAAO,YACL,QAAMmC,EAAQ,EACLnC,EAAK3E,MAAMhF,KAAM6D,WAD1B,SAWJ3D,EAAEmC,KAAOD,GAAc,SAASI,GAC9B,GAAIA,IAAQhC,OAAOgC,GAAM,KAAM,IAAIsB,WAAU,iBAC7C,IAAIzB,KACJ,KAAK,GAAI6C,KAAO1C,GAAStC,EAAE6G,IAAIvE,EAAK0C,IAAM7C,EAAK1B,KAAKuE,EACpD,OAAO7C,IAITnC,EAAEsH,OAAS,SAAShF,GAIlB,IAAK,GAHDH,GAAOnC,EAAEmC,KAAKG,GACdQ,EAASX,EAAKW,OACdwE,EAAS,GAAInH,OAAM2C,GACdC,EAAI,EAAOD,EAAJC,EAAYA,IAC1BuE,EAAOvE,GAAKT,EAAIH,EAAKY,GAEvB,OAAOuE,IAITtH,EAAE6L,MAAQ,SAASvJ,GAIjB,IAAK,GAHDH,GAAOnC,EAAEmC,KAAKG,GACdQ,EAASX,EAAKW,OACd+I,EAAQ,GAAI1L,OAAM2C,GACbC,EAAI,EAAOD,EAAJC,EAAYA,IAC1B8I,EAAM9I,IAAMZ,EAAKY,GAAIT,EAAIH,EAAKY,IAEhC,OAAO8I,IAIT7L,EAAE8L,OAAS,SAASxJ,GAGlB,IAAK,GAFD0B,MACA7B,EAAOnC,EAAEmC,KAAKG,GACTS,EAAI,EAAGD,EAASX,EAAKW,OAAYA,EAAJC,EAAYA,IAChDiB,EAAO1B,EAAIH,EAAKY,KAAOZ,EAAKY,EAE9B,OAAOiB,IAKThE,EAAE+L,UAAY/L,EAAEgM,QAAU,SAAS1J,GACjC,GAAI2J,KACJ,KAAK,GAAIjH,KAAO1C,GACVtC,EAAE6E,WAAWvC,EAAI0C,KAAOiH,EAAMxL,KAAKuE,EAEzC,OAAOiH,GAAM5F,QAIfrG,EAAEkM,OAAS,SAAS5J,GAQlB,MAPAK,GAAKjC,EAAMsC,KAAKW,UAAW,GAAI,SAASwI,GACtC,GAAIA,EACF,IAAK,GAAIC,KAAQD,GACf7J,EAAI8J,GAAQD,EAAOC,KAIlB9J,GAITtC,EAAEqM,KAAO,SAAS/J,GAChB,GAAIgK,MACAnK,EAAOxB,EAAOmE,MAAM5E,EAAYQ,EAAMsC,KAAKW,UAAW,GAI1D,OAHAhB,GAAKR,EAAM,SAAS6C,GACdA,IAAO1C,KAAKgK,EAAKtH,GAAO1C,EAAI0C,MAE3BsH,GAITtM,EAAEuM,KAAO,SAASjK,GAChB,GAAIgK,MACAnK,EAAOxB,EAAOmE,MAAM5E,EAAYQ,EAAMsC,KAAKW,UAAW,GAC1D,KAAK,GAAIqB,KAAO1C,GACTtC,EAAEsE,SAASnC,EAAM6C,KAAMsH,EAAKtH,GAAO1C,EAAI0C,GAE9C,OAAOsH,IAITtM,EAAEwM,SAAW,SAASlK,GAQpB,MAPAK,GAAKjC,EAAMsC,KAAKW,UAAW,GAAI,SAASwI,GACtC,GAAIA,EACF,IAAK,GAAIC,KAAQD,GACX7J,EAAI8J,SAAe,KAAG9J,EAAI8J,GAAQD,EAAOC,MAI5C9J,GAITtC,EAAEyM,MAAQ,SAASnK,GACjB,MAAKtC,GAAE0M,SAASpK,GACTtC,EAAEiC,QAAQK,GAAOA,EAAI5B,QAAUV,EAAEkM,UAAW5J,GADtBA,GAO/BtC,EAAE2M,IAAM,SAASrK,EAAKsK,GAEpB,MADAA,GAAYtK,GACLA,EAIT,IAAIuK,GAAK,SAASrG,EAAGC,EAAGqG,EAAQC,GAG9B,GAAIvG,IAAMC,EAAG,MAAa,KAAND,GAAW,EAAIA,GAAK,EAAIC,CAE5C,IAAS,MAALD,GAAkB,MAALC,EAAW,MAAOD,KAAMC,CAErCD,aAAaxG,KAAGwG,EAAIA,EAAEjE,UACtBkE,YAAazG,KAAGyG,EAAIA,EAAElE,SAE1B,IAAIyK,GAAYpM,EAASoC,KAAKwD,EAC9B,IAAIwG,GAAapM,EAASoC,KAAKyD,GAAI,OAAO,CAC1C,QAAQuG,GAEN,IAAK,kBAGH,MAAOxG,IAAKyG,OAAOxG,EACrB,KAAK,kBAGH,MAAOD,KAAMA,EAAIC,IAAMA,EAAU,GAALD,EAAS,EAAIA,GAAK,EAAIC,EAAID,IAAMC,CAC9D,KAAK,gBACL,IAAK,mBAIH,OAAQD,IAAMC,CAEhB,KAAK,kBACH,MAAOD,GAAE2F,QAAU1F,EAAE0F,QACd3F,EAAE0G,QAAUzG,EAAEyG,QACd1G,EAAE2G,WAAa1G,EAAE0G,WACjB3G,EAAE4G,YAAc3G,EAAE2G,WAE7B,GAAgB,gBAAL5G,IAA6B,gBAALC,GAAe,OAAO,CAIzD,KADA,GAAI3D,GAASgK,EAAOhK,OACbA,KAGL,GAAIgK,EAAOhK,IAAW0D,EAAG,MAAOuG,GAAOjK,IAAW2D,CAIpD,IAAI4G,GAAQ7G,EAAE8G,YAAaC,EAAQ9G,EAAE6G,WACrC,IAAID,IAAUE,KAAWvN,EAAE6E,WAAWwI,IAAWA,YAAiBA,IACzCrN,EAAE6E,WAAW0I,IAAWA,YAAiBA,IAChE,OAAO,CAGTT,GAAOrM,KAAK+F,GACZuG,EAAOtM,KAAKgG,EACZ,IAAIc,GAAO,EAAGvD,GAAS,CAEvB,IAAiB,kBAAbgJ,GAIF,GAFAzF,EAAOf,EAAE1D,OACTkB,EAASuD,GAAQd,EAAE3D,OAGjB,KAAOyE,MACCvD,EAAS6I,EAAGrG,EAAEe,GAAOd,EAAEc,GAAOuF,EAAQC,WAG3C,CAEL,IAAK,GAAI/H,KAAOwB,GACd,GAAIxG,EAAE6G,IAAIL,EAAGxB,KAEXuC,MAEMvD,EAAShE,EAAE6G,IAAIJ,EAAGzB,IAAQ6H,EAAGrG,EAAExB,GAAMyB,EAAEzB,GAAM8H,EAAQC,KAAU,KAIzE,IAAI/I,EAAQ,CACV,IAAKgB,IAAOyB,GACV,GAAIzG,EAAE6G,IAAIJ,EAAGzB,KAAUuC,IAAS,KAElCvD,IAAUuD,GAMd,MAFAuF,GAAOU,MACPT,EAAOS,MACAxJ,EAIThE,GAAEyN,QAAU,SAASjH,EAAGC,GACtB,MAAOoG,GAAGrG,EAAGC,UAKfzG,EAAEoF,QAAU,SAAS9C,GACnB,GAAW,MAAPA,EAAa,OAAO,CACxB,IAAItC,EAAEiC,QAAQK,IAAQtC,EAAE0N,SAASpL,GAAM,MAAsB,KAAfA,EAAIQ,MAClD,KAAK,GAAIkC,KAAO1C,GAAK,GAAItC,EAAE6G,IAAIvE,EAAK0C,GAAM,OAAO,CACjD,QAAO,GAIThF,EAAE2N,UAAY,SAASrL,GACrB,SAAUA,GAAwB,IAAjBA,EAAIsL,WAKvB5N,EAAEiC,QAAUD,GAAiB,SAASM,GACpC,MAA6B,kBAAtB1B,EAASoC,KAAKV,IAIvBtC,EAAE0M,SAAW,SAASpK,GACpB,MAAOA,KAAQhC,OAAOgC,IAIxBK,GAAM,YAAa,WAAY,SAAU,SAAU,OAAQ,UAAW,SAASkL,GAC7E7N,EAAE,KAAO6N,GAAQ,SAASvL,GACxB,MAAO1B,GAASoC,KAAKV,IAAQ,WAAauL,EAAO,OAMhD7N,EAAEmI,YAAYxE,aACjB3D,EAAEmI,YAAc,SAAS7F,GACvB,SAAUA,IAAOtC,EAAE6G,IAAIvE,EAAK,aAKX,kBAAV,MACTtC,EAAE6E,WAAa,SAASvC,GACtB,MAAsB,kBAARA,KAKlBtC,EAAE8N,SAAW,SAASxL,GACpB,MAAOwL,UAASxL,KAASyL,MAAMC,WAAW1L,KAI5CtC,EAAE+N,MAAQ,SAASzL,GACjB,MAAOtC,GAAEiO,SAAS3L,IAAQA,IAAQA,GAIpCtC,EAAEkO,UAAY,SAAS5L,GACrB,MAAOA,MAAQ,GAAQA,KAAQ,GAA+B,oBAAtB1B,EAASoC,KAAKV,IAIxDtC,EAAEmO,OAAS,SAAS7L,GAClB,MAAe,QAARA,GAITtC,EAAEoO,YAAc,SAAS9L,GACvB,MAAOA,SAAa,IAKtBtC,EAAE6G,IAAM,SAASvE,EAAK0C,GACpB,MAAOnE,GAAemC,KAAKV,EAAK0C,IAQlChF,EAAEqO,WAAa,WAEb,MADAxO,GAAKG,EAAID,EACFD,MAITE,EAAEqE,SAAW,SAASlB,GACpB,MAAOA,IAITnD,EAAE4L,MAAQ,SAAS5F,EAAGpD,EAAUC,GAE9B,IAAK,GADDyL,GAAQnO,MAAMoF,KAAKD,IAAI,EAAGU,IACrBjD,EAAI,EAAOiD,EAAJjD,EAAOA,IAAKuL,EAAMvL,GAAKH,EAASI,KAAKH,EAASE,EAC9D,OAAOuL,IAITtO,EAAE8F,OAAS,SAASJ,EAAKJ,GAKvB,MAJW,OAAPA,IACFA,EAAMI,EACNA,EAAM,GAEDA,EAAMH,KAAKgJ,MAAMhJ,KAAKO,UAAYR,EAAMI,EAAM,IAIvD,IAAI8I,IACFC,QACEC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,UAGTN,GAAUO,SAAW/O,EAAE8L,OAAO0C,EAAUC,OAGxC,IAAIO,IACFP,OAAU,GAAIQ,QAAO,IAAMjP,EAAEmC,KAAKqM,EAAUC,QAAQS,KAAK,IAAM,IAAK,KACpEH,SAAU,GAAIE,QAAO,IAAMjP,EAAEmC,KAAKqM,EAAUO,UAAUG,KAAK,KAAO,IAAK,KAIzElP,GAAE2C,MAAM,SAAU,YAAa,SAAS+B,GACtC1E,EAAE0E,GAAU,SAASyK,GACnB,MAAc,OAAVA,EAAuB,IACnB,GAAKA,GAAQC,QAAQJ,EAActK,GAAS,SAAS2K,GAC3D,MAAOb,GAAU9J,GAAQ2K,QAO/BrP,EAAEgE,OAAS,SAAS+E,EAAQuG,GAC1B,GAAc,MAAVvG,EAAgB,WAAY,EAChC,IAAI5F,GAAQ4F,EAAOuG,EACnB,OAAOtP,GAAE6E,WAAW1B,GAASA,EAAMH,KAAK+F,GAAU5F,GAIpDnD,EAAEuP,MAAQ,SAASjN,GACjBK,EAAK3C,EAAE+L,UAAUzJ,GAAM,SAASuL,GAC9B,GAAIpE,GAAOzJ,EAAE6N,GAAQvL,EAAIuL,EACzB7N,GAAEI,UAAUyN,GAAQ,WAClB,GAAIlJ,IAAQ7E,KAAKyC,SAEjB,OADA9B,GAAKqE,MAAMH,EAAMhB,WACVK,EAAOhB,KAAKlD,KAAM2J,EAAK3E,MAAM9E,EAAG2E,OAO7C,IAAI6K,GAAY,CAChBxP,GAAEyP,SAAW,SAASC,GACpB,GAAIC,KAAOH,EAAY,EACvB,OAAOE,GAASA,EAASC,EAAKA,GAKhC3P,EAAE4P,kBACAC,SAAc,kBACdC,YAAc,mBACdrB,OAAc,mBAMhB,IAAIsB,GAAU,OAIVC,GACFlB,IAAU,IACVmB,KAAU,KACVC,KAAU,IACVC,KAAU,IACVC,IAAU,IACVC,SAAU,QACVC,SAAU,SAGRC,EAAU,8BAKdvQ,GAAEwQ,SAAW,SAASC,EAAMC,EAAMC,GAChC,GAAIC,EACJD,GAAW3Q,EAAEwM,YAAamE,EAAU3Q,EAAE4P,iBAGtC,IAAIiB,GAAU,GAAI5B,UACf0B,EAASlC,QAAUsB,GAAS5D,QAC5BwE,EAASb,aAAeC,GAAS5D,QACjCwE,EAASd,UAAYE,GAAS5D,QAC/B+C,KAAK,KAAO,KAAM,KAGhB9L,EAAQ,EACR+I,EAAS,QACbsE,GAAKrB,QAAQyB,EAAS,SAASxB,EAAOZ,EAAQqB,EAAaD,EAAUiB,GAcnE,MAbA3E,IAAUsE,EAAK/P,MAAM0C,EAAO0N,GACzB1B,QAAQmB,EAAS,SAASlB,GAAS,MAAO,KAAOW,EAAQX,KAExDZ,IACFtC,GAAU,cAAgBsC,EAAS,kCAEjCqB,IACF3D,GAAU,cAAgB2D,EAAc,wBAEtCD,IACF1D,GAAU,OAAS0D,EAAW,YAEhCzM,EAAQ0N,EAASzB,EAAMvM,OAChBuM,IAETlD,GAAU,OAGLwE,EAASI,WAAU5E,EAAS,mBAAqBA,EAAS,OAE/DA,EAAS,2CACP,oDACAA,EAAS,eAEX,KACEyE,EAAS,GAAIpQ,UAASmQ,EAASI,UAAY,MAAO,IAAK5E,GACvD,MAAO6E,GAEP,KADAA,GAAE7E,OAASA,EACL6E,EAGR,GAAIN,EAAM,MAAOE,GAAOF,EAAM1Q,EAC9B,IAAIwQ,GAAW,SAASE,GACtB,MAAOE,GAAO5N,KAAKlD,KAAM4Q,EAAM1Q,GAMjC,OAFAwQ,GAASrE,OAAS,aAAewE,EAASI,UAAY,OAAS,OAAS5E,EAAS,IAE1EqE,GAITxQ,EAAEiR,MAAQ,SAAS3O,GACjB,MAAOtC,GAAEsC,GAAK2O,QAUhB,IAAIjN,GAAS,SAAS1B,GACpB,MAAOxC,MAAKoR,OAASlR,EAAEsC,GAAK2O,QAAU3O,EAIxCtC,GAAEuP,MAAMvP,GAGR2C,GAAM,MAAO,OAAQ,UAAW,QAAS,OAAQ,SAAU,WAAY,SAASkL,GAC9E,GAAInJ,GAASxE,EAAW2N,EACxB7N,GAAEI,UAAUyN,GAAQ,WAClB,GAAIvL,GAAMxC,KAAKyC,QAGf,OAFAmC,GAAOI,MAAMxC,EAAKqB,WACL,SAARkK,GAA2B,UAARA,GAAoC,IAAfvL,EAAIQ,cAAqBR,GAAI,GACnE0B,EAAOhB,KAAKlD,KAAMwC,MAK7BK,GAAM,SAAU,OAAQ,SAAU,SAASkL,GACzC,GAAInJ,GAASxE,EAAW2N,EACxB7N,GAAEI,UAAUyN,GAAQ,WAClB,MAAO7J,GAAOhB,KAAKlD,KAAM4E,EAAOI,MAAMhF,KAAKyC,SAAUoB,eAIzD3D,EAAEkM,OAAOlM,EAAEI,WAGT6Q,MAAO,WAEL,MADAnR,MAAKoR,QAAS,EACPpR,MAITqD,MAAO,WACL,MAAOrD,MAAKyC,cAKfS,KAAKlD"} \ No newline at end of file diff --git a/vendors/underscore/1.5.2/underscore.js b/vendors/underscore/1.5.2/underscore.js deleted file mode 100644 index 6ab229244..000000000 --- a/vendors/underscore/1.5.2/underscore.js +++ /dev/null @@ -1,1300 +0,0 @@ -// Underscore.js 1.5.2 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - //use the faster Date.now if available. - var getTime = (Date.now || function() { - return new Date().getTime(); - }); - - // Create quick reference variables for speed access to core prototypes. - var - push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.5.2'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, length = obj.length; i < length; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results.push(iterator.call(context, value, index, list)); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results.push(value); - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? void 0 : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797) - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed > result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array, using the modern version of the - // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // Sample **n** random values from a collection. - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - _.sample = function(obj, n, guard) { - if (n == null || guard) { - if (obj.length !== +obj.length) obj = _.values(obj); - return obj[_.random(obj.length - 1)]; - } - return _.shuffle(obj).slice(0, Math.max(0, n)); - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = value == null ? _.identity : lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value: value, - index: index, - criteria: iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(behavior) { - return function(obj, value, context) { - var result = {}; - var iterator = value == null ? _.identity : lookupIterator(value); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - _.indexBy = group(function(result, key, value) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = group(function(result, key) { - _.has(result, key) ? result[key]++ : result[key] = 1; - }); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely create a real, live array from anything iterable. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n == null) || guard ? array[0] : slice.call(array, 0, n); - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n == null) || guard) { - return array[array.length - 1]; - } else { - return slice.call(array, Math.max(array.length - n, 0)); - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - if (shallow && _.every(input, _.isArray)) { - return concat.apply(output, input); - } - each(input, function(value) { - if (_.isArray(value) || _.isArguments(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Flatten out an array, either recursively (by default), or just one level. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(_.flatten(arguments, true)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var length = _.max(_.pluck(arguments, "length").concat(0)); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(arguments, '' + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, length = list.length; i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, length = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < length; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(length); - - while(idx < length) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Reusable constructor function for prototype setting. - var ctor = function(){}; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - var args, bound; - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError; - args = slice.call(arguments, 2); - return bound = function() { - if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); - ctor.prototype = func.prototype; - var self = new ctor; - ctor.prototype = null; - var result = func.apply(self, args.concat(slice.call(arguments))); - if (Object(result) === result) return result; - return self; - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. - _.partial = function(func) { - var args = slice.call(arguments, 1); - return function() { - return func.apply(this, args.concat(slice.call(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) throw new Error("bindAll must be passed function names"); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - _.throttle = function(func, wait, options) { - var context, args, result; - var timeout = null; - var previous = 0; - options || (options = {}); - var later = function() { - previous = options.leading === false ? 0 : getTime(); - timeout = null; - result = func.apply(context, args); - context = args = null; - }; - return function() { - var now = getTime(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, args, context, timestamp, result; - return function() { - context = this; - args = arguments; - timestamp = getTime(); - var later = function() { - var last = getTime() - timestamp; - if (last < wait) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - context = args = null; - } - } - }; - var callNow = immediate && !timeout; - if (!timeout) { - timeout = setTimeout(later, wait); - } - if (callNow) { - result = func.apply(context, args); - context = args = null; - } - - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return _.partial(wrapper, func); - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys.push(key); - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var values = new Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = new Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; - } - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - result[obj[keys[i]]] = keys[i]; - } - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] === void 0) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor)) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(Math.max(0, n)); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named `property` is a function then invoke it with the - // `object` as context; otherwise, return it. - _.result = function(object, property) { - if (object == null) return void 0; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - - // AMD registration happens at the end for compatibility with AMD loaders - // that may not enforce next-turn semantics on modules. Even though general - // practice for AMD registration is to be anonymous, underscore registers - // as a named module because, like jQuery, it is a base library that is - // popular enough to be bundled in a third party lib, but not be part of - // an AMD load request. Those cases could generate an error when an - // anonymous define() is called outside of a loader request. - if (typeof define === 'function' && define.amd) { - define('underscore', [], function() { - return _; - }); - } -}).call(this); diff --git a/vendors/underscore/1.6.0/underscore-min.js b/vendors/underscore/1.6.0/underscore-min.js deleted file mode 100644 index 805b6a14b..000000000 --- a/vendors/underscore/1.6.0/underscore-min.js +++ /dev/null @@ -1,5 +0,0 @@ -// Underscore.js 1.6.0 -// http://underscorejs.org -// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return n;if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this); \ No newline at end of file diff --git a/vendors/underscore/1.6.0/underscore-min.map b/vendors/underscore/1.6.0/underscore-min.map deleted file mode 100644 index 47c69bad3..000000000 --- a/vendors/underscore/1.6.0/underscore-min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"underscore-min.js","sources":["underscore.js"],"names":["root","this","previousUnderscore","_","breaker","ArrayProto","Array","prototype","ObjProto","Object","FuncProto","Function","push","slice","concat","toString","hasOwnProperty","nativeForEach","forEach","nativeMap","map","nativeReduce","reduce","nativeReduceRight","reduceRight","nativeFilter","filter","nativeEvery","every","nativeSome","some","nativeIndexOf","indexOf","nativeLastIndexOf","lastIndexOf","nativeIsArray","isArray","nativeKeys","keys","nativeBind","bind","obj","_wrapped","exports","module","VERSION","each","iterator","context","length","i","call","collect","results","value","index","list","reduceError","foldl","inject","memo","initial","arguments","TypeError","foldr","find","detect","predicate","result","any","select","reject","all","identity","contains","include","target","invoke","method","args","isFunc","isFunction","apply","pluck","key","property","where","attrs","matches","findWhere","max","Math","Infinity","lastComputed","computed","min","shuffle","rand","shuffled","random","sample","n","guard","values","lookupIterator","sortBy","criteria","sort","left","right","a","b","group","behavior","groupBy","has","indexBy","countBy","sortedIndex","array","low","high","mid","toArray","size","first","head","take","last","rest","tail","drop","compact","flatten","input","shallow","output","isArguments","without","difference","partition","pass","fail","elem","uniq","unique","isSorted","seen","union","intersection","item","other","zip","object","from","hasIndex","range","start","stop","step","ceil","idx","ctor","func","bound","self","partial","boundArgs","position","bindAll","funcs","Error","f","memoize","hasher","delay","wait","setTimeout","defer","throttle","options","timeout","previous","later","leading","now","remaining","clearTimeout","trailing","debounce","immediate","timestamp","callNow","once","ran","wrap","wrapper","compose","after","times","isObject","pairs","invert","functions","methods","names","extend","source","prop","pick","copy","omit","defaults","clone","tap","interceptor","eq","aStack","bStack","className","String","global","multiline","ignoreCase","aCtor","constructor","bCtor","pop","isEqual","isEmpty","isString","isElement","nodeType","name","isFinite","isNaN","parseFloat","isNumber","isBoolean","isNull","isUndefined","noConflict","constant","accum","floor","Date","getTime","entityMap","escape","&","<",">","\"","'","unescape","entityRegexes","RegExp","join","string","replace","match","mixin","idCounter","uniqueId","prefix","id","templateSettings","evaluate","interpolate","noMatch","escapes","\\","\r","\n","\t","
","
","escaper","template","text","data","settings","render","matcher","offset","variable","e","chain","_chain","define","amd"],"mappings":";;;;CAKA,WAME,GAAIA,GAAOC,KAGPC,EAAqBF,EAAKG,EAG1BC,KAGAC,EAAaC,MAAMC,UAAWC,EAAWC,OAAOF,UAAWG,EAAYC,SAASJ,UAIlFK,EAAmBP,EAAWO,KAC9BC,EAAmBR,EAAWQ,MAC9BC,EAAmBT,EAAWS,OAC9BC,EAAmBP,EAASO,SAC5BC,EAAmBR,EAASQ,eAK5BC,EAAqBZ,EAAWa,QAChCC,EAAqBd,EAAWe,IAChCC,EAAqBhB,EAAWiB,OAChCC,EAAqBlB,EAAWmB,YAChCC,EAAqBpB,EAAWqB,OAChCC,EAAqBtB,EAAWuB,MAChCC,EAAqBxB,EAAWyB,KAChCC,EAAqB1B,EAAW2B,QAChCC,EAAqB5B,EAAW6B,YAChCC,EAAqB7B,MAAM8B,QAC3BC,EAAqB5B,OAAO6B,KAC5BC,EAAqB7B,EAAU8B,KAG7BrC,EAAI,SAASsC,GACf,MAAIA,aAAetC,GAAUsC,EACvBxC,eAAgBE,QACtBF,KAAKyC,SAAWD,GADiB,GAAItC,GAAEsC,GAQlB,oBAAZE,UACa,mBAAXC,SAA0BA,OAAOD,UAC1CA,QAAUC,OAAOD,QAAUxC,GAE7BwC,QAAQxC,EAAIA,GAEZH,EAAKG,EAAIA,EAIXA,EAAE0C,QAAU,OAQZ,IAAIC,GAAO3C,EAAE2C,KAAO3C,EAAEe,QAAU,SAASuB,EAAKM,EAAUC,GACtD,GAAW,MAAPP,EAAa,MAAOA,EACxB,IAAIxB,GAAiBwB,EAAIvB,UAAYD,EACnCwB,EAAIvB,QAAQ6B,EAAUC,OACjB,IAAIP,EAAIQ,UAAYR,EAAIQ,QAC7B,IAAK,GAAIC,GAAI,EAAGD,EAASR,EAAIQ,OAAYA,EAAJC,EAAYA,IAC/C,GAAIH,EAASI,KAAKH,EAASP,EAAIS,GAAIA,EAAGT,KAASrC,EAAS,WAI1D,KAAK,GADDkC,GAAOnC,EAAEmC,KAAKG,GACTS,EAAI,EAAGD,EAASX,EAAKW,OAAYA,EAAJC,EAAYA,IAChD,GAAIH,EAASI,KAAKH,EAASP,EAAIH,EAAKY,IAAKZ,EAAKY,GAAIT,KAASrC,EAAS,MAGxE,OAAOqC,GAKTtC,GAAEiB,IAAMjB,EAAEiD,QAAU,SAASX,EAAKM,EAAUC,GAC1C,GAAIK,KACJ,OAAW,OAAPZ,EAAoBY,EACpBlC,GAAasB,EAAIrB,MAAQD,EAAkBsB,EAAIrB,IAAI2B,EAAUC,IACjEF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/BH,EAAQzC,KAAKmC,EAASI,KAAKH,EAASM,EAAOC,EAAOC,MAE7CH,GAGT,IAAII,GAAc,6CAIlBtD,GAAEmB,OAASnB,EAAEuD,MAAQvD,EAAEwD,OAAS,SAASlB,EAAKM,EAAUa,EAAMZ,GAC5D,GAAIa,GAAUC,UAAUb,OAAS,CAEjC,IADW,MAAPR,IAAaA,MACbpB,GAAgBoB,EAAInB,SAAWD,EAEjC,MADI2B,KAASD,EAAW5C,EAAEqC,KAAKO,EAAUC,IAClCa,EAAUpB,EAAInB,OAAOyB,EAAUa,GAAQnB,EAAInB,OAAOyB,EAU3D,IARAD,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC1BK,EAIHD,EAAOb,EAASI,KAAKH,EAASY,EAAMN,EAAOC,EAAOC,IAHlDI,EAAON,EACPO,GAAU,MAKTA,EAAS,KAAM,IAAIE,WAAUN,EAClC,OAAOG,IAKTzD,EAAEqB,YAAcrB,EAAE6D,MAAQ,SAASvB,EAAKM,EAAUa,EAAMZ,GACtD,GAAIa,GAAUC,UAAUb,OAAS,CAEjC,IADW,MAAPR,IAAaA,MACblB,GAAqBkB,EAAIjB,cAAgBD,EAE3C,MADIyB,KAASD,EAAW5C,EAAEqC,KAAKO,EAAUC,IAClCa,EAAUpB,EAAIjB,YAAYuB,EAAUa,GAAQnB,EAAIjB,YAAYuB,EAErE,IAAIE,GAASR,EAAIQ,MACjB,IAAIA,KAAYA,EAAQ,CACtB,GAAIX,GAAOnC,EAAEmC,KAAKG,EAClBQ,GAASX,EAAKW,OAWhB,GATAH,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/BD,EAAQjB,EAAOA,IAAOW,KAAYA,EAC7BY,EAIHD,EAAOb,EAASI,KAAKH,EAASY,EAAMnB,EAAIc,GAAQA,EAAOC,IAHvDI,EAAOnB,EAAIc,GACXM,GAAU,MAKTA,EAAS,KAAM,IAAIE,WAAUN,EAClC,OAAOG,IAITzD,EAAE8D,KAAO9D,EAAE+D,OAAS,SAASzB,EAAK0B,EAAWnB,GAC3C,GAAIoB,EAOJ,OANAC,GAAI5B,EAAK,SAASa,EAAOC,EAAOC,GAC9B,MAAIW,GAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IACxCY,EAASd,GACF,GAFT,SAKKc,GAMTjE,EAAEuB,OAASvB,EAAEmE,OAAS,SAAS7B,EAAK0B,EAAWnB,GAC7C,GAAIK,KACJ,OAAW,OAAPZ,EAAoBY,EACpB5B,GAAgBgB,EAAIf,SAAWD,EAAqBgB,EAAIf,OAAOyC,EAAWnB,IAC9EF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC3BW,EAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IAAOH,EAAQzC,KAAK0C,KAEzDD,IAITlD,EAAEoE,OAAS,SAAS9B,EAAK0B,EAAWnB,GAClC,MAAO7C,GAAEuB,OAAOe,EAAK,SAASa,EAAOC,EAAOC,GAC1C,OAAQW,EAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IAC7CR,IAML7C,EAAEyB,MAAQzB,EAAEqE,IAAM,SAAS/B,EAAK0B,EAAWnB,GACzCmB,IAAcA,EAAYhE,EAAEsE,SAC5B,IAAIL,IAAS,CACb,OAAW,OAAP3B,EAAoB2B,EACpBzC,GAAec,EAAIb,QAAUD,EAAoBc,EAAIb,MAAMuC,EAAWnB,IAC1EF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,OAAMY,EAASA,GAAUD,EAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IAA/D,OAA8EpD,MAEvEgE,GAMX,IAAIC,GAAMlE,EAAE2B,KAAO3B,EAAEkE,IAAM,SAAS5B,EAAK0B,EAAWnB,GAClDmB,IAAcA,EAAYhE,EAAEsE,SAC5B,IAAIL,IAAS,CACb,OAAW,OAAP3B,EAAoB2B,EACpBvC,GAAcY,EAAIX,OAASD,EAAmBY,EAAIX,KAAKqC,EAAWnB,IACtEF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,MAAIY,KAAWA,EAASD,EAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IAAepD,EAA7E,WAEOgE,GAKXjE,GAAEuE,SAAWvE,EAAEwE,QAAU,SAASlC,EAAKmC,GACrC,MAAW,OAAPnC,GAAoB,EACpBV,GAAiBU,EAAIT,UAAYD,EAAsBU,EAAIT,QAAQ4C,KAAY,EAC5EP,EAAI5B,EAAK,SAASa,GACvB,MAAOA,KAAUsB,KAKrBzE,EAAE0E,OAAS,SAASpC,EAAKqC,GACvB,GAAIC,GAAOlE,EAAMsC,KAAKW,UAAW,GAC7BkB,EAAS7E,EAAE8E,WAAWH,EAC1B,OAAO3E,GAAEiB,IAAIqB,EAAK,SAASa,GACzB,OAAQ0B,EAASF,EAASxB,EAAMwB,IAASI,MAAM5B,EAAOyB,MAK1D5E,EAAEgF,MAAQ,SAAS1C,EAAK2C,GACtB,MAAOjF,GAAEiB,IAAIqB,EAAKtC,EAAEkF,SAASD,KAK/BjF,EAAEmF,MAAQ,SAAS7C,EAAK8C,GACtB,MAAOpF,GAAEuB,OAAOe,EAAKtC,EAAEqF,QAAQD,KAKjCpF,EAAEsF,UAAY,SAAShD,EAAK8C,GAC1B,MAAOpF,GAAE8D,KAAKxB,EAAKtC,EAAEqF,QAAQD,KAM/BpF,EAAEuF,IAAM,SAASjD,EAAKM,EAAUC,GAC9B,IAAKD,GAAY5C,EAAEiC,QAAQK,IAAQA,EAAI,MAAQA,EAAI,IAAMA,EAAIQ,OAAS,MACpE,MAAO0C,MAAKD,IAAIR,MAAMS,KAAMlD,EAE9B,IAAI2B,IAAUwB,IAAUC,GAAgBD,GAQxC,OAPA9C,GAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,GAAIsC,GAAW/C,EAAWA,EAASI,KAAKH,EAASM,EAAOC,EAAOC,GAAQF,CACnEwC,GAAWD,IACbzB,EAASd,EACTuC,EAAeC,KAGZ1B,GAITjE,EAAE4F,IAAM,SAAStD,EAAKM,EAAUC,GAC9B,IAAKD,GAAY5C,EAAEiC,QAAQK,IAAQA,EAAI,MAAQA,EAAI,IAAMA,EAAIQ,OAAS,MACpE,MAAO0C,MAAKI,IAAIb,MAAMS,KAAMlD,EAE9B,IAAI2B,GAASwB,IAAUC,EAAeD,GAQtC,OAPA9C,GAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,GAAIsC,GAAW/C,EAAWA,EAASI,KAAKH,EAASM,EAAOC,EAAOC,GAAQF,CACxDuC,GAAXC,IACF1B,EAASd,EACTuC,EAAeC,KAGZ1B,GAKTjE,EAAE6F,QAAU,SAASvD,GACnB,GAAIwD,GACA1C,EAAQ,EACR2C,IAMJ,OALApD,GAAKL,EAAK,SAASa,GACjB2C,EAAO9F,EAAEgG,OAAO5C,KAChB2C,EAAS3C,EAAQ,GAAK2C,EAASD,GAC/BC,EAASD,GAAQ3C,IAEZ4C,GAMT/F,EAAEiG,OAAS,SAAS3D,EAAK4D,EAAGC,GAC1B,MAAS,OAALD,GAAaC,GACX7D,EAAIQ,UAAYR,EAAIQ,SAAQR,EAAMtC,EAAEoG,OAAO9D,IACxCA,EAAItC,EAAEgG,OAAO1D,EAAIQ,OAAS,KAE5B9C,EAAE6F,QAAQvD,GAAK5B,MAAM,EAAG8E,KAAKD,IAAI,EAAGW,IAI7C,IAAIG,GAAiB,SAASlD,GAC5B,MAAa,OAATA,EAAsBnD,EAAEsE,SACxBtE,EAAE8E,WAAW3B,GAAeA,EACzBnD,EAAEkF,SAAS/B,GAIpBnD,GAAEsG,OAAS,SAAShE,EAAKM,EAAUC,GAEjC,MADAD,GAAWyD,EAAezD,GACnB5C,EAAEgF,MAAMhF,EAAEiB,IAAIqB,EAAK,SAASa,EAAOC,EAAOC,GAC/C,OACEF,MAAOA,EACPC,MAAOA,EACPmD,SAAU3D,EAASI,KAAKH,EAASM,EAAOC,EAAOC,MAEhDmD,KAAK,SAASC,EAAMC,GACrB,GAAIC,GAAIF,EAAKF,SACTK,EAAIF,EAAMH,QACd,IAAII,IAAMC,EAAG,CACX,GAAID,EAAIC,GAAKD,QAAW,GAAG,MAAO,EAClC,IAAQC,EAAJD,GAASC,QAAW,GAAG,OAAQ,EAErC,MAAOH,GAAKrD,MAAQsD,EAAMtD,QACxB,SAIN,IAAIyD,GAAQ,SAASC,GACnB,MAAO,UAASxE,EAAKM,EAAUC,GAC7B,GAAIoB,KAMJ,OALArB,GAAWyD,EAAezD,GAC1BD,EAAKL,EAAK,SAASa,EAAOC,GACxB,GAAI6B,GAAMrC,EAASI,KAAKH,EAASM,EAAOC,EAAOd,EAC/CwE,GAAS7C,EAAQgB,EAAK9B,KAEjBc,GAMXjE,GAAE+G,QAAUF,EAAM,SAAS5C,EAAQgB,EAAK9B,GACtCnD,EAAEgH,IAAI/C,EAAQgB,GAAOhB,EAAOgB,GAAKxE,KAAK0C,GAASc,EAAOgB,IAAQ9B,KAKhEnD,EAAEiH,QAAUJ,EAAM,SAAS5C,EAAQgB,EAAK9B,GACtCc,EAAOgB,GAAO9B,IAMhBnD,EAAEkH,QAAUL,EAAM,SAAS5C,EAAQgB,GACjCjF,EAAEgH,IAAI/C,EAAQgB,GAAOhB,EAAOgB,KAAShB,EAAOgB,GAAO,IAKrDjF,EAAEmH,YAAc,SAASC,EAAO9E,EAAKM,EAAUC,GAC7CD,EAAWyD,EAAezD,EAG1B,KAFA,GAAIO,GAAQP,EAASI,KAAKH,EAASP,GAC/B+E,EAAM,EAAGC,EAAOF,EAAMtE,OACbwE,EAAND,GAAY,CACjB,GAAIE,GAAOF,EAAMC,IAAU,CAC3B1E,GAASI,KAAKH,EAASuE,EAAMG,IAAQpE,EAAQkE,EAAME,EAAM,EAAID,EAAOC,EAEtE,MAAOF,IAITrH,EAAEwH,QAAU,SAASlF,GACnB,MAAKA,GACDtC,EAAEiC,QAAQK,GAAa5B,EAAMsC,KAAKV,GAClCA,EAAIQ,UAAYR,EAAIQ,OAAe9C,EAAEiB,IAAIqB,EAAKtC,EAAEsE,UAC7CtE,EAAEoG,OAAO9D,OAIlBtC,EAAEyH,KAAO,SAASnF,GAChB,MAAW,OAAPA,EAAoB,EAChBA,EAAIQ,UAAYR,EAAIQ,OAAUR,EAAIQ,OAAS9C,EAAEmC,KAAKG,GAAKQ,QASjE9C,EAAE0H,MAAQ1H,EAAE2H,KAAO3H,EAAE4H,KAAO,SAASR,EAAOlB,EAAGC,GAC7C,MAAa,OAATiB,MAA2B,GACrB,MAALlB,GAAcC,EAAciB,EAAM,GAC/B,EAAJlB,KACGxF,EAAMsC,KAAKoE,EAAO,EAAGlB,IAO9BlG,EAAE0D,QAAU,SAAS0D,EAAOlB,EAAGC,GAC7B,MAAOzF,GAAMsC,KAAKoE,EAAO,EAAGA,EAAMtE,QAAgB,MAALoD,GAAcC,EAAQ,EAAID,KAKzElG,EAAE6H,KAAO,SAAST,EAAOlB,EAAGC,GAC1B,MAAa,OAATiB,MAA2B,GACrB,MAALlB,GAAcC,EAAciB,EAAMA,EAAMtE,OAAS,GAC/CpC,EAAMsC,KAAKoE,EAAO5B,KAAKD,IAAI6B,EAAMtE,OAASoD,EAAG,KAOtDlG,EAAE8H,KAAO9H,EAAE+H,KAAO/H,EAAEgI,KAAO,SAASZ,EAAOlB,EAAGC,GAC5C,MAAOzF,GAAMsC,KAAKoE,EAAa,MAALlB,GAAcC,EAAQ,EAAID,IAItDlG,EAAEiI,QAAU,SAASb,GACnB,MAAOpH,GAAEuB,OAAO6F,EAAOpH,EAAEsE,UAI3B,IAAI4D,GAAU,SAASC,EAAOC,EAASC,GACrC,MAAID,IAAWpI,EAAEyB,MAAM0G,EAAOnI,EAAEiC,SACvBtB,EAAOoE,MAAMsD,EAAQF,IAE9BxF,EAAKwF,EAAO,SAAShF,GACfnD,EAAEiC,QAAQkB,IAAUnD,EAAEsI,YAAYnF,GACpCiF,EAAU3H,EAAKsE,MAAMsD,EAAQlF,GAAS+E,EAAQ/E,EAAOiF,EAASC,GAE9DA,EAAO5H,KAAK0C,KAGTkF,GAITrI,GAAEkI,QAAU,SAASd,EAAOgB,GAC1B,MAAOF,GAAQd,EAAOgB,OAIxBpI,EAAEuI,QAAU,SAASnB,GACnB,MAAOpH,GAAEwI,WAAWpB,EAAO1G,EAAMsC,KAAKW,UAAW,KAKnD3D,EAAEyI,UAAY,SAASrB,EAAOpD,GAC5B,GAAI0E,MAAWC,IAIf,OAHAhG,GAAKyE,EAAO,SAASwB,IAClB5E,EAAU4E,GAAQF,EAAOC,GAAMlI,KAAKmI,MAE/BF,EAAMC,IAMhB3I,EAAE6I,KAAO7I,EAAE8I,OAAS,SAAS1B,EAAO2B,EAAUnG,EAAUC,GAClD7C,EAAE8E,WAAWiE,KACflG,EAAUD,EACVA,EAAWmG,EACXA,GAAW,EAEb,IAAIrF,GAAUd,EAAW5C,EAAEiB,IAAImG,EAAOxE,EAAUC,GAAWuE,EACvDlE,KACA8F,IAOJ,OANArG,GAAKe,EAAS,SAASP,EAAOC,IACxB2F,EAAa3F,GAAS4F,EAAKA,EAAKlG,OAAS,KAAOK,EAAUnD,EAAEuE,SAASyE,EAAM7F,MAC7E6F,EAAKvI,KAAK0C,GACVD,EAAQzC,KAAK2G,EAAMhE,OAGhBF,GAKTlD,EAAEiJ,MAAQ,WACR,MAAOjJ,GAAE6I,KAAK7I,EAAEkI,QAAQvE,WAAW,KAKrC3D,EAAEkJ,aAAe,SAAS9B,GACxB,GAAIU,GAAOpH,EAAMsC,KAAKW,UAAW,EACjC,OAAO3D,GAAEuB,OAAOvB,EAAE6I,KAAKzB,GAAQ,SAAS+B,GACtC,MAAOnJ,GAAEyB,MAAMqG,EAAM,SAASsB,GAC5B,MAAOpJ,GAAEuE,SAAS6E,EAAOD,QAO/BnJ,EAAEwI,WAAa,SAASpB,GACtB,GAAIU,GAAOnH,EAAOoE,MAAM7E,EAAYQ,EAAMsC,KAAKW,UAAW,GAC1D,OAAO3D,GAAEuB,OAAO6F,EAAO,SAASjE,GAAQ,OAAQnD,EAAEuE,SAASuD,EAAM3E,MAKnEnD,EAAEqJ,IAAM,WAGN,IAAK,GAFDvG,GAAS9C,EAAEuF,IAAIvF,EAAEgF,MAAMrB,UAAW,UAAUhD,OAAO,IACnDuC,EAAU,GAAI/C,OAAM2C,GACfC,EAAI,EAAOD,EAAJC,EAAYA,IAC1BG,EAAQH,GAAK/C,EAAEgF,MAAMrB,UAAW,GAAKZ,EAEvC,OAAOG,IAMTlD,EAAEsJ,OAAS,SAASjG,EAAM+C,GACxB,GAAY,MAAR/C,EAAc,QAElB,KAAK,GADDY,MACKlB,EAAI,EAAGD,EAASO,EAAKP,OAAYA,EAAJC,EAAYA,IAC5CqD,EACFnC,EAAOZ,EAAKN,IAAMqD,EAAOrD,GAEzBkB,EAAOZ,EAAKN,GAAG,IAAMM,EAAKN,GAAG,EAGjC,OAAOkB,IASTjE,EAAE6B,QAAU,SAASuF,EAAO+B,EAAMJ,GAChC,GAAa,MAAT3B,EAAe,OAAQ,CAC3B,IAAIrE,GAAI,EAAGD,EAASsE,EAAMtE,MAC1B,IAAIiG,EAAU,CACZ,GAAuB,gBAAZA,GAIT,MADAhG,GAAI/C,EAAEmH,YAAYC,EAAO+B,GAClB/B,EAAMrE,KAAOoG,EAAOpG,GAAK,CAHhCA,GAAgB,EAAXgG,EAAevD,KAAKD,IAAI,EAAGzC,EAASiG,GAAYA,EAMzD,GAAInH,GAAiBwF,EAAMvF,UAAYD,EAAe,MAAOwF,GAAMvF,QAAQsH,EAAMJ,EACjF,MAAWjG,EAAJC,EAAYA,IAAK,GAAIqE,EAAMrE,KAAOoG,EAAM,MAAOpG,EACtD,QAAQ,GAIV/C,EAAE+B,YAAc,SAASqF,EAAO+B,EAAMI,GACpC,GAAa,MAATnC,EAAe,OAAQ,CAC3B,IAAIoC,GAAmB,MAARD,CACf,IAAIzH,GAAqBsF,EAAMrF,cAAgBD,EAC7C,MAAO0H,GAAWpC,EAAMrF,YAAYoH,EAAMI,GAAQnC,EAAMrF,YAAYoH,EAGtE,KADA,GAAIpG,GAAKyG,EAAWD,EAAOnC,EAAMtE,OAC1BC,KAAK,GAAIqE,EAAMrE,KAAOoG,EAAM,MAAOpG,EAC1C,QAAQ,GAMV/C,EAAEyJ,MAAQ,SAASC,EAAOC,EAAMC,GAC1BjG,UAAUb,QAAU,IACtB6G,EAAOD,GAAS,EAChBA,EAAQ,GAEVE,EAAOjG,UAAU,IAAM,CAMvB,KAJA,GAAIb,GAAS0C,KAAKD,IAAIC,KAAKqE,MAAMF,EAAOD,GAASE,GAAO,GACpDE,EAAM,EACNL,EAAQ,GAAItJ,OAAM2C,GAEVA,EAANgH,GACJL,EAAMK,KAASJ,EACfA,GAASE,CAGX,OAAOH,GAOT,IAAIM,GAAO,YAKX/J,GAAEqC,KAAO,SAAS2H,EAAMnH,GACtB,GAAI+B,GAAMqF,CACV,IAAI7H,GAAc4H,EAAK3H,OAASD,EAAY,MAAOA,GAAW2C,MAAMiF,EAAMtJ,EAAMsC,KAAKW,UAAW,GAChG,KAAK3D,EAAE8E,WAAWkF,GAAO,KAAM,IAAIpG,UAEnC,OADAgB,GAAOlE,EAAMsC,KAAKW,UAAW,GACtBsG,EAAQ,WACb,KAAMnK,eAAgBmK,IAAQ,MAAOD,GAAKjF,MAAMlC,EAAS+B,EAAKjE,OAAOD,EAAMsC,KAAKW,YAChFoG,GAAK3J,UAAY4J,EAAK5J,SACtB,IAAI8J,GAAO,GAAIH,EACfA,GAAK3J,UAAY,IACjB,IAAI6D,GAAS+F,EAAKjF,MAAMmF,EAAMtF,EAAKjE,OAAOD,EAAMsC,KAAKW,YACrD,OAAIrD,QAAO2D,KAAYA,EAAeA,EAC/BiG,IAOXlK,EAAEmK,QAAU,SAASH,GACnB,GAAII,GAAY1J,EAAMsC,KAAKW,UAAW,EACtC,OAAO,YAGL,IAAK,GAFD0G,GAAW,EACXzF,EAAOwF,EAAU1J,QACZqC,EAAI,EAAGD,EAAS8B,EAAK9B,OAAYA,EAAJC,EAAYA,IAC5C6B,EAAK7B,KAAO/C,IAAG4E,EAAK7B,GAAKY,UAAU0G,KAEzC,MAAOA,EAAW1G,UAAUb,QAAQ8B,EAAKnE,KAAKkD,UAAU0G,KACxD,OAAOL,GAAKjF,MAAMjF,KAAM8E,KAO5B5E,EAAEsK,QAAU,SAAShI,GACnB,GAAIiI,GAAQ7J,EAAMsC,KAAKW,UAAW,EAClC,IAAqB,IAAjB4G,EAAMzH,OAAc,KAAM,IAAI0H,OAAM,wCAExC,OADA7H,GAAK4H,EAAO,SAASE,GAAKnI,EAAImI,GAAKzK,EAAEqC,KAAKC,EAAImI,GAAInI,KAC3CA,GAITtC,EAAE0K,QAAU,SAASV,EAAMW,GACzB,GAAIlH,KAEJ,OADAkH,KAAWA,EAAS3K,EAAEsE,UACf,WACL,GAAIW,GAAM0F,EAAO5F,MAAMjF,KAAM6D,UAC7B,OAAO3D,GAAEgH,IAAIvD,EAAMwB,GAAOxB,EAAKwB,GAAQxB,EAAKwB,GAAO+E,EAAKjF,MAAMjF,KAAM6D,aAMxE3D,EAAE4K,MAAQ,SAASZ,EAAMa,GACvB,GAAIjG,GAAOlE,EAAMsC,KAAKW,UAAW,EACjC,OAAOmH,YAAW,WAAY,MAAOd,GAAKjF,MAAM,KAAMH,IAAUiG,IAKlE7K,EAAE+K,MAAQ,SAASf,GACjB,MAAOhK,GAAE4K,MAAM7F,MAAM/E,GAAIgK,EAAM,GAAGrJ,OAAOD,EAAMsC,KAAKW,UAAW,MAQjE3D,EAAEgL,SAAW,SAAShB,EAAMa,EAAMI,GAChC,GAAIpI,GAAS+B,EAAMX,EACfiH,EAAU,KACVC,EAAW,CACfF,KAAYA,KACZ,IAAIG,GAAQ,WACVD,EAAWF,EAAQI,WAAY,EAAQ,EAAIrL,EAAEsL,MAC7CJ,EAAU,KACVjH,EAAS+F,EAAKjF,MAAMlC,EAAS+B,GAC7B/B,EAAU+B,EAAO,KAEnB,OAAO,YACL,GAAI0G,GAAMtL,EAAEsL,KACPH,IAAYF,EAAQI,WAAY,IAAOF,EAAWG,EACvD,IAAIC,GAAYV,GAAQS,EAAMH,EAY9B,OAXAtI,GAAU/C,KACV8E,EAAOjB,UACU,GAAb4H,GACFC,aAAaN,GACbA,EAAU,KACVC,EAAWG,EACXrH,EAAS+F,EAAKjF,MAAMlC,EAAS+B,GAC7B/B,EAAU+B,EAAO,MACPsG,GAAWD,EAAQQ,YAAa,IAC1CP,EAAUJ,WAAWM,EAAOG,IAEvBtH,IAQXjE,EAAE0L,SAAW,SAAS1B,EAAMa,EAAMc,GAChC,GAAIT,GAAStG,EAAM/B,EAAS+I,EAAW3H,EAEnCmH,EAAQ,WACV,GAAIvD,GAAO7H,EAAEsL,MAAQM,CACVf,GAAPhD,EACFqD,EAAUJ,WAAWM,EAAOP,EAAOhD,IAEnCqD,EAAU,KACLS,IACH1H,EAAS+F,EAAKjF,MAAMlC,EAAS+B,GAC7B/B,EAAU+B,EAAO,OAKvB,OAAO,YACL/B,EAAU/C,KACV8E,EAAOjB,UACPiI,EAAY5L,EAAEsL,KACd,IAAIO,GAAUF,IAAcT,CAS5B,OARKA,KACHA,EAAUJ,WAAWM,EAAOP,IAE1BgB,IACF5H,EAAS+F,EAAKjF,MAAMlC,EAAS+B,GAC7B/B,EAAU+B,EAAO,MAGZX,IAMXjE,EAAE8L,KAAO,SAAS9B,GAChB,GAAiBvG,GAAbsI,GAAM,CACV,OAAO,YACL,MAAIA,GAAYtI,GAChBsI,GAAM,EACNtI,EAAOuG,EAAKjF,MAAMjF,KAAM6D,WACxBqG,EAAO,KACAvG,KAOXzD,EAAEgM,KAAO,SAAShC,EAAMiC,GACtB,MAAOjM,GAAEmK,QAAQ8B,EAASjC,IAK5BhK,EAAEkM,QAAU,WACV,GAAI3B,GAAQ5G,SACZ,OAAO,YAEL,IAAK,GADDiB,GAAOjB,UACFZ,EAAIwH,EAAMzH,OAAS,EAAGC,GAAK,EAAGA,IACrC6B,GAAQ2F,EAAMxH,GAAGgC,MAAMjF,KAAM8E,GAE/B,OAAOA,GAAK,KAKhB5E,EAAEmM,MAAQ,SAASC,EAAOpC,GACxB,MAAO,YACL,QAAMoC,EAAQ,EACLpC,EAAKjF,MAAMjF,KAAM6D,WAD1B,SAWJ3D,EAAEmC,KAAO,SAASG,GAChB,IAAKtC,EAAEqM,SAAS/J,GAAM,QACtB,IAAIJ,EAAY,MAAOA,GAAWI,EAClC,IAAIH,KACJ,KAAK,GAAI8C,KAAO3C,GAAStC,EAAEgH,IAAI1E,EAAK2C,IAAM9C,EAAK1B,KAAKwE,EACpD,OAAO9C,IAITnC,EAAEoG,OAAS,SAAS9D,GAIlB,IAAK,GAHDH,GAAOnC,EAAEmC,KAAKG,GACdQ,EAASX,EAAKW,OACdsD,EAAS,GAAIjG,OAAM2C,GACdC,EAAI,EAAOD,EAAJC,EAAYA,IAC1BqD,EAAOrD,GAAKT,EAAIH,EAAKY,GAEvB,OAAOqD,IAITpG,EAAEsM,MAAQ,SAAShK,GAIjB,IAAK,GAHDH,GAAOnC,EAAEmC,KAAKG,GACdQ,EAASX,EAAKW,OACdwJ,EAAQ,GAAInM,OAAM2C,GACbC,EAAI,EAAOD,EAAJC,EAAYA,IAC1BuJ,EAAMvJ,IAAMZ,EAAKY,GAAIT,EAAIH,EAAKY,IAEhC,OAAOuJ,IAITtM,EAAEuM,OAAS,SAASjK,GAGlB,IAAK,GAFD2B,MACA9B,EAAOnC,EAAEmC,KAAKG,GACTS,EAAI,EAAGD,EAASX,EAAKW,OAAYA,EAAJC,EAAYA,IAChDkB,EAAO3B,EAAIH,EAAKY,KAAOZ,EAAKY,EAE9B,OAAOkB,IAKTjE,EAAEwM,UAAYxM,EAAEyM,QAAU,SAASnK,GACjC,GAAIoK,KACJ,KAAK,GAAIzH,KAAO3C,GACVtC,EAAE8E,WAAWxC,EAAI2C,KAAOyH,EAAMjM,KAAKwE,EAEzC,OAAOyH,GAAMlG,QAIfxG,EAAE2M,OAAS,SAASrK,GAQlB,MAPAK,GAAKjC,EAAMsC,KAAKW,UAAW,GAAI,SAASiJ,GACtC,GAAIA,EACF,IAAK,GAAIC,KAAQD,GACftK,EAAIuK,GAAQD,EAAOC,KAIlBvK,GAITtC,EAAE8M,KAAO,SAASxK,GAChB,GAAIyK,MACA5K,EAAOxB,EAAOoE,MAAM7E,EAAYQ,EAAMsC,KAAKW,UAAW,GAI1D,OAHAhB,GAAKR,EAAM,SAAS8C,GACdA,IAAO3C,KAAKyK,EAAK9H,GAAO3C,EAAI2C,MAE3B8H,GAIT/M,EAAEgN,KAAO,SAAS1K,GAChB,GAAIyK,MACA5K,EAAOxB,EAAOoE,MAAM7E,EAAYQ,EAAMsC,KAAKW,UAAW,GAC1D,KAAK,GAAIsB,KAAO3C,GACTtC,EAAEuE,SAASpC,EAAM8C,KAAM8H,EAAK9H,GAAO3C,EAAI2C,GAE9C,OAAO8H,IAIT/M,EAAEiN,SAAW,SAAS3K,GAQpB,MAPAK,GAAKjC,EAAMsC,KAAKW,UAAW,GAAI,SAASiJ,GACtC,GAAIA,EACF,IAAK,GAAIC,KAAQD,GACXtK,EAAIuK,SAAe,KAAGvK,EAAIuK,GAAQD,EAAOC,MAI5CvK,GAITtC,EAAEkN,MAAQ,SAAS5K,GACjB,MAAKtC,GAAEqM,SAAS/J,GACTtC,EAAEiC,QAAQK,GAAOA,EAAI5B,QAAUV,EAAE2M,UAAWrK,GADtBA,GAO/BtC,EAAEmN,IAAM,SAAS7K,EAAK8K,GAEpB,MADAA,GAAY9K,GACLA,EAIT,IAAI+K,GAAK,SAAS1G,EAAGC,EAAG0G,EAAQC,GAG9B,GAAI5G,IAAMC,EAAG,MAAa,KAAND,GAAW,EAAIA,GAAK,EAAIC,CAE5C,IAAS,MAALD,GAAkB,MAALC,EAAW,MAAOD,KAAMC,CAErCD,aAAa3G,KAAG2G,EAAIA,EAAEpE,UACtBqE,YAAa5G,KAAG4G,EAAIA,EAAErE,SAE1B,IAAIiL,GAAY5M,EAASoC,KAAK2D,EAC9B,IAAI6G,GAAa5M,EAASoC,KAAK4D,GAAI,OAAO,CAC1C,QAAQ4G,GAEN,IAAK,kBAGH,MAAO7G,IAAK8G,OAAO7G,EACrB,KAAK,kBAGH,MAAOD,KAAMA,EAAIC,IAAMA,EAAU,GAALD,EAAS,EAAIA,GAAK,EAAIC,EAAID,IAAMC,CAC9D,KAAK,gBACL,IAAK,mBAIH,OAAQD,IAAMC,CAEhB,KAAK,kBACH,MAAOD,GAAEiG,QAAUhG,EAAEgG,QACdjG,EAAE+G,QAAU9G,EAAE8G,QACd/G,EAAEgH,WAAa/G,EAAE+G,WACjBhH,EAAEiH,YAAchH,EAAEgH,WAE7B,GAAgB,gBAALjH,IAA6B,gBAALC,GAAe,OAAO,CAIzD,KADA,GAAI9D,GAASwK,EAAOxK,OACbA,KAGL,GAAIwK,EAAOxK,IAAW6D,EAAG,MAAO4G,GAAOzK,IAAW8D,CAIpD,IAAIiH,GAAQlH,EAAEmH,YAAaC,EAAQnH,EAAEkH,WACrC,IAAID,IAAUE,KAAW/N,EAAE8E,WAAW+I,IAAWA,YAAiBA,IACzC7N,EAAE8E,WAAWiJ,IAAWA,YAAiBA,KAC1C,eAAiBpH,IAAK,eAAiBC,GAC7D,OAAO,CAGT0G,GAAO7M,KAAKkG,GACZ4G,EAAO9M,KAAKmG,EACZ,IAAIa,GAAO,EAAGxD,GAAS,CAEvB,IAAiB,kBAAbuJ,GAIF,GAFA/F,EAAOd,EAAE7D,OACTmB,EAASwD,GAAQb,EAAE9D,OAGjB,KAAO2E,MACCxD,EAASoJ,EAAG1G,EAAEc,GAAOb,EAAEa,GAAO6F,EAAQC,WAG3C,CAEL,IAAK,GAAItI,KAAO0B,GACd,GAAI3G,EAAEgH,IAAIL,EAAG1B,KAEXwC,MAEMxD,EAASjE,EAAEgH,IAAIJ,EAAG3B,IAAQoI,EAAG1G,EAAE1B,GAAM2B,EAAE3B,GAAMqI,EAAQC,KAAU,KAIzE,IAAItJ,EAAQ,CACV,IAAKgB,IAAO2B,GACV,GAAI5G,EAAEgH,IAAIJ,EAAG3B,KAAUwC,IAAS,KAElCxD,IAAUwD,GAMd,MAFA6F,GAAOU,MACPT,EAAOS,MACA/J,EAITjE,GAAEiO,QAAU,SAAStH,EAAGC,GACtB,MAAOyG,GAAG1G,EAAGC,UAKf5G,EAAEkO,QAAU,SAAS5L,GACnB,GAAW,MAAPA,EAAa,OAAO,CACxB,IAAItC,EAAEiC,QAAQK,IAAQtC,EAAEmO,SAAS7L,GAAM,MAAsB,KAAfA,EAAIQ,MAClD,KAAK,GAAImC,KAAO3C,GAAK,GAAItC,EAAEgH,IAAI1E,EAAK2C,GAAM,OAAO,CACjD,QAAO,GAITjF,EAAEoO,UAAY,SAAS9L,GACrB,SAAUA,GAAwB,IAAjBA,EAAI+L,WAKvBrO,EAAEiC,QAAUD,GAAiB,SAASM,GACpC,MAA6B,kBAAtB1B,EAASoC,KAAKV,IAIvBtC,EAAEqM,SAAW,SAAS/J,GACpB,MAAOA,KAAQhC,OAAOgC,IAIxBK,GAAM,YAAa,WAAY,SAAU,SAAU,OAAQ,UAAW,SAAS2L,GAC7EtO,EAAE,KAAOsO,GAAQ,SAAShM,GACxB,MAAO1B,GAASoC,KAAKV,IAAQ,WAAagM,EAAO,OAMhDtO,EAAEsI,YAAY3E,aACjB3D,EAAEsI,YAAc,SAAShG,GACvB,SAAUA,IAAOtC,EAAEgH,IAAI1E,EAAK,aAKX,kBAAV,MACTtC,EAAE8E,WAAa,SAASxC,GACtB,MAAsB,kBAARA,KAKlBtC,EAAEuO,SAAW,SAASjM,GACpB,MAAOiM,UAASjM,KAASkM,MAAMC,WAAWnM,KAI5CtC,EAAEwO,MAAQ,SAASlM,GACjB,MAAOtC,GAAE0O,SAASpM,IAAQA,IAAQA,GAIpCtC,EAAE2O,UAAY,SAASrM,GACrB,MAAOA,MAAQ,GAAQA,KAAQ,GAA+B,oBAAtB1B,EAASoC,KAAKV,IAIxDtC,EAAE4O,OAAS,SAAStM,GAClB,MAAe,QAARA,GAITtC,EAAE6O,YAAc,SAASvM,GACvB,MAAOA,SAAa,IAKtBtC,EAAEgH,IAAM,SAAS1E,EAAK2C,GACpB,MAAOpE,GAAemC,KAAKV,EAAK2C,IAQlCjF,EAAE8O,WAAa,WAEb,MADAjP,GAAKG,EAAID,EACFD,MAITE,EAAEsE,SAAW,SAASnB,GACpB,MAAOA,IAGTnD,EAAE+O,SAAW,SAAS5L,GACpB,MAAO,YACL,MAAOA,KAIXnD,EAAEkF,SAAW,SAASD,GACpB,MAAO,UAAS3C,GACd,MAAOA,GAAI2C,KAKfjF,EAAEqF,QAAU,SAASD,GACnB,MAAO,UAAS9C,GACd,GAAIA,IAAQ8C,EAAO,OAAO,CAC1B,KAAK,GAAIH,KAAOG,GACd,GAAIA,EAAMH,KAAS3C,EAAI2C,GACrB,OAAO,CAEX,QAAO,IAKXjF,EAAEoM,MAAQ,SAASlG,EAAGtD,EAAUC,GAE9B,IAAK,GADDmM,GAAQ7O,MAAMqF,KAAKD,IAAI,EAAGW,IACrBnD,EAAI,EAAOmD,EAAJnD,EAAOA,IAAKiM,EAAMjM,GAAKH,EAASI,KAAKH,EAASE,EAC9D,OAAOiM,IAIThP,EAAEgG,OAAS,SAASJ,EAAKL,GAKvB,MAJW,OAAPA,IACFA,EAAMK,EACNA,EAAM,GAEDA,EAAMJ,KAAKyJ,MAAMzJ,KAAKQ,UAAYT,EAAMK,EAAM,KAIvD5F,EAAEsL,IAAM4D,KAAK5D,KAAO,WAAa,OAAO,GAAI4D,OAAOC,UAGnD,IAAIC,IACFC,QACEC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,UAGTN,GAAUO,SAAW3P,EAAEuM,OAAO6C,EAAUC,OAGxC,IAAIO,IACFP,OAAU,GAAIQ,QAAO,IAAM7P,EAAEmC,KAAKiN,EAAUC,QAAQS,KAAK,IAAM,IAAK,KACpEH,SAAU,GAAIE,QAAO,IAAM7P,EAAEmC,KAAKiN,EAAUO,UAAUG,KAAK,KAAO,IAAK,KAIzE9P,GAAE2C,MAAM,SAAU,YAAa,SAASgC,GACtC3E,EAAE2E,GAAU,SAASoL,GACnB,MAAc,OAAVA,EAAuB,IACnB,GAAKA,GAAQC,QAAQJ,EAAcjL,GAAS,SAASsL,GAC3D,MAAOb,GAAUzK,GAAQsL,QAO/BjQ,EAAEiE,OAAS,SAASqF,EAAQpE,GAC1B,GAAc,MAAVoE,EAAgB,WAAY,EAChC,IAAInG,GAAQmG,EAAOpE,EACnB,OAAOlF,GAAE8E,WAAW3B,GAASA,EAAMH,KAAKsG,GAAUnG,GAIpDnD,EAAEkQ,MAAQ,SAAS5N,GACjBK,EAAK3C,EAAEwM,UAAUlK,GAAM,SAASgM,GAC9B,GAAItE,GAAOhK,EAAEsO,GAAQhM,EAAIgM,EACzBtO,GAAEI,UAAUkO,GAAQ,WAClB,GAAI1J,IAAQ9E,KAAKyC,SAEjB,OADA9B,GAAKsE,MAAMH,EAAMjB,WACVM,EAAOjB,KAAKlD,KAAMkK,EAAKjF,MAAM/E,EAAG4E,OAO7C,IAAIuL,GAAY,CAChBnQ,GAAEoQ,SAAW,SAASC,GACpB,GAAIC,KAAOH,EAAY,EACvB,OAAOE,GAASA,EAASC,EAAKA,GAKhCtQ,EAAEuQ,kBACAC,SAAc,kBACdC,YAAc,mBACdpB,OAAc,mBAMhB,IAAIqB,GAAU,OAIVC,GACFjB,IAAU,IACVkB,KAAU,KACVC,KAAU,IACVC,KAAU,IACVC,IAAU,IACVC,SAAU,QACVC,SAAU,SAGRC,EAAU,8BAKdlR,GAAEmR,SAAW,SAASC,EAAMC,EAAMC,GAChC,GAAIC,EACJD,GAAWtR,EAAEiN,YAAaqE,EAAUtR,EAAEuQ,iBAGtC,IAAIiB,GAAU,GAAI3B,UACfyB,EAASjC,QAAUqB,GAAS9D,QAC5B0E,EAASb,aAAeC,GAAS9D,QACjC0E,EAASd,UAAYE,GAAS9D,QAC/BkD,KAAK,KAAO,KAAM,KAGhB1M,EAAQ,EACRwJ,EAAS,QACbwE,GAAKpB,QAAQwB,EAAS,SAASvB,EAAOZ,EAAQoB,EAAaD,EAAUiB,GAcnE,MAbA7E,IAAUwE,EAAK1Q,MAAM0C,EAAOqO,GACzBzB,QAAQkB,EAAS,SAASjB,GAAS,MAAO,KAAOU,EAAQV,KAExDZ,IACFzC,GAAU,cAAgByC,EAAS,kCAEjCoB,IACF7D,GAAU,cAAgB6D,EAAc,wBAEtCD,IACF5D,GAAU,OAAS4D,EAAW,YAEhCpN,EAAQqO,EAASxB,EAAMnN,OAChBmN,IAETrD,GAAU,OAGL0E,EAASI,WAAU9E,EAAS,mBAAqBA,EAAS,OAE/DA,EAAS,2CACP,oDACAA,EAAS,eAEX,KACE2E,EAAS,GAAI/Q,UAAS8Q,EAASI,UAAY,MAAO,IAAK9E,GACvD,MAAO+E,GAEP,KADAA,GAAE/E,OAASA,EACL+E,EAGR,GAAIN,EAAM,MAAOE,GAAOF,EAAMrR,EAC9B,IAAImR,GAAW,SAASE,GACtB,MAAOE,GAAOvO,KAAKlD,KAAMuR,EAAMrR,GAMjC,OAFAmR,GAASvE,OAAS,aAAe0E,EAASI,UAAY,OAAS,OAAS9E,EAAS,IAE1EuE,GAITnR,EAAE4R,MAAQ,SAAStP,GACjB,MAAOtC,GAAEsC,GAAKsP,QAUhB,IAAI3N,GAAS,SAAS3B,GACpB,MAAOxC,MAAK+R,OAAS7R,EAAEsC,GAAKsP,QAAUtP,EAIxCtC,GAAEkQ,MAAMlQ,GAGR2C,GAAM,MAAO,OAAQ,UAAW,QAAS,OAAQ,SAAU,WAAY,SAAS2L,GAC9E,GAAI3J,GAASzE,EAAWoO,EACxBtO,GAAEI,UAAUkO,GAAQ,WAClB,GAAIhM,GAAMxC,KAAKyC,QAGf,OAFAoC,GAAOI,MAAMzC,EAAKqB,WACL,SAAR2K,GAA2B,UAARA,GAAoC,IAAfhM,EAAIQ,cAAqBR,GAAI,GACnE2B,EAAOjB,KAAKlD,KAAMwC,MAK7BK,GAAM,SAAU,OAAQ,SAAU,SAAS2L,GACzC,GAAI3J,GAASzE,EAAWoO,EACxBtO,GAAEI,UAAUkO,GAAQ,WAClB,MAAOrK,GAAOjB,KAAKlD,KAAM6E,EAAOI,MAAMjF,KAAKyC,SAAUoB,eAIzD3D,EAAE2M,OAAO3M,EAAEI,WAGTwR,MAAO,WAEL,MADA9R,MAAK+R,QAAS,EACP/R,MAITqD,MAAO,WACL,MAAOrD,MAAKyC,YAYM,kBAAXuP,SAAyBA,OAAOC,KACzCD,OAAO,gBAAkB,WACvB,MAAO9R,OAGVgD,KAAKlD"} \ No newline at end of file diff --git a/vendors/underscore/1.6.0/underscore.js b/vendors/underscore/1.6.0/underscore.js deleted file mode 100644 index 9a4cabecf..000000000 --- a/vendors/underscore/1.6.0/underscore.js +++ /dev/null @@ -1,1343 +0,0 @@ -// Underscore.js 1.6.0 -// http://underscorejs.org -// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var - push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.6.0'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return obj; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, length = obj.length; i < length; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; - } - } - return obj; - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results.push(iterator.call(context, value, index, list)); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, predicate, context) { - var result; - any(obj, function(value, index, list) { - if (predicate.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, predicate, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); - each(obj, function(value, index, list) { - if (predicate.call(context, value, index, list)) results.push(value); - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, predicate, context) { - return _.filter(obj, function(value, index, list) { - return !predicate.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, predicate, context) { - predicate || (predicate = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); - each(obj, function(value, index, list) { - if (!(result = result && predicate.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, predicate, context) { - predicate || (predicate = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); - each(obj, function(value, index, list) { - if (result || (result = predicate.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, _.property(key)); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs) { - return _.filter(obj, _.matches(attrs)); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.find(obj, _.matches(attrs)); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797) - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - var result = -Infinity, lastComputed = -Infinity; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed > lastComputed) { - result = value; - lastComputed = computed; - } - }); - return result; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - var result = Infinity, lastComputed = Infinity; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed < lastComputed) { - result = value; - lastComputed = computed; - } - }); - return result; - }; - - // Shuffle an array, using the modern version of the - // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // Sample **n** random values from a collection. - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - _.sample = function(obj, n, guard) { - if (n == null || guard) { - if (obj.length !== +obj.length) obj = _.values(obj); - return obj[_.random(obj.length - 1)]; - } - return _.shuffle(obj).slice(0, Math.max(0, n)); - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - if (value == null) return _.identity; - if (_.isFunction(value)) return value; - return _.property(value); - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, iterator, context) { - iterator = lookupIterator(iterator); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value: value, - index: index, - criteria: iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(behavior) { - return function(obj, iterator, context) { - var result = {}; - iterator = lookupIterator(iterator); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, key, value) { - _.has(result, key) ? result[key].push(value) : result[key] = [value]; - }); - - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - _.indexBy = group(function(result, key, value) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = group(function(result, key) { - _.has(result, key) ? result[key]++ : result[key] = 1; - }); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely create a real, live array from anything iterable. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - if ((n == null) || guard) return array[0]; - if (n < 0) return []; - return slice.call(array, 0, n); - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n == null) || guard) return array[array.length - 1]; - return slice.call(array, Math.max(array.length - n, 0)); - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - if (shallow && _.every(input, _.isArray)) { - return concat.apply(output, input); - } - each(input, function(value) { - if (_.isArray(value) || _.isArguments(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Flatten out an array, either recursively (by default), or just one level. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Split an array into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function(array, predicate) { - var pass = [], fail = []; - each(array, function(elem) { - (predicate(elem) ? pass : fail).push(elem); - }); - return [pass, fail]; - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(_.flatten(arguments, true)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.contains(other, item); - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var length = _.max(_.pluck(arguments, 'length').concat(0)); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(arguments, '' + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, length = list.length; i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, length = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < length; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(length); - - while(idx < length) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Reusable constructor function for prototype setting. - var ctor = function(){}; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - var args, bound; - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError; - args = slice.call(arguments, 2); - return bound = function() { - if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); - ctor.prototype = func.prototype; - var self = new ctor; - ctor.prototype = null; - var result = func.apply(self, args.concat(slice.call(arguments))); - if (Object(result) === result) return result; - return self; - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. _ acts - // as a placeholder, allowing any combination of arguments to be pre-filled. - _.partial = function(func) { - var boundArgs = slice.call(arguments, 1); - return function() { - var position = 0; - var args = boundArgs.slice(); - for (var i = 0, length = args.length; i < length; i++) { - if (args[i] === _) args[i] = arguments[position++]; - } - while (position < arguments.length) args.push(arguments[position++]); - return func.apply(this, args); - }; - }; - - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) throw new Error('bindAll must be passed function names'); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - _.throttle = function(func, wait, options) { - var context, args, result; - var timeout = null; - var previous = 0; - options || (options = {}); - var later = function() { - previous = options.leading === false ? 0 : _.now(); - timeout = null; - result = func.apply(context, args); - context = args = null; - }; - return function() { - var now = _.now(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, args, context, timestamp, result; - - var later = function() { - var last = _.now() - timestamp; - if (last < wait) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - context = args = null; - } - } - }; - - return function() { - context = this; - args = arguments; - timestamp = _.now(); - var callNow = immediate && !timeout; - if (!timeout) { - timeout = setTimeout(later, wait); - } - if (callNow) { - result = func.apply(context, args); - context = args = null; - } - - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return _.partial(wrapper, func); - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = function(obj) { - if (!_.isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys.push(key); - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var values = new Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = new Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; - } - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - result[obj[keys[i]]] = keys[i]; - } - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] === void 0) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor)) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - _.constant = function(value) { - return function () { - return value; - }; - }; - - _.property = function(key) { - return function(obj) { - return obj[key]; - }; - }; - - // Returns a predicate for checking whether an object has a given set of `key:value` pairs. - _.matches = function(attrs) { - return function(obj) { - if (obj === attrs) return true; //avoid comparing an object to itself. - for (var key in attrs) { - if (attrs[key] !== obj[key]) - return false; - } - return true; - } - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(Math.max(0, n)); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function() { return new Date().getTime(); }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named `property` is a function then invoke it with the - // `object` as context; otherwise, return it. - _.result = function(object, property) { - if (object == null) return void 0; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - - // AMD registration happens at the end for compatibility with AMD loaders - // that may not enforce next-turn semantics on modules. Even though general - // practice for AMD registration is to be anonymous, underscore registers - // as a named module because, like jQuery, it is a base library that is - // popular enough to be bundled in a third party lib, but not be part of - // an AMD load request. Those cases could generate an error when an - // anonymous define() is called outside of a loader request. - if (typeof define === 'function' && define.amd) { - define('underscore', [], function() { - return _; - }); - } -}).call(this); diff --git a/vendors/underscore/LICENSE b/vendors/underscore/LICENSE deleted file mode 100644 index 3acf90838..000000000 --- a/vendors/underscore/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative -Reporters & Editors - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/webpack.config.js b/webpack.config.js index fd0e8e78b..a2b72d19b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,75 +1,74 @@ - -var - path = require('path'), - webpack = require('webpack'), - jsLoaderQuery = { - cacheDirectory: true, - presets: ['es2015-loose-native-modules', 'stage-0'] - } -; - -module.exports = { - entry: { - 'boot': __dirname + '/dev/boot.jsx', - 'app': __dirname + '/dev/app.jsx', - 'admin': __dirname + '/dev/admin.jsx' - }, - output: { - pathinfo: true, - path: __dirname + '/rainloop/v/0.0.0/static/js/', - filename: '[name].js', - publicPath: 'rainloop/v/0.0.0/static/js/' - }, -// devtool: "#source-map", - plugins: [ -// new webpack.optimize.CommonsChunkPlugin('common.js'), - new webpack.optimize.OccurrenceOrderPlugin() - ], - resolve: { - modules: [path.resolve(__dirname, 'dev'), 'node_modules'], - extensions: ['', '.js', '.jsx'], - alias: { - 'Opentip': __dirname + '/dev/External/Opentip.js', - 'ko': __dirname + '/dev/External/ko.js' - } - }, - module: { - loaders: [ - { - test: /\.(html|css)$/, - loader: 'raw', - exclude: /(node_modules|bower_components|vendors)/ - }, - { - test: /\.json$/, - loader: 'json', - exclude: /(node_modules|bower_components|vendors)/ - }, - { - test: /\.jsx$/, - loader: 'babel', - exclude: /(node_modules|bower_components|vendors)/, - query: jsLoaderQuery - } - ] - }, - externals: { - 'window': 'window', - 'JSON': 'window.JSON', - 'JSEncrypt': 'window.JSEncrypt', - 'progressJs': 'window.progressJs', - 'moment': 'window.moment', - 'ifvisible': 'window.ifvisible', - 'crossroads': 'window.crossroads', - 'hasher': 'window.hasher', - 'Jua': 'window.Jua', - 'Autolinker': 'window.Autolinker', - 'Tinycon': 'window.Tinycon', - 'ssm': 'window.ssm', - 'key': 'window.key', - '_': 'window._', - 'qr': 'window.qr', - 'Promise': 'window.Promise', - '$': 'window.jQuery' - } + +var + path = require('path'), + webpack = require('webpack'), + jsLoaderQuery = { + cacheDirectory: true, + presets: ['es2015-loose-native-modules', 'stage-0'] + } +; + +module.exports = { + entry: { + 'boot': __dirname + '/dev/boot.jsx', + 'app': __dirname + '/dev/app.jsx', + 'admin': __dirname + '/dev/admin.jsx' + }, + output: { + pathinfo: true, + path: __dirname + '/rainloop/v/0.0.0/static/js/', + filename: '[name].js', + publicPath: 'rainloop/v/0.0.0/static/js/' + }, +// devtool: "#source-map", + plugins: [ +// new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.optimize.OccurrenceOrderPlugin() + ], + resolve: { + modules: [path.resolve(__dirname, 'dev'), 'node_modules'], + extensions: ['', '.js', '.jsx'], + alias: { + 'Opentip': __dirname + '/dev/External/Opentip.js', + 'ko': __dirname + '/dev/External/ko.js' + } + }, + module: { + loaders: [ + { + test: /\.(html|css)$/, + loader: 'raw', + exclude: /(node_modules|bower_components|vendors)/ + }, + { + test: /\.json$/, + loader: 'json', + exclude: /(node_modules|bower_components|vendors)/ + }, + { + test: /\.jsx$/, + loader: 'babel', + exclude: /(node_modules|bower_components|vendors)/, + query: jsLoaderQuery + } + ] + }, + externals: { + 'window': 'window', + 'JSON': 'window.JSON', + 'progressJs': 'window.progressJs', + 'moment': 'window.moment', + 'ifvisible': 'window.ifvisible', + 'crossroads': 'window.crossroads', + 'hasher': 'window.hasher', + 'Jua': 'window.Jua', + 'Autolinker': 'window.Autolinker', + 'Tinycon': 'window.Tinycon', + 'ssm': 'window.ssm', + 'key': 'window.key', + '_': 'window._', + 'qr': 'window.qr', + 'Promise': 'window.Promise', + '$': 'window.jQuery' + } }; \ No newline at end of file