User:AZPR/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:AZPR/monobook.css. |
//following variables for peer reviewing script
select_PR = true;
allSpaces_PR = true;
spellcheck_PR = false; // true
showHeading_PR = true;
noXHR_PR = true; // false
// Script from [[User:AndyZ/peerreviewer.js]]
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:AndyZ/peerreviewer.js'
+ '&action=raw&ctype=text/javascript');
// Script from [[User:AZPR/personalredirect.js]]
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:AZPR/personalredirect.js'
+ '&action=raw&ctype=text/javascript');
importScript('User:Omegatron/monobook.js/addlink.js'); //[[User:Omegatron/monobook.js/addlink.js]]
if((wgNamespaceNumber == 0) && (document.location.href.indexOf("action")==-1)){
document.location.href = "http://en.wikipedia.org/w/index.php?title="+document.title.split(" - ")[0].replace(/\s/, "_")+"&action=edit"
}
function addMsg(num,num2){
// if(wgNamespaceNumber == 4 && wgTitle == "Peer review"){
var list = document.getElementById('wpTextbox1').value.match(/review\|.*?\|/g);
var f = new Array();
for(i=num;i<num2+1;i++){
list[i] = list[i]
// .replace(/(\{\{|\}\})/g,"");
// .replace(/(review|\|)/g,"");
.substring(7,list[i].length-1);
f[i]=document.createElement("IFRAME");
f[i].src=mw.config.get('wgServer')+mw.config.get('wgScriptPath')+"/index.php?title=Wikipedia:Peer review/"+list[i]+"&action=edit";
// alert(mw.config.get('wgServer')+mw.config.get('wgScriptPath')+"/index.php?title=Wikipedia:Peer review/"+list[i]+"&action=edit"); //debugging temporary
document.body.appendChild(f[i]);
}
// }
}
function askAddMsg(){
x = prompt("Indicate range of PRs to add message, using comma, like 1,20", "1,10");
x = x.split(",");
addMsg(parseInt(x[0]),parseInt(x[1]));
}
addOnloadHook(function () {
if(wgPageName == "Wikipedia:Peer_review" && document.location.href.indexOf("action=edit") != -1)
mw.util.addPortletLink("p-cactions", "javascript:askAddMsg()", "Add notices", "ca-addMsg", "Goes through articles, add little notices regarding auto-PRs", "", "");
});