MediaWiki:Gadget-ImageAnnotator.js: Difference between revisions

Content deleted Content added
m adding a polyfill to the local scope
m getElementsByClassName() used to return an array; so let's return the jQuery object: it's array-like enough (I hope)
Line 22:
*/
 
// Global: getElementsByClassName, importScript, importScriptURI (wiki.js)
// Global: wgPageName, wgCurRevisionId, wgUserGroups, wgRestrictionEdit (inline script on the page)
// Global: wgAction, wgNamespaceNumber, wgUserLanguage, wgContentLanguage, stylepath (inline script)
Line 3,191:
}; // end IA
 
// Backwards compatibility
// Polyfill: getElementsByClassName (stolen from HotCat)
function getElementsByClassName (scope, tag, className) {
var result =return window.jQuery(scope).find(((!tag || tag === '*') ? '' : tag) + '.' + className);
return (result && result.length) ? result[0] : null;
}
 
 
window.ImageAnnotator = {