User talk:Conrad.Irwin/edittools.js

This allows users (for the moment) to add their own sections to the edittools box. It may, in the future, replace the current Edittools methodology and thus greatly reduce the 28KB that is added to each edit page. It works by using XmlHTTPRequest to fetch User:Username/edittools and then, providing the page is correctly formatted, adds the sections to the top of the Edittools dropdown list. To use it you need to add the following to your User:Username/common.js (Special:MyPage/common.js) file. You can then add entries to your User:Username/edittools (Special:MyPage/edittools) file.

An example, if fairly pointless User:edittools, can be found at User:Conrad.Irwin/edittools. The syntax is reasonably straightforward. If you want to be more adventurous, you can wrap groups of &lt;charinsert>s within &lt;span>s so that the line spacing is right, or add links or other text between the sections for clarity. You should note that you cannot include block level elements (p, div, ol, ul, etc.) in this, or it will break in internet explorer.

To include templates, you need to make sure that you have no spaces in the template name, and that you wrap at least one of the opening brackets in &lt;nowiki>. For example.

Future use
It may be possible in the future to have sections for all users that are not initially loaded. This would mean that they have to be requested each time they are used (though I believe they are cached). In order to create such sections, you would need to be a sysop, and the sections should be at Mediawiki:edittools/Section Name. In order to help with server load, and to speed up the sections, you can manually add the sections that you use frequently to your User:Username/edittools. To do this, you need to add To your edittools, though obviously a template can be created so that it becomes.

MediaWiki:Edittools/Section Name
These should not contain the &lt;p> tags, as those are included in the MediaWiki:Edittools proper, and the user pages. Instead they should contain the contents (i.e. the &lt;charinsert>s and any spans or links that are required. Again, and even more importantly here, they must not contain block level elements (p, div, ol, ul, etc.) or it will break internet explorer.

MediaWiki:Edittools
This will contain some of the more common sections, and merely references to the others. Everything should, as now, be wrapped in a &lt;div> For example,  English: {[ en-verb}} French:

= Discussion =

This looks very promising, but I have a question: is there a way to make something not visible on the edit, but still show up when the link is clicked, eg. have it show like, but actually add  ? If not I'll just add a, but having it included would be a great time- and placesaver. Circeus


 * No, at the moment this is just a wrapper for the Mediawiki edittools, so it only supports what they support. I should really devise a better syntax to allow that kind of thing - it comes in very useful for diacritics and other modifiers that it doesn't make sense to display alone. Conrad.Irwin 01:52, 27 July 2008 (UTC)

Above you mention that  will break IE. The next line you say to use   Does this mean the first one is old news and IE has fixed itself, or am I reading it wrong? Amina (sack36) 01:46, 27 July 2008 (UTC)


 * The surrounding &lt;div> must be a div, but it mustn't contain any other divs - hope that's clearer. Conrad.Irwin

Problems
Is this stuff working anylonger? --Harald Khan  Ճ  18:37, 4 October 2010 (UTC)
 * Turns out I simply had to switch from Special:MyPage/monobook.js to Special:MyPage/vector.js. I suppose the introduction at the top should be changed? Njardarlogar 16:37, 3 March 2011 (UTC)
 * Made it so. Mglovesfun (talk) 16:41, 3 March 2011 (UTC)
 * I changed it to Special:MyPage/common.js so that it can work no matter what skin is being used. --Yair rand (talk) 16:43, 3 March 2011 (UTC)

Not working again. Anyone else? Njardarlogar 13:43, 15 May 2011 (UTC)

I too am experiencing problem OrenBochman 17:19, 17 June 2011 (UTC)

It's not working for me either. — Eru·tuon 02:44, 7 April 2016 (UTC)
 * I got it to work by putting js in my common.js. — Eru·tuon 04:37, 7 April 2016 (UTC)

"edittools-"
The string "edittools-" has been added the beginning of each option of the drop-down box:, etc. Is this by design? Can it be changed to lack that prefix? It just makes the drop-down box take up more room on the line. &#x200b;—msh210℠ (talk) 15:25, 11 October 2011 (UTC)