User:CWenger/common.js

// mark all mainspace edits as minor by default if(mw.config.get('wgAction') == 'edit' && mw.config.get('wgNamespaceNumber') == 0) $('#wpMinoredit').attr('checked', true)

// Navigation popups settings popupDelay = 0.2; popupHideDelay = 0.1;

// Twinkle settings if(typeof(TwinkleConfig) == 'undefined') TwinkleConfig = {}; TwinkleConfig.watchWarnings = false; TwinkleConfig.watchRevertedPages = [ ];

// AutoEd importScript('Wikipedia:AutoEd/core.js'); autoEdLinkName = "AutoEd"; importScript('Wikipedia:AutoEd/extrabreaks.js'); importScript('Wikipedia:AutoEd/fullwidth.js'); importScript('Wikipedia:AutoEd/headlines.js'); importScript('Wikipedia:AutoEd/htmltowikitext.js'); importScript('Wikipedia:AutoEd/isbn.js'); importScript('Wikipedia:AutoEd/links.js'); importScript('Wikipedia:AutoEd/tablestowikitext.js'); importScript('Wikipedia:AutoEd/templates.js'); importScript('Wikipedia:AutoEd/unicodecontrolchars.js'); importScript('Wikipedia:AutoEd/unicodehex.js'); importScript('Wikipedia:AutoEd/unicodify.js'); importScript('Wikipedia:AutoEd/whitespace.js'); importScript('Wikipedia:AutoEd/wikilinks.js'); importScript('User:CWenger/dashesFunction.js'); importScript('User:CWenger/emDashesFunction.js'); importScript('User:CWenger/unhyphenateFunction.js'); importScript('User:CWenger/straightenQuotesFunction.js'); function autoEdFunctions { var txt = document.editform.wpTextbox1; txt.value = autoEdExtraBreaks(txt.value); //txt.value = autoEdFullwidth(txt.value); txt.value = autoEdHeadlines(txt.value); txt.value = autoEdHTMLtoWikitext(txt.value); txt.value = autoEdISBN(txt.value); txt.value = autoEdLinks(txt.value); txt.value = autoEdTablestoWikitext(txt.value); txt.value = autoEdTemplates(txt.value); txt.value = autoEdUnicodeControlChars(txt.value); txt.value = autoEdUnicodeHex(txt.value); txt.value = autoEdUnicodify(txt.value); txt.value = autoEdWhitespace(txt.value); txt.value = autoEdWikilinks(txt.value); txt.value = autoEdDashes(txt.value); txt.value = autoEdEmDashes(txt.value); txt.value = autoEdUnhyphenate(txt.value); txt.value = autoEdStraightenQuotes(txt.value); }

// remove most bot edits from watchlist ExemptBots = [ "SineBot", "SmackBot", "AnomieBOT", "Helpful Pixie Bot" ]; function hideMostBotEditsFromWatchlist { if(mw.config.get('wgPageName') == 'Special:Watchlist') {   changes_hidden = 0;

days = document.getElementById('bodyContent').getElementsByTagName('ul');

for(day in days) {     change = days[day].firstChild;

while(change) {       hide = -1; for(change_child_node in change.childNodes) {         if(change.childNodes[change_child_node].nodeName == "ABBR") {           if(change.childNodes[change_child_node].attributes['class'].value == "bot") {             hide = 1; }         }          else if(change.childNodes[change_child_node].nodeName == "A") {           for(exempt_bot in ExemptBots) {             if(change.childNodes[change_child_node].attributes['title'] != null &&                change.childNodes[change_child_node].attributes['title'].value == "User:" + ExemptBots[exempt_bot]) {               hide = 0; break; }           }            if(hide == 0) {             break; }         }        }

if(hide == 1) {         change.style.display = "none"; changes_hidden++; }

change = change.nextSibling; }   }

b_nodes = document.getElementsByTagName("b"); for(b = 1; b < b_nodes.length; b++) {     if(parseInt(b_nodes[b].textContent) <= parseInt(b_nodes[b - 1].textContent)) {       total_changes = parseInt(b_nodes[b].textContent); b_nodes[b].textContent = b_nodes[b].textContent + " − " + changes_hidden + " bot = " + (total_changes - changes_hidden) + " visible"; }   }  } } addOnloadHook(hideMostBotEditsFromWatchlist);