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

De WikiEducator
Saltar a: navegación, buscar
(cambio de orden)
 
(No se muestran 6 ediciones intermedias de 2 usuarios)
Línea 9: Línea 9:
  
 
$(function () {
 
$(function () {
   $('#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 id="n-newpages"><a href="/Special:NewPages?namespace=all" title="The list of newly created pages">Páginas nuevas</a></li>');
  $('#pt-mytalk')
+
    .after('<li><a href="/User:'+wgUserName+'/Blog">My blog</a></li>')
+
    .after('<li><a href="/User:'+wgUserName+'/Projects">My projects</a></li>')
+
    .after('<li>' + document.getElementById('content').offsetHeight + 'px</li>');
+
  // change the font and size used for edit box
+
  $('#wpTextbox1').css('font-family', 'Courier New').css('font-size', '14px');
+
 
   // gardening tool
 
   // gardening tool
   if (wgPageName === 'Special:NewPages') {
+
   if (wgPageName === 'Especial:PáginasNuevas') {
     $.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 */
+
/* hide-vector-sidebar.js: Adds a button to toggle visibility of the Vector sidebar.
addOnloadHook(function() {
+
  Written by PleaseStand. Public domain; all copyright claims waived as described
    var editTab = document.getElementById("ca-edit");
+
  in http://en.wikipedia.org/wiki/Template:PD-self */
    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 */
+
/*global document, window, addOnloadHook, addPortletLink, skin*/
addOnloadHook(function () {
+
 
  var ef, labels;
+
var sidebarSwitch;
  if (document.getElementById("lqt_method")) {
+
 
    ef = document.getElementById('editform'); /* narrow the search for labels */
+
function sidebarHide() {
    if (ef) {
+
document.getElementById("mw-panel").style.visibility = "hidden";
      document.getElementById('wpMinoredit').style.display = 'none';
+
document.getElementById("mw-head-base").style.marginLeft = "0";
      document.getElementById('wpWatchthis').style.display = 'none';
+
document.getElementById("content").style.marginLeft = "0";
      labels = ef.getElementsByTagName('label');
+
document.getElementById("left-navigation").style.left = "0";
      for (var i=0; i<labels.length; ++i) {
+
document.getElementById("footer").style.marginLeft = "0";
        if ((labels[i].htmlFor === 'wpMinoredit') || (labels[i].htmlFor === 'wpWatchthis')) {
+
if(typeof sidebarSwitch == "object") {
          labels[i].style.display = 'none';
+
sidebarSwitch.parentNode.removeChild(sidebarSwitch);
        }
+
}
      }
+
sidebarSwitch = addPortletLink("p-cactions", "javascript:sidebarShow()", "Mostrar barra", "ca-sidebar", "Show the navigation links", "a");
    }
+
}
  }
+
 
});
+
function sidebarShow() {
 +
document.getElementById("mw-head-base").style.marginLeft = "";
 +
document.getElementById("content").style.marginLeft = "";
 +
document.getElementById("left-navigation").style.left = "";
 +
document.getElementById("footer").style.marginLeft = "";
 +
document.getElementById("mw-panel").style.visibility = "";
 +
if(typeof sidebarSwitch == "object") {
 +
sidebarSwitch.parentNode.removeChild(sidebarSwitch);
 +
}
 +
sidebarSwitch = addPortletLink("p-cactions", "javascript:sidebarHide()", "Ocultar barra", "ca-sidebar", "Hide the navigation links", "a");
 +
}
 +
 
 +
// Only activate on Vector skin
 +
if(skin == "vector") {
 +
addOnloadHook(function() {
 +
// Change this if you want to show the sidebar by default
 +
sidebarShow();
 +
});
 +
}

Última revisión de 00:32 27 ene 2015

// Basado en http://wikieducator.org/User:JimTittsler/vector.js
 
importScript('Ususario:Lmorillas/googlesearch.js');
 
// reader mode for narrow screens  --> para el tablet de 7"
// should follow googlesearch.js if used
// window.weReader = true;  // force to always use reader mode, regardless of width
importScript('Usuario:Lmorillas/reader.js');
 
$(function () {
  $('#n-recentchanges').after('<li id="n-newpages"><a href="/Special:NewPages?namespace=all" title="The list of newly created pages">Páginas nuevas</a></li>');
  // gardening tool
  if (wgPageName === 'Especial:PáginasNuevas') {
    $.getScript('/extensions/WE/spam.js');
  }
  if (wgAction === 'history') {
    $.getScript('/extensions/WE/deleterevs.js');
  }
});
 
/* hide-vector-sidebar.js: Adds a button to toggle visibility of the Vector sidebar.
   Written by PleaseStand. Public domain; all copyright claims waived as described
   in http://en.wikipedia.org/wiki/Template:PD-self */
 
/*global document, window, addOnloadHook, addPortletLink, skin*/
 
var sidebarSwitch;
 
function sidebarHide() {
	document.getElementById("mw-panel").style.visibility = "hidden";
	document.getElementById("mw-head-base").style.marginLeft = "0";
	document.getElementById("content").style.marginLeft = "0";
	document.getElementById("left-navigation").style.left = "0";
	document.getElementById("footer").style.marginLeft = "0";
	if(typeof sidebarSwitch == "object") {
		sidebarSwitch.parentNode.removeChild(sidebarSwitch);
	}
	sidebarSwitch = addPortletLink("p-cactions", "javascript:sidebarShow()", "Mostrar barra", "ca-sidebar", "Show the navigation links", "a");
}
 
function sidebarShow() {
	document.getElementById("mw-head-base").style.marginLeft = "";
	document.getElementById("content").style.marginLeft = "";
	document.getElementById("left-navigation").style.left = "";
	document.getElementById("footer").style.marginLeft = "";
	document.getElementById("mw-panel").style.visibility = "";
	if(typeof sidebarSwitch == "object") {
		sidebarSwitch.parentNode.removeChild(sidebarSwitch);
	}
	sidebarSwitch = addPortletLink("p-cactions", "javascript:sidebarHide()", "Ocultar barra", "ca-sidebar", "Hide the navigation links", "a");
}
 
// Only activate on Vector skin
if(skin == "vector") {
	addOnloadHook(function() {
		// Change this if you want to show the sidebar by default
		sidebarShow();
	});
}