Extension talk:CharInsert
This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
![]() Archives
|
---|
|
Semantic Forms
I use semantic forms and need to get char insert working within a form. When i edit a page with a form, i can get the char insert menu to show up but clicking the insert buttons doesn't do anything. I have seen several mentions of forms not loading edit.js and edittools.js but i can't even find edit.js (is it deprecated for edittools in 1.18?) and i tried loading edittools via Common.js and still don't have anything working. Any ideas?
Thanks! — Preceding unsigned comment added by 166.122.75.57 (talk • contribs) 20:26, 17 February 2012 166.122.75.57 (talk · contribs) 00:40, 19 March 2012 (UTC)
- Semantic Forms does not support this extension. It does support WikiEditor though, which also allows you to insert special characters. Cavila MW 1.17, MySQL 5.5.16, Php 5.3.8 09:05, 26 April 2012 (UTC)
Not displaying as buttons..
For some reason these are not showing up as buttons.. I've tried every instruction a few times to get it to work and it is not.. the button stuff is just CSS, correct? Could it not be working because my wiki uses a custom skin? Is there a $wpUseCustomSkinCSS or something I am missing? I'm very frustrated. ~:-| Technical 13 (talk) 20:11, 12 April 2012 (UTC)
- After the regular installations follow instructions on Extension:CharInsert#Advanced_Installation if you want to style them as buttons. Note that for MediaWiki:Common.css and MediaWiki:Common.js to be loaded,
$wgUseSiteJs
and$wgUseSiteCss
have to be enabled. Krinkle (talk) 09:14, 14 April 2012 (UTC)- Hi Technical 13. I'm having the same problem on my MW 1.18 installation and I cannot get the dropdown box to work either. $wgUseSiteJs and $wgUseSiteCss are enabled by default. Of course, if you have upgraded to MW 1.18, you should know that there have been a number of breaking changes. For instance, it now requires the page MediaWiki:Gadget-Edittools.js and the scripting uses different names (e.g. different div class names). But I'm still trying to figure out what else has changed that is causing trouble. Cavila MW 1.17, MySQL 5.5.16, Php 5.3.8 09:03, 26 April 2012 (UTC)
- We are running 1.17.1 and they only don't appear as buttons for me with our custom skins.. I'm wondering if there is a different or special switch somewhere to turn userCss on with custom skins, or if the skin is severely broken and somehow causes it to not even look for MediaWiki:Common.css let alone username/common.css. ShoeMaker ( Contributions • Message ) 12:07, 26 April 2012 (UTC)
- I note that $wgUseSiteCss and $wgUseSiteJs default to true; assuming therefore that I don't need to add them in explicitly.
- Also assume that only the Styling section of advanced installation need be followed. Nevertheless, these are not displaying as buttons. Do I need to have an image file somewhere?
- I do see where the instructions say, To give the charinsert lists additional styling, wrap the contents of your Edittools between <div class="mw-charinsert-buttons"> and </div>, but can't help but notice that the code on this site's Edittools page isn't all wrapped up within a DIV like that, and yet everything looks fine here. So I copied this site's code on both pages, and all the Gadget pages, exactly as I found them, and no dice. Help? RiverStyx23 (talk) 18:47, 11 April 2015 (UTC)
- Hi Technical 13. I'm having the same problem on my MW 1.18 installation and I cannot get the dropdown box to work either. $wgUseSiteJs and $wgUseSiteCss are enabled by default. Of course, if you have upgraded to MW 1.18, you should know that there have been a number of breaking changes. For instance, it now requires the page MediaWiki:Gadget-Edittools.js and the scripting uses different names (e.g. different div class names). But I'm still trying to figure out what else has changed that is causing trouble. Cavila MW 1.17, MySQL 5.5.16, Php 5.3.8 09:03, 26 April 2012 (UTC)
Is it possible to have the link text be one thing and what it actually inserts another?
I want to set up a script to help my users fill in some extensive and somewhat complicated templates. A simple one would be my bind template. I currently have it set up as:
This is the text it needs to insert for the template to work; however, it would be easier for the user if what they saw was more like:
How can this be accomplished? -- Technical 13 (talk) Technical 13 (talk) 20:20, 12 April 2012 (UTC)
- I'm also interested in this. I use htmlet extension in working with LaTeX environments and I want to show users something like:
- <env_name></env_name>
- and not
- <htmlet>begin-env_name</htmlet><htmlet>end-env_name</htmlet>.
- Any suggestion, please? Thanks a lot in advance. Best regards! Nikita Swank (talk) 20:12, 15 November 2012 (UTC)
"You must have the Gadgets extension for this to work" SOLVED (read entire page)
"You must have the Gadgets extension for this to work." OK, fair enough. But that page says gadgets have to be specifically enabled. Um, OK? Well, the Gadget's page even says where to do this here enabling, but doesn't give a lot of guidance, or in fact any guidance for CharInsert. I could figure it out if I were familiar with coding, but I'm not. What's needed? RiverStyx23 (talk) 01:25, 12 January 2013 (UTC)
- Hi RiverStyx23
- I had the same problem. After posting in the forum and receiving some very good advices I finally got it to work.
- To help other people to have this extention working, I made a documentation (in French but it should be easy to follow).
- You can look at it at: http://www.micronator.org/PDF/RF-232_SME-8.0_MediaWiki_Gadgets_CharInsert.pdf
- Michel-André 206.248.138.152 17:27, 16 January 2013 (UTC)
Not compatible with Extension:CodeEditor
Hi,
The charinsert tags don't work with the CodeEditor enabled in a javascript file for example. Automatik (talk) 23:17, 2 September 2013 (UTC)
- Reported on bugzilla:53743 Helder 10:33, 4 September 2013 (UTC)
White screen after editing localsettings
After uploading the files, when I put the code in localettings.php, I lose connection to my wiki - I just get a white screen. Removing the code again restores things to normal.
It's only this extension I've had this problem with. (I installed a different extension just now, to make sure, and had no problems with that one.)
Any thoughts? Laurentio (talk) 20:18, 5 September 2013 (UTC)
undocumented XML element
I could be wrong, but it looks like <p> (the XML element for encoding paragraphs) is registered by this extension, yet nothing is indicated on Special:Version ("parser extension tags"). To avoid any potential confusion, it would be worth adding this to that page. Cavila (MW 1.19.7, MySQL 5.1.66, Php 5.3.3-7, SMW 1.8, SF 1.5.2} 17:48, 31 October 2013 (UTC)
Feature request: Accesskey
<charinsert accesskey="c">...</charinsert>
Subfader (talk) 14:28, 1 November 2013 (UTC)
Just my personal comment
For what it's worth, I like it. For text editing in Wikisource it's very helpful. Thanks to those who designed and implemented it. Ineuw talk 07:03, 2 January 2014 (UTC)
- Not very informative. 2A01:E35:8A8D:FE80:9A7:81B4:B3AB:846F (talk) 19:40, 4 January 2017 (UTC)
It disappeared!
Within the last couple of days, this gadget stopped working on en.wikipedia. I've gone to my Preferences, switched off the gadget, saved, purged the cache, switched it back on, saved, and purged the cache, without success. Any idea what's wrong, or where I should report it if not here? Thanks. (Please try using {{U}} to notify me of a response; I'm not sure it works across wikis.) D'Ranged 1 (talk) 03:21, 6 June 2014 (UTC)
- Are you talking about w:en:MediaWiki:Gadget-charinsert...? That gadget is usually discussed on w:en:MediaWiki talk:Edittools. Helder.wiki 15:37, 6 June 2014 (UTC)
- Thank you; I'll post there. D'Ranged 1 (talk) 05:00, 9 June 2014 (UTC)
Character insertion stopped working after 1.25wmf14 rollout
- Subject says it all.
- See T86715 Regression: No longer able to insert characters using CharInsert gadget based on extension after 1.25wmf14 roll-out. George Orwell III (talk) 23:00, 13 January 2015 (UTC)
- Anxious for this to be resolved, as the work I am editing requires the gadget's use on almost every page. Thanks, Londonjackbooks (talk) 00:23, 14 January 2015 (UTC)
- "The gadget needs to be made dependent on mediawiki.toolbar in the gadgets definition:
charinsert-core[ResourceLoader|hidden|rights=hidden|dependencies=mediawiki.action.edit,mediawiki.toolbar,jquery.textSelection,user]|charinsert-core.js|charinsert-core.css
- Added the dependency on en.wikisource and character insertion works again. Hat-tip to TTO. George Orwell III (talk) 04:57, 14 January 2015 (UTC)
- Anxious for this to be resolved, as the work I am editing requires the gadget's use on almost every page. Thanks, Londonjackbooks (talk) 00:23, 14 January 2015 (UTC)
- Same issue. How to make it work with MW 1.26.2 and an advanced installation ? Cheers. Gigajoule (talk) 19:22, 1 April 2016 (UTC)
<charinsert> attributes
Hi,
I would like it if <charinsert>
tags could have an attribute called, for example, content =
. The purpose would be so that while what is between the charinsert tags would be what is displayed in Edittools what is called by this attribute will be what is inserted (unless it is left blank where it will revert back to what is between the <charinsert>
tags. e.g., adding
<charinsert content = "{{Information|Description=|Source=|Author=|Permission=|Date=}}">{{Information}}</charinsert>
to MediaWiki:Edittools would produce a button {{Information}}
in edittools that when clicked would add:
{{Information|Description=|Source=|Author=|Permission=|Date=}}</pre> to the page. Is there any way to add this functionality to this extension.
Thanks for your time,
Brenton Fuse809 (talk, c 22:20, 2 March 2015 (UTC)
- This was requested on phab:T25354 (~5 years ago). Helder 17:55, 29 March 2015 (UTC)
- And how do I implement it? I think the charinsert code has changed significantly since then as https://phab.wmfusercontent.org/file/data/pvsf46w2iksxbyexls2t/PHID-FILE-2jqmm2236ey6seocloyv/fiqy3idcyr2grxam/charinsert-customlabel.patch includes charInsert with inputs ($data, $args) while my version of CharInsert.php includes three function inputs ($data, $params, $parser). Fuse809(talk, contribs, email) 07:26, 14 April 2015 (UTC)
Extension vs Gadget
What is the difference between this extension and the charinsert gadget? Do I need to install both or only one of them to get the the drop-down box like wikipedia? Prod (talk) 23:23, 3 March 2016 (UTC)
- To get the drop-down box, you need Extension:Gadgets, too. See instructions at Extension:CharInsert#Advanced_Installation. Quiddity (WMF) (talk) 00:27, 9 March 2016 (UTC)
- What does this extension provide that the gadget doesn't? Prod (talk) 03:36, 10 March 2016 (UTC)
- I've deployed the gadget, and removed this extension, and I get all the features that I required. It seems this extension is only required if one doesn't want to deploy the gadgets extension. Prod (talk) 13:37, 16 March 2016 (UTC)
Instructions: CharInsert menu like the one used in English Wikipedia
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
For CharInsert menu like the one used in English Wikipedia, mirror the following interface pages to your own Wiki:
- MediaWiki:Gadget-charinsert-core.js (Wikipedia) - Main JavaScript file.
- MediaWiki:Gadget-charinsert-core.css (Wikipedia) - Creates surrounding boxes around the symbols/characters giving them the look of buttons.
- MediaWiki:Gadget-charinsert.js (Wikipedia) - CharInsert loader.
- MediaWiki:Edittools (Wikipedia) - Only for users with JavaScript turned off or unsupported (which disable the WikiEditor extension too), therefore not really necessary or useful either. It only shows symbols/characters as simple text, which can be copy-pasted and thus being of some help to the editors. Apparently, it does not get activated in English Wikipedia.
In your MediaWiki:Gadgets-definition, add the following definitions:
* charinsert[ResourceLoader|default]|charinsert.js * charinsert-core[ResourceLoader|hidden|rights=hidden|dependencies=mediawiki.toolbar,jquery.textSelection,user]|charinsert-core.js|charinsert-core.css
Note: This particular English Wikipedia character set also contains templates, which will need to be defined separately, if they are to be used on your Wiki.
Checked on: March 7th, 2016
_______________________________________________________________________________________
I am unsure what the guidelines are for putting these instructions first here or directly in the main Extension page. If someone can explain this I would be grateful. AhmadF.Cheema (talk) 19:24, 6 March 2016 (UTC)
- Please do improve the documentation! It's just like a wiki article, all help is appreciated. Quiddity (WMF) (talk) 00:25, 9 March 2016 (UTC)
- Will do.
- Thanks. AhmadF.Cheema (talk) 00:59, 9 March 2016 (UTC)
- Thanks! Hinote (talk) 18:54, 11 March 2016 (UTC)
Insert linebreaks?
Previously (<=MW 1.25) we could add code that adds linebreaks on insert with
.
E.g.
<charinsert label="Foo Bar"><nowiki>Foo Bar</charinsert>
inserts
Foo Bar
In MW 1.27.1 these are returned as �. Subfader (talk) 12:27, 10 September 2016 (UTC)
- Hmm, does this work?
#x0A;
instead of#13;
- (Note: I am not a dev. I just poked around on google a bit, and also noticed that roundtripping
#13;
in parsoid resulted in#x0A;
...) Quiddity (WMF) (talk) 22:28, 12 September 2016 (UTC) - Tried it before. It's also not working, but differently:
:

does the linebreak in the links (but we want them in the inserted text):- Can't you try on mediawiki.org?
<charinsert label="Foo Bar"><nowiki>Foo Bar</charinsert></nowiki>
Subfader (talk) 10:06, 14 September 2016 (UTC)- I assume you've tried a raw linebreak, too?
- (I'm not comfortable with personally testing things on such a prominent interface element on mediawiki.org, and the CharInsert doesn't appear to be functional at Testwiki: or https://en.wikipedia.beta.wmflabs.org ... so I can't do testing there... :/ )
- I'll try to find a dev to take a look... Quiddity (WMF) (talk) 00:23, 15 September 2016 (UTC)
- 
 (newline) is much more correct than #13 (carriage return)
- I cant really reproduce what you are describing. It sounds almost like you are running into doBlockLevels() (aka pre formatting when you start a line with a space). Can you paste the exact code you are using?
- The syntax you are using is a bit odd. Nowiki is misnested, and you have a label attribute which isnt part of the extension...
- As an aside you can test charinsert on any page during preview. You do not need to edit mediawiki ns to test. Bawolff (talk) 18:40, 15 September 2016 (UTC)
- Meanwhile was changed to https://www.mediawiki.org/w/index.php?title=Extension%3ACharInsert&type=revision&diff=2239365&oldid=2235689
- This fixes it I guess. Just not when you want a working button. Add this button:
<charinsert><nowiki>{{Infobox | }}</nowiki></charinsert>
- Now I need to hack my label attribute back in...
- Thanks! Subfader (talk) 15:32, 17 September 2016 (UTC)
- Try killing the space between the and the |:
<charinsert><nowiki>{{Infobox&#10;|&#10;}}</nowiki></charinsert>
- Perhaps the extension should be changed so that charInsertHook() returns an array with first parameter the current return value and a
'markerType' => 'nowiki'
parameter. Bawolff (talk) 22:22, 19 September 2016 (UTC) - Fixed it already using the labels, thanks. Subfader (talk) 13:08, 2 October 2016 (UTC)
Exclude from Forms
Is it a way how to exlude (or not to include) Edittools page (with CharInsert) from Forms? Since CharInsert does not work there properly, at least on MW 1.27. I mean do not include in edit mode, in view mode Forms look fine. Pavel Malakhov (talk) 04:42, 15 September 2017 (UTC)
- Hi. Please could you clarify which specific Forms you mean? I don't think you mean Extension:InputBox which is the usual meaning that I'm familiar with, on wikimedia wikis. Thanks! (direct example links almost always help.) Quiddity (WMF) (talk) 17:07, 15 September 2017 (UTC)
- I mean form pages which are created with Extension:Page Forms...
- I have found out that is was my fault. I've added Edittools in MediaWiki:Summary for better access durint the editing. So this updated Summary massage was shown in forms as plain text without parsing by CharInsert.
- Solution: remove Summary from forms. Pavel Malakhov (talk) 10:03, 22 September 2017 (UTC)
Can you move the location of the Edittools box?
his might not be the most appropriate location for this query (I have also posted it to Mediawiki:Edittools, but is it possible to adjust preferences, skin, common.css etc to have the edittools/charinsert box ABOVE the edit window rather than below it? ElectricRay (talk) 14:44, 9 May 2018 (UTC)
- I posted a code there. There is also on Commons a default gadget which does this for the Wikieditor (converts them all). → User: Perhelion 12:53, 21 May 2018 (UTC)
- Excuse me, where can I see Commons a default gadget? Thank you! 101.26.42.115 (talk) 07:45, 25 May 2018 (UTC)
- c:MediaWiki:Edittools.js → User: Perhelion 08:32, 5 June 2018 (UTC)
MediaWiki:Gadget-Edittools.js needs to be updated
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
I believe the code in MediaWiki:Gadget-Edittools.js is broken after phab:T30856. Clicking on buttons prints the following error into browsers console:
TypeError: mw.toolbar is undefined; can't access its "insertTags" property
Dalba 14:27, 6 November 2018 (UTC)
- We fixed on fawiki with the following change: https://fa.wikipedia.org/w/index.php?title=%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C%3AGadget-Edittools.js&type=revision&diff=24787771&oldid=24786882 . Dalba 15:52, 6 November 2018 (UTC)
Suggestions for improvement of documentation
I am using the CharInsert extension on a local wiki installation. However I find the information in Extension:CharInsert#Notes confusing, not very helpful.
I actually found important information for customization at other places.
- https://en.wikipedia.org/wiki/MediaWiki_talk:Edittools#Customization_instructions
- https://en.wikipedia.org/wiki/Help:CharInsert#Customization
Following explanations:
- Use to add new lines (\n).
- I had to use
\\n
with double backslashes
- I had to use
- Enclose white spaces in nowiki tags when needed.
<nowiki>
tag might actually work (not sure here), however using just the dot sign.
is much more convenient
This is a great extension. Loved it
It is a very useful tool. Please do not obsolete it. RIT RAJARSHI (talk) 06:29, 6 April 2020 (UTC)
How to create a button
Hello. Is it possible to create a button like with simple text "Python code" and it would insert a piece of text like
<syntaxhighlight lang="Python"></syntaxhighlight> Fokebox (talk) 15:09, 17 June 2020 (UTC)