- Timestamp:
- 04/01/10 15:38:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/expressoMail1_2/corretor_ortografico/spell_checker/js/spell_checker.js
r2376 r2404 120 120 var ifr = document.getElementsByTagName('iframe')[0]; 121 121 var numSpellCheckers = 0; 122 var tempSpellCheckers = Array(); 123 // alert("NOT OK"); 124 125 //novo 126 //if (textareas){ 122 //var tempSpellCheckers = Array(); 123 127 124 if(ifr.contentWindow) 128 125 ifr=ifr.contentWindow.document; 129 126 else 130 127 ifr=ifr.contentDocument; 131 // alert(ifr.body.innerHTML); 132 var texto = ifr.body.innerHTML; 128 var texto = ifr.body.innerHTML; 133 129 134 130 // alert("valor textarea"); … … 376 372 377 373 378 // Adicionado por Nathalie374 // Obtain the HTML content from iframe (edit area) 379 375 var ifr= currObj.objToCheck; 380 376 if(ifr.contentWindow) … … 382 378 else 383 379 ifr=ifr.contentDocument; 384 alert(ifr.body.innerHTML);385 386 380 var texto = ifr.body.innerHTML; 387 381 … … 695 689 { 696 690 with(currObj); 691 var parentElement = currObj.spellingResultsDiv; 692 693 // Obtain all span tags which have highlight className or corrected_word className 694 var nodeArray = parentElement.getElementsByTagName("span"); 695 var totArray = nodeArray.length; 696 var nodeRemove = new Array(totArray); 697 var j = -1; 698 for (var i = 0 ; i < totArray ; i++) { 699 var node = nodeArray[i]; 700 if (node.className == "highlight" || node.className == "corrected_word") { 701 j++; 702 nodeRemove[j] = node.id; 703 704 705 } 706 } 707 708 //Remove span tags which have highlight className or corrected_word className 709 for (var i = 0 ; i <= j ; i++) { 710 var valorNo = document.getElementById(nodeRemove[i]).innerHTML; 711 var fake = document.createTextNode(valorNo); 712 var parent = document.getElementById(nodeRemove[i]).parentNode; 713 parent.replaceChild(fake, document.getElementById(nodeRemove[i])); 714 } 697 715 var text = currObj.spellingResultsDiv.innerHTML; 698 text = text.replace(/<br *\/?>/gi, "~~~"); 699 // Work around a cpaint/safari bug by prefixing an asterisk to the text so that the text is never completely empty 700 text = '*' + text; 701 cp.call(currObj.config['spellUrl'], 'switchText', switchText_cb, text); 716 717 text = text.replace(/ /gi, " %u2026 "); // Replace with the code %u2026 718 text = '*' + text; 719 cp.call(currObj.config['spellUrl'], 'switchText', switchText_cb, text); 720 702 721 }; // end switchText 703 722 … … 717 736 { 718 737 with(currObj); 738 739 new_string = new_string.replace(/ %u2026/gi, " "); // Replace the code %u2026 with 740 719 741 new_string = new_string.replace(/~~~/gi, "\n"); 720 742 721 743 // Remove the prefixed asterisk that was added in switchText(). 722 744 new_string = new_string.substr(1); 745 746 723 747 currObj.objToCheck.style.display = "none"; 724 748 var ifr= currObj.objToCheck; … … 727 751 else 728 752 ifr=ifr.contentDocument; 729 alert(ifr.body.innerHTML);730 753 var texto = ifr.body.innerHTML; 754 731 755 ifr.body.innerHTML = new_string; 732 756 currObj.objToCheck.disabled = false; … … 769 793 currObj.statusSpan.innerHTML = "Working..."; 770 794 } 795 771 796 772 797 if(spellingSuggestionsDiv) 773 798 { 774 spellingSuggestionsDiv.parentNode.removeChild(spellingSuggestionsDiv); 799 800 spellingSuggestionsDiv.parentNode.removeChild(spellingSuggestionsDiv); 775 801 spellingSuggestionsDiv = null; 776 802 }
Note: See TracChangeset
for help on using the changeset viewer.