Jump to content

User:Jarry1250/vector.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jarry1250 (talk | contribs) at 09:17, 12 July 2011 (unwrap function). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$.wikiLoveOptions.types.goofy = {
   name: 'Goofy', // name of the type (appears in the types menu)
   fields: [ 'header', 'message' ], // fields to ask for in form
   header: 'Wikilove greetings!', // header that appears at the top of the talk page post (optional)
   text: '[[$3|left|150px]]\n$1\n\n&ndash; [[User:Quadell|Quadell]] <sup>([[User_talk:Quadell|talk]])</sup> 12:42, 11 July 2011 (UTC)\n<br style="clear: both"/>', // $3 is the image filename
   gallery: {
    imageList: [ 'Iris cat.jpg', 'Quatre mains - Titran-s Kasper (by).jpg', 'Redneck hillbilly.jpg' ],
    width: 145,
    height: 150,
    number: 3
  },
  icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-kitten.png'
 };

function wikiloveme(){}

importScript('User:Splarka/ajaxfilemove.js');
importScript('User:John254/mass rollback.js')
importScript('User:Anomie/linkclassifier.js'); // Linkback: [[User:Anomie/linkclassifier.js]]
importScript('Wikipedia:AutoEd/complete.js');
importScript('User:Shubinator/DYKcheck.js'); //DYKcheck tool
//importScript('User:Jarry1250/rfaform.js'); //RFA form tool
var delLog_timeformat = 2;
importScript('User:Mr.Z-man/delLog.js');
importScript('User:Mr.Z-man/closeAFD.js');
importScript('User:Mr.Z-man/hideClosedAFD.js');
popupFixDabs=true;
popupAdminLinks=true;
importScript('User:X!/userrights.js');
importScript('User:AWeenieMan/furme.js');//Fair use rational
importScript('User:GregU/familytree.js');
importScript('User:Jarry1250/ajaxsendcomment.js')
importScript('User:Ale_jrb/Scripts/csdhelper.js');  //[[User:Ale_jrb/Scripts]]
importScript("User:GregU/dashes.js");

//Below script is not mine.
function unwatchlinks() {
 aitchone = document.getElementById('firstHeading').firstChild.nodeValue;
 switch(aitchone){
  case 'My watchlist':
   lists=document.getElementsByTagName('ul');
   for (i=0;i<lists.length;i++) {
    if (lists[i].hasAttribute('class')) {
     if (lists[i].getAttribute('class')=='special') {//It's a day's watchlist.
      items=lists[i].childNodes;//li elements and whitespace
      for (j=items.length-1;j>-1;j--) {
       if (items[j].nodeType>1) continue;//li elements, not whitespace
       difflink=items[j].firstChild;
       while (difflink.nodeType>1) difflink=difflink.nextSibling;//first element sub the li
       diffurl=difflink.getAttribute('href');// /w/index.php?title=TITLE&amp;OTHERPARAMS if not a log entry
       if (diffurl.indexOf('/wiki/')) {//not a log entry
        title=diffurl.split('=')[1];
        title=title.split('&')[0];//pagename of the watchlist item
        newurl='/wiki/'+title+'?action=unwatch';
        anch=document.createElement('a');
        anch.setAttribute('href',newurl);
        anch.appendChild(document.createTextNode('-'));
        items[j].insertBefore(anch,difflink);
        spacer=document.createTextNode(') (');
        items[j].insertBefore(spacer,difflink);
       }//end if indexOf
      }//end for j
     }//end if special
    }//end if hasAttr
   };//end for i
  break;//case 'My watchlist'
  case 'Recent changes':
   strongs=document.getElementsByTagName('strong');
   for (i=0;i<strongs.length;i++) {
    strong=strongs[i];
    if (strong.getAttribute('class')=='mw-watched') {//page is on watchlist
     children=strong.childNodes;//a element and whitespace
     for (j=0;j<children.length;j++) {
      if (children[j].nodeType>1) continue;//elements only, so a element
      pageurl=children[j].getAttribute('href');// /wiki/TITLE
      unwatchurl=pageurl+'?action=unwatch';
      anch=document.createElement('a');
      anch.setAttribute('href',unwatchurl);
      anch.appendChild(document.createTextNode('(unwatch)'));
      strong.parentNode.insertBefore(anch,strong);
      spacer=document.createTextNode(' ');
      strong.parentNode.insertBefore(spacer,strong);
      break;//for j, don't look at subsequent whitespace
     }//end for j
    }//end if mw-watched
   }//end for i
  break;//case 'Recent changes'
 }//end switch
};//end function
addOnloadHook(unwatchlinks);
addOnloadHook(wikiloveme);