MediaWiki:Gadget-ImageAnnotator.js: Difference between revisions

Content deleted Content added
protocol relative urls.
mNo edit summary
Line 50:
var revision_id = null;
if (window.mediaWiki) { // MW 1.17+
revision_id = htmltextOfWikiPage.match (/(mediaWiki|mw).config.set\(\{.*"wgCurRevisionId"\s*:\s*(\d+),/);
if (revision_id) revision_id = parseInt (revision_id[12], 10);
} else { // MW < 1.17
revision_id = htmltextOfWikiPage.match (/wgCurRevisionId\s*=\s*(\d+)[;,]/);
if (revision_id) revision_id = parseInt (revision_id[1], 10);
}
if (revision_id) revision_id = parseInt (revision_id[1], 10);
return revision_id;
};
Line 1,947 ⟶ 1,948:
+ '&prop=info|imageinfo&inprop=protection&iiprop=size'
+ '&titles=&callback=ImageAnnotator.info_callbacks[].callback';
if (template.startsWith('//')) template = document.___location.protocol + template; // Avoid protocol-relative URIs (IE7 bug)
make_calls (
function (length, titles) {
Line 2,703 ⟶ 2,705:
+ '&maxage=1800&smaxage=1800&uselang=' + wgUserLanguage //see bugzilla 22764
+ '&callback=ImageAnnotator.script_callbacks[].callback';
if (template.startsWith('//')) template = document.___location.protocol + template; // Avoid protocol-relative URIs (IE7 bug)
make_calls (
list
Line 3,133 ⟶ 3,136:
url += ((url.indexOf ('?') >= 0) ? '&' : '?') + 'dummyTimestamp=' + (new Date()).getTime ();
}
// Avoid protocol-relative URIs (IE7 bug)
if (url.length >= 2 && url.substring(0, 2) == '//') url = document.___location.protocol + url;
if (bypass_local_cache) {
var s = document.createElement ('script');