[Elgg 1.7: Extended TinyMCE] vr2

Release Notes

Changelog:

  • Increased the font size in the editor input area to 12px by adding a custom CSS file. You can configure the editor's apprearance via /views/default/tinymce/custom_content.css.
  • Re-ordered the editor's buttons from two to three button bars: automatic resizing (reducing the width) only works if the buttons don't block it. For example on Tidypics' "edit details" page after image upload the editor needed to be smaller. This works now.

Install instructions:

  1. Disable the Elgg core tinymce plugin and/or any other tinymce plugins,
  2. Replace the tinymce folder in your mod directory with this tinymce folder,
  3. Enable the tinymce plugin again,
  4. Execute the upgrade.php script, i.e. call http://<yoursite.domain>/upgrade.php in your browser.
  • Hi! I think I found a bug. I'm running Elgg 1.7.8 and under "Font size" it gives several "{#undefined}" options.

  • Ah, it happens in Chrome (latest), Firefox works fine. Hmmmm.....

  • @k5sat: do you get the error when trying to select the font size in the dropdown menu or are there any errors written to the server log? I've tested it with the latest Chrome version (11) in Linux, Vista and WinXP and haven't seen any issues (also not with IE9, FF4, Opera and Safari). You could test what happens when removing the lines

    theme_advanced_font_sizes: "10px,12px,13px,14px,16px,18px,20px",
    font_size_style_values : "10px,12px,13px,14px,16px,18px,20px",

    in /views/default/input/longtext.php. These lines should normally result in the text being entered in the editor input field being of the same size as after posting later.

  • Great plugin. Thanks it seems to be working well on version 1.8. I have one question though I see that your plugin does not have some of the features from version 3.4.2 of Tinymce such as special characters subscripts and superscripts etc. How can one add these features? I would appreciate any form of help regarding this. Thanks

  • Also the font size drop down list has undefined font sizes

  • @charlie:

    1. If you already use Elgg 1.8, you can install Evan Winslow's MathJax plugin to allow for adding math formulas / equations in a Tex/Latex syntax. The TinyMCE editor itself is not capable of handling formulas.
    2. I've not tested my TinyMCE plugin in Elgg 1.8 myself. Nice to know that it works. I don't know if the final version of Elgg 1.8 might already include version 3.4.2 of the TinyMCE editor in the core TinyMCE plugin. If not, I will most likely release an update.
    3. Regarding subscripts / superscripts: The TinyMCE editor has internally also "plugins". I've included all default plugins of the editor available at http://tinymce.moxiecode.com/ but I've not enabled all of them. You can modify the plugins to be enabled in the file tinymce/views/default/input/longtext.php in the variable "plugins". You most likely will have to add the corresponding buttons to the toolbars (theme_advanced_buttons1-4), too. The general configuration of the TinyMCE editor is described in more details at http://tinymce.moxiecode.com/. All config options can be done in the longtext.php file
    4. "Undefined font sizes": could you tell me what browser you are using (name, version and which Operating system)? I couldn't verify this error so far myself, so it's difficult to find the reason for the problem. You could remove the line "theme_advanced_font_sizes" and "font_size_style_values" in longtext.php. Maybe it will work then. But you might get a smaller default font size in the editor area and / or the font size in the editor area won't match the font size after posting respectively.
  • @iionly: I see what you mean about the tinymce plugins. I tested your plugin on opera v 11.11 , build 2109 and windows 7 operating system. Also tested on mozilla firefox v 3.6.17 and internet explorer 8 and it works well after a page refresh but this is not the case with opera.

    I want to add more than characters I want to add equations. I will try Mathjax I see that someone has already setup a plugin for it. I hope it's compatible with yours. I have a question, why is it that when you use subscripts or superscripts on the tinymce editor they  appear well on the preview but when you view them after publishing a post they appear like this x^2 or x2. Would appreciate your insight on this. Thanks

  • @charlie:

    I now also see the "undefined" entries in the font size dropdown menu with the latest version of Opera. I'm not sure yet what's causing the problem. Maybe it's a bug in the TinyMCE editor code itself. As the Opera browser is very strict on web standards it might through an error while the other browsers accept some lazy hacks... If I find a solution, I'll post an update.

    The MathJax plugin would allow you to enter full featured equations. But it works only in Elgg 1.8 as Evan replied to your question. I don't know if it's possible to backport it to Elgg 1.7. The plugin itself only consists of 2 lines of code as it simply relies on new functions introduced with Elgg 1.8. To backport these functions might be a major effort.

    I'm not sure how the TinyMCE editor handles subscripts and superscripts. It might do it by adding some html tags in the posted message. Elgg's htmlawed plugin might remove this html tags as they are not included in the list of allowed tags. If that's the case I don't at the moment how to change this setting. You could test it by disabling the htmlawed plugin - but please only temporarily as it's a possible security problem otherwise.

  • @iionly Thanks for the response. I decided to use a different plugin for equations and it works well. My current problem is that when I use a font like Comic Sans MS  on the editor in a comment for example, and save it. The font resets to what seems like a standard font for elgg. I need some help on this because I would like to see the font formating on the saved comments. Thanks in advance.

  • @charlie:

    I just tested posting with different fonts briefly (FF4, Linux). It works for me, so it's difficult to say why it doesn't work for you. :( There could be several reasons:

    • a browser issue? Have you tried a different broweser?
    • font not available for some reason or
    • core htmlawed plugin removes the font style related html tags when saving a posting.

    You could test the latter two possibilities by looking at the message text before and after posting in TinyMCE's html mode. You should see the same html style tags then (you need to test it with a group posting or blog to be able to edit your posting after sending). Are all html tags still included after posting? If not, are they still included when disabling the htmlawed plugin temporarily?

  • @iionly: Desabling the htmlawed enables the font formatting to appear after saving the post. So what does this mean and how can I fix it. The htmlawed plugin seems to be very important.

  • It surely is not recommended to disable the htmlawed plugin. I have looked at the start.php file of the Elgg 1.7.9 htmlawed plugin and compared it with the start.php file of my installation. It seems the font-style tag is included in the allowed tags of the default start.php file. But the file is quite different to the version I've installed. My version came from yet another tinymce plugin (vazco_tinymce). I thought the only difference would be to allow more freedom for admins. It seems the core start.php file was rewritten at some point. Maybe the new version doesn't work as intended. I also need to figure out if the version installed on my site still works correctly!

    Maybe you could post a new discussion thread asking for advice / feedback regarding htmlawed configuration. If there really is a bug, others should have noticed it, too. Or it's maybe only a slight modification necessary to allow for different font styles. If I find out more, I'll post again.

  • @iionly: So maybe this is a bug from 1.7.8. I don't mind upgrading to 1.7.9 but I am a bit worried that some of the existing plugins might not be compatible with this version. So if I understand you correctly, you are saying that the htmlawed plugin for 1.7.9 allows font-style tags, right? Also can you please let me know about your experience with 1.7.9 so far in terms of plugins. Thanks alot.

  • @charlie: there has been no changes in the htmlawed plugin between 1.7.8 and 1.7.9. So, if it is a bug it has been introduced before and is still in it. But maybe it's not a bug. Another possibility is that some other 3rd party plugin is causing the issue by re-defining the allowed tags (for example the izap_videos plugin once did that on a former release).

    I can't say for sure that there will be no trouble when upgrading to 1.7.9. But I had no problem with any plugin after upgrading. It's a minor upgrade anyway.

  • @iionly: It's not a 3rd party plugin problem I checked by disabling all plugins and then enabling only the default elgg plugin as well the Tinymce plugin. But if you are saying that it works well for you, maybe I need to check the tinymce plugin because I added some extra functionality to it. Thanks a lot for your help.

  • Thank you for the plugin.

    I find that it doesn't insert images on Chrome, and on IE9 it won't insert images if items in the 'Appearance' tab have been selected: HTML code produced <p><img border="0" /></p>

  • @Lee: a new version (3.4.3) of the TinyMCE editor was released yesterday. The changelog lists some fixed bugs that might be connected with your problems. I'll bundle the new editor version with a new release of this plugin and upload it asap (just need a bit of time for testing).

  • Hello iionly,

    Thank you very much.

    Lee

Stats

  • Category: Tools
  • License: GNU General Public License (GPL) version 2
  • Updated: 2015-5-15
  • Downloads: 8171
  • Recommendations: 14

Other Projects

View iionly's plugins