summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-06-07 21:44:56 +0200
committerandi <andi@splitbrain.org>2005-06-07 21:44:56 +0200
commitdc57ef04af4d12bb589c98e7457a22c44a091815 (patch)
tree8364d81819ec7745ce4e05c149256c40704f19da /inc/html.php
parent50d915fed681509e84e625a5bfd4e3602dfe98d2 (diff)
downloadrpg-dc57ef04af4d12bb589c98e7457a22c44a091815.tar.gz
rpg-dc57ef04af4d12bb589c98e7457a22c44a091815.tar.bz2
AJAX spellchecker #29
This is nearly a complete rewrite of the gmail like AJAX spellchecker from http://www.broken-notebook.com/spell_checker/index.php Here are the differences and features * seemless integrated into DokuWiki * no need for the pspell extension * needs GNU aspell installed (not sure about the version I guess 0.60+ for UTF8) * needs PHP 4.3.0+ * uses SACK for AJAX * gets errors and suggestions in one transfer So far only tested in Firefox. It should work in IE, Safari and Opera 8, too. Please test and report back. darcs-hash:20050607194456-9977f-f699144d1fd28359742b2ce0f28c839a1f4cefbb.gz
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/inc/html.php b/inc/html.php
index d972c1abb..bd34bb609 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -833,6 +833,8 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
$ro='readonly="readonly"';
}
if(!$DATE) $DATE = $INFO['lastmod'];
+
+
?>
<form name="editform" method="post" action="<?=script()?>" accept-charset="<?=$lang['encoding']?>" onsubmit="return svchk()">
<input type="hidden" name="id" value="<?=$ID?>" />
@@ -842,7 +844,7 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
<input type="hidden" name="suffix" value="<?=formText($SUF)?>" />
<table style="width:99%">
<tr>
- <td class="toolbar" colspan="3">
+ <td class="toolbar" colspan="2">
<?if($wr){?>
<script language="JavaScript" type="text/javascript">
<?/* sets changed to true when previewed */?>
@@ -852,7 +854,7 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
formatButton('italic.png','<?=$lang['qb_italic']?>',"\/\/","\/\/",'<?=$lang['qb_italic']?>','i');
formatButton('underline.png','<?=$lang['qb_underl']?>','__','__','<?=$lang['qb_underl']?>','u');
formatButton('code.png','<?=$lang['qb_code']?>','\'\'','\'\'','<?=$lang['qb_code']?>','c');
- formatButton('strike.png','<?=$lang['qb_strike']?>','<del>','</del>','<?=$lang['qb_strike']?>','d');
+ formatButton('strike.png','<?=$lang['qb_strike']?>','<del>','<\/del>','<?=$lang['qb_strike']?>','d');
formatButton('fonth1.png','<?=$lang['qb_h1']?>','====== ',' ======\n','<?=$lang['qb_h1']?>','1');
formatButton('fonth2.png','<?=$lang['qb_h2']?>','===== ',' =====\n','<?=$lang['qb_h2']?>','2');
@@ -877,13 +879,20 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
</script>
<?}?>
</td>
+ <td>
+<!-- <span class="action" id="action"><a class="check_spelling" onClick="setObjToCheck('wikitext'); spellCheck();">Check Spelling</a></span>
+ <span class="status" id="status"></span> -->
+ <div id="spell_action"></div>
+ <div id="spell_suggest"></div>
+ </td>
</tr>
<tr>
<td colspan="3">
+ <div id="spell_result"></div>
<textarea name="wikitext" id="wikitext" <?=$ro?> cols="80" rows="10" class="edit" onchange="textChanged = true;" onkeyup="summaryCheck();" tabindex="1"><?="\n".formText($text)?></textarea>
</td>
</tr>
- <tr>
+ <tr id="wikieditbar">
<td>
<?if($wr){?>
<input class="button" type="submit" name="do" value="<?=$lang['btn_save']?>" accesskey="s" title="[ALT+S]" onclick="textChanged=false" onkeypress="textChanged=false" tabindex="3" />
@@ -902,6 +911,10 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
showSizeCtl();
<?if($wr){?>
init_locktimer(<?=$conf['locktime']-60?>,'<?=$lang['willexpire']?>');
+
+ //initialize spellchecker
+ ajax_spell.init('<?=$lang['spell_start']?>','<?=$lang['spell_stop']?>','<?=$lang['spell_wait']?>','<?=$lang['spell_noerr']?>','<?=$lang['spell_nosug']?>');
+
document.editform.wikitext.focus();
<?}?>
</script>