https://bugzilla.wikimedia.org/show_bug.cgi?id=25962

Krinkle <krinklem...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |krinklem...@gmail.com

--- Comment #5 from Krinkle <krinklem...@gmail.com> 2010-11-18 19:36:17 UTC ---
Back in the present live deployed environment, it's possible to use jQuery's
getScript() which is comparable to importScriptURI(), but with a callback
function.

Example:

$.getScript('http://meta.wikimedia.org/?title=User:Krinkle/Scripts/Countervandalism.js&action=raw&ctype=text/javascript',
function() {
  alert('Hello, script load was performed.');
});
See also: http://api.jquery.com/jQuery.getScript/

As for ResourceLoader, I don't know exactly what is going to change but the
following works for modules that are defined:

mw.loader.using( 'module.name', funciton(){
  // script loaded OK
}, function(){
 // script loaded with Error
});

If not already the case, perhaps we can expand using() to also accept a URL and
remember which urls are loaded already

mw.loader.using(
'http://meta.wikimedia.org/?title=User:Krinkle/Scripts/Countervandalism.js&action=raw&ctype=text/javascript',
funciton(){
  // script loaded OK
}, function(){
 // script loaded with Error
});

Or, if not already, allow registering of new modules in the front-end and then
load them with callback using using() like:

mw.loader.registerModle( 'krinkle.sample',
'http://meta.wikimedia.org/?title=User:Krinkle/Sample.js&action=raw&ctype=text/javascript',
'jquery.ui');
// jquery.ui being the dependancy

mw.loader.using( 'krinkle.sample', funciton(){
  // script loaded OK
}, function(){
 // script loaded with Error
});

Lots of ideas :)

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to