Ugrás a tartalomhoz

Szerkesztő:Karmela/monobook.js 2009-01-25

A Wikipédiából, a szabad enciklopédiából

//<source lang="javascript">

/* Force preview */ /* by Marc Mongenet, 2006, fr.wikipedia. Modified to work for non-anons by Soxred93 */ /* en:User:Soxred93/forcepreview.js */ //function forcePreview() { // if (wgAction == "edit"){ // document.getElementById("wpSave").disabled=true; // document.getElementById("wpSave").value = "Save (preview first)"; // document.getElementById("wpSave").style.fontWeight = "normal"; // document.getElementById("wpPreview").style.fontWeight = "bold"; // } //} // //addOnloadHook(forcePreview);

$(function () {

// viewsource, lapforrás

 if (location.href.indexOf('viewsource=1') != -1) {
   sl = document.getElementById('wpSummaryLabel'); sl.parentNode.removeChild(sl);
   ed = document.getElementById('wpSummary').parentNode; ed.parentNode.removeChild(ed);
   return;
 }
 editbutton = document.getElementById('ca-edit');
 if (editbutton && location.href.indexOf('action=edit')==-1) {
   editlink = editbutton.getElementsByTagName('a')[0].href + '&viewsource=1';
   tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
   na = document.createElement('a');
   na.href = editlink; na.appendChild(document.createTextNode('lapforrás'));
   li = document.createElement('li'); li.id = 'ca-viewsource'; li.appendChild(na);
   tabs.insertBefore(li,editbutton);
 }

});