Added async script loader

This commit is contained in:
RainLoop Team 2014-08-14 13:26:58 +04:00
parent 9a30680748
commit 25cf891037
23 changed files with 1200 additions and 342 deletions

View file

@ -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'

View file

@ -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;
}
}
};

View file

@ -1,3 +0,0 @@
if (window.SimplePace) {
window.SimplePace.add(10);
}

View file

@ -1,3 +0,0 @@
if (window.SimplePace) {
window.SimplePace.add(10);
}

View file

@ -1,3 +0,0 @@
if (window.SimplePace) {
window.SimplePace.add(20);
}

View file

@ -108,8 +108,9 @@ cfg.paths.js = {
name: 'boot.js',
src: [
'vendors/json2.min.js',
'vendors/labjs/LAB.min.js',
'vendors/simple-pace/simple-pace-1.0.min.js',
'vendors/rl/rl-1.0.min.js'
'vendors/rl/rl-1.1.min.js'
]
},
openpgp: {
@ -159,8 +160,7 @@ cfg.paths.js = {
'vendors/keymaster/keymaster.js',
'vendors/ifvisible/ifvisible.min.js',
'vendors/jquery-magnific-popup/jquery.magnific-popup.min.js',
'vendors/bootstrap/js/bootstrap.min.js',
'dev/Common/_LibsEnd.js'
'vendors/bootstrap/js/bootstrap.min.js'
]
},
app: {
@ -266,8 +266,7 @@ cfg.paths.js = {
'dev/Boots/AbstractApp.js',
'dev/Boots/RainLoopApp.js',
'dev/Common/_End.js',
'dev/Common/_CoreEnd.js'
'dev/Common/_End.js'
]
},
admin: {
@ -338,8 +337,7 @@ cfg.paths.js = {
'dev/Boots/AbstractApp.js',
'dev/Boots/AdminApp.js',
'dev/Common/_End.js',
'dev/Common/_CoreEnd.js'
'dev/Common/_End.js'
]
}
};
@ -467,10 +465,10 @@ regOtherMinTask('other:inputosaurus', 'vendors/inputosaurus/', 'inputosaurus.js'
'/*! Inputosaurus Text v0.1.6 (c) 2013 Dan Kielp <dan@sproutsocial.com>; 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) 2013 RainLoop Team; Licensed under MIT */\n');
'/*! RainLoop Simple Pace v1.0 (c) 2014 RainLoop Team; Licensed under MIT */\n');
regOtherMinTask('other:rl', 'vendors/rl/', 'rl.js', 'rl-1.0.min.js',
'/*! RainLoop Top Driver v1.0 (c) 2013 RainLoop Team; Licensed under MIT */\n');
regOtherMinTask('other:rl', 'vendors/rl/', 'rl.js', 'rl-1.1.min.js',
'/*! RainLoop Index Helper v1.1 (c) 2014 RainLoop Team; Licensed under MIT */\n');
gulp.task('package-inc-release', function() {
fs.writeFileSync('package.json',

View file

@ -12,10 +12,6 @@
<meta http-equiv="refresh" content="0; URL=./?/BadBrowser" />
<![endif]-->
<script type="text/javascript" data-cfasync="false">
function __fIncludeScr(sSrc) {
document.write(unescape('%3Csc' + 'ript data-cfasync="false" type="text/jav' + 'ascr' + 'ipt" sr' + 'c="' + sSrc + '"%3E%3C/' + 'scr' + 'ipt%3E'));
}
if (!navigator || !navigator.cookieEnabled) {
document.location.replace('./?/NoCookie');
}
@ -30,7 +26,7 @@
<link type="text/css" rel="stylesheet" id="rlThemeLink" />
<script type="text/javascript" data-cfasync="false">{{BaseAppBootScriptSource}}</script>
<script type="text/javascript" data-cfasync="false">
__fIncludeScr('{{BaseAppDataScriptLink}}' + (window.__rlah ? window.__rlah() || '0' : '0') + '/{{BaseRandHash}}/');
__includeScr('{{BaseAppDataScriptLink}}' + (window.__rlah ? window.__rlah() || '0' : '0') + '/{{BaseRandHash}}/');
</script>
<script type="text/javascript" data-cfasync="false">
if (window.rainloopAppData && window.rainloopAppData['NewThemeLink']) {
@ -50,7 +46,7 @@
</div>
<script type="text/javascript" data-cfasync="false">
var oE = document.getElementById('rl-loading');
if (oE) {
if (oE && oE.style) {
oE.style.opacity = 0;
window.setTimeout(function () {
oE.style.opacity = 1;
@ -58,7 +54,9 @@
}
</script>
<div id="rl-loading-error" class="thm-loading">
An Error occurred,<br />please refresh the page and try again.
An Error occurred,
<br />
please refresh the page and try again.
</div>
<div id="rl-content">
<div id="rl-popups"></div>
@ -71,42 +69,44 @@
</div>
<div id="rl-templates"></div>
<div id="rl-hidden"></div>
<script type="text/javascript" src="{{BaseAppLibsScriptLink}}" data-cfasync="false"></script>
<script type="text/javascript" src="{{BaseAppEditorScriptLink}}" data-cfasync="false"></script>
<script type="text/javascript" data-cfasync="false">
if (window.rainloopAppData && window.rainloopAppData['TemplatesLink']) {
__fIncludeScr(window.rainloopAppData['TemplatesLink']);
}
</script>
<script type="text/javascript" data-cfasync="false">
if (window.rainloopAppData && window.rainloopAppData['LangLink']) {
__fIncludeScr(window.rainloopAppData['LangLink']);
}
</script>
<script type="text/javascript" src="{{BaseAppMainScriptLink}}" data-cfasync="false"></script>
<script type="text/javascript" data-cfasync="false">
if (window.rainloopAppData && window.rainloopAppData['PluginsLink']) {
__fIncludeScr(window.rainloopAppData['PluginsLink']);
}
</script>
<script type="text/javascript" data-cfasync="false">
function __showError() {
var oR = document.getElementById('rl-loading'),
oL = document.getElementById('rl-loading-error');
if (oR) {oR.style.display = 'none';}
if (oL) {oL.style.display = 'block';}
if (window.SimplePace) {window.SimplePace.set(100);}
if (window.$LAB && window.rainloopAppData && window.rainloopAppData['TemplatesLink'] && window.rainloopAppData['LangLink'])
{
__simplePace(10);
window.$LAB
.script('{{BaseAppLibsScriptLink}}')
.script(window.rainloopAppData['TemplatesLink'])
.script(window.rainloopAppData['LangLink'])
.wait(function () {
__simplePace(30);
})
.script('{{BaseAppMainScriptLink}}')
.wait(function () {
__simplePace(20);
})
.script(function () {
return window.rainloopAppData['PluginsLink'] || null;
})
.wait(function () {
__simplePace(5);
__runBoot(false);
})
.script('{{BaseAppEditorScriptLink}}')
.wait(function () {
if (window.CKEDITOR && window.__initEditor) {
window.__initEditor();
window.__initEditor = null;
}
})
;
}
if (window.__RLBOOT) {
window.__RLBOOT(function (bV) {
if (!bV) {
__showError();
}
});
} else {
__showError();
else
{
__runBoot(true);
}
</script>
</body>
</html>

View file

@ -637,7 +637,7 @@
border-radius: 8px;
}
/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
/* =============================================================================
@ -1142,7 +1142,7 @@ table {
border-collapse: collapse;
border-spacing: 0;
}
@charset "UTF-8";
@font-face {
@ -1513,7 +1513,7 @@ table {
.icon-resize-out:before {
content: "\e06d";
}
/** initial setup **/
.nano {
/*
@ -1630,7 +1630,7 @@ table {
.nano > .pane2:hover > .slider2, .nano > .pane2.active > .slider2 {
background-color: rgba(0, 0, 0, 0.4);
}
/* Magnific Popup CSS */
.mfp-bg {
top: 0;
@ -1995,7 +1995,7 @@ img.mfp-img {
right: 0;
padding-top: 0; }
/* overlay at start */
.mfp-fade.mfp-bg {
@ -2041,7 +2041,7 @@ img.mfp-img {
-moz-transform: translateX(50px);
transform: translateX(50px);
}
.simple-pace {
-webkit-pointer-events: none;
pointer-events: none;
@ -2112,7 +2112,7 @@ img.mfp-img {
@keyframes simple-pace-stripe-animation {
0% { transform: none; transform: none; }
100% { transform: translate(-32px, 0); transform: translate(-32px, 0); }
}
}
.inputosaurus-container {
background-color:#fff;
border:1px solid #bcbec0;
@ -2180,7 +2180,7 @@ img.mfp-img {
box-shadow:none;
}
.inputosaurus-input-hidden { display:none; }
.flag-wrapper {
width: 24px;
height: 16px;
@ -2226,7 +2226,7 @@ img.mfp-img {
.flag.flag-pt-br {background-position: -192px -11px}
.flag.flag-cn, .flag.flag-zh-tw, .flag.flag-zh-cn, .flag.flag-zh-hk {background-position: -208px -22px}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
.clearfix {
*zoom: 1;

View file

@ -78,7 +78,7 @@ var
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*jshint onevar: false*/
@ -87,7 +87,7 @@ var
*/
var RL = null;
/*jshint onevar: true*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -209,9 +209,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'
@ -248,7 +245,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Consts.Defaults = {};
@ -368,7 +365,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -799,7 +796,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Utils.trim = $.trim;
@ -2880,7 +2877,7 @@ Utils.triggerAutocompleteInputChange = function (bDelay) {
};
/*jslint bitwise: true*/
// Base64 encode / decode
// http://www.webtoolkit.info/
@ -3044,7 +3041,7 @@ Base64 = {
}
};
/*jslint bitwise: false*/
/*jslint bitwise: false*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
ko.bindingHandlers.tooltip = {
@ -3887,7 +3884,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4193,7 +4190,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4289,7 +4286,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4365,7 +4362,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4438,7 +4435,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4483,7 +4480,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4498,7 +4495,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4593,7 +4590,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
return true;
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4671,7 +4668,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5087,7 +5084,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5453,7 +5450,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5499,7 +5496,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml)
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
Utils.encodeHtml(this.name()) : this.name();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5796,7 +5793,7 @@ PopupsDomainViewModel.prototype.clearForm = function ()
this.smtpAuth(true);
this.whiteList('');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5940,7 +5937,7 @@ PopupsPluginViewModel.prototype.onBuild = function ()
return false;
}, this));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6058,7 +6055,7 @@ PopupsActivateViewModel.prototype.validateSubscriptionKey = function ()
{
var sValue = this.key();
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6120,7 +6117,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6233,7 +6230,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6334,7 +6331,7 @@ AdminLoginViewModel.prototype.submitForm = function ()
{
this.submitCommand();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6360,7 +6357,7 @@ AdminMenuViewModel.prototype.link = function (sRoute)
{
return '#/' + sRoute;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6386,7 +6383,7 @@ AdminPaneViewModel.prototype.logoutClick = function ()
RL.remote().adminLogout(function () {
RL.loginAndLogoutReload();
});
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6514,7 +6511,7 @@ AdminGeneral.prototype.phpInfoLink = function ()
return RL.link().phpInfo();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6568,7 +6565,7 @@ AdminLogin.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6639,7 +6636,7 @@ AdminBranding.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6861,7 +6858,7 @@ AdminContacts.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6952,7 +6949,7 @@ AdminDomains.prototype.onDomainListChangeRequest = function ()
{
RL.reloadDomainList();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7067,7 +7064,7 @@ AdminSecurity.prototype.phpInfoLink = function ()
{
return RL.link().phpInfo();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7204,7 +7201,7 @@ AdminSocial.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7303,7 +7300,7 @@ AdminPlugins.prototype.onPluginDisableRequest = function (sResult, oData)
RL.reloadPluginList();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7403,7 +7400,7 @@ AdminPackages.prototype.installPackage = function (oPackage)
RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7460,7 +7457,7 @@ AdminLicensing.prototype.licenseExpiredMomentValue = function ()
;
return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')');
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7537,7 +7534,7 @@ AdminAbout.prototype.updateCoreData = function ()
RL.updateCoreData();
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7672,7 +7669,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7725,7 +7722,7 @@ _.extend(AdminDataStorage.prototype, AbstractData.prototype);
AdminDataStorage.prototype.populateDataOnStart = function()
{
AbstractData.prototype.populateDataOnStart.call(this);
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8009,7 +8006,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8272,7 +8269,7 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
{
this.defaultRequest(fCallback, 'AdminPing');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8333,7 +8330,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData)
{
this.oServices = oData;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8346,7 +8343,7 @@ function AdminCacheStorage()
}
_.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype);
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8528,7 +8525,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8545,7 +8542,7 @@ _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype);
AdminLoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8565,7 +8562,7 @@ _.extend(AdminSettingsScreen.prototype, AbstractSettings.prototype);
AdminSettingsScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8925,7 +8922,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -9228,7 +9225,7 @@ AdminApp.prototype.bootstart = function ()
* @type {AdminApp}
*/
RL = new AdminApp();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
@ -9282,8 +9279,5 @@ window['__RLBOOT'] = function (fCall) {
});
};
if (window.SimplePace) {
window.SimplePace.add(10);
}
}(window, jQuery, ko, crossroads, hasher, _));

File diff suppressed because one or more lines are too long

View file

@ -78,7 +78,7 @@ var
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*jshint onevar: false*/
@ -90,7 +90,7 @@ var
$proxyDiv = $('<div></div>')
;
/*jshint onevar: true*/
/*jshint onevar: true*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -212,9 +212,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'
@ -251,7 +248,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Consts.Defaults = {};
@ -371,7 +368,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -802,7 +799,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Utils.trim = $.trim;
@ -2883,7 +2880,7 @@ Utils.triggerAutocompleteInputChange = function (bDelay) {
};
/*jslint bitwise: true*/
// Base64 encode / decode
// http://www.webtoolkit.info/
@ -3047,7 +3044,7 @@ Base64 = {
}
};
/*jslint bitwise: false*/
/*jslint bitwise: false*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
ko.bindingHandlers.tooltip = {
@ -3890,7 +3887,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4196,7 +4193,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4292,7 +4289,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
/**
* @constructor
@ -4312,9 +4309,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 ()
@ -4445,60 +4442,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;
}
}
};
@ -4536,7 +4550,7 @@ NewHtmlEditorWrapper.prototype.clear = function (bFocus)
this.setHtml('', bFocus);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5249,7 +5263,7 @@ Selector.prototype.on = function (sEventName, fCallback)
{
this.oCallbacks[sEventName] = fCallback;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5325,7 +5339,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5398,7 +5412,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5443,7 +5457,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5458,7 +5472,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5553,7 +5567,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
return true;
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5631,7 +5645,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6047,7 +6061,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6413,7 +6427,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6539,7 +6553,7 @@ ContactModel.prototype.lineAsCcc = function ()
return aResult.join(' ');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6570,7 +6584,7 @@ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder)
}, this);
}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6616,7 +6630,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml)
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
Utils.encodeHtml(this.name()) : this.name();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6854,7 +6868,7 @@ AttachmentModel.prototype.iconClass = function ()
return sClass;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6917,7 +6931,7 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment)
}
return bResult;
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8180,7 +8194,7 @@ MessageModel.prototype.flagHash = function ()
return [this.deleted(), this.unseen(), this.flagged(), this.answered(), this.forwarded(),
this.isReadReceipt()].join('');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8514,7 +8528,7 @@ FolderModel.prototype.printableFullName = function ()
{
return this.fullName.split(this.delimiter).join(' / ');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8537,7 +8551,7 @@ AccountModel.prototype.email = '';
AccountModel.prototype.changeAccountLink = function ()
{
return RL.link().change(this.email);
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8575,7 +8589,7 @@ IdentityModel.prototype.formattedNameForEmail = function ()
var sName = this.name();
return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>';
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8624,7 +8638,7 @@ FilterConditionModel.prototype.removeSelf = function ()
{
this.parentList.remove(this);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8704,7 +8718,7 @@ FilterModel.prototype.parse = function (oItem)
return bResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8737,7 +8751,7 @@ OpenPgpKeyModel.prototype.user = '';
OpenPgpKeyModel.prototype.email = '';
OpenPgpKeyModel.prototype.armor = '';
OpenPgpKeyModel.prototype.isPrivate = false;
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8835,7 +8849,7 @@ PopupsFolderClearViewModel.prototype.onShow = function (oFolder)
this.selectedFolder(oFolder);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8947,7 +8961,7 @@ PopupsFolderCreateViewModel.prototype.onFocus = function ()
{
this.folderName.focused(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -9062,7 +9076,7 @@ PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType)
this.notification(sNotification);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -10769,7 +10783,7 @@ PopupsComposeViewModel.prototype.triggerForResize = function ()
this.editorResizeThrottle();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11513,7 +11527,7 @@ PopupsContactsViewModel.prototype.onHide = function ()
// oItem.checked(false);
// });
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11651,7 +11665,7 @@ PopupsAdvancedSearchViewModel.prototype.onFocus = function ()
{
this.fromFocus(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11747,7 +11761,7 @@ PopupsAddAccountViewModel.prototype.onFocus = function ()
{
this.emailFocus(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11838,7 +11852,7 @@ PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function ()
{
this.key.focus(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11880,7 +11894,7 @@ PopupsViewOpenPgpKeyViewModel.prototype.onShow = function (oOpenPgpKey)
this.key(oOpenPgpKey.armor);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11976,7 +11990,7 @@ PopupsGenerateNewOpenPgpKeyViewModel.prototype.onFocus = function ()
{
this.email.focus(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12218,7 +12232,7 @@ PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFr
this.to(aRec);
this.text(sText);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12368,7 +12382,7 @@ PopupsIdentityViewModel.prototype.onFocus = function ()
this.email.focused(true);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12430,7 +12444,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12486,7 +12500,7 @@ PopupsTwoFactorTestViewModel.prototype.onFocus = function ()
{
this.code.focused(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12599,7 +12613,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12646,7 +12660,7 @@ PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom)
}
}, this));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12684,7 +12698,7 @@ PopupsFilterViewModel.prototype.onFocus = function ()
{
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -13029,7 +13043,7 @@ LoginViewModel.prototype.selectLanguage = function ()
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -13127,7 +13141,7 @@ AbstractSystemDropDownViewModel.prototype.onBuild = function ()
}
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -13141,7 +13155,7 @@ function MailBoxSystemDropDownViewModel()
}
Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -13155,7 +13169,7 @@ function SettingsSystemDropDownViewModel()
}
Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -13405,7 +13419,7 @@ MailBoxFolderListViewModel.prototype.contactsClick = function ()
kn.showScreenPopup(PopupsContactsViewModel);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -14312,7 +14326,7 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function ()
;
return !!oJua;
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15006,7 +15020,7 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
RL.reloadFlagsCurrentMessageListAndMessageFromCache();
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15037,7 +15051,7 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15070,7 +15084,7 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15232,7 +15246,7 @@ SettingsGeneral.prototype.selectLanguage = function ()
{
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15284,7 +15298,7 @@ SettingsContacts.prototype.onBuild = function ()
//{
//
//};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15367,7 +15381,7 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
}
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15457,7 +15471,7 @@ SettingsIdentity.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15676,7 +15690,7 @@ SettingsIdentities.prototype.onBuild = function (oDom)
});
}, 50);
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15709,7 +15723,7 @@ SettingsFilters.prototype.addFilter = function ()
{
kn.showScreenPopup(PopupsFilterViewModel, [new FilterModel()]);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15861,7 +15875,7 @@ SettingsSecurity.prototype.onBuild = function ()
this.processing(true);
RL.remote().getTwoFactor(this.onResult);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15930,7 +15944,7 @@ function SettingsSocialScreen()
}
Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -16037,7 +16051,7 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes
Utils.getNotification(Enums.Notification.CouldNotSaveNewPassword));
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -16234,7 +16248,7 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder)
oFolder.subScribed(false);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -16350,7 +16364,7 @@ SettingsThemes.prototype.onBuild = function ()
};
}));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -16420,7 +16434,7 @@ SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
RL.reloadOpenPgpKeys();
}
}
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -16555,7 +16569,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -17815,7 +17829,7 @@ WebMailDataStorage.prototype.findSelfPrivateKey = function (sPassword)
{
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -18099,7 +18113,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -18899,7 +18913,7 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
this.defaultRequest(fCallback, 'SocialUsers');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -18960,7 +18974,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData)
{
this.oServices = oData;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19280,7 +19294,7 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function
this.setMessageFlagsToCache(sFolder, sUid, aFlags);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19462,7 +19476,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19479,7 +19493,7 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype);
LoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19651,7 +19665,7 @@ MailBoxScreen.prototype.routes = function ()
[/^([^\/]*)$/, {'normalize_': fNormS}]
];
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19680,7 +19694,7 @@ SettingsScreen.prototype.onShow = function ()
RL.setTitle(this.sSettingsTitle);
RL.data().keyScope(Enums.KeyState.Settings);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -20040,7 +20054,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -21350,7 +21364,7 @@ RainLoopApp.prototype.bootstart = function ()
* @type {RainLoopApp}
*/
RL = new RainLoopApp();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
@ -21404,8 +21418,5 @@ window['__RLBOOT'] = function (fCall) {
});
};
if (window.SimplePace) {
window.SimplePace.add(10);
}
}(window, jQuery, ko, crossroads, hasher, moment, Jua, _, ifvisible, key));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5
vendors/labjs/LAB-debug.min.js vendored Normal file

File diff suppressed because one or more lines are too long

5
vendors/labjs/LAB.js vendored Normal file

File diff suppressed because one or more lines are too long

2
vendors/labjs/LAB.min.js vendored Normal file

File diff suppressed because one or more lines are too long

514
vendors/labjs/LAB.src.js vendored Normal file
View file

@ -0,0 +1,514 @@
/*! LAB.js (LABjs :: Loading And Blocking JavaScript)
v2.0.3 (c) Kyle Simpson
MIT License
*/
(function(global){
var _$LAB = global.$LAB,
// constants for the valid keys of the options object
_UseLocalXHR = "UseLocalXHR",
_AlwaysPreserveOrder = "AlwaysPreserveOrder",
_AllowDuplicates = "AllowDuplicates",
_CacheBust = "CacheBust",
/*!START_DEBUG*/_Debug = "Debug",/*!END_DEBUG*/
_BasePath = "BasePath",
// stateless variables used across all $LAB instances
root_page = /^[^?#]*\//.exec(location.href)[0],
root_domain = /^\w+\:\/\/\/?[^\/]+/.exec(root_page)[0],
append_to = document.head || document.getElementsByTagName("head"),
// inferences... ick, but still necessary
opera_or_gecko = (global.opera && Object.prototype.toString.call(global.opera) == "[object Opera]") || ("MozAppearance" in document.documentElement.style),
/*!START_DEBUG*/
// console.log() and console.error() wrappers
log_msg = function(){},
log_error = log_msg,
/*!END_DEBUG*/
// feature sniffs (yay!)
test_script_elem = document.createElement("script"),
explicit_preloading = typeof test_script_elem.preload == "boolean", // http://wiki.whatwg.org/wiki/Script_Execution_Control#Proposal_1_.28Nicholas_Zakas.29
real_preloading = explicit_preloading || (test_script_elem.readyState && test_script_elem.readyState == "uninitialized"), // will a script preload with `src` set before DOM append?
script_ordered_async = !real_preloading && test_script_elem.async === true, // http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order
// XHR preloading (same-domain) and cache-preloading (remote-domain) are the fallbacks (for some browsers)
xhr_or_cache_preloading = !real_preloading && !script_ordered_async && !opera_or_gecko
;
/*!START_DEBUG*/
// define console wrapper functions if applicable
if (global.console && global.console.log) {
if (!global.console.error) global.console.error = global.console.log;
log_msg = function(msg) { global.console.log(msg); };
log_error = function(msg,err) { global.console.error(msg,err); };
}
/*!END_DEBUG*/
// test for function
function is_func(func) { return Object.prototype.toString.call(func) == "[object Function]"; }
// test for array
function is_array(arr) { return Object.prototype.toString.call(arr) == "[object Array]"; }
// make script URL absolute/canonical
function canonical_uri(src,base_path) {
var absolute_regex = /^\w+\:\/\//;
// is `src` is protocol-relative (begins with // or ///), prepend protocol
if (/^\/\/\/?/.test(src)) {
src = location.protocol + src;
}
// is `src` page-relative? (not an absolute URL, and not a domain-relative path, beginning with /)
else if (!absolute_regex.test(src) && src.charAt(0) != "/") {
// prepend `base_path`, if any
src = (base_path || "") + src;
}
// make sure to return `src` as absolute
return absolute_regex.test(src) ? src : ((src.charAt(0) == "/" ? root_domain : root_page) + src);
}
// merge `source` into `target`
function merge_objs(source,target) {
for (var k in source) { if (source.hasOwnProperty(k)) {
target[k] = source[k]; // TODO: does this need to be recursive for our purposes?
}}
return target;
}
// does the chain group have any ready-to-execute scripts?
function check_chain_group_scripts_ready(chain_group) {
var any_scripts_ready = false;
for (var i=0; i<chain_group.scripts.length; i++) {
if (chain_group.scripts[i].ready && chain_group.scripts[i].exec_trigger) {
any_scripts_ready = true;
chain_group.scripts[i].exec_trigger();
chain_group.scripts[i].exec_trigger = null;
}
}
return any_scripts_ready;
}
// creates a script load listener
function create_script_load_listener(elem,registry_item,flag,onload) {
elem.onload = elem.onreadystatechange = function() {
if ((elem.readyState && elem.readyState != "complete" && elem.readyState != "loaded") || registry_item[flag]) return;
elem.onload = elem.onreadystatechange = null;
onload();
};
}
// script executed handler
function script_executed(registry_item) {
registry_item.ready = registry_item.finished = true;
for (var i=0; i<registry_item.finished_listeners.length; i++) {
registry_item.finished_listeners[i]();
}
registry_item.ready_listeners = [];
registry_item.finished_listeners = [];
}
// make the request for a scriptha
function request_script(chain_opts,script_obj,registry_item,onload,preload_this_script) {
// setTimeout() "yielding" prevents some weird race/crash conditions in older browsers
setTimeout(function(){
var script, src = script_obj.real_src, xhr;
// don't proceed until `append_to` is ready to append to
if ("item" in append_to) { // check if `append_to` ref is still a live node list
if (!append_to[0]) { // `append_to` node not yet ready
// try again in a little bit -- note: will re-call the anonymous function in the outer setTimeout, not the parent `request_script()`
setTimeout(arguments.callee,25);
return;
}
// reassign from live node list ref to pure node ref -- avoids nasty IE bug where changes to DOM invalidate live node lists
append_to = append_to[0];
}
script = document.createElement("script");
if (script_obj.type) script.type = script_obj.type;
if (script_obj.charset) script.charset = script_obj.charset;
// should preloading be used for this script?
if (preload_this_script) {
// real script preloading?
if (real_preloading) {
/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg("start script preload: "+src);/*!END_DEBUG*/
registry_item.elem = script;
if (explicit_preloading) { // explicit preloading (aka, Zakas' proposal)
script.preload = true;
script.onpreload = onload;
}
else {
script.onreadystatechange = function(){
if (script.readyState == "loaded") onload();
};
}
script.src = src;
// NOTE: no append to DOM yet, appending will happen when ready to execute
}
// same-domain and XHR allowed? use XHR preloading
else if (preload_this_script && src.indexOf(root_domain) == 0 && chain_opts[_UseLocalXHR]) {
xhr = new XMLHttpRequest(); // note: IE never uses XHR (it supports true preloading), so no more need for ActiveXObject fallback for IE <= 7
/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg("start script preload (xhr): "+src);/*!END_DEBUG*/
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
xhr.onreadystatechange = function(){}; // fix a memory leak in IE
registry_item.text = xhr.responseText + "\n//@ sourceURL=" + src; // http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
onload();
}
};
xhr.open("GET",src);
xhr.send();
}
// as a last resort, use cache-preloading
else {
/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg("start script preload (cache): "+src);/*!END_DEBUG*/
script.type = "text/cache-script";
create_script_load_listener(script,registry_item,"ready",function() {
append_to.removeChild(script);
onload();
});
script.src = src;
append_to.insertBefore(script,append_to.firstChild);
}
}
// use async=false for ordered async? parallel-load-serial-execute http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order
else if (script_ordered_async) {
/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg("start script load (ordered async): "+src);/*!END_DEBUG*/
script.async = false;
create_script_load_listener(script,registry_item,"finished",onload);
script.src = src;
append_to.insertBefore(script,append_to.firstChild);
}
// otherwise, just a normal script element
else {
/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg("start script load: "+src);/*!END_DEBUG*/
create_script_load_listener(script,registry_item,"finished",onload);
script.src = src;
append_to.insertBefore(script,append_to.firstChild);
}
},0);
}
// create a clean instance of $LAB
function create_sandbox() {
var global_defaults = {},
can_use_preloading = real_preloading || xhr_or_cache_preloading,
queue = [],
registry = {},
instanceAPI
;
// global defaults
global_defaults[_UseLocalXHR] = true;
global_defaults[_AlwaysPreserveOrder] = false;
global_defaults[_AllowDuplicates] = false;
global_defaults[_CacheBust] = false;
/*!START_DEBUG*/global_defaults[_Debug] = false;/*!END_DEBUG*/
global_defaults[_BasePath] = "";
// execute a script that has been preloaded already
function execute_preloaded_script(chain_opts,script_obj,registry_item) {
var script;
function preload_execute_finished() {
if (script != null) { // make sure this only ever fires once
script = null;
script_executed(registry_item);
}
}
if (registry[script_obj.src].finished) return;
if (!chain_opts[_AllowDuplicates]) registry[script_obj.src].finished = true;
script = registry_item.elem || document.createElement("script");
if (script_obj.type) script.type = script_obj.type;
if (script_obj.charset) script.charset = script_obj.charset;
create_script_load_listener(script,registry_item,"finished",preload_execute_finished);
// script elem was real-preloaded
if (registry_item.elem) {
registry_item.elem = null;
}
// script was XHR preloaded
else if (registry_item.text) {
script.onload = script.onreadystatechange = null; // script injection doesn't fire these events
script.text = registry_item.text;
}
// script was cache-preloaded
else {
script.src = script_obj.real_src;
}
append_to.insertBefore(script,append_to.firstChild);
// manually fire execution callback for injected scripts, since events don't fire
if (registry_item.text) {
preload_execute_finished();
}
}
// process the script request setup
function do_script(chain_opts,script_obj,chain_group,preload_this_script) {
var registry_item,
registry_items,
ready_cb = function(){ script_obj.ready_cb(script_obj,function(){ execute_preloaded_script(chain_opts,script_obj,registry_item); }); },
finished_cb = function(){ script_obj.finished_cb(script_obj,chain_group); }
;
script_obj.src = canonical_uri(script_obj.src,chain_opts[_BasePath]);
script_obj.real_src = script_obj.src +
// append cache-bust param to URL?
(chain_opts[_CacheBust] ? ((/\?.*$/.test(script_obj.src) ? "&_" : "?_") + ~~(Math.random()*1E9) + "=") : "")
;
if (!registry[script_obj.src]) registry[script_obj.src] = {items:[],finished:false};
registry_items = registry[script_obj.src].items;
// allowing duplicates, or is this the first recorded load of this script?
if (chain_opts[_AllowDuplicates] || registry_items.length == 0) {
registry_item = registry_items[registry_items.length] = {
ready:false,
finished:false,
ready_listeners:[ready_cb],
finished_listeners:[finished_cb]
};
request_script(chain_opts,script_obj,registry_item,
// which callback type to pass?
(
(preload_this_script) ? // depends on script-preloading
function(){
registry_item.ready = true;
for (var i=0; i<registry_item.ready_listeners.length; i++) {
registry_item.ready_listeners[i]();
}
registry_item.ready_listeners = [];
} :
function(){ script_executed(registry_item); }
),
// signal if script-preloading should be used or not
preload_this_script
);
}
else {
registry_item = registry_items[0];
if (registry_item.finished) {
finished_cb();
}
else {
registry_item.finished_listeners.push(finished_cb);
}
}
}
// creates a closure for each separate chain spawned from this $LAB instance, to keep state cleanly separated between chains
function create_chain() {
var chainedAPI,
chain_opts = merge_objs(global_defaults,{}),
chain = [],
exec_cursor = 0,
scripts_currently_loading = false,
group
;
// called when a script has finished preloading
function chain_script_ready(script_obj,exec_trigger) {
/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg("script preload finished: "+script_obj.real_src);/*!END_DEBUG*/
script_obj.ready = true;
script_obj.exec_trigger = exec_trigger;
advance_exec_cursor(); // will only check for 'ready' scripts to be executed
}
// called when a script has finished executing
function chain_script_executed(script_obj,chain_group) {
/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg("script execution finished: "+script_obj.real_src);/*!END_DEBUG*/
script_obj.ready = script_obj.finished = true;
script_obj.exec_trigger = null;
// check if chain group is all finished
for (var i=0; i<chain_group.scripts.length; i++) {
if (!chain_group.scripts[i].finished) return;
}
// chain_group is all finished if we get this far
chain_group.finished = true;
advance_exec_cursor();
}
// main driver for executing each part of the chain
function advance_exec_cursor() {
while (exec_cursor < chain.length) {
if (is_func(chain[exec_cursor])) {
/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg("$LAB.wait() executing: "+chain[exec_cursor]);/*!END_DEBUG*/
try { chain[exec_cursor++](); } catch (err) {
/*!START_DEBUG*/if (chain_opts[_Debug]) log_error("$LAB.wait() error caught: ",err);/*!END_DEBUG*/
}
continue;
}
else if (!chain[exec_cursor].finished) {
if (check_chain_group_scripts_ready(chain[exec_cursor])) continue;
break;
}
exec_cursor++;
}
// we've reached the end of the chain (so far)
if (exec_cursor == chain.length) {
scripts_currently_loading = false;
group = false;
}
}
// setup next chain script group
function init_script_chain_group() {
if (!group || !group.scripts) {
chain.push(group = {scripts:[],finished:true});
}
}
// API for $LAB chains
chainedAPI = {
// start loading one or more scripts
script:function(){
for (var i=0; i<arguments.length; i++) {
(function(script_obj,script_list){
var splice_args;
if (!is_array(script_obj)) {
script_list = [script_obj];
}
for (var j=0; j<script_list.length; j++) {
init_script_chain_group();
script_obj = script_list[j];
if (is_func(script_obj)) script_obj = script_obj();
if (!script_obj) continue;
if (is_array(script_obj)) {
// set up an array of arguments to pass to splice()
splice_args = [].slice.call(script_obj); // first include the actual array elements we want to splice in
splice_args.unshift(j,1); // next, put the `index` and `howMany` parameters onto the beginning of the splice-arguments array
[].splice.apply(script_list,splice_args); // use the splice-arguments array as arguments for splice()
j--; // adjust `j` to account for the loop's subsequent `j++`, so that the next loop iteration uses the same `j` index value
continue;
}
if (typeof script_obj == "string") script_obj = {src:script_obj};
script_obj = merge_objs(script_obj,{
ready:false,
ready_cb:chain_script_ready,
finished:false,
finished_cb:chain_script_executed
});
group.finished = false;
group.scripts.push(script_obj);
do_script(chain_opts,script_obj,group,(can_use_preloading && scripts_currently_loading));
scripts_currently_loading = true;
if (chain_opts[_AlwaysPreserveOrder]) chainedAPI.wait();
}
})(arguments[i],arguments[i]);
}
return chainedAPI;
},
// force LABjs to pause in execution at this point in the chain, until the execution thus far finishes, before proceeding
wait:function(){
if (arguments.length > 0) {
for (var i=0; i<arguments.length; i++) {
chain.push(arguments[i]);
}
group = chain[chain.length-1];
}
else group = false;
advance_exec_cursor();
return chainedAPI;
}
};
// the first chain link API (includes `setOptions` only this first time)
return {
script:chainedAPI.script,
wait:chainedAPI.wait,
setOptions:function(opts){
merge_objs(opts,chain_opts);
return chainedAPI;
}
};
}
// API for each initial $LAB instance (before chaining starts)
instanceAPI = {
// main API functions
setGlobalDefaults:function(opts){
merge_objs(opts,global_defaults);
return instanceAPI;
},
setOptions:function(){
return create_chain().setOptions.apply(null,arguments);
},
script:function(){
return create_chain().script.apply(null,arguments);
},
wait:function(){
return create_chain().wait.apply(null,arguments);
},
// built-in queuing for $LAB `script()` and `wait()` calls
// useful for building up a chain programmatically across various script locations, and simulating
// execution of the chain
queueScript:function(){
queue[queue.length] = {type:"script", args:[].slice.call(arguments)};
return instanceAPI;
},
queueWait:function(){
queue[queue.length] = {type:"wait", args:[].slice.call(arguments)};
return instanceAPI;
},
runQueue:function(){
var $L = instanceAPI, len=queue.length, i=len, val;
for (;--i>=0;) {
val = queue.shift();
$L = $L[val.type].apply(null,val.args);
}
return $L;
},
// rollback `[global].$LAB` to what it was before this file was loaded, the return this current instance of $LAB
noConflict:function(){
global.$LAB = _$LAB;
return instanceAPI;
},
// create another clean instance of $LAB
sandbox:function(){
return create_sandbox();
}
};
return instanceAPI;
}
// create the main instance of $LAB
global.$LAB = create_sandbox();
/* The following "hack" was suggested by Andrea Giammarchi and adapted from: http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html
NOTE: this hack only operates in FF and then only in versions where document.readyState is not present (FF < 3.6?).
The hack essentially "patches" the **page** that LABjs is loaded onto so that it has a proper conforming document.readyState, so that if a script which does
proper and safe dom-ready detection is loaded onto a page, after dom-ready has passed, it will still be able to detect this state, by inspecting the now hacked
document.readyState property. The loaded script in question can then immediately trigger any queued code executions that were waiting for the DOM to be ready.
For instance, jQuery 1.4+ has been patched to take advantage of document.readyState, which is enabled by this hack. But 1.3.2 and before are **not** safe or
fixed by this hack, and should therefore **not** be lazy-loaded by script loader tools such as LABjs.
*/
(function(addEvent,domLoaded,handler){
if (document.readyState == null && document[addEvent]){
document.readyState = "loading";
document[addEvent](domLoaded,handler = function(){
document.removeEventListener(domLoaded,handler,false);
document.readyState = "complete";
},false);
}
})("addEventListener","DOMContentLoaded");
})(this);

100
vendors/labjs/README.md vendored Normal file
View file

@ -0,0 +1,100 @@
LABjs (Loading And Blocking JavaScript)
=======================================
**NOTE: LABjs is still supported, and still encouraged to be used if it makes sense for your project. But, no further development beyond bug fixes is expected. LABjs is almost 4 years old, and has been stable (no bug fixes/patches) for almost 2 years. Thank you to the community for your support of this project over the last 4 years.**
LABjs is a dynamic script loader intended to replace the use of the ugly, non-performant &lt;script> tag with a flexible and performance-optimized alternative API.
The defining characteristic of LABjs is the ability to load *all* JavaScript files in parallel, as fast as the browser will allow, but giving you the option to ensure proper execution order if you have dependencies between files.
For instance, the following "&lt;script> tag soup":
<script src="http://remote.tld/jquery.js"></script>
<script src="local/plugin1.jquery.js"></script>
<script src="local/plugin2.jquery.js"></script>
<script src="local/init.js"></script>
<script>
initMyPage();
</script>
With LABjs becomes:
<script src="LAB.js"></script>
<script>
$LAB
.script("http://remote.tld/jquery.js").wait()
.script("/local/plugin1.jquery.js")
.script("/local/plugin2.jquery.js").wait()
.script("/local/init.js").wait(function(){
initMyPage();
});
</script>
The differences between the two snippets is that with regular &lt;script> tags, you cannot control their loading and executing behavior reliably cross-browser. Some new browsers will load them in parallel but execute them serially, delaying execution of a smaller (quicker loading) script in the pessimistic assumption of dependency on previous scripts. Older browsers will load *and* execute them one-at-a-time, completely losing any parallel loading speed optimizations and slowing the whole process drastically.
All browsers will, however, block other page resources (like stylesheets, images, etc) while these scripts are loading, which causes the rest of the page's content loading to appear much more sluggish to the user.
LABjs by contrast will load ALL the scripts in parallel, and will execute them as soon as possible, unless you express an execution order dependency in the chain by inserting .wait(). In addition, you can "couple" inline script logic to execute in the proper order in your chain as desired by passing a function to .wait(...).
It's important to realize that explicitly, separate $LAB chains operate completely independently, meaning there will be no explicit waiting for execution order between them.
NOTE: JavaScript execution is always still a single-threaded, first-come-first-served environment. Also, some browsers use internal loading queues which create implicit "blocking" on script execution between separate chains. Also, the 'AllowDuplicates:false' config option will de-duplicate across chains, meaning chain B can be made to implicitly "wait" on chain A if chain B references a same script URL as chain A, and that script is still downloading.
Build Process
-------------
There is no "official" build process or script. There is however "BUILD.md" which lists the steps that I take to prepare the LAB.min.js and LAB-debug.min.js files.
Configuration
-------------
There are a number of configuration options which can be specified either globally (for all $LAB chains on the page) or per chain.
For instance:
$LAB.setGlobalDefaults({AlwaysPreserveOrder:true});
would tell all $LAB chains to insert an implicit .wait() call in between each .script() call. The behavior is identical to if you just put the .wait() call in yourself.
$LAB.setOptions({AlwaysPreserveOrder:true}).script(...)...
would tell just this particular $LAB chain to do the same.
The configuration options available are:
* `UseLocalXHR`: true/false (default true): use XHR to preload scripts from local (same-domain) locations
* `AlwaysPreserveOrder`: true/false (default false): whether to insert an implicit .wait() call after each script load request... if turned on, prevents immediate execution of loaded files and instead executes all scripts in order
* `AllowDuplicates`: true/false (default true): whether to inspect the current page and $LAB loading cache to see if the same script URL has already been requested and allow (true) or ignore (false) if so. NOTE: in v1.2.0 and before, this didn't work correctly across multiple $LAB chains, but as of v2.0, it works correctly.
* `CacheBust`: true/false (default false): adds a cache-busting parameter (random number) to the end of a script URL
* `BasePath`: {string} (default ""): a path string to prepend to every script request's URL
Protocol-relative URLs
----------------------
Browsers have long supported "protocol-relative URLs", which basically means leaving off the "http:" or "https:" portion of a URL (leaving just the "//domain.tld/path/..." part), which causes that URL to be assumed to be the same protocol as the parent page. The benefit is that if you have a page that can be viewed in either HTTP or HTTPS, and your resources can (and need to be) served through either HTTP or HTTPS, respectively, you can simply list your URLs as protocol-relative and the browser will auto-select based on which protocol the page is viewed in.
LABjs now supports specifying such URLs to any script URL setting. NOTE: This is the recommended way to specify URLs for script resources if: a) the page you're serving can be viewed in both HTTP and HTTPS; and b) the script resource you're linking to can be accessed using the exact same domain/path with exception to the protocol.
A common example of such a resource is the CDN locations on the Google Ajax API, where popular frameworks like jQuery and Dojo are hosted. If you are linking to such CDN resources, you are strongly encouraged to change to using protocol-relative URLs, like "//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" instead of "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" or "https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js".
New in v2.0
-----------
* `AllowDuplicates` now actually works across chains. This is very important for those who want to use multiple/nested $LAB chains as part of a shared-dependency loading mechanism.
* Chains are now fully resumable, meaning you can save the return value from the last call to a chained function, and then use that saved value later as the starting point to resume the chain from where it left off.
* Queueing is now built-in, with `queueScript`, `queueWait` and `runQueue` -- this important for those who want to build up the chain across multiple files or inline &lt;script> elements (like in the CMS case), but want to defer starting the loading of the code starting until later (usually at the bottom of the page).
* LABjs now supports `noConflict` (for rolling back to a previous version/copy of $LAB on the page) and `sandbox` (for creating a new pristine sandboxed copy of the current $LAB)
* LABjs now relies on feature-testing for `async=false` and implicit/explicit "true preloading" (currently only IE, but in the spec process). Ugly/hacky "cache preloading" is now only used for "older webkit" (before March 2011 nightlies, etc), and even then, only for remote files.
* For XHR preloading (only used in "older webkit" for local files, by default), to support better debugability, "// @sourceURL=..." is appended to the end of the code, to map the XHR/injected code to a real file name. Currently, browsers only support this for eval() (not script injection, like LABjs uses). It is hoped that browsers will soon support this annotation for their developer-tools.
* Speaking of debugging, LABjs now supports a DEBUG mode (only if you use the source file, or if you use the LABjs-debug.min.js production file) *and* enable the "Debug" config option, which captures all the inner workings (and any errors in .wait() calls) to the browser's console.log, if present.
* LABjs now supports a "CacheBust" config option, which will attempt to make sure all loaded scripts are forcibly loaded new on each page refresh, by auto-appending a random number parameter to each URL. ****This is really only practical/advised for DEV environments, where you want to ensure that the code reloads every time. Doing so in production would be really bad for user performance.*****
* As part of LABjs' rewrite, the code style is now significantly improved in readability (most "minification" hacks have been removed), and it's also using more memory-savvy code, such as far fewer closures. As a result, LABjs should run leaner and faster, if only by a little bit. The goal is to get LABjs out of the way so your scripts load and run as fast as possible.
* "AppendTo", "UsePreloading", and "UseCachePreloading" options were removed as they are no longer useful. This is the only backwards-incompatible change (no actual API changes, just config), and the change should just cause older usage code to continue to operate as normal while ignoring the no longer supported options. Still, test your code carefully if you've been using either of those 3 config options before.

191
vendors/labjs/fLAB.src.js vendored Normal file
View file

@ -0,0 +1,191 @@
// fLAB.js (file:// protocol adapter for LABjs 1.x only)
// v0.2 (c) Kyle Simpson
// MIT License
(function(global){
var orig_$LAB = global.$LAB,
oDOC = global.document,
oDOCLOC = oDOC.location,
local_filesystem = (oDOCLOC.protocol === "file:")
;
if (!orig_$LAB || !local_filesystem) return; // only adapt LABjs with fLABjs wrapper if LABjs exists and we're currently in local filesystem
var sUNDEF = "undefined", // constants used for compression optimization
sSTRING = "string",
sHEAD = "head",
sBODY = "body",
sFUNCTION = "function",
sSCRIPT = "script",
sSRCURI = "srcuri",
sDONE = "done",
sWHICH = "which",
bTRUE = true,
bFALSE = false,
fSETTIMEOUT = global.setTimeout,
fGETELEMENTSBYTAGNAME = function(tn){return oDOC.getElementsByTagName(tn);},
fOBJTOSTRING = Object.prototype.toString,
fNOOP = function(){},
append_to = {},
all_scripts = {},
PAGEROOT = /^[^?#]*\//.exec(oDOCLOC.href)[0],
DOCROOT = /^file:\/\/(localhost)?(\/[a-z]:)?/i.exec(PAGEROOT)[0],
docScripts = fGETELEMENTSBYTAGNAME(sSCRIPT),
is_ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
sync_script_loading = is_ie, // only IE is currently known to do synchronous loading of file:// scripts, others require core LABjs async functionality
global_defs = {
dupe:bFALSE, // allow duplicate scripts?
preserve:bFALSE, // preserve execution order of all loaded scripts (regardless of preloading)
base:"", // base path to prepend to all non-absolute-path scripts
which:sHEAD // which DOM object ("head" or "body") to append scripts to
}
;
append_to[sHEAD] = fGETELEMENTSBYTAGNAME(sHEAD);
append_to[sBODY] = fGETELEMENTSBYTAGNAME(sBODY);
function canonicalScriptURI(src,base_path) {
if (typeof src !== sSTRING) src = "";
if (typeof base_path !== sSTRING) base_path = "";
var ret = (/^file\:\/\//.test(src) ? "" : base_path) + src;
return ((/^file\:\/\//.test(ret) ? "" : (ret.charAt(0) === "/" ? DOCROOT : PAGEROOT)) + ret);
}
function scriptTagExists(uri) { // checks if a script uri has ever been loaded into this page's DOM
var i = 0, script;
while (script = docScripts[i++]) {
if (typeof script.src === sSTRING && uri === canonicalScriptURI(script.src)) return bTRUE;
}
return bFALSE;
}
function engine(opts) {
if (typeof opts === sUNDEF) opts = global_defs;
var ready = bFALSE,
_which = opts.which,
_base_path = opts.base,
waitFunc = fNOOP,
scripts_loading = bFALSE,
publicAPI,
scripts = {},
orig_engine = null
;
function createScriptTag(scriptentry,src,type,charset) {
if (append_to[scriptentry[sWHICH]][0] === null) { // append_to object not yet ready
fSETTIMEOUT(arguments.callee,25);
return;
}
var scriptElem = oDOC.createElement(sSCRIPT), fSETATTRIBUTE = function(attr,val){scriptElem.setAttribute(attr,val);};
fSETATTRIBUTE("type",type);
if (typeof charset === sSTRING) fSETATTRIBUTE("charset",charset);
fSETATTRIBUTE("src",src);
append_to[scriptentry[sWHICH]][0].appendChild(scriptElem);
}
function loadScript(o) {
if (typeof o.allowDup === sUNDEF) o.allowDup = opts.dupe;
var src = o.src, type = o.type, charset = o.charset, allowDup = o.allowDup,
src_uri = canonicalScriptURI(src,_base_path), scriptentry;
if (typeof type !== sSTRING) type = "text/javascript";
if (typeof charset !== sSTRING) charset = null;
allowDup = !(!allowDup);
if (!allowDup &&
(
(typeof all_scripts[src_uri] !== sUNDEF && all_scripts[src_uri] !== null) ||
scriptTagExists(src_uri)
)
) {
return;
}
if (typeof scripts[src_uri] === sUNDEF) scripts[src_uri] = {};
scriptentry = scripts[src_uri];
if (typeof scriptentry[sWHICH] === sUNDEF) scriptentry[sWHICH] = _which;
scriptentry[sDONE] = bFALSE;
scriptentry[sSRCURI] = src_uri;
scripts_loading = bTRUE;
all_scripts[scriptentry[sSRCURI]] = bTRUE;
createScriptTag(scriptentry,src_uri,type,charset);
}
function serializeArgs(args) {
var sargs = [], i;
for (i=0; i<args.length; i++) {
if (fOBJTOSTRING.call(args[i]) === "[object Array]") sargs = sargs.concat(serializeArgs(args[i]));
else sargs[sargs.length] = args[i];
}
return sargs;
}
publicAPI = {
script:function() {
var args = serializeArgs(arguments), use_engine, i;
for (i=0; i<args.length; i++) {
if (typeof args[i] === sSTRING) args[i] = {src:canonicalScriptURI(args[i])};
else if (typeof args[i].src !== sUNDEF) args[i].src = canonicalScriptURI(args[i].src);
}
if (sync_script_loading) { // handle without core LABjs since we're sync loading
use_engine = publicAPI;
for (i=0; i<args.length; i++) loadScript(args[i]);
}
else { // pass off to core LABjs to handle async loading
if (orig_engine === null) orig_engine = orig_$LAB.setOptions(opts.pubMap);
use_engine = orig_engine = orig_engine.script.apply(null,args);
}
return use_engine;
},
wait:function(func) {
var use_engine;
if (typeof func !== sFUNCTION) func = fNOOP;
if (sync_script_loading) { // execute immediately since we're sync loading
use_engine = publicAPI;
fSETTIMEOUT(func,0);
}
else { // pass off to core LABjs to handle since we're async loading
if (orig_engine === null) orig_engine = orig_$LAB.setOptions(opts.pubMap);
use_engine = orig_engine = orig_engine.wait(func);
}
return use_engine;
}
};
publicAPI.block = publicAPI.wait; // alias "block" to "wait" -- "block" is now deprecated
return publicAPI;
}
function processOpts(opts) {
var k, newOpts = {},
boolOpts = {"AlwaysPreserveOrder":"preserve","AllowDuplicates":"dupe"},
allOpts = {"AppendTo":"which","BasePath":"base"}
;
for (k in boolOpts) allOpts[k] = boolOpts[k];
for (k in allOpts) {
if (allOpts.hasOwnProperty(k) && typeof global_defs[allOpts[k]] !== sUNDEF) newOpts[allOpts[k]] = (opts && typeof opts[k] !== sUNDEF) ? opts[k] : global_defs[allOpts[k]];
}
for (k in boolOpts) { // normalize bool props to actual boolean values if not already
if (boolOpts.hasOwnProperty(k)) newOpts[boolOpts[k]] = !(!newOpts[boolOpts[k]]);
}
newOpts.preload = newOpts.cache = newOpts.order = newOpts.xhr = bFALSE; // don't use any preloading techniques if working in file:///
newOpts.which = (newOpts.which === sHEAD || newOpts.which === sBODY) ? newOpts.which : sHEAD;
newOpts.pubMap = {};
for (k in allOpts) {
if (allOpts.hasOwnProperty(k)) newOpts.pubMap[k] = newOpts[allOpts[k]]; // create a hash of reverse mappings back to the public names, suitable to pass along to orig_$LAB.setOptions()
}
return newOpts;
}
global.$LAB = {
setGlobalDefaults:function(gdefs) { // intentionally does not return an "engine" instance -- must call as stand-alone function call on $LAB
global_defs = processOpts(gdefs);
},
setOptions:function(opts){ // set options per chain
return engine(processOpts(opts));
},
script:function(){ // will load one or more scripts
return engine().script.apply(null,arguments);
},
wait:function(){ // will ensure that the chain's previous scripts are executed before execution of scripts in subsequent chain links
return engine().wait.apply(null,arguments);
}
};
global.$LAB.block = global.$LAB.wait; // alias "block" to "wait" -- "block" is now deprecated
})(window);

View file

@ -1,2 +0,0 @@
/*! RainLoop Top Driver v1.0 (c) 2013 RainLoop Team; Licensed under MIT */
!function(t,h){function s(){}s.prototype.s=t.sessionStorage,s.prototype.t=t.top||t,s.prototype.getHash=function(){var t=null;if(this.s)t=this.s.getItem("__rlA")||null;else if(this.t){var s=this.t.name&&h&&"{"===this.t.name.toString().substr(0,1)?h.parse(this.t.name.toString()):null;t=s?s.__rlA||null:null}return t},s.prototype.setHash=function(){var s=t.rainloopAppData,n=null;this.s?this.s.setItem("__rlA",s&&s.AuthAccountHash?s.AuthAccountHash:""):this.t&&h&&(n={},n.__rlA=s&&s.AuthAccountHash?s.AuthAccountHash:"",this.t.name=h.stringify(n))},s.prototype.clearHash=function(){this.s?this.s.setItem("__rlA",""):this.t&&(this.t.name="")},t._rlhh=new s,t.__rlah=function(){return t._rlhh?t._rlhh.getHash():null},t.__rlah_set=function(){t._rlhh&&t._rlhh.setHash()},t.__rlah_clear=function(){t._rlhh&&t._rlhh.clearHash()}}(window,window.JSON);

2
vendors/rl/rl-1.1.min.js vendored Normal file
View file

@ -0,0 +1,2 @@
/*! RainLoop Index Helper v1.1 (c) 2014 RainLoop Team; Licensed under MIT */
!function(t,n){function e(){}e.prototype.s=t.sessionStorage,e.prototype.t=t.top||t,e.prototype.getHash=function(){var t=null;if(this.s)t=this.s.getItem("__rlA")||null;else if(this.t){var e=this.t.name&&n&&"{"===this.t.name.toString().substr(0,1)?n.parse(this.t.name.toString()):null;t=e?e.__rlA||null:null}return t},e.prototype.setHash=function(){var e=t.rainloopAppData,s=null;this.s?this.s.setItem("__rlA",e&&e.AuthAccountHash?e.AuthAccountHash:""):this.t&&n&&(s={},s.__rlA=e&&e.AuthAccountHash?e.AuthAccountHash:"",this.t.name=n.stringify(s))},e.prototype.clearHash=function(){this.s?this.s.setItem("__rlA",""):this.t&&(this.t.name="")},t._rlhh=new e,t.__rlah=function(){return t._rlhh?t._rlhh.getHash():null},t.__rlah_set=function(){t._rlhh&&t._rlhh.setHash()},t.__rlah_clear=function(){t._rlhh&&t._rlhh.clearHash()},t.__includeScr=function(t){document.write(unescape('%3Cscript data-cfasync="false" type="text/javascript" src="'+t+'"%3E%3C/script%3E'))},t.__showError=function(){var n=document.getElementById("rl-loading"),e=document.getElementById("rl-loading-error");n&&(n.style.display="none"),e&&(e.style.display="block"),t.SimplePace&&t.SimplePace.set(100)},t.__simplePace=function(n){t.SimplePace&&t.SimplePace.add(n)},t.__runBoot=function(n){t.__RLBOOT&&!n?t.__RLBOOT(function(t){t||__showError()}):__showError()}}(window,window.JSON);

37
vendors/rl/rl.js vendored
View file

@ -1,4 +1,4 @@
/*! RainLoop Top Driver v1.0 (c) 2013 RainLoop Team; Licensed under MIT */
/*! RainLoop Index Helper v1.1 (c) 2013 RainLoop Team; Licensed under MIT */
(function (window, JSON) {
/**
@ -51,14 +51,49 @@
window['__rlah'] = function () {
return window['_rlhh'] ? window['_rlhh']['getHash']() : null;
};
window['__rlah_set'] = function () {
if (window['_rlhh']) {
window['_rlhh']['setHash']();
}
};
window['__rlah_clear'] = function () {
if (window['_rlhh']) {
window['_rlhh']['clearHash']();
}
};
// index function
window['__includeScr'] = function (sSrc) {
document.write(unescape('%3Csc' + 'ript data-cfasync="false" type="text/jav' + 'ascr' + 'ipt" sr' + 'c="' + sSrc + '"%3E%3C/' + 'scr' + 'ipt%3E'));
};
window['__showError'] = function () {
var oR = document.getElementById('rl-loading'),
oL = document.getElementById('rl-loading-error');
if (oR) {oR.style.display = 'none';}
if (oL) {oL.style.display = 'block';}
if (window.SimplePace) {window.SimplePace.set(100);}
};
window['__simplePace'] = function (nVal) {
if (window.SimplePace) {
window.SimplePace.add(nVal);
}
};
window['__runBoot'] = function (bWithError) {
if (window.__RLBOOT && !bWithError) {
window.__RLBOOT(function (bV) {
if (!bV) {
__showError();
}
});
} else {
__showError();
}
};
}(window, window.JSON));