| | |
| | | |
| | | this.drag_end = function(e) |
| | | { |
| | | this.drag_active = false; |
| | | this.env.last_folder_target = null; |
| | | var list, model; |
| | | |
| | | if (this.treelist) |
| | | this.treelist.drag_end(); |
| | | |
| | | // execute drag & drop action when mouse was released |
| | | if (list = this.message_list) |
| | | model = this.env.mailboxes; |
| | | else if (list = this.contact_list) |
| | | model = this.env.contactfolders; |
| | | |
| | | if (this.drag_active && model && this.env.last_folder_target) { |
| | | var target = model[this.env.last_folder_target]; |
| | | list.draglayer.hide(); |
| | | |
| | | if (this.contact_list) { |
| | | if (!this.contacts_drag_menu(e, target)) |
| | | this.command('move', target); |
| | | } |
| | | else if (!this.drag_menu(e, target)) |
| | | this.command('move', target); |
| | | } |
| | | |
| | | this.drag_active = false; |
| | | this.env.last_folder_target = null; |
| | | }; |
| | | |
| | | this.drag_move = function(e) |
| | |
| | | |
| | | this.doc_mouse_up = function(e) |
| | | { |
| | | var model, list, id; |
| | | var list, id; |
| | | |
| | | // ignore event if jquery UI dialog is open |
| | | if ($(rcube_event.get_target(e)).closest('.ui-dialog, .ui-widget-overlay').length) |
| | | return; |
| | | |
| | | if (list = this.message_list) |
| | | model = this.env.mailboxes; |
| | | else if (list = this.contact_list) |
| | | model = this.env.contactfolders; |
| | | else if (this.ksearch_value) |
| | | this.ksearch_blur(); |
| | | |
| | | list = this.message_list || this.contact_list; |
| | | if (list && !rcube_mouse_is_over(e, list.list.parentNode)) |
| | | list.blur(); |
| | | |
| | | // handle mouse release when dragging |
| | | if (this.drag_active && model && this.env.last_folder_target) { |
| | | var target = model[this.env.last_folder_target]; |
| | | |
| | | this.env.last_folder_target = null; |
| | | list.draglayer.hide(); |
| | | this.drag_end(e); |
| | | |
| | | if (this.contact_list) { |
| | | if (!this.contacts_drag_menu(e, target)) |
| | | this.command('move', target); |
| | | } |
| | | else if (!this.drag_menu(e, target)) |
| | | this.command('move', target); |
| | | } |
| | | |
| | | // reset 'pressed' buttons |
| | | if (this.buttons_sel) { |
| | |
| | | if (this.env.draft_id && formdata.draft_id && formdata.draft_id != this.env.draft_id) { |
| | | continue; |
| | | } |
| | | // skip records on reply |
| | | if (this.env.reply_msgid && formdata.reply_msgid != this.env.reply_msgid) { |
| | | continue; |
| | | } |
| | | // show dialog asking to restore the message |
| | | if (formdata.changed && formdata.session != this.env.session_id) { |
| | | this.show_popup_dialog( |
| | |
| | | if ($("input[name='_is_html']").val() == '1') { |
| | | var editor = tinyMCE.get(this.env.composebody); |
| | | editor.getWin().focus(); // correct focus in IE & Chrome |
| | | editor.selection.setContent(insert, { format:'text' }); |
| | | editor.selection.setContent(this.quote_html(insert).replace(/\r?\n/g, '<br/>'), { format:'text' }); |
| | | } |
| | | // replace selection in compose textarea |
| | | else { |
| | |
| | | this.env.draft_id = id; |
| | | $("input[name='_draft_saveid']").val(id); |
| | | |
| | | this.remove_compose_data(this.env.compose_id); |
| | | } |
| | | |
| | | // always remove local copy upon saving as draft |
| | | this.remove_compose_data(this.env.compose_id); |
| | | }; |
| | | |
| | | this.auto_save_start = function() |
| | |
| | | |
| | | if (this.env.draft_id) { |
| | | formdata.draft_id = this.env.draft_id; |
| | | } |
| | | if (this.env.reply_msgid) { |
| | | formdata.reply_msgid = this.env.reply_msgid; |
| | | } |
| | | |
| | | $('input, select, textarea', this.gui_objects.messageform).each(function(i, elem) { |
| | |
| | | this.mark_folder = function(name, class_name, prefix, encode) |
| | | { |
| | | $(this.get_folder_li(name, prefix, encode)).addClass(class_name); |
| | | this.triggerEvent('markfolder', {folder: name, mark: class_name, status: true}); |
| | | }; |
| | | |
| | | // adds a class to selected folder |
| | | this.unmark_folder = function(name, class_name, prefix, encode) |
| | | { |
| | | $(this.get_folder_li(name, prefix, encode)).removeClass(class_name); |
| | | this.triggerEvent('markfolder', {folder: name, mark: class_name, status: false}); |
| | | }; |
| | | |
| | | // helper method to find a folder list item |