Diferencia entre revisiones de «Usuario:JimTittsler/vector.js»

De WikiEducator
Saltar a: navegación, buscar
(trigger gardening tools on some pages)
m (1 revisión: import from en.WE after update to MW 1.23+)
 
(4 revisiones intermedias por el mismo usuario no mostrado)
Línea 2: Línea 2:
  
 
$(function () {
 
$(function () {
 +
  $('#n-recentchanges').find('a:first').attr('href', '/index.php?title=Special:RecentChanges&hidebots=0');
 
   $('#n-recentchanges').after('<li><a href="/Special:NewPages?namespace=all" title="The list of newly created pages">New pages</a></li>');
 
   $('#n-recentchanges').after('<li><a href="/Special:NewPages?namespace=all" title="The list of newly created pages">New pages</a></li>');
   $('#pt-mytalk')
+
   var st = $('#pt-mytalk').attr('style');
    .after('<li><a href="/User:'+wgUserName+'/Blog">My blog</a></li>')
+
  st = st ? ' style="' + st + '"': '';
    .after('<li><a href="/User:'+wgUserName+'/Projects">My projects</a></li>')
+
    .after('<li>' + document.getElementById('content').offsetHeight + 'px</li>');
+
 
   // gardening tool
 
   // gardening tool
   if (wgPageName === 'Especial:PáginasNuevas') {
+
   if ((wgCanonicalNamespace === 'Special') && $.inArray(wgCanonicalSpecialPageName, ['Newpages', 'Recentchanges']) > -1) {
     $.getScript('/skins/common/we/spam.js');
+
     $.getScript('/extensions/WE/spam.js');
 
   }
 
   }
 
   if (wgAction === 'history') {
 
   if (wgAction === 'history') {
     $.getScript('/skins/common/we/deleterevs.js');
+
     $.getScript('/extensions/WE/deleterevs.js');
  }
+
});
+
 
+
/* http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/External_editor */
+
addOnloadHook(function() {
+
    var editTab = document.getElementById("ca-edit");
+
    if (!editTab) return;
+
    var editURL = editTab.getElementsByTagName("a")[0].href;
+
    addPortletLink("p-cactions", editURL + "&externaledit=true", "EE", "ca-exted", "External editor", "");
+
});
+
 
+
/* hide the watch checkbox on LQT postings */
+
addOnloadHook(function () {
+
  if (document.getElementById("lqt_method")) {
+
    var ef = document.getElementById('editform'); /* narrow the search for labels */
+
    if (ef) {
+
      document.getElementById('wpMinoredit').style.display = 'none';
+
      document.getElementById('wpWatchthis').style.display = 'none';
+
      labels = ef.getElementsByTagName('label');
+
      for (var i=0; i<labels.length; ++i) {
+
        if ((labels[i].htmlFor == 'wpMinoredit') || (labels[i].htmlFor == 'wpWatchthis')) {
+
          labels[i].style.display = 'none';
+
        }
+
      }
+
    }
+
 
   }
 
   }
 +
  $('#p-coll-create_a_book li a[href*="add_article"]').parent()
 +
    .after('<li><a id="t-bookmaker" title="Add the current page and its subpages" rel="nofollow" href="#">Add page &amp; subpages</a></li>');
 
});
 
});

Última revisión de 14:48 3 sep 2014

importScript('User:JimTittsler/googlesearch.js');
 
$(function () {
  $('#n-recentchanges').find('a:first').attr('href', '/index.php?title=Special:RecentChanges&hidebots=0');
  $('#n-recentchanges').after('<li><a href="/Special:NewPages?namespace=all" title="The list of newly created pages">New pages</a></li>');
  var st = $('#pt-mytalk').attr('style');
  st = st ? ' style="' + st + '"': '';
  // gardening tool
  if ((wgCanonicalNamespace === 'Special') && $.inArray(wgCanonicalSpecialPageName, ['Newpages', 'Recentchanges']) > -1) {
    $.getScript('/extensions/WE/spam.js');
  }
  if (wgAction === 'history') {
    $.getScript('/extensions/WE/deleterevs.js');
  }
  $('#p-coll-create_a_book li a[href*="add_article"]').parent()
    .after('<li><a id="t-bookmaker" title="Add the current page and its subpages" rel="nofollow" href="#">Add page &amp; subpages</a></li>'); 
});