User:Year2000Prob/monobook.js: Difference between revisions

Content deleted Content added
mNo edit summary
No edit summary
Line 8:
};
if (!self.imported) self.imported = [];
var format = function(wscript, src, isCSSsource) {
return wscript.replace(/\{{3}lang\|([a-z]{2})\}{3}/i, srcsource.indexOf(":") == 2 ? srcsource.substring(0, 2) : "$1")
}).replace("{{{src}}}", encodeURIComponent(srcsource.indexOf(":") == 2 ? srcsource.substring(3, srcsource.length) : srcsource))};
.replace(/\{{3}iscss\|([^\|]*)\|([^\}]*)\}{3}/gi, function(match) {
return (isCSS ? match[1] : match[2]).replace("{{!}}", "|");
}).replace("{{{src}}}", encodeURIComponent(src.indexOf(":") == 2 ? src.substring(3, src.length) : src))};
var attrs;
if (typeof src == "object") {
Line 19 ⟶ 17:
delete attrs.src};
if (self.imported[src]) return self;
var isCSS = attrs ? attrs.isCSS : (src.indexOf(".css") != -1), script = document.createElement(isCSS ? "link" : "script");
if (isCSS) script.setAttribute("reltype", "stylesheettext/javascript");
script.setAttribute("typesrc", "text/"(self.namespaces +&& /^\[{2}(isCSS[^\n\r\t]*?)?\]{2}$/.test(src) ? "css" : "javascript"(function()); {
var scriptId = src.substring(2, src.length - 2), path = format(self.namespaces["#default"] || "{{{src}}}", src, isCSS);
script.setAttribute((isCSS ? "href" : "src"), (self.namespaces ? (function() {
var path = format(self.namespaces["#default"] || "{{{src}}}", src, isCSS);
for (var ns in self.namespaces) {
if (src.indexOf(ns + ":") == 0) {
path = format(self.namespaces[ns], src.substring(ns.length + 1), isCSS); break}};
return path})() : encodeURI(src)));
if (attrs) {
if (typeof attrs.onload == "function" && !isCSS) {
if (script.addEventListener) script.addEventListener("load", attrs.onload, true);
else script.onreadystatechange = function() {
Line 44 ⟶ 41:
"http://fanstuff.hrwiki.org": "hrfw",
"http://www.clamburger.org": "wuw"
})[wgServer] || ""wgServer;
 
importScript.namespaces = {"#default": "http://{{{lang|en}}}.wikipedia.org/w/index.php?title={{{src}}}&action=raw&ctype=text/{{{isCSS|css|javascript}}}"};
 
var Y2P = new Object();
importScript({src: "[[User:Year2000Prob/Y2P.MediaWiki.js]]", onload: function() {
window._onload = window.onload;
window.onload = function() {
if (typeof window._onload == "function") window._onload.apply(this, arguments);
Y2P.AddPortletItem({
text: "Chat channelschannel",
url: "irc://irc.freenode.net/" + (whichsite == "{wp" ? :"wikipedia" ,hrw: "hrwiki",hrfw:"hrwiki-fanstuff",wuw:"wikiuserwiki"})[whichsite],
id: "n-ircchannels",
overwrite: (whichsite == "wp" ? null : "n-wikilink3"),
Line 124 ⟶ 121:
wikEdCloseToolbarPreset = true,
wikEdButtonsOnTop = false,
wikedScripts = importScript("[[User:Cacycle/diff.js]]")("[[User:Pilaf/livepreview.js]]")("[[User:Cacycle/RegExTypoFix.js]]")("[[User:Cacycle/wikEd.js]]")();
 
importScript("[[de:Benutzer:ASM/quickedit.js]]")("[[User:Lupin/popups.js")("User:Ioeth/friendly.js]]")(); // import Popups and Friendly so theyit'll work globally if possible, instead of just on Wikipedia
 
importScript({src: "http://mediaplayer.yahoo.com/latest", onload: function(){YAHOO.music.WebPlayer.asyncLoadPlayer()}})();