Revision as of 12:24, 6 March 2007 editMarkS (talk | contribs)6,561 editsm →Simple Install: Reassure users this is all that is need.← Previous edit | Latest revision as of 17:20, 8 May 2022 edit undoQwerfjkl (bot) (talk | contribs)Bots, Mass message senders4,013,301 editsm Replaced deprecated <source> tags with <syntaxhighlight>Tag: AWB | ||
(66 intermediate revisions by 36 users not shown) | |||
Line 1: | Line 1: | ||
{{User:MarkS/XEB/Nav}} | |||
'''Extra edit buttons''' allows the user to change the buttons on the top of the edit panel. The main features are: | '''Extra edit buttons''' allows the user to change the buttons on the top of the edit panel. The main features are: | ||
* Ability to add buttons to the toolbar. Extra Edit buttons makes a large number of extra buttons available to the user. Simply including the script will add a set of extra buttons to your toolbar. | * Ability to add buttons to the toolbar. Extra Edit buttons makes a large number of extra buttons available to the user. Simply including the script will add a set of extra buttons to your toolbar. | ||
Line 6: | Line 4: | ||
* The option to remove the standard buttons | * The option to remove the standard buttons | ||
* The option to include extra user defined buttons. | * The option to include extra user defined buttons. | ||
* Popup dialog boxes to easily customise the markup code that is entered. | |||
] | |||
] | |||
==Supported Browsers== | ==Supported Browsers== | ||
I normally test Extra Edit buttons: | I normally test Extra Edit buttons: | ||
* ] (Windows XP |
* ] (Windows XP esx5) | ||
* ] (Windows XP SP2) | * ] (Windows XP SP2) | ||
* ] (Windows XP SP2)<!-- Im ruby, and i am implementing mediawiki in my org, I have tested all extra buttons in IE-6--Thanks --> | |||
* ] (Windows XP SP2). | |||
* ] (Windows XP SP2). | |||
* ] (Windows) v3.0.1 onwards | |||
The code will normally be tweaked to ensured that it works fully on these browsers. | The code will normally be tweaked to ensured that it works fully on these browsers. | ||
I may sometimes test on: | I may sometimes test on: | ||
* SeaMonkey (Windows XP SP2) | |||
* Firefox on Linux (]). | * Firefox on Linux (]). | ||
* ] (Ubunutu) | * ] (Ubunutu) | ||
* Earlier version of IE |
* Earlier version of IE | ||
==Users== | |||
I cannot test on: | |||
* Safari (or anything else which runs on MAC OS). If you are willing to test Extra Edit Buttons on MAC OS then please get in touch. | |||
A list of users of XEB is kept at ]. The list will be used to help contact interested parties in the event of new features/radical changes/problems. XEB will work whether or not you are on the list of users. | |||
==Installing== | ==Installing== | ||
Line 28: | Line 31: | ||
===Simple Install=== | ===Simple Install=== | ||
For extra edit page buttons, put the following code in your ], replacing "monobook" with the name of your skin, in all lowercase (using "standard" for Classic skin). | For extra edit page buttons, put the following code in your ], replacing "monobook" with the name of your skin, in all lowercase (using "standard" for Classic skin). | ||
<syntaxhighlight lang=javascript> | |||
<pre> | |||
{{subst:js|User:MarkS/extraeditbuttons.js}} | {{subst:js|User:MarkS/extraeditbuttons.js}} | ||
</syntaxhighlight> | |||
</pre> | |||
Once this has been done, refresh Misplaced Pages in your browser (select Refresh or Reload) and the new buttons will be available on your toolbar. You do not need to do anything further. If after using the extra edit buttons for some time you wish to alter the buttons available or the order of the buttons then please read the more detailed instructions below. | Once this has been done, refresh Misplaced Pages in your browser (select Refresh or Reload) and the new buttons will be available on your toolbar. You do not need to do anything further. If after using the extra edit buttons for some time you wish to alter the buttons available or the order of the buttons then please read the more detailed instructions below. | ||
===Customised Install=== | ===Customised Install=== | ||
To fully customise extra edit buttons then add the following code to your ], replacing "monobook" with the name of your skin, in all lowercase (using "standard" for Classic skin). | To fully customise extra edit buttons then add the following code to your ], replacing "monobook" with the name of your skin, in all lowercase (using "standard" for Classic skin). | ||
<syntaxhighlight lang=javascript> | |||
<pre> | |||
XEBOrder='A,B,C,D'; | XEBOrder='A,B,C,D'; | ||
rmEditButtons=; | rmEditButtons=; | ||
myButtons=; | myButtons=; | ||
{{subst:js|User:MarkS/extraeditbuttons.js}} | {{subst:js|User:MarkS/extraeditbuttons.js}} | ||
</syntaxhighlight> | |||
</pre> | |||
Note: | Note: | ||
* XEBOrder specifies which buttons to display and the order in which to display them | * XEBOrder specifies which buttons to display and the order in which to display them | ||
* rmEditButtons lists the standard buttons to remove | * rmEditButtons lists the standard buttons to remove (use <code>rmEditButtons=</code> to remove them all) | ||
* myButtons lists extra buttons which you wish to use with extra edit buttons. | * myButtons lists extra buttons which you wish to use with extra edit buttons. | ||
If you don't add one or more of these variables to your monobook.js then extra edit buttons will still work. | If you don't add one or more of these variables to your monobook.js then extra edit buttons will still work. | ||
== |
==The buttons== | ||
Extra edit buttons includes the buttons listed below. Those marked as standard are added to your toolbar if you install XEB. The remaining buttons can be included by using the XEBOrder option (see below). | |||
A list of users of XEB is kept at ]. The list will be used to help contact interested parties in the event of new features/radical changes/problems. XEB will work whether or not you are on the list of users. | |||
==The buttons== | |||
You can also specify completely new buttons to be included using the myButtons option (see below). | |||
The buttons are: | |||
{| border='1' class="wikitable sortable" | {| border='1' class="wikitable sortable" | ||
Line 65: | Line 65: | ||
!| Icon || Name || Standard || Code || Popup || Comments / What is shown when editing | !| Icon || Name || Standard || Code || Popup || Comments / What is shown when editing | ||
|- | |- | ||
| || Bold || || 0 || || | | ] || Bold || || 0 || || <nowiki>'''Bold text'''</nowiki> | ||
|- | |- | ||
| || Italic || || 1 || || | | ] || Italic || || 1 || || <nowiki>''Italic text''</nowiki> | ||
|- | |- | ||
| || Wiki link || || 2 || || | | ] || Wiki link || || 2 || || <nowiki>]</nowiki> | ||
|- | |- | ||
| || Web link || || 3 || || | | ] || Web link || || 3 || || <nowiki></nowiki> | ||
|- | |- | ||
| || Heading || || 4 || || | | ] || Heading || || 4 || || <nowiki>== Headline text ==</nowiki> | ||
|- | |- | ||
| || Image || || 5 || || | | ] || Image || || 5 || || <nowiki>]</nowiki> | ||
|- | |- | ||
| || Media File Link || || 6 || || | | ] || Media File Link || || 6 || || <nowiki>]</nowiki> | ||
|- | |- | ||
| || Mathematical Formula || || 7 || || | | ] || Mathematical Formula || || 7 || || <nowiki><math>Insert formula here</math></nowiki> | ||
|- | |- | ||
| ] || No Wiki || || 8 || || <nowiki><nowiki>Insert non-formatted text here</nowiki></nowiki> | |||
| || Wiki link || || 8 || || | |||
|- | |- | ||
| || |
| ] || Signature || || 9 || || <nowiki>-- ~~~~</nowiki> | ||
|- | |- | ||
| || |
| ] || Horizontal Line || || 10 || || <nowiki>----</nowiki> | ||
|- | |||
| ] || Button redirect || || 11 || || <nowiki>#REDIRECT ]</nowiki> | |||
|- | |- | ||
| ] || Secondary Headline || * ||A || || <nowiki> | | ] || Secondary Headline || * ||A || || <nowiki> | ||
Line 100: | Line 102: | ||
</div></nowiki> | </div></nowiki> | ||
|- | |- | ||
| ] || Align Right || * ||D1 || || <nowiki><div style="text-align: |
| ] || Align Right || * ||D1 || || <nowiki><div style="text-align: right; direction: ltr; margin-left: 1em;"> | ||
Right-aligned text | Right-aligned text | ||
</div></nowiki> | </div></nowiki> | ||
Line 116: | Line 118: | ||
| ] || Small text || * ||J1 || || <nowiki><small>Small Text</small></nowiki> | | ] || Small text || * ||J1 || || <nowiki><small>Small Text</small></nowiki> | ||
|- | |- | ||
| ] || Insert table|| * ||E |
| ] || Insert table|| * ||E|| ] || Displays a popup allow the user to set the type of table they want. Typical markup inserted: | ||
<nowiki>{| class="wikitable"</nowiki><br /> | <nowiki>{| class="wikitable"</nowiki><br /> | ||
Line 161: | Line 163: | ||
| ] || Comment || * ||H || || <nowiki><!--Comment--></nowiki> | | ] || Comment || * ||H || || <nowiki><!--Comment--></nowiki> | ||
|- | |- | ||
| ] || Insert code || * ||O || || <nowiki><code>Code</code></nowiki> | | ] || Insert code || * ||O || || <nowiki><code>Code</code></nowiki> | ||
|- | |- | ||
| ] || Reference (see below) || * ||R || || <nowiki><ref>Insert reference material</ref></nowiki> | | ] || Reference (see below) || * ||R ||] || <nowiki><ref>Insert reference material</ref></nowiki> | ||
|- | |- | ||
| ] || Add a template || * ||T || || <nowiki>{{Template name}}</nowiki> | | ] || Add a template || * ||T || || <nowiki>{{Template name}}</nowiki> | ||
Line 214: | Line 216: | ||
| ] || Advanced image || ||AI || || <nowiki>]</nowiki> | | ] || Advanced image || ||AI || || <nowiki>]</nowiki> | ||
|- | |- | ||
| ] || Geo link || || GEO || Yes || Displays a popup to enter latitude and longitude, type of place (landmark, city ...). The popup then inserts the relevant coor template | | ] || Geo link || || GEO || ] || Displays a popup to enter latitude and longitude, type of place (landmark, city ...). The popup then inserts the relevant coor template | ||
|} | |} | ||
Line 232: | Line 234: | ||
You can change the order of the buttons and which buttons are displayed by creating a Javascript variable XEBOrder. Set this variable equal to a string containing each button's code separated by commas. The order of the buttons in XEBOrder is the order they are displayed on the toolbar. For example: | You can change the order of the buttons and which buttons are displayed by creating a Javascript variable XEBOrder. Set this variable equal to a string containing each button's code separated by commas. The order of the buttons in XEBOrder is the order they are displayed on the toolbar. For example: | ||
<syntaxhighlight lang=javascript> | |||
<pre> | |||
XEBOrder="A,B,C,E,G,I1,I2,R1,R2,R4,T1,Y1,Y2,Z,AI,N"; | XEBOrder = "A,B,C,E,G,I1,I2,R1,R2,R4,T1,Y1,Y2,Z,AI,N"; | ||
mw.loader.load( 'http://en.wikipedia.org/search/?title=User:MarkS/Extra edit buttons/dev.js' | |||
document.write('<script type="text/javascript" src="' | |||
+ '&action=raw&ctype=text/javascript' ); | |||
+ 'http://en.wikipedia.org/search/?title=User:MarkS/Extra edit buttons/dev.js' | |||
</syntaxhighlight> | |||
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); | |||
</pre> | |||
===Removing buttons: rmEditButtons=== | ===Removing buttons: rmEditButtons=== | ||
rmEditButtons is an array which lists the index numbers of the standard buttons you wish to remove. For example: | rmEditButtons is an array which lists the index numbers of the standard english wikipedia buttons you wish to remove. For example: | ||
<syntaxhighlight lang=javascript> | |||
<pre> | |||
rmEditButtons= | rmEditButtons= | ||
</syntaxhighlight> | |||
</pre> | |||
will remove buttons 0 and 2 from your toolbar. | will remove buttons 0 and 2 from your toolbar. | ||
<syntaxhighlight lang=javascript> | |||
<pre> | |||
rmEditButtons= | rmEditButtons= | ||
</syntaxhighlight> | |||
</pre> | |||
will remove all the standard buttons from your toolbar. You may wish to use this option if you want to fully customise the toolbar and specify where the standard buttons appear in the toolbar. | will remove all the standard buttons from your toolbar. You may wish to use this option if you want to fully customise the toolbar and specify where the standard buttons appear in the toolbar. | ||
rmEditButtons can only remove buttons that Misplaced Pages itself places on your toolbar. These buttons have numbered IDs. IF you wish to remove buttons from the default extra buttons supplied by XEB then you must use the XEBOrder variable and specify all the buttons you want XEB to add to your toolbar. | |||
==Standard Misplaced Pages buttons== | |||
===Standard Misplaced Pages buttons=== | |||
The Wikimedia software used to power Misplaced Pages provides 10 standard buttons. The English version of Misplaced Pages then provides a further 11 standard buttons. These 21 buttons are the default toolbar shown to users. XEB provides access to these buttons using numeric codes starting from 0 (so Bold is 0, Italic is 1). You can use these codes in two ways: (i) You can include them in XEBOrder to make a standard button appear somewhere else in the toolbar, (ii) You can use then in rmEditButtons to stop wikipedia displaying them. In this way you can customise the whole toolbar. | The Wikimedia software used to power Misplaced Pages provides 10 standard buttons. The English version of Misplaced Pages then provides a further 11 standard buttons. These 21 buttons are the default toolbar shown to users. XEB provides access to these buttons using numeric codes starting from 0 (so Bold is 0, Italic is 1). You can use these codes in two ways: (i) You can include them in XEBOrder to make a standard button appear somewhere else in the toolbar, (ii) You can use then in rmEditButtons to stop wikipedia displaying them. In this way you can customise the whole toolbar. | ||
===User defined buttons: myButtons=== | === User defined buttons: myButtons === | ||
XEB can also work with extra buttons created by the user. To do this you must define the myButtons variable in ]. The format of myButtons is: | XEB can also work with extra buttons created by the user. To do this you must define the myButtons variable in ]. The format of myButtons is: | ||
<syntaxhighlight lang=javascript> | |||
<pre> | |||
myButtons={' |
myButtons={'_CODE1':, | ||
' |
'_CODE2':}; | ||
</syntaxhighlight> | |||
</pre> | |||
where: | where: | ||
* Code is a code for the button. You should place this code in XEBOrder 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. | * Code is a code for the button. You should place this code in XEBOrder 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: rather than | * 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: rather than | ||
* ToolTip is the popup tooltip that will appear when the mouse moves over the button. | * ToolTip is the popup tooltip that will appear when the mouse moves over the button. | ||
Line 279: | Line 282: | ||
This example defines two extra buttons: | This example defines two extra buttons: | ||
<syntaxhighlight lang=javascript> | |||
<pre> | |||
myButtons={'_ZZ':, | myButtons={'_ZZ':, | ||
'_ZA':}; | '_ZA':}; | ||
</syntaxhighlight> | |||
</pre> | |||
For more examples and usable buttons, see the ''']''' made by ]. | |||
==== Pictures for myButtons ==== | |||
This is the list of buttons we know of so far (the list below includes the standard buttons). Buttons used by the 'extra buttons' have captions. Please upload any new buttons you find to the ] and add them to the gallery below (in alphabetical image order, so we can find duplicates and easily know what is there). Buttons not in Commons cat are tagged as MOVE TO COMMONS (please upload them to Commons and remove the tag from the gallery). The list as of now may contain duplicates, images not upload to commons and images at commons not at category — please help fix it! | |||
====Pictures for myButtons==== | |||
This is the list of buttons we know of so far (the list below includes the standard buttons). Buttons used by the 'extra buttons' have captions. Please upload any new buttons you find to the ] and add them to the gallery below (in alphabetical image order, so we can find duplicates and easily know what is there). Buttons not in Commons cat are tagged as MOVE TO COMMONS (please upload them to Commons and remove the tag from the gallery). The list as of now may contain duplicates, images not upload to commons and images at commons not at category - please help fix it! | |||
<gallery> | <gallery> | ||
Line 323: | Line 329: | ||
Image:Button check.png | Image:Button check.png | ||
Image:Button class text.png | Image:Button class text.png | ||
Image:Button |
Image:Button code1.png| Insert code MOVE TO COMMONS | ||
Image:Button comillas latinas.png | Image:Button comillas latinas.png | ||
Image:Button comment.png| Comment | Image:Button comment.png| Comment | ||
Line 341: | Line 347: | ||
Image:Button dagger.png | Image:Button dagger.png | ||
Image:Button definition list.png|Definition list MOVE TO COMMONS | Image:Button definition list.png|Definition list MOVE TO COMMONS | ||
Image:Button delete |
Image:Button delete.png | ||
Image:Button delete.png | Image:Button delete.png | ||
Image:Button desambig.png | Image:Button desambig.png | ||
Line 353: | Line 359: | ||
Image:Button exclamation 2.png | Image:Button exclamation 2.png | ||
Image:Button fairuse.png | Image:Button fairuse.png | ||
Image:Button fait.png | |||
Image:Button find.png | Image:Button find.png | ||
Image:Button flamme.png | Image:Button flamme.png | ||
Line 404: | Line 410: | ||
Image:Button plantilla.png|Add a template | Image:Button plantilla.png|Add a template | ||
Image:Button plume.png | Image:Button plume.png | ||
Image: |
Image:Button_plume.pngButton plume 1.png | ||
Image:Button poeme.png | Image:Button poeme.png | ||
Image:Button polytonique.png | Image:Button polytonique.png | ||
Line 417: | Line 423: | ||
Image:Button rediriger.png | Image:Button rediriger.png | ||
Image:Button references alt.png | Image:Button references alt.png | ||
Image:Button references2.png | Image:Button references2 new.png | ||
Image:Button reflink.png|Reference | Image:Button reflink.png|Reference | ||
Image:Button reflink advanced 2.png|Add reference material | Image:Button reflink advanced 2.png|Add reference material | ||
Line 445: | Line 451: | ||
Image:Button support.png | Image:Button support.png | ||
Image:Button tachar.png | Image:Button tachar.png | ||
Image:Button template.png | |||
Image:Button template alt.png|Reference footer | Image:Button template alt.png|Reference footer | ||
Image:Button templatelink.png | Image:Button templatelink.png | ||
Line 493: | Line 499: | ||
Image:Icono seguimiento.png | Image:Icono seguimiento.png | ||
Image:Image icon.png | Image:Image icon.png | ||
Image: |
Image:Button_link.png | ||
Image:Italic icon.png | Image:Italic icon.png | ||
Image:Math icon.png | Image:Math icon.png | ||
Line 511: | Line 517: | ||
Image:Tt icon.png | Image:Tt icon.png | ||
Image:WP-icon.png | Image:WP-icon.png | ||
Image:Button RSS.png | |||
</gallery> | </gallery> | ||
==Popups== | |||
From the ] ] XEB includes popups on a number of buttons. Popups are dialog boxes that float over the web page when you click on the button. The dialog boxes are to make it easier to customise in more detail the markup code that gets entered. | |||
The popups currently available are: | |||
{| class="wikitable" | |||
|- | |||
! Button Code | |||
! Button Description | |||
! Comment | |||
|- | |||
| GEO | |||
| GEO Link | |||
| Allows the user to set: | |||
* Latitude and Longitude. You can enter just the degrees, the degrees and minutes or the degrees, minutes and seconds. | |||
* Should the location appear in the title bar or in the middle of the page | |||
* The type of location (city/landmark...). | |||
* The region of the location | |||
The popup then generates a coor template. | |||
|- | |||
| E | |||
| Table | |||
| Allows the user to set: | |||
* Number of rows | |||
* Number of columns | |||
* If the table is sortable | |||
* Whether or not a title row is required. | |||
|- | |||
| AI | |||
| Advanced Image | |||
| Allows the user to set: | |||
* Image Size | |||
* Image location | |||
* Image caption | |||
* Image URL | |||
|- | |||
| R | |||
| Reference | |||
| Allows the user to set: | |||
* The name of the footnote | |||
* The text of the footnote | |||
|} | |||
==Requests== | ==Requests== | ||
Line 531: | Line 582: | ||
*] 2006 All toolbar buttons (XEB and standard buttons) are now fully customizable. Changes to the timing of when the buttons are setup. Users can now defined their own buttons. Ability to remove some or all of the standard buttons. Order of standard Misplaced Pages buttons can changed. | *] 2006 All toolbar buttons (XEB and standard buttons) are now fully customizable. Changes to the timing of when the buttons are setup. Users can now defined their own buttons. Ability to remove some or all of the standard buttons. Order of standard Misplaced Pages buttons can changed. | ||
*] ] Major upgrade. XEB now features popups on some of the buttons. These display a dialog box to complete with parameters. The markup code then depends on the inserted text. | *] ] Major upgrade. XEB now features popups on some of the buttons. These display a dialog box to complete with parameters. The markup code then depends on the inserted text. | ||
*] ]. Quick update to fix a bug. It looks as if the order of items in the array which stores the mediaWiki standard buttons has changed. When these were copied to XEB then the URL of the image ended up as the popup text. This quick update copies the info a different way. The bug only affect people who reused the standard MediaWiki buttons elsewhere in the toolbar. | |||
*] ]. Update to the way text from popups is inserted into the page. This mainly affects IE which had problems putting the text in right place after Misplaced Pages's edit box had lost focus. Version: 3.1 | |||
==Development Versions== | ==Development Versions== | ||
Line 537: | Line 590: | ||
If trying out your own changes then you can use the test version or you may find it easier to take a copy of the live code and create a test version under your userpages. Change the reference in your monobook.js to this test version. Then try out your changes. Once your changes have been made and tested then either update the live code or ask me. Note: When I update the live version I usually test in IE7, Opera and Firefox (Windows versions). | If trying out your own changes then you can use the test version or you may find it easier to take a copy of the live code and create a test version under your userpages. Change the reference in your monobook.js to this test version. Then try out your changes. Once your changes have been made and tested then either update the live code or ask me. Note: When I update the live version I usually test in IE7, Opera and Firefox (Windows versions). | ||
==Installing XEB on your own Wiki== | |||
Installing XEB on setups other than Misplaced Pages is not something that is supported. However, the steps may help: | |||
#You will need your own setup of the MediaWiki software. This is not something I can help you with. However, I have used ] and found it easy to setup. I have also installed XEB on it. | |||
#You must enable users to run Javascript by setting $wgAllowUserJS to true in LocalSettings.php (see: ) | |||
#For the simplest install create a user called MarkS (or see below at 6). | |||
#Copy the XEB script from ] to the same location on your wiki | |||
#Copy the XEB css from ] to the same location on your wiki | |||
#Get users to include the script by editing their monobook.js. (Note: The easiest way to do this without creating a user MarkS is adding an accordant line in .php (the php of your skin)!) You might be able to do this the same way that it works on Misplaced Pages (see the top of this article). Alternatively use the following lines (changing the URL as necessary): | |||
<syntaxhighlight lang=javascript> | |||
importScriptURI('//en.wikipedia.org/search/?title=User:MarkS/extraeditbuttons.js&action=raw&ctype=text/javascript'); | |||
</syntaxhighlight> | |||
:7. Once the script is running you should move the images from MediaWiki to your own wiki (unless you have enabled ], in which case you won't have to). | |||
There may be other ways to install the script. For example it could be installed in common.js which would provide the script to all users. I have never tried this. | |||
==Credits== | ==Credits== | ||
Line 545: | Line 615: | ||
* ] for converting some GIF images to PNG images | * ] for converting some GIF images to PNG images | ||
] | ] | ||
<!--interwiki--> | <!--interwiki--> |
Latest revision as of 17:20, 8 May 2022
Extra edit buttons allows the user to change the buttons on the top of the edit panel. The main features are:
- Ability to add buttons to the toolbar. Extra Edit buttons makes a large number of extra buttons available to the user. Simply including the script will add a set of extra buttons to your toolbar.
- The option to change the order of the buttons.
- The option to remove the standard buttons
- The option to include extra user defined buttons.
- Popup dialog boxes to easily customise the markup code that is entered.
Supported Browsers
I normally test Extra Edit buttons:
- Firefox (Windows XP esx5)
- Internet Explorer 7 (Windows XP SP2)
- Internet Explorer 6 (Windows XP SP2)
- Opera (Windows XP SP2).
- Safari (Windows) v3.0.1 onwards
The code will normally be tweaked to ensured that it works fully on these browsers.
I may sometimes test on:
Users
A list of users of XEB is kept at List of users. The list will be used to help contact interested parties in the event of new features/radical changes/problems. XEB will work whether or not you are on the list of users.
Installing
Simple Install
For extra edit page buttons, put the following code in your monobook.js, replacing "monobook" with the name of your skin, in all lowercase (using "standard" for Classic skin).
{{subst:js|User:MarkS/extraeditbuttons.js}}
Once this has been done, refresh Misplaced Pages in your browser (select Refresh or Reload) and the new buttons will be available on your toolbar. You do not need to do anything further. If after using the extra edit buttons for some time you wish to alter the buttons available or the order of the buttons then please read the more detailed instructions below.
Customised Install
To fully customise extra edit buttons then add the following code to your monobook.js, replacing "monobook" with the name of your skin, in all lowercase (using "standard" for Classic skin).
XEBOrder='A,B,C,D'; rmEditButtons=; myButtons=; {{subst:js|User:MarkS/extraeditbuttons.js}}
Note:
- XEBOrder specifies which buttons to display and the order in which to display them
- rmEditButtons lists the standard buttons to remove (use
rmEditButtons=
to remove them all) - myButtons lists extra buttons which you wish to use with extra edit buttons.
If you don't add one or more of these variables to your monobook.js then extra edit buttons will still work.
The buttons
Extra edit buttons includes the buttons listed below. Those marked as standard are added to your toolbar if you install XEB. The remaining buttons can be included by using the XEBOrder option (see below).
You can also specify completely new buttons to be included using the myButtons option (see below).
Icon | Name | Standard | Code | Popup | Comments / What is shown when editing |
---|---|---|---|---|---|
Bold | 0 | '''Bold text''' | |||
Italic | 1 | ''Italic text'' | |||
Wiki link | 2 | ] | |||
Web link | 3 | ||||
Heading | 4 | == Headline text == | |||
Image | 5 | ] | |||
Media File Link | 6 | ] | |||
Mathematical Formula | 7 | <math>Insert formula here</math> | |||
No Wiki | 8 | <nowiki>Insert non-formatted text here</nowiki> | |||
Signature | 9 | -- ~~~~ | |||
Horizontal Line | 10 | ---- | |||
Button redirect | 11 | #REDIRECT ] | |||
Secondary Headline | * | A | ===Secondary headline=== | ||
Line break | B | <br /> | |||
Align left | * | D | <div style="text-align: left; direction: ltr; margin-left: 1em;"> Left-aligned text </div> | ||
Centred text | * | C | <div style="text-align: center;"> Centred text </div> | ||
Align Right | * | D1 | <div style="text-align: right; direction: ltr; margin-left: 1em;"> Right-aligned text </div> | ||
Coloured text | * | F | <span style="color: ColourName">Coloured text</span> | ||
Underline | * | U | <u>Underlined text</u> | ||
Strike through text | * | S | <s>Struck out text</s> | ||
Superscript | I1 | <sup></sup> | |||
Subscript | I2 | <sub>Subscript text</sub> | |||
Small text | * | J1 | <small>Small Text</small> | ||
Insert table | * | E | Yes | Displays a popup allow the user to set the type of table they want. Typical markup inserted:
{| class="wikitable" | |
Insert a gallery | * | G | <gallery> Image:M63.jpg|] Image:Mona Lisa.jpg|] Image:Truite arc-en-ciel.jpg|A ] </gallery> | ||
Definition list | * | Q |
; Definition | ||
Numbered list | * | W |
# Element 1 | ||
Bulleted list | * | X |
* Element 1 | ||
Category | * | K | ] | ||
Tabs | * | L | : | ||
Block quote text | * | M | <blockquote style="border: 1px solid blue; padding: 2em;"> Block quote </blockquote> | ||
Comment | * | H | <!--Comment--> | ||
Insert code | * | O | <code>Code</code> | ||
Reference (see below) | * | R | Yes | <ref>Insert reference material</ref> | |
Add a template | * | T | {{Template name}} | ||
Redirect | V | #REDIRECT ] | |||
Unsigned post | FS | {{subst:unsigned|user name or IP|date}} | |||
Big text | J2 | <big>Big text</big> | |||
Non breaking space | N | ||||
Pre formatted text | P | <pre>Pre formatted text</pre> | |||
Link to a sub page | P1 | ] | |||
Start a reference (see below) | R1 | <ref name="Reference name | |||
Add reference material (see below) | R2 | ||||
End a reference (see below) | R3 | ||||
Reference footer | R4 |
==Notes== | |||
Teletype text | T1 | <tt>Teletype Text</tt> | |||
Substitute template | TL | {{subst:tl|Template name}} | |||
Start a table | TS | {| | |||
Table cell | TC | | | |||
Table row | TR | |- | |||
End a table | TE | |} | |||
No include | Y1 | <noinclude>Text</noinclude> | |||
Include only | Y2 | <includeonly>Text</includeonly> | |||
Substitute | Z | {{subst:Template}} | |||
Advanced image | AI | ] | |||
Geo link | GEO | Yes | Displays a popup to enter latitude and longitude, type of place (landmark, city ...). The popup then inserts the relevant coor template |
By default only buttons with a "*" in the standard column are displayed. This is keeps the total number of buttons down and avoids showing the more complex buttons in the default arrangement. To show the extra (non-default) buttons or alter the order of the buttons are showed see the section below 'Changing the layout').
Reference Buttons
The reference buttons come in two parts:
- 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
Changing the layout: XEBOrder
XEB displays the standard buttons in the order listed above automatically.
You can change the order of the buttons and which buttons are displayed by creating a Javascript variable XEBOrder. Set this variable equal to a string containing each button's code separated by commas. The order of the buttons in XEBOrder is the order they are displayed on the toolbar. For example:
XEBOrder = "A,B,C,E,G,I1,I2,R1,R2,R4,T1,Y1,Y2,Z,AI,N"; mw.loader.load( 'http://en.wikipedia.org/search/?title=User:MarkS/Extra edit buttons/dev.js' + '&action=raw&ctype=text/javascript' );
Removing buttons: rmEditButtons
rmEditButtons is an array which lists the index numbers of the standard english wikipedia buttons you wish to remove. For example:
rmEditButtons=
will remove buttons 0 and 2 from your toolbar.
rmEditButtons=
will remove all the standard buttons from your toolbar. You may wish to use this option if you want to fully customise the toolbar and specify where the standard buttons appear in the toolbar.
rmEditButtons can only remove buttons that Misplaced Pages itself places on your toolbar. These buttons have numbered IDs. IF you wish to remove buttons from the default extra buttons supplied by XEB then you must use the XEBOrder variable and specify all the buttons you want XEB to add to your toolbar.
Standard Misplaced Pages buttons
The Wikimedia software used to power Misplaced Pages provides 10 standard buttons. The English version of Misplaced Pages then provides a further 11 standard buttons. These 21 buttons are the default toolbar shown to users. XEB provides access to these buttons using numeric codes starting from 0 (so Bold is 0, Italic is 1). You can use these codes in two ways: (i) You can include them in XEBOrder to make a standard button appear somewhere else in the toolbar, (ii) You can use then in rmEditButtons to stop wikipedia displaying them. In this way you can customise the whole toolbar.
User defined buttons: myButtons
XEB can also work with extra buttons created by the user. To do this you must define the myButtons variable in your monobook.js. The format of myButtons is:
myButtons={'_CODE1':, '_CODE2':};
where:
- Code is a code for the button. You should place this code in XEBOrder 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://upload.wikimedia.org/wikipedia/commons/f/f0/Bouton_Vandale0.png rather than http://commons.wikimedia.org/Image:Bouton_Vandale0.png
- ToolTip is the popup tooltip that will appear when the mouse moves over the button.
- Before is the text to insert before the current cursor location.
- After 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.
This example defines two extra buttons:
myButtons={'_ZZ':, '_ZA':};
For more examples and usable buttons, see the !voting/discussion buttons made by Willscrlt.
Pictures for myButtons
This is the list of buttons we know of so far (the list below includes the standard buttons). Buttons used by the 'extra buttons' have captions. Please upload any new buttons you find to the commons:Category:MediaWiki edit toolbar and add them to the gallery below (in alphabetical image order, so we can find duplicates and easily know what is there). Buttons not in Commons cat are tagged as MOVE TO COMMONS (please upload them to Commons and remove the tag from the gallery). The list as of now may contain duplicates, images not upload to commons and images at commons not at category — please help fix it!
- Advanced image
- Align left MOVE TO COMMONS
- Align right
- Insert table
- Big txt
- Block quote text MOVE TO COMMONS
- Category
- Centred text MOVE TO COMMONS
- Insert code MOVE TO COMMONS
- Comment
- Definition list MOVE TO COMMONS
- Line break MOVE TO COMMONS
- Coloured text MOVE TO COMMONS
- MOVE TO COMMONS
- MOVE TO COMMONS
- Secondary headline MOVE TO COMMONS
- MOVE TO COMMONS
- Include only
- MOVE TO COMMONS
- Unsigned post
- Non breaking space
- No include
- Add a template
- File:Button plume.pngButton plume 1.png
- Pre formatted text
- Redirect MOVE TO COMMONS
- Reference
- Add reference material
- End a reference
- MOVE TO COMMONS
- Small text MOVE TO COMMONS
- Strike through text MOVE TO COMMONS
- Subscript
- Link to a sub page MOVE TO COMMONS
- Substitute
- Superscript
- Reference footer
- Substitute template
- Underline
- MOVE TO COMMONS
- Numbered list
- Insert a gallery
- Bulleted list
- Teletype text
- Table cell
- End a table
- Table row
- Start a table
- File:Button RSS.png
Popups
From the 6 March 2007 XEB includes popups on a number of buttons. Popups are dialog boxes that float over the web page when you click on the button. The dialog boxes are to make it easier to customise in more detail the markup code that gets entered.
The popups currently available are:
Button Code | Button Description | Comment |
---|---|---|
GEO | GEO Link | Allows the user to set:
The popup then generates a coor template. |
E | Table | Allows the user to set:
|
AI | Advanced Image | Allows the user to set:
|
R | Reference | Allows the user to set:
|
Requests
If you want something extra added or changed then you can:
- Amend the code. Please note: If you amend the main code (User:MarkS/extraeditbuttons.js) then everybody who uses XEB will pick up the change at the same. For this reason you should test changes in a development version (see below) before amending the live code.
- Leave a request on the talk page, ideally with the code you want added.
Changes
- Misplaced Pages has revised how it builds toolbar buttons. Misplaced Pages now seems to build its toolbar buttons through on onload event after the page has loaded. Extra edit buttons overrode this which stopped the buttons working. However, as the buttons are now loading after the page has loaded the extra edit buttons now have to be added first. The choice was either add the buttons before wikipedia's or add them on a separate line. I have gone for a separate line.
- April 25 2006 fundamental changes
- I have removed all the original code which insert HTML into the toolbar and replaced it by filling in the javascript array wmCustomEditButtons. This seems to be the official way to do it and the resulting code is a lot neater.
- June 26 2006 Added 4 extra buttons: template, category, reflink and references
- October 13 2006 Complete rewrite of the code added. Ability to change the order of the buttons and which buttons are shown.
- November 19 2006 Added tl button and updated two images.
- December 13 2006 All toolbar buttons (XEB and standard buttons) are now fully customizable. Changes to the timing of when the buttons are setup. Users can now defined their own buttons. Ability to remove some or all of the standard buttons. Order of standard Misplaced Pages buttons can changed.
- 6 March 2007 Major upgrade. XEB now features popups on some of the buttons. These display a dialog box to complete with parameters. The markup code then depends on the inserted text.
- 8 March 2007. Quick update to fix a bug. It looks as if the order of items in the array which stores the mediaWiki standard buttons has changed. When these were copied to XEB then the URL of the image ended up as the popup text. This quick update copies the info a different way. The bug only affect people who reused the standard MediaWiki buttons elsewhere in the toolbar.
- 28 April 2007. Update to the way text from popups is inserted into the page. This mainly affects IE which had problems putting the text in right place after Misplaced Pages's edit box had lost focus. Version: 3.1
Development Versions
My test version can be found under User:MarkS/Extra edit buttons/dev.js. This version may or may not be different to the live version. You can use this version by updating your monobook.js to use the test version rather than the live version.
If trying out your own changes then you can use the test version or you may find it easier to take a copy of the live code and create a test version under your userpages. Change the reference in your monobook.js to this test version. Then try out your changes. Once your changes have been made and tested then either update the live code or ask me. Note: When I update the live version I usually test in IE7, Opera and Firefox (Windows versions).
Installing XEB on your own Wiki
Installing XEB on setups other than Misplaced Pages is not something that is supported. However, the steps may help:
- You will need your own setup of the MediaWiki software. This is not something I can help you with. However, I have used meta:Wiki on a stick and found it easy to setup. I have also installed XEB on it.
- You must enable users to run Javascript by setting $wgAllowUserJS to true in LocalSettings.php (see: )
- For the simplest install create a user called MarkS (or see below at 6).
- Copy the XEB script from User:MarkS/extraeditbuttons.js to the same location on your wiki
- Copy the XEB css from User:MarkS/XEB/live.css to the same location on your wiki
- Get users to include the script by editing their monobook.js. (Note: The easiest way to do this without creating a user MarkS is adding an accordant line in .php (the php of your skin)!) You might be able to do this the same way that it works on Misplaced Pages (see the top of this article). Alternatively use the following lines (changing the URL as necessary):
importScriptURI('//en.wikipedia.org/search/?title=User:MarkS/extraeditbuttons.js&action=raw&ctype=text/javascript');
- 7. Once the script is running you should move the images from MediaWiki to your own wiki (unless you have enabled InstantCommons, in which case you won't have to).
There may be other ways to install the script. For example it could be installed in common.js which would provide the script to all users. I have never tried this.
Credits
- Brian0918 who supplied the code to English Misplaced Pages from Hebrew Misplaced Pages
- Ingoolemo for supply the code for four of the buttons and the original GIF images (which I converted to PNG)
- Olliminatore for supplying a major rewrite of the code producing something significantly shorter and simpler
- Karl Dickman for converting some GIF images to PNG images