-// (c) Benoît PIN 2006-2007
+// (c) Benoît PIN 2006-2015
// http://plinn.org
// Licence GPL
//
//
+var ScriptRegistry;
+var globalScriptRegistry;
+
+(function() {
function ScriptRegistry() {
- this.loadedScripts = new Object();
- this.pendingScripts = new Array();
+ this.loadedScripts = {};
+ this.pendingScripts = [];
this.HEAD = document.getElementsByTagName('head')[0];
this.isLoading = false;
}
}
if(!this.isLoading && this.pendingScripts.length)
this._loadNextScript();
-}
+};
ScriptRegistry.prototype._loadNextScript = function() {
var firstScript = this.pendingScripts[0];
break;
case 'code' :
try {
+ /* jshint ignore:start */
eval(firstScript[1].text);
+ /* jshint ignore:end */
}
catch(e) {
if (window.console) {
}
this._removeScriptAfterLoad();
break;
- };
-}
+ }
+};
ScriptRegistry.prototype._removeScriptAfterLoad = function() {
this.pendingScripts.shift();
if(this.pendingScripts.length)
- this._loadNextScript()
+ this._loadNextScript();
else
this.isLoading = false;
-}
+};
+
+globalScriptRegistry = new ScriptRegistry();
-globalScriptRegistry = new ScriptRegistry();
\ No newline at end of file
+}());
\ No newline at end of file