mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Added async script loader
This commit is contained in:
parent
9a30680748
commit
25cf891037
23 changed files with 1200 additions and 342 deletions
|
|
@ -119,9 +119,6 @@ Globals.oHtmlEditorDefaultConfig = {
|
|||
'allowedContent': true,
|
||||
'autoParagraph': false,
|
||||
|
||||
'enterMode': window.CKEDITOR.ENTER_BR,
|
||||
'shiftEnterMode': window.CKEDITOR.ENTER_BR,
|
||||
|
||||
'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'
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ function NewHtmlEditorWrapper(oElement, fOnBlur, fOnReady, fOnModeChange)
|
|||
|
||||
self.$element = $(oElement);
|
||||
|
||||
self.init();
|
||||
|
||||
self.resize = _.throttle(_.bind(self.resize, self), 100);
|
||||
|
||||
self.init();
|
||||
}
|
||||
|
||||
NewHtmlEditorWrapper.prototype.blurTrigger = function ()
|
||||
|
|
@ -150,60 +150,77 @@ NewHtmlEditorWrapper.prototype.init = function ()
|
|||
{
|
||||
var
|
||||
self = this,
|
||||
oConfig = Globals.oHtmlEditorDefaultConfig,
|
||||
sLanguage = RL.settingsGet('Language'),
|
||||
bSource = !!RL.settingsGet('AllowHtmlEditorSourceButton')
|
||||
fInit = function () {
|
||||
|
||||
var
|
||||
oConfig = Globals.oHtmlEditorDefaultConfig,
|
||||
sLanguage = RL.settingsGet('Language'),
|
||||
bSource = !!RL.settingsGet('AllowHtmlEditorSourceButton')
|
||||
;
|
||||
|
||||
if (bSource && oConfig.toolbarGroups && !oConfig.toolbarGroups.__SourceInited)
|
||||
{
|
||||
oConfig.toolbarGroups.__SourceInited = true;
|
||||
oConfig.toolbarGroups.push({name: 'document', groups: ['mode', 'document', 'doctools']});
|
||||
}
|
||||
|
||||
oConfig.enterMode = window.CKEDITOR.ENTER_BR;
|
||||
oConfig.shiftEnterMode = window.CKEDITOR.ENTER_BR;
|
||||
|
||||
oConfig.language = Globals.oHtmlEditorLangsMap[sLanguage] || 'en';
|
||||
if (window.CKEDITOR.env)
|
||||
{
|
||||
window.CKEDITOR.env.isCompatible = true;
|
||||
}
|
||||
|
||||
self.editor = window.CKEDITOR.appendTo(self.$element[0], oConfig);
|
||||
|
||||
self.editor.on('key', function(oEvent) {
|
||||
if (oEvent && oEvent.data && 9 /* Tab */ === oEvent.data.keyCode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
self.editor.on('blur', function() {
|
||||
self.blurTrigger();
|
||||
});
|
||||
|
||||
self.editor.on('mode', function() {
|
||||
|
||||
self.blurTrigger();
|
||||
|
||||
if (self.fOnModeChange)
|
||||
{
|
||||
self.fOnModeChange('plain' !== self.editor.mode);
|
||||
}
|
||||
});
|
||||
|
||||
self.editor.on('focus', function() {
|
||||
self.focusTrigger();
|
||||
});
|
||||
|
||||
if (self.fOnReady)
|
||||
{
|
||||
self.editor.on('instanceReady', function () {
|
||||
|
||||
self.editor.setKeystroke(window.CKEDITOR.CTRL + 65 /* A */, 'selectAll');
|
||||
|
||||
self.fOnReady();
|
||||
self.__resizable = true;
|
||||
self.resize();
|
||||
});
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
if (bSource && oConfig.toolbarGroups && !oConfig.toolbarGroups.__SourceInited)
|
||||
if (window.CKEDITOR)
|
||||
{
|
||||
oConfig.toolbarGroups.__SourceInited = true;
|
||||
oConfig.toolbarGroups.push({name: 'document', groups: ['mode', 'document', 'doctools']});
|
||||
fInit();
|
||||
}
|
||||
|
||||
oConfig.language = Globals.oHtmlEditorLangsMap[sLanguage] || 'en';
|
||||
if (window.CKEDITOR.env)
|
||||
else
|
||||
{
|
||||
window.CKEDITOR.env.isCompatible = true;
|
||||
}
|
||||
|
||||
self.editor = window.CKEDITOR.appendTo(self.$element[0], oConfig);
|
||||
|
||||
self.editor.on('key', function(oEvent) {
|
||||
if (oEvent && oEvent.data && 9 /* Tab */ === oEvent.data.keyCode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
self.editor.on('blur', function() {
|
||||
self.blurTrigger();
|
||||
});
|
||||
|
||||
self.editor.on('mode', function() {
|
||||
|
||||
self.blurTrigger();
|
||||
|
||||
if (self.fOnModeChange)
|
||||
{
|
||||
self.fOnModeChange('plain' !== self.editor.mode);
|
||||
}
|
||||
});
|
||||
|
||||
self.editor.on('focus', function() {
|
||||
self.focusTrigger();
|
||||
});
|
||||
|
||||
if (self.fOnReady)
|
||||
{
|
||||
self.editor.on('instanceReady', function () {
|
||||
|
||||
self.editor.setKeystroke(window.CKEDITOR.CTRL + 65 /* A */, 'selectAll');
|
||||
|
||||
self.fOnReady();
|
||||
self.__resizable = true;
|
||||
self.resize();
|
||||
});
|
||||
window.__initEditor = fInit;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
if (window.SimplePace) {
|
||||
window.SimplePace.add(10);
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
if (window.SimplePace) {
|
||||
window.SimplePace.add(10);
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
if (window.SimplePace) {
|
||||
window.SimplePace.add(20);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue