snappymail/dev/Common/Globals.js

151 lines
2.9 KiB
JavaScript
Raw Normal View History

/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @type {?}
*/
Globals.now = (new Date()).getTime();
/**
* @type {?}
*/
Globals.momentTrigger = ko.observable(true);
/**
* @type {?}
*/
Globals.dropdownVisibility = ko.observable(false);
/**
* @type {?}
*/
Globals.langChangeTrigger = ko.observable(true);
/**
* @type {number}
*/
Globals.iAjaxErrorCount = 0;
/**
* @type {number}
*/
Globals.iTokenErrorCount = 0;
/**
* @type {number}
*/
Globals.iMessageBodyCacheCount = 0;
/**
* @type {boolean}
*/
Globals.bUnload = false;
/**
* @type {string}
*/
Globals.sUserAgent = (navigator.userAgent || '').toLowerCase();
/**
* @type {boolean}
*/
Globals.bIsiOSDevice = -1 < Globals.sUserAgent.indexOf('iphone') || -1 < Globals.sUserAgent.indexOf('ipod') || -1 < Globals.sUserAgent.indexOf('ipad');
/**
* @type {boolean}
*/
Globals.bIsAndroidDevice = -1 < Globals.sUserAgent.indexOf('android');
/**
* @type {boolean}
*/
Globals.bMobileDevice = Globals.bIsiOSDevice || Globals.bIsAndroidDevice;
/**
* @type {boolean}
*/
Globals.bDisableNanoScroll = Globals.bMobileDevice;
/**
* @type {boolean}
*/
Globals.bAllowPdfPreview = !Globals.bMobileDevice;
/**
* @type {boolean}
*/
Globals.bAnimationSupported = !Globals.bMobileDevice && $html.hasClass('csstransitions');
/**
* @type {string}
*/
Globals.sAnimationType = '';
2014-02-11 07:43:50 +08:00
/**
* @type {Object}
*/
Globals.oHtmlEditorDefaultConfig = {
'title': false,
'stylesSet': false,
'customConfig': '',
'contentsCss': '',
2014-02-11 07:43:50 +08:00
'toolbarGroups': [
{name: 'spec'},
2014-02-11 07:43:50 +08:00
{name: 'styles'},
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
{name: 'colors'},
2014-02-13 00:01:53 +08:00
{name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align']},
2014-02-11 07:43:50 +08:00
{name: 'links'},
2014-02-13 00:01:53 +08:00
{name: 'insert'},
{name: 'others'}
2014-02-11 07:43:50 +08:00
// {name: 'document', groups: ['mode', 'document', 'doctools']}
],
'removePlugins': 'contextmenu', //blockquote
'removeButtons': 'Format,Undo,Redo,Cut,Copy,Paste,Anchor,Strike,Subscript,Superscript,Image,SelectAll',
2014-02-11 07:43:50 +08:00
'removeDialogTabs': 'link:advanced;link:target;image:advanced',
2014-02-12 00:00:01 +08:00
'extraPlugins': 'plain',
2014-02-13 00:01:53 +08:00
'allowedContent': true,
2014-02-11 07:43:50 +08:00
'autoParagraph': false,
'enterMode': window.CKEDITOR.ENTER_BR,
2014-02-12 00:00:01 +08:00
'shiftEnterMode': window.CKEDITOR.ENTER_BR,
2014-02-11 07:43:50 +08:00
'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'
2014-02-11 07:43:50 +08:00
};
/**
* @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',
2014-02-13 23:45:18 +08:00
'ro': 'ro',
2014-02-11 07:43:50 +08:00
'zh': 'zh',
'zh-cn': 'zh-cn'
};
if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
{
Globals.bAllowPdfPreview = !!_.find(navigator.mimeTypes, function (oType) {
return oType && 'application/pdf' === oType.type;
});
}