mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 23:17:02 +03:00
Improve scripts load system
This commit is contained in:
parent
58b9eed8e8
commit
72bf212f67
39 changed files with 916 additions and 411 deletions
2
vendors/es6-promise-polyfill/.gitignore
vendored
Normal file
2
vendors/es6-promise-polyfill/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/node_modules
|
||||
/tmp
|
||||
3
vendors/es6-promise-polyfill/.npmignore
vendored
Normal file
3
vendors/es6-promise-polyfill/.npmignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
/node_modules/
|
||||
/tmp
|
||||
/test
|
||||
6
vendors/es6-promise-polyfill/.travis.yml
vendored
Normal file
6
vendors/es6-promise-polyfill/.travis.yml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
node_js:
|
||||
- "0.12"
|
||||
- "node"
|
||||
- "iojs"
|
||||
18
vendors/es6-promise-polyfill/CHANGELOG.md
vendored
Normal file
18
vendors/es6-promise-polyfill/CHANGELOG.md
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
## 1.2.0 (December 8, 2015)
|
||||
|
||||
- Support for IE8 and below
|
||||
- Promises/A+ tests added
|
||||
|
||||
## 1.1.0 (October 16, 2015)
|
||||
|
||||
- Change way to get reference to `global`, since `Function()()` may be prohibited
|
||||
- Add AMD support
|
||||
|
||||
## 1.0.1 (September 14, 2015)
|
||||
|
||||
- Fix exports - use polyfill only if native implementation isn't supported
|
||||
- Add license
|
||||
|
||||
## 1.0.0 (June 19, 2014)
|
||||
|
||||
- Init release
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
Copyright 2015 RainLoop Team
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Roman Dvornov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
|
@ -17,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
88
vendors/es6-promise-polyfill/README.md
vendored
Normal file
88
vendors/es6-promise-polyfill/README.md
vendored
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
[](https://www.npmjs.com/package/es6-promise-polyfill)
|
||||
[](https://travis-ci.org/lahmatiy/es6-promise-polyfill)
|
||||
|
||||
# ES6 Promise polyfill
|
||||
|
||||
This is a polyfill of [ES6 Promise](https://github.com/domenic/promises-unwrapping). The implementation based on [Jake Archibald implementation](https://github.com/jakearchibald/es6-promise) a subset of [rsvp.js](https://github.com/tildeio/rsvp.js). If you're wanting extra features and more debugging options, check out the [full library](https://github.com/tildeio/rsvp.js).
|
||||
|
||||
For API details and how to use promises, see the <a href="http://www.html5rocks.com/en/tutorials/es6/promises/">JavaScript Promises HTML5Rocks article</a>.
|
||||
|
||||
## Notes
|
||||
|
||||
The main target: implementation should be conformance with browser's implementations and to be minimal as possible in size. So it's strictly polyfill of ES6 Promise specification and nothing more.
|
||||
|
||||
It passes both [Promises/A+ test suite](https://github.com/promises-aplus/promises-tests) and [rsvp.js test suite](https://github.com/jakearchibald/es6-promise/tree/master/test). And as small as 2,6KB min (or 1KB min+gzip).
|
||||
|
||||
The polyfill uses `setImmediate` if available, or fallback to use `setTimeout`. Use [setImmediate polyfill](https://github.com/YuzuJS/setImmediate) by @YuzuJS to reach better performance.
|
||||
|
||||
## How to use
|
||||
|
||||
### Browser
|
||||
|
||||
To install:
|
||||
|
||||
```sh
|
||||
bower install es6-promise-polyfill
|
||||
```
|
||||
|
||||
To use:
|
||||
|
||||
```html
|
||||
<script src="bower_components/es6-promise-polyfill/promise.min.js"></script>
|
||||
<script>
|
||||
var promise = new Promise(...);
|
||||
</script>
|
||||
```
|
||||
|
||||
### Node.js
|
||||
|
||||
To install:
|
||||
|
||||
```sh
|
||||
npm install es6-promise-polyfill
|
||||
```
|
||||
|
||||
To use:
|
||||
|
||||
```js
|
||||
var Promise = require('es6-promise-polyfill').Promise;
|
||||
var promise = new Promise(...);
|
||||
```
|
||||
|
||||
### AMD
|
||||
|
||||
To install:
|
||||
|
||||
```sh
|
||||
npm install es6-promise-polyfill
|
||||
```
|
||||
|
||||
To use:
|
||||
|
||||
```js
|
||||
define(['es6-promise-polyfill'], function(Promise) {
|
||||
var promise = new Promise(...);
|
||||
});
|
||||
```
|
||||
|
||||
## Usage in IE<9
|
||||
|
||||
`catch` is a reserved word in IE<9, meaning `promise.catch(func)` throws a syntax error. To work around this, use a string to access the property:
|
||||
|
||||
```js
|
||||
promise['catch'](function(err) {
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Or use `.then` instead:
|
||||
|
||||
```js
|
||||
promise.then(undefined, function(err) {
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Licensed under the MIT License.
|
||||
11
vendors/es6-promise-polyfill/bower.json
vendored
Normal file
11
vendors/es6-promise-polyfill/bower.json
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "es6-promise-polyfill",
|
||||
"version": "1.1.1",
|
||||
"main": "promise.js",
|
||||
"ignore": [
|
||||
".*",
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
27
vendors/es6-promise-polyfill/package.json
vendored
Normal file
27
vendors/es6-promise-polyfill/package.json
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "es6-promise-polyfill",
|
||||
"description": "Polyfill for ES6 Promise",
|
||||
"version": "1.2.0",
|
||||
"author": "Roman Dvornov <rdvornov@gmail.com>",
|
||||
"license": "MIT",
|
||||
"repository": "lahmatiy/es6-promise-polyfill",
|
||||
"bugs": {
|
||||
"url": "https://github.com/lahmatiy/es6-promise-polyfill/issues"
|
||||
},
|
||||
"main": "promise.js",
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
"promises-aplus-tests": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "promises-aplus-tests test/test-adapter"
|
||||
},
|
||||
"keywords": [
|
||||
"es6",
|
||||
"es2015",
|
||||
"polyfill",
|
||||
"promise",
|
||||
"promises"
|
||||
]
|
||||
}
|
||||
346
vendors/es6-promise-polyfill/promise.js
vendored
Normal file
346
vendors/es6-promise-polyfill/promise.js
vendored
Normal file
|
|
@ -0,0 +1,346 @@
|
|||
(function(global){
|
||||
|
||||
//
|
||||
// Check for native Promise and it has correct interface
|
||||
//
|
||||
|
||||
var NativePromise = global['Promise'];
|
||||
var nativePromiseSupported =
|
||||
NativePromise &&
|
||||
// Some of these methods are missing from
|
||||
// Firefox/Chrome experimental implementations
|
||||
'resolve' in NativePromise &&
|
||||
'reject' in NativePromise &&
|
||||
'all' in NativePromise &&
|
||||
'race' in NativePromise &&
|
||||
// Older version of the spec had a resolver object
|
||||
// as the arg rather than a function
|
||||
(function(){
|
||||
var resolve;
|
||||
new NativePromise(function(r){ resolve = r; });
|
||||
return typeof resolve === 'function';
|
||||
})();
|
||||
|
||||
|
||||
//
|
||||
// export if necessary
|
||||
//
|
||||
|
||||
if (typeof exports !== 'undefined' && exports)
|
||||
{
|
||||
// node.js
|
||||
exports.Promise = nativePromiseSupported ? NativePromise : Promise;
|
||||
exports.Polyfill = Promise;
|
||||
}
|
||||
else
|
||||
{
|
||||
// AMD
|
||||
if (typeof define == 'function' && define.amd)
|
||||
{
|
||||
define(function(){
|
||||
return nativePromiseSupported ? NativePromise : Promise;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// in browser add to global
|
||||
if (!nativePromiseSupported)
|
||||
global['Promise'] = Promise;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Polyfill
|
||||
//
|
||||
|
||||
var PENDING = 'pending';
|
||||
var SEALED = 'sealed';
|
||||
var FULFILLED = 'fulfilled';
|
||||
var REJECTED = 'rejected';
|
||||
var NOOP = function(){};
|
||||
|
||||
function isArray(value) {
|
||||
return Object.prototype.toString.call(value) === '[object Array]';
|
||||
}
|
||||
|
||||
// async calls
|
||||
var asyncSetTimer = typeof setImmediate !== 'undefined' ? setImmediate : setTimeout;
|
||||
var asyncQueue = [];
|
||||
var asyncTimer;
|
||||
|
||||
function asyncFlush(){
|
||||
// run promise callbacks
|
||||
for (var i = 0; i < asyncQueue.length; i++)
|
||||
asyncQueue[i][0](asyncQueue[i][1]);
|
||||
|
||||
// reset async asyncQueue
|
||||
asyncQueue = [];
|
||||
asyncTimer = false;
|
||||
}
|
||||
|
||||
function asyncCall(callback, arg){
|
||||
asyncQueue.push([callback, arg]);
|
||||
|
||||
if (!asyncTimer)
|
||||
{
|
||||
asyncTimer = true;
|
||||
asyncSetTimer(asyncFlush, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function invokeResolver(resolver, promise) {
|
||||
function resolvePromise(value) {
|
||||
resolve(promise, value);
|
||||
}
|
||||
|
||||
function rejectPromise(reason) {
|
||||
reject(promise, reason);
|
||||
}
|
||||
|
||||
try {
|
||||
resolver(resolvePromise, rejectPromise);
|
||||
} catch(e) {
|
||||
rejectPromise(e);
|
||||
}
|
||||
}
|
||||
|
||||
function invokeCallback(subscriber){
|
||||
var owner = subscriber.owner;
|
||||
var settled = owner.state_;
|
||||
var value = owner.data_;
|
||||
var callback = subscriber[settled];
|
||||
var promise = subscriber.then;
|
||||
|
||||
if (typeof callback === 'function')
|
||||
{
|
||||
settled = FULFILLED;
|
||||
try {
|
||||
value = callback(value);
|
||||
} catch(e) {
|
||||
reject(promise, e);
|
||||
}
|
||||
}
|
||||
|
||||
if (!handleThenable(promise, value))
|
||||
{
|
||||
if (settled === FULFILLED)
|
||||
resolve(promise, value);
|
||||
|
||||
if (settled === REJECTED)
|
||||
reject(promise, value);
|
||||
}
|
||||
}
|
||||
|
||||
function handleThenable(promise, value) {
|
||||
var resolved;
|
||||
|
||||
try {
|
||||
if (promise === value)
|
||||
throw new TypeError('A promises callback cannot return that same promise.');
|
||||
|
||||
if (value && (typeof value === 'function' || typeof value === 'object'))
|
||||
{
|
||||
var then = value.then; // then should be retrived only once
|
||||
|
||||
if (typeof then === 'function')
|
||||
{
|
||||
then.call(value, function(val){
|
||||
if (!resolved)
|
||||
{
|
||||
resolved = true;
|
||||
|
||||
if (value !== val)
|
||||
resolve(promise, val);
|
||||
else
|
||||
fulfill(promise, val);
|
||||
}
|
||||
}, function(reason){
|
||||
if (!resolved)
|
||||
{
|
||||
resolved = true;
|
||||
|
||||
reject(promise, reason);
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (!resolved)
|
||||
reject(promise, e);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function resolve(promise, value){
|
||||
if (promise === value || !handleThenable(promise, value))
|
||||
fulfill(promise, value);
|
||||
}
|
||||
|
||||
function fulfill(promise, value){
|
||||
if (promise.state_ === PENDING)
|
||||
{
|
||||
promise.state_ = SEALED;
|
||||
promise.data_ = value;
|
||||
|
||||
asyncCall(publishFulfillment, promise);
|
||||
}
|
||||
}
|
||||
|
||||
function reject(promise, reason){
|
||||
if (promise.state_ === PENDING)
|
||||
{
|
||||
promise.state_ = SEALED;
|
||||
promise.data_ = reason;
|
||||
|
||||
asyncCall(publishRejection, promise);
|
||||
}
|
||||
}
|
||||
|
||||
function publish(promise) {
|
||||
var callbacks = promise.then_;
|
||||
promise.then_ = undefined;
|
||||
|
||||
for (var i = 0; i < callbacks.length; i++) {
|
||||
invokeCallback(callbacks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function publishFulfillment(promise){
|
||||
promise.state_ = FULFILLED;
|
||||
publish(promise);
|
||||
}
|
||||
|
||||
function publishRejection(promise){
|
||||
promise.state_ = REJECTED;
|
||||
publish(promise);
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
function Promise(resolver){
|
||||
if (typeof resolver !== 'function')
|
||||
throw new TypeError('Promise constructor takes a function argument');
|
||||
|
||||
if (this instanceof Promise === false)
|
||||
throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
|
||||
|
||||
this.then_ = [];
|
||||
|
||||
invokeResolver(resolver, this);
|
||||
}
|
||||
|
||||
Promise.prototype = {
|
||||
constructor: Promise,
|
||||
|
||||
state_: PENDING,
|
||||
then_: null,
|
||||
data_: undefined,
|
||||
|
||||
then: function(onFulfillment, onRejection){
|
||||
var subscriber = {
|
||||
owner: this,
|
||||
then: new this.constructor(NOOP),
|
||||
fulfilled: onFulfillment,
|
||||
rejected: onRejection
|
||||
};
|
||||
|
||||
if (this.state_ === FULFILLED || this.state_ === REJECTED)
|
||||
{
|
||||
// already resolved, call callback async
|
||||
asyncCall(invokeCallback, subscriber);
|
||||
}
|
||||
else
|
||||
{
|
||||
// subscribe
|
||||
this.then_.push(subscriber);
|
||||
}
|
||||
|
||||
return subscriber.then;
|
||||
},
|
||||
|
||||
'catch': function(onRejection) {
|
||||
return this.then(null, onRejection);
|
||||
}
|
||||
};
|
||||
|
||||
Promise.all = function(promises){
|
||||
var Class = this;
|
||||
|
||||
if (!isArray(promises))
|
||||
throw new TypeError('You must pass an array to Promise.all().');
|
||||
|
||||
return new Class(function(resolve, reject){
|
||||
var results = [];
|
||||
var remaining = 0;
|
||||
|
||||
function resolver(index){
|
||||
remaining++;
|
||||
return function(value){
|
||||
results[index] = value;
|
||||
if (!--remaining)
|
||||
resolve(results);
|
||||
};
|
||||
}
|
||||
|
||||
for (var i = 0, promise; i < promises.length; i++)
|
||||
{
|
||||
promise = promises[i];
|
||||
|
||||
if (promise && typeof promise.then === 'function')
|
||||
promise.then(resolver(i), reject);
|
||||
else
|
||||
results[i] = promise;
|
||||
}
|
||||
|
||||
if (!remaining)
|
||||
resolve(results);
|
||||
});
|
||||
};
|
||||
|
||||
Promise.race = function(promises){
|
||||
var Class = this;
|
||||
|
||||
if (!isArray(promises))
|
||||
throw new TypeError('You must pass an array to Promise.race().');
|
||||
|
||||
return new Class(function(resolve, reject) {
|
||||
for (var i = 0, promise; i < promises.length; i++)
|
||||
{
|
||||
promise = promises[i];
|
||||
|
||||
if (promise && typeof promise.then === 'function')
|
||||
promise.then(resolve, reject);
|
||||
else
|
||||
resolve(promise);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Promise.resolve = function(value){
|
||||
var Class = this;
|
||||
|
||||
if (value && typeof value === 'object' && value.constructor === Class)
|
||||
return value;
|
||||
|
||||
return new Class(function(resolve){
|
||||
resolve(value);
|
||||
});
|
||||
};
|
||||
|
||||
Promise.reject = function(reason){
|
||||
var Class = this;
|
||||
|
||||
return new Class(function(resolve, reject){
|
||||
reject(reason);
|
||||
});
|
||||
};
|
||||
|
||||
})(typeof window != 'undefined' ? window : typeof global != 'undefined' ? global : typeof self != 'undefined' ? self : this);
|
||||
6
vendors/es6-promise-polyfill/promise.min.js
vendored
Normal file
6
vendors/es6-promise-polyfill/promise.min.js
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
(function(t){function z(){for(var a=0;a<g.length;a++)g[a][0](g[a][1]);g=[];m=!1}function n(a,b){g.push([a,b]);m||(m=!0,A(z,0))}function B(a,b){function c(a){p(b,a)}function h(a){k(b,a)}try{a(c,h)}catch(d){h(d)}}function u(a){var b=a.owner,c=b.state_,b=b.data_,h=a[c];a=a.then;if("function"===typeof h){c=l;try{b=h(b)}catch(d){k(a,d)}}v(a,b)||(c===l&&p(a,b),c===q&&k(a,b))}function v(a,b){var c;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(b&&("function"===
|
||||
typeof b||"object"===typeof b)){var h=b.then;if("function"===typeof h)return h.call(b,function(d){c||(c=!0,b!==d?p(a,d):w(a,d))},function(b){c||(c=!0,k(a,b))}),!0}}catch(d){return c||k(a,d),!0}return!1}function p(a,b){a!==b&&v(a,b)||w(a,b)}function w(a,b){a.state_===r&&(a.state_=x,a.data_=b,n(C,a))}function k(a,b){a.state_===r&&(a.state_=x,a.data_=b,n(D,a))}function y(a){var b=a.then_;a.then_=void 0;for(a=0;a<b.length;a++)u(b[a])}function C(a){a.state_=l;y(a)}function D(a){a.state_=q;y(a)}function e(a){if("function"!==
|
||||
typeof a)throw new TypeError("Promise constructor takes a function argument");if(!1===this instanceof e)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[];B(a,this)}var f=t.Promise,s=f&&"resolve"in f&&"reject"in f&&"all"in f&&"race"in f&&function(){var a;new f(function(b){a=b});return"function"===typeof a}();"undefined"!==typeof exports&&exports?(exports.Promise=s?f:e,exports.Polyfill=e):"function"==
|
||||
typeof define&&define.amd?define(function(){return s?f:e}):s||(t.Promise=e);var r="pending",x="sealed",l="fulfilled",q="rejected",E=function(){},A="undefined"!==typeof setImmediate?setImmediate:setTimeout,g=[],m;e.prototype={constructor:e,state_:r,then_:null,data_:void 0,then:function(a,b){var c={owner:this,then:new this.constructor(E),fulfilled:a,rejected:b};this.state_===l||this.state_===q?n(u,c):this.then_.push(c);return c.then},"catch":function(a){return this.then(null,a)}};e.all=function(a){if("[object Array]"!==
|
||||
Object.prototype.toString.call(a))throw new TypeError("You must pass an array to Promise.all().");return new this(function(b,c){function h(a){e++;return function(c){d[a]=c;--e||b(d)}}for(var d=[],e=0,f=0,g;f<a.length;f++)(g=a[f])&&"function"===typeof g.then?g.then(h(f),c):d[f]=g;e||b(d)})};e.race=function(a){if("[object Array]"!==Object.prototype.toString.call(a))throw new TypeError("You must pass an array to Promise.race().");return new this(function(b,c){for(var e=0,d;e<a.length;e++)(d=a[e])&&"function"===
|
||||
typeof d.then?d.then(b,c):b(d)})};e.resolve=function(a){return a&&"object"===typeof a&&a.constructor===this?a:new this(function(b){b(a)})};e.reject=function(a){return new this(function(b,c){c(a)})}})("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
|
||||
22
vendors/es6-promise-polyfill/test/test-adapter.js
vendored
Normal file
22
vendors/es6-promise-polyfill/test/test-adapter.js
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
var assert = require('assert');
|
||||
var Promise = require('../promise').Polyfill;
|
||||
var resolve = Promise.resolve;
|
||||
var reject = Promise.reject;
|
||||
|
||||
function defer(){
|
||||
var deferred = {};
|
||||
|
||||
deferred.promise = new Promise(function(resolve, reject){
|
||||
deferred.resolve = resolve;
|
||||
deferred.reject = reject;
|
||||
});
|
||||
|
||||
return deferred;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
resolved: function(a){ return Promise.resolve(a); },
|
||||
rejected: function(a){ return Promise.reject(a); },
|
||||
deferred: defer,
|
||||
Promise: Promise
|
||||
};
|
||||
2
vendors/rl/rl-1.5.min.js
vendored
2
vendors/rl/rl-1.5.min.js
vendored
|
|
@ -1,2 +0,0 @@
|
|||
/*! RainLoop Index Helper v1.5 (c) 2015 RainLoop Team; Licensed under MIT */
|
||||
!function(t,e,n){function r(){}r.prototype.s=t.sessionStorage,r.prototype.t=t.top||t,r.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},r.prototype.setHash=function(){var e=t.rainloopAppData,r=null;this.s?this.s.setItem("__rlA",e&&e.AuthAccountHash?e.AuthAccountHash:""):this.t&&n&&(r={},r.__rlA=e&&e.AuthAccountHash?e.AuthAccountHash:"",this.t.name=n.stringify(r))},r.prototype.clearHash=function(){this.s?this.s.setItem("__rlA",""):this.t&&(this.t.name="")},t._rlhh=new r,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){e.write(unescape('%3Cscript data-cfasync="false" type="text/javascript" src="'+t+'"%3E%3C/script%3E'))},t.__includeStyle=function(t){e.write(unescape("%3Cstyle%3E"+t+'"%3E%3C/style%3E'))},t.__showError=function(n){var r=e.getElementById("rl-loading"),s=e.getElementById("rl-loading-error"),l=e.getElementById("rl-loading-error-additional");r&&(r.style.display="none"),s&&(s.style.display="block"),l&&n&&(l.style.display="block",l.innerHTML=n),t.SimplePace&&t.SimplePace.set(100)},t.__simplePace=function(e){t.SimplePace&&t.SimplePace.add(e)},t.__runBoot=function(e,n){t.__APP_BOOT&&!e?t.__APP_BOOT(function(t){t||__showError(n)}):__showError(n)}}(window,window.document,window.JSON);
|
||||
105
vendors/rl/rl.js
vendored
105
vendors/rl/rl.js
vendored
|
|
@ -1,105 +0,0 @@
|
|||
/*! RainLoop Index Helper v1.5 (c) 2015 RainLoop Team; Licensed under MIT */
|
||||
(function (window, document, JSON, undefined) {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function CRLTopDriver() {}
|
||||
|
||||
CRLTopDriver.prototype.s = window['sessionStorage'] || null;
|
||||
|
||||
CRLTopDriver.prototype.t = window['top'] || window;
|
||||
|
||||
/**
|
||||
* @return {(string|null)}
|
||||
*/
|
||||
CRLTopDriver.prototype['getHash'] = function() {
|
||||
var mR = null;
|
||||
if (this.s) {
|
||||
mR = this.s['getItem']('__rlA') || null;
|
||||
} else if (this.t) {
|
||||
var mData = this.t['name'] && JSON && '{' === this.t['name']['toString']()['substr'](0, 1) ? JSON['parse'](this.t['name']['toString']()) : null;
|
||||
mR = mData ? (mData['__rlA'] || null) : null;
|
||||
}
|
||||
return mR;
|
||||
};
|
||||
|
||||
CRLTopDriver.prototype['setHash'] = function() {
|
||||
var mData = window['rainloopAppData'], mRes = null;
|
||||
if (this.s) {
|
||||
this.s['setItem']('__rlA', mData && mData['AuthAccountHash'] ? mData['AuthAccountHash'] : '');
|
||||
} else if (this.t && JSON) {
|
||||
mRes = {};
|
||||
mRes['__rlA'] = mData && mData['AuthAccountHash'] ? mData['AuthAccountHash'] : '';
|
||||
this.t['name'] = JSON['stringify'](mRes);
|
||||
}
|
||||
};
|
||||
|
||||
CRLTopDriver.prototype['clearHash'] = function() {
|
||||
if (this.s) {
|
||||
this.s['setItem']('__rlA', '');
|
||||
} else if (this.t) {
|
||||
this.t['name'] = '';
|
||||
}
|
||||
};
|
||||
|
||||
window['_rlhh'] = new CRLTopDriver();
|
||||
|
||||
/**
|
||||
* @returns {(string|null)}
|
||||
*/
|
||||
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['__includeStyle'] = function (sStyles) {
|
||||
document.write(unescape('%3Csty' + 'le%3E' + sStyles + '"%3E%3C/' + 'sty' + 'le%3E'));
|
||||
};
|
||||
|
||||
window['__showError'] = function (sAdditionalError) {
|
||||
var oR = document.getElementById('rl-loading'),
|
||||
oL = document.getElementById('rl-loading-error'),
|
||||
oLA = document.getElementById('rl-loading-error-additional');
|
||||
|
||||
if (oR) {oR.style.display = 'none';}
|
||||
if (oL) {oL.style.display = 'block';}
|
||||
if (oLA && sAdditionalError) { oLA.style.display = 'block'; oLA.innerHTML = sAdditionalError; }
|
||||
if (window.SimplePace) {window.SimplePace.set(100);}
|
||||
};
|
||||
|
||||
window['__simplePace'] = function (nVal) {
|
||||
if (window.SimplePace) {
|
||||
window.SimplePace.add(nVal);
|
||||
}
|
||||
};
|
||||
|
||||
window['__runBoot'] = function (bWithError, sAdditionalError) {
|
||||
if (window.__APP_BOOT && !bWithError) {
|
||||
window.__APP_BOOT(function (bV) {
|
||||
if (!bV) {
|
||||
__showError(sAdditionalError);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
__showError(sAdditionalError);
|
||||
}
|
||||
};
|
||||
|
||||
}(window, window.document, window.JSON));
|
||||
Loading…
Add table
Add a link
Reference in a new issue