User:Mormegil/vector.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
The accompanying .css page for this skin is at User:Mormegil/vector.css. |
// <source type="javascript"><nowiki>
// --------- subst:lle ------------
function addSubstLleToEditNotice()
{
var lleNotice = document.getElementById('editnotice-lle');
if (!lleNotice) return;
var a = document.createElement('a');
a.innerHTML = '(update)';
a.style.marginLeft = '0.5em';
a.href = '#';
a.onclick = function() {
var box = document.getElementById('wpTextbox1');
var summary = document.getElementById('wpSummary');
box.value = '{{subst:lle}}';
if (summary.value) summary.value += ": ";
summary.value += 'Updated using {{subst:lle}}';
};
var tds = lleNotice.getElementsByTagName('td');
tds[0].appendChild(a);
}
// --------- edit toolbar ----------
if (typeof mwCustomEditButtons !== 'undefined') {
var titleRE = /^([MP]otd)\/(\d{4})-(\d{2})-(\d{2}) \(([a-z]+)\)$/;
var parsedTitle = titleRE.exec(mw.config.get('wgTitle'));
if (mw.config.get('wgNamespaceNumber') === 10 && parsedTitle !== null) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/2/28/Button_gâteau.png",
"speedTip": "\x7b\x7b" + parsedTitle[1] + " description}}",
"tagOpen": "\x7b\x7b" + parsedTitle[1] + " description|1=",
"tagClose": "|2=" + parsedTitle[5] + "|3=" + parsedTitle[2] + "|4=" + parsedTitle[3] + "|5=" + parsedTitle[4] + "}}",
"sampleText": ""
};
}
}
if ( typeof($) !== 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
// Execute on load
$( document ).ready( function() {
var titleRE = /^([MP]otd)\/(\d{4})-(\d{2})-(\d{2}) \(([a-z]+)\)$/;
var parsedTitle = titleRE.exec(mw.config.get('wgTitle'));
if (mw.config.get('wgNamespaceNumber') === 10 && parsedTitle !== null) {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'potd description': {
label: "\x7b\x7b" + parsedTitle[1] + " description}}",
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/2/28/Button_gâteau.png',
action: {
type: 'encapsulate',
options: {
pre: "\x7b\x7b" + parsedTitle[1] + " description|1=",
post: "|2=" + parsedTitle[5] + "|3=" + parsedTitle[2] + "|4=" + parsedTitle[3] + "|5=" + parsedTitle[4] + "}}"
}
}
}
}
} );
}
addSubstLleToEditNotice();
} );
}
//importScript('User:Magnus_Manske/category_intersection.js');
//$.getScript("//localhost/commons.js");
$.getScript("//cs.wikipedia.org/w/index.php?title=Wikipedista:Mormegil/tools.js&action=raw&ctype=text/javascript&dontcountme=s",
function() {
addFindAndReplaceToolbar();
//removeAccessKeys(null);
addLinktoolbar("Sledované stránky", [ ["Category:Candidates for speedy deletion", "CAT:CSD"], ["Commons:Deletion requests/Older Discussions", "Old DelReq"], ["Category:Commons protected edit requests", "Editprotected"] ]);
});
// </nowiki></source>