Changeset 3bd94b1 in github
- Timestamp:
- Sep 14, 2008 4:34:11 AM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 108d3b0
- Parents:
- 14c5b8e
- Location:
- program
- Files:
-
- 6 edited
-
js/app.js (modified) (2 diffs)
-
js/editor.js (modified) (3 diffs)
-
localization/en_GB/messages.inc (modified) (1 diff)
-
localization/en_US/messages.inc (modified) (1 diff)
-
localization/pl_PL/messages.inc (modified) (1 diff)
-
steps/settings/edit_identity.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
program/js/app.js
ra980cb8 r3bd94b1 3649 3649 { 3650 3650 var ischecked = checkbox.checked; 3651 var composeElement = document.getElementById(textAreaId); 3652 3651 3653 if (ischecked) 3652 3654 { 3653 tinyMCE.execCommand('mceAddControl', true, textAreaId); 3655 var existingPlainText = composeElement.value; 3656 var htmlText = "<pre>" + existingPlainText + "</pre>"; 3657 composeElement.value = htmlText; 3658 tinyMCE.execCommand('mceAddControl', true, textAreaId); 3654 3659 } 3655 3660 else 3656 3661 { 3657 tinyMCE.execCommand('mceRemoveControl', true, textAreaId); 3662 var thisMCE = tinyMCE.get(textAreaId); 3663 var existingHtml = thisMCE.getContent(); 3664 this.html2plain(existingHtml, textAreaId); 3665 tinyMCE.execCommand('mceRemoveControl', true, textAreaId); 3658 3666 } 3659 3667 }; … … 3715 3723 this.gui_objects.all_headers_row.style.display = 'none'; 3716 3724 elem.onclick = function() { rcmail.load_headers(elem); } 3725 } 3726 3727 3728 /********************************************************/ 3729 /********* html to text conversion functions *********/ 3730 /********************************************************/ 3731 3732 this.html2plain = function(htmlText, id) 3733 { 3734 var http_request = new rcube_http_request(); 3735 var url = this.env.bin_path+'html2text.php'; 3736 var rcmail = this; 3737 3738 this.set_busy(true, 'converting'); 3739 console.log('HTTP POST: '+url); 3740 3741 http_request.onerror = function(o) { rcmail.http_error(o); }; 3742 http_request.oncomplete = function(o) { rcmail.set_text_value(o, id); }; 3743 http_request.POST(url, htmlText, 'application/octet-stream'); 3744 } 3745 3746 this.set_text_value = function(httpRequest, id) 3747 { 3748 this.set_busy(false); 3749 document.getElementById(id).value = httpRequest.get_text(); 3750 console.log(httpRequest.get_text()); 3751 } 3752 3753 this.handle_conv_error = function(httpRequest) 3754 { 3755 alert('html2text request returned with error ' + httpRequest.xmlhttp.status); 3717 3756 } 3718 3757 -
program/js/editor.js
r4ca10b8 r3bd94b1 56 56 57 57 // do the appropriate conversion 58 59 var composeElement = document.getElementById('compose-body');60 61 58 if (selectedEditor == 'html') 62 59 { 63 var existingPlainText = composeElement.value;64 var htmlText = "<pre>" + existingPlainText+ "</pre>";60 var composeElement = document.getElementById('compose-body'); 61 var htmlText = "<pre>" + composeElement.value + "</pre>"; 65 62 composeElement.value = htmlText; 66 63 tinyMCE.execCommand('mceAddControl', true, 'compose-body'); … … 70 67 else 71 68 { 72 rcmail.set_busy(true, 'converting');73 69 var thisMCE = tinyMCE.get('compose-body'); 74 70 var existingHtml = thisMCE.getContent(); 75 rcmail _html2plain(existingHtml);71 rcmail.html2plain(existingHtml, 'compose-body'); 76 72 tinyMCE.execCommand('mceRemoveControl', true, 'compose-body'); 77 73 htmlFlag.value = "0"; … … 79 75 } 80 76 } 81 82 function rcmail_html2plain(htmlText)83 {84 var http_request = new rcube_http_request();85 86 http_request.onerror = function(o) { rcmail_handle_toggle_error(o); };87 http_request.oncomplete = function(o) { rcmail_set_text_value(o); };88 var url = rcmail.env.bin_path+'html2text.php';89 //console.log('HTTP request: ' + url);90 http_request.POST(url, htmlText, 'application/octet-stream');91 }92 93 function rcmail_set_text_value(httpRequest)94 {95 rcmail.set_busy(false);96 var composeElement = document.getElementById('compose-body');97 composeElement.value = httpRequest.get_text();98 }99 100 function rcmail_handle_toggle_error(httpRequest)101 {102 alert('html2text request returned with error ' + httpRequest.xmlhttp.status);103 } -
program/localization/en_GB/messages.inc
r9a5762a r3bd94b1 67 67 $messages['folderdeleted'] = 'Folder successfully deleted'; 68 68 $messages['deletedsuccessfully'] = 'Successfully deleted'; 69 $messages['converting'] = 'Removing formatting from message...';69 $messages['converting'] = 'Removing formatting...'; 70 70 $messages['messageopenerror'] = 'Could not load message from server'; 71 71 $messages['fileuploaderror'] = 'File upload failed'; -
program/localization/en_US/messages.inc
red132ed r3bd94b1 67 67 $messages['folderdeleted'] = 'Folder successfully deleted'; 68 68 $messages['deletedsuccessfully'] = "Successfully deleted"; 69 $messages['converting'] = 'Removing formatting from message...';69 $messages['converting'] = 'Removing formatting...'; 70 70 $messages['messageopenerror'] = 'Could not load message from server'; 71 71 $messages['fileuploaderror'] = 'File upload failed'; -
program/localization/pl_PL/messages.inc
r2a61274 r3bd94b1 90 90 $messages['folderdeleted'] = 'Folder zostaÅ pomyÅlnie usuniÄty.'; 91 91 $messages['deletedsuccessfully'] = 'UsuniÄto'; 92 $messages['converting'] = 'Konwertowanie wiadomoÅci...';92 $messages['converting'] = 'Konwertowanie tekstu...'; 93 93 $messages['messageopenerror'] = 'Nie moÅŒna zaÅadowaÄ wiadomoÅci z serwera'; 94 94 $messages['fileuploaderror'] = 'ZaÅÄ -
program/steps/settings/edit_identity.inc
r000bb9a r3bd94b1 61 61 62 62 // add some labels to client 63 rcube_add_label('noemailwarning', 'nonamewarning');63 $OUTPUT->add_label('noemailwarning', 'nonamewarning', 'converting'); 64 64 65 65
Note: See TracChangeset
for help on using the changeset viewer.
