MediaWiki talk:Edittools

From mediawiki.org
Latest comment: 7 months ago by Shirayuki in topic Quote marks for tvars

Edittools installation summary[edit]

You need sysop right to create and edit these files. Save everything, refresh your browser cache, then try editing some page. Those steps work for me at least. I get the edittools with button and drop down list. These instructions are gathered from the discussion below. Thanks for your comments.

very helpful! thank you! Igottheconch 20:25, 25 November 2011 (UTC)Reply

Continuing issues with Form Button/Drop down - Solved![edit]

(See the end of this post for solution)

I have tried the Edittools with CharInsert installed and showing on the Version page. Just as in the Edit page for this Discussion and others, the Standard character buttons appear below - but no drop-down to change to other style such as Arabic, Greek, etc.

I have done the following:

  • Installed CharInsert (shows on Version page and render the chars in a simple manner)
    • Because CharInsert nuked the Special page, I commented out
"$wgExtensionMessagesFiles['CharInsert'] = $dir . 'CharInsert.i18n.php';"

This also blocked the Js formatting from the changes as list below.

  • Created my own MediaWiki:Edittools and pasted the code from this MediaWiki:Edittools.
  • Created my own MediaWiki:Edittools.js and pasted code from the page with the same name here.
  • Created my own MediaWiki:Common.css and placed css section per the instructions.
  • Created my own MediaWiki:Common.js and have tried both calls to Edittools.js

Again, if you go to the Edit page for this Discussion page, my Edittools appear along the bottom the exact same way, except there is no drop-down box with Standard etc in it.

I have verified the $wgScript and $wgScriptPath (these are on a localhost - not yet uploaded to live server)

$wgScript = "/m/index.php"

$wgScriptPath = "/m"

What could I be missing?

Thanks!

Qaaz

Try checking function "includePage" in your MediaWiki:Common.js which should be the following::
function includePage( name )
{
 document.write('<script type="text/javascript" src="/m/index.php?title='
  + name 
  + '&action=raw&ctype=text/javascript"><\/script>' 
 );
}
--Kaganer 21:34, 27 May 2008 (UTC)Reply

This doesn't work. I have been trying that and as many different variations of that as I could come up with - it simply does not make it work.

I see Edittools.js uses an event "onload". In Common.js for another extension, I use:

 addOnloadHook(CustomizeModificationsOfSidebar);

Could this conflict?

Could there be something wrong with the code in MW:Edittools or Edittools.js? Are there any settings that need to be set correctly that could be different in your implementation and mine?

Thanks for your help!

P.S. Also I am using an extension for multiple uploads (Extensions:MultiUpload) - when I bring up that special page, the buttons also appear at the bottom of that page as well.

Qaaz

Based on my post and the two posters below having the similiar problem, I read the solution as "Try replace function "includePage" to custimised version:

 function includePage( name )

The confusion arises in that both the original code had the call to the function but not the definition. I misunderstood the instructions as replace the old "includename" line of code with the new code! I need both obviously!! So the whole code to add to MediaWiki:Common.js is:

function includePage( name )
{
 document.write('<script type="text/javascript" src="' + wgScript + '?title='
  + name 
  + '&action=raw&ctype=text/javascript"><\/script>' 
 );
}
/* End of includePage */
 
 
/* Including extra .js pages */ 
 
// switches for scripts
// TODO: migrate to JSConfig
// var load_extratabs = true;
var load_edittools = true;
 
// extra drop down menu on editing for adding special characters
includePage( 'MediaWiki:Edittools.js' );

Works great now! Thanks for the great extension!

Qaaz
Congratulations on winning! I am going to rewrite this page to FAQ-style. --Kaganer 10:31, 29 May 2008 (UTC)Reply

How do I disable this?[edit]

For hide (no traffic economy) this pane, add following string for your personal CSS file:

.mw-editTools {display:none}

For ability to disable Edittools need support this bug. --Kaganer 18:08, 17 December 2007 (UTC)Reply

Form Button doesn't work on my Wiki[edit]

I just get the first set of options and no form or button. What am I missing here? Is it possible that this is due to the fact that I am using version 1.12alpha? Susan 17:38, 12 February 2008 (UTC)Reply

This functionality almost "version-independent". For correctly working this toolbox (as is the case here) need following:
  1. install extension Extension:CharInsert (supporting "charinsert" tag)
  2. create MediaWiki:Edittools.js
  3. place into MediaWiki:Common.js calling of MediaWiki:Edittools.js; as example, in section "Including extra .js pages" (swith "load_edittools" need set as "true"):
/* Including extra .js pages */ 
// switches for scripts
var load_edittools = true;
 
// extra drop down menu on editing for adding special characters
includePage( 'MediaWiki:Edittools.js' );
  • copy section "extra buttons for edit dialog" from MediaWiki:Common.css into your MediaWiki:Common.css (used for decorating Edittools buttons)
All these actions are fully implemented? --Kaganer 10:07, 13 February 2008 (UTC)Reply
See also simple format this toolbox in w:en:MediaWiki:Edittools - without scripts; only Extension:CharInsert needed. --Kaganer 10:12, 13 February 2008 (UTC)Reply
I have now implemented all of the above, and all of my choices now have buttons. However, the dropdown is still not appearing -- which is mainly what I wanted. I copied all of MediaWiki:Common.js just in case. Still no dropdown. Susan 14:27, 13 February 2008 (UTC)Reply
P.S., I have learned a lot, though.
Hmm. Check function "includePage" in MediaWiki:Common.js is return the correct path for called .js files - for your wiki. For mediawiki.org this function return path:
wgScript + '?title=' + name
where "wgScript" - variable, configuring through LocalSettings.php. Value by default: «{$wgScriptPath}/index.php», with default value of "$wgScriptPath" = «/wiki» (but on wikimedia projects value = «/w»).
Therefore, full correct path for mediawiki.org will be (name of called file ="MediaWiki:Edittools.js"):
/w/index.php?title=MediaWiki:Edittools.js
Please сheck these settings for your wiki. Or try purging cache...--Kaganer 18:49, 18 February 2008 (UTC)Reply
I see your wiki. Correct result will be (before "&action...") = "/genwiki/index.php?title=MediaWiki:Edittools.js". Try replace function "includePage" to custimised version:
function includePage( name )
{
 document.write('<script type="text/javascript" src="/genwiki/index.php?title='
  + name 
  + '&action=raw&ctype=text/javascript"><\/script>' 
 );
}
--Kaganer 19:05, 18 February 2008 (UTC)Reply

....I tried hard, but I also failed to install it completely on http://wiki.gorebiobio.cl ....any idea what I might have done wrong? It s a pity because I like the drop down box much more than the long page with all characters....Thanks in advance for any hint. --Horst Salzwedel 01:11, 23 March 2008 (UTC)Reply

I had the same problem, my drop down menu didn't show up, just the first standard character set. I cleared my browser cache and tadaa...! Cheers, --Till Kraemer 20:54, 22 March 2009 (UTC)Reply

Nowiki[edit]

Any nowiki additions on here? -PatPeter, MediaWiki Support Team 22:26, 1 March 2008 (UTC)Reply

I not understand this question :( --Kaganer 19:43, 2 March 2008 (UTC)Reply
The system message lists <includeonly></includeonly> <noinclude></noinclude> but not <nowiki></nowiki> and <onlyinclude></onlyinclude>. -PatPeter, MediaWiki Support Team 22:52, 11 March 2008 (UTC)Reply

How do you install these js files[edit]

I am not understanding where you would install these js files to work. Do I generate the js files and place them in the wiki root? What file do I add there call to? Index.php in the wiki root?


More information would be helpful.

24.249.248.8 11/17/2008 djdubuque

No. Needed
  1. create on your wiki standard editable wiki-page with name MediaWiki:Gadget-Edittools.js (sysop rights required)
  2. create MediaWiki:Gadget-site.js (standard editable wiki-page)
  3. add edittools definition into MediaWiki:Gadgets-definition and description into Special:Gadgets


Tutorial[edit]

I had the same question and the linked tutorial gives very detailed steps. Only in step 4 the wording must be adapted to "Styling for links generated by MediaWiki:Edittools"-section.

Although some of the pages used there have been moved, the code is most likely the same and it is functional.

Sm8ps (talk) 23:02, 14 August 2013 (UTC)Reply

OK, thanks. --Kaganer (talk) 20:04, 30 August 2013 (UTC)Reply

Current setup procedure[edit]

Tested in February 2017

  1. Install CharInsert extension Extension:CharInsert
  2. Create the gadget pages
  3. CSS: add the appropriate style lines from https://www.mediawiki.org/wiki/Extension:CharInsert#Styling or MediaWiki:Gadget-site.css to your MediaWiki:Common.css
  4. Add gadget entry to MediaWiki:Gadgets-definition
    • * Edittools[ResourceLoader|default]|Edittools.js
  5. English Wikipedia uses a slightly different setup, check Extension:CharInsert#English_Wikipedia_CharInsert_menu
    --Escalatr (talk) 10:44, 15 February 2017 (UTC)Reply

Problem on preview after changing Edittools[edit]

I followed all the points of Form Button doesn't work on my Wiki to use the Edittools and Charinsert, they works on edit but when I try to show the preview the connection to the server is cancelled. I don't know if I missed something or I made an error on configuration.
My server has the following software installed: MediaWiki 1.13.3, PHP 5.2.0 (apache2handler), MySQL 5.0.27-community-log
EDIT: Seem that the problem occurs only on pages which weight more than 9KB
Thank you for any help, Wolf01

Missed Step[edit]

I had to do this in my LocalSettings.php file:

require_once("$IP/extensions/CharInsert/CharInsert.php");

This step is required in the CharInsert installation instruction :) Fabricebaro 20:32, 19 January 2010 (UTC)Reply
I'd like to see complete babysteps within single page (either here or on CharInsert page). Also, there is probably one more missing step, because internationalization didnt work despite of language listed in the i18n file. 23:45, 1 August 2010 (UTC)

spcae in chars[edit]

is it possible i add <div dir="ltr">+</div> button? vahid 14:28, 11 April 2010 (UTC)Reply

only over {{subst :rtl}} / {{subst :ltr}} construction, ok? Space character between "div" and "dir" is prevents the normal work of Charinsert Extension (replacement to html-acronym does not solve the problem). --Kaganer 21:15, 11 April 2010 (UTC)Reply

English Wikipedia–style Edittools[edit]

Can anybody tell me how to get the special characters toolbar exactly like the one in English Wikipedia? I installed the CharInsert extension and tried copying the code from MediaWiki:Edittools and MediaWiki:Edittools.js but it just seemed to ignore the latter. I didn't see any CSS references in it that I would need to copy as well (i.e. something from MediaWiki:Common.js). –CWenger 22:14, 4 May 2011 (UTC)Reply

In the en-wiki Edittools.js is called from Editpage.js, which is called from Common.js/edit.js, which is called from Common.js ;) --Kaganer 17:55, 5 May 2011 (UTC)Reply
Of course! Not sure how I missed this obvious configuration. :-) –CWenger 21:22, 6 May 2011 (UTC)Reply
Now worked? More help is needed? --Kaganer 10:35, 11 May 2011 (UTC)Reply
Hi. I hope it's not a long shot, but is it possible for another Wikipedia to use the very same WP-en Edittools, with buttons as in MW? --Zack 12:35, 28 August 2011 (UTC)Reply
Only buttons style from MW? I think it's not very difficult. --Kaganer 13:03, 28 August 2011 (UTC)Reply
Well, in the WP-en, you can switch between Edittools contents using using downward pointing arrow, plus when you preview/refresh your page, the content doesn't change. --Zack 13:45, 28 August 2011 (UTC)Reply
Excuse me, but I probably do not fully understand your problem. You do not work properly switching between items in the drop-down list in the en-WP? I do not watch this problem (in Google Chrome) in the en-WP or this wiki. Or a problem on another site with "en-WP-style" EditTools? I do not have access to edit the system messages in the en-WP, please contact with en-WP admins. If about another website - please give URL. NB: For using drop-down list need to have your browser has been enabled Javascript. This is done? --Kaganer 16:46, 28 August 2011 (UTC)Reply
I'll explain:) In the Edittools of Mediawiki, when I want to go for example from Standard to Latin, I have to click Standard so as for the menu to appear, and then click again on Latin. However, in the English Wikipedia, I just have to use the up/down arrow to choose and the content appears automatically, and I don't have to click or press Enter.
What I want to know for now is: What do I have to do to use the WP-en Edittools style in my home Wikipedia? Do I just have to copy Mediawiki:Edittools and Mediawiki:Edittools.js or is there any thing else?--Zack 18:23, 28 August 2011 (UTC)Reply

Please add ẞ[edit]

Please add the uppercase sharp s (ẞ) to MediaWiki:Edittools. it appears at two places, which I've copied here and updated, so you should be able to copy&paste the two altered lines from here:

<p class="specialbasic" id="Latin" style="display:none">
…
<charinsert>ß ẞ </charinsert> ·
<p class="specialbasic" id="German" style="display:none">
<charinsert>Ä ä Ö ö Ü ü ß ẞ</charinsert>
</p>

Thank you --Purodha Blissenbach 11:27, 14 January 2012 (UTC)Reply

Yes Done by Petrb. --Kaganer (talk) 12:20, 29 February 2012 (UTC)Reply
What is that character? It doesn't render on my Windows Vista machine running FireFox 19.0.2 T13   ( C • M • Click to learn how to view this signature as intended ) 13:37, 28 March 2013 (UTC)Reply
Please select "Latin" item in the expanded menu. --Kaganer (talk) 17:29, 28 March 2013 (UTC)Reply
All I see is a little box with 1E on top of 9E inside it. T13   ( C • M • Click to learn how to view this signature as intended ) 17:48, 28 March 2013 (UTC)Reply
I don't understand. Please give me link to screnshoot. --Kaganer (talk) 19:37, 28 March 2013 (UTC)Reply

Problems defining some wiki markup tools.[edit]

In an older version of MW (1.9.3) I was using MediaWiki:Edittools to define some tools to help in editing.

<charinsert><font(& #32;)color=red>+</font></charinsert>  

The entry above would allow me to mark some text and wrap the <font color=red>... </font> around some text. Recently I needed to move the wiki and upgraded to version 1.19.1... only to find that the command above does not work properly. It would seem that the "& #32;" is no longer recognized and so it breaks up the command into two entries.

I searched this site and found some text saying that the Font command had been depreciated... and I should use <span style="color:red"> ... </span> instead. Unfortunately I need the "& #32;" for this too. Does anyone know of a workaround for this?--TDeeming (talk) 13:23, 17 July 2012 (UTC)Reply

I see this bug. There is a reason why you need to insert a direct html-formatting instead of using of wiki-template? --Kaganer (talk) 14:14, 17 July 2012 (UTC)Reply
While the changes you made to the MediaWiki:Edittools look okay on the page itself. When it is used on another page...like this one... the buttons are broken at the space between <span and style="color:red;></span>.
Yes, I are seen. New bugreport is already opened. --Kaganer (talk) 09:47, 18 July 2012 (UTC)Reply
In regards to your answer... I am not sure what you mean about using of wiki-template. Can you explain... Thanks --TDeeming (talk) 06:04, 18 July 2012 (UTC)Reply
Standard solution for this case:
  1. Create page in the namespace "Template:", with his name like "Template:Red" and code: <span style="color:red">{{{1}}}</span>
  2. Add into MediaWiki:Edittools new section with code <charinsert>{{Red|+}}</charinsert>
See new example in the Edittools here ("Standard" section, right button). Why not do so? --Kaganer (talk) 09:47, 18 July 2012 (UTC)Reply
Thanks for teaching me! This works great and I think I can use it for my other shortcuts too! It is also probably more understandable to other users too. --TDeeming (talk) 10:10, 18 July 2012 (UTC)Reply
great, best wishes ;) --Kaganer (talk) 10:25, 18 July 2012 (UTC)Reply
Yes Done, but bug with using of "& #32;" is still exist and should be fixed. --Kaganer (talk) 10:25, 18 July 2012 (UTC)Reply
Solution: You have to enclose templates and spaces inside "nowiki" if they should become one button. See example made by User:Krinkle (removed from current version).

How do I create a multiple word button with spaces in it?[edit]

How do I create a single button for Foo Button with the space in the middle? I have a few templates with more than one word on my wiki I would like to create buttons for like "Feather Falling" and "Boon of Undeath". -- ShoeMaker   ( Contributions Message )   01:49, 23 July 2012 (UTC)Reply

By deafault, separate different symbols by space, each symbol will become a separate button. You have to enclose templates and spaces inside "nowiki" if they should become one button. See example made by User:Krinkle (removed from current version). --Kaganer (talk) 08:43, 23 July 2012 (UTC)Reply

Personalising[edit]

Is it possible for users to personalise edit tools, just as one can customise Common.js? Remigiu (talk) 16:49, 30 September 2012 (UTC)Reply

I came to ask the same. –Quiddity (talk) 01:41, 9 May 2014 (UTC)Reply
Me too. Noone knows? --Wesalius (talk) 13:06, 30 August 2014 (UTC)Reply

Edit request[edit]

I'm using this on my wiki and have found that this line

<code><charinsert>… ~ | °  </charinsert> ·</code>

requires nowiki tags around the &-n-b-s-p-; - otherwise you don't get a non-breaking space.

Yes Done. Thanks! --Kaganer (talk) 20:31, 13 January 2013 (UTC)Reply

redundant &nbsp[edit]

Please remove trailing &-n-b-s-p; in line 5 -- it breaks down alignment of the corresponding line of Edittools buttons. Hinote (talk) 12:26, 14 July 2013 (UTC)Reply

I do not see a problem. Please provide a screenshot or a more detailed explain of your case. --Kaganer (talk) 15:23, 18 July 2013 (UTC)Reply

Move Edittools just below the edit window or summary[edit]

  • Hi, im a newbie and thanks to the discussion here i was able to successfully install the Editools. However, the layout seems awkward to me as the edittools is located below the Save page buttons, etc. How can I change it's layout and move it just below the edit window or summary box? Thank you. Fcnanawa (talk) 07:06, 29 October 2013 (UTC)Reply
  • I face the same problem. Wikipedia has placed the charinsert in a nice place. Even Mediawiki has it at the bottom after the save botton. It's not convenient to use it without scrolling down, clicking, then scrolling up back to the edit box. It would better be off Right below the edit box. I've tried searching Wikipedia but no clue. Do we have to modify Common.css? Abhinav paulite (talk) 21:54, 21 August 2014 (UTC)Reply
  • Reup the earlier queries. Is it possible to move the Edittools box to ABOVE the edit window? ElectricRay (talk) 14:40, 9 May 2018 (UTC)Reply
  • @ElectricRay, Abhinav paulite, and Fcnanawa: Here is a js code as how a gadget could look like (now as script file):
/* Move Edittools direct below the edit field. */ // [[File:User:Perhelion/EdittoolsJustBelow.js]]
mw.loader.load("//meta.wikimedia.org/w/index.php?title=User:Perhelion/EdittoolsJustBelow.js&action=raw&ctype=text/javascript");

User: Perhelion 12:52, 21 May 2018 (UTC)Reply

Add strikethrough[edit]

Hi. Please add this to the end of the Standard section (after DEFAULTSORT):

<charinsert><s>+</s></charinsert>

and 2) add · at the end of the two lines above (translation and DEFAULTSORT).

Thanks. (And/or solve #Personalising above. :) –Quiddity (talk) 01:48, 9 May 2014 (UTC)Reply

Quiddity, Yes Done --Kaganer (talk) 23:37, 17 March 2015 (UTC)Reply

How Do I Get This To Work?[edit]

Also, Can you move Ø and ø to the other stroke letters --The Brynda1231 |Talc page 16:45, 17 April 2017 (UTC)Reply

Can you add Hirigana and Katakana? ---The Brynda1231 |Talc page 16:50, 17 April 2017 (UTC)Reply

Building a simple auto-correction tool[edit]

I am trying to make a simple tool that will help to automatically replace a user’s wrong using characters with the correct one in Mon Wiktionary in MediaWiki:Common.css. It doesn’t work. Anyone can help me for that? --Htawmonzel (talk) 08:58, 17 May 2021 (UTC)Reply

Quote marks for tvars[edit]

Hi @Shirayuki! I added the quote marks for four reasons: (1) to avoid errors when someone unfamiliar with the requirement to add them for those exceptions, tries to do so; (2) I occasionally see folks adding them to tvars, e.g. this edit (Note: I'm not intending to single this editor out -- I see many people do it, and quite often); (3) for consistency with Meta-wiki and Wikidata; (4) I think it's a good habit. -- I won't revert you back, but I hope you might consider doing so yourself. At the least, you (all) now know why it edited it! :) Quiddity (WMF) (talk) 03:23, 29 July 2023 (UTC)Reply

Especially on MediaWiki.org, (1) most of the old syntax <tvar|1>...</> has been replaced with <tvar name=1>...</tvar>; (2) The variable names on existing pages are mostly numerical; (3) There are very few people who use inappropriate variable names; (4) The Translate extension produces errors for inappropriate variable names, making it possible to fix them immediately. Shirayuki (talk) 23:21, 29 July 2023 (UTC)Reply