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)

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

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

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)

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)