diff options
author | alecpl <alec@alec.pl> | 2010-06-29 19:27:26 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-06-29 19:27:26 +0000 |
commit | 087c7dc5d2e58e4aa99f1ffdb9b8f01c6121ce1d (patch) | |
tree | 566cbf7451768406f431d597a6c20f87a317e6e5 /program/js | |
parent | 02cc63c515488aede560facf0d4ae59792776c84 (diff) |
- Improved compose screen: resizable body and attachments list, vertical splitter, options menu
- Removed productname/version element, changed footer size to 20px
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 33 | ||||
-rw-r--r-- | program/js/editor.js | 18 | ||||
-rw-r--r-- | program/js/googiespell.js | 42 |
3 files changed, 32 insertions, 61 deletions
diff --git a/program/js/app.js b/program/js/app.js index 4c0e1841f..4f2ef85e8 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -225,7 +225,7 @@ function rcube_webmail() } } else if (this.env.action == 'compose') { - this.enable_command('add-attachment', 'send-attachment', 'remove-attachment', 'send', true); + this.enable_command('send-attachment', 'remove-attachment', 'send', true); if (this.env.spellcheck) { this.env.spellcheck.spelling_state_observer = function(s){ ref.set_spellcheck_state(s); }; @@ -872,9 +872,6 @@ function rcube_webmail() clearTimeout(this.request_timer); break; - case 'add-attachment': - this.show_attachment_form(true); - case 'send-attachment': // Reset the auto-save timer self.clearTimeout(this.save_timer); @@ -3068,32 +3065,6 @@ function rcube_webmail() return true; }; - this.show_attachment_form = function(a) - { - if (!this.gui_objects.uploadbox) - return false; - - var elm, list; - if (elm = this.gui_objects.uploadbox) { - if (a && (list = this.gui_objects.attachmentlist)) { - var pos = $(list).offset(); - elm.style.top = (pos.top + list.offsetHeight + 10) + 'px'; - elm.style.left = pos.left + 'px'; - } - - $(elm).toggle(); - } - - // clear upload form - try { - if (!a && this.gui_objects.attachmentform != this.gui_objects.messageform) - this.gui_objects.attachmentform.reset(); - } - catch(e){} // ignore errors - - return true; - }; - // upload attachment file this.upload_file = function(form) { @@ -3156,8 +3127,6 @@ function rcube_webmail() form.setAttribute('enctype', 'multipart/form-data'); form.submit(); - // hide upload form - this.show_attachment_form(false); // display upload indicator and cancel button var content = this.get_label('uploading'); if (this.env.loadingicon) diff --git a/program/js/editor.js b/program/js/editor.js index bd9c00cdc..a5e3af3d5 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -103,8 +103,7 @@ function rcmail_toggle_editor(select, textAreaId, flagElement) else ishtml = select.value == 'html'; - if (ishtml) - { + if (ishtml) { rcmail.display_spellcheck_controls(false); rcmail.plain2html(composeElement.value, textAreaId); @@ -113,25 +112,24 @@ function rcmail_toggle_editor(select, textAreaId, flagElement) setTimeout("rcmail_editor_tabindex();", 500); if (flagElement && (flag = rcube_find_object(flagElement))) flag.value = '1'; - } - else - { + } + else { var thisMCE = tinyMCE.get(textAreaId); var existingHtml = thisMCE.getContent(); if (existingHtml) { if (!confirm(rcmail.get_label('editorwarning'))) { if (select.tagName == 'SELECT') - select.value = 'html'; + select.value = 'html'; return false; - } + } rcmail.html2plain(existingHtml, textAreaId); - } + } tinyMCE.execCommand('mceRemoveControl', false, textAreaId); rcmail.display_spellcheck_controls(true); if (flagElement && (flag = rcube_find_object(flagElement))) flag.value = '0'; - } -}; + } +} diff --git a/program/js/googiespell.js b/program/js/googiespell.js index 51acb732f..a9879f361 100644 --- a/program/js/googiespell.js +++ b/program/js/googiespell.js @@ -767,6 +767,27 @@ this.hideLangWindow = function() { $(this.switch_lan_pic).removeClass().addClass('googie_lang_3d_on'); }; +this.showLangWindow = function(elm) { + if (this.show_menu_observer) + this.show_menu_observer(this); + + this.createLangWindow(); + $('body').append(this.language_window); + + var pos = $(elm).offset(), + height = $(elm).height(), + width = $(elm).width(), + h = $(this.language_window).height(), + pageheight = $(document).height(), + left = this.change_lang_pic_placement == 'right' ? + pos.left - 100 + width : pos.left + width, + top = pos.top + h < pageheight ? pos.top + height : pos.top - h - 4; + + $(this.language_window).css({'visibility': 'visible', 'top' : top+'px','left' : left+'px'}); + + this.highlightCurSel(); +}; + this.deHighlightCurSel = function() { $(this.lang_cur_elm).removeClass().addClass('googie_list_onout'); }; @@ -776,32 +797,15 @@ this.highlightCurSel = function() { GOOGIE_CUR_LANG = GOOGIE_DEFAULT_LANG; for (var i=0; i < this.lang_elms.length; i++) { if ($(this.lang_elms[i]).attr('googieId') == GOOGIE_CUR_LANG) { - this.lang_elms[i].className = "googie_list_selected"; + this.lang_elms[i].className = 'googie_list_selected'; this.lang_cur_elm = this.lang_elms[i]; } else { - this.lang_elms[i].className = "googie_list_onout"; + this.lang_elms[i].className = 'googie_list_onout'; } } }; -this.showLangWindow = function(elm) { - if (this.show_menu_observer) - this.show_menu_observer(this); - - this.createLangWindow(); - $('body').append(this.language_window); - - var pos = $(elm).offset(), - top = pos.top + $(elm).height(), - left = this.change_lang_pic_placement == 'right' ? - pos.left - 100 + $(elm).width() : pos.left + $(elm).width(); - - $(this.language_window).css({'visibility': 'visible', 'top' : top+'px','left' : left+'px'}); - - this.highlightCurSel(); -}; - this.createChangeLangPic = function() { var img = $('<img>') .attr({src: this.img_dir + 'change_lang.gif', 'alt': 'Change language', 'googie_action_btn': '1'}), |