- Timestamp:
- 04/16/10 10:55:43 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/expressoMail1_2/corretor_ortografico/spell_checker/spell_checker.php
r2554 r2557 162 162 * 163 163 *************************************************************/ 164 function spellCheck($string, $varName, $language )164 function spellCheck($string, $varName, $language, $browser) 165 165 { 166 166 //global $pspell_link; //the global link to the pspell module … … 181 181 $numResults = count($words); //the number of elements in the array. 182 182 183 $misspelledCount = 0; 183 $misspelledCount = 0; 184 185 186 /* There is a problem with innerHTML of IE browsers - It removes the spaces. 187 * If there are two misspelled words side by side, it makes then together (no space 188 * between then). This will be checked using this variable. 189 * */ 190 $difference = 0; 184 191 185 192 //this loop looks through the words array and splits any lines of text that aren't html tags on space, preserving the spaces. … … 207 214 { 208 215 $onClick = "onclick=\"setCurrentObject(" . $varName . "); showSuggestions('" . addslashes($tmpWord) . "', '" . $varName . "_" . $misspelledCount . "_" . addslashes($tmpWord) . "'); return false;\""; 209 $words[$i][$j] = str_replace($tmpWord, " <span " . $onClick . " id=\"" . $varName . "_" . $misspelledCount . "_" . $tmpWord . "\" class=\"highlight\">" . stripslashes($tmpWord) . " </span> ", $words[$i][$j]); 216 217 $difference = $misspelledCount + 1; 218 if (($difference - $misspelledCount) == 1 and $browser == "ie") //if IE, adds a html space before Span tag 219 $words[$i][$j] = str_replace($tmpWord, "<span " . $onClick . " id=\"" . $varName . "_" . $misspelledCount . "_" . $tmpWord . "\" class=\"highlight\">" . stripslashes($tmpWord) . " </span> ", $words[$i][$j]); 220 else 221 $words[$i][$j] = str_replace($tmpWord, "<span " . $onClick . " id=\"" . $varName . "_" . $misspelledCount . "_" . $tmpWord . "\" class=\"highlight\">" . stripslashes($tmpWord) . " </span>", $words[$i][$j]); 222 210 223 $misspelledCount++; 211 } 224 225 } 212 226 213 227 $words[$i][$j] = str_replace("\n", "<br />", $words[$i][$j]); //replace any breaks with <br />'s, for html display
Note: See TracChangeset
for help on using the changeset viewer.