Jump to content

User:Ukexpat/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <syntaxhighlight lang=javascript>

//importStylesheet('MediaWiki:Gadget-navpop.css');
//importScript('MediaWiki:Gadget-popups.js');
wikEdRegExTypoFix = true;

importScript('User:Cacycle/wikEd.js');
var wikEdDoCloneWarnings = false;

//importScript('User:AzaToth/twinkle.js');


// importScript("User:Lupin/recent2.js");

//importScript('User:Ioeth/friendly.js');
//FriendlyConfig = {
//summaryAd                       :       " using [[WP:FRIENDLY|Friendly]]",
//enableClock                     :       false,
//topWelcomes                     :       false,
//watchWelcomes                   :       false,
//markWelcomesAsMinor             :       true,
//insertHeadings                  :       true,
//welcomeHeading                  :       "== Welcome ==",
//insertUsername                  :       true,
//insertSignature                 :       true,
//quickWelcomeMode                :       "auto",
//quickWelcomeTemplate            :       "Welcome",
//maskTemplateInSummary           :       true,
//markSharedAsMinor               :       true,
//groupByDefault                  :       true,
//watchTaggedPages                :       false,
//markTaggedPagesAsMinor          :       true,
//customWelcomeList:      [
//{
//label: '{{User:Ukexpat/welcome1|ukexpat}}: ukexpat welcome template 1',
//value: 'User:Ukexpat/welcome1|ukexpat'},
//{
//label: '{{User:Ukexpat/welcome2|ukexpat}}: ukexpat welcome template 2',
//value: 'User:Ukexpat/welcome2|ukexpat'}

//]
//};
//FriendlyConfig.customTagList = [ { label: '{{BLPunsourced}}: Unsourced biography', value: 'BLPunsourced' }, { label: '{{BLP sources}}: Biography sources need improving', value: 'BLP sources' } ];

importScript('User:Voice_of_All/Addtabs/monobook.js');

importScript('User:Misza13/statusChanger.js');

importScript('User:Mr.Z-man/refToolbar 2.0.js');
//Signature button (—)
if( mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit' )  try{    mw.toolbar.buttons[9][2] = '&nbsp;–&nbsp;~~\~~'  } catch(e){}
// [[User:Ais523/votesymbols.js]]
// Code for adding icons to !votes in AfDs, RfAs, etc.. Doesn't affect the page, just
// shows the icons when this code is installed.
// Please see [[:Image:Votesymbols.js-enhanced_SfD.png]] for copyright info on the images that are added.
 
function lowerNoPunct(s)
{
return s.toLowerCase().split('.').join('').split(',').join('').split(':').join('').split(';').join('').split('+').join('');
}
 
$(function() {
if(mw.config.get('wgNamespaceNumber')==0) return; //avoid article space, generally speaking
var vs=
"http://upload.wikimedia.org/wikipedia/commons/thumb/9/94/Symbol_support_vote.svg/15px-Symbol_support_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Symbol_keep_vote.svg/15px-Symbol_keep_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/15px-Symbol_oppose_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Symbol_delete_vote.svg/15px-Symbol_delete_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Symbol_neutral_vote.svg/15px-Symbol_neutral_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Symbol_merge_vote.svg/15px-Symbol_merge_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Symbol_move_vote.svg/15px-Symbol_move_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Symbol_redirect_vote.svg/15px-Symbol_redirect_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Symbol_opinion_vote.svg/15px-Symbol_opinion_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Symbol_comment_vote.svg/15px-Symbol_comment_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Symbol_unsupport_vote.svg/15px-Symbol_unsupport_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Symbol_question.svg/15px-Symbol_question.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Symbol_divide_vote.svg/15px-Symbol_divide_vote.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Symbol_wait.svg/15px-Symbol_wait.svg.png#"+
"http://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Face-grin.svg/15px-Face-grin.svg.png";
var vt=vs.split("#");
var la=new Array();
la['support']=0; la['endorse']=0;
la['keep']=1;
la['oppose']=2; la['overturn']=2; la['object']=2;
la['delete']=3;
la['neutral']=4;
la['merge']=5; la['upmerge']=5;
la['move']=6; la['rename']=6; la['userfy']=6; la['transwiki']=6;
la['redirect']=7;
la['opinion']=8; la['relist']=8; la['subst']=8; la['salt']=8; la['change']=8;
// Note that icon 8 on the list is often used for debate-specific !votes
la['comment']=9; la['update']=9; la['note']=9;
la['delist']=10;
la['question']=11;
la['split']=12;
la['wait']=13;
la['bjaodn']=14;
 
var btc=document.body.getElementsByTagName("B");
i=btc.length;
while(i--)
{
var j,k;
j=btc[i].innerHTML.split("<").join(" ").split(">").join(" ").split("/").join(" ").split(" ");
k=0;
var x="";
while(k<j.length)
{
if(lowerNoPunct(j[k])=="don't"||lowerNoPunct(j[k])=='not'
||lowerNoPunct(j[k])=='no'||lowerNoPunct(j[k])=='without') break;
var l=la[lowerNoPunct(j[k])];
if(l!=undefined)
{
x+="<IMG SRC='"+vt[l]+"' /> "
}
k++;
}
if(x!="") btc[i].innerHTML=x+btc[i].innerHTML;
}
});
//[[Category:Wikipedia scripts]]

//this helps automate AfD closing by adding a 'close' tab to AfD debates
//written by [[User:Johnleemk]] based on [[Wikipedia:WikiProject User scripts/Scripts/test-n.js]] by [[User:Celestianpower]]

function autoafd_result()
{
var close = prompt("Result of debate?")
var f = document.editform, t = f.wpTextbox1;
t.value = t.value.split('{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD').join('{{ns:0');
t.value = "{{subst:" + "at" + "}} '''" + close + "'''. " + "~" + "~" + "~" + "~" + '\n' + '\n' + t.value;
if (t.value.length > 0)
t.value += '\n';
t.value += "{{subst:" + "ab" + "}}";
f.wpSummary.value = "Closing debate; result was " + close;
}

function autoafd_relist()
{
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value += "{{subst:" + "relist" + "|~" + "~" + "~" + "~}}";
f.wpSummary.value = "Relisting debate";
}

function autoafd_keep()
{
var date = prompt("Nomination was made when?")
var votepage = prompt("Vote page is? (Enter 'd' for default.)")
var f = document.editform, t = f.wpTextbox1;

// If default votepage...
if (votepage=="d")
{
var temp = document.editform.action.split("/w/index.php?title=");
var temp = temp[1].split("&action=submit");
var temp = temp[0].substring(5);
var votepage = temp;
}

t.value = "{{" + "oldafdfull" + "|date=" + date + "|votepage=" + votepage + "}}" + '\n' + '\n' + t.value;
f.wpSummary.value = "Article survived AfD";
}

function autoafd_no_consensus()
{
var date = prompt("Nomination was made when?")
var votepage = prompt("Vote page is? (Enter 'd' for default.)")
var f = document.editform, t = f.wpTextbox1;

// If default votepage...
if (votepage=="d")
{
var temp = document.editform.action.split("/w/index.php?title=");
var temp = temp[1].split("&action=submit");
var temp = temp[0].substring(5);
var votepage = temp;
}

t.value = "{{" + "oldafdfull" + "|date=" + date + "|result='''no consensus'''|votepage=" + votepage + "}}" + '\n' + '\n' + t.value;
f.wpSummary.value = "Article survived AfD with no consensus";
}

function autoafd_redirect()
{
var date = prompt("Nomination was made when?")
var redirect = prompt("Redirect to?")
var votepage = prompt("Vote page is? (Enter 'd' for default.)")
var f = document.editform, t = f.wpTextbox1;

// If default votepage...
if (votepage=="d")
{
var temp = document.editform.action.split("/w/index.php?title=");
var temp = temp[1].split("&action=submit");
var temp = temp[0].substring(5);
var votepage = temp;
}

t.value = "{{" + "oldafdfull" + "|date=" + date + "|result='''redirect to [[" + redirect + "]]'''|votepage=" + votepage + "}}" + '\n' + '\n' + t.value;
f.wpSummary.value = "Article redirected to [[" + redirect + "]] as per AfD";
}

function autoafd_merge()
{
var date = prompt("Nomination was made when?")
var redirect = prompt("Merge and redirect to?")
var votepage = prompt("Vote page is? (Enter 'd' for default.)")
var f = document.editform, t = f.wpTextbox1;

// If default votepage...
if (votepage=="d")
{
var temp = document.editform.action.split("/w/index.php?title=");
var temp = temp[1].split("&action=submit");
var temp = temp[0].substring(5);
var votepage = temp;
}

t.value = "{{" + "oldafdfull" + "|date=" + date + "|result='''merge and redirect to [[" + redirect + "]]'''|votepage=" + votepage + "}}" + '\n' + '\n' + t.value;
f.wpSummary.value = "Article merged and redirected to [[" + redirect + "]] as per AfD";
}

function autoafd_other()
{
var date = prompt("Nomination was made when?")
var result = prompt("Result was?")
var votepage = prompt("Vote page is? (Enter 'd' for default.)")
var f = document.editform, t = f.wpTextbox1;

// If default votepage...
if (votepage=="d")
{
var temp = document.editform.action.split("/w/index.php?title=");
var temp = temp[1].split("&action=submit");
var temp = temp[0].substring(5);
var votepage = temp;
}

t.value = "{{" + "oldafdfull" + "|date=" + date + "|result='''" + result + "'''|votepage=" + votepage + "}}" + '\n' + '\n' + t.value;
f.wpSummary.value = "AfDed; result was " + result;
}

function autoafd_add_afd_tabs()
{
// Only add for pages with the right string somewhere in the title
if (document.title.indexOf("Editing Wikipedia:Articles for deletion/") != -1)
{
mw.util.addPortletLink('p-cactions', 'javascript:autoafd_result()', "close");
mw.util.addPortletLink('p-cactions', 'javascript:autoafd_relist()', "relist");
}
if (document.title.indexOf("Editing Talk:") != -1)
{
mw.util.addPortletLink('p-cactions', 'javascript:autoafd_keep()', "keep");
mw.util.addPortletLink('p-cactions', 'javascript:autoafd_no_consensus()', "no consensus");
mw.util.addPortletLink('p-cactions', 'javascript:autoafd_redirect()', "redirect");
mw.util.addPortletLink('p-cactions', 'javascript:autoafd_merge()', "merge");
mw.util.addPortletLink('p-cactions', 'javascript:autoafd_other()', "other");
}
}

$(autoafd_add_afd_tabs);

//end AfD closing script

//

// AutoCopyvio - Adds copyright violation notice to article and adds entry to Copyright Problems page
// Created by Bmicomp from modified AutoVFD(by Korath)
var CopyvioConfig={
page:'Wikipedia:Copyright_problems',
tabname:'copyvio',
addmsg:'copyvio'
}

function add_link2(url, name)
{
var na = document.createElement('a');
na.setAttribute('href', url);
na.appendChild(document.createTextNode(name));

var li = document.createElement('li');
li.appendChild(na);

var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
tabs.appendChild(li);
}

function strip_namespace(target)
{
var colon = target.indexOf(':');
if (colon != -1)
{
var spaces = new Array('User', 'Wikipedia', 'Image', 'MediaWiki', 'Template', 'Help', 'Category');
var ns = target.substring(0, colon);
if (ns == '' || ns == 'Talk')
return target.substring(colon + 1);
else
for (var i = 0; i < spaces.length; ++i)
{
if (ns == spaces[i]
|| ns == spaces[i] + '_talk')
return target.substring(colon + 1);
}
}
return target;
}

function copyvio()
{
document.editform.wpTextbox1.value = '{' + '{' + 'copyvio|url=}}';
document.editform.wpSummary.value = 'copyvio';

var target = document.editform.action;
target = target.substring(target.indexOf('title=') + 6,
target.lastIndexOf('&action=submit'));

var months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
var date = new Date();
var datestring = date.getUTCFullYear() + '_' + months[date.getUTCMonth()] + '_' + date.getUTCDate();
var pagename = strip_namespace(target);

window.open('/w/index.php?title=Wikipedia:Copyright_problems/' + datestring + '&action=edit&fakeaction=copyviolist&faketarget=' + pagename, 'status,toolbar,location,menubar,directories,resizeable,scrollbars');
}

function autocopyvio()
{
if (document.title.indexOf('Editing ') == 0)
{
var action = '';
var target = '';
if (location.search)
{
var l = location.search.substring(1).split('&');
for (var i = 0; i < l.length; ++i)
{
var eq = l[i].indexOf('=');
var name = l[i].substring(0, eq);
if (name == 'fakeaction')
action = l[i].substring(eq + 1);
else if (name == 'faketarget')
target = unescape(l[i].substring(eq + 1)).replace(/_/g, ' ');
}
}

if (action == 'copyviolist')
{
document.editform.wpTextbox1.value += '*[[' + target + ']] <span class="plainlinks">([http://en.wikipedia.org/{{localurl:' + target + '|action=history}} history] &middot; [http://en.wikipedia.org/{{localurl:' + target + '|diff=0}} last edit])</span>' + ' from [' + '] ~' + '~~' + '~';
document.editform.wpSummary.value = 'Copyvio ' + '[[' + target + ']]';
}
else
mw.util.addPortletLink('p-cactions','javascript:copyvio()',CopyvioConfig.tabname,'ca-copyvio','request copyvio','');
}
}

$(autocopyvio);
//

importScript('User:Ais523/stubtagtab2.js');

//importScript('User:Dr pda/persondata.js'); //[[User:Dr pda/persondata.js]]

//importScript('User:Dr pda/articlehistory.js'); //[[User:Dr pda/articlehistory.js]]

/**** afd helper ****/
importScript('User:Jnothman/afd_helper/script.js');

/* This is to keep track of who is using this extension: [[User:Jnothman/afd_helper/script.js]] */

importScript('User:Mr.Z-man/refbuttons.js');

importScript('Wikipedia:WikiProject_User_scripts/Scripts/Formatter');
importScript('Wikipedia:WikiProject_User_scripts/Scripts/Formatter/Auto Edit Summary');

/***scripts for Afd sorting***/

importScript('User:Quarl/util.js');

importScript('User:Quarl/wikipage.js');

importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');

importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');

importScript('User:Fox Wilson/delsort-monobook.js'); // Deletion sorting script [[WP:FWDS]]

// [[User:Krimpet/CH2.js]]
importScript('User:Krimpet/CH2.js');

importScript('User:Dr_pda/templatecheck.js'); //[[User:Dr_pda/templatecheck.js]]

importScript('User:Dr_pda/editrefs.js'); //[[User:Dr_pda/editrefs.js]]

importScript('User:AndyZ/peerreviewer.js'); //[[User:AndyZ/peerreviewer.js]]

importScript('User:Dr_pda/generatestats.js');

importScript('User:Ilmari Karonen/modrollback-newwindow.js');
importScript('Wikipedia:WikiProject User scripts/Scripts/Changes since I last edited');

importScript('User:Lightmouse/monobook.js/script.js');

importScript('User:Splarka/dabfinder.js');

importScript('User:Dr pda/prosesizebytes.js');

//importScript('User:AWeenieMan/furme.js');

importScript('User:Mr.Z-man/moverevert.js');
//importScript('User:Twinzor/wikimark.js');

//importScript('User:Haza-w/cactions.js'); //[[User:Haza-w/cactions.js]]

importScript('User:Mr.Z-man/patrollinks.js');

//importScript('User:Drilnoth/assessortags.js'); //See [[User:Drilnoth/assessortags.js/doc]] for details

importScript('User:Cameltrader/Advisor.js');

importScript('Wikipedia:AutoEd/complete.js');

importScript('user:js/urldecoder.js')
urlDecoderKey = 'c' //accesskey
urlDecoderIntLinks = true //also decode existing [[internal links]] in selected text
$( function () {
mw.util.addPortletLink("p-tb", mw.config.get('wgServer')+mw.config.get('wgArticlePath').replace("$1", "Special:PrefixIndex/"+mw.config.get('wgPageName')+"/"), "Subpages", "t-subpages", "See all subpages of this page");
});

importScript('User:Patchy1/stubtag.js');

importScript('User:Shubinator/DYKcheck.js'); //DYKcheck tool
fixedSidebar = "always";

importScript('User:Js/ajaxPreview.js')

importScript('User:Tra/sidebartranslate.js'); //[[User:Tra/sidebartranslate.js]]

importScript('User:Anakin101/search-new-window.js');

// Module: revisionjumper.js Allows to jump between diffs and permanent links
//importScript('MediaWiki:Gadget-revisionjumper.js'); // [[MediaWiki:Gadget-revisionjumper.js]]

//importScript('User:Ale_jrb/Scripts/igloo.js'); // [[User:Ale_jrb/Scripts/igloo]]

//importScript('User:ProveIt GT/ProveIt.js');
// [[User:ProveIt GT/ProveIt.js]]

importScript('User:Anomie/util.js');
importScript('User:Anomie/previewtemplatelastmod.js'); // Linkback: [[User:Anomie/previewtemplatelastmod.js]]

//importScript('User:TheDJ/sharebox.js');

importStylesheet('User:Gadget850/talkhighlight.css'); // Linkback: [[User:Gadget850/talkhighlight.css]]

mw.loader.load('https://de.wikipedia.org/w/index.php?title=Benutzer:Luxo/gwatch.js'
 + '&action=raw&ctype=text/javascript');

$( function() {    mw.util.addPortletLink( 'p-personal', "http://commons.wikimedia.org/w/index.php?title=Special:Contributions/Ukexpat&offset=&limit=500&target=Ukexpat", 'Commons contributions', 'pt-randomfile', 'Link to my Commons contributions', 'A', document.getElementById("pt-mycontris")); });

importScript("Wikipedia:Dazzle!/code.js");

importScript('User:Alpha Quadrant/closerm.js');

window.hotcat_use_category_links = true;

// [[user:js/watchlist]]

if (mw.config.get('wgCanonicalSpecialPageName') == 'Watchlist')
importScript('user:js/watchlist.js');

importScript('User:Chicocvenancio/HelpDeskTBLinks.js');

$( function() {    mw.util.addPortletLink( 'p-personal', "http://www.wikidata.org/w/index.php?title=Special:Contributions/Ukexpat&offset=&limit=500&target=Ukexpat", 'Wikidata contributions', 'pt-randomfile', 'Link to my Wikidata contributions', 'A', document.getElementById("pt-mycontris")); });

$( function() {    mw.util.addPortletLink( 'p-personal', "http://en.wikipedia.org/wiki/Special:Notifications", 'Notifications', 'pt-randomfile', 'Link to my notifications', 'A', document.getElementById("pt-mycontris")); });

//importScript('User:NicoV/TemplateDataEditor.js');

importScript('User:Anomie/previewtemplatelastmod.js'); // Linkback: [[User:Anomie/previewtemplatelastmod.js]]

// </syntaxhighlight>