Wikipedista:Ragimiri/monobook.js

Z Wikipedie, otevřené encyklopedie

Poznámka: Po uložení musíte vyprázdnit mezipaměť vašeho prohlížeče, jinak změny neuvidíte.

mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Js/ajaxPreview.js&action=raw&ctype=text/javascript');
mw.loader.load('https://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-LongEditSummaries.js&action=raw&ctype=text/javascript');

ajaxPreviewPos = 'bottom';
ajaxPreviewKey = '';
ajaxDiffKey = '';
ajaxPreviewScrollTop = true;
ajaxPreviewFull = false;

$(function()
{
var pLink = document.getElementById('t-permalink')
if (pLink) pLink.firstChild.href = pLink.firstChild.href.replace(/title=[^&]*&/,'')
});

$(function()
{
if (typeof oldEditsectionLinks != 'undefined' && oldEditsectionLinks) return;
var spans = document.getElementsByTagName("span");
for (var i=0; i<spans.length; i++)
{
var span = spans[i];
if (span.className != "editsection") continue;
span.style.fontSize = "x-small";
span.style.fontWeight = "normal";
span.style.cssFloat = "none";
span.style.marginLeft = "0px";
span.style.verticalAlign = "middle";
span.parentNode.appendChild(document.createTextNode(" "));
span.parentNode.appendChild(span);
}
});

mw.loader.using('mediawiki.action.edit', function () {
var button = {
id: 'exp0',
imageFile: '//upload.wikimedia.org/wikipedia/commons/3/3d/EXPBT0.png',
speedTip: 'Experimenty0',
tagOpen: '\x7b\x7bsubst:Experimenty0|',
tagClose: '}} --\~\~\~\~',
sampleText: ''
};
mw.toolbar.addButton(button.imageFile,button.speedTip,button.tagOpen,button.tagClose,button.sampleText,button.id,button.id);

var button = {
id: 'exp1',
imageFile: '//upload.wikimedia.org/wikipedia/commons/b/b0/EXPBT1.png',
speedTip: 'Experimenty1',
tagOpen: '\x7b\x7bsubst:Experimenty|',
tagClose: '}} --\~\~\~\~',
sampleText: ''
};
mw.toolbar.addButton(button.imageFile,button.speedTip,button.tagOpen,button.tagClose,button.sampleText,button.id,button.id);

var button = {
id: 'exp2',
imageFile: '//upload.wikimedia.org/wikipedia/commons/a/ae/EXPBT2.png',
speedTip: 'Experimenty2',
tagOpen: '\x7b\x7bExperimenty2|',
tagClose: '}} --\~\~\~\~',
sampleText: ''
};
mw.toolbar.addButton(button.imageFile,button.speedTip,button.tagOpen,button.tagClose,button.sampleText,button.id,button.id);

var button = {
id: 'exp2o',
imageFile: '//upload.wikimedia.org/wikipedia/commons/3/3a/EXPBT2-o.png',
speedTip: 'Experimenty2o',
tagOpen: '\x7b\x7bExperimenty2o|',
tagClose: '}} --\~\~\~\~',
sampleText: ''
};
mw.toolbar.addButton(button.imageFile,button.speedTip,button.tagOpen,button.tagClose,button.sampleText,button.id,button.id);

var button = {
id: 'exp3',
imageFile: '//upload.wikimedia.org/wikipedia/commons/e/e5/EXPBT3.png',
speedTip: 'Experimenty3',
tagOpen: '\x7b\x7bExperimenty3|',
tagClose: '}} --\~\~\~\~',
sampleText: ''
};
mw.toolbar.addButton(button.imageFile,button.speedTip,button.tagOpen,button.tagClose,button.sampleText,button.id,button.id);

var button = {
id: 'exp3o',
imageFile: '//upload.wikimedia.org/wikipedia/commons/c/ca/EXPBT3-o.png',
speedTip: 'Experimenty3o',
tagOpen: '\x7b\x7bExperimenty3o|',
tagClose: '}} --\~\~\~\~',
sampleText: ''
};
mw.toolbar.addButton(button.imageFile,button.speedTip,button.tagOpen,button.tagClose,button.sampleText,button.id,button.id);

var button = {
id: 'uo',
imageFile: '//upload.wikimedia.org/wikipedia/commons/4/4e/Button_fait2.png',
speedTip: 'Urgentně ověřit',
tagOpen: '\x7b\x7bsubst:Urgentně ověřit}}',
tagClose: '',
sampleText: ''
};
mw.toolbar.addButton(button.imageFile,button.speedTip,button.tagOpen,button.tagClose,button.sampleText,button.id,button.id);

var button = {
id: 'uu',
imageFile: '//upload.wikimedia.org/wikipedia/commons/0/02/Button_fuente_primaria.png',
speedTip: 'Urgentně upravit',
tagOpen: '\x7b\x7bsubst:Urgentně upravit}}',
tagClose: '',
sampleText: ''
};
mw.toolbar.addButton(button.imageFile,button.speedTip,button.tagOpen,button.tagClose,button.sampleText,button.id,button.id);

var button = {
id: 'fakt',
imageFile: '//upload.wikimedia.org/wikipedia/commons/a/aa/Button_question.png',
speedTip: 'Chybí zdroj',
tagOpen: '\x7b\x7bsubst:Fakt}}',
tagClose: '',
sampleText: ''
};
mw.toolbar.addButton(button.imageFile,button.speedTip,button.tagOpen,button.tagClose,button.sampleText,button.id,button.id);

});

/* hezčí diff */
function parametr(jmeno)
 {
  vyraz1 = "[\\?&]"+jmeno+"=([0-9]*)";
  vyraz2 = new RegExp(vyraz1);
  var vysledek = vyraz2.exec(window.location.href);
  if (vysledek == null)
    return "";
  else
    return vysledek[1];
}

if (parametr('diff')!='')
 {
  adresa = wgServer + '/w/index.php?diff='+parametr('diff');
  mw.util.addPortletLink('p-cactions', adresa, 'diff', 'ca-diff', 'Vytvořit kratší diff');
  if (parametr('oldid')=='') document.getElementById('ca-diff').setAttribute('class', 'selected');
 }