Участник:Dnikitin/vector.js
Материал из Википедии — свободной энциклопедии
// Администраторам: Не удалять, ошибка скрипта.
// следует ставить слеш в упоминаниях шаблонов {\{template)) иначе страница будет попадать в соответствующие категории
//mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedia:WikiProject_User_scripts/Scripts/Replace');
importScript('MediaWiki:Gadget-HotCat.js')
$( function(){
if (mw.config.get('wgAction').match(/edit|submit/) && mwEditButtons.length >= 10) mwEditButtons[9].tagOpen = ' — ~~' + '~~'
})
function addExtraChars1(){
var wpSummary = document.getElementById('wpSummary')
var block = document.getElementById ('editpage-specialchars');
if (!block) return;
block.innerHTML =
'<small>Нарушения: ' + '<a href=\'javascript:Vandal()\'>Вандализм</a> ' +
'</small><br/>' + block.innerHTML;
block.innerHTML =
'<small>К удалению: ' + '<a href=\'javascript:dbempty()\'>{\{db-empty))</a> ' +
'<a href=\'javascript:dbnn()\'>{\{db-nn))</a> ' +
'<a href=\'javascript:Copyvio()\'>{\{db-copyvio))</a> ' +
'<a href=\'javascript:afdd()\'>{\{subst:afdd))</a> ' +
'</small><br/>' + block.innerHTML;
}
function Vandal(){
var wpSummary = document.getElementById('wpSummary')
insertTags("{"+"{subst:Вандализм|diff=",")) --~"+"~"+"~"+"~","");
if (!wpSummary) return;
wpSummary.value = wpSummary.value + 'Вандализм';
}
function dbnn(){
var wpSummary = document.getElementById('wpSummary')
insertTags("((","))","db-nn");
if (!wpSummary) return;
wpSummary.value = 'К удалению';
}
function dbempty(){
var wpSummary = document.getElementById('wpSummary')
insertTags("((","))","db-empty");
if (!wpSummary) return;
wpSummary.value = 'К удалению';
}
function Copyvio(){
var wpSummary = document.getElementById('wpSummary')
insertTags("{"+"{db-copyvio|url=","))","");
if (!wpSummary) return;
wpSummary.value = 'К удалению по сopy-vio';
}
function afdd(){
var wpSummary = document.getElementById('wpSummary')
insertTags("{"+"{subst:afdd","))","");
if (!wpSummary) return;
wpSummary.value = 'К удалению';
}
if (mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit'){
$(addExtraChars1);
}
//Пример: добавление в панель своей вставки
//function func_start (){
//var specialchars = document.getElementById ('editpage-specialchars');
//specialchars.innerHTML +="<small>Мои настройки: <a href=\"#\" onclick=\"insertTags('((','))','db-empty');return false\">{\{db-empty))</a>"+
//"<a href=\"#\" onclick=\"insertTags('((','))','db-nn');return false\">{\{db-nn))</a>"+
//"</small>";
//}
//addOnloadHook(func_start);
// см http://en.wikipedia.org/wiki/User_talk:Gerbrant/edit/autoReplace.js
// автозамена
Gerbrant = {fw: {load: [
"Gerbrant.edit.autoReplace"
]))
Gerbrant = {
autoReplace: {
// noDefault: true,
lib:
[
// This loads User:Gerbrant/edit/autoReplace/default.js.
// Same effect can be achieved by not specifying the noDefault setting.
"Gerbrant.edit.autoReplace.default",
// Your own set of replacements.
"ExampleUser.scriptname"
],
defs:
[
// { // This example will replace things like A with A.
// re: "\\[\\[(.*?)\\|\\1\\]\\]",
// hf: function(a,b){return "" + b + "";}
// },
{
re: "<references/>",
hr: function(a){return "((примечания))";}
}
]
} // autoReplace
} //
document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Gerbrant/fw.js&action=raw&ctype=text/javascript&dontcountme=s"><\u002fscript>');
Text is available under the CC BY-SA 4.0 license; additional terms may apply.
Images, videos and audio are available under their respective licenses.