Wikipedysta:Pur/vector.js

//importScript('Wikipedysta:Holek/refToolbar.js');
importScript('Wikipedysta:Matma Rex/infobox.js');
// przycisk "Przejrzyj"
//importScript('Wikipedysta:Matma Rex/przejrzyj.js');
importScript('Wikipedysta:Żbiczek/gadzet.js');

/* $('#bodyContent').contents().filter(function() {
  if (this.nodeType == 8)  {
        return (this.data.indexOf("Saved") > 0 ||
            this.data.indexOf("NewPP") > 0);
  } else return false;
}).replaceWith(function() {
  return "<pre>" + this.data + "</pre>";
}); */


// <nowiki>
// przyciski tylko podczas edycji strony dyskusji - komy
// autor - [[:pl:User:Masur|Masur]]
 
$(function()
{
	var copywarn = document.getElementById('editpage-copywarn');
	if (! copywarn)
		return;
 
	// usuń niepotrzebne
	copywarn.innerHTML = '';
 
	if (wgNamespaceNumber != 3)
		return;
 
	if (wgAction != 'edit' && wgAction != 'editredlink')
		return;
 
	var userSummaryButtons = document.getElementById('userSummaryButtons');
 
	if (! userSummaryButtons)
	{
		var userSummaryButtons = document.createElement('span');
		userSummaryButtons.id = 'userSummaryButtons'
		copywarn.appendChild(userSummaryButtons);
	}
	else
	{
		userSummaryButtons.appendChild(document.createElement('br'));
	}
	var el = userSummaryButtons;
	// dla nowicjuszy
	przyciskiDodaj(el, 'witamy', 'usertalk_text("Witam cię", 1) ', '', 'Witaj na Wikipedii');
	przyciskiDodaj(el, 'nowy', 'usertalk_text("Kom|nowy", 1) ', '', 'treść jest niezgodna z zasadami');
	przyciskiDodaj(el, 'ek', 'usertalk_text("Kom|ek", 1) ', '', 'artykuł został zekowany');
	przyciskiDodaj(el, 'stub', 'usertalk_text("Kom|substub", 1) ', '', 'artykuł nie spełnia wymagań');
	el.appendChild(document.createTextNode(' ')); // odstęp
	przyciskiDodaj(el, 'źródła', 'usertalk_text("Kom|weryfikacja", 1) ', '', 'o źródłach');
	przyciskiDodaj(el, 'nieency', 'usertalk_text("Kom|nieency", 1) ', '', 'nieency');
	przyciskiDodaj(el, 'advert', 'usertalk_text("Kom|linki", 1) ', '', 'nowy daje spamlinki');
	przyciskiDodaj(el, 'ngn', 'usertalk_text("Kom|gryzienie", 1) ', '', 'nie podgryzaj!');
	przyciskiDodaj(el, 'podp', 'usertalk_text("Kom|podpis", 1) ', '', 'na czyjeś wiadomości odpowiadaj na jego stronie dyskusji');
	el.appendChild(document.createTextNode(' ')); // odstęp
	przyciskiDodaj(el, 'źródła!', 'usertalk_text("Kom|hoax", 1) ', '', 'o źródłach');
	przyciskiDodaj(el, 'spam!', 'usertalk_text("Kom|spam", 1) ', '', 'linki');
	przyciskiDodaj(el, 'reklama', 'usertalk_text("Kom|reklama", 1) ', '', 'advert');
	przyciskiDodaj(el, 'blanking', 'usertalk_text("Kom|blanking", 1) ', '', 'blanking');	
	przyciskiDodaj(el, 'pov', 'usertalk_text("Kom|pov", 1) ', '', 'pov');	
	el.appendChild(document.createTextNode(' ')); // odstęp
	przyciskiDodaj(el, 'npa', 'usertalk_text("Kom|npa-usunięte", 1) ', '', 'npa');
	przyciskiDodaj(el, 'grafika npa', 'usertalk_text("GrafikaNPA", 1) ', '', 'grafika NPA');
	przyciskiDodaj(el, 'comm', 'usertalk_text("TestCommons", 1) ', '', 'grafiki na commons');
	przyciskiDodaj(el, 'plik', 'usertalk_text("Wikipedysta:Masur/TestGrafiki", 1) ', '', 'Zapoznaj się z zasadami przesyłania plików');
	el.appendChild(document.createTextNode(' ')); // odstęp
	przyciskiDodaj(el, 'stop', 'usertalk_text("Kom|stop", 1) ', '', 'nie rób tak!');
	przyciskiDodaj(el, 'stop-ip', 'usertalk_text("Kom|stop-ip", 1) ', '', 'nie rób tak-ip');
	przyciskiDodaj(el, 'Ostatnie!!!', 'usertalk_text("Kom|ostatnie", 1) ', '', 'ostatnie ostrzeżenie');
	przyciskiDodaj(el, 'Warn!!!', 'usertalk_text("Kom|wandal", 1) ', '', 'pierwsze i ostatnie ostrzeżenie');
	przyciskiDodaj(el, 'Blok!!!', 'usertalk_text("Kom|blokada", 1) ', '', 'blokada');
});
 
 
function usertalk_text(n, subst)
{
	var sufix = '{' + '{' + ( subst ? 'subst:' : '')  + n + '}}~~~~';
	document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + sufix;
	var prefix = n.substr(0, 12) == 'Wikipedysta:' ? '' : 'Szablon:';
	if (document.editform.wpSection.value == '')
		document.editform.wpSummary.value = "[[" + prefix + n + "|" + n + "]]";
}
 
// </nowiki> -------------------------------------------
// ---------------------------------------------------------------
// wyświetlanie kłódki w prawym górnym rogu kiedy 
// strona jest zabezpieczona
// ---------------------------------------------------------------
 
$(function()
{
	if (! wgRestrictionEdit)
		return;
 
	if (! wgRestrictionEdit.length)
		return;
 
	if (document.location.href.match(/printable=yes/))
		return;
 
	if (wgRestrictionEdit[0] == "")
		return;
 
	// na stronie głównej nie pokazujemy kłódki
	if (wgTitle == "Strona główna")
		return;
 
	// czy jest duże zatłoczenie rożnych elementów
	if (document.getElementById('featured-star') && document.getElementById('coordinates'))
		return;
 
	var img = document.createElement('img');
	if (wgRestrictionEdit[0] == "autoconfirmed") {
		img.src = "http://upload.wikimedia.org/wikipedia/commons/thumb/a/a1/Padlock-light-silver.svg/20px-Padlock-light-silver.svg.png";
		img.title = "częściowe zabezpieczenie";
	}
	else if (wgRestrictionEdit[0] == "sysop") {
		img.src = "http://upload.wikimedia.org/wikipedia/commons/thumb/5/59/Padlock.svg/20px-Padlock.svg.png";
		img.title = "pełne zabezpieczenie";
	}
	img.alt = "padlock";
 
	var link = document.createElement('a');
	link.id = "padlock";
	link.href = wgArticlePath.replace("$1", "Wikipedia:Strona_zabezpieczona");
	link.style.position = "absolute";
	if (document.getElementById('featured-star')) {
		// umieść kłódkę obok medalu
		link.style.right = "30px";
	}
	else
		link.style.right = "10px";
 
	link.style.top = "10px";
	link.style.zIndex = "100";
	link.appendChild(img);
 
	var bodyContent = document.getElementById('bodyContent');
	bodyContent.appendChild(link);
});

// QuickEK script by [[:pl:User:ChP94]]
 // based on quickimgdelete.js script written by [[:en:User:Howcheng]]
 // Released under the [http://www.gnu.org/licenses/gpl.txt GNU Public License (GPL)]
// <pre><nowiki>
 
var quickek_autosave = true;
 
// From [[en:User:Lupin/autoedit.js]]
function getParamValue(paramName) {
  var cmdRe=RegExp('[&?]'+paramName+'=([^&]*)');
  var h=document.location;
  var m=cmdRe.exec(h);
  if (m) {
    try {
      return decodeURIComponent(m[1]);
    } catch (someError) {}
  }
  return null;
}
 
function quickek_ekIt () {
   var reason = prompt("Dlaczego chcesz zEKować ten art?", '');
   if((reason) && (reason != "")) {
       var title = encodeURIComponent(mw.config.get('wgPageName'));
       window.location.href= "http://pl.wikipedia.org/w/index.php?title=" + title + "&action=edit&fakeaction=quickek&reason=" + encodeURIComponent(reason);
   }
}
 
function quickek_fastEk () {
   var title = encodeURIComponent(mw.config.get('wgPageName'));
   alert("EKujesz artykuł bez podania powodu");
   window.location.href= "http://pl.wikipedia.org/w/index.php?title=" + title + "&action=edit&fakeaction=fastek";
}

 
 
function quickek_onload() {
  if (document.getElementById('ca-edit') == null) // not editable by non-admin
    return; 
  mw.util.addPortletLink('p-tb', 'javascript:quickek_ekIt()', "EK", 'quick-ek', "Zgłoś artykuł do ekspresowego kasowanka");
  mw.util.addPortletLink('p-tb', 'javascript:quickek_fastEk()', "EK bez podania powodu", 'fast-ek', "Zgłoś artykuł do ekspresowego kasowanka bez podawania powodu");
 
 
  var fakeaction = getParamValue('fakeaction');
  if(fakeaction=="quickek") {
     var reason = decodeURIComponent(getParamValue('reason'));
     editformval = document.editform.wpTextbox1.value;
     if((editformval) && (editformval != "") && !(editformval.match("{{ek")) && (reason) && (reason != "")) {
        editformval = "{{ek|1="+reason+"}}\n" + editformval;
        document.editform.wpTextbox1.value = editformval;
        document.editform.wpSummary.value = "[[Kategoria:Ekspresowe kasowanie" + "|ek]], powód: " + reason;
        if(quickek_autosave) { document.editform.wpSave.click(); }
    }
  }
  else if(fakeaction=="fastek") {
     editformval = document.editform.wpTextbox1.value;
     if((editformval) && (editformval != "") && !(editformval.match("{{ek"))) {
        editformval = "{{ek" +"}}\n" + editformval;
        document.editform.wpTextbox1.value = editformval;
        document.editform.wpSummary.value = "[[Kategoria:Ekspresowe kasowanie" + "|ek]]";
        if(quickek_autosave) { document.editform.wpSave.click(); }
     }
  }
}
 

 
$(quickek_onload);
//</nowiki></pre>

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
Kembali kehalaman sebelumnya