| | |
| | | } |
| | | |
| | | // enable general commands |
| | | this.enable_command('logout', 'mail', 'addressbook', 'settings', 'save-pref', 'compose', 'undo', true); |
| | | this.enable_command('logout', 'mail', 'addressbook', 'settings', 'save-pref', 'compose', 'undo', 'switch-task', true); |
| | | |
| | | if (this.env.permaurl) |
| | | this.enable_command('permaurl', true); |
| | |
| | | this.enable_command('reply-list', this.env.list_post); |
| | | |
| | | if (this.env.action == 'show') { |
| | | this.http_request('pagenav', '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox), |
| | | this.http_request('pagenav', '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox) |
| | | + (this.env.search_request ? '&_search='+this.env.search_request : ''), |
| | | this.display_message('', 'loading')); |
| | | } |
| | | |
| | |
| | | if (!this.gui_objects.messageform) |
| | | break; |
| | | |
| | | if (!this.check_compose_input()) |
| | | if (!props.nocheck && !this.check_compose_input(command)) |
| | | break; |
| | | |
| | | // Reset the auto-save timer |
| | |
| | | if (this.folder_auto_timer) |
| | | window.clearTimeout(this.folder_auto_timer); |
| | | |
| | | this.folder_auto_expand = k; |
| | | this.folder_auto_expand = this.env.mailboxes[k].id; |
| | | this.folder_auto_timer = window.setTimeout(function() { |
| | | rcmail.command('collapse-folder', rcmail.folder_auto_expand); |
| | | rcmail.drag_start(null); |
| | |
| | | div.removeClass('expanded').addClass('collapsed'); |
| | | this.env.collapsed_folders = this.env.collapsed_folders+'&'+urlencode(name)+'&'; |
| | | |
| | | // select parent folder if one of its childs is currently selected |
| | | if (this.env.mailbox.indexOf(name + this.env.delimiter) == 0) |
| | | // select the folder if one of its childs is currently selected |
| | | // don't select if it's virtual (#1488346) |
| | | if (this.env.mailbox.indexOf(name + this.env.delimiter) == 0 && !$(li).hasClass('virtual')) |
| | | this.command('list', name); |
| | | } |
| | | else |
| | |
| | | }; |
| | | |
| | | // checks the input fields before sending a message |
| | | this.check_compose_input = function() |
| | | this.check_compose_input = function(cmd) |
| | | { |
| | | // check input fields |
| | | var ed, input_to = $("[name='_to']"), |
| | |
| | | |
| | | // display localized warning for missing subject |
| | | if (input_subject.val() == '') { |
| | | var subject = prompt(this.get_label('nosubjectwarning'), this.get_label('nosubject')); |
| | | var myprompt = $('<div class="prompt">').html('<div class="message">' + this.get_label('nosubjectwarning') + '</div>').appendTo(document.body); |
| | | var prompt_value = $('<input>').attr('type', 'text').attr('size', 30).appendTo(myprompt).val(this.get_label('nosubject')); |
| | | |
| | | // user hit cancel, so don't send |
| | | if (!subject && subject !== '') { |
| | | var buttons = {}; |
| | | buttons[this.get_label('cancel')] = function(){ |
| | | input_subject.focus(); |
| | | return false; |
| | | } |
| | | else |
| | | input_subject.val((subject ? subject : this.get_label('nosubject'))); |
| | | $(this).dialog('close'); |
| | | }; |
| | | buttons[this.get_label('sendmessage')] = function(){ |
| | | input_subject.val(prompt_value.val()); |
| | | $(this).dialog('close'); |
| | | ref.command(cmd, { nocheck:true }); // repeat command which triggered this |
| | | }; |
| | | |
| | | myprompt.dialog({ |
| | | modal: true, |
| | | resizable: false, |
| | | buttons: buttons, |
| | | close: function(event, ui) { $(this).remove() } |
| | | }); |
| | | prompt_value.select(); |
| | | return false; |
| | | } |
| | | |
| | | // Apply spellcheck changes if spell checker is active |
| | |
| | | if (!vis) |
| | | this.stop_spellchecking(); |
| | | |
| | | $(this.env.spellcheck.spell_container).css('visibility', vis ? 'visible' : 'hidden'); |
| | | $(this.env.spellcheck.spell_container)[vis ? 'show' : 'hide'](); |
| | | } |
| | | }; |
| | | |
| | |
| | | mod = rcube_event.get_modifier(e); |
| | | |
| | | switch (key) { |
| | | case 38: // key up |
| | | case 40: // key down |
| | | if (!this.ksearch_pane) |
| | | case 38: // arrow up |
| | | case 40: // arrow down |
| | | if (!this.ksearch_visible()) |
| | | break; |
| | | |
| | | var dir = key==38 ? 1 : 0; |
| | |
| | | this.delete_contacts = function() |
| | | { |
| | | var selection = this.contact_list.get_selection(), |
| | | undelete = this.env.address_sources[this.env.source].undelete; |
| | | undelete = this.env.source && this.env.address_sources[this.env.source].undelete; |
| | | |
| | | // exit if no mailbox specified or if selection is empty |
| | | if (!(selection.length || this.env.cid) || (!undelete && !confirm(this.get_label('deletecontactconfirm')))) |
| | |
| | | }); |
| | | }; |
| | | |
| | | this.plain2html = function(plainText, id) |
| | | this.plain2html = function(plain, id) |
| | | { |
| | | var lock = this.set_busy(true, 'converting'); |
| | | $('#'+id).val(plainText ? '<pre>'+plainText+'</pre>' : ''); |
| | | |
| | | plain = plain.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); |
| | | $('#'+id).val(plain ? '<pre>'+plain+'</pre>' : ''); |
| | | |
| | | this.set_busy(false, null, lock); |
| | | }; |
| | | |