User:Cometstyles/common.js

//TwinkleConfig.showRollbackLinks = []; //importScript('User:Xaradnam/twinkle.js'); importScript('User:ais523/editcount.js'); importScript('User:Zocky/SearchBox.js');

/**** Add generic tab ****/ function addlilink(tabs, url, name, id) { var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); li.id = name; li.appendChild(na); tabs.appendChild(li); return li; }

/**** Add tab as menu ****/ function addlimenu(tabs, name, id) { var na = document.createElement('a'); na.href = '#'; var mn = document.createElement('ul'); na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); li.id = id; li.className = 'tabmenu'; li.appendChild(na); li.appendChild(mn); tabs.appendChild(li); return li; }

// appends msg to the currently-editted page, sets the summary to summ, // and marks or unmarks the Watch this page checkbox according to watch. function edit_summary_watch(msg, summ, watch) { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += msg; f.wpSummary.value = summ; f.wpWatchthis.checked = watch; }

// appends msg to the currently-editted page, sets the summary to summ, // and marks or unmarks the Watch this page checkbox according to watch. function add_del_tag(msg, summ, watch) { var f = document.editform, t = f.wpTextbox1; msg += '\n'; msg += t.value; t.value = msg; f.wpSummary.value = summ; f.wpWatchthis.checked = watch; }

// User:Jsimlo/shortcuts.js //mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Jsimlo/shortcuts.js&action=raw&ctype=text/javascript');

function shortcutsInit { shortcutsAddLink ('Templates', 'Wikipedia:Template_messages'); shortcutsAddLink ('SD criteria', 'WP:CSD'); shortcutsAddLink ('Log', 'Special:Log'); shortcutsAddLink ('Delete Log', 'Special:Log/delete'); shortcutsAddLink ('Block Log', 'Special:Log/block'); shortcutsAddLink ('IPBlocklist', 'Special:Ipblocklist'); shortcutsAddLink ('Move', 'Special:Log/move'); shortcutsAddLink ('Unblock requests', 'Category:Requests for unblock'); }

function addNavBarLinks { var navbar = document.getElementById('p-navigation').getElementsByTagName('ul')[0]; var afdtime = new Date; var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; addlilink(navbar, '/wiki/Wikipedia:Articles_for_deletion/Log/' + afdtime.getUTCFullYear + '_' + months[afdtime.getUTCMonth] + '_' + afdtime.getUTCDate, 'Todays AfD', ''); afdtime.setUTCDate(afdtime.getUTCDate - 5); addlilink(navbar, '/wiki/Wikipedia:Articles_for_deletion/Log/' + afdtime.getUTCFullYear + '_' + months[afdtime.getUTCMonth] + '_' + afdtime.getUTCDate, '5-day old AfD', ''); var username=document.getElementById("pt-userpage").textContent; addlilink(navbar, '/wiki/Wikipedia_talk:WikiProject_Spam', 'WikiProject Spam', ''); addlilink(navbar, '/w/index.php?title=Special%3ALinksearch&target=*.', 'Link Search', ''); }

/** * Ajax sysop * @see https://meta.wikimedia.org/wiki/Ajax_sysop * @update-token */ mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');