MediaWiki:Onlyifediting.js

El Komunejo

Iri al: navigado, serĉi

Notu: Post konservado vi forviŝu la kaŝmemoron de via foliumilo por vidi la ŝanĝojn : Mozilo: alklaku Reŝarĝi (aŭ Stir-Shift-R), IE / Opera: Stir-F5, Safari: Cmd-R, Konqueror Stir-R.

//<source lang="javascript">
/*  z monobook.js wužiwarja Tlustulimu */
/* z / from enwikt */
function addLoadEvent(func) 
{
  if (window.addEventListener) 
    window.addEventListener("load", func, false);
  else if (window.attachEvent) 
    window.attachEvent("onload", func);
}
 
/* z / from enwikit */
//Cookie helpers
function setCookie(cookieName, cookieValue) {
var today = new Date();
var expire = new Date();
var nDays = 30;
expire.setTime( today.getTime() + (3600000 * 24 * nDays) );
document.cookie = cookieName + "=" + escape(cookieValue)
                 + ";path=/w"
                 + ";expires="+expire.toGMTString();
document.cookie = cookieName + "=" + escape(cookieValue)
                 + ";path=/wiki"
                 + ";expires="+expire.toGMTString();
}
 
function getCookie(cookieName) {
  var start = document.cookie.indexOf( cookieName + "=" );
  if ( start == -1 ) return "";
  var len = start + cookieName.length + 1;
  if ( ( !start ) &&
    ( cookieName != document.cookie.substring( 0, cookieName.length ) ) )
      {
        return "";
      }
  var end = document.cookie.indexOf( ";", len );
  if ( end == -1 ) end = document.cookie.length;
  return unescape( document.cookie.substring( len, end ) );
}
 
function deleteCookie(cookieName) {
  if ( getCookie(cookieName) ) {
    document.cookie = cookieName + "=" + ";path=/w" +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
    document.cookie = cookieName + "=" + ";path=/wiki" +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
  }
}
 
// Opcioj por la redaktilo por specialaj signoj in [[MediaWiki:Edittools]]
// ĝi estas alligita je la fino de [[MediaWiki:Monobook.js]] 
 
function addCharSubsetMenu() {
 var specialchars = document.getElementById('specialchars');
 
 if (specialchars) {
   var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
   menu += "<option>Esperanto</option>";
   menu += "<option>Vikisintakso</option>";
   menu += "<option>IPA-alfabeto</option>";
   menu += "<option>Latinidaj</option>";
   menu += "<option>AHD-alfabeto</option>";
   menu += "<option>Araba</option>";
   menu += "<option>Bosna/Serba/Kroata</option>";
   menu += "<option>Cigana</option>";
   menu += "<option>Cirila</option>";
   menu += "<option>Ĉeĥa</option>";
   menu += "<option>DMG-Transskribo</option>";
   menu += "<option>Estona</option>";
   menu += "<option>Franca</option>";
   menu += "<option>Gaela</option>";
   menu += "<option>Greka</option>";
   menu += "<option>Helena</option>";
   menu += "<option>Havaja</option>";
   menu += "<option>Hispana</option>";
   menu += "<option>Hungara</option>";
   menu += "<option>Islanda</option>";
   menu += "<option>Itala</option>";
   menu += "<option>Jida/Hebrea</option>";
   menu += "<option>Kataluna</option>";
   menu += "<option>Latva</option>";
   menu += "<option>Litova</option>";
   menu += "<option>Malnovangla</option>";
   menu += "<option>Malteza</option>";
   menu += "<option>Pinyin (ĉina latina)</option>";
   menu += "<option>Pola</option>";
   menu += "<option>Portugala</option>";
   menu += "<option>Rumana</option>";
   menu += "<option>Serba (cirila)</option>";
   menu += "<option>Skandinava</option>";
   menu += "<option>Slovaka</option>";
   menu += "<option>Turka</option>";
   menu += "<option>Vjetnama</option>";
   menu += "</select>";
   specialchars.innerHTML = menu + specialchars.innerHTML;
 
/* default subset from cookie */
    var s = parseInt( getCookie('edittoolscharsubset') );
    if ( isNaN(s) ) s = 0;
 
    /* update dropdown control to value of cookie */
    document.getElementById('charSubsetControl').selectedIndex = s; 
 
    /* display the subset indicated by the cookie */
    chooseCharSubset( s );
  }
}
 
/* select subsection of special characters */
function chooseCharSubset(s) {
  var l = document.getElementById('specialchars').getElementsByTagName('p');
  for (var i = 0; i < l.length ; i++) {
    l[i].style.display = i == s ? 'inline' : 'none';
   // l[i].style.visibility = i == s ? 'visible' : 'hidden';
  }
  setCookie('edittoolscharsubset', s);
}
 
/* do any Wikipedia-specific customizations */
/* from enwikt */
function customizeWikipedia() {
  // doRedirect();
  addCharSubsetMenu();
  // fixEditSectionWikifiedLinks();
  // wiktHeadingToolTips();
}
 
addLoadEvent(customizeWikipedia);
 
//</source>
Personaj iloj