Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Plugin TinyMCE

Here's a plugin that will allow you to replace the default redactor editor with TinyMCE

This is mainly done as an expirement and also because the redactor version currently in use is getting a bit old.

I've mainly ported the functions that were available in redactor to TinyMCE so as of yet there's no extra functionality as such, but if i've missed something or you've a good idea please just suggest it.

Functions ported
  • Auto renewal of lock if you're typing
  • Canned responses
  • Context typeahead in templates
  • Drafts (uses tinymces autosave plugin)
  • Signatures





  • Ohhhh neat!  :)
  • How is this plugin installed? I have copied the files/folders to include/plugins but it does not show up.

  • First you need to copy all the files to include/plugins/tinymce

    Then you need to go to Admin -> Manage -> Plugins and press Add new plugin
    The TinyMCE plugin should now show up and allow you to press install.

    Once done you need to tick the checkbox in the list and choose enable in the menu at the top right.

    If you go click on the plugin you'll get to the configuration part and you can adjust it as you'd like there, the most important part of the installation is where your tinymce.min.js file is located.
    I've encountered issues with having it located in my plugin folder so i've included an option to set the js location in the standard js folder, so if you choose to do that just copy and paste the include/plugins/tinymce/tinymce folder to js/tinymce and set it in the configuration, or if you just want to test that it's running you can choose to use the cloud hosted version of tinymce.
  • Update: 0.2.3
    Fixed issues with notifications when editor is not visible.
    Added the function that embeds youtube/vimeo videos when you paste 1 of their links.
    Added so if you translate osticket, tinymce will look for the translation file for that language in the langs folder.
    Captures redactor translations.
    Categorization of plugins (paid and free) and mapped more of the existing plugins to the config.
    Added a osticket based theme.
    Skin and theme will now look in their folders (if hosting locally) for what options are actually available.
    Set default value for plugins.
  • @Mike1101 my guys would love this! They hate the current redactor

    I tried this with 1.10.1 and it doesn't seem to work the same? I could probably be less specific... 

    My configuration page doesn't let me select any theme (none available from the list) and when I have it enabled, i also seem to have a skin option that has no choices in its dropdown as well. 

    I also don't get the menu bar even though show menu bar is checked, and my text box is sized to have the width.

    I will include a couple screen shots
  • edited September 2017
    Yes even though in the screen shot, Show menu bar is NOT checked, I have checked it and confirmed that there is still not menu bar


    Copying the tinymce folder to my js folder got me working with the menu bar

    Thats what i get for being a skimmer....

  • edited September 2017
    Great to see that you solved it, maybe there should be a check to see if tinymce actually has been loaded and if not prompt the user to copy the files.
  • Also for some reason when I put this in my live environment, the theme and skin options were available as well, so I don't know what is wrong with my sandbox but apparently it is not an exact copy of my live environment as I thought it was...

    Anyway, It looks good and so far my guys are very happy with this. Thanks for all the work you do to support the community @Micke1101

  • As the plugin is mostly javascript based please check if you're getting any weird errors, just fixed a regex based error that i noticed after trying to put it in live enviroment (it was a little bit greedy when it came to removing scripts) other than that i only know about the notification js error that seems to come every now and then, harmless but still looking into it.

    Great to hear that :).

    It's a pleasure, love to see all the ideas that people come up with!
  • Hello @Micke1101,
    I have a small problem with the spellchecker plugin.

    When I activate this pluguin and try to enable it in the part of the editor,
    the following error appears "The spelling service was not found: (undefined)".

    Any way to solve this error or to use the corrector that comes by default in the browser firefox or chrome?

    thanks for developing this plugin!
  • edited September 2017
    Unfortunately I've no experience working with the spellchecker plugin as it's a paid plugin and I've not seen this error before but i'll see if i can find some more information about this, for now i've updated the plugin that include an option that will let you enable or disable the built in browsers spellchecker.


    It seems that by default the spellchecker is looking at googles webservice but this is no longer available and you have to specify the url yourself.
  • edited September 2017
    This is great but I'm having a few issues. When i copy and paste an image from a word doc into the text editor and click save the image does not upload instead it creates a wall of text :/ Also the Table of contents do not seem to work when i click them.

    Besides that this is really nice great work man
  • edited September 2017
    Canned responses have issues too sometimes they work other times it wont we have to refresh in order for it to work let me know what data you need me to gather so i can get that for you so we can get this fixed :) Thanks a lot we really appreciate your work
  • edited September 2017
    Paste from word: as far as i know most webbased editors will have issues with office pasted content (i believe the powerpaste plugin in the tinymce suite fixes this but it's a paid plugin)

    I just tested (word 2016, docx) and if i copy text and an image it only pastes the text but if i try to paste them seperately they do look correct both when i enter them and when i receive them.

    Could you provide some screenshots? and if possible an example file i can test with? what browser are you using? which webserver are you using?

    Table of contents:This is a paid plugin, i've never used the paid plugins from TinyMCE but i'm presuming you need to validate that you're infact paying them for the plugin in order to actually use it.

    Canned responses: What browser are you using? webserver? (presuming it's the same as for the word bit but just listing as i need to know).
    Are you seeing any errors in the browser console?
    Are ajax calls being made when it's failing?
    Are you noticing any difference if you've already typed in data or not?

    I'm thinking that maybe if the integration does not work i could replace the combobox with the built in template tool in TinyMCE and just read the data from the canned responses.
  • @spankymasterc
    I think i know what caused the issues with canned responses, please update with the latest files on the github and see if that helps.
  • @Micke1101 Hey so i went ahead and added the updated files and it looks like it did the trick ill have my guys try it out tomorrow morning and will updated if i see any issues with canned responses so far looks like it worked.

    As far as posting images on tinyMCE it looks like the picture goes through and displays as it should but once you click save it makes this giant wall of text ill try and include a screenshot once i get a chance. The workaround for this is uploading images to imgur and then using the link to past them on there more a hassle than anything.

    Table of Contents: Ill digg in deeper into this i dont see anywhere i can purchase this specific app which is weird anyways good job the TinyMCE is much much nicer than the one it currently has thanks so much!
  • @spankymaster good that it seems to be fixed, i've doublechecked and it looks like i was wrong and ToC is not a paid plugin but it does seem to work for me.

    What is the issue for you with the ToC plugin more specifically?

    Yes the word pasting issue is frustrating, i've been experimenting a bit with it, i did a PoC with CKEditor plugin and it had the same issue even tho they claim to have built in word pasting support.
    The only thing that seems to work properly is TinyMCEs powerpaste plugin that i got working on a setup.
  • @Micke1101 ToC Plugin Generates a nice little table of contents but when you click on the link it does not go to the specific part of the page do i need to add anchors or something?

    As far as canned responses my guys were able to test it and it seems you found the issue thanks!

    Yeah the pasting feature is a bit frustrating but its fine Ive been uploading things to imgur and then using link to post an image a bit of a PIA but manageable I suppose.

    You did a hell of a job thanks so much!
  • edited October 2017
    Ok i just checked the table of contents plugin and it seems that it's doing what it's expected to, but htmlawed seems to be filtering out the id's so the links are correct but the anchors are removed by osTicket.

    I unfortunately don't think there's much that can be done to prevent this, unless you modify core code, i will however have a look later on.

  • edited October 2017
    While troubleshooting a different problem, I noticed this error in my PHP log, it doesn't appear to affect how it works, and I haven't had a chance to see what it's referring to because as I said I am troubleshooting a different problem lol, but thought I would pass this along.

    [05-Oct-2017 23:20:27 UTC] PHP Warning:  scandir(/js/tinymce/skins,/js/tinymce/skins): The system cannot find the path specified. (code: 3) in C:\inetpub\wwwroot\support\include\plugins\OSTicket-plugin-TinyMCE-master\config.php on line 40
    [05-Oct-2017 23:20:27 UTC] PHP Warning:  scandir(/js/tinymce/skins): failed to open dir: No such file or directory in C:\inetpub\wwwroot\support\include\plugins\OSTicket-plugin-TinyMCE-master\config.php on line 40
    [05-Oct-2017 23:20:27 UTC] PHP Warning:  scandir(): (errno 2): No such file or directory in C:\inetpub\wwwroot\support\include\plugins\OSTicket-plugin-TinyMCE-master\config.php on line 40

    EDIT: this error seems to correspond with my cron job interestingly enough, I have cron shut off at the moment because of a mail fetch problem I am having and these errors stopped as well and were occuring at the same interval as my cron job. 
  • edited October 2017
    @blueyeguy Thank you, I don’t have cron on my test so haven’t seen this.

    The scandir should only be on the config page, so weird that it’s called on a cron job.

    I've now added a check so that it should no longer give you a warning regarding the scandir.

    Micke1101, you are our savior. Your plugin works extremely well !
    I followed your instructions and it worked right off the bat.
    Thank you so much!!! You have no idea what you just did for us :-)

  • Great to read that you enjoy it :)
  • +1 

    This is great and our agents love it. The only thing thing that doesn't seem to work for us is the "browsers native spellchecker", but our agents just need to learn how to spell :-)

  • @blueyeguy that's strange, what browsers are they using? any add ons active? what tinymce plugins do you have running?
  • @Micke1101 I'm sure it's a mix of Chrome and FireFox, and a few Apple users with Safari, I doubt any use IE or Edge. I personally use both Chrome and Firefox (my queue open in FF, and logged in as admin to see all tickets in Chrome) and I think AdBlock Plus is the only addon we have installed other than Flash, Java, etc.

    Here's a pic of my config page

  • @blueyeguy it looks like when i commited the fix for autosaving, i commited an old version of 2 files that didn't have the browser spellcheck in them yet.
    Now it should be back and working.
  • Brilliant! But now my lazy agents don't need to have any spelling ability. 

    Thanks tons for all you do for the community @Micke1101

  • edited October 2017
    Hello @Micke1101, this is superb work you have done :) Can anyone please confirm if Organisations notes work when using this plugin? As currently it shows only empty, editable box, but without text controls.

    P.S. Maybe it is worth to add "forecolor" before "backcolor" in Toolbar setting by default, as text colour quite possibly is used more than background colour. Just my two cents :)
Sign In or Register to comment.