Index: /sandbox/expressoMail1_2/corretor_ortografico/spell_checker/spell_checker.php
===================================================================
--- /sandbox/expressoMail1_2/corretor_ortografico/spell_checker/spell_checker.php (revision 2554)
+++ /sandbox/expressoMail1_2/corretor_ortografico/spell_checker/spell_checker.php (revision 2557)
@@ -162,5 +162,5 @@
*
*************************************************************/
-function spellCheck($string, $varName, $language)
+function spellCheck($string, $varName, $language, $browser)
{
//global $pspell_link; //the global link to the pspell module
@@ -181,5 +181,12 @@
$numResults = count($words); //the number of elements in the array.
- $misspelledCount = 0;
+ $misspelledCount = 0;
+
+
+ /* There is a problem with innerHTML of IE browsers - It removes the spaces.
+ * If there are two misspelled words side by side, it makes then together (no space
+ * between then). This will be checked using this variable.
+ * */
+ $difference = 0;
//this loop looks through the words array and splits any lines of text that aren't html tags on space, preserving the spaces.
@@ -207,7 +214,14 @@
{
$onClick = "onclick=\"setCurrentObject(" . $varName . "); showSuggestions('" . addslashes($tmpWord) . "', '" . $varName . "_" . $misspelledCount . "_" . addslashes($tmpWord) . "'); return false;\"";
- $words[$i][$j] = str_replace($tmpWord, " " . stripslashes($tmpWord) . " ", $words[$i][$j]);
+
+ $difference = $misspelledCount + 1;
+ if (($difference - $misspelledCount) == 1 and $browser == "ie") //if IE, adds a html space before Span tag
+ $words[$i][$j] = str_replace($tmpWord, "" . stripslashes($tmpWord) . " ", $words[$i][$j]);
+ else
+ $words[$i][$j] = str_replace($tmpWord, "" . stripslashes($tmpWord) . " ", $words[$i][$j]);
+
$misspelledCount++;
- }
+
+ }
$words[$i][$j] = str_replace("\n", "
", $words[$i][$j]); //replace any breaks with
's, for html display
Index: /sandbox/expressoMail1_2/corretor_ortografico/spell_checker/js/spell_checker.js
===================================================================
--- /sandbox/expressoMail1_2/corretor_ortografico/spell_checker/js/spell_checker.js (revision 2554)
+++ /sandbox/expressoMail1_2/corretor_ortografico/spell_checker/js/spell_checker.js (revision 2557)
@@ -412,6 +412,5 @@
function spellCheck_cb(new_data)
{
-
- var ifr= currObj.objToCheck;
+ var ifr= currObj.objToCheck;
if(ifr.contentWindow)
ifr=ifr.contentWindow.document;
@@ -419,5 +418,4 @@
ifr=ifr.contentDocument;
-
with(currObj);
@@ -426,25 +424,21 @@
new_data = new_data.substring(1);
-
-
- if(currObj.spellingResultsDiv)
- {
-
- ifr.removeChild(currObj.spellingResultsDiv.id);
-
- }
-
-
- var ifr= currObj.objToCheck;
- if(ifr.contentWindow)
- ifr=ifr.contentWindow.document;
- else
- ifr=ifr.contentDocument;
- ifr.body.innerHTML = "";
- var cssLink = ifr.createElement("link");
- cssLink.href = "spell_checker/css/spell_checker.css";
- cssLink .rel = "stylesheet";
- cssLink .type = "text/css";
- //Testes nathalie - substituido
+ if(currObj.spellingResultsDiv)
+ {
+ ifr.removeChild(currObj.spellingResultsDiv.id);
+ }
+
+ var ifr= currObj.objToCheck;
+ if(ifr.contentWindow)
+ ifr=ifr.contentWindow.document;
+ else
+ ifr=ifr.contentDocument;
+ ifr.body.innerHTML = "";
+ var cssLink = ifr.createElement("link");
+ cssLink.href = "spell_checker/css/spell_checker.css";
+ cssLink .rel = "stylesheet";
+ cssLink .type = "text/css";
+
+ // this is not being used
currObj.spellingResultsDiv = ifr.createElement('span');
currObj.spellingResultsDiv.className = 'edit_box';
@@ -457,15 +451,9 @@
//currObj.objToCheck.style.display = "none";
currObj.statusSpan.innerHTML = "";
-
- //ifr.body.appendChild(currObj.spellingResultsDiv);
- //alert(new_data);
- ifr.body.innerHTML = "";
- //alert(new_data);
- //new_data = new_data.replace(/