User:Dreamafter/georgemoney.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. |
![]() | Documentation for this user script can be added at User:Dreamafter/georgemoney. |
//<pre><nowiki>
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('remexamplejpg=1') != -1) {
function RemoveExampleJpg() {
document.getElementById('wpSummary').value = "Removing [[Image:Example.jpg]], '''bold text''', etc...";
var contents = document.getElementById('wpTextbox1').value;
var newcontents = contents.replace(/(\[http:\/\/www\.example\.com link title\]|== Headline text ==|<math>Insert formula here<\/math>|<nowiki>Insert non-formatted text here<\/nowiki>|#REDIRECT \[\[Insert text\]\]|'''Bold text'''|''Italic text''|\[\[(Media:Example\.ogg|Image:Example\.jpg|Link title)\]\]|#REDIRECT \[\[Insert text\]\]|<s>Strike-through text<\/s>|<sup>Superscript text<\/sup>|<sub>Subscript text<\/sub>|<small>Small Text<\/small>|<!-- Comment -->|<gallery>\s+Image:Example.jpg\|Caption1\s+Image:Example.jpg\|Caption2\s+<\/gallery>|<blockquote>\s+Block quote\s+<\/blockquote>|\{\| class="wikitable"\s+\|-\s+! header 1\s+! header 2\s+! header 3\s+\|-\s+\| row 1, cell 1\s+\| row 1, cell 2\s+\| row 1, cell 3\s+\|-\s+\| row 2, cell 1\s+\| row 2, cell 2\s+\| row 2, cell 3\s+\|\})/g, "");
document.getElementById('wpTextbox1').value = newcontents;
document.getElementById('wpWatchthis').checked = "";
document.getElementById('wpDiff').click();
}
addOnloadHook(function(){ RemoveExampleJpg(); });
}
if(wgCanonicalNamespace != "Special") {
addOnloadHook(function(){
var taburl = "http://en.wikipedia.org/w/index.php?title="+wgPageName+"&action=edit&remexamplejpg=1";
addTab(taburl, "example.jpg", "ca-examplejpgfix", "This is to remove Image:Example.jpg from stuff");
});
}
function openmypages() {
window.open('http://en.wikipedia.org/wiki/Image:Example.jpg?action=purge#filelinks');
window.open('http://en.wikipedia.org/wiki/Image:Example.ogg?action=purge#filelinks');
window.open('http://en.wikipedia.org/w/index.php?action=purge&title=Special:Whatlinkshere&target=Link_title');
window.open('http://en.wikipedia.org/w/index.php?action=purge&title=Special:Whatlinkshere&target=Insert_text');
}
if (window.location.href.indexOf('Special:Whatlinkshere&target=Link_title') != -1 || window.location.href.indexOf('Special:Whatlinkshere&target=Insert_text') != -1 || window.location.href.indexOf('Image:Example.jpg') != -1 || window.location.href.indexOf('Image:Example.ogg') != -1 || window.location.href.indexOf('Media:Example.ogg') != -1) {
addOnloadHook(function(){
var len=document.links.length;
for(var i=0; i<len; ++i) {
var l=document.links[i];
if (l.className != 'new') {
l.href=l.href+"?action=edit&remexamplejpg=1";
}
}
});
}
//</nowiki></pre>
//<pre><nowiki>
// BEGIN STUBFIX CODE
//check if we are editing and we want to stubfix
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('stubfix=1') != -1) {
function stubfix() {
document.getElementById('wpSummary').value = "Removing stub";
var contents = document.getElementById('wpTextbox1').value;
var newcontents = contents.replace(/\{\{.*?stubs?(\|?.*)\}\}/g, "");
document.getElementById('wpTextbox1').value = newcontents;
document.getElementById('wpWatchthis').checked = "";
document.getElementById('wpDiff').click();
}
addOnloadHook(function(){ stubfix(); });
}
//Check if it's article to add the tab
if(wgCanonicalNamespace == "") {
addOnloadHook(function(){
var taburl = "http://en.wikipedia.org/w/index.php?title="+wgPageName+"&action=edit&stubfix=1";
addTab(taburl, "rms", "ca-stubrem", "This removes stub tag.");
});
}
//END STUBFIX CODE
//</nowiki></pre>
//<pre><nowiki>
$(function() {
var ds = document.getElementsByTagName('td');
for(var i=0; i<ds.length; i++) {
var a = ds[i];
if(a.className == 'diff-ntitle') {
var fs = a.getElementsByTagName('a');
for(var j=0; j<fs.length; j++) {
var b = fs[j];
if(b.firstChild.data == 'rollback') {
var oldhref = ''+b.href;
var usr = unescape(b.href.split('from=')[1].split('&')[0]);
var cont = 'http://en.wikipedia.org/wiki/'+
'Special:Contributions/'+usr;
b.href = 'javascript:void(0)';
b.onclick = function() {
var http = new XMLHttpRequest();
http.open('GET', oldhref, true);
http.setRequestHeader("Connection", "close");
http.send(null);
http.onreadystatechange= function() {
window.location.href = (cont);
}
}
}
}
}
}
});
//</nowiki></pre>