18,909
edits
m (→Defining new buttons: wording/formatting) |
(→Re-ordering the buttons: wording) |
||
Line 171: | Line 171: | ||
==Re-ordering the buttons== | ==Re-ordering the buttons== | ||
XEB parses a string variable called <tt>XEBOrder</tt> to know which buttons to place in the toolbar in which order. If there is no <tt>XEBOrder</tt> | XEB parses a string variable called <tt>XEBOrder</tt> to know which buttons to place in the toolbar in which order. If there is no string passed in to set <tt>XEBOrder</tt>, it uses its own hardcoded value in order to provide a default editing toolbar. To set this variable and get your own custom toolbar, you use a custom JavaScript page under your user name, such as [[Special:MyPage/monobook.js|User:YourName/monobook.js]] or [[Special:MyPage/vector.js|User:YourName/vector.js]]. | ||
First, look at the page with | First, look at [[MediaWiki:Common.js/edit.js|the edit.js page]] with XEB's code -- find the <tt>initButtons()</tt> function, and you'll see the default button order (actually called <tt>XEBOrder2</tt>): | ||
<code> | <code> | ||
Line 179: | Line 179: | ||
</code> | </code> | ||
Let's say that you wanted to move the "Insert signature" button from the right to the left side of the toolbar. Looking at the table on the right, you can see that the signature button has the ID "9", so you would add this text to | Let's say that you wanted to move the "Insert signature" button from the right to the left side of the toolbar. Looking at the table on the right, you can see that the signature button has the ID "9", so you would add this text to your custom JS page: | ||
<code> | <code> | ||
XEBOrder="9,0,1,U,F,D,C,D1,4,A,2,3,E,G,8,H"; | XEBOrder="9,0,1,U,F,D,C,D1,4,A,2,3,E,G,8,H"; | ||
Line 185: | Line 185: | ||
</code> | </code> | ||
Notice that the "9" comes first now. You will not see the "Insert signature" button move up in the actual toolbar, however, until your | Notice that the "9" comes first now. You will not see the "Insert signature" button move up in the actual toolbar, however, until your [[wikipedia:WP:BYPASS|cache is cleared]]. Note that you will have to be on a wiki page in editing mode before trying this if you want to see the change take effect before your eyes. | ||
==Adding buttons== | ==Adding buttons== |