New Immissions/Updates:
boundless - educate - edutalab - empatico - es-ebooks - es16 - fr16 - fsfiles - hesperian - solidaria - wikipediaforschools
- wikipediaforschoolses - wikipediaforschoolsfr - wikipediaforschoolspt - worldmap -

See also: Liber Liber - Libro Parlato - Liber Musica  - Manuzio -  Liber Liber ISO Files - Alphabetical Order - Multivolume ZIP Complete Archive - PDF Files - OGG Music Files -

PROJECT GUTENBERG HTML: Volume I - Volume II - Volume III - Volume IV - Volume V - Volume VI - Volume VII - Volume VIII - Volume IX

Ascolta ""Volevo solo fare un audiolibro"" su Spreaker.
CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
User:Tra/whatlinksherewatchlist.js - Wikipedia, the free encyclopedia

User:Tra/whatlinksherewatchlist.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

 ///////////////////////////////////////
 //     What links here watchlist     //
 //              by Tra               //
 ///////////////////////////////////////


function wlhdownload(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 && wlhdownloadComplete(x,bundle);
    };
    x.open("GET",bundle.url,true);
    x.send(null);
  }
  return x;
}

function wlhdownloadComplete(x,bundle) {
  x.status==200 && ( bundle.onSuccess && bundle.onSuccess(x,bundle) || true )
  || ( bundle.onFailure && bundle.onFailure(x,bundle) || alert(x.statusText));
}



function wlhgetstartdate(wlhdate) {

  var tempvar = ''

  tempvar = wlhdate.getYear()

  tempvar += ''

  if ((wlhdate.getMonth() + 1) < 10 ) {
    tempvar += '0'
  }

  tempvar += (wlhdate.getMonth() + 1)

  tempvar += ''

  if (wlhdate.getDate() < 10 ) {
    tempvar += '0'
  }

  tempvar += wlhdate.getDate()

  tempvar += '000000'

  return tempvar

}



window.gettingWatchlist=false;
wlhwatchlist=null;
function wlhgetWatchlist() {
  window.gettingWatchlist=true;
  wlhdownload({url: 'http://' + document.location.hostname + '/wiki/Special:Watchlist/edit',
	      onSuccess: wlhprocessWatchlist, onFailure: function () { setTimeout(wlhgetWatchlist, 15000); return true; }});
}
function wlhprocessWatchlist(req, bundle) {
  var watchlist={};
  var lines=req.responseText.split('\n');

  var h1=document.getElementsByTagName('h1')[0]
  var myinfo=document.createElement('ul');
  h1.parentNode.appendChild(myinfo);

  var wlhnspg = ''
  var wlhpropline = ''
  var wlhdonestart = 'no'
  var wlhquerystring = 'what=backlinks&blnamespace=0&titles='


  for (var i=0; i<lines.length; ++i) {
    if (lines[i].indexOf('<li><input type="checkbox" name="id[]" value=') > -1) {
      wlhpropline = (lines[i].replace(/.*title="(.*?)">.*/, '$1'));
      wlhnspg=wlhpropline.split('/');

      // show only correct sort
  // myinfo.innerHTML += '<li>' + wlhpropline + '</li>'
      if (wlhnspg[0] == 'Talk:Backlinks') {

        if (wlhdonestart == 'yes') {wlhquerystring += '|'}
        wlhdonestart = 'yes'

        wlhquerystring += wlhnspg[1]

      }      
    }
  }

  var wlhnow = new Date()

  wlhquerystring += '&format=json&dummy=' + parseInt(Math.random()*99999999)
//  myinfo.innerHTML += '<li>' + wlhquerystring + '</li>'



  wlhdownload({url: 'http://' + document.location.hostname + '/w/query.php?' + wlhquerystring,
	      onSuccess: wlhprocessuserwatchlist});


}


function wlhmid(str, start, len)
  /***
  IN: str - the string we are LEFTing
  start - our string's starting position (0 based!!)
  len - how many characters from start we want to get

  RETVAL: The substring from start to start+len
  ***/
  {
    // Make sure start and len are within proper bounds
    if (start < 0 || len < 0) return "";

    var iEnd, iLen = String(str).length;
    if (start + len > iLen)
      iEnd = iLen;
    else
      iEnd = start + len;

    return String(str).substring(start,iEnd);
}



function wlhtimefromdate(wlhdate) {

  return wlhmid(wlhdate, 11, 5)

}





function wlhprocessuserwatchlist(req, bundle) {

  var h1=document.getElementsByTagName('h1')[0]
  var wlhoutput=document.createElement('div');
  h1.parentNode.appendChild(wlhoutput);

  wlhoutput.innerHTML = '';


  // wlhoutput.innerHTML += req.responseText

  var wlhtempoutput = ''

  var wlhdata = eval('(' + req.responseText + ')');

  var wlhusernum = 0;

  // var wlhcontribnum = 0;

  var wlhobjcontrib

  var wlhusername

  wlhtempoutput += '';

  // wlhtempoutput += wlhdata.pages.length;
  // wlhtempoutput += wlhdata.pages.items[0].title;

  for (prop in wlhdata.pages) {
    if (1==1) {                             //if (wlhdata.pages[prop].backlinks.length > 0) {
// alert ('one');

    wlhusername = wlhdata.pages[prop].title //.split(':')[1]

    wlhtempoutput += '<h2><a href="http://en.wikipedia.org/wiki/' + wlhusername + '">' + wlhusername + '</a></h2>'
    wlhtempoutput += '<a href="http://en.wikipedia.org/wiki/' + wlhusername + '">article</a> • <a href="http://en.wikipedia.org/wiki/Special:Whatlinkshere/' + wlhusername + '">what links here</a> • <a href="http://en.wikipedia.org/wiki/Talk:' + wlhusername + '">talk</a> • <a href="http://en.wikipedia.org/w/index.php?title=' + wlhusername + '&action=history">history</a><ul>'



// alert ('hello');
    for (prop2 in wlhdata.pages[prop].backlinks){

      wlhobjcontrib = wlhdata.pages[prop].backlinks[prop2]


      wlhtempoutput += '<li>'
      wlhtempoutput += '<a href="http://en.wikipedia.org/wiki/' + wlhobjcontrib['*'] + '">' + wlhobjcontrib['*'] + '</a>'

      wlhtempoutput += '</li>'

/*
      wlhtempoutput += '" title="' + wlhobjcontrib['*'] + '">' + wlhtimefromdate(wlhobjcontrib.timestamp) + '</a></tt> '


      wlhtempoutput +='(<a href="/w/index.php?title=' + wlhobjcontrib['*']
      wlhtempoutput += '&amp;action=history" title="' + wlhobjcontrib['*'] + '">hist</a>) (<a href="/w/index.php?title='
      wlhtempoutput += wlhobjcontrib['*'] + '&amp;diff=prev&amp;oldid=' + wlhobjcontrib.revid + '" title="' + wlhobjcontrib['*']
      wlhtempoutput += '">diff</a>)  <a href="/wiki/' + wlhobjcontrib['*'] + '" title="' + wlhobjcontrib['*'] + '">'
      wlhtempoutput += wlhobjcontrib['*'] + '</a>  <span class="comment">(' + wlhobjcontrib.comment + ')</span>' + '<br />'
*/
    }

wlhtempoutput += '</ul>'
    ++wlhusernum

    }

  }

  wlhtempoutput += '';


  wlhloadingmsg.innerHTML = ''

  wlhoutput.innerHTML = wlhtempoutput;
  if (typeof(window.setupTooltips)!='undefined') { setupTooltips(wlhoutput); }



}

// **************************************************
// Installation
// **************************************************

/* function wlhaddlilink(tabs, url, name, id, title, key){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    tabs.appendChild(li);
    if(id) {
      if(key && title) ta[id] = [key, title];
      else if(key)     ta[id] = [key, ''];
      else if(title)   ta[id] = ['', title];
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}
*/

function wlhaddToolboxLink(url, name, id){
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
    wlhaddlilink(tb, url, name, id);
}


var wlhloadingmsg
function wlhloadapp() {

  //var h1=document.getElementsByTagName('h1')[0]
  // var wlhoutput=document.createElement('div');
  //h1.innerHTML = 'User watchlist';

  wlhaddToolboxLink('http://' + document.location.hostname + '/wiki/' + 'User:Tra/What_links_here_watchlist', 'Backlinks watchlist', 'wlh_link');

   if (wgPageName == 'User:Tra/What_links_here_watchlist') {

    var h1=document.getElementsByTagName('h1')[0]
    wlhloadingmsg=document.createElement('div');
    h1.parentNode.appendChild(wlhloadingmsg);

    wlhloadingmsg.innerHTML = 'Loading...'


    wlhgetWatchlist()



   }


if (wgPageName == "Special:Whatlinkshere") {
     wlhaddTab('http://en.wikipedia.org/w/index.php?action=watch&title=Backlinks/' + document.getElementById('specialDeleteTarget').firstChild.innerHTML + '&gonow=yes&gonowto=' + location.href,'watch','addwlhwatchlist','Watch this page for backlinks','w')

     wlhaddTab('http://en.wikipedia.org/w/index.php?action=unwatch&title=Backlinks/' + document.getElementById('specialDeleteTarget').firstChild.innerHTML + '&gonow=yes&gonowto=' + location.href,'unwatch','rmwlhwatchlist','Remove this page from your watchlist for backlinks')




}

if (wlhgetQueryVariable('gonow')=='yes') {

   location.href=wlhgetQueryVariable('gonowto');

}

}


function wlhgetQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  //alert('Query Variable ' + variable + ' not found');
}

function wlhaddTab(url, name, id, title, key){
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    return wlhaddlilink(tabs, url, name, id, title, key)
};





function wlhaddlilink(tabs, url, name, id, title, key){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    tabs.appendChild(li);
    if(id)
    {
        if(key && title)
        {
            ta[id] = [key, title];
        }
        else if(key)
        {
            ta[id] = [key, ''];
        }
        else if(title)
        {
            ta[id] = ['', title];
        }
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}



addOnloadHook(wlhloadapp)

Static Wikipedia (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2006 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Static Wikipedia February 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu