mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
CommonJS (research)
This commit is contained in:
parent
2fa2cd191e
commit
56607de87c
91 changed files with 20220 additions and 12933 deletions
|
|
@ -1,157 +1,184 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.now = (new Date()).getTime();
|
||||
(function (module) {
|
||||
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.momentTrigger = ko.observable(true);
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.dropdownVisibility = ko.observable(false).extend({'rateLimit': 0});
|
||||
var
|
||||
Globals = {},
|
||||
window = require('../External/window.js'),
|
||||
ko = require('../External/ko.js'),
|
||||
$html = require('../External/$html.js')
|
||||
;
|
||||
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.tooltipTrigger = ko.observable(false).extend({'rateLimit': 0});
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.now = (new window.Date()).getTime();
|
||||
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.langChangeTrigger = ko.observable(true);
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.momentTrigger = ko.observable(true);
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
Globals.iAjaxErrorCount = 0;
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.dropdownVisibility = ko.observable(false).extend({'rateLimit': 0});
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
Globals.iTokenErrorCount = 0;
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.tooltipTrigger = ko.observable(false).extend({'rateLimit': 0});
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
Globals.iMessageBodyCacheCount = 0;
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
Globals.langChangeTrigger = ko.observable(true);
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bUnload = false;
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
Globals.iAjaxErrorCount = 0;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
Globals.sUserAgent = (navigator.userAgent || '').toLowerCase();
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
Globals.iTokenErrorCount = 0;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bIsiOSDevice = -1 < Globals.sUserAgent.indexOf('iphone') || -1 < Globals.sUserAgent.indexOf('ipod') || -1 < Globals.sUserAgent.indexOf('ipad');
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
Globals.iMessageBodyCacheCount = 0;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bIsAndroidDevice = -1 < Globals.sUserAgent.indexOf('android');
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bUnload = false;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bMobileDevice = Globals.bIsiOSDevice || Globals.bIsAndroidDevice;
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
Globals.sUserAgent = (window.navigator.userAgent || '').toLowerCase();
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bDisableNanoScroll = Globals.bMobileDevice;
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bIsiOSDevice = -1 < Globals.sUserAgent.indexOf('iphone') || -1 < Globals.sUserAgent.indexOf('ipod') || -1 < Globals.sUserAgent.indexOf('ipad');
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bAllowPdfPreview = !Globals.bMobileDevice;
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bIsAndroidDevice = -1 < Globals.sUserAgent.indexOf('android');
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bAnimationSupported = !Globals.bMobileDevice && $html.hasClass('csstransitions');
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bMobileDevice = Globals.bIsiOSDevice || Globals.bIsAndroidDevice;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bXMLHttpRequestSupported = !!window.XMLHttpRequest;
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bDisableNanoScroll = Globals.bMobileDevice;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
Globals.sAnimationType = '';
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bAllowPdfPreview = !Globals.bMobileDevice;
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
Globals.oHtmlEditorDefaultConfig = {
|
||||
'title': false,
|
||||
'stylesSet': false,
|
||||
'customConfig': '',
|
||||
'contentsCss': '',
|
||||
'toolbarGroups': [
|
||||
{name: 'spec'},
|
||||
{name: 'styles'},
|
||||
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
|
||||
{name: 'colors'},
|
||||
{name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align']},
|
||||
{name: 'links'},
|
||||
{name: 'insert'},
|
||||
{name: 'others'}
|
||||
// {name: 'document', groups: ['mode', 'document', 'doctools']}
|
||||
],
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bAnimationSupported = !Globals.bMobileDevice && $html.hasClass('csstransitions');
|
||||
|
||||
'removePlugins': 'contextmenu', //blockquote
|
||||
'removeButtons': 'Format,Undo,Redo,Cut,Copy,Paste,Anchor,Strike,Subscript,Superscript,Image,SelectAll',
|
||||
'removeDialogTabs': 'link:advanced;link:target;image:advanced;images:advanced',
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bXMLHttpRequestSupported = !!window.XMLHttpRequest;
|
||||
|
||||
'extraPlugins': 'plain',
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
Globals.sAnimationType = '';
|
||||
|
||||
'allowedContent': true,
|
||||
'autoParagraph': false,
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
Globals.oHtmlEditorDefaultConfig = {
|
||||
'title': false,
|
||||
'stylesSet': false,
|
||||
'customConfig': '',
|
||||
'contentsCss': '',
|
||||
'toolbarGroups': [
|
||||
{name: 'spec'},
|
||||
{name: 'styles'},
|
||||
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
|
||||
{name: 'colors'},
|
||||
{name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align']},
|
||||
{name: 'links'},
|
||||
{name: 'insert'},
|
||||
{name: 'others'}
|
||||
// {name: 'document', groups: ['mode', 'document', 'doctools']}
|
||||
],
|
||||
|
||||
'font_defaultLabel': 'Arial',
|
||||
'fontSize_defaultLabel': '13',
|
||||
'fontSize_sizes': '10/10px;12/12px;13/13px;14/14px;16/16px;18/18px;20/20px;24/24px;28/28px;36/36px;48/48px'
|
||||
};
|
||||
'removePlugins': 'contextmenu', //blockquote
|
||||
'removeButtons': 'Format,Undo,Redo,Cut,Copy,Paste,Anchor,Strike,Subscript,Superscript,Image,SelectAll',
|
||||
'removeDialogTabs': 'link:advanced;link:target;image:advanced;images:advanced',
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
Globals.oHtmlEditorLangsMap = {
|
||||
'de': 'de',
|
||||
'es': 'es',
|
||||
'fr': 'fr',
|
||||
'hu': 'hu',
|
||||
'is': 'is',
|
||||
'it': 'it',
|
||||
'ko': 'ko',
|
||||
'ko-kr': 'ko',
|
||||
'lv': 'lv',
|
||||
'nl': 'nl',
|
||||
'no': 'no',
|
||||
'pl': 'pl',
|
||||
'pt': 'pt',
|
||||
'pt-pt': 'pt',
|
||||
'pt-br': 'pt-br',
|
||||
'ru': 'ru',
|
||||
'ro': 'ro',
|
||||
'zh': 'zh',
|
||||
'zh-cn': 'zh-cn'
|
||||
};
|
||||
'extraPlugins': 'plain',
|
||||
|
||||
if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
|
||||
{
|
||||
Globals.bAllowPdfPreview = !!_.find(navigator.mimeTypes, function (oType) {
|
||||
return oType && 'application/pdf' === oType.type;
|
||||
});
|
||||
}
|
||||
'allowedContent': true,
|
||||
'autoParagraph': false,
|
||||
|
||||
'font_defaultLabel': 'Arial',
|
||||
'fontSize_defaultLabel': '13',
|
||||
'fontSize_sizes': '10/10px;12/12px;13/13px;14/14px;16/16px;18/18px;20/20px;24/24px;28/28px;36/36px;48/48px'
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
Globals.oHtmlEditorLangsMap = {
|
||||
'de': 'de',
|
||||
'es': 'es',
|
||||
'fr': 'fr',
|
||||
'hu': 'hu',
|
||||
'is': 'is',
|
||||
'it': 'it',
|
||||
'ko': 'ko',
|
||||
'ko-kr': 'ko',
|
||||
'lv': 'lv',
|
||||
'nl': 'nl',
|
||||
'no': 'no',
|
||||
'pl': 'pl',
|
||||
'pt': 'pt',
|
||||
'pt-pt': 'pt',
|
||||
'pt-br': 'pt-br',
|
||||
'ru': 'ru',
|
||||
'ro': 'ro',
|
||||
'zh': 'zh',
|
||||
'zh-cn': 'zh-cn'
|
||||
};
|
||||
|
||||
if (Globals.bAllowPdfPreview && window.navigator && window.navigator.mimeTypes)
|
||||
{
|
||||
Globals.bAllowPdfPreview = !!_.find(window.navigator.mimeTypes, function (oType) {
|
||||
return oType && 'application/pdf' === oType.type;
|
||||
});
|
||||
}
|
||||
|
||||
Globals.oI18N = {},
|
||||
|
||||
Globals.oNotificationI18N = {},
|
||||
|
||||
Globals.aBootstrapDropdowns = [],
|
||||
|
||||
Globals.aViewModels = {
|
||||
'settings': [],
|
||||
'settings-removed': [],
|
||||
'settings-disabled': []
|
||||
};
|
||||
|
||||
module.exports = Globals;
|
||||
|
||||
}(module));
|
||||
Loading…
Add table
Add a link
Reference in a new issue