Content deleted Content added
Year2000Prob (talk | contribs) No edit summary |
Year2000Prob (talk | contribs) I hope this new formula works. |
||
Line 9:
if (!self.imported) self.imported = [];
var format = function(wscript, source) {
var lang, src;
return wscript.replace(/\{{3}lang\|([a-z]{2})\}{3}/i, source.indexOf(":") == 2 ? source.substring(0, 2) : "$1")▼
return [wscript.replace(/\{{3}src(?:\|(.+)\|(.+))?\}{3}/, function(m) {
src = m.length == 1 ? source : source.replace(new RegExp("^" + m[1] + "$"), m[2]);
if (/^([a-z]\-[A-Za-z]|[a-z])\:/.test(src)) {
var n = src.match(/^([a-z]\-[A-Za-z]|[a-z])\:/);
lang = n[1];
src = src.substr(n[0].length);
};
return encodeURIComponent(src.replace(" ", "_"));
▲
var attrs;
if (typeof src == "object") {
Line 19 ⟶ 27:
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", (self.namespaces
var
▲ path = format(self.namespaces["#default"] || "{{{src}}}", scriptId);
for (var ns in self.namespaces) {
if (
path = _f[0]; source = _f[1]; break}};
return path})() : encodeURI(src)));
if (attrs) {
Line 44 ⟶ 52:
})[wgServer] || wgServer;
importScript.namespaces = {"#default": "http://{{{lang|en}}}.wikipedia.org/w/index.php?title={{{src|\\[{2}([^\\n\\r\\t]+)(\\|[^\\n\\r\\t]*?)?\\]{2}|$1}}}&action=raw&ctype=text/javascript"};
var Y2P = new Object();
|