Changeset 2477 for sandbox/expressoMail1_2
- Timestamp:
- 04/12/10 10:27:29 (14 years ago)
- Location:
- sandbox/expressoMail1_2/corretor_ortografico
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/expressoMail1_2/corretor_ortografico/js/main.js
r2431 r2477 1250 1250 1251 1251 var body = document.getElementById("body_" + new_border_ID); 1252 beginSpellCheck(parentDiv.id, "body_" + new_border_ID, new_border_ID);1252 // beginSpellCheck(); 1253 1253 body.contentWindow.document.open(); 1254 1254 // Insert the signature automaticaly at message body if use_signature preference is set … … 1386 1386 1387 1387 Element("border_id_" + new_border_ID).innerHTML = "<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td id=font_border_id_" + new_border_ID +" class='font-menu' width=*>" +title + "</td><td width=1px><img onmousedown='javascript:return false' style='cursor:pointer' onclick=delete_border('" + new_border_ID + "','false') src='templates/"+template+"/images/close_button.gif'></td></tr></table>"; 1388 1389 setupSpellChecker(); 1390 1388 1391 return new_border_ID; //Preciso retornar o ID da nova mensagem. 1389 1392 } -
sandbox/expressoMail1_2/corretor_ortografico/js/rich_text_editor.js
r2005 r2477 56 56 57 57 var checkbox = document.createElement("INPUT"); 58 checkbox.id = 'viewsource_rt_checkbox ';58 checkbox.id = 'viewsource_rt_checkbox_' + currentTab; 59 59 checkbox.type = "checkbox"; 60 60 checkbox.setAttribute("tabIndex","-1"); … … 169 169 } 170 170 div_button_rt.appendChild(selectBox); 171 171 172 172 173 var buttons = ['bold', 'italic', 'underline', 'forecolor', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', … … 198 199 } 199 200 201 selectBox=document.createElement("SELECT"); 202 selectBox.id="selectLanguage"; 203 selectBox.setAttribute("tabIndex","-1"); 204 selectBox.setAttribute("unselectable","on"); 205 selectBox.className = 'select_richtext'; 206 selectBox.onchange = function () {RichTextEditor.Select("selectLanguage");}; 207 var option1 = new Option(get_lang("Portuguese"),"pt_BR" ); 208 option1.selected = true; 209 var option2 = new Option(get_lang("English"),'en'); 210 var option3 = new Option(get_lang("Spanish"),'es'); 211 if (is_ie){ 212 selectBox.add(option1); 213 selectBox.add(option2); 214 selectBox.add(option3); 215 } 216 else{ 217 selectBox.add(option1, null); 218 selectBox.add(option2, null); 219 selectBox.add(option3, null); 220 } 221 div_button_rt.appendChild(selectBox); 222 223 // spellCheck button 224 var img = document.createElement("IMG"); 225 img.id = "spellCheck"; 226 img.className = 'imagebutton'; 227 img.align = 'center'; 228 img.src = './templates/'+template+'/images/'+img.id+'.gif'; 229 img.title = get_lang(img.id); 230 img.style.cursor = 'pointer'; 231 img.onclick = function () {RichTextEditor.editorCommand(this.id,'');}; 232 img.onmouseover = function () {this.style.border="outset 2px";}; 233 img.onmouseout = function () {this.style.border="solid 2px #C0C0C0";}; 234 div_button_rt.appendChild(img); 235 200 236 td.appendChild(div_button_rt); 201 237 tr.appendChild(td); … … 206 242 cRichTextEditor.prototype.editorCommand = function(command, option) { 207 243 try { 208 244 var mainField = document.getElementById(this.editor).contentWindow; 209 245 mainField.focus(); 210 246 var signature = preferences.type_signature == 'html' ? preferences.signature : preferences.signature.replace(/\n/g, "<br>"); … … 240 276 else if (command == 'Image') 241 277 mainField.document.execCommand('InsertImage', false, option); 278 else if (command == 'spellCheck'){ 279 beginSpellCheck(); // configure 280 spellCheck(); // run spellChecker 281 } 242 282 else 243 283 mainField.document.execCommand(command, false, option); -
sandbox/expressoMail1_2/corretor_ortografico/setup/phpgw_en.lang
r1747 r2477 99 99 Enable digitally sign/cipher the message? expressoMail1_2 en Enable digitally sign/cipher the message? 100 100 Enable Quick Reply expressoMail1_2 en Enable Quick Reply 101 English expressoMail1_2 en English 101 102 Enter a name for the box expressoMail1_2 en Enter a name for the box 102 103 Enter the name of the new folder: expressoMail1_2 en Enter the name of the new folder: … … 257 258 Postfix with LDAP expressoMail1_2 en Postfix with LDAP 258 259 People expressoMail1_2 en People 260 Portuguese expressoMail1_2 en Portuguese 259 261 Preferences expressoMail1_2 en Preferences 260 262 Previous expressoMail1_2 en Previous … … 335 337 Spam expressoMail1_2 en Spam 336 338 Spam Folder name admin en Spam Folder name 339 Spanish expressoMail1_2 en Spanish 337 340 standard IMAP server expressoMail1_2 en standard IMAP server 338 341 standard POP3 server expressoMail1_2 en standard POP3 server -
sandbox/expressoMail1_2/corretor_ortografico/setup/phpgw_es-es.lang
r1402 r2477 77 77 Enable expressoMail1_2 es-es Habilitar 78 78 Enable Quick Reply expressoMail1_2 es-es Responder rápidamente (con detalles y al remitente) 79 English expressoMail1_2 es-es Inglés 79 80 Enter a name for the box expressoMail1_2 es-es Entre con un nombre para la Bandeja 80 81 Enter the name of the new folder: expressoMail1_2 es-es Entre con un nombre para la nueva carpeta: … … 216 217 Personal Catalog expressoMail1_2 es-es Catálogo Personal 217 218 Postfix with LDAP expressoMail1_2 es-es Postfix con LDAP 219 Portuguese expressoMail1_2 es-es Portugués 218 220 Preferences expressoMail1_2 es-es Preferencias 219 221 Previous expressoMail1_2 es-es Anterior … … 286 288 Spam expressoMail1_2 es-es Espam 287 289 Spam Folder name admin es-es Nombre de la carpeta Spam 290 Spanish expressoMail1_2 es-es Español 288 291 standard IMAP server expressoMail1_2 es-es Servidor standar de IMAP 289 292 standard POP3 server expressoMail1_2 es-es Servidor standar de POP3 -
sandbox/expressoMail1_2/corretor_ortografico/setup/phpgw_pt-br.lang
r2022 r2477 134 134 Enabling this options you will be able to store messages in your local computer expressoMail1_2 pt-br Ao ativar esta opção você será capaz de armazenar mensagens no seu computador local 135 135 End of archive messages expressoMail1_2 pt-br Fim do arquivamento de mensagens 136 English expressoMail1_2 pt-br Inglês 136 137 Enter a name for the box expressoMail1_2 pt-br Entre com um nome para a caixa 137 138 Enter the name of the new folder: expressoMail1_2 pt-br Insira o nome da nova pasta: … … 337 338 Phone Warnings List expressoMail1_2 pt-br Lista de Alertas Telefônicos 338 339 Postfix with LDAP expressoMail1_2 pt-br Postfix with LDAP 340 Portuguese expressoMail1_2 pt-br Português 339 341 Preferences expressoMail1_2 pt-br Preferências 340 342 Preview message text within a tool-tip box? expressoMail1_2 pt-br Pré-visualizar a mensagem em uma caixa tool-tip? … … 435 437 Spam expressoMail1_2 pt-br Spam 436 438 Spam Folder name admin pt-br Nome da pasta spam 439 Spanish expressoMail1_2 pt-br Espanhol 437 440 standard IMAP server expressoMail1_2 pt-br servidor padrão de IMAP 438 441 standard POP3 server expressoMail1_2 pt-br servidor padrão de POP3 -
sandbox/expressoMail1_2/corretor_ortografico/spell_checker/js/spell_checker.js
r2430 r2477 43 43 var positionEditor; 44 44 var areaEditor; 45 var abaEditor; 45 var abaEditor; 46 var blockSpellCheck = false; 46 47 cp = new cpaint(); 47 48 cp.set_transfer_mode('post'); 48 49 cp.set_response_type('text'); 49 function beginSpellCheck(position, area, aba){ 50 51 50 function beginSpellCheck(){ 51 if(!blockSpellCheck){ 52 position = "body_position_" + currentTab; 53 area = "body_" + currentTab; 54 aba = currentTab; 52 55 //var cp = new cpaint(); 53 56 // alert("Seta globals"); … … 109 112 //window.onload =new setupSpellCheckers(); 110 113 //alert("Fim"); 114 } else { 115 alert("O corretor ja esta rodando.") 116 } 111 117 } // fecha funᅵᅵo 112 118 … … 140 146 141 147 }; // end setInit 148 149 function setupSpellChecker(){ 150 151 152 currObj = this; 153 154 currObj.config = new Array(); 155 156 currObj.config['divId'] = "body_position_" + currentTab; 157 currObj.config['width'] = "99%"; 158 currObj.config['id'] = "body_" + currentTab; 159 160 spellContainer = document.createElement('DIV'); 161 spellContainer.id = currObj.config['divId']; 162 spellContainer.className = 'spell_container'; 163 spellContainer.style.width = currObj.config['width']; 164 165 oldElement = document.getElementById(currObj.config['id']); 166 167 //oldElement.parentNode.replaceChild(spellContainer, oldElement); 168 169 //generate the div to hold the spell checker controls 170 currObj.controlPanelDiv = document.createElement('DIV'); 171 currObj.controlPanelDiv.className = 'control_panel'; 172 currObj.controlPanelDiv.id = 'control_panel_' + currentTab; 173 document.getElementById(currObj.config['divId']).appendChild(currObj.controlPanelDiv); 174 175 //the span that toggles between spell checking and editing 176 currObj.actionSpan = document.createElement('SPAN'); 177 currObj.actionSpan.className = "action"; 178 currObj.actionSpan.id = "action"; 179 /*if(currObj.config['useIcons']) 180 { 181 currObj.actionSpan.innerHTML = "<a class=\"check_spelling\" onclick=\"setCurrentObject(" + currObj.config['varName'] + "); " + currObj.config['varName'] + ".spellCheck();\"><img src=\"images/spellcheck.png\" width=\"16\" height=\"16\" title=\"Verificar Ortografia\" alt=\"Verificar Ortografia \" border=\"0\" /></a>"; 182 } 183 else 184 { 185 currObj.actionSpan.innerHTML = "<a class=\"check_spelling\" onclick=\"setCurrentObject(" + currObj.config['varName'] + "); " + currObj.config['varName'] + ".spellCheck();\">Verificar Ortografia</a>"; 186 }*/ 187 currObj.controlPanelDiv.appendChild(currObj.actionSpan); 188 189 //the span that lets the user know of the status of the spell checker 190 currObj.statusSpan = document.createElement('SPAN'); 191 currObj.statusSpan.className = "status"; 192 currObj.statusSpan.id = "status"; 193 currObj.statusSpan.innerHTML = ""; 194 currObj.controlPanelDiv.style.display = "none"; 195 currObj.controlPanelDiv.appendChild(currObj.statusSpan); 196 197 //document.getElementById("body_position_" + currentTab).insertBefore(currObj.controlPanelDiv, document.getElementById("viewsource_rt_checkbox")); 198 //the textarea to be spell checked 199 //oldElement.value = currObj.config['value']; 200 //document.getElementById(currObj.config['divId']).appendChild(oldElement); 201 currObj.controlPanelDiv.parentNode.insertBefore(currObj.controlPanelDiv, document.getElementById("viewsource_rt_checkbox_" + currentTab)); 202 203 } 142 204 143 205 … … 161 223 function ajaxSpell(varName, width, height, spellUrl, divId, name, id, title, value) 162 224 { 163 164 225 226 currObj = this; 165 227 166 228 currObj.config = new Array(); //the array of configuration options … … 185 247 } 186 248 187 spellContainer = document.createElement('DIV');249 /*spellContainer = document.createElement('DIV'); 188 250 spellContainer.id = currObj.config['divId']; 189 251 spellContainer.className = 'spell_container'; … … 192 254 oldElement = document.getElementById(currObj.config['id']); 193 255 194 oldElement.parentNode.replaceChild(spellContainer, oldElement);256 //oldElement.parentNode.replaceChild(spellContainer, oldElement); 195 257 196 258 //generate the div to hold the spell checker controls … … 203 265 currObj.actionSpan.className = "action"; 204 266 currObj.actionSpan.id = "action"; 205 if(currObj.config['useIcons'])267 /*if(currObj.config['useIcons']) 206 268 { 207 269 currObj.actionSpan.innerHTML = "<a class=\"check_spelling\" onclick=\"setCurrentObject(" + currObj.config['varName'] + "); " + currObj.config['varName'] + ".spellCheck();\"><img src=\"images/spellcheck.png\" width=\"16\" height=\"16\" title=\"Verificar Ortografia\" alt=\"Verificar Ortografia \" border=\"0\" /></a>"; … … 210 272 { 211 273 currObj.actionSpan.innerHTML = "<a class=\"check_spelling\" onclick=\"setCurrentObject(" + currObj.config['varName'] + "); " + currObj.config['varName'] + ".spellCheck();\">Verificar Ortografia</a>"; 212 } 213 currObj.controlPanelDiv.appendChild(currObj.actionSpan);274 }*/ 275 /*currObj.controlPanelDiv.appendChild(currObj.actionSpan); 214 276 215 277 //the span that lets the user know of the status of the spell checker … … 219 281 currObj.statusSpan.innerHTML = ""; 220 282 currObj.controlPanelDiv.appendChild(currObj.statusSpan); 221 283 284 //document.getElementById("body_position_" + currentTab).insertBefore(currObj.controlPanelDiv, document.getElementById("viewsource_rt_checkbox")); 222 285 //the textarea to be spell checked 223 286 oldElement.value = currObj.config['value']; 224 document.getElementById(currObj.config['divId']).appendChild(oldElement); 225 226 287 //document.getElementById(currObj.config['divId']).appendChild(oldElement); 288 currObj.controlPanelDiv.parentNode.insertBefore(currObj.controlPanelDiv, document.getElementById("viewsource_rt_checkbox_" + currentTab)); 289 */ 290 291 currObj.controlPanelDiv = document.getElementById('control_panel_' + currentTab); 292 currObj.statusSpan = currObj.controlPanelDiv.childNodes[1]; 293 currObj.actionSpan = currObj.controlPanelDiv.childNodes[0] ; 294 227 295 currObj.objToCheck = document.getElementById(currObj.config['id']); //the actual object we're spell checking 228 296 currObj.spellingResultsDiv = null; // Auto-generated results div … … 276 344 function spellCheck_cb(new_data) 277 345 { 278 with(currObj); 346 347 with(currObj); 279 348 new_data = new_data.toString(); 280 349 var isThereAMisspelling = new_data.charAt(0); … … 295 364 296 365 currObj.objToCheck.style.display = "none"; 297 currObj.objToCheck.parentNode.insertBefore(currObj.spellingResultsDiv,currObj.objToCheck); 366 //currObj.objToCheck.parentNode. 367 //currObj.objToCheck.parentNode.appendChild(currObj.spellingResultsDiv,currObj.objToCheck); 368 currObj.objToCheck.parentNode.insertBefore(currObj.spellingResultsDiv, document.getElementById("viewsource_rt_checkbox_" + currentTab)); 298 369 currObj.statusSpan.innerHTML = ""; 299 370 … … 320 391 currObj.objToCheck.disabled = false; 321 392 } 393 394 currObj.controlPanelDiv.style.display = "block"; 395 322 396 }; // end spellCheck_cb 323 397 … … 332 406 *************************************************************/ 333 407 function spellCheck() { 334 with(currObj); 335 var query; 336 337 if(currObj.spellingResultsDiv) 338 { 339 currObj.spellingResultsDiv.parentNode.removeChild(currObj.spellingResultsDiv); 340 currObj.spellingResultsDiv = null; 341 } 342 343 if(currObj.config['useIcons']) 344 { 345 currObj.actionSpan.innerHTML = "<img src=\"images/spellcheck.png\" width=\"16\" height=\"16\" title=\"Verificar Ortografia\" alt=\"Verificar Ortografia\" border=\"0\" />"; 346 } 347 else 348 { 349 currObj.actionSpan.innerHTML = "<a class=\"check_spelling\">Verificar Ortografia</a>"; 350 } 351 352 if(currObj.config['useIcons']) 353 { 354 currObj.statusSpan.innerHTML = "<img src=\"images/working.gif\" width=\"16\" height=\"16\" title=\"Verificando Ortografia...\" alt=\"Verificando Ortografia...\" border=\"0\" />"; 355 } 356 else 357 { 358 currObj.statusSpan.innerHTML = "Verificando Ortografia..."; 359 } 360 361 362 // Obtain the HTML content from iframe (edit area) 363 var ifr= currObj.objToCheck; 364 if(ifr.contentWindow) 365 ifr=ifr.contentWindow.document; 366 else 367 ifr=ifr.contentDocument; 368 var texto = ifr.body.innerHTML; 369 370 371 query = texto; 372 //query = currObj.objToCheck.value; 373 374 //query = query.replace(/\r?\n/gi, "<br />"); // Commented from the original by Nathalie 375 query = query.replace(/\r?\n/gi, " "); // replace \n with " " - By Nathalie 376 377 378 cp.call(currObj.config['spellUrl'], 'spellCheck', spellCheck_cb, query, currObj.config['varName']); 408 409 if(!blockSpellCheck) { 410 blockSpellCheck = true; 411 412 language = document.getElementById("selectLanguage"); 413 language = language[document.getElementById("selectLanguage").selectedIndex].value; 414 415 with(currObj); 416 var query; 417 418 currObj.controlPanelDiv.style.display = "block"; 419 420 if(currObj.spellingResultsDiv) 421 { 422 currObj.spellingResultsDiv.parentNode.removeChild(currObj.spellingResultsDiv); 423 currObj.spellingResultsDiv = null; 424 } 425 426 /*if(currObj.config['useIcons']) 427 { 428 currObj.actionSpan.innerHTML = "<img src=\"images/spellcheck.png\" width=\"16\" height=\"16\" title=\"Verificar Ortografia\" alt=\"Verificar Ortografia\" border=\"0\" />"; 429 } 430 else 431 { 432 currObj.actionSpan.innerHTML = "<a class=\"check_spelling\">Verificar Ortografia</a>"; 433 }*/ 434 435 /*if(currObj.config['useIcons']) 436 { 437 currObj.statusSpan.innerHTML = "<img src=\"images/working.gif\" width=\"16\" height=\"16\" title=\"Verificando Ortografia...\" alt=\"Verificando Ortografia...\" border=\"0\" />"; 438 } 439 else 440 { 441 currObj.statusSpan.innerHTML = "Verificando Ortografia..."; 442 }*/ 443 444 // Obtain the HTML content from iframe (edit area) 445 var ifr= currObj.objToCheck; 446 if(ifr.contentWindow) 447 ifr=ifr.contentWindow.document; 448 else 449 ifr=ifr.contentDocument; 450 var texto = ifr.body.innerHTML; 451 452 query = texto; 453 //query = currObj.objToCheck.value; 454 455 //query = query.replace(/\r?\n/gi, "<br />"); // Commented from the original by Nathalie 456 query = query.replace(/\r?\n/gi, " "); // replace \n with " " - By Nathalie 457 458 cp.call(currObj.config['spellUrl'], 'spellCheck', spellCheck_cb, query, currObj.config['varName'], language); 459 } 379 460 }; // end spellcheck 380 461 … … 400 481 spellingSuggestionsDiv = null; 401 482 } 402 483 484 currObj.controlPanelDiv.style.display = "block"; 485 403 486 if(currObj.config['useIcons']) 404 487 { … … 595 678 function showSuggestions(word, id) 596 679 { 597 680 language = document.getElementById("selectLanguage"); 681 language = language[document.getElementById("selectLanguage").selectedIndex].value; 682 598 683 with(currObj); 599 684 if(currObj.config['useIcons']) … … 633 718 document.body.appendChild(spellingSuggestionsDiv); 634 719 635 cp.call(currObj.config['spellUrl'], 'showSuggestions', showSuggestions_cb, word, id );720 cp.call(currObj.config['spellUrl'], 'showSuggestions', showSuggestions_cb, word, id, language); 636 721 }; // end showSuggestions 637 722 … … 682 767 683 768 with(currObj); 684 685 769 //By Nathalie - The Element means that this div belongs to the current tab 686 770 var parentElement = Element(currObj.spellingResultsDiv.id); 687 688 771 // Obtain all span tags which have highlight className or corrected_word className 689 772 var nodeArray = parentElement.getElementsByTagName("span"); … … 691 774 var nodeRemove = new Array(totArray); 692 775 var j = -1; 776 693 777 for (var i = 0 ; i < totArray ; i++) { 694 778 var node = nodeArray[i]; … … 708 792 parent.replaceChild(fake, document.getElementById(nodeRemove[i])); 709 793 } 710 var text = currObj.spellingResultsDiv.innerHTML; 794 795 var text = currObj.spellingResultsDiv.innerHTML; 711 796 712 797 text = text.replace(/ /gi, " %u2026 "); // Replace with the code %u2026 713 798 text = '*' + text; 799 714 800 cp.call(currObj.config['spellUrl'], 'switchText', switchText_cb, text); 715 801 … … 730 816 function switchText_cb(new_string) 731 817 { 732 818 733 819 with(currObj); 734 820 … … 775 861 776 862 with(currObj); 863 864 currObj.controlPanelDiv.style.display = "block"; 777 865 if(currObj.config['useIcons']) 778 866 { … … 812 900 function resetAction() 813 901 { 814 815 902 with(currObj); 816 if(currObj.config['useIcons'])903 /*if(currObj.config['useIcons']) 817 904 { 818 905 currObj.actionSpan.innerHTML = "<a class=\"check_spelling\" onclick=\"setCurrentObject(" + currObj.config['varName'] + "); " + currObj.config['varName'] + ".spellCheck();\"><img src=\"images/spellcheck.png\" width=\"16\" height=\"16\" title=\"Verificar Ortografia\" alt=\"Verificar Ortografia\" border=\"0\" /></a>"; … … 821 908 { 822 909 currObj.actionSpan.innerHTML = "<a class=\"check_spelling\" onclick=\"setCurrentObject(" + currObj.config['varName'] + "); " + currObj.config['varName'] + ".spellCheck();\">Verificar Ortografia</a>"; 823 } 824 910 }*/ 911 912 currObj.actionSpan.innerHTML = ""; 825 913 currObj.statusSpan.innerHTML = ""; 914 currObj.controlPanelDiv.style.display = "none"; 915 blockSpellCheck = false; 826 916 }; // end resetAction 827 917 -
sandbox/expressoMail1_2/corretor_ortografico/spell_checker/spell_checker.php
r2430 r2477 75 75 76 76 //$pspell_link = pspell_new_config($pspell_config); 77 $pspell_link = pspell_new("pt_BR"); 77 78 78 79 79 require_once("cpaint/cpaint2.inc.php"); //AJAX library file … … 98 98 * 99 99 *************************************************************/ 100 function showSuggestions($word, $id )100 function showSuggestions($word, $id, $language) 101 101 { 102 102 global $editablePersonalDict; //bool to set editability of personal dictionary 103 global $pspell_link; //the global link to the pspell module 103 //global $pspell_link; //the global link to the pspell module 104 $pspell_link = pspell_new($language); 104 105 global $cp; //the CPAINT object 105 106 … … 160 161 * 161 162 *************************************************************/ 162 function spellCheck($string, $varName) 163 { 164 global $pspell_link; //the global link to the pspell module 163 function spellCheck($string, $varName, $language) 164 { 165 //global $pspell_link; //the global link to the pspell module 166 $pspell_link = pspell_new($language); 165 167 global $cp; //the CPAINT object 166 168 $retVal = ""; … … 287 289 { 288 290 global $editablePersonalDict; 289 global $pspell_link; //the global link to the pspell module 291 //global $pspell_link; //the global link to the pspell module 292 $pspell_link = pspell_new("pt_BR"); 290 293 global $cp; //the CPAINT object 291 294 $retVal = "";
Note: See TracChangeset
for help on using the changeset viewer.