[pmwiki-users] Small headache with a spell check attempt.

Seth Cherney sethcherney at yahoo.com
Fri Dec 15 17:58:56 CST 2006


I have been trying to integrate a java spell check into pmwiki, as I cannot access pspell/aspell on my hosted server.  

My thought was only to mod PM's spellcheck.php to call the other js (it works on js in the browser as well.  The spell checker I am trying to integrate is VERY easy to integrate (but I am no coder).  It is sourceforge.net/projects/jspspellcheck, based on jazzy - and using word lists fo dicts (ie can make any language!).
  
I was dropping the whole thing into the pub directory, then trying to rewrite the spellcheck.php in the cookbook to point to it.  There are a few syntax problems converting the js to php compatible js, and it tries to find the form name, but ther is no form name in pmwiki edit, just for the text area. bellow is the file I have been trying to work on.  the two lines with !!! are the ones I believe causing probs.  someone with a little time could perhaps download jspspellcheck and give me  some help??  I think it is very easy for someone with background (I am a theologian).

Yes, the script works fine from the directory outside of pmwiki.

My whole wiki will be for spell cheking, so this is crucial to say the least.  
THANKS IN ADVANCE, MERCI BIEN, MUCHAS GRACIAS.

CODE (pms orig is commented out at the top):
<?php if (!defined('PmWiki')) exit(); 
/*  
    This script adds a spell checking functionality to PmWiki
    based on Speller Pages (http://spellerpages.sourceforge.net)
    and GNU Aspell.

    The script was originally prototyped by Ciaran Jessup, and then
    modified by Patrick Michaud (pmichaud at pobox.com) for cleaner
    installation with PmWiki.  

    To use this script, you will need a working copy of GNU aspell
    on your server.  Then, add the following line to your local
    configuration:

        include_once('cookbook/spellchecker.php');

    This will add a "spell check" button to the GUI button bar, and
    link in the necessary spell checking scripts.
#<script src='$PubDirUrl/speller/spellChecker.js'></script>
#<script type='text/javascript' >
#function openSpellChecker() {
#    var textarea1 = document.getElementById('text');
#    var speller = new spellChecker( textarea1 );
#    speller.popUpUrl = '$PubDirUrl/speller/spellchecker.html';
##    speller.openChecker();
#}
#</script>
*/

# If we're not editing, then just exit.
if ($action != 'edit') return;
# Configure in the Speller Pages javascript code.
$HTMLHeaderFmt[] = "
<script src='$PubDirUrl/jspspellcheck/jspspellcheck/spellcheck-caller.js'></script>
<script type='text/javascript' >
function spellCheck(){
    var elements = new Array(0);
    !!!    elements = document.getElementById('text');
    !!!    startSpellCheck('$PubDirUrl/jspspellcheck/', elements );
}
</script>
";
# Add a GUI button for spell checking.
$GUIButtons['spellcheck'] = array(1000, '', '', '',
  "<a href='javascript:spellcheck()'><img src='\$GUIButtonDirUrlFmt/spellcheck.gif' title='$[Spell check]' style='border:0px' /></a>");

?>


 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20061215/31e7d7ea/attachment.html 


More information about the pmwiki-users mailing list