projects
/
Plinn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lint.
[Plinn.git]
/
Products
/
Plinn
/
skins
/
ajax_scripts
/
plinn_script_loader.js
diff --git
a/Products/Plinn/skins/ajax_scripts/plinn_script_loader.js
b/Products/Plinn/skins/ajax_scripts/plinn_script_loader.js
index
d78ff6c
..
fc8b660
100644
(file)
--- a/
Products/Plinn/skins/ajax_scripts/plinn_script_loader.js
+++ b/
Products/Plinn/skins/ajax_scripts/plinn_script_loader.js
@@
-1,13
+1,17
@@
-// (c) Benoît PIN 2006-20
07
+// (c) Benoît PIN 2006-20
15
// http://plinn.org
// Licence GPL
//
//
// http://plinn.org
// Licence GPL
//
//
+var ScriptRegistry;
+var globalScriptRegistry;
+
+(function() {
function ScriptRegistry() {
function ScriptRegistry() {
- this.loadedScripts =
new Object()
;
- this.pendingScripts =
new Array()
;
+ this.loadedScripts =
{}
;
+ this.pendingScripts =
[]
;
this.HEAD = document.getElementsByTagName('head')[0];
this.isLoading = false;
}
this.HEAD = document.getElementsByTagName('head')[0];
this.isLoading = false;
}
@@
-28,7
+32,7
@@
ScriptRegistry.prototype.loadScript = function(scriptOb) {
}
if(!this.isLoading && this.pendingScripts.length)
this._loadNextScript();
}
if(!this.isLoading && this.pendingScripts.length)
this._loadNextScript();
-}
+}
;
ScriptRegistry.prototype._loadNextScript = function() {
var firstScript = this.pendingScripts[0];
ScriptRegistry.prototype._loadNextScript = function() {
var firstScript = this.pendingScripts[0];
@@
-52,7
+56,9
@@
ScriptRegistry.prototype._loadNextScript = function() {
break;
case 'code' :
try {
break;
case 'code' :
try {
+ /* jshint ignore:start */
eval(firstScript[1].text);
eval(firstScript[1].text);
+ /* jshint ignore:end */
}
catch(e) {
if (window.console) {
}
catch(e) {
if (window.console) {
@@
-64,15
+70,17
@@
ScriptRegistry.prototype._loadNextScript = function() {
}
this._removeScriptAfterLoad();
break;
}
this._removeScriptAfterLoad();
break;
- }
;
-}
+ }
+}
;
ScriptRegistry.prototype._removeScriptAfterLoad = function() {
this.pendingScripts.shift();
if(this.pendingScripts.length)
ScriptRegistry.prototype._removeScriptAfterLoad = function() {
this.pendingScripts.shift();
if(this.pendingScripts.length)
- this._loadNextScript()
+ this._loadNextScript()
;
else
this.isLoading = false;
else
this.isLoading = false;
-}
+};
+
+globalScriptRegistry = new ScriptRegistry();
-
globalScriptRegistry = new ScriptRegistry(
);
\ No newline at end of file
+
}()
);
\ No newline at end of file