MediaWiki:Editpage.js: verschil tussen versies
Uit Wiki
Naar navigatie springenNaar zoeken springenRegel 10: | Regel 10: | ||
lnk.href = 'javascript:loadCommonTools()' | lnk.href = 'javascript:loadCommonTools()' | ||
lnk.title = 'Load Common-style Edittools' | lnk.title = 'Load Common-style Edittools' | ||
− | lnk.id = ' | + | lnk.id = 'loadCommonEdittools' |
lnk.appendChild(document.createTextNode('[load edittools]')) | lnk.appendChild(document.createTextNode('[load edittools]')) | ||
lnk.style.cssText = 'float:right' | lnk.style.cssText = 'float:right' | ||
box.appendChild(lnk) | box.appendChild(lnk) | ||
} | } | ||
− | function | + | function loadCommonTools(){ |
− | importScript('MediaWiki:Scripts/ | + | importScript('MediaWiki:Scripts/Edittools.js') |
− | var lnk = document.getElementById(' | + | var lnk = document.getElementById('loadCommonEdittoos') |
if (lnk) lnk.parentNode.removeChild(lnk) | if (lnk) lnk.parentNode.removeChild(lnk) | ||
} | } |
Versie van 5 jun 2008 17:38
//<nowiki> //dynamically load Commons-style Edittools function createEdittoolsLink(){ //get div.mw-editTools var box = document.getElementById('wpTextbox1') while (box && box.className!='mw-editTools') box=box.nextSibling if (!box) return //create a link var lnk = document.createElement('a') lnk.href = 'javascript:loadCommonTools()' lnk.title = 'Load Common-style Edittools' lnk.id = 'loadCommonEdittools' lnk.appendChild(document.createTextNode('[load edittools]')) lnk.style.cssText = 'float:right' box.appendChild(lnk) } function loadCommonTools(){ importScript('MediaWiki:Scripts/Edittools.js') var lnk = document.getElementById('loadCommonEdittoos') if (lnk) lnk.parentNode.removeChild(lnk) } if (doneOnloadHook) createEdittoolsLink() else addOnloadHook(createEdittoolsLink) //Add Insert Buttons function addInsertButton(img, speedTip, tagOpen, tagClose, sampleText){ mwCustomEditButtons[mwCustomEditButtons.length] = {'imageFile': 'http://www.spankingforum.nl/wiki/images' + img, 'speedTip': speedTip, 'tagOpen': tagOpen, 'tagClose': tagClose, 'sampleText': sampleText}; } addInsertButton('http://www.spankingforum.nl/wiki/skins/common/images/link-up.png','#Redirect [[',']]',''); //+ buttons addInsertButton('http://www.spankingforum.nl/wiki/skins/common/images/link-up.png',' — ','—','',''); addInsertButton('http://www.spankingforum.nl/wiki/skins/common/images/link-up.png','Category','[[Category:',']]',''); //</nowiki>