Changeset 2536 for sandbox/expressoMail1_2/corretor_ortografico
- Timestamp:
- 04/14/10 16:26:24 (14 years ago)
- Location:
- sandbox/expressoMail1_2/corretor_ortografico
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/expressoMail1_2/corretor_ortografico/index.php
r2487 r2536 33 33 echo '<script type="text/javascript" src="spell_checker/cpaint/cpaint2.inc.js"></script>'; 34 34 echo '<script type="text/javascript" src="spell_checker/js/spell_checker.js"></script>'; 35 35 36 36 37 //Enable/Disable VoIP Service -> Voip Server Config -
sandbox/expressoMail1_2/corretor_ortografico/spell_checker/css/spell_checker.css
r2512 r2536 15 15 padding: 2px 2px 2px 2px; 16 16 text-align: left; 17 17 18 outline: none; outline-style: none; -moz-outline-style:none; outline-style: 0px; 19 _moz_resizing: false; 18 20 19 21 … … 83 85 .highlight { 84 86 color: #FF0000; 87 cursor: pointer; 85 88 font-family: Verdana, Arial, Helvetica, sans-serif; 86 89 font-size: 11px; 87 90 text-decoration: underline; 88 cursor: pointer; 91 92 93 89 94 } 90 95 .no_misspellings { -
sandbox/expressoMail1_2/corretor_ortografico/spell_checker/js/spell_checker.js
r2516 r2536 357 357 *************************************************************/ 358 358 function showMenu(){ 359 alert("showMenu"); 359 360 var iframe= currObj.objToCheck; 361 if(iframe.contentWindow) 362 iframe=iframe.contentWindow.document; 363 else 364 iframe=iframe.contentDocument; 365 366 var browser = checkBrowser(); 367 if (browser == "ie"){ 368 //iframe.body.CONTENTEDITABLE="false" ; 369 //iframe.CONTENTEDITABLE="true" ; 370 } 371 else { 372 iframe.designMode = "off"; 373 iframe.designMode = "on"; 374 } 375 360 376 var browser = checkBrowser(); 361 377 if (browser == "ie"){ … … 396 412 function replaceMenu(){ 397 413 //adicionado nathalie 398 alert("replaceMenu"); 414 415 var iframe= currObj.objToCheck; 416 if(iframe.contentWindow) 417 iframe=iframe.contentWindow.document; 418 else 419 iframe=iframe.contentDocument; 420 421 var browser = checkBrowser(); 422 if (browser == "ie"){ 423 //iframe.CONTENTEDITABLE="false" ; 424 //iframe.CONTENTEDITABLE="true" ; 425 } 426 else { 427 iframe.designMode = "off"; 428 iframe.designMode = "on"; 429 } 430 431 432 399 433 var browser = checkBrowser(); 400 434 if (browser == "ie"){ … … 500 534 // Obtain all the span tags which have highlight className 501 535 // and add the eventListener for the click - This event shows the suggestions menu 502 var nodeArray = ifr.getElementsByTagName(" span");536 var nodeArray = ifr.getElementsByTagName("div"); 503 537 var totArray = nodeArray.length; 504 538 for (var i = 0 ; i < totArray ; i++) { 505 539 var node = nodeArray[i]; 506 540 if (node.className == "highlight") { 507 if (document.addEventListener) 508 ifr.getElementsByTagName("span")[i].addEventListener("click", showMenu , true); 509 else 510 ifr.getElementsByTagName("span")[i].attachEvent("onclick", showMenu ); 541 if (document.addEventListener) { 542 ifr.getElementsByTagName("div")[i].addEventListener("click", showMenu , true); 543 ifr.getElementsByTagName("div")[i].style.cursor = "pointer"; 544 ifr.getElementsByTagName("div")[i].CONTENTEDITABLE="false" ; 545 } 546 else { 547 ifr.getElementsByTagName("div")[i].attachEvent("onclick", showMenu ); 548 ifr.getElementsByTagName("div")[i].CONTENTEDITABLE="false" ; 549 } 511 550 512 551 } … … 864 903 ifr=ifr.contentDocument; 865 904 866 var nodeArray = ifr.getElementsByTagName(" span");905 var nodeArray = ifr.getElementsByTagName("div"); 867 906 var totArray = nodeArray.length; 868 907 for (var i = 0 ; i < totArray ; i++) { 869 908 var node = nodeArray[i]; 870 909 if (node.className == "suggestion" || node.className == "ignore" ) { 871 if (document.addEventListener) 872 ifr.getElementsByTagName("span")[i].addEventListener("click", replaceMenu , true); 873 else 874 ifr.getElementsByTagName("span")[i].attachEvent("onclick", replaceMenu); 910 if (document.addEventListener){ 911 ifr.getElementsByTagName("div")[i].addEventListener("click", replaceMenu , true); 912 ifr.getElementsByTagName("div")[i].CONTENTEDITABLE="false" ; 913 } 914 else { 915 ifr.getElementsByTagName("div")[i].attachEvent("onclick", replaceMenu); 916 ifr.getElementsByTagName("div")[i].CONTENTEDITABLE="false" ; 917 } 875 918 876 919 … … 903 946 function showSuggestions(word, id) 904 947 { 905 alert("showSuggestions");948 906 949 //adicionado nathalie 907 950 var ifr= currObj.objToCheck; … … 943 986 spellingSuggestionsDiv.parentNode.removeChild(spellingSuggestionsDiv); 944 987 } 945 spellingSuggestionsDiv = ifr.createElement(' span');988 spellingSuggestionsDiv = ifr.createElement('div'); 946 989 spellingSuggestionsDiv.style.display = "none"; 947 990 spellingSuggestionsDiv.className = 'suggestion_box'; … … 950 993 spellingSuggestionsDiv.style.top = (y+16-scrollPos) + 'px'; 951 994 spellingSuggestionsDiv.id = 'suggestion_box'; //Adicionado Nathalie 995 spellingSuggestionsDiv.CONTENTEDITABLE="false" ; 952 996 953 997 … … 993 1037 { 994 1038 995 alert("replaceWord"); 1039 996 1040 var ifr= currObj.objToCheck; 997 1041 if(ifr.contentWindow) … … 999 1043 else 1000 1044 ifr=ifr.contentDocument; 1045 1001 1046 1002 1047 var valorNo = trim(ifr.getElementById(id).innerHTML); … … 1013 1058 1014 1059 // Obtain all span tags which have highlight className and contais the old word 1015 var nodeArray = ifr.getElementsByTagName(" span");1060 var nodeArray = ifr.getElementsByTagName("div"); 1016 1061 var totArray = nodeArray.length; 1017 1062 var nodeRemove = new Array(totArray); … … 1031 1076 } 1032 1077 1078 1079 1033 1080 1034 1081 if(spellingSuggestionsDiv) … … 1099 1146 function switchText() 1100 1147 { 1101 alert("switchText");1148 1102 1149 with(currObj); 1103 1150 //By Nathalie - The Element means that this div belongs to the current tab … … 1112 1159 // 1113 1160 // Obtain all span tags which have highlight className or corrected_word className 1114 var nodeArray = ifr.getElementsByTagName(" span");1161 var nodeArray = ifr.getElementsByTagName("div"); 1115 1162 var totArray = nodeArray.length; 1116 1163 var nodeRemove = new Array(totArray); … … 1159 1206 { 1160 1207 1161 alert("switchText_cb"); 1208 1162 1209 //adicionado Paula 1163 1210 with(currObj); … … 1209 1256 function resumeEditing() 1210 1257 { 1211 alert("resumeEditing");1258 1212 1259 with(currObj); 1213 1260 -
sandbox/expressoMail1_2/corretor_ortografico/spell_checker/spell_checker.php
r2510 r2536 120 120 for($i=0; $i<$tmpNum; $i++) 121 121 { 122 $retVal .= "< span class=\"suggestion\" onclick=\"replaceWord('" . addslashes_custom($id) . "', '" . addslashes(utf8_encode($suggestions[$i])) . "'); return false;\">" . utf8_encode($suggestions[$i]) . " </span></br>";122 $retVal .= "<div class=\"suggestion\" onclick=\"replaceWord('" . addslashes_custom($id) . "', '" . addslashes(utf8_encode($suggestions[$i])) . "'); return false;\">" . utf8_encode($suggestions[$i]) . " </div>"; 123 123 } 124 124 125 125 if($editablePersonalDict) 126 126 { 127 $retVal .= "< span class=\"addtoDictionary\" onclick=\"addWord('" . addslashes_custom($id) . "'); return false;\">Add To Dictionary</span>";127 $retVal .= "<div class=\"addtoDictionary\" onclick=\"addWord('" . addslashes_custom($id) . "'); return false;\">Add To Dictionary</div>"; 128 128 } 129 129 130 130 //Ignore the suggestion - Added by Nathalie 131 $retVal .= "< span class=\"ignore\" onclick=\"replaceWord('" . addslashes_custom($id) . "', '" . addslashes($word) . "'); return false;\"> Ignorar </span>";131 $retVal .= "<div class=\"ignore\" onclick=\"replaceWord('" . addslashes_custom($id) . "', '" . addslashes($word) . "'); return false;\"> Ignorar </div>"; 132 132 133 133 … … 136 136 { 137 137 $retVal .= "Sem sugestão"; 138 $retVal .= "< span class=\"ignore\" onclick=\"replaceWord('" . addslashes_custom($id) . "', '" . addslashes($word) . "'); return false;\"> Ignorar </span>";138 $retVal .= "<div class=\"ignore\" onclick=\"replaceWord('" . addslashes_custom($id) . "', '" . addslashes($word) . "'); return false;\"> Ignorar </div>"; 139 139 } 140 140 … … 207 207 { 208 208 $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]);209 $words[$i][$j] = str_replace($tmpWord, "<div " . $onClick . " id=\"" . $varName . "_" . $misspelledCount . "_" . $tmpWord . "\" class=\"highlight\">" . stripslashes($tmpWord) . " </div>", $words[$i][$j]); 210 210 $misspelledCount++; 211 211 }
Note: See TracChangeset
for help on using the changeset viewer.