Ignore:
Timestamp:
04/14/10 16:26:24 (14 years ago)
Author:
nathalie.silva
Message:

Ticket #891 - resolvido problema de drag e drop Firefox - alterado pra div - Nathalie

Location:
sandbox/expressoMail1_2/corretor_ortografico/spell_checker
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sandbox/expressoMail1_2/corretor_ortografico/spell_checker/css/spell_checker.css

    r2512 r2536  
    1515        padding: 2px 2px 2px 2px; 
    1616        text-align: left; 
    17          
     17 
     18        outline: none; outline-style: none; -moz-outline-style:none; outline-style: 0px; 
     19  _moz_resizing: false;  
    1820        
    1921         
     
    8385.highlight { 
    8486        color: #FF0000; 
     87        cursor: pointer; 
    8588        font-family: Verdana, Arial, Helvetica, sans-serif; 
    8689        font-size: 11px; 
    8790        text-decoration: underline; 
    88         cursor: pointer; 
     91         
     92        
     93 
    8994} 
    9095.no_misspellings { 
  • sandbox/expressoMail1_2/corretor_ortografico/spell_checker/js/spell_checker.js

    r2516 r2536  
    357357 *************************************************************/ 
    358358function 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     
    360376    var browser = checkBrowser(); 
    361377    if (browser == "ie"){ 
     
    396412function replaceMenu(){ 
    397413      //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     
    399433    var browser = checkBrowser(); 
    400434    if (browser == "ie"){ 
     
    500534        // Obtain all the span tags which have highlight className 
    501535        //    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"); 
    503537        var totArray = nodeArray.length; 
    504538        for (var i = 0 ; i < totArray ; i++) { 
    505539            var node = nodeArray[i]; 
    506540            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                } 
    511550 
    512551            } 
     
    864903            ifr=ifr.contentDocument; 
    865904 
    866         var nodeArray = ifr.getElementsByTagName("span"); 
     905        var nodeArray = ifr.getElementsByTagName("div"); 
    867906        var totArray = nodeArray.length; 
    868907        for (var i = 0 ; i < totArray ; i++) { 
    869908            var node = nodeArray[i]; 
    870909            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                } 
    875918                     
    876919 
     
    903946function showSuggestions(word, id) 
    904947{ 
    905         alert("showSuggestions"); 
     948         
    906949        //adicionado nathalie 
    907950         var ifr= currObj.objToCheck; 
     
    943986                spellingSuggestionsDiv.parentNode.removeChild(spellingSuggestionsDiv); 
    944987        } 
    945         spellingSuggestionsDiv = ifr.createElement('span'); 
     988        spellingSuggestionsDiv = ifr.createElement('div'); 
    946989        spellingSuggestionsDiv.style.display = "none"; 
    947990        spellingSuggestionsDiv.className = 'suggestion_box'; 
     
    950993        spellingSuggestionsDiv.style.top = (y+16-scrollPos) + 'px'; 
    951994        spellingSuggestionsDiv.id = 'suggestion_box'; //Adicionado Nathalie 
     995        spellingSuggestionsDiv.CONTENTEDITABLE="false" ;  
    952996         
    953997         
     
    9931037{ 
    9941038 
    995    alert("replaceWord"); 
     1039 
    9961040    var ifr= currObj.objToCheck; 
    9971041    if(ifr.contentWindow) 
     
    9991043    else 
    10001044        ifr=ifr.contentDocument; 
     1045    
    10011046 
    10021047    var valorNo = trim(ifr.getElementById(id).innerHTML); 
     
    10131058 
    10141059    // 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"); 
    10161061    var totArray = nodeArray.length; 
    10171062    var nodeRemove = new Array(totArray); 
     
    10311076    } 
    10321077 
     1078     
     1079 
    10331080 
    10341081    if(spellingSuggestionsDiv) 
     
    10991146function switchText() 
    11001147{ 
    1101         alert("switchText"); 
     1148        
    11021149        with(currObj); 
    11031150        //By Nathalie - The Element means that this div belongs to the current tab 
     
    11121159        // 
    11131160        // Obtain all span tags which have highlight className or corrected_word className 
    1114         var nodeArray = ifr.getElementsByTagName("span"); 
     1161        var nodeArray = ifr.getElementsByTagName("div"); 
    11151162        var totArray = nodeArray.length; 
    11161163        var nodeRemove = new Array(totArray); 
     
    11591206{ 
    11601207 
    1161 alert("switchText_cb"); 
     1208 
    11621209//adicionado Paula 
    11631210    with(currObj); 
     
    12091256function resumeEditing() 
    12101257{ 
    1211         alert("resumeEditing"); 
     1258         
    12121259        with(currObj); 
    12131260 
  • sandbox/expressoMail1_2/corretor_ortografico/spell_checker/spell_checker.php

    r2510 r2536  
    120120                for($i=0; $i<$tmpNum; $i++) 
    121121                { 
    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>"; 
    123123                } 
    124124         
    125125                if($editablePersonalDict) 
    126126                { 
    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>"; 
    128128                } 
    129129 
    130130                //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>"; 
    132132 
    133133 
     
    136136        { 
    137137                $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>"; 
    139139        } 
    140140         
     
    207207                                {                                         
    208208                                        $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]); 
    210210                                        $misspelledCount++; 
    211211                                }  
Note: See TracChangeset for help on using the changeset viewer.