MediaWiki:RefToolbar.js: Difference between revisions

Content deleted Content added
changing 675 width to 680 to accommodate Timeless skin
Avoid double-encoding bug with Citoid (https://phabricator.wikimedia.org/T146539)
Line 459:
}
}
};
 
// Safe version of decodeURIComponent() that doesn't throw exceptions.
// If the native decodeURIComponent() threw an exception, the original string will be returned.
CiteTB.safeDecodeURIComponent = function(s) {
try {
s = decodeURIComponent(s);
} catch (e) {}
return s;
};
 
Line 473 ⟶ 482:
}
var url = '//reftoolbar.toolforge.org/lookup.php?';
// Citoid expects minimally encoded input, so do some speculative decoding here to avoid
// 404 fetches. https://phabricator.wikimedia.org/T146539
id = CiteTB.safeDecodeURIComponent(id);
url+=autotype+'='+encodeURIComponent(id);
url+='&template='+encodeURIComponent(tem);