User:Year2000Prob/monobook.js: Difference between revisions

Content deleted Content added
mNo edit summary
No edit summary
Line 10:
var format = function(wscript, source) {
return wscript.replace(/\{{3}lang\|([a-z]{2})\}{3}/i, source.indexOf(":") == 2 ? source.substring(0, 2) : "$1")
.replace("{{{src}}}", encodeURIComponent(source.indexOf(":") == 2 ? source.substring(3, source.length) : source).replace(/\s|[\.%]20/g, "_"))};
var attrs;
if (typeof src == "object") {
Line 19:
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", (self.namespaces && /^\[{2}([^\n\r\t]*?)(\|[^\n\r\t]*?)?\]{2}$/.test(src) ? (function() {
var scriptId = src.substringmatch(/^\[{2, src.length - 2), path = format}(self.namespaces["#default"^\n\r\t] +)(\|| "{[^\n\r\t]*?)?\]{{src2}}}", src$/);[1],
path = format(self.namespaces["#default"] || "{{{src}}}", scriptId);
for (var ns in self.namespaces) {
if (scriptId.indexOf(ns + ":") == 0) {