Extension talk:CharInsert/Archive

=2006=

wikibits.js
I've removed the note about wikibits.js, since it was misleading several people into believing they had to replace core skin files to get the extension working. Unfortunately, this often caused several other things to break. robchurch | talk 18:17, 13 December 2006 (UTC)

=2007=

It no works.

 * MediaWiki: 1.6.8
 * PHP: 5.2.0 (cgi-fcgi)
 * MySQL: 4.0.23a-log
 * Extensions:
 * Parser hooks:
 * CharInsert, allows creation of JavaScript box for inserting non-standard characters, by Brion Vibber
 * Extension functions:
 * setupSpecialChars
 * Parser extension tags:
 * is correctly connected to a MagicWord-hook and  is a existing Template)'' -Sent 11:31, 24 February 2007 (UTC)


 * I fixed this -in a way- by translating to UTF8
 * &amp;#123;&amp;#123;wiu|+&amp;#125;&amp;#125; &amp;#123;&amp;#123;&amp;#125;&amp;#125;
 * -Sent 12:43, 24 February 2007 (UTC)

newbie notes
As someone who is just starting out installing and using Wiki's (as in I just started today) I thought I'd add some notes for those who are just getting going and save the hour I just wasted trying to figure out what to do.


 * Download the php file.
 * Create a folder on your server in /extensions called CharInsert
 * dump the php file there
 * add the require_once("$IP/extensions/CharInsert/CharInsert.php"); line to the LocalSettings.php file in your root.

Thats the install

Now to edit the Edit page

go to: index.php/MediaWiki:Edittools?action=edit

This brings up the editor interface allowing you to edit text that will be displayed at the bottom of every Edit page.

Put in this text and save.

--28 February 2007


 * OR ANY OTHER TEXT, e.g. the one you may have derived from MediaWiki: Edittools
 * --Horst Salzwedel 23:52, 21 October 2007 (UTC)


 * It is just does not work. I did everything like you. Added line in localsettings.php, put charinsert.php in charinsert newely created folder in extensions. Is it about permissions for file? I did changed permission to 777. Do not work. Please help.--71.111.53.144 20:25, 11 July 2007 (UTC)


 * Thanks for the information! The part about editing the edit page should be on the main installation for further clarification. Note, you can also copy the source from http://en.wikipedia.org/w/index.php?title=MediaWiki:Edittools&action=edit for more options as well. 159.39.19.254 16:03, 16 August 2007 (UTC)


 * Really useful information, thanks! This should be on the main page.  --Robinson Weijman 16:13, 19 June 2009 (UTC)

Using CharInsert for commonly-used images
Is it possible to extend CharInsert to provide a "palette" (for lack of a better term) for commonly-used images in a wiki? I'd like the box to show the actual image that will be inserted into the entry, and upon click, would insert the appropriate wiki code to insert the image into the article.

I've goofed around with it some, but it always displays the text of the insert, and never the image I'm trying to call. --Achernar Dni 04:44, 8 August 2007 (UTC)

Some characters are not displayed correctly
I noticed that some characters weren't displaying at all and just gave me the usual � in FF (and rectangles in IE) that you would see if you lacked the fonts and/or language support necessary. I know that couldn't be the case, as they all displayed just fine on a Wikipedia edit page, and what I was using on my own wiki was a direct copy from what Wikipedia had.

The symbols in question that would not display for me were:

† à Š Ġ ム Π Р ɠ ˠ

While they would not display at all in the CharInsert toolbox, they do display just fine when viewed in the edit box or when written outside of the box. This same set of symbols exhibited the same behavior on another MediaWiki installation I have on another computer, also running on a Windows platform. --87.168.116.1 20:27, 8 September 2007 (UTC)


 * Same here, it displays fine in the edit window but not when rendered outside of the window. Characters: ≠ † ɠ à and some more. Could that have something to do with the MySQL database? Is this a MySQL5 bug? --84.176.183.153 09:56, 5 October 2007 (UTC)

The problem exists only on a Windows-platform (and Solaris), it works fine on a Linux(debian) platform.

I tried to analyze it and I find that the problem arises from a wrong behaviour of the php function preg_split that recognizes as a white space one of the two byte-codes of utf-8 code of these characters. So a workaround on a windows-platform is to substitute the following line (line 55 in file charinsert.php) preg_split( '/\\s+/', charInsertArmor( $data ) ) ) ); with split(' +', charInsertArmor( $data ) ) ) ); It has one limit: you can use only a space as character-separator.

--85.18.66.28 16:31, 20 November 2007 (UTC)


 * You can also use the following code with PHP 4.2.3 or higher:

preg_split( '/\\s+/u', charInsertArmor( $data ) ) ) );
 * The 'u' at the end of the pattern enables UTF-8 mode for the 'preg_split' function, solving the problem described above. --147.83.123.130 10:59, 27 November 2007 (UTC)

Non-inserted but clickable text
Is there a way to add text within the charinsert tag that is shown but not inserted when clicked? For example, some IPA characters (such as stress marks) are very small and hard to click on. I'd like to have "stress mark - '" shown below the edit box, but only the ' mark inserted. --18 September 2007


 * You found a solution in the meantime? --Lastwebpage 17:09, 3 May 2011 (UTC)


 * https://bugzilla.wikimedia.org/show_bug.cgi?id=23354 --Subfader 17:11, 4 May 2011 (UTC)

Tooltips for CharInsert
Along the same lines... how about adding support for tooltips in CharInsert... I see it has been talked about in https://bugzilla.wikimedia.org/show_bug.cgi?id=3550 ... the discussion kinda got derailed by talk of where to lookup the names of symbols to display.... but that is beyond the point... the CharInsert Extension would benefit by supporting tooltips... the issue of where the tooltip text comes from can be left up to whoever is writing the

actually be something like this?



When I used "include" mediawiki kept telling me that it was trying to redeclare it's own functions (but only when logging in for some reason.)

I would just edit it, but don't want to make anyone angry... --6 December 2007


 * Seems to have been corrected: "require_once" appears in the instructions. Fabricebaro 17:45, 1 February 2010 (UTC)

How Can I add space to the text that I want to insert ?
I found out the chars are separated with spaces,then how can I add space to my text? I want to insert this text: ''' please help me about this issue, this is an example :

--Tofighi 06:40, 18 December 2007 (UTC)


 * Ise  tag. I've just added this info on the page. Btw you could just tak a look at the w:MediaWiki:Edittools source Alex Smotrov 23:09, 18 December 2007 (UTC)

=2008=

Having some trouble.....
i am getting the following error when i try and load my special pages after installing this extension: Warning: MessageCache::require(/usr/local/psa/home/vhosts/nautf.com/httpdocs/mkportal/modules/mediawiki/extensions/CharInsert.i18n.php) [function.MessageCache-require]: failed to open stream: No such file or directory in /usr/local/psa/home/vhosts/nautf.com/httpdocs/mkportal/modules/mediawiki/includes/MessageCache.php on line 699 Fatal error: MessageCache::require [function.require]: Failed opening required '/usr/local/psa/home/vhosts/nautf.com/httpdocs/mkportal/modules/mediawiki/extensions/CharInsert.i18n.php' (include_path='/usr/local/psa/home/vhosts/nautf.com/httpdocs/mkportal/modules/mediawiki:/usr/local/psa/home/vhosts/nautf.com/httpdocs/mkportal/modules/mediawiki/includes:/usr/local/psa/home/vhosts/nautf.com/httpdocs/mkportal/modules/mediawiki/languages:.:/usr/local/share/pear') in /usr/local/psa/home/vhosts/nautf.com/httpdocs/mkportal/modules/mediawiki/includes/MessageCache.php on line 699 --18 February 2008
 * It appears CharInsert.i18n.php is missing in extensions/, which is where the software expects it... Siebrand 23:21, 18 February 2008 (UTC)
 * there is only one thing to download though on the extension page. where do i find that other file? 74.181.117.58 05:11, 19 February 2008 (UTC)
 * I'll update the documentation. Cheers! Siebrand 13:58, 19 February 2008 (UTC)


 * I find that commenting out the line
 * "$wgExtensionMessagesFiles['CharInsert'] = $dir . 'CharInsert.i18n.php';"
 * fixes special pages without sacrificing functionality. --Markus 12:08, 22 February 2008 (UTC)
 * Yep. You just removed i18n support from the extension. Siebrand 22:21, 22 February 2008 (UTC)

New function request: To make a link that the surface text differs from the inserting text
Currently, surface text of CharInsert links is same with the text that will be inserted in text boxes. For instance, if a CharInsert link is a button to insert “ ”, the surface text is always “ ” not “ ”, etc.

This "enforcement of unity between texts" can cause a problem when making CharInsert links that input special characters (e.g. Combining Diacritical Marks). CharInsert button to insert those special characters should have different texts. Of course, we can alternate them to character reference codes, but it is not convenient. ― Yes0song 13:21, 2 March 2008 (UTC)


 * See also 3821. ― Yes0song 13:57, 9 March 2008 (UTC)

Has this been fixed? If so how do I do it? I'd like to add some longer code in the edittools section without it appearing there. For example I want the user to be able to click on category names on the edit tools panel and have the entire code with category name go into the edit box. --Bluesoju 11:58, 15 June 2009 (UTC)


 * Has not been added yet. Would be use ful for longer code like tables etc. --Subfader 14:18, 15 June 2009 (UTC)

Real Javascript insert
You cannot use this to insert long text :( I would like to see it being a real javascript insert funtion:

clicking the "Link text" link will insert before cursor| and after cursor while | is your cursor position --Subfader 20:26, 17 March 2008 (UTC)
 * Please be more specific, "long text" is too vague. You can insert new lines with . —AlexSm 05:26, 18 March 2008 (UTC)
 * Well, mainly I want to insert text like [[Category:X]] . All extensions i found supporting insert text "store the text on wiki pages what makes those pages included into the ctagories, e.g. Category:X. But they shouldn't show up ther and I cannot use or cos those would be inserted... So the best may be to call the insert text from php files at the moment the extension is used. Is there a solution? --Subfader 19:16, 19 March 2008 (UTC)
 * Did you actually verify that &lt;charinsert> Category:X&lt;/charinsert> places the page in Category X? As far as I know, it doesn't. Even if it did, you can use &lt;nowiki> inside &lt;charinsert>. By the way, inserting  02:53, 20 March 2008 (UTC)
 * Problem solved. Thanks anyway. --Subfader 10:01, 28 March 2008 (UTC)

More than one place where text should be used
Hi, my question is the following: I make heavily use of the namespaces. Because of that I often need to set a link like Title. Is it possible to modify the extension in that way, that if you highlight TITLE it puts title before and after the |? i tried but then anything behind the | dissapears. --8 May 2008


 * Hi, o make this extension work on multiple textareas you need to grab the function insertTags(tagOpen, tagClose, sampleText) from skins/common/edit.js and copy it to a new function let's call it function insertTagsToTextArea(tagOpen, tagClose, sampleText, textAreaNumber). at the very beginning of that function there's an If clause that identifies the textarea to edit. Substitute it with:


 * and the game is done, you've to go a bit more complex than this though, for example to avoid an index out of bound exception in the textareanumber. But that's basically the game done. It should be also interesting to see how to make the client's browser include this new function without modifying the edit.js which is a core one from mediaWiki.


 * regards, --DonGiulio 13:14, 9 December 2008 (UTC)

bug in CharInsert.i18n.php
CharInsert.i18n.php has some ' on places that it shouldn't. Recent changes link (in navigation) doesn't function properly because this.

Curious why Mediawiki:edittools isn't effected. Livingtale 14:58, 2 June 2008 (UTC)

Icons on top and bottom of this page
This adit page has a fine toolbar. I discovered that it is called: edit page toolbar. But I have not the slightest idea where and how to get it on my own pages.

The buttons below I did discover, and that's why I visited this page: you need the extensions from this page. Use and make Mediawiki:Edittools.js. Only when you want it to be as nicely as here, you need css as well. Can anyone gife the code for: and In which css file should they be placed? Livingtale 18:00, 2 June 2008 (UTC)
 * class="my-buttons"
 * class="specialbasic"

I discoverde after a tip that "my-buttons" is part of common.css. And that installation of the "edit page toolbar" goes alond with it.

Remains the question where to find "specialbasic" and a way to edit the "edit page toolbar" --Livingtale 08:02, 5 June 2008 (UTC)

bug in Mediawiki:Edittools.js
One bug I want to report in the 'buttons' of Mediawiki:Edittools.js: One of the 'actions' is this one: · + stands for the selected text. Double + should mean that the selected text is copied. But instead of doing this, it breaks of at the second +. I see three possibilities: --Livingtale 08:02, 5 June 2008 (UTC)
 * 1) another script is needed to do this properly (in http://www.mediawiki.org/w/ the second + doesn't work either, but it doesn't brake of - the]] do appear)
 * 2) it's really a bug  - the second + shouldn't be there
 * 3) it's really a bug: some code/script is forgotten or doesn't work properly
 * 4) I don't use it the way it is intended

Additional charsets?
Can anyone advise on where to find extra character sets and the describe how to load them? Obviously, I think I would just type them using a keyboard that was configured for the characters and use the same coding format as for all the other sets.

I've never done something like that - so I am only guessing. Any further hints?

--Qaaz 6 June 2008

adding sub or superscript chars
I've like to display just the superscript + character in CharInsert and then when the user clicks on it, it actually puts in the + string. Seeing the whole string listed takes up a lot of room in the edittool page! The subscript 2,3, etc. are also used a lot in chemistry. Any clues how to do this? --Stuart Halliday 11:25, 19 October 2008 (UTC)

Using Charinsert in a page with multiple text areas
Hi,

In my site I use semantic forms which creates html forms to have two text areas in a page. I'd like to use charinsert along with each one of the text areas.

I tried to put the charinsert tags in the page close to each text area, but the result is that where ever I click the characters are inserted always in the first text area. While I'd like to be able to visualize the charinsert tags twice, close to each text area and when I click on a link the chars are added to the correspondent text area.

Anyone has an Idea on how to solve that?

thanks, --DonGiulio 11:22, 22 November 2008 (UTC)


 * yeah I answered to myself here. --DonGiulio 13:16, 9 December 2008 (UTC)

bug: charinsert doesn't check if edit.js is imported
Hi,

I'm trying to use charInsert together with semantic forms here but it doesn't work.

Investigating on the issue I realized that in the page the skins/common/edit.js has not been imported by the browser, but it's necessary for char insert's 'insertTags function call.

Semantic forms doesn't make use of it, so it doesn't include it, charinsert assumes that it's included already. The result is that nobody includes it and, charinsert doesn't work properly with semantic forms.

I think it would be good for both extensions to be compatible with each other.

How to fix this?

thanks, --DonGiulio 13:29, 9 December 2008 (UTC)

Hebrew diacritics
See the discussion at s:MediaWiki talk:Edittools.

When this extension is used for adding Hebrew diacritics, the cursor goes back.

Is it a known problem? --Amir E. Aharoni 18:22, 21 December 2008 (UTC)
 * Filed a bug: 16900. --Amir E. Aharoni 08:49, 6 January 2009 (UTC)

=2009=

Applying Dropdown
It would be very interesting to add some info refering to this comment. It have been very useful to apply into my wiki. --Neoshinji 00:35, 7 January 2009 (UTC)
 * To avoid problems using another javascript files check the files Onlyifediting.js and Common.js and dont forget to copy the function Includepage.--Neoshinji 01:43, 9 January 2009 (UTC)


 * Thanks for the tip! The en-wiki solution (Common.js + Common.js/edit.js + Edittools.js + Edittools) didn't work in my wiki for some reason, but the solution you gave above worked as a charm. Capmo 02:58, 30 April 2010 (UTC)
 * PS: Just to make it clear, the JavaScript solutions above don't require the installation of extension CharInsert.

Insert ZWNJ
I want to insert "zero width non-joiner" how can I use charinsert? --Alisabzevari 10:27, 22 April 2009 (UTC)

Insert HTML entities
I think that we should have HTML entities inserted when HTML entities are in the source. The problem I have is due to some charsets won't work properly. For instance, "&mdash;" is inserted as literal text (not an entity) in a iGoogle gadget I know of. But it comes up as "?".

Example:

This would show "&mdash;" in the link, but insert "&amp;mdash;" in the code. Will 17:00, 14 October 2009 (UTC)

=2010=

Insert a table
I would like to add a basic table code to my Edittools. However space and returns don't work well (they get separated as individual buttons). I found the solution by going through this talk page: replace spaces with     and new lines with   Here is the line you should add to Edittools: (see source for the actual text to copy/paste)

Fabricebaro 18:08, 1 February 2010 (UTC)


 * Splitting the displayed text from the inserted code was requested long time ago and is still unsolved. I opened a request here --Subfader 13:05, 30 April 2010 (UTC)

Not working
Idem for me, neither the tag nor the extension appear in Special:Version.
 * MediaWiki 	1.15.1
 * PHP 	5.2.13 (cgi)
 * MySQL 	5.0.81-log

JackPotte 18:06, 13 May 2010 (UTC)


 * Please check if you have copied all files to a folder called /CharInsert below folder /extensions, and that you have correctly added the require_once line to your LocalSettings.php file. Remember that the require_once should be added near the end of this file. Capmo 04:19, 20 May 2010 (UTC)
 * Yes, I did both with the last version, as I could install the other modules. JackPotte 07:28, 20 May 2010 (UTC)
 * I suppose you're trying to install this in order to use Edittools. If so, then check this alternative solution that doesn't require the use of extensions. Capmo 14:38, 20 May 2010 (UTC)
 * Thanks but it's still not working, maybe for the same reason... JackPotte 18:14, 20 May 2010 (UTC)
 * Are you using all that code inside Common.js? I'd suggest that you remove everything but the call to Edittools.js. If it works after that, then begin adding the functions you need one by one to until you find where is the problem. I also had trouble trying to make my Common.js work with code imported from wikipedia, and decided to remove it all leaving only the basic. For instance, near the middle of your Common.js there is a code

if( wgAction == 'edit' || wgAction == 'submit' ) { importScript( 'MediaWiki:Common.js/edit.js' ); }
 * that is doing basically the same as the call you added on top (but this time to call script Common.js/edit.js), but this sintax above didn't work in my wiki. Capmo 23:38, 20 May 2010 (UTC)
 * OK, but now even with a minimum Common.js it's failing... Sorry but I've tried the maximum. JackPotte 13:27, 21 May 2010 (UTC)

=2011=

Advanced Installation
CharInsert is a fantastic tool and well customisable. From the given directions however, including the discussion page, I found it took too much research to understand the advanced way how this site as well as the german and english wikipedias implement it (modified looks, dropdown menu). That's why I added this chapter. Hope it's correct and not overexplained. --BRFR 14:48, 16 January 2011 (UTC)

Position of the tool bar
Is there a way to show the toolbar above the edit box and not below like it is done actually?--Tsouchon 15:40, 18 March 2011 (UTC)
 * Sure... the answer is already there. Second sentence: "These links are usually used in MediaWiki:Edittools system message" and under Notes: "Generated JavaScript links also work in other areas around edit window, e.g. in MediaWiki:Copyrightwarning or MediaWiki:Newarticletext, on the page preloaded with Inputbox, and even from the text preview." ... That means any other system message is suitable as long as Mediawiki shows it on the create/edit page. Improve the description if it's not clear enough (happens all the time). Of course, if you need more choice, you can create your own skin (don't change the skins that come with MW!) and your own system message and place the buttons anywhere you need them. --BRFR 12:12, 19 March 2011 (UTC)
 * Ok thanks for your answer. If a want to create a new system message and make a new version on the skin, what should I do? --Tsouchon 21:54, 8 May 2011 (UTC)

CharInsert e CategoyTree
It is possible to use

(Line 1466 mentioned in the error message is highlighted). The variable  isn't used or defined anywhere else within the page, so it must be set by the line. Otherwise, it could just remain blank, and so generate the "Empty regular expression" error. To work around this, I modified Linker.php to comment out  and the closing brace three lines below it, so that   is populated with a value in all instances. I don't know if this will cause other issues, but it seems to work for now. I've raised bug 31130 for this. --Adamcox82 05:48, 24 September 2011 (UTC)

Bad page scroll in MW 1.18.0 with IE9
Hi. Summary: After a Preview or Show_changes, any use of the ChartInsert button insert the tag (ok) but scroll the page to the top! very far from the EditingArea :(

Example: This site & this page ;) / Edit / GO anywhere in EditArea / Press " – " button (by example) / " – " added in text / ok

Now: Press Show_preview / repeat same insertion sequence / " – " added but the page scrolled to the top! Unusable :(

I don't have this problem with FireFox (8) nor Chrome (16), only Internet Explorer (9), but at least half my visitors use IE…

--180.183.187.226 03:27, 24 December 2011 (UTC)
 * This is a problem of the insertTag function. --91.34.68.190 10:47, 20 February 2012 (UTC)

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!