User:UniQue tree/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin can be added at User:UniQue tree/monobook.css. |
importScript("User:Lupin/recent2.js");
importScript('User:AzaToth/twinkle.js');
TwinkleConfig = {
revertMaxRevisions : 50,
userTalkPageMode : 'tab',
showSharedIPNotice : true,
openTalkPage : [ 'agf', 'norm', 'vand' ],
openTalkPageOnAutoRevert : false,
openAOLAnonTalkPage : false,
summaryAd : " ",
deletionSummaryAd : " ",
protectionSummaryAd : " ",
watchSpeedyPages : [ 'g3', 'g5', 'g10', 'g11', 'g12' ],
watchProdPages : false,
openUserTalkPageOnSpeedyDelete : [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ],
watchRevertedPages : [ ],
markRevertedPagesAsMinor : [ 'agf', 'norm', 'vand', 'torev' ],
deleteTalkPageOnDelete : false,
watchWarnings : true,
markAIVReportAsMinor : true,
markSpeedyPagesAsMinor : true,
offerReasonOnNormalRevert : true,
};
var topaz = new Object();
topaz.latestversion = {
//statuschanger: 20061108,
editcountutil: 20061104,
enhanceduserpage: 20061107
};
topaz.init = new Object();
topaz.init.oldonload = window.onload;
window.onload = function() {
if (typeof topaz.init.oldonload == "function") topaz.init.oldonload();
var outdated = [];
var highestversion = 0;
var versionoverride = topaz.util.cookie.get("topaz.init.versionoverride");
for (mod in topaz.latestversion) {
if (topaz[mod]) {
if (!topaz[mod].version || topaz[mod].version < topaz.latestversion[mod]) {
if (!versionoverride || topaz.latestversion[mod] > versionoverride) {
outdated.push({
mod: mod,
latest: topaz.latestversion[mod],
cur: (topaz[mod].version?topaz[mod].version:0)
});
}
}
if (topaz.latestversion[mod] > highestversion) {
highestversion = topaz.latestversion[mod];
}
}
}
if (outdated.length==0) {return}
var noticemessage = 'You seem to be using outdated versions of <font color="#ff9900">Topaz\'s</font> <font color="#0066ff">Wikiscripts</font>. While you may opt to <a href="javascript:void(0);" onclick="javascript:topaz.util.cookie.set(\'topaz.init.versionoverride\','+highestversion+');topaz.init.noticediv.style.display=\'none\';">hide this message</a> until the next major update (or until you clear your cookies), you should strongly consider <a href="/wiki/User:Topaz/Wikiscripts">updating them</a> to take advantage of the new features and bug fixes. In particular, the following scripts could use updating:<ul>';
for(var i=0; i<outdated.length; i++) {
noticemessage += "<li><strong>" + outdated[i].mod + "</strong> version " + outdated[i].cur + " (latest is version " + outdated[i].latest + ")</li>";
}
noticemessage += "</ul>";
with(topaz.init.noticediv = topaz.util.add(topaz.util.getobj("contentSub"), "div")) {
innerHTML = noticemessage;
style.color = "#666666";
style.backgroundColor = "#eeeeee";
style.border = "1px solid #cccccc";
style.margin = "5px";
style.padding = "2px";
}
// todo: hide button
};
topaz.util = {
getobj:function(id) {
return document.getElementById ?
document.getElementById(id) :
document.all[id];
},
time:function() {
return((new Date()).getTime()/1000);
},
add:function(parent, tag, attr) {
var el = document.createElement(tag);
if (attr) {
for (key in attr) {
el[key] = attr[key];
}
}
return parent.appendChild(el);
},
fullescape:function(text) {
return escape(text).replace(/\+/g,"%2B");
},
mousebtnmap:{
ns:[null,1,3,2],
ie:[null,1,2,null,3]
},
xmlhttpreq:function() {
if (window.XMLHttpRequest) {
xmlhttpobj = new XMLHttpRequest()
} else {
try {
xmlhttpobj = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttpobj = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
xmlhttpobj = null;
}
}
}
return xmlhttpobj;
},
cookie:{
noexpire:(function(){
var d = new Date();
d.setTime(d.getTime()+(365*24*60*60*1000));
return d.toGMTString();
})(),
expire:(function(){
var d = new Date();
d.setTime(d.getTime()-1);
return d.toGMTString();
})(),
get:function(name) {
var cl = document.cookie.split(/;\s*/);
for (var i=0; i<cl.length; i++) {
var curc = cl[i].split(/\=/);
if (curc[0] == name) {
return(curc[1]);
}
}
return null;
},
set:function(name, value) {
document.cookie = name + "=" + escape(value) +
"; expires=" + topaz.util.cookie.noexpire +
"; path=/";
},
del:function(name) {
document.cookie = name+"=; expires="+topaz.util.coookie.expire+"; path=/";
}
}
};
topaz.comm = {
doreq:function(url,postdata,headers) {
var req = topaz.util.xmlhttpreq();
req.open(postdata?"POST":"GET", url, false);
for(header in headers) {
req.setRequestHeader(header,headers[header]);
}
req.send(postdata||null);
return req;
}
};
topaz.wputil = {
username:function() {
return wgUserName;
//return topaz.util.getobj("pt-userpage").childNodes[0].childNodes[0].nodeValue;
},
iseditpage:function() {
return document.title.indexOf("Editing ")==0;
},
pagename:function() {
var iseditpage = topaz.wputil.iseditpage();
return document.title.substr(iseditpage?8:0,document.title.indexOf(" - ")-(iseditpage?8:0));
},
addsidepanel:function(id,label) {
var div = topaz.util.add(topaz.util.getobj("column-one"), "div", {className:"portlet",id:id});
topaz.util.add(div, "H5").innerHTML = label;
topaz.util.add(topaz.util.add(div, "div", {className:"pBody"}), "ul");
},
addsidepanelbutton:function(id,label,targhref) {
var li = topaz.util.add((topaz.util.getobj(id).getElementsByTagName("ul"))[0],"li");
with(topaz.util.add(li,"a")) {
innerHTML = label;
href = targhref;
}
return li;
},
setpagecontent:function(pagename,content,summary,watch) {
var prelimresp = topaz.comm.doreq("/w/index.php?title="+pagename+"&action=submit");
var edittime = prelimresp.responseText.match(/\<input type='hidden' value="(\d+)" name="wpEdittime" \/\>/)[1];
var edittoken = prelimresp.responseText.match(/\<input type='hidden' value="([^"]+)" name="wpEditToken" \/\>/)[1];
topaz.comm.doreq("/w/index.php?title="+pagename+"&action=submit",
"wpEdittime="+edittime+
"&wpEditToken="+topaz.util.fullescape(edittoken)+
"&wpTextbox1="+escape(content)+
"&wpSummary="+escape(summary)+
(watch?"&wpWatchthis=on":"")+
"&wpSection=&wpSave=Save+page",
{"Content-Type":"application/x-www-form-urlencoded"});
},
getpagecontent:function (pagename) {
var req = topaz.comm.doreq("/w/index.php?title="+pagename+"&action=edit");
var content = req.responseText.match(/\<textarea[\w\W]*?\>([\w\W]*?)\<\/textarea\>/)[1];
content = content.replace(/\<\;/gi, "<");
content = content.replace(/\>\;/gi, ">");
content = content.replace(/\"\;/gi, "\"");
content = content.replace(/\&\;/gi, "&");
return content;
}
};
/* end configuration */
//</nowiki>
/*#### This area contains scripts only for Firefox ####*/
var detect = navigator.userAgent.toLowerCase();
var IE;
var place = detect.indexOf('msie') + 1;
if (place) IE=true;
if (!IE) {
/* Put all scripts you want disabled only in Internet Explorer in this area. */
}
importScript('User:MarkS/extraeditbuttons.js'); //[[User:MarkS/extraeditbuttons.js]]
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');