Last modified: 2014-08-07 12:14:33 UTC
Editing in non-javascript environment, I copy&paste characters in [[MediaWiki:Edittools]]. But because of the mouse links, it's somewhat tricky to drag the wanted character. I want the links activated only when javascript is enabled.
Any stuff requiring JavaScript should not be in Edittools. Only JS independent texts and placeholders which are to be filled/manipulated by scripts in Common.js or other linked js pages.
Yes, the Charinsert extension should just output a plain character wrapped in a span with class="mw-charinsert" that the JavaScript can add a link to if enabled.
The script should be able to differentiate between <charinsert>A+B</charinsert> (inserts "A" to the beginning and "B" to the end of the selection) and <charinsert>A<nowiki>+</nowiki>B</charinsert> (inserts "A+B").
Per comment #2, it seems adequated to tag this as "easy".
If any scripts or styles remain, port to ResourceLoader as well.
Actually the links by core EditTools do use JavaScript and it looks genuine too. In the current state (SVN HEAD:112664) extensions/CharInsert/CharInsert.php outputs: <a onclick="insertTags( .. );"> .. </a> Which calls the core mw.toolbar.insertTags function. So it does work by default (insertion in toolbar). And that pretty much justifies the use of links, right ? Granted it could be nicer and prettier but the assumption made here that it requires site-specific javascript code to work is not true. Marking WONTFIX as such.
Well, the deal was to remove onclick=... stuff in favour of jQuery general global handling. Thus reopening.
OK, maybe that should be a separate request then. Re-summarizing for now (removing javascript on itself makes no sense as a goal unless it's redundant or broken).
Change 152076 had a related patch set uploaded by Helder: Use event binding from a module instead of inline javascript https://gerrit.wikimedia.org/r/152076
Change 152076 had a related patch set uploaded by TheDJ: Use event binding from a module instead of inline javascript https://gerrit.wikimedia.org/r/152076