web: drop JSLoader extension

Ext now includes an Ext.Loader class that can load scripts so this
extra extension to do so is surplurfluous.
This commit is contained in:
Damien Churchill 2011-10-05 23:31:41 +01:00
parent d44a357284
commit b724f74700
1 changed files with 0 additions and 38 deletions

View File

@ -1,38 +0,0 @@
Ext.ux.JSLoader = function(options) {
Ext.ux.JSLoader.scripts[++Ext.ux.JSLoader.index] = {
url: options.url,
success: true,
jsLoadObj: null,
options: options,
onLoad: options.onLoad || Ext.emptyFn,
onError: options.onError || Ext.ux.JSLoader.stdError,
scope: options.scope || this
};
Ext.Ajax.request({
url: options.url,
scriptIndex: Ext.ux.JSLoader.index,
success: function(response, options) {
var script = Ext.ux.JSLoader.scripts[options.scriptIndex];
try {
eval(response.responseText);
} catch(e) {
script.success = false;
script.onError(script.options, e);
}
if (script.success) {
script.onLoad.call(script.scope, script.options);
}
},
failure: function(response, options) {
var script = Ext.ux.JSLoader.scripts[options.scriptIndex];
script.success = false;
script.onError(script.options, response.status);
}
});
}
Ext.ux.JSLoader.index = 0;
Ext.ux.JSLoader.scripts = [];
Ext.ux.JSLoader.stdError = function(options, e) {
window.alert('Error loading script:\n\n' + options.url + '\n\nstatus: ' + e);
}