Wikipedysta:PMG/common.js

mw.loader.load('https://pl.wikipedia.org/w/index.php?title=Wikipedysta:Wargo/Skrypty/linter_helper.js&action=raw&ctype=text/javascript');
mw.loader.load('https://pl.wikipedia.org/w/index.php?title=Wikipedysta:Beau/skrypty/move-page-whl.js&action=raw&ctype=text/javascript');
mw.loader.load('https://pl.wikipedia.org/w/index.php?title=Wikipedysta:Matma_Rex/kodmapy.js&action=raw&ctype=text/javascript');
mw.loader.load('https://pl.wikipedia.org/w/index.php?title=Wikipedysta:Peter_Bowman/missing-person-infoboxes.js&action=raw&ctype=text/javascript');
mw.loader.load("/w/index.php?title=Wikipedysta:Msz2001/wstaw-interwiki.js&action=raw&ctype=text/javascript");

//dodatkowe przyciski w CWZ
mw.loader.load( 'https://pl.wikipedia.org/w/index.php?title=Wikipedysta:AramilFeraxa/DYKCheck.js&action=raw&ctype=text/javascript');

// konfiguracja do https://pl.wikipedia.org/wiki/Wikipedia:Narz%C4%99dzia/Pending_Changes_Helper
mw.hook('userjs.pendingChangesHelper.beforeInit').add(function (pch) {
  pch.options.limit = 7;
});


// Zamiana [link opis] na {{cytuj stronę}}
importScript("Wikipedysta:Matma Rex/cytuj stronę.js");


var customizeToolbar = function () {
  $("#wpTextbox1").wikiEditor("addToToolbar", {
    section: "main",
    group: "insert",
    tools: {
      fixing: {
        label: "removes tags",
        type: "button",
        icon: "https://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Crystal_Clear_action_reload.png/40px-Crystal_Clear_action_reload.png",
        action: {
          type: "callback",
          execute: function (context) {
            var textarea = context.$textarea[0];
            var text = context.$textarea.val();
            var list = [
              /<center>/gi,
              /<\/center>/gi,
              /<\/em>/gi,
              /<em>/gi,
              /<\/small>/gi,
              /<small>/gi,
              /<\/tt>/gi,
              /<tt>/gi,
              /<\/nowiki>/gi,
              /<nowiki\/>/gi,
              /<nowiki>/gi
            ];

            var badText = text.substring(textarea.selectionStart, textarea.selectionEnd);
            var goodText = text.substring(textarea.selectionStart, textarea.selectionEnd);
            list.forEach(function (element) {
              goodText = goodText.replace(element, "");
            });

            var newText = text.replace(badText, goodText);
            context.$textarea.val(newText);
          }
        }
      },
      fixinghash: {
        label: "changes hash to bullets",
        type: "button",
        id: "hashToStar",
        icon: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Crystal_Clear_action_loopnone.png/40px-Crystal_Clear_action_loopnone.png",
        action: {
          type: "callback",
          execute: function (context) {
            var textarea = context.$textarea[0];
            var text = context.$textarea.val();

            var badText = text.substring(textarea.selectionStart, textarea.selectionEnd);
            var goodText = badText.replace(/\n#/g, "\n*");

            var newText = text.replace(badText, goodText);
            context.$textarea.val(newText);
          }
        }
      }
    }
  });
};

if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
	mw.loader.using( 'user.options', function () {
                if ( mw.user.options.get('usebetatoolbar') ) {
                        mw.loader.using( 'ext.wikiEditor', function () {
                                $(document).ready( customizeToolbar );
                        } );
                }
        } );
}

/*Otwieracz Linter*/
if(mw.config.get('wgCanonicalSpecialPageName') == "LintErrors")
{
	var linter_opened_titles = [];
	var el_open_multi = $('<a>Otwórz edytowanie 21 unikalnych stron           </a>').click(function(e){
		e.preventDefault();
		
		$(".TablePager_col_title a:contains('edytuj')").each(function(i, e){
			if(linter_opened_titles.indexOf($(e).attr('title')) != -1 || linter_opened_titles.length > 20) return;
			window.open($(e).attr('href'));
			linter_opened_titles.push($(e).attr('title'));
		});
	});
	
	$('.TablePager_nav').after(el_open_multi);
//--
	var linter_opened_titles = [];
	var el_open_multi = $('<a>Otwórz edytowanie wszystkich unikalnych stron</a>').click(function(e){
		e.preventDefault();
		
		$(".TablePager_col_title a:contains('edytuj')").each(function(i, e){
			if(linter_opened_titles.indexOf($(e).attr('title')) != -1) return;
			window.open($(e).attr('href'));
			linter_opened_titles.push($(e).attr('title'));
		});
	});
	
	$('.TablePager_nav').after(el_open_multi);
}

/*Otwieracz "edytuj"*/
var tabs_limit = 20;
var page_class_pattern = 'page-Wikipedysta_PMG_brudnopisW'; //np. rootpage-Wikipedysta_PMG

var el_open_multi = $('<a>Otwórz w nowych kartach edytowanie co '+tabs_limit+' stron</a>').click(function(e){
	e.preventDefault();
	
	$("."+page_class_pattern+" ol a:contains('edytuj')").each(function(i, hLink){
		if(i > tabs_limit) return false;
		window.open($(hLink).attr('href'));
		$(hLink).remove();
	});
});

$("."+page_class_pattern+" ol").before(el_open_multi);

/*Otwieracz "edytuj": Wikipedysta:PBbot/biogramy bez infoboksów*/
var tabs_limit = 99;

mw.hook('pb-mpi.results').add(function ($results) {
	var $ol = $results.find('ol').first();
	
	$('<a>')
		.text(mw.format('Otwórz w nowych kartach edytowanie co $1 stron', tabs_limit))
		.on('click', function (e) {
			e.preventDefault();
			
			$ol.find('a:contains("edytuj")').slice(0, tabs_limit).each(function (i, li) {
				window.open(li.href);
				li.remove();
			});
		})
		.prependTo($results);
});

/*Otwieracz wyników wyszukiwania*/
var el_open_multi = $('<a>Otwórz edytowanie wszystkich wyników w nowych kartach</a>').click(function(e){
	e.preventDefault();
	
	$(".mw-search-result-heading a").each(function(i, hLink){
		window.open($(hLink).attr('href')+"?action=edit");
	});
});
$('.results-info').before(el_open_multi);

//
$(function()
{
	if(typeof nuxsr !== 'undefined')
	{
	nuxsr.mem.s = [''
	,'tytuł=[[Dziennik Personalny Ministerstwa Spraw Wojskowych]]|'
	,'cośik',
	];
	nuxsr.mem.r = [''
	,'tytuł=Dziennik Personalny Ministerstwa Spraw Wojskowych|'
	,'cosik',
	];
	}

	/*Kategoria:Szablon cytuj – goły link w tytule*/
	$(".problemy-w-cytuj")
		.show("slow")
		.css("display", "inline")
		.css("color", "red");

	//T54701
	$('#ca-ve-edit a').attr('accessKey', '');
});

//czyszczenie thum z px

mw.hook('userjs.wp_sk.ready').add(function () {
    importScript('Wikipedysta:Msz2001/sk-remove-pixels.js');
} );


dodatkowePrzyciskiOpisuEdycjiUstawienia = [
  {opis: 'tłumaczenie z enwiki', skrot: 'en.wiki', nrWiersza: 1, kolorTla: 'whitesmoke'},
  {opis: 'dubel kategorii', skrot: 'dubel kat', nrWiersza: 1, kolorTla: 'whitesmoke'},
  {opis: 'dwukropek w nagłówku to błąd', skrot: 'dwukropek w nagł', nrWiersza: 1, kolorTla: 'whitesmoke'},
  {opis: '+źródła', skrot: '+źr', nrWiersza: 2, kolorTla: 'blanchedalmond'},
  {opis: 'posortowano', skrot: 'sort', nrWiersza: 2, kolorTla: 'blanchedalmond'},
  {opis: 'uaktualniono', skrot: 'akt.', nrWiersza: 2, kolorTla: 'blanchedalmond', kolorTekstu: 'red'},
  {opis: 'drobne językowe', skrot: 'dr.jęz.', nrWiersza: 2, kolorTla: 'deepskyblue', styl:'color:azure;'}
];
 
importScript('Wikipedysta:Skalee/dodatkowe_przyciski_opisu_edycji.js');

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