User:Flabby Bunny Ears/vector.js

From wikishia

Note: After publishing, 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 / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
if( typeof( TwinkleConfig ) == 'undefined' ) TwinkleConfig = {}; // DO NOT REMOVE THIS LINE - ALL TWINKLE SETTINGS AFTER THIS
TwinkleConfig.batchdeleteChunks			=	50;
TwinkleConfig.batchDeleteMinCutOff			=	5;
TwinkleConfig.batchMax					=	5000;
TwinkleConfig.batchProtectChunks			=	50;
TwinkleConfig.batchProtectMinCutOff			=	5;
TwinkleConfig.batchundeleteChunks			=	50;
TwinkleConfig.batchUndeleteMinCutOff			=	5;
TwinkleConfig.blankTalkpageOnIndefBlock		=	false;
TwinkleConfig.defaultWarningGroup			=	1;
TwinkleConfig.deleteTalkPageOnDelete			=	false;
TwinkleConfig.deletionSummaryAd			=	' using	[[WP:TW|TW]]';
TwinkleConfig.deliChunks				=	500;
TwinkleConfig.deliMax					=	5000;
TwinkleConfig.markAIVReportAsMinor			=	true;
TwinkleConfig.markSockReportAsMinor			=	true;
TwinkleConfig.markUAAReportAsMinor			=	true;
TwinkleConfig.markRevertedPagesAsMinor			=	[ 'vand' ];
TwinkleConfig.markSpeedyPagesAsMinor			=	false;
TwinkleConfig.markSpeedyPagesAsPatrolled		=	true;
TwinkleConfig.notifyUserOnDeli				=	true;
TwinkleConfig.notifyUserOnSpeedyDeletionNomination	=	[ 'g1',	'g2', 'g3', 'g4', 'g10', 'g11',	'g12', 'a1', 'a2', 'a3', 'a5', 'a7', 'a9', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f9', 'f10', 'f11', 'u3', 't2', 't3', 'p2'	];
TwinkleConfig.offerReasonOnNormalRevert		=	true;
TwinkleConfig.openTalkPage				=	[ 'agf', 'norm', 'vand'	];
TwinkleConfig.openTalkPageOnAutoRevert			=	false;
TwinkleConfig.openUserTalkPageOnSpeedyDelete		=	[ 'g1',	'g2', 'g3', 'g4', 'g5',	'g10', 'g11', 'g12', 'a1', 'a3', 'a7', 'a9', 'f3', 'f4', 'f5', 'f6', 'f7', 'f9', 'f11', 'u3', 't2' ];
TwinkleConfig.orphanBacklinksOnSpeedyDelete		=	{exclude:['g6'], orphan:true};
TwinkleConfig.proddeleteChunks				=	50;
TwinkleConfig.protectionSummaryAd			=	' using	[[WP:TW|TW]]';
TwinkleConfig.revertMaxRevisions			=	50;
TwinkleConfig.showRollbackLinks			=	[ 'diff', 'others' ];
TwinkleConfig.showSharedIPNotice			=	true;
TwinkleConfig.summaryAd				=	' using	[[WP:TW|TW]]';
TwinkleConfig.userTalkPageMode				=	'window';
TwinkleConfig.watchProdPages				=	true;
TwinkleConfig.watchRevertedPages			=	[ ];
TwinkleConfig.watchSpeedyPages				=	[ 'g3',	'g5', 'g10', 'g11', 'g12', 't1'	];
TwinkleConfig.watchWarnings				=	false;
TwinkleConfig.welcomeUserOnSpeedyDeletionNotification	=	TwinkleConfig.notifyUserOnSpeedyDeletionNomination;
importScript('Wikipedia:WikiProject User scripts/Scripts/qSig');
 
// Please leave the following line
// [[user:Where/usertabs]]
 
addOnloadHook(function() {
  if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history
     return;
  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
     var username = encodeURIComponent( wgTitle );
     addPortletLink("p-cactions", wgServer + "/wiki/Special:Contributions/" + username, "Contribs", "ca-contrib", "User contributions");
     addPortletLink("p-cactions","http://toolserver.org/~soxred93/count/index.php?name="+ username +"&lang=en&wiki=wikipedia" , "Edits", "ca-editcount", "Edit count from X!'s Tool");
     addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=move&user=" + username, "Moves", "ca-pagemoves", "Page moves by this user");
     addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=block&page=User:" + username, "Blocks", "ca-blog", "Blocks received by this user");
     addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Prefixindex&from=" + username + "&namespace=2", "Pages", "", "List of pages in this user's userspace");
  }
});
 
// 
 
// [[User:Jsimlo/shortcuts.js]]
 document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Jsimlo/shortcuts.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 function shortcutsInit ()
 {
 
  shortcutsAddLink ( 'Wireless Keyboard', 'User talk:Wireless Keyboard' );
 
 
 }
 
// CHECK THAT I'VE REMEMBERED TO SIGN TALK PAGES AND IF SURE DO IT AUTOMATIC:
// *** aut. signing / (automatische Unterschrift) *** [[User:Olliminatore/signing.js]]
// created 23.04.2006 by [[User:Olliminatore]]
// updated 23.04.2006 by [[:en:User:Ilmari Karonen]]
// current version 1.56 13.03.2007
// Interwiki <noinclude>[[de:User:Olliminatore/signing.js]]</noinclude>
//<pre><nowiki>
 
String.prototype.trim = function(){return this.replace(/^\s*|\s*$/g,"")};
 
if (typeof usersignature == 'undefined') usersignature = ' --\~\~\~\~\n';
 
if (typeof regpages == 'undefined') { // list of all none talk pages
    var regpages = [
    ':Village pump',
    ':Articles for deletion',
    ':Requests for ',
    ':Reference desk',
    ':Deletion review',
    ':Templates for deletion',
    '.*noticeboard.*',
    ':checkuser',
    ':arbitration',
    ':feedback',
    ':page protection',
    'mediation)',
    ':Bot requests',
    ':Help desk',
    ':Editor review',
    ':Adminship survey',
    ':Cleanup',
    ':Miscellany for deletion',
    ':New contributors\' help page',
    ':Media copyright questions'
    ];
} 
 
    // regarded pages type encoded
if (wgCanonicalNamespace.match(/talk$/i)) var regpages = "";
for (p in regpages) if (wgPageName.indexOf(regpages[p]) != -1){regpages=false; break}
 
if (!regpages) 
addOnloadHook(function(){
    if (!(window.editform = document.forms['editform'])) return;
    // Add a new checkbox to the Wiki editOptions.
    sigBox = document.createElement("input");
    sigBox.setAttribute('type','checkbox');
    sigBox.setAttribute('name','wpSigning');
    sigBox.setAttribute('id','wpSigning');
    sigBox.setAttribute('checked','checked');
    sigBox.defaultChecked=true;
    neuB = document.createElement("label");
    neuB.appendChild(sigBox);
    neuB.appendChild(document.createTextNode("Sign"));
    neuB.setAttribute('for','wpSigning');
    neuB.setAttribute('title','Sign this edit automatic.');
 
    function setSigBox() { // switch enable box
        if (editform.wpMinoredit.checked) sigBox.setAttribute('disabled','disabled');
        else sigBox.removeAttribute('disabled');
    };
 
    var txtarea=editform.elements['wpTextbox1'];
    var txtOld=txtarea.value.trim();
    // txtOld_l=txtOld.length
    var txtOldEnd=txtOld.slice(-24);
    var sig = /~{3}/g;
 
    if (!tNode){
        //editform.insertBefore(neuB, editform.elements['wpWatchthis']); // maybe FIXME: raised an NS_DOM_ERR!
        var tNode = editform.elements['wpMinoredit'].parentNode;  // DOM workaround!?
        tNode.divs = tNode.getElementsByTagName("DIV");
        tNode.divs = tNode.divs.item(tNode.divs.length-1); // last div
        tNode.insertBefore(neuB, tNode.divs);
        setSigBox();
    }
 
    function doSign(event){
        if(editform.onsubmit==''){ // only once!
            removeEvent(editform.wpSave,"click",doSign);
            removeEvent(editform.wpPreview,"click",doSign);
        }
        if(editform.onsubmit=='') removeEvent(editform.wpSave,"click",doSign); // only once!
        if(editform.wpMinoredit.checked || !sigBox.checked) return;
        txtarea.focus();
        var cOld = txtOld.match(/<nowiki>.*?~{3}.*?<\/nowiki>/g); // exception for nowiki
        if (cOld) cOld = cOld.length;
        cNew = txtarea.value.match(sig); if (cNew) cNew = cNew.length;
        if (cNew > cOld){ // if there are a sign, check for true
            var cNew2 = txtarea.value.match(/\{\{subst\:unsig.*?~{3}\}\}/); // exception for Template:unsigned
            cNew -= (cNew2)?cNew2.length:0;
        }
        if(cNew <= cOld){ // if nothing then search a set position
            txt=txtarea.value.trim();
            txtEnd=txt.slice(-24);
            if(txtOldEnd!=txtEnd) return txtarea.value = txt + usersignature;  // aut. underwrite
            else { // post between
                pos = getCaretPos(txtarea);
                pos = txt.indexOf('\n', pos); // go to the post-end
                txtEnds = txt.substr(pos,24).replace(/(^\s*)/,""); // after
                txtpEnds = txt.slice(pos-18,pos); // before
                oldp = txtOld.indexOf(txtEnds);
                if(oldp!=-1 && oldp < pos - 3 && txtOld.indexOf(txtpEnds+RegExp.$1+txtEnds)==-1) // if some added
                    return txtarea.value = txt.slice(0,pos).trim() + usersignature + txt.slice(pos+1);
            }
         // FIXME: then the edit-end is not found!?
        }
        else if(!sig.test(txtOld) || cOld < cNew) return;
        if (event) event=(window.Event)? event.target: event.srcElement;
        if (event.name == 'wpPreview') return; // not for preview
        return editform.onsubmit=new Function("editform.onsubmit='';"
          +"return confirm('No signing was found. Continue anyway?')"); //warn if saving without signature
    };
    addEvent(editform.wpSave,"click", doSign);
    addEvent(editform.wpPreview,"click", doSign);
    addEvent(editform.wpMinoredit,"click", setSigBox);
});
 
function getCaretPos(txtObj){
    if (txtObj.setSelectionRange) return txtObj.selectionStart; // NS like
    else if(!document.selection) return 0;  // not IE like
    var c="\001", pos=0;
    var range=document.selection.createRange();
    var txt=range.text, dul=range.duplicate();
    dul.moveToElementText(txtObj);
    range.text=txt+c;
    pos=(dul.text.indexOf(c));
    range.moveStart('character',-1);
    range.text="";
    return pos;
};
 
/* add/removeEvent Original idea by John Resig
 Tweaked by Scott Andrew LePera, Dean Edwards and Peter-Paul Koch
 Fixed for IE by Tino Zijdel (crisp) @date 2005-10 */
function addEvent(obj,type,fn){if(obj.addEventListener){obj.addEventListener(type,fn,false)}else if(obj.attachEvent){var eProp=type+fn;obj["e"+eProp]=fn;obj[eProp]=function(){obj["e"+eProp](window.event)};obj.attachEvent("on"+type,obj[eProp])}else{obj['on'+type]=fn}};
function removeEvent(obj,type,fn){if(obj.removeEventListener){obj.removeEventListener(type,fn,false)}else if(obj.detachEvent){var eProp=type+fn;obj.detachEvent("on"+type,obj[eProp]);obj['e'+eProp]=null;obj[eProp]=null}else{obj['on'+type]=null}};
 
// *** end *** </nowiki></pre>
importScript('Wikipedia:AutoEd/complete.js');
 
importScript('User:Cameltrader/Advisor.js');
 
importScript('User:TheJosh/Scripts/NewPagePatrol.js');
 
// [[User:Lupin/popups.js]]
 
importScript('User:Lupin/popups.js');
 
importScript('User:TheJosh/Scripts/RecentChangesPatrol.js');
 
importScript('Wikipedia:WikiProject User scripts/Scripts/Force edit summary alternative');
 
// Stub tag tab. By [[User:ais523]], on a request by [[User:thesublime514]]. // ([[User:ais523/stubtagtab.js]]) // <source lang="javascript"> addOnloadHook(function(){   if(wgNamespaceNumber==0&&wgAction=="view")   {     if(document.getElementById("ca-edit"))       addPortletLink('p-cactions', 'javascript:stubtagtab()', 'stub', 'ca-stubtag',                                    'Add a stub tag to this page', '');   }   if(location.href.indexOf("&autoaddstubtag=")!=-1&&document.getElementById('wpTextbox1')!=null)   {     var x=decodeURIComponent(location.href.split("&autoaddstubtag=")[1]);     if(x=="") x="stub"; else x+="-stub";     document.getElementById('wpTextbox1').value+="\n{"+"{"+x+"}}"; //add to the end of the article     document.getElementById('wpSummary').value=       "Tagging with {"+"{"+x+"}} using [[WP:US/S|user scripts]]";     document.getElementById('wpPreview').click();   } });   function stubtagtab() {   var x=prompt("Which stub tag? (Leave blank for {"+                "{stub}}; otherwise -stub will be added to the name)");   if(x==null) return;   location.href=wgServer+wgScript+"?title="+encodeURIComponent(wgPageName)+                                                   "&action=edit&autoaddstubtag="+encodeURIComponent(x); }   // </source> [[Category:Wikipedia scripts]]
 
/* Watchlist notifier ([[User:Ais523/watchlistnotifier.js]]); displays a message every time a watched page changes. */
//<pre><nowiki>
 
var wmwpajax;
// From [[WP:US]] mainpage (wpajax renamed to wmwpajax)
wmwpajax={
        download:function(bundle) {
                // mandatory: bundle.url
                // optional:  bundle.onSuccess (xmlhttprequest, bundle)
                // optional:  bundle.onFailure (xmlhttprequest, bundle)
                // optional:  bundle.otherStuff OK too, passed to onSuccess and onFailure
 
                var x = window.XMLHttpRequest ? new XMLHttpRequest()
                : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP")
                : false;
 
                if (x) {
                        x.onreadystatechange=function() {
                                x.readyState==4 && wmwpajax.downloadComplete(x,bundle);
                        };
                        x.open("GET",bundle.url,true);
                        x.send(null); 
                }
                return x;
        },
 
        downloadComplete:function(x,bundle) {
                x.status==200 && ( bundle.onSuccess && bundle.onSuccess(x,bundle) || true )
                || ( bundle.onFailure && bundle.onFailure(x,bundle) || alert(x.statusText+': '+bundle.url));
        }
};
 
// Example:
// function dlComplete(xmlreq, data) {
//      alert(data.message + xmlreq.responseText);
// }
//  wmwpajax.download({url:'http://en.wikipedia.org/w/index.php?title=Thresher&action=raw', 
//                   onSuccess: dlComplete, message: "Here's what we got:\n\n" });
 
// End of [[WP:US]] quote
 
function wmWatchEditFound(xmlreq, data) {
  var watchrev, watchsum, watchrevold, watchpage, junk;
  if(xmlreq.responseText.indexOf('revid=')==-1)
  {
    document.getElementById('contentSub').innerHTML+=
      "<div class='watchlistnotify'>(<i>watchlistnotifier can't determine whether a "+
      "watched page has changed<i>)</div>";
    return;
  }
  watchrev=xmlreq.responseText.split('revid="')[1].split('"')[0];
  try
  {
    watchrevold=document.cookie.split('ais523wmwatchrev=')[1].split('.')[0];
  }
  catch(junk) {watchrevold=0;}
  if(wgPageName == "Special:Watchlist")
  {
    document.cookie="ais523wmwatchrev="+watchrev+".; path=/";
    var aas=document.getElementById('bodyContent').getElementsByTagName('a');
    var i=aas.length;
    while(i--)
    {
      if(aas[i].href.indexOf('diff=')!=-1&&watchrevold)
        if(+(aas[i].href.split('diff=')[1].split('&')[0])>watchrevold)
          aas[i].parentNode.style.fontWeight='bold';
    }
  }
  else
  {
    watchsum=xmlreq.responseText.split('comment="')[1].split('"')[0];
    watchpage=xmlreq.responseText.split('title="')[1].split('"')[0];
    watchsum=watchsum.split('<').join('&lt;').split('>').join('&gt;');
    watchpage=watchpage.split('<').join('&lt;').split('>').join('&gt;');
    if(watchrev!=watchrevold)
      document.getElementById('contentSub').innerHTML+=
        "<div class='watchlistnotify'>\""+watchpage+'" changed: "'+watchsum+
        '". (<a href="/wiki/Special:Watchlist">watchlist</a>)</div>';
  }
}
 
addOnloadHook(function() {
  /* Find the top item in the watchlist, and its edit summary. We only need one item, so
     set the limit to 1 to ease the load on the server. */
    wmwpajax.download({url:'http://en.wikipedia.org/w/api.php?action=query&list=watchlist&wllimit=1&'+
      'wldir=older&format=xml&wlprop=comment|ids|title', onSuccess: wmWatchEditFound});
});
// </nowiki></pre>
// [[Category:Wikipedia scripts]]
 
importScript('Wikipedia:WikiProject_User_scripts/Scripts/TwoColumns.js');
importScript('User:Odie5533/SnipManager.user.js');
importScript('User:Philip Trueman/recent2.js');
importScript('User:TheDJ/qui.js');