MediaWiki talk:Edittools

From Wikipedia, the free encyclopedia
Jump to navigation Jump to 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>.

Interface-protected edit request on 28 January 2019[edit]

A request, since I no longer seem to have editing rights here.

At MediaWiki:Gadget-charinsert-core.js, under 'Latin', we need the three modifier letter commas/apostrophes from the Spacing Modifier Letters block (U+02BB, 02BC, 02BD), which look like single quotation marks but are encoded as letters and behave as such. A common usage is 02BB for the ʻokina that's used in many Hawaiian words and names -- the opening single quote mark currently listed under 'Symbols' is inappropriate for Unicode text as it is encoded as punctuation rather than as a letter.

This year, ISO-693 language names with 'apostrophes' in them are being changed from ASCII <'> and the punctuation apostrophe to the Unicode modifier letters, just as clicks were changed from punctuation marks to Unicode click letters last year. But, in general, it is often best practice to use the correct letters rather than ASCII or punctuation substitutes. We should support them in the edit window so editors can access them readily. (The click letters are already listed in the IPA window, and I don't think we need them repeated under Latin, as not many editors would need them.)

I would suggest labeling each of the modifier letters so that editors can distinguish them easily, since they tend to look similar at small font sizes. I propose appending at the end of the list of Latin letters,

 saltillo: Ꞌ ꞌ ʻokina: ʻ hamza: ʼ ayin: ʽ 

as the shortest labels I can think of, though they all have other uses (the "ʻokina" is also used for aspiration in the Wade-Giles system for transcribing Chinese, the "hamza" is used as a general glottal stop as well as in various Latin digraphs, etc.) — kwami (talk) 23:26, 28 January 2019 (UTC)

Not done (yet) @Kwamikagami: I created a user-sandbox for you at User:Kwamikagami/sandbox/Gadget-charinsert-core.js, please make the edits there so we can see exactly what you would like done. Once ready, please reply here and reactivate the edit request template above. Thank you, — xaosflux Talk 02:12, 30 January 2019 (UTC)

@Xaosflux: Okay, done. The proposed change can be seen here.

BTW, there's a template {{okina}} to produce the first of them, so editors can be sure they're inserting the correct character rather than using the punctuation mark by mistake, but that template is not safe to use in citation templates and often I think it would be more convenient in the edit window. — kwami (talk) 20:19, 30 January 2019 (UTC)

@Kwamikagami: think this is going to need a bit more consideration, we don't put labels in this table to name any other symbol - why are these so special? — xaosflux Talk 03:27, 1 February 2019 (UTC)
@Xaosflux: Only because they are easy to confuse at small font sizes. It was just a suggestion. By all means, leave out the labels if you think that would be better. The saltillos, Ꞌ ꞌ, are an upper-case–lower-case pair, the others are unicase.
Here is the proposal without labels. If you're uncertain about the labels, I wouldn't mind having the bare characters added while you think about it. — kwami (talk) 04:23, 1 February 2019 (UTC)
 Donexaosflux Talk 21:57, 1 February 2019 (UTC)

Thanks! — kwami (talk) 01:27, 2 February 2019 (UTC)

Interface-protected edit request on 31 January 2019 (problematic invisible character)[edit]

I wanted to make this request separately, in case there's some technical reason for having the template the way it is.

In the 'Latin' section, there's an extra clickable space between the pair of letters Ị and ị that inserts a thinspace. When editing the .js code, this invisible character is displayed as a pink space with a red dot in the middle, where a simple space would be expected.

There's no obvious reason why thinspace should be provided here, in the middle of the alphabet, and since it's not labeled, the user can't tell what it is. I don't know if for some reason maybe the pair of letters Ị and ị won't display properly otherwise. I suggest that we might want to change

Ị ị


Ị ị

. The proposed change can be seen here. — kwami (talk) 19:34, 31 January 2019 (UTC)

Support Looks like it was added in Special:Diff/514433347 (by me, oops) with edit summary "Sync somewhat with MediaWiki:Edittools", which (presumably) has a thin space there for formatting purposes. There seems to be no reason for it here, it looks like it was a copy-paste error due to it being visually very similar to a standard space. Anomie 22:11, 31 January 2019 (UTC)
 Donexaosflux Talk 23:58, 31 January 2019 (UTC)
@Xaosflux: Looks like you accidentally undid it with Special:Diff/881335146. Anomie 03:14, 2 February 2019 (UTC)
@Anomie: thanks for the note, too many edit requests! Re-applied this fix. — xaosflux Talk 03:29, 2 February 2019 (UTC)
@Xaosflux: You did it again with Special:Diff/885341869... Anomie 23:59, 27 February 2019 (UTC)
 Done thanks for the note @Anomie:. — xaosflux Talk 00:21, 28 February 2019 (UTC)


I wonder, instead of 'click on the character or tag to insert it into the edit window', would it be possible for the pop-up to display the name of the character? The IPA section, for example, is rather difficult to read as it currently is. Or would that require too much re-engineering? — kwami (talk) 01:28, 2 February 2019 (UTC)

I've wanted something like this. A draft is at User:Erutuon/scripts/charinsert-core.js. It seems to work. It adds tooltips to the links that contain only one code point. You can test it by disabling Charinsert in the Gadgets tab of your Preferences and then entering importScript('User:Erutuon/scripts/charinsert-core.js'), importStylesheet('MediaWiki:Gadget-charinsert-styles.css'); in your browser's JavaScript console or in your common.js. — Eru·tuon 03:06, 2 February 2019 (UTC)
I used Module:Unicode data on Wiktionary (the one on Wikipedia will work too) to get the code point names. it can be updated using Module:Sandbox/Erutuon/charinsert names. — Eru·tuon 03:07, 2 February 2019 (UTC)
Actually, having charinsert-core just add a class to identify the charinsert links, so that another script can locate them and add the tooltips, would be neater, because the code point names add more than 46 kilobytes of clutter to the page. — Eru·tuon 04:02, 2 February 2019 (UTC)
@Erutuon: While we're at it, can we also reconsider the way the script formats the strings? It appears that currently a sequence of non-ASCII characters can only form a button if it's only one or two characters, which has prevented us from adding ⟨ɜːr⟩ to "IPA (English)" and has made no sense to me. Nardog (talk) 04:15, 2 February 2019 (UTC)
@Nardog: Hmm, actually, doing ɜːr+ achieves that. — Eru·tuon 08:10, 2 February 2019 (UTC)
Oh, that's how it works! Thanks. Nardog (talk) 01:04, 3 February 2019 (UTC)
Okay, created a version, User:Erutuon/scripts/charinsert-names.js, that works with the unmodified Charinsert script. — Eru·tuon 09:20, 2 February 2019 (UTC)

───────────────────────── Do I need to refresh or something? Turned off the editor in prefs and added this last line to my js, but nothing's changed.

For the pop-ups, the clutter could be greatly reduced by removing redundant wording. No need to say everything in the Latin block is Latin, for example, and rather than "Latin capital letter a with acute" and "Latin small letter a with acute", we could just say "A-acute" and "a-acute". That should be all the info anyone needs. If you think people will want the Unicode values, it would be simpler to name them directly, "193 A-acute" and "225 a-acute". — kwami (talk) 20:38, 6 February 2019 (UTC)

@Kwamikagami: Hmm, it didn't work because you just entered the name of the page in your JavaScript file, but you should probably try the newer version of the script anyway. Make sure the edit toolbar and the Charinsert gadget are enabled and that you're seeing the Charinsert box again, and then add importScript('User:Erutuon/scripts/charinsert-names.js'); to your common.js. — Eru·tuon 21:32, 6 February 2019 (UTC)
Thanks. I wasn't paying attention. Still no change, though. — kwami (talk) 21:40, 6 February 2019 (UTC)
So the Charinsert box is showing up, but no tooltips (like "LATIN SMALL LETTER M WITH HOOK" for ɱ) when you put your mouse over one of the Charinsert links? Any error messages in your browser's JavaScript console? — Eru·tuon 21:53, 6 February 2019 (UTC)
Any of the names that are displayed for the code points can be changed. They are right in the file (User:Erutuon/scripts/charinsert-names.js). However, the script that compiles the list of names currently just outputs the official Unicode names ("LATIN SMALL LETTER WITH ACUTE" rather than "a-acute") so the next time the list needs to be updated, it would have to be modified so that it retains the modified names. I agree that "a-acute" is much more readable.
It would be pretty easy to add the code points to the tooltip, either by default or user preference. I think the official U+hex format of the code point (U+00E1 rather than 225) would be more familiar though. — Eru·tuon 21:50, 6 February 2019 (UTC)
Erutuon, "so the next time the list needs to be updated, it would have to be modified so that it retains the modified names. I agree that "a-acute" is much more readable.". note: this is sort of why that functionality is not provided by default. Especially not in core where not only we can then start doing this for 137000 characters, but also multiplied by up to potentially 300 languages ;) —TheDJ (talkcontribs) 08:45, 7 February 2019 (UTC)

Yes. Charinsert box is the same, the tooltip is the default 'click on character ...'. Exactly as it was before. That's why I wondered if I needed to refresh somehow. I just turned it off under Gadgets, confirmed the box was gone, then back on, and still no change. Though enabling/disabling the editing toolbar under Preferences has no effect on the box.

Agreed, hex would be better IMO. But it doesn't need to be the full U+00E1. Just 'E1' should be sufficient, as that's all you need for the &#x...; coding. I think minimal wording is best, esp. if the editor has to opt in for the Unicode values. — kwami (talk) 23:50, 6 February 2019 (UTC)

Ahh, yeah, the bare value could be better if the purpose is for HTML numerical character references. Dunno if it would confuse people.
I need more information to figure out what's going wrong. Any message in the browser console? In Firefox (Linux) I get it up with Ctrl+Shift+K. If you don't mind telling me, what browser and operating system are you using? — Eru·tuon 00:46, 7 February 2019 (UTC)

I don't think it would be confusing if they had to opt in, as then they would know what they were getting and why. It would be if it were the default display.

MS10 with FF, both up to date. No messages that I can see, other that a bunch of stuff about pages using deprecated modules, which don't change when I turn the box or gadget off & on. — kwami (talk) 07:21, 7 February 2019 (UTC)

Okay, I just had my script not work for me. On one page it didn't work, on another it did. Not sure what's going on. Perhaps it's about the relative execution time of the charinsert-core script and my script. — Eru·tuon 08:19, 9 February 2019 (UTC)

Interface-protected edit request on 26 February 2019[edit]

A few more additions to the Latin alphabet, in keeping with last month's. Diff here.[1] (This diff is based on the code left on my page from last month. FYI in case you've made other changes since then.)

These letters are used in a number of Native American languages. ⟨Ɂ ɂ⟩ are capital and l.c. glottal stop, equivalent in function though different in shape from the saltillo we added last month. The ⟨ɂ⟩ made headlines when a Chipewyan woman was not allowed to give her daughter a Chipewyan name, despite Chipewyan supposedly being an official language of the province, because Canadian govt computer systems didn't support this letter. So I think we should. (In Seneca, ⟨ˀ⟩ is used instead, but it's already available in the IPA section of charinsert.) ⟨꞉⟩ and ⟨ꞏ⟩ are a colon and half-colon defined as alphabetic letters rather than as a punctuation marks. They're used in a number of Native American languages for long vowels, and are distinct from the ASCII colon in the same way -- and for the same reasons -- that Hawaiian ʻokina (which we added last month) is distinct from an apostrophe/quotation mark. They're not a case pair, but rather some languages use the two-dot and some the one-dot variant. — kwami (talk) 04:04, 27 February 2019 (UTC)

 Donexaosflux Talk 12:23, 27 February 2019 (UTC)

Thanks! — kwami (talk) 20:02, 27 February 2019 (UTC)