User:Year2000Prob/monobook.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 8:
return imported;
};
var attrs, format = function(ns,src){return typeof self.namespaces[ns]=="function"?self.namespaces[ns](src):(self.namespaces[ns]||wgServer+wgScript+"?title={{{src}}}&action=raw&ctype=text/javascript").replace("{{{src}}}", src)};
var format = function(wscript, src) {
var lang, source = src;
return wscript.replace(/\{{3}lang\|([a-z]{2})\}{3}/, function(m) {
lang = m[1];
if (/^([a-z]{2})\:/.test(source)) {
var n = source.match(/^([a-z]{2})\:/);
lang = n[1];
source = source.substr(n[0].length);
};
return lang;
}).replace("{{{src}}}", encodeURIComponent(source.replace(" ", "_")))};
var attrs;
if (typeof src == "object") {
attrs = src;
Line 29 ⟶ 18:
script.setAttribute("src", (self.namespaces && /^\[{2}([^\n\r\t]+)\]{2}$/.test(src) ? (function() {
var source = src.match(/^\[{2}([^\n\r\t]+)\]{2}$/)[1],
path = format(self.namespaces["#default"] || "{{{src}}}", source);
for (var ns in self.namespaces) {
if (source.indexOf(ns + ":") == 0) {
path = format(self.namespaces[ns], source.substring(ns.length + 1)); break}};
return path})() : encodeURI(src)));
if (attrs) {
Line 57 ⟶ 46:
})[wgServer] || "null";
 
importScript.namespaces = {"#default": function(src) {
return "http://{{{lang|en}}}.wikipedia.org/w/index.php?title={{{src}}}&action=raw&ctype=text/javascript".replace("{{{lang};}}", function() {
var n = sourcesrc.match(/^([a-z]{2})\:/), lang = n[1];
sourcesrc = sourcesrc.substr(n[0].length); return lang;
}).replace("{{{src}}}", encodeURIComponent(sourcesrc.replace(" ", "_")))}};
 
var Y2P = new Object();
importScript({src: "[[en:User:Year2000Prob/Y2P.MediaWiki.js]]", onload: function() {
window._onload = window.onload;
window.onload = function() {
Line 122 ⟶ 115:
var sidebar = $(".portlet:not(#p-personal, #p-cactions, #p-logo) div.pBody");
sidebar.css("border-left", "none").parent().find("h5").css("cursor", "default");
// The click event is made obsolete by MediaWiki 1.14 and higher
if (MWVersion <== 1.14) sidebar.hide().parent().find("h5").click(function() {
$(this).parent().find("div.pBody").slideToggle("slow")});
Line 133 ⟶ 126:
});
};
 
// I hope this works with Shadowbox
$("#bodyContent img").attr("rel", "shadowbox[All]").each(function() {
$(this).attr("href", $("#bodyContent img", $.get($(this).attr("href")).responseXML).get(0).getAttribute("src"));
});
});
}})();
}})("http://year2000prob.freehostia.com/wp-content/uploads/2008/09/shadowbox-2.0.js")();
 
var wikEdUsing = "(using [[" + (whichsite != "wp" ? "wikipedia:" : "") + "User:Cacycle/wikEd|wikEd]])",
Line 146 ⟶ 134:
wikEdCloseToolbarPreset = true,
wikEdButtonsOnTop = false,
wikedScripts = importScript("[[en:User:Cacycle/diff.js]]")("[[en:User:Pilaf/livepreview.js]]")("[[en:User:Cacycle/RegExTypoFix.js]]")("[[en:User:Cacycle/wikEd.js]]")();
 
importScript("[[de:Benutzer:ASM/quickedit.js]]")("[[en:User:Lupin/popups.js]]")(); // import Popups so it'll work globally if possible, instead of just on Wikipedia
 
var ywmpScript = importScript("http://mediaplayer.yahoo.com/latest")()[0];