Szerkesztő:Karmela/monobook.js 2009-03-15-jó
// 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
\n", "tagClose": "\n
\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": "", "tagClose": "", "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); }
})