MediaWiki:Editpage.js
出自Meshal Lite
(修订版本间的差异)
第48行: | 第48行: | ||
addInsertButton( 'button_img.png', 'Image Files under /liteimg', '{{img|', '}}', 'sample.jpg'); | addInsertButton( 'button_img.png', 'Image Files under /liteimg', '{{img|', '}}', 'sample.jpg'); | ||
addInsertButton( 'button_eximg.png', 'External Image Files on internet', '{{eximg|', '}}', 'http://www.sample.com/sample.jpg'); | addInsertButton( 'button_eximg.png', 'External Image Files on internet', '{{eximg|', '}}', 'http://www.sample.com/sample.jpg'); | ||
+ | addInsertButton( 'button_imglink.png', 'URL masked with image', '{{imglink|', '|page}}', 'sample.jpg'); | ||
// tables | // tables |
在2018年3月26日 (一) 10:13所做的修订版本
// <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:loadCommonsTools()'; lnk.title = 'Load Commons-style Edittools'; lnk.id = 'loadCommonsEdittoos'; lnk.appendChild(document.createTextNode('[load edittools]')); lnk.style.cssText = 'float:right'; box.appendChild(lnk); } function loadCommonsTools(){ importScript('MediaWiki:Scripts/Edittools1.js'); var lnk = document.getElementById('loadCommonsEdittoos'); 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': '//www.necroz.com/liteimg/' + img, 'speedTip': speedTip, 'tagOpen': tagOpen, 'tagClose': tagClose, 'sampleText': sampleText }; } // Customized Quickedit Buttons // addInsertButton( 'image.ext', 'tips', 'tagopen', 'tagclose', 'sampletext'); // standard addInsertButton( 'button_img.png', 'Image Files under /liteimg', '{{img|', '}}', 'sample.jpg'); addInsertButton( 'button_eximg.png', 'External Image Files on internet', '{{eximg|', '}}', 'http://www.sample.com/sample.jpg'); addInsertButton( 'button_imglink.png', 'URL masked with image', '{{imglink|', '|page}}', 'sample.jpg'); // tables addInsertButton( 'button_tab.png', 'Universal Table Frame', '\n{{tab}}\n', '\n|}\n', ''); addInsertButton( 'button_tabsort.png', 'Sortable Table Frame', '\n{{tab_sort}}\n', '\n|}\n', ''); addInsertButton( 'button_tab_collapse.png', 'Collapsible Table Frame', '\n{{tab_collapse|', '}}\n|\n|}\n', 'TableName'); // Edits and Templates addInsertButton( 'button_callpage.png', 'Embed a Page', '{{:', '}}', 'PageName'); addInsertButton( 'button_groupshow.png', 'Grand Permission to Specific Usergroup to Read the Contents', '{{groupshow|sysop|', '\n}}', 'ContentsToHide'); addInsertButton( 'button_nowiki.png', 'nowiki', '<nowiki>', '</nowiki>', 'Codes in this pair of tag won\'t be parsed as wiki codes'); addInsertButton( 'button_includeonly.png', 'Includeonly Tag', '<includeonly>', '</includeonly>', 'Codes that be included only'); addInsertButton( 'button_noinclude.png', 'Noinclude Tag', '<noinclude>', '</noinclude>', 'Codes that not be included'); addInsertButton( 'button_source.png', 'Render Source Codes', '<source lang="', '">\n\n</source>', 'Codes Language'); addInsertButton( 'button_code.png', 'Inline Code', '<code>', '</code>', 'Code'); addInsertButton( 'button_redirect.png', 'Redirect', '#REDIRECT [[', ']]', 'DestinationPage'); addInsertButton( 'button_category_plus.png', 'Category', '[[category:', ']]', 'CategoryName'); addInsertButton( 'button_category_tree.png', 'Insert a Category Tree', '{{categorytree|', '}}', 'RootCategory'); addInsertButton( 'button_subpage.png', 'Insert a Subpage', '{{subst:subpage|', '}}', 'SubpageTitle'); // </nowiki>