MediaWiki:Onlyifediting.js

El Kitakujo

Redakto de 20:14, 20. Dec 2009 de WikiSysop (Diskuto | kontribuoj)
(malsamoj) ← Antaŭa versio | Rigardi nunan version (malsamoj) | Sekva versio → (malsamoj)
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 id=\"charSubsetControl\" style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
   menu += "<option>Esperanto</option>";
   menu += "<option>Vikisintakso</option>";
   menu += "<option value=\"Latina\">Latinidaj</option>";   
   menu += "<option>Greka</option>";
   menu += "<option>Cirila</option>";
   menu += "<option>Araba</option>";
   menu += "<option value=\"AHD\">AHD-alfabeto</option>";
   menu += "<option value=\"Czech\">Ĉeĥa</option>";
   menu += "<option>Cigana</option>";
   menu += "<option>Estona</option>";
   menu += "<option>Franca</option>";
   menu += "<option>Germana</option>";
   menu += "<option>Havaja</option>";
   menu += "<option>Hieroglifoj</option>";
   menu += "<option>Hispana</option>";
   menu += "<option>Hungara</option>";
   menu += "<option>Islanda</option>";
   menu += "<option>Itala</option>";
   menu += "<option>Kataluna</option>";
   menu += "<option>Kimra</option>";
   menu += "<option>Kroata</option>";
   menu += "<option value=\"Let\">Latva</option>";
   menu += "<option value=\"Lit\">Litova</option>";
   menu += "<option>Malnovangla</option>";
   menu += "<option value=\"Malta\">Malteza</option>";
   menu += "<option value=\"Pinjina\">Pinyin (ĉina latina)</option>";
   menu += "<option>Pola</option>";
   menu += "<option>Portugala</option>";
   menu += "<option>Romaji</option>";
   menu += "<option>Rumana</option>";
   menu += "<option value=\"Serba\">Serba (cirila)</option>";
   menu += "<option>Skandinava</option>";
   menu += "<option>Slovaka</option>";
   menu += "<option>Soraba</option>";
   menu += "<option>Turka</option>";
   menu += "<option>Vjetnama</option>";
   menu += "<option value=\"IPA\">IPA-alfabeto</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