MediaWiki talk:Edittools

From Wikipedia, the free encyclopedia
Jump to: navigation, search


Customization instructions[edit]

To add custom entries, adapt this code, and place it in your common.js:

// Add custom Character Inserter entries
window.charinsertCustom = { 
	"Insert": ' Mention: {\{u|+}}  {\{ping|+}}', 
	"Wiki markup": ' Mention: {\{u|+}}  {\{ping|+}}' 
};

that will append the {{u}} and {{ping}} code to the indicated menus.

  • Note1: The "+" in those items, is where your cursor will appear after the text is inserted, or if you already have text highlighted when you click them then that text will be properly surrounded by the templates.
  • Note2: You can also remove or change the word "Mention:" - anything that is followed by a colon seems to get turned into a heading - Use_underscores_for_multi_word_headings: like so.
  • Note3: use a dot ( . ) for any spacing needed in such things as inline css class or id assignments. For example. -- the space needed between the words span and class in <span.class="plainlinks">+</span>
  • Note4: to include a single literal \ use four backslashes ( \\\\ ) (will appear as double-\ on menu display.) E.g. <math>\\\\scriptstyle{+}</math>.

adjustment[edit]

Under Latin, could we have both Ə ə and Ǝ ǝ? (Make sure that the lower-case letters are matched correctly!) They're used in different alphabets.

Under Arabic, "transcription" should really be "transliteration".

kwami (talk) 20:12, 22 April 2014 (UTC)

Yes check.svg Done @Kwamikagami: Is this what you meant? let me know if they need to be in a different order or anything. — Mr. Stradivarius ♪ talk ♪ 10:17, 23 April 2014 (UTC)
Perfect. (Maybe the opposite order, so the caps go from more similar to less similar, but that's not important.) — kwami (talk) 17:32, 23 April 2014 (UTC)
I've switched the order around. — Mr. Stradivarius ♪ talk ♪ 12:59, 24 April 2014 (UTC)
Also, Arabic doesn't seem to be maintained here. Sorry, I'm not sure which message is the one that needs editing. — Mr. Stradivarius ♪ talk ♪ 10:19, 23 April 2014 (UTC)
Odd. It used to be. But the labels aren't important. — kwami (talk) 17:32, 23 April 2014 (UTC)
@Mr. Stradivarius: You edited MediaWiki:Edittools which is the old-style cut&paste, for browsers without javascript. The clickable insertions are handled in MediaWiki:Gadget-charinsert-core.js, which is pulled in by MediaWiki:Edittools.js as described in the box at the top of this page. --Redrose64 (talk) 12:54, 24 April 2014 (UTC)
Ah yes, found it - thanks for that. I've updated the JavaScript version as well. — Mr. Stradivarius ♪ talk ♪ 13:09, 24 April 2014 (UTC)

Individual customization?[edit]

Is it possible for an editor to customize this for individual use without replicating all the .js files? Alternatively, would it be possible to get a combined <code><nowiki></nowiki></code> option in the list of tools? I find I use this combination quite frequently; since the tool doesn't maintain focus on the selected text once it is wrapped, I have to re-select the desired text to apply the second wrap.

Also, just a quibble, but is there a way to wrap pairs in the tools so that they don't split across lines? Currently, in my browser, there is a line break between <s> and </s>. Thanks for any assistance you could provide!—D'Ranged 1 VTalk 01:47, 30 June 2014 (UTC)

I support addition of <code><nowiki></nowiki></code> to Edittools. I constantly use these together and made the same suggestion at MediaWiki talk:Edittools/Archive 8#code and nowiki in one step. PrimeHunter (talk) 14:45, 6 October 2014 (UTC)
I support PrimeHunter. ‑‑Mandruss (talk) 18:15, 6 October 2014 (UTC)
Sounds like a good idea to me. Support PrimeHunter as well. --Florian Blaschke (talk) 02:38, 8 October 2014 (UTC)
I also support, and use this combo a lot.
But, I'm also curious about the initial question. Is there a way for individual editors to easily customize CharInsert? Eg. I'd like to add {{ping}} and {{u}} and a few others, at various wikis... and Slimvirgin is asking about those at Wikipedia talk:Notifications#Typos... If not, I'll have to ask about RefToolbar custom buttons... Thanks. Quiddity (talk) 02:27, 18 October 2014 (UTC)
MediaWiki:Gadget-charinsert-core.js allows for users to add data to window.charinsertCustom to add additional categories to the dropdown and to append additional entries to the existing categories. For example, I have a userscript that adds an entry to help me insert {{unsigned}}. Anomie 20:42, 18 October 2014 (UTC)
Thanks Anomie. Between those pointers, and George Orwell III's explanation at the other thread, and some searching through various users' other usages, I was able to put together this explanation with bonus headings. :) Quiddity (WMF) (talk) 19:04, 20 October 2014 (UTC)

Request option to load CharInsert bar above toolbar[edit]

Is it possible to add an additional User .js settable option like charinsert.DontMove already does in the MediaWiki:Gadget-charinsert-core.js script so that the CharInsert toolbar loads above/ontop of the classic/Wikieditor toolbar? Something like charinsert.LoadHigh maybe? -- George Orwell III (talk) 22:34, 18 October 2014 (UTC)

I believe all these options don't even work anymore since this has been moved to a gadget (as gadgets load before user js). Pinging Mr. Stradivarius and Anomie. -- [[User:Edokter]] {{talk}} 12:08, 19 October 2014 (UTC)
Sorry, I think you have the wrong user here! I've never played around with JavaScript on MediaWiki in much detail. — Mr. Stradivarius ♪ talk ♪ 12:32, 19 October 2014 (UTC)
Sorry, I asumed you had some programming skills as I see you fiddle quite a lot with LUA. -- [[User:Edokter]] {{talk}} 13:58, 19 October 2014 (UTC)
Oh they still work (see Wikipedia_talk:Notifications#Typos too). Edokter you seem to have set '...DontMove' to 'true' (Why anyone wants tools below the terms of use disclaimer I'll never know) when it should have been 'false' plus you left out if(window.updateEditTools) window.updateEditTools(); as well.

Anyway, we had it "loading high" for awhile on Wikisource using something along the lines of....

            if ( window.charinsertMoveHigh ) {
                $( '.wikiEditor-ui' ).before( placeholder );
            }
... but that would up going flakey for some users after one the those core wmf upgrades. Now it just does it by itself (see here) in just one namespace!

I'll bet you're right about loading order issues though. -- George Orwell III (talk) 12:18, 19 October 2014 (UTC)

I see charinsertDontMove isn't working reliably anymore, sigh. I use the option because I don't want it intruding between the edit box and the summary and submit buttons (and "below the terms of use disclaimer" doesn't matter to me considering I hide that with CSS). Anomie 13:54, 19 October 2014 (UTC)
(ec) I didn't change anything here, I just tested the options in my common.js to see what they did... nothing in my case. So why would they not work for me? -- [[User:Edokter]] {{talk}} 13:58, 19 October 2014 (UTC)
Anomie, just had an idea; If I knew the module name for the user script module, I could list it as a dependency. -- [[User:Edokter]] {{talk}} 14:13, 19 October 2014 (UTC)
Not sure. We've basically used variants of the following....
/* CharInsert specific */
window.charinsertDontMove = false;
window.editToolsRecall = true;
window.charinsertCustom = { User: ' |  =  {\{+}}  [\[+|]]  —  Æ  æ  Œ  œ  <code><nowiki>+</nowiki></code>  {\{ping|+}}' };
if(window.updateEditTools) window.updateEditTools();
... with little trouble for quite some time now. I thought the highlighted line made customization & the load order "agreeable". Other than the usual 'need to purge cache' issues, applying the above seems to work everybody either way - old style under the edit form box or stuck in between the textarea and the start of the edit summary - it works both ways.

What "we" were looking for was a third way (to load above WikiEditor) as Wikisource does a lot of transcribing (scrolling around just leads to losing the focus if you follow my drift). -- George Orwell III (talk) 14:19, 19 October 2014 (UTC)

@Edokter: I think it's "user", although whether depending on that would work I don't know.
@George Orwell III: The highlighted line makes charinsertCustom work and maybe editToolsRecall, but not charinsertDontMove. Anomie 10:16, 20 October 2014 (UTC)
@Anomie:, editToolsRecall = true; should enable as clickable pseudo-button to the left of the drop down menu. This lets you toggle between the current set selected and the previous set used in an editing session with only a single click opposed to having to open the drop-down and scroll back & forth or between two character sets over and over again.

Not sure why charinsertDontMove = false; isn't allowing CharInsert to load between the editing field and the edit form for you but I assure folks it is possible as it has been working for me for months now. -- George Orwell III (talk) 23:53, 20 October 2014 (UTC)

Because false is the default. Anomie complains that true didn't work, which has now been fixed. -- [[User:Edokter]] {{talk}} 01:09, 21 October 2014 (UTC)
Listing user as a dependency seems to work on testwiki, so I will do so here. I'll see if the 'top' option works on testwiki as well. -- [[User:Edokter]] {{talk}} 11:09, 20 October 2014 (UTC)
fwiw... the only difference I can nail down between the Wikipedia and the Wikisource approaches to the "editing tools" app scheme is that WS stopped bothering with the javascript-browser enabled (Edittools.js ?) part some time ago. Not only has the overall coding development moved away from supporting such javascripting but it would always load regardless of the condition at hand (e.g. the controlling css simply adds display: none; to the div container to "hide" the constant loading of MediaWiki:Edittools' content; just review the html source of any article already opened to edit mode to see what I'm talking about). Other than that, I'm not sure why generating the CharInsert bar "in between" works for some folks but not others. -- George Orwell III (talk) 23:53, 20 October 2014 (UTC)
@Edokter:, an additional update -- after also adding the dependency on 'user' over on Wikisource and re-adding ...
            if ( window.charinsertMoveHigh ) {
                $( '.wikiEditor-ui' ).before( placeholder );
            }
back into MediaWiki:Gadget-charinsert-core.js there, the option charinsertMoveHigh = true; is valid & working properly again for us. Its up to folks here if they want to duplicate the option(s) currently used on WS I guess. -- George Orwell III (talk) 05:26, 21 October 2014 (UTC)
I will experiment. May I suggest renaming the option to window.charinsertMoveTop; "high" is not a common term used in programming. -- [[User:Edokter]] {{talk}} 09:09, 21 October 2014 (UTC)
Yes check.svg Done -- switched window.charinsertMoveHigh to window.charinsertMoveTop (+ changed documentation) on Wikisource. -- George Orwell III (talk) 09:30, 21 October 2014 (UTC)
When I first saw "LoadHigh" in this thread, I was reminded of the MS-DOS command LOADHIGH. This was used when invoking a TSR program to persuade it to load in a segment between A000:0000 and FFFF:000F - otherwise it would reduce the memory available for real-mode user programs. --Redrose64 (talk) 09:36, 21 October 2014 (UTC)
Problem: The current (wikisource) MoveTop only works with the enhanced toolbar enabled. It also gains a blue background as a result of being part of the enhanced toolbar. Are these traits intended? -- [[User:Edokter]] {{talk}} 10:19, 21 October 2014 (UTC)
The blue background (actually ghostWhite) for all 3 possible positions is new on WS because the original inherited "blue" upon using LoadTop over there was visually irritating - I don't know if the same holds true here or has any color inherited here on WP at all. I'm not so sure the blue was being inherited from WikiEditor; at any rate if "we" can plain old white back somehow, I'd make the switch for all 3 possible positions.

If we can get it to load above the Classic toolbar, that would be great too -- but not a deal breaker for us.

Its obvious VisualEditor is to be the future default for sites as "big" as Wikipedia while WikiEditor seems to be to be geared more towards the "lesser" wikis such as Wikisource. The Classic toolbar is going to be more trouble than its worth some point in the future. Still, some folks swear by it so it would be neat if could be done too.

Its hard to get folks to accept simple facts like that - things such as the popularity/need for the RefToolbar here translates to a big honkin' waste of resources elsewhere. I wish the developers would just come up with one interface (a single blank toolbar) and let folks plug in (buttons or menus) what they want after that. -- George Orwell III (talk) 13:21, 21 October 2014 (UTC)

I tend to be conservative when adding options; there can be too many. And the perfectionist that I am, I'd have to fix the CSS as well to adapt all the borders. I'm not ready to add it just yet... I'd like to see some demand from the community for a top loading charinsert. Perhaps you can organize a small RfC. -- [[User:Edokter]] {{talk}} 18:01, 21 October 2014 (UTC)

Edit request[edit]

I don't think that it's necessary. It's already in "Insert" and "Wiki markup" (third link from the left, between em-dash and single prime); and also in "Math and logic" (fifth from left, between the dot operator and the asterisk operator). --Redrose64 (talk) 21:26, 5 November 2014 (UTC)
What Redrose said... already present three times. -- [[User:Edokter]] {{talk}} 23:30, 5 November 2014 (UTC)