Szerkesztő:Karmela/monobook.js
Megjelenés
Megjegyzés: közzététel után frissítened kell a böngésződ gyorsítótárát, hogy lásd a változásokat.
- Firefox / Safari: tartsd lenyomva a Shift gombot és kattints a Frissítés gombra a címsorban, vagy használd a Ctrl–F5 vagy Ctrl–R (Macen ⌘–R) billentyűkombinációt
- Google Chrome: használd a Ctrl–Shift–R (Macen ⌘–Shift–R) billentyűkombinációt
- Internet Explorer / Edge: tartsd nyomva a Ctrl-t, és kattints a Frissítés gombra, vagy nyomj Ctrl–F5-öt
- Opera: Nyomj Ctrl–F5-öt
// Extra buttons for the edit toolbar, based on http://hu.wikipedia.org/w/index.php?title=MediaWiki:Common.js&oldid=5090124
function InsertPrivatButtonsToToolBar() {
// pre button
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/3c/Button_pre.png",
"speedTip": "pre",
"tagOpen": "\n<pre>\n",
"tagClose": "\n</pre>\n",
"sampleText": "szöveg" }
// blockquote button
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/f/fd/Button_blockquote.png",
"speedTip": "blockquote",
"tagOpen": "<blockquote>\n",
"tagClose": "</blockquote>\n",
"sampleText": "szöveg" }
// span button
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/72/Button_span_2.png",
"speedTip": "span",
"tagOpen": "<span style=\"\">",
"tagClose": "</span>",
"sampleText": "szöveg" }
// i button
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/1d/Button_italic.png",
"speedTip": "i",
"tagOpen": "<i>",
"tagClose": "</i>",
"sampleText": "szöveg" }
// cite book button
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/ef/Button_cite_book.png",
"speedTip": "cite book",
"tagOpen": "\n{{Cite book ",
"tagClose": "\n}}\n",
"sampleText": "\n| author = \n| authorlink = \n| title = \n| url = \n| chapter = \n| chapterurl = \n| series = \n| edition = \n| isbn = \n| publisher = \n| location = \n| year = \n| accessdate = " }
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/bd/Btn_plus.png",
"speedTip": "Tudakozó",
"tagOpen": "== A [[Wikipédia:Tudakozó|Tudakozó]]ban kérdezték==\nJó lenne beleszőni a cikkbe:<blockquote>",
"tagClose": "</blockquote>",
"sampleText": "szöveg" }
}
addOnloadHook(InsertPrivatButtonsToToolBar);
// VIEW SOURCE
$(function () {
if (location.href.indexOf('viewsource=1') != -1) {
sl = document.getElementById('wpSummaryLabel'); sl.parentNode.removeChild(sl);
ed = document.getElementById('wpSummary').parentNode; ed.parentNode.removeChild(ed);
return;
}
editbutton = document.getElementById('ca-edit');
if (editbutton && location.href.indexOf('action=edit')==-1) {
editlink = editbutton.getElementsByTagName('a')[0].href + '&viewsource=1';
tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
na = document.createElement('a');
na.href = editlink; na.appendChild(document.createTextNode('view source'));
li = document.createElement('li'); li.id = 'ca-viewsource'; li.appendChild(na);
tabs.insertBefore(li,editbutton);
}
})
// Figyelőlistán utolsó betöltés óta történt változtatások
$(function () {
if (!wgCanonicalSpecialPageName || wgCanonicalSpecialPageName != "Watchlist") return;
if (!document.forms[0] || !document.forms[0].namespace) return;
var link = document.createElement('a');
link.id = 'listSince';
link.href = '#listSince'; // must have a href to show as link!
var then = +(new Date());
var fixLinkHref = function () {
var url = window.location.href.split('#')[0];
var days = (( +(new Date()) - then ) + (60 * 1000)) / (1000 * 3600 * 24);
if (url.match(/[?&]days=/))
this.href = url.replace(/([?&]days=)[^&]*/, '$1'+days);
else
this.href = url + (url.indexOf('?') < 0 ? '?':'&') + 'days=' + days;
return true;
};
link.onclick = fixLinkHref;
link.onmousedown = fixLinkHref; // react to middle clicks too
var frag = document.createDocumentFragment();
frag.appendChild(document.createTextNode(' | '));
frag.appendChild(link);
link.appendChild(document.createTextNode('Változtatások'));
frag.appendChild(document.createTextNode(' az utolsó betöltés óta'));
// just one little ID attribute would be _so_ nice...
var nsSelectForm = document.getElementsByTagName('form')[0];
nsSelectForm.parentNode.insertBefore(frag, nsSelectForm);
});