[Elgg 1.8-1.12 & 2.X & 3.X: Extended TinyMCE] vElgg_1.9_4.1.6

Release Notes

  • Updated to Tinymce version 4.1.6.
  • Wow! Tinymce 4 is a huge improvement from Tinymce 3. IMO much more flexible than the current CKeditor. I feel crippled using it (maybe I don't know how to).

    I found that this it nicely with this spellchecker http://tinymcespellcheck.com/

    Just had to add two lines into init.php (before of the list of common plugins):

            external_plugins: { "nanospell": "/mod/extended_tinymce/nanospell_location/plugin.js" },
            nanospell_server:"php",

  • @Darth Vader I don't know if you really need an additional plugin for spellchecking. The Extended Tinymce plugin already has the tinymce editor configured to allow for the browser's spellchecker to work. As far as I know all browsers come with a built-in spellchecker these days. You might only have enable it in your browser's settings.

  • I've got the newest Firefox installed but I still don't get no spell check here or anywhere. I've got the "check spelling as I type" selected and english locale. Also spellcheckers are often disabled or users have old devices or different languages selected.

    Too bad that today Nanospell started to complain that it is a trial... Worked very good for a while.

  • You might need to do two things to get spell-checking to work in Firefox:

    • enable spell-checking option in FF's settings,
    • then you might need to activate spellchecking at least once via the context menu (right-click when mouse pointer is on a input text area).

    It seems FF has now even the option to select the language to be checked via the context menu. Not being able to do so made me to turn off the spellchecking quite some time ago and not using it again since then because it was just annoying if basically the whole text got underlined just because the browser's language is different from the language you write in. But now you can easily select the language to be used for the check.

    I can't say how to enable spellchecking in other browsers - don't understand why anyone would NOT use FF. :-)

    I think to use only only the browser's spellchecker is the better way as some people simply don't want their writing to be checked automatically. If the spellchecking is done by the browser, it's the user's choice to enable it or not. And I would think that spellchecking is included in browsers for long enough already. If anyone uses such an old browser that there's no spellchecking he might have much more serious (security) issues to deal with.

  • I had to set my language to en-us. I didn't get the language context menu at all if the language selection is en-UK or just plain en. Probably some licensing mess (I downloaded a GB version of Firefox) because it makes no sense. I'll try this next http://www.abeautifulsite.net/enabling-tinymces-php-spell-checker/

    EDIT: the PHP Spellchecker plugin doesn't work because google has permanently disabled it's spellcheck service

  • I do not see the "Edit html" option as with the core CKEditor.
    However the main problem is how to configure it to not wrap content in 'p' when enter is pressed, and instead use 'br' (without the user having to press shift&enter?

  • @dranii There's an (admin only) toolbar option to edit the source code (=html code).

    p-tags are the "building blocks" of the input. Both CKeditor and Tinymce editor are based on it. Without the p-tags the styling set by the users for their content wouldn't work. While it seems possible to change the p-tags (or remove them) I've never tested this on my own, so I can't say how it can be done and I can't say what possible (negative) consequences would arise by removing them. I suggest to google for instructions how to configure the Tinymce editor for working without p-tags

  • Googling is not helping. The problem is not with p-tag per se. The problem is that it breaks the normal typing experience - when you type in NotePad/Word etc or suppose you type a poem you press Enter only to start the next line, and get single space between 2 lines. Here you press Enter and get 2 spaces.

    In the Elgg.og site itself, the things are happening correctly. I don't know how.

  • You can't compare a texteditor on your local computer with an editor used online. There are some conditions an editor has to match when used on a website that are not necessary when editing a text file (not even html in wysiwyg mode!) locally.

    You have two options:

    • use a "soft return" by pressing "Shift" + "Enter" if you don't want a p-tag included but only a new line. That's the option I would suggest to use,
    • change the tinymce configuraration in extended_tinymce/views/default/extended_tinymce/init.php by adding the option forced_root_block : false, as described at http://www.tinymce.com/wiki.php/Configuration:forced_root_block. But I don't know if using this second option might result in problems (the warning on the Tinymce page is: "Note that not using P elements as root block can severly cripple the functionality of the editor.").
  • > You can't compare a texteditor on your local computer with an editor used online

    I agree Iionly. But whether on local or on web when you press 'a' you are supposed to get 'a'.
    Pressing Enter to start the next line is just as common as that.

    I have tried forced_root_block : false but its just not working, may be I am not doing it correctly.

    I know about "Shift+Enter" but its not intuitive to the end-user, please also note that paragraph (p-tag) in English usually starts as a next new line without one line space. But in TinyMCE and CK one new line space is introduced. Their forums have long list of complaints but none of the solutions available there is working with current versions.

    I am also wonder-struck how things are happening correctly on this Elgg.org site itself. What modifications they have done to the editor!

  • Additionally, I would like to say when you are toggling Rich mode and plain mode ( as you can do with the default CK Editor or may be with TinyMCE also) - in Plain mode you press Enter to reach the next line, without any one line space. This is happening on the web itself. Now you tell the end-user when he toggles to Rich Mode he should press Shift+Enter

    Please do not take this as argument with you. I know Devs here has nothing to do with this. Its a problem with the Editor itself. Regarding "Note that not using P elements as root block can severly cripple the functionality of the editor." someone asked on stackflow what will be some examples of such problems, there was no answer :)

  • @dranii had you the caching disabled when testing the modification or at least flushed the cache after making the change? I've just tested the output myself by adding forced_root_block : false, and it gave the expected result (no longer p-tags but br-tags on pressing enter).

    And pressing enter does not add a blank line at all (for me) but just starts a new paragraph. There's only a vertical space between the two paragraphs (p-tags). For better readability this vertical space has an advantage and therefore the enclosing of paragraphs in p-tags is the default behaviour of web html text editors.

    Toggling between html and pure text input is also not possible using the Extended Tinymce editor on purpose (the same with the html source code edit function only available for admins). It happened more than once on my site that users (unintentionally) saved content with faulty html code (e.g. no closing tag). This faulty html code can result in the whole page not getting correctly displayed anymore (and in the worst case you can't even reach the edit mode to fix the error). That why I wanted to avoid users being able to edit the html code of their input directly as best as possible.

  • @iionly I have added forced_root_block : false between the script tags and it gave the expected result.
    I also tried by adding forced_root_block : 'p' according to the TinyMCE manual. It also gave expected result.
    But the problem is that the editor buttons (B, I,U etc etc) all vanish when this is added. When forced_root_block is removed buttons again appear.
    Are you getting expected result && buttons both in your tests? Where exactly are you adding forced_root_block?


    Toggling between rich and plain editor - the expected behavior ( as it happens in websites like gmail etc) is when you toggle to plain mode you see/get only plain text devoid of any html tags - so when plain text is saved as plain text no problem of incomplete tags occur.

  • It's not "Toggling between rich text and plain text" but "Edit html code / source code of input". That means that any html tags that define the style of the content is preserved when toggling between the modes. That's the way it is with the default CKeditor. For the Extended Tinymce plugin I've decided to not allow normal users to toggle between modes at all. For a longtext input field the tinymce editor is displayed. Period.

    I've added the "forced_root_block : false," line in extended_tinymce/views/default/extended_tinymce/init.php like this:

    toolbar_items_size: "small",
            toolbar: [
                "newdocument preview fullscreen print | searchreplace | styleselect | fontselect | fontsizeselect | template",
                "undo redo | bullist numlist | outdent indent | bold italic underline | alignleft aligncenter alignright alignjustify | removeformat",
                "pastetext | insertdatetime | charmap | hr | table | forecolor backcolor | link unlink | image | emoticons | blockquote" + (elgg.is_admin_logged_in() ? " | code" : "")
            ],
            forced_root_block : false,

    and I don't see any buttons disappearing.

  • Thanks a lot. I was doing it in the wrong place. I will check it now.

Stats

  • Category: Tools
  • License: GNU General Public License (GPL) version 2
  • Updated: 2019-4-5
  • Downloads: 23304
  • Recommendations: 52

Other Projects

View iionly's plugins