WordPress.org

Ready to get started?Download WordPress

Forums

Help Adding SpellCheck Button to TinyMCE (12 posts)

  1. TerranceDC
    Member
    Posted 8 years ago #

    I've been going back and forth about this on different thread, and I'm hoping that taking it to its own thread will yield more answers.

    I should caveat all of this by saying that I am not a programmer or a developer. I'm a writer who happens not to be a great speller/typist. I know more than enough HTML to do my own coding, as I work with it every day. But when it comes to my blog I'm lazy. I'd much rather write with out having to do much coding. In fact, I'd rather not see the coding unless I want to. That said, I'll explain my dilemma in as much detail as possible while letting a little of my frustration seep through as possible.

    Since I upgraded to 2.0 (which I'm mostly happy with, BTW) I've been trying to figure out how to add spellcheck to the built-in WYSIWYG. I've tried various solutions, and none have worked well, so I decided to try adding the iespell plugin for TinyMCE. I downloaded the editor and uploaded the plugin to the wp-includes/js/tinymce directory.

    I then uploaded and activated an advanced editing plugin for 2.0. After several hours of tweaking, I now have an array of features in the WYSIWYG, neatly arranged in three rows.

    http://i25.photobucket.com/albums/c70/TerranceDC/wysiwyg.jpg

    There's one thing missing, however. The spellcheck button for iespell. It's not there. I've uploaded the plugin to the correct place, etc. I've edited the Worpdress plugin to include the button for iespell. Here's what I've got in the plugin.

    if (isset($wp_version)) {
    add_filter("mce_plugins", "extended_editor_mce_plugins", 0);
    add_filter("mce_buttons", "extended_editor_mce_buttons", 0);
    add_filter("mce_buttons_2", "extended_editor_mce_buttons2", 0);
    add_filter("mce_buttons_3", "extended_editor_mce_buttons3", 0);
    }

    function extended_editor_mce_plugins($plugins) {
    array_push($plugins, "table", "fullscreen", "emotions", "advlink", "advimage", "searchreplace", "iespell");
    return $plugins;
    }

    function extended_editor_mce_buttons($buttons) {
    return array(
    "cut", "copy", "paste", "separator", "undo", "redo", "separator", "search,replace", "separator", "charmap", "emotions", "separator", "link", "unlink", "anchor", "image", "separator", "removeformat", "code", "fullscreen", "wordpress", "iespell", "wphelp");
    return $buttons;
    }

    function extended_editor_mce_buttons2($buttons) {
    return array(
    "formatselect", "bold", "italic", "underline", "strikethrough", "sub", "sup", "separator", "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "bullist", "numlist", "outdent", "indent", "separator", "forecolor", "backcolor", "separator", "hr");
    return $buttons;
    }

    function extended_editor_mce_buttons3($buttons) {
    return array(
    "tablecontrols");
    return $buttons;
    }
    ?>

    If I did this right, and I'm reading this correctly, the iespell button should be right before the help button on the top row. But it's not. At this point, I've worked on it from about 9am to 2pm, without any success in getting the feature I want most. If anyone can point out what's wrong, I'd be most appreciative. If more information is required, I'm happy to supply it if asked (and if I have any idea how to track it down).

    I've tried a few other solutions. I installed some Firefox spellcheck extensions, but none of them work in Firefox 1.5. I downgraded to the previous Firefox version, with no luck. What does work is the Google toolbar extension for Firefox, which does have spellcheck. But its spellcheck doesn't work well in the TinyMCE editor, because it inserts tons of code that remains invisible until you post, unless you go into HTML mode and delete it. So, if I want to use the Google spellcheck, I have to kill the WYSIWYG editor and just ignore it when Google's spellcheck picks up HTML tags as mispellings. Not a great solution since it means not using the WYSIWYG.

    Like I said before, I'm not a developer or a programmer, so I don't know how difficult it is to do what I'm about to suggest. I'd like to humbly request that the WordPress developers consider making the TinyMCE spellcheck plugin a part of the native WordPress install. It would add tons more value to the WYSIWYG editor.

  2. Morbing
    Member
    Posted 8 years ago #

    Hi, I would realy like to have the same features as you have but it seems like the link is broken or the site is gone!
    http://blog.labnotes.org/2005/12/26/advanced-editing-for-wordpress-20/

    I've searched around but I cant find the advanced-editing plugin anywhere else...
    Can you send it to me? Or a link to another location?

    Thank you in advance.

  3. dan13l
    Member
    Posted 8 years ago #

    I've managed to get this working using the SpellerPages v1 plugin for TinyMCE.

    I used the Advanced Editing Plugin (which I've mirrored here: http://www.istherefood.com/advanced-wysiwyg.zip) and uploaded the SpellerPages v1 plugin to the TinyMCE plugins directory (wp-includes/js/tinymce/plugins/), then added "spellerpages" to both the buttons array and plugins array in the Advanced Editing Plugin. Eg:

    function extended_editor_mce_plugins($plugins) {
    array_push($plugins, "fullscreen", "spellerpages", "table");
    return $plugins;
    }

    and

    function extended_editor_mce_buttons_2($buttons) {
    // Add buttons on the second toolbar line
    array_push($buttons, "fullscreen", "spellerpages");
    return $buttons;
    }

    Oh, I also had to edit one of the Spellerpages files to set the language. This was spellerpages/files/server-scripts/spellchecker.php - I had to set the path to Aspell (try the linux default if you're running on linux hosting) and the language to "en".

    Hope this helps.

    Dan.

  4. bravecreatures
    Member
    Posted 8 years ago #

    I have tried adding the code you suggest to the advacned-wysiwyg.php and finally its working. Neither spellerpages or iespell were showing up in the button row, but with a few tweaks it actually worked.

    The part I needed to configure was the spellerchecker.php. This depends on where I had aspell installed and configured for. This is what got mine showing the button.

    ///$aspell_prog = 'aspell'; //LINUX
    $aspell_prog = '/usr/bin/aspell'; // WINDOWS

    $lang = 'en';
    $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H";
    $tempfiledir = "./";
    $input_separator = "A";

    Now its got that far, it still is falling over when it trys to actually spell check, but at least I have made it another step closer.

    The text box doesnt seem to be reading correctly, there is no add button and it seems to be suggesting and then changing the wrong things (eg last error I handled) when I do click change. Any suiggestions?

  5. Morbing
    Member
    Posted 8 years ago #

    Thanks a lot:)
    Now all I need is to swap the "insert image" part with the imagebrowser/uploader part from mubcombs WYSIWYG editor.
    http://mudbomb.com/archives/2005/02/02/wysiwyg-plugin-for-wordpress/

    Do you think this is this possible?

  6. Morbing
    Member
    Posted 8 years ago #

    Sorry, I found a solution myself:)

  7. brianbonner
    Member
    Posted 8 years ago #

    Tell the rest of us the solution please?

  8. bravecreatures
    Member
    Posted 8 years ago #

    Strangely enough I have just tried the spell check on my computer at work and its working perfectly. Go figure.

    Things that I think I needed to check are:

    1/ the aspell installation on my server
    2/ that spellerchecker.php is pointing in the right place for aspell - see my post above
    3/ that spellerchecker.php has the right language listed - see my post above
    4/ that the plugin and button are listed correctly - - see other posts above

    My only remaining questions are:

    > how to get a custom dictionary working
    > how to get an Australian dictionary installed 9although I think this is an aspell issue)

  9. ctingom
    Member
    Posted 8 years ago #

    Hi everybody, this post is quit timely as I've been working for days to get a spell check plugin to work in WP 2.0. The fact that I say days shouldn't scare you because I'm not too familiar with php so I'm pretty much just hacking.

    With that in mind, I tend to get myself into a bind and then eventually out of it with enough effort.

    I have the spell check plugin working in 2.0 now based on everything written above.

    I got SpellerPages v1 from here:
    http://sourceforge.net/tracker/index.php?func=detail&aid=1339856&group_id=103281&atid=738747

    I made the modifications to the files as suggested above.

    For my path to perl I actually had to move the two comment slashes so that I was commenting out the Aspell path on Windows and using the Linux one. That and making sure the path was correct.

    I ended up using this:

    $aspell_prog = '/usr/local/bin/aspell'; //LINUX

    The spell check works in FireFox on PC and IE on PC. Doesn't work in Safari or FireFox on Mac. That's ok though.

    What I am having a problem with (hoping someone can help) is that when I run the spell check (and fix errors or ignore them) and then click Close it removes all of the line breaks.

    So if I have a bunch of line breaks in my post it just removes them. Now that is a big pain because it renders it useless.

    Any ideas?

  10. ctingom
    Member
    Posted 8 years ago #

    I started a thread about this up here:
    http://sourceforge.net/forum/forum.php?thread_id=1415390&forum_id=296697

    Specifically, it removes p tags except in cases where I have alignment formatting (like centered). Doesn't remove BR tags or blockquote or anything like that.

  11. ctingom
    Member
    Posted 8 years ago #

    If anybody is interested in helping me out with this issue I am willing to pay. Please contact me: http://www.tornadodesign.com/contact

    Thanks -

  12. ctingom
    Member
    Posted 8 years ago #

    I am looking for a WordPress Plugin programmer to hire about coding a spell check plugin for WP 2.0.

    Please contact me: http://www.tornadodesign.com/contact

Topic Closed

This topic has been closed to new replies.

About this Topic