User:Lahwaacz/common.js

From ArchWiki
Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
// customization of the diff library: https://en.wikipedia.org/wiki/User:Cacycle/diff#Customization
var wikEdDiffConfig; if (wikEdDiffConfig === undefined) { wikEdDiffConfig = {}; }
wikEdDiffConfig.coloredBlocks = true;

// Find clip position: characters from right
wikEdDiffConfig.clipHeadingLeft      = 1000;
wikEdDiffConfig.clipParagraphLeftMax = 1000;
wikEdDiffConfig.clipParagraphLeftMin =  500;
wikEdDiffConfig.clipLineLeftMax      = 1000;
wikEdDiffConfig.clipLineLeftMin      =  500;
wikEdDiffConfig.clipBlankLeftMax     = 1000;
wikEdDiffConfig.clipBlankLeftMin     =  500;
wikEdDiffConfig.clipCharsLeft        =  500;

// Find clip position: characters from right
wikEdDiffConfig.clipHeadingRight      = 1000;
wikEdDiffConfig.clipParagraphRightMax = 1000;
wikEdDiffConfig.clipParagraphRightMin =  500;
wikEdDiffConfig.clipLineRightMax      = 1000;
wikEdDiffConfig.clipLineRightMin      =  500;
wikEdDiffConfig.clipBlankRightMax     = 1000;
wikEdDiffConfig.clipBlankRightMin     =  500;
wikEdDiffConfig.clipCharsRight        =  500;

// Skip clipping if ranges are too close
wikEdDiffConfig.clipSkipLines = 5;
wikEdDiffConfig.clipSkipChars = 250;

// customization of wikEdDiff interface: https://en.wikipedia.org/wiki/User:Cacycle/wikEdDiff#Customization
//var wikEd; if ( wikEd === undefined ) { wikEd = {}; }
//if ( wikEd.config === undefined ) { wikEd.config = {}; }

// install [[w:User:Cacycle/wikEdDiff]] enhanced diff
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEdDiff.js&action=raw&ctype=text/javascript');

// hide the ordinary MediaWiki's diff
//$( "table.diff tr:has(td.diff-lineno, td.diff-marker)" ).css( "display", "none" );

// Wiki Monkey  https://github.com/kynikos/wiki-monkey/wiki
wikiMonkeyConfig = {update_check_wdays: [0, 1, 2, 3, 4, 5, 6]};
mw.loader.load('https://rawcdn.githack.com/kynikos/wiki-monkey/v4.2.2/dist/WikiMonkey-ArchWiki.min.js');


// move category links to the top
//var contentDivs = document.getElementsByClassName("mw-content-ltr");
//if ( contentDivs.length == 0 ) {
//  contentDivs = document.getElementsByClassName("mw-content-rtl");
//}
//if ( contentDivs.length > 0 ) {
//  var contentDiv = contentDivs[0];
//  var catlinks = document.getElementById("catlinks");
//  if ( catlinks != null ) {
//    contentDiv.parentNode.insertBefore(catlinks, contentDiv);
//    catlinks.setAttribute("style", "margin-bottom: 1em;");
//  }
//}