Szerkesztő:FBöbe/monobook.js

A Wikiforrásból

Megjegyzés: közzététel után frissítened kell a böngésződ gyorsítótárát, hogy lásd a változásokat.

  • Firefox / Safari: tartsd lenyomva a Shift gombot és kattints a Frissítés gombra a címsorban, vagy használd a Ctrl–F5 vagy Ctrl–R (Macen ⌘–R) billentyűkombinációt
  • Google Chrome: használd a Ctrl–Shift–R (Macen ⌘–Shift–R) billentyűkombinációt
  • Internet Explorer / Edge: tartsd nyomva a Ctrl-t, és kattints a Frissítés gombra, vagy nyomj Ctrl–F5-öt
  • Opera: Nyomj Ctrl–F5-öt
/* automatikus öszefoglaló */
 document.write('<script type="text/javascript" src="' 
              + 'http://hu.wikipedia.org/w/index.php?title=User:Tgr/summary.js' 
              + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

/* meg egy ful a bevezeto szerkesztesehez <pre>
*/
 
/*
 * edit section 0 (text until the first section title)
 */
function addEditSection0(){
    if(!document.getElementById) return;
    var edit = document.getElementById('ca-edit');
    if(!edit) return;
    var link = ((edit.children) ? edit.children : edit.childNodes)[0].href + '&section=0';
    var edit0 = mw.util.addPortletLink('p-cactions', link, '0', 'ca-edit-0', 
        'Bevezető szerkesztése', '0', edit.nextSibling);
    if(/selected/.test(edit.className) && /section=0$/.test(window.location.href)) 
        edit0.className = 'selected';
    if(/istalk/.test(edit.className)) 
        edit0.className += (edit0.className.length ? ' istalk' : 'istalk');
}
$(addEditSection0);

/* szöveginőség-jelek a füleken (az angoloktól másolva)*/
/**********************
*** Quality indicators on "article" tab
*** by [[user:ThomasV]]
**********************/
function icon_src(t){
	var src='';
	switch(t){
		case "0%": src='http://upload.wikimedia.org/wikipedia/commons/8/8f/00%25.png'; break;
		case "25%": src='http://upload.wikimedia.org/wikipedia/commons/5/5b/25%25.png'; break;
		case "50%": src='http://upload.wikimedia.org/wikipedia/commons/3/3a/50%25.png'; break;
		case "75%": src='http://upload.wikimedia.org/wikipedia/commons/c/cd/75%25.png'; break;
		case "100%": src='http://upload.wikimedia.org/wikipedia/commons/6/64/100%25.png'; break;
	} 
	return src;
}
 
function pageQuality() {
	var a = document.getElementById("ca-nstab-main");
	if(wgCanonicalNamespace == "Page") a = document.getElementById("ca-nstab-page");
	if(!a) return;
 
	var q = document.getElementById("textquality")
	if(q) {
		var new_img = document.createElement("img");
		new_img.setAttribute("src", icon_src(q.className));
		a.firstChild.appendChild(new_img);
	}
 
	for(var i=0; spanElem = document.getElementsByTagName("span")[i]; i++) {
		if (spanElem.className == "pagequality")  {
			var new_img = document.createElement("img");
			new_img.setAttribute("src", icon_src(spanElem.title));
 
			if(wgCanonicalNamespace == "Page") {
				a.firstChild.appendChild(new_img);
			}
			else {
				s1 = spanElem.parentNode.previousSibling;
				opttext = s1.firstChild.firstChild;
				img = opttext.firstChild.nextSibling.nextSibling.nextSibling;
				next = img.nextSibling;
				opttext.removeChild(img);
				opttext.insertBefore(new_img,next);
			}
		}
	}
}
 
$(pageQuality);
 
/**********************
*** Add quality buttons on edit view
*** by [[user:ThomasV]]
**********************/
 
function addQuality(form,value) {
	var text="";
	switch(value){
		case "0%": text = "In project"; break;
		case "25%": text = "Incomplete"; break;
		case "50%": text = "Not formatted"; break;
		case "75%": text = "Complete and formatted"; break;
		case "100%": text = "Proofread"; break;
	} 
 
	form.elements["wpSummary"].value="/* "+text+" */";
	s = form.elements["wpTextbox1"].value;
	if(wgPageName.substring(0,5) == "Page:") {
		prefix="Page";
		s = s.replace(/\{\{PageQuality\|(.*?)\}\}/gi,"")
	}
	else {
		prefix="Text";
		s = s.replace(/\{\{Textquality\|(.*?)\}\}/gi,"")
	}
	form.elements["wpTextbox1"].value="{"+"{"+prefix+"Quality|"+value+"}"+"}"+s;
}
 
function addQualityButtons(){
	if( wgNamespaceNumber != 104 && wgNamespaceNumber != 0) {
		return;
	}
	var ig  = document.getElementById("wpWatchthis"); 
	if(ig) {
		var f = document.createElement("span");
		f.innerHTML = ' <input type="radio" name="quality" value="25%" onclick="addQuality(this.form,this.value)"><img src = "/wiki/Special:Filepath/25%25.png">'+'<input type="radio" name="quality" value="50%" onclick="addQuality(this.form,this.value)"><img src = "/wiki/Special:Filepath/50%25.png">'+'<input type="radio" name="quality" value="75%" onclick="addQuality(this.form,this.value)"><img src = "/wiki/Special:Filepath/75%25.png">'+'<input type="radio" name="quality" value="100%" onclick="addQuality(this.form,this.value)"><img src = "/wiki/Special:Filepath/100%25.png"> Text advancement';
		ig.parentNode.insertBefore(f,ig.nextSibling.nextSibling.nextSibling)
	}
}
 
$(addQualityButtons);

/* </pre> */

 /* // WikEd eleje 
 // Csörföly D. fordítása
 document.write('<script type="text/javascript" src="'
 + 'http://hu.wikipedia.org/w/index.php?title=User:Cs%C3%B6rf%C3%B6ly_D/wikEd-hu.js'
 + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 // saját beállítások, hogy ne legyen piros a link
 wikEdText = {
   'wikEdSummaryUsing':           '…a [[Segítség:wikEd|wikEd]] segítségével'
 }
 
 // wikEd betöltése
 document.write('<script type="text/javascript" src="'
 + 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
 + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
  
 //WikEd vége
 */