"MediaWiki:Common.js" 修訂間的差異
出自 淡水維基館
(→Jquery) |
小 |
||
行 21: | 行 21: | ||
}); | }); | ||
}); | }); | ||
+ | mw.loader.load( 'jquery.ui.button' ); function my_accordion() { | ||
+ | |||
+ | jQuery( "#button" ).accordion({ collapsible: true, active: false }); | ||
+ | } jQuery( my_button); |
於 2013年10月6日 (日) 11:34 的修訂
/* 此處的JavaScript將載入於所有用戶每一個頁面。 */ jQuery(document).ready(function ($) { $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'advanced', group: 'format', tools: { buttonId: { label: 'Comment visible only for editors', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/f/f9/Toolbaricon_regular_S_stroke.png', action: { type: 'encapsulate', options: { pre: "<!-- ", peri: "Insert comment here", post: " -->" } } } } }); }); mw.loader.load( 'jquery.ui.button' ); function my_accordion() { jQuery( "#button" ).accordion({ collapsible: true, active: false }); } jQuery( my_button);