MediaWiki:UndeleteCheck.js — Версийн башхалла

ХӀара гӀирс Википеди чуьра бу — маьрша энциклопеди
Чулацам дӀабаьккхина Чулацам тӀетоьхна
Максим Підліснюк (дийцар | къинхьегам)
okey
Максим Підліснюк (дийцар | къинхьегам)
Нисдарах лаьцна йаздина дац
МогӀа 1: МогӀа 1:
// scripts from uk.wikipedia https://uk.wikipedia.org/w/index.php?title=MediaWiki:Deletecheck.js
// script from uk.wikipedia https://uk.wikipedia.org/w/index.php?title=MediaWiki:Deletecheck.js
// authors from uk.wikipedia - Максим Підліснюк, RLuts
// authors from uk.wikipedia - Максим Підліснюк, RLuts
// adapted by Максим Підліснюк
// adapted by Максим Підліснюк

Верси 2016, 18 март, 00:03

// script from uk.wikipedia https://uk.wikipedia.org/w/index.php?title=MediaWiki:Deletecheck.js
// authors from uk.wikipedia - Максим Підліснюк, RLuts
// adapted by Максим Підліснюк
// CC-BY-SA 4.0

if ($.inArray('sysop',mw.config.get('wgUserGroups')) > -1 && wgAction == 'edit') {
    $(document).ready(function () {
		var text = document.getElementById ('wpTextbox1');
		if (!text) return;
		text.value = text.value.replace(/^\s*((?:.|\n)+?)\s*$/, "$1")
					  .replace (/(\<noinclude\>)?\s*\{\{[hH]angon[^}]*\}\}\s*(\<.noinclude\>)?\n*/g, "")
					  .replace (/(\<noinclude\>)?\s*\{\{[dD]elete[^}]*\}\}\s*(\<.noinclude\>)?\n*/g, "")
					  .replace (/(\<noinclude\>)?\s*\{\{[С]иха дӀаяккхаре[^}]*\}\}\s*(\<.noinclude\>)?\n*/g, "")
					  .replace (/(\<noinclude\>)?\s*\{\{[dD]b[^}]*\}\}\s*(\<.noinclude\>)?\n*/g, "")
					  .replace(/^\s*((?:.|\n)+?)\s*$/, "$1");
		// Remove any whitespace from beginning and end
		text.value = $.trim( text.value || "" );
 
		// Set edit summary
                var add = "Дита";
                var summary = document.getElementById ('wpSummary');
                if (!summary) return;
                var val = $.trim( summary.value || "" );
                if (val.indexOf(add) != -1) return;
                summary.value = (val.length == 0) ? add : val + " " + add;
	});
}