Extension talk:TinyMCE/2022
Add topic| 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. |
If you have a bug report please post it On the phabricator site for this extension
Customize keyboard shortcuts
[edit]Is there a way to customize the keyboard shortcuts in TinyMCE? Activede (talk) 00:19, 7 January 2022 (UTC)
- Hi Activede, thank you for using the TinyMCE extension. Currently the shortcuts are hard coded either in the TinyMCE extension or the TinyMCE core code. I think it would be possible to create some configuration variables to over-ride these but it would require some coding. Also, many of them are standards used in Windows and Apple IOS operating systems. If you let me know which specifically you'd like to change, I may be able to do something if it's not too many?
- Thanks, Duncan DuncanCrane (talk) 16:41, 7 January 2022 (UTC)
- Hi Duncan, thanks for your reply. I actually just want to set "tab" and "shift+tab" for indent and outdent. Do you know which lines to change for that? Activede (talk) 20:16, 7 January 2022 (UTC)
- Hi Activede
- It may be possible to make changes to the 'mw_wikinonbreaking' custom plugin to do that. This plugin already allows 'ctrl' + 'shift' + 'tab' to insert a pseudo tab into the editor content. There are potentially some drawbacks, as 'tab' characters have a specific meaning within tables and lists (see https://www.tiny.cloud/docs/plugins/opensource/nonbreaking/#nonbreaking_force_tab)
- The code would need to trap when the insert point is inside either of these constructs and allow the 'tab' character to be processed by the 'lists' or 'tables' plugins as normal. Also, there would need to be a custom configuration variable to switch this tab behaviour on and off, as not every user would want it. The default should probably be 'off'. There are already standard TinyMCE commands for 'Indent' and 'Outdent'. So the code would: test for a 'tab' or 'shift' + 'tab'; if true, test for not in a 'list' or 'table'; if true, fire 'Indent' or 'Outdent' as appropriate.
- I could probably do this over the next week or so for you, or I'm happy to provide some support/QA if you'd like to try it yourself? Let me know?
- Thanks, Duncan DuncanCrane (talk) 12:26, 8 January 2022 (UTC)
- Hi Duncan,
- thanks for your reply. The main reason for me using TinyMCE instead of VisualEditor is, that I need to indent and outdent standard paragraphs. VisualEditor only allows to indent list items, which doesn't help in this case. Wikitext of course has a comfortable solution with just using ":" or "::" for two "tabs", but the audience of this page probably doesn't want to learn wikitext.
- Every single wiki page will presumably have the following structure
- A. First point to mention
- And some text here. Probably a few paragraphs.
- I. Some text here
- and some here
- With some bullets
- And another one
- 1. Some text here
- 2. Some text here
- a) And some text here
- b) and some here
- aa) and some here
- bb) and here
- (1) And so on
- (2) And
- II. So
- B. Forth
- So it is going to be such a massive list, that using <ul> and <ol> could become very difficult to set up, so I decided to do that manually. However, always clicking the indent / outdent button in TinyMCE would become very tiring when writing on that page. As I will have tables disabled anyways it doesn't matter for me if there would be any conflicts. So that is the plan. ;-) Your solution would just add some -elements if I got that right? That's not really what I need. I need TinyMCE to put a ":" when pressing the "tab"-key. Although I also don't mind to provide a different shortcut if that would cause less problems. Activede (talk) 15:49, 8 January 2022 (UTC)
- Hi Activede,
- Not quite. In my suggestion, using 'tab' and 'shift' + 'tab' would fire the native TinyMCE 'Indent' and 'Outdent' events. Using the TinyMCE Indent and Outdent events is equivalent to using ':' in wiki text. The TinyMCE extension already translates the presence of 'indents' and 'outdents' in the editor back to the ':' wiki markup, for example if you use the 'Indent' or 'Outdent' menu buttons in the TinyMCE editor.
- Using a different short cut would simplify matters, as it wouldn't conflict with the processing of lists and tables by TinyMCE. As mentioned, it would be possible to trap these cases and process them appropriately, just more complicated. However, time is precious, so if you'd like to propose a different shortcut (which isn't already in use) that would make things simpler for me :-)
- I do have a question relating to your example above, which I am not sure I understood fully. Is it when you have a paragraph within a list where you want to use the indent (eg the 'and some here' in point 'I' of your example)? In which case using 'shift' + 'return' within the bullet point in the TinyMCE editor would visually achieve this. Using a ':' in a list at this point in the wiki markup, I think, will have a slightly different result. Perhaps you could give the wiki markup for the example as well, if this is the use case that is important?
- Many thanks
- Duncan DuncanCrane (talk) 15:01, 10 January 2022 (UTC)
- Hi Duncan, sorry for the late reply. The wiki is a hobby project and I had some stuff to do for work. The "and some here" could either be achieved by pressing shift+return or by pressing return and then indenting independently. I have not thought about the differences to be honest. Important is that indent and outdent work smoothly via a convenient shortcut. Activede (talk) 09:25, 17 January 2022 (UTC)
- Hi Activede, in which case what short cut would you want to use in preference to 'tab' and 'shift tab', because they already have an application in lists and tables? DuncanCrane (talk) 17:40, 17 January 2022 (UTC)
- Hi Duncan, Word on Mac uses opt+tab as soon as you enter a table. That makes sense to me. What do you think? Activede (talk) 15:28, 19 January 2022 (UTC)
Set templates
[edit]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.
This is how I tried to set up my toolbar with a customized test template. However, the button appears but tells that no templates were found. Any ideas?
$wgTinyMCESettings = array(
"#wpTextbox1" => array (
"toolbar" => 'undo redo | formatselect | outdent indent | bold italic underline | bullist numlist advlist | wikilink wikiunlink table | reference template wikitext'
),
"TinyMCETemplates" => array(
array(
"title" => 'Test-Template',
"description" => 'Test-Template',
"content" => 'Test-Template'
),
),
);
Update: Got it.
$wgTinyMCESettings = array(
"#wpTextbox1" => array (
"toolbar" => 'undo redo | formatselect | outdent indent | bold italic underline | bullist numlist advlist | wikilink wikiunlink table | reference template wikitext',
"tinyMCETemplates" => array(
array(
'title' => 'Test-Template',
'description' => 'Test-Template',
'content' => 'Test-Template'
),
)
),
); Activede (talk) 22:31, 7 January 2022 (UTC)
TinyMCE Editor MediaWiki 1.37
[edit]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.
TINY MCE Problems.... upload and display file does not work
dialog for uploading a file. One can upload from a local disk, from a url or just link to another file already uploaded to the wiki---- i already uploaded Files .jpg... but i can not use the dialog for that files... nothing happens Than! 2A02:8070:1C3:3440:4EF:58E4:F872:FB4E (talk) 08:29, 3 February 2022 (UTC)
- i wanted to upload a scrennshot but its not allowed here.. Stuttgarter2006 (talk) 08:42, 3 February 2022 (UTC)
- Open developer console of your browser (by hitting the F12 key), switch to the console tab, clear all its contents, do the same on the network tab, and try the upload or select a file again.
- Then look for errors appearing here and also the network tab in case the error comes from a network request. Any error you get from there may be useful to debug the problem. Ciencia Al Poder (talk) 09:24, 3 February 2022 (UTC)
Upload and display file - Problem with TinyMCE
[edit]Problem with TinyMCE // mediawiki-1.37.1, -- PHP8.0
If i want to use a file from the server it show me no files from the Server... but i have got files inside the /images/...?! Stuttgarter2006 (talk) 10:49, 8 February 2022 (UTC)
- Hi Stuttgarter2006
- Thanks for trying the TinyMCE extension. Currently, if you select the 'file in this wiki' option, you have to provide the name of the page which points to the file. For example if the wiki page of the image is 'File:picturexyz.jpg' then the entry to the 'Source' field should be 'picturexyz.jpg'. The upload facility doesn't allow browsing of the images stored in the wiki in the current version, although this could be added as a feature in future. The reason this hasn't be done so far is that wiki's frequently have many thousands of images, often without meaningful names, so it can be quite a resource hungry process to locate an existing image by browsing, unless one has been very disciplined when storing them in the first place!
- Thanks, Duncan DuncanCrane (talk) 16:47, 14 February 2022 (UTC)
TinyMCE - If i click image properties --- i get this....
[edit]If i click image properties Stuttgarter2006 (talk) 11:03, 8 February 2022 (UTC)
- Hi again Stuttgarter2006 and thank you for drawing this to my attention. It appears from the screen image that there is no entry in the 'source' field of the dialog. If you try to select the 'image properties' tab of the dialog this is not possible without a 'source' file being provided first. That is why this message is displayed.
- However, when I tested the problem you identified before, if one tries to 'ok' the upload of a file when the 'source' field is empty, one also gets this message. This is a bug so I'll have a look at fixing this.
- Many thanks, Duncan DuncanCrane (talk) 16:59, 14 February 2022 (UTC)
Textbox grows infinitely with Citizen skin (thus unable to save edits)
[edit]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.
Hi, I just installed the Citizen skin in my private wiki. The regular editor works fine.
When I try to edit a page with TinyMCE editor though, the textbox (where we make edits) just expands infinitely, and I can never reach the bottom of the page as a result (so I can't save my edits). When I inspected the element, the height of it just kept increasing on and on, it even reached 60k pixels before I closed the page!
I'm running latest MediaWiki 1.37. No other extensions (other than pre-installed ones).
Also, I had already tested TinyMCE with Timeless skin and there were no problems. That's a very weird bug...
I hope you can find a solution! Thanks! Lulullia (talk) 15:29, 21 March 2022 (UTC)
- After tinkering a bit more with the Inspector, I found that the issue may be coming from this css:
- .tox .tox-edit-area__iframe {
- height: 100%;
- }
- When I disable/change the value of "height", the text area returns to normal size and no longer expands.
- I also found that disabling "display: flex" on the iframe's parents removes the problem, but of course it renders the editor unusable so it's not a viable workaround. Lulullia (talk) 17:31, 21 March 2022 (UTC)
- Hi Lulullia
- Thank you for using TinyMCE and letting me know about this issue (and also investigating it). I haven't had the problem reported before, so it looks like it may be something to do with how the Citizen skin works. Several other skins have been used with TinyMCE successfully so I don't think this is a bug with TinyMCE as such.
- The height setting you identify is part of standard TinyMCE setup. You could try redefining it in the MW_tinymce.css file in the extension root directory as a workaround? You might also ask the extension developers if they have any ideas. Do let me know how you get on.
- Many thanks
- Duncan DuncanCrane (talk) 17:54, 22 March 2022 (UTC)
- Hi,
- I have started a thread on the Citizen skin's page and someone who was having the same issue as me found a workaround in disabling the plugin "autoresizer" (bundled with TinyMCE).
- Here is the original message. It works great for me right now so I can close the issue but I thought maybe you'd want to investigate more.
- Thanks for the support! Lulullia (talk) 10:12, 9 May 2022 (UTC)
- Thanks Lulullia, I'll look into that. DuncanCrane (talk) 10:32, 28 June 2022 (UTC)
Using Mediawiki 1.37, TinyMCE installed but not working and gets PHP warning
[edit]Warning: Undefined array key "action" in c:\xampp\htdocs\zh\extensions\TinyMCE.hooks.php on line 281 Tekthyrios (talk) 07:25, 25 May 2022 (UTC)
- Hi Tekthyrios, sorry I didn't see this before now. Would you let me know the version numbers of any extensions you are using and also what skin you use? You could also look at topic Extension talk:TinyMCE/2021#h-Depricated_Hook_After_Upgrading_to_MediaWiki_1.37.1-2021-12-23T18:40:00.000Z to see if it addresses your issue? Many thanks, Duncan DuncanCrane (talk) 10:31, 28 June 2022 (UTC)
Missing toolbar icon and no icons visible in 'icons' button dropdown
[edit]MW - 1.35.7
PHP - 7.4.30
MariaDB - 5.5.68
TinyMCE: REL1_35
2022-06-19T19:20:56
Skin - Vector
Hello,
I recently installed the TinyMCE extension on the above wiki site environment. The majority of the toolbar buttons are fine and appear to work as expected. I am running into an odd issue with a couple, however.
• There is a button/icon to the right of the 'paste' button that appears to not be rendering itself properly. It has a drop-down within and appears to have the same buttons as the 'Special Character', 'icons' ( a flag ), 'Date/time', 'Single linebreak', 'Wikimagic' and 'Browser context menu'. What should that parent toolbar icon look like?
• The second issue is when clicking the 'icons' ( a flag ) button, the window that opens has various icon lists, but there appear to be no icons within each. Is that expected?
• An additional question about the available buttons, reviewing the 'Toolbar buttons' section of the extension page: Extension:TinyMCE , there is the reference to the ... menu button providing additional buttons, such as the citation/reference button: File:Reference button capture from TinyMCE extension.png. I am not seeing that button or the ... available.
I do have the default Cite extension enabled in the wiki, however. Not sure if it is dependent on that. Alongaks (talk) 19:09, 20 July 2022 (UTC)
Using both Visual Editor & TinyMCE
[edit]Quick question: Is it possible to use both Visual Editor & TinyMCE extension? I'm thinking of having them handle different namespaces. I'm assuming there would be a conflict, but just curious (Before this extension existed I once backdoored TinyMCE via JavaScript & attached it a text area in Extension:Page Forms|Page Forms but that was less than ideal. Specially since it was the basic version without any Wiki syntax & I don't think this method would work via namespace) Christharp (talk) 17:44, 29 August 2022 (UTC)
- Hey, Christharp
- While I was perusing to see if my prior question was answered, noticed yours and figured I would offer some of my observations. :-)
- Long story short - having both VisualEditor and TinyMCE appears fine technically, but don't really play nice with both enabled. Seems to be an either/or deal.
- I am running the following environment:
- MW 1.35.7
- PHP 8.0.22
- MySQL 5.5.68
- TinyMCE REL1_35 2022-06-19T19:20:56
- VisualEditor 0.1.2
- I found toggling in Preferences > Editing > 'Use the TinyMCE editor to edit pages' and ensure to untoggle 'Enable the visual editor...' will allow editing in the typical 'Edit' tab of a page. Loading the TinyMCE toolbar.
- If I wanted to get the VisualEditor functionality back, I had to not only untoggle TinyMCE from preferences and toggle back VisualEditor, but also had to disable the TinyMCE extension in LocalSettings _then_ completely clear the cache from the browser for the site. Relaunch the site and then VE was back. Otherwise, VE would quickly try to launch but it was no-go.
- May not really help for what you are looking for, but FYI. Alongaks (talk) 18:41, 30 August 2022 (UTC)
- Thanks. It's what I figured, which is why I asked before doing the work & having to deal with the crap you describe. I may try my old hack of doing it via JavaScript, but that's less than ideal. Christharp (talk) 21:41, 30 August 2022 (UTC)
References/Cite issue with the name tag.
[edit]I have just come across a peculiar bug. When using references/cite with a name tag, TinyMCE keeps stripping the name tag out of the <ref>.
For example, if you have <ref name=AD"></ref>, when editing in TinyMCE (I am within PageForms) this changes to <ref></ref>
Any idea what the issue may be? Squeak24 (talk) 13:25, 26 September 2022 (UTC)