User:Saintrain/vector.js

//

/* //=================== firebug lite - firebugx.js  ================================================= if( !("console" in window) || !("firebug" in console) ) { var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) window.console[names[i]] = function {} }

// install User:Cacycle/wikEd in-browser text editor mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' + '&action=raw&ctype=text/javascript'); /* */

//=================== getElementsByClass  ========================================================= function getElementsByClass(searchClass, node, tag, findFirst) { // Function from http://www.dustindiaz.com/getelementsbyclass/ BUG = false; if ( node == null ) node = document; if ( tag == null ) tag = '*'; if ( findFirst == null ) findFirst = false; if ( ! findFirst ) var classElements = new Array; var els = node.getElementsByTagName(tag); if(BUG) console.group('gec: els.length = ', els.length ); var elsLen = els.length; var pattern = new RegExp( searchClass );  // ("(^|\\s)"+searchClass+"(\\s|$)"); for(i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { if( findFirst ) { if(BUG) console.log('gec: els[',i,'].className = ', els[i].className, ' -> found first' ); if(BUG) console.groupEnd; return els[i]; }    else { classElements[j] = els[i]; j++; if(BUG) console.log('gec: els[',i,'].className = ', els[i].className, ' -> j = ', j ); }   }  } if ( findFirst ) { if(BUG) console.log('gec: NOT FOUND: <',tag,' class="',searchClass,'">' ); if(BUG) console.groupEnd; return null; } else { if(BUG) console.groupEnd; return classElements; } }

var Klvl = 0, nKidCalls = 0; //===================== dump tree structure  ======================================================= function Kids( Mom ) { Klvl++; nKidCalls++; document.writeln('--'); for(var l=0; l<Klvl; l++) { document.writeln('-'); } document.writeln('Mom[', Klvl, ']' ); if( Mom.hasChildNodes ) document.writeln('(nKids=',Mom.childNodes.length,')' ); else document.writeln('(nKids=0)' ); document.writeln(' Tag={', Mom.tagName, ')' ); document.writeln('  Class={', Mom.className, '}' ); document.writeln('  text={', Mom.textContent, '}' ); document.writeln(' ' ); if( Mom.hasAttributes ) { for(var l=0; l<=Klvl; l++) {  document.writeln('-'); }  document.writeln(' Attrs=');  for(var k=0; k<Mom.Attributes.length; k++) {    document.writeln(' {[',k,':', Mom.attributes[k].name, '/', Mom.attributes[k].value,'}' );    }  } else  document.writeln('(nAttributes=0)' ); if( Mom.hasChildNodes ) {  for(var k=0; k<Mom.childNodes.length; k++) {    Kids( Mom.childNodes[k] );    }  } document.writeln(' '); Klvl--; } /* //============================================================================ function dumpKids { Kids( window ); console.log('After ',nKidCalls,' Kid calls, Klvl=',Klvl ); } //============================================================================ addOnloadHook( dumpKids ); /* */

//=================== deSpamWiki  ========================================================= //  User:Saintrain/J1/deSpamWiki.js //-edit-page changed- importScript('User:Saintrain/J1/deSpamWiki.js');

//=================== Collapsing Columns  ================================================= //-too weird- importScript('User:Saintrain/S3/colcol.js');

/* //=================== User:Lupin/popups.js  =============================================== // User:Lupin/popups.js // importScript('User:Lupin/popups.js'); //=================== User:TheDJ/slimpopups.js  =========================================== // User:TheDJ/slimpopups.js importStylesheet('MediaWiki:Gadget-navpop.css'); importScript('User:TheDJ/slimpopups.js'); /* */

//=================== User:Henrik/js/afc-helper.js  ======================================= // User:Henrik/afc-helper importScript('User:Henrik/js/afc-helper.js');

popupFixRedirs         = true; popupWatchRedirredPages = false; popupRedirAutoClick    = 'wpPreview'; popupRedlinkRemoval 	= true; popupFixDabs 	          = true; popupWatchDisambiggedPages = null; // popupPreviewRawTemplates = true; //??? popupPreviewFirstParOnly = false; popupMaxPreviewSentences = 6; //(4)

window.charinsertCustom = { "Insert": "∝", // proportional tocategorized as a shared IP  //-fun but silly- "Smileys": ":-) :-( :-D :-/ :-P ;-)  :) :( :D :/ :P ;)" };

/* 1by1

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

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

// // WikiProject User scripts/Scripts/Watchlist since // importScript('Wikipedia:WikiProject User scripts/Scripts/Watchlist since');

/* */

// modified from User:Ais523/bracketmatch.js // var bm_useparsebutton=1; importScript('User:Saintrain/bracketmatch2.js');

// user:js/watchlist importScript('user:js/watchlist.js');

// User:Dschwen/highlightredirects.js - please include this line mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Dschwen/highlightredirects.js'  + '&action=raw&ctype=text/javascript');

//