Difference between revisions of "User:King of Herdaz/Toolbar customization"

m
no edit summary
m
 
* Inserting <code>' + '</code> between two pieces of text can have effects on your <code>common.js</code> page (as will be discussed below), but will not appear on a page when the action is called. For example, both <code><nowiki><br /></nowiki></code> and <code><nowiki><' + 'br /></nowiki></code> will produce the same result (<code><nowiki><br /></nowiki></code>) on the page when they are called.
* When writing out templates, whether asfor thea label foror an action or as part of the action itself, you must insert <code>' + '</code> between the first two curly brackets. For example, instead of writing <code><nowiki>{{Stormlight}}</nowiki></code> you should write <code><nowiki>{' + '{Stormlight}}</nowiki></code>. This prevents the template from applying categories to your <code>common.js</code> page and also prevents it from being listed on the relevant template's list of pages that use it.
* For the same reason you must also do this when writing category tags. For example, instead of writing <code><nowiki>[[Category: Stormlight]]</nowiki></code> you should write <code><nowiki>[' + '[Category: Stormlight]]</nowiki></code>.
* When writing code for substitutions this is even more important, since if you do not do it then the substitution will be performed when you save your <code>common.js</code> page. For example, instead of writing <code><nowiki>{{SUBST:PAGENAME}}</nowiki></code> you should write <code><nowiki>{' + '{SUBST:PAGENAME}}</nowiki></code>.
* To have an action include a line break insert <code>\n</code> into the snippet at the place you want it to be. For stylistic reasons some people will put <code>' + '</code> between instances of <code>\n</code> and other text in their snippets, but this does not have any effect on the output of the action and can be omitted if you want.
* Do not reuse internal names within your entire toolbar.
 
 
<code>XXXX</code> is replaced by the snippet that goes before the highlighted text/cursor, and <code>YYYY</code> is replaced by the snippet that goes after the highlighted text/cursor.
 
* To have an action include a line break insert <code>\n</code> into the snippet at the place you want it to be. For stylistic reasons some people will put <code>' + '</code> between instances of <code>\n</code> and other text in their snippets, but this does not have any effect on the output of the action and can be omitted if you want.
* To have an action include apostrophes (<code>'</code>) in the text that it inserts, place <code>\'</code> into your code at the place you want the apostrophe to go. If you do not include the backslash (<code>\</code>) and type additional apostrophes in your code it will cause the toolbar to break.
Autopatrolled, Editors
8,721

edits