Revision as of 13:42, 19 August 2009 view sourceBetacommand (talk | contribs)86,927 editsNo edit summary← Previous edit |
Latest revision as of 08:12, 29 November 2021 view source Ladsgroup (talk | contribs)Extended confirmed users, IP block exemptions, Pending changes reviewers, Rollbackers20,548 editsm Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink) |
(8 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
|
⚫ |
//<nowiki> |
|
//Written by ], thanks to ] and ] for help with this! |
|
//Written by ], thanks to ] and ] for help with this! |
|
//Modified by ] |
|
//Modified by ] |
|
// BEGIN MYSPACE LINK REMOVAL CODE |
|
|
//check if we are editing and we want to myspace |
|
|
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('myspace=1') != -1) |
|
|
{ |
|
|
function myspace() { |
|
|
document.getElementById('wpSummary').value = "Removing Myspace link as unverifiable and against policy ]"; |
|
|
var contents = document.getElementById('wpTextbox1').value; |
|
|
var newcontents = contents.replace(/(\*\s*?)?\/g, ""); |
|
|
document.getElementById('wpTextbox1').value = newcontents; |
|
|
document.getElementById('wpDiff').click(); |
|
|
document.getElementById('wpWatchthis').checked = ""; |
|
|
} |
|
|
addOnloadHook(function(){ myspace(); }); |
|
|
} |
|
|
//Check if it's article to add the tab |
|
|
if(wgCanonicalNamespace === "") { |
|
|
addOnloadHook(function(){ |
|
|
var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&myspace=1"; |
|
|
addTab(taburl, "Remove Myspace!", "ca-myspace", "This is to kill Myspace Links"); |
|
|
}); |
|
|
} |
|
|
//END MYSPACE LINK REMOVAL CODE |
|
|
//////////////////////////////////////////////// |
|
|
//Written by ], thanks to ] and ] for help with this! |
|
|
//Modified by ] |
|
|
// BEGIN google LINK REMOVAL CODE |
|
|
//check if we are editing and we want to google |
|
|
if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('google=1') != -1) { |
|
|
function google() { |
|
|
document.getElementById('wpSummary').value = "Removing google link against policy to link to Search Engines"; |
|
|
var contents = document.getElementById('wpTextbox1').value; |
|
|
var newcontents = contents.replace(/(\*\s*?)?\/g, ""); |
|
|
document.getElementById('wpTextbox1').value = newcontents; |
|
|
document.getElementById('wpDiff').click(); |
|
|
document.getElementById('wpWatchthis').checked = ""; |
|
|
} |
|
|
addOnloadHook(function(){ google(); }); |
|
|
} |
|
|
//Check if it's article to add the tab |
|
|
if(wgCanonicalNamespace === "") { |
|
|
addOnloadHook(function(){ |
|
|
var taburl = "http://en.wikipedia.org/search/?title="+wgPageName+"&action=edit&google=1"; |
|
|
addTab(taburl, "Remove google!", "ca-google", "This is to kill google Links"); |
|
|
}); |
|
|
} |
|
|
//END google LINK REMOVAL CODE |
|
|
|
|
|
|
|
|
⚫ |
//<pre><nowiki> |
|
|
if(wgNamespaceNumber == -1) { |
|
if(mw.config.get('wgNamespaceNumber') == -1) { |
|
addOnloadHook(function() { |
|
addOnloadHook(function() { |
|
var tbs = document.getElementById('p-cactions').getElementsByTagName('ul'); |
|
var tbs = document.getElementById('p-cactions').getElementsByTagName('ul'); |
Line 136: |
Line 91: |
|
}; |
|
}; |
|
|
|
|
|
if(wgPageName == 'Special:Linksearch') { |
|
if(mw.config.get('wgPageName') == 'Special:LinkSearch') { |
|
addOnloadHook(function() { |
|
addOnloadHook(function() { |
|
var tbs = document.getElementById('p-cactions').getElementsByTagName('ul'); |
|
var tbs = document.getElementById('p-cactions').getElementsByTagName('ul'); |
|
addlilink(tbs, "javascript:void(filter_main())", "filter", 'ca-filter', 'Filter all pages on here to only be for mainspace'); |
|
addlilink(tbs, "javascript:filter_main();", "filter", 'ca-filter', 'Filter all pages on here to only be for mainspace'); |
|
}); |
|
}); |
|
}; |
|
}; |
⚫ |
//</nowiki></pre> |
|
|
|
|
|
|
function substNRD() { |
|
function substNRD() { |
Line 150: |
Line 104: |
|
document.editform.submit(); |
|
document.editform.submit(); |
|
} else |
|
} else |
|
document.location = wgServer + wgScript + "?title=" + wgPageName + "&action=edit&substNRD=1"; |
|
document.location = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + mw.config.get('wgPageName') + "&action=edit&substNRD=1"; |
|
}; |
|
}; |
|
function addSubstNRD(){ |
|
function addSubstNRD(){ |
|
if (wgCanonicalNamespace == "File") |
|
if (mw.config.get('wgCanonicalNamespace') == "File") |
|
addPortletLink("p-cactions", "javascript:substNRD()", "{{" + "dfu}}", ""); |
|
mw.util.addPortletLink("p-cactions", "javascript:substNRD()", "{{" + "dfu}}", ""); |
|
if (document.location.href.indexOf("substNRD=1") > 0) |
|
if (document.location.href.indexOf("substNRD=1") > 0) |
|
substNRD(); |
|
substNRD(); |
|
}; |
|
}; |
|
addOnloadHook(addSubstNRD); |
|
$(addSubstNRD); |
|
⚫ |
//</nowiki> |