Open main menu

Extension talk:CharInsert

About this board

Archives 


MediaWiki:Gadget-Edittools.js needs to be updated

2
Dalba (talkcontribs)

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 (talkcontribs)

Can you move the location of the Edittools box?

4
ElectricRay (talkcontribs)

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)

Perhelion (talkcontribs)

I posted a code there. There is also on Commons a default gadget which does this for the Wikieditor (converts them all).

101.26.42.115 (talkcontribs)

Excuse me, where can I see Commons a default gadget? Thank you!

Perhelion (talkcontribs)
Reply to "Can you move the location of the Edittools box?"
24pm (talkcontribs)

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.

Quiddity (WMF) (talkcontribs)

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.)

24pm (talkcontribs)

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.

Reply to "Exclude from Forms"
Ineuw (talkcontribs)

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.

2A01:E35:8A8D:FE80:9A7:81B4:B3AB:846F (talkcontribs)

Not very informative.

Reply to "Just my personal comment"
Subfader (talkcontribs)

Previously (<=MW 1.25) we could add code that adds linebreaks on insert with &#13;.

E.g.

<charinsert label="Foo Bar"><nowiki>Foo&#13;Bar</charinsert></nowiki>

inserts

Foo
Bar

In MW 1.27.1 these are returned as �.

Quiddity (WMF) (talkcontribs)

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;...)

Subfader (talkcontribs)

Tried it before. It's also not working, but differently:

&#13;:

&#x0A; 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&#13;Bar</charinsert></nowiki>
Quiddity (WMF) (talkcontribs)

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...

Bawolff (talkcontribs)

&#x0a (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.

Subfader (talkcontribs)
Bawolff (talkcontribs)

Try killing the space between the &#10; and the |:

<charinsert>{{Infobox&#10;|&#10;}}</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.

Subfader (talkcontribs)

Fixed it already using the labels, thanks.

Reply to "Insert linebreaks?"

Character insertion stopped working after 1.25wmf14 rollout

4
George Orwell III (talkcontribs)

Subject says it all.

See task T86715 Regression: No longer able to insert characters using CharInsert gadget based on extension after 1.25wmf14 roll-out.

Londonjackbooks (talkcontribs)

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)

George Orwell III (talkcontribs)

"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.

Gigajoule (talkcontribs)
Reply to "Character insertion stopped working after 1.25wmf14 rollout"
Prod (talkcontribs)

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?

Quiddity (WMF) (talkcontribs)
Prod (talkcontribs)

What does this extension provide that the gadget doesn't?

Prod (talkcontribs)

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.

Reply to "Extension vs Gadget"

Instructions: CharInsert menu like the one used in English Wikipedia

4
AhmadF.Cheema (talkcontribs)

For CharInsert menu like the one used in English Wikipedia, mirror the following interface pages to your own Wiki:

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.

Quiddity (WMF) (talkcontribs)

Please do improve the documentation! It's just like a wiki article, all help is appreciated.

AhmadF.Cheema (talkcontribs)

Will do.

Thanks.

Hinote (talkcontribs)

Thanks!

White screen after editing localsettings

1
Laurentio~mediawikiwiki (talkcontribs)

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?

This post was posted by Laurentio~mediawikiwiki, but signed as Laurentio.

Reply to "White screen after editing localsettings"
Fuse809 (talkcontribs)

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=}}

to the page. Is there any way to add this functionality to this extension.

Thanks for your time,

Brenton

He7d3r (talkcontribs)
Fuse809 (talkcontribs)
Reply to "<charinsert> attributes"
Return to "CharInsert" page.