Jump to content

MediaWiki:Common.js/edit: Difference between revisions

m
removing note now that we *do* have Cite installed
m (→‎Defining new buttons: less ugly code)
m (removing note now that we *do* have Cite installed)
Line 204: Line 204:
where:
where:


* Code is a code for the button. You should place this code in <tt>XEBOrder</tt> to make your button appear on the toolbar. You can use any text you like. However, it is recommended that you start the code with an underscore to make sure it doesn't clash with any future standard XEB buttons. This must be in upper case letters.
* <tt>CODE</tt> is a code for the button. You should place this code in <tt>XEBOrder</tt> to make your button appear on the toolbar. You can use any text you like. However, it is recommended that you start the code with an underscore to make sure it doesn't clash with any future standard XEB buttons. This must be in upper case letters.
* URL is the full URL to the button image. You must enter the URL of the image on its own, rather than the Wikimedia page that describes the button, so use: [http://wiki.oni2.net/w/images/e/ec/Button_base.png "http://wiki.oni2.net/w/images/e/ec/Button_base.png"] rather than [http://wiki.oni2.net/File:Button_base.png "http://wiki.oni2.net/File:Button_base.png"] (incidentally, you can use that image as the base for a new button icon).
* <tt>url</tt> is the full URL to the button image. You must enter the URL of the image on its own, rather than the Wikimedia page that describes the button, so use: [http://wiki.oni2.net/w/images/e/ec/Button_base.png "http://wiki.oni2.net/w/images/e/ec/Button_base.png"] rather than [http://wiki.oni2.net/File:Button_base.png "http://wiki.oni2.net/File:Button_base.png"] (incidentally, you can use that image as the base for a new button icon).
* Tooltip is the pop-up tooltip that will appear when the mouse moves over the button.
* <tt>Tooltip</tt> is the pop-up tooltip that will appear when the mouse moves over the button.
* Before is the text to insert before the current cursor location.
* <tt>Before</tt> is the text to insert before the current cursor location.
* After is the text to place after the current cursor location.
* <tt>After</tt> is the text to place after the current cursor location.
* Text is the text that is placed between before and after. If the user has selected text in the edit box when the button is pressed this selected text will be placed between before and after instead.
* <tt>Text</tt> is the text that is placed between before and after. If the user has selected text in the edit box when the button is pressed this selected text will be placed between before and after instead.


This example defines two extra buttons:
This example defines two extra buttons:
Line 223: Line 223:
==Special button instructions==
==Special button instructions==
===Reference Buttons===
===Reference Buttons===
'''These buttons won't work because we don't have the Cite extension installed, so don't bother.''' -- [[User:Iritscen|Iritscen]]
The reference buttons come in two flavors:
 
The reference buttons come in two parts:
# Button 'R' (included by default) includes the basic reference tags.
# Button 'R' (included by default) includes the basic reference tags.
# Button 'R1','R2' and 'R3' allow you to build up a reference in parts. R1 starts a reference. R2 lets you add the reference material and 'R3' finishes the reference. You are likely to want all these buttons or none of them.
# Button 'R1', 'R2' and 'R3' allow you to build up a reference in parts. R1 starts a reference, R2 lets you add the reference material and R3 finishes the reference. You are likely to want all three of these buttons or none of them.


===Smart Table===
===Smart Table===