| | |
| | | |
| | | // unified command call (command name == function name) |
| | | default: |
| | | var func = command.replace('-', '_'); |
| | | var func = command.replace(/-/g, '_'); |
| | | if (this[func] && typeof this[func] == 'function') |
| | | this[func](props); |
| | | break; |
| | |
| | | if (msg == message) |
| | | msg = 'Loading...'; |
| | | |
| | | this.display_message(msg, 'loading', true); |
| | | if (this.gui_objects.message && this.gui_objects.message.__type != 'error') |
| | | this.display_message(msg, 'loading', true); |
| | | } |
| | | else if (!a) |
| | | else if (!a && this.gui_objects.message && this.gui_objects.message.__type != 'error') |
| | | this.hide_message(); |
| | | |
| | | this.busy = a; |
| | |
| | | |
| | | this.show_contentframe = function(show) |
| | | { |
| | | var frm; |
| | | var frm, win; |
| | | if (this.env.contentframe && (frm = $('#'+this.env.contentframe)) && frm.length) { |
| | | if (!show && window.frames[this.env.contentframe]) { |
| | | if (window.frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)<0) |
| | | window.frames[this.env.contentframe].location.href = this.env.blankpage; |
| | | if (!show && (win = window.frames[this.env.contentframe])) { |
| | | if (win.location && win.location.href.indexOf(this.env.blankpage)<0) |
| | | win.location.href = this.env.blankpage; |
| | | } |
| | | else if (!bw.safari && !bw.konq) |
| | | frm[show ? 'show' : 'hide'](); |
| | |
| | | page = 1; |
| | | this.env.current_page = page; |
| | | this.select_all_mode = false; |
| | | this.show_contentframe(false); |
| | | this.env.messages = {}; |
| | | } |
| | | |
| | | // unselect selected messages and clear the list and message data |
| | | this.clear_message_list(); |
| | | |
| | | if (mbox != this.env.mailbox || (mbox == this.env.mailbox && !page && !sort)) |
| | | url += '&_refresh=1'; |
| | | |
| | | // unselect selected messages |
| | | this.last_selected = 0; |
| | | if (this.message_list) { |
| | | this.message_list.clear_selection(); |
| | | } |
| | | this.select_folder(mbox, this.env.mailbox); |
| | | this.env.mailbox = mbox; |
| | | |
| | |
| | | this.set_busy(true, 'loading'); |
| | | target.location.href = this.env.comm_path+'&_mbox='+urlencode(mbox)+(page ? '&_page='+page : '')+url; |
| | | } |
| | | }; |
| | | |
| | | this.clear_message_list = function() |
| | | { |
| | | this.env.messages = {}; |
| | | this.last_selected = 0; |
| | | |
| | | this.show_contentframe(false); |
| | | if (this.message_list) |
| | | this.message_list.clear(true); |
| | | }; |
| | | |
| | | // send remote request to load message list |
| | |
| | | tinyMCE.execCommand('mceAddControl', false, props.id); |
| | | } |
| | | else { |
| | | var thisMCE = tinyMCE.get(props.id), |
| | | existingHtml = thisMCE.getContent(); |
| | | var thisMCE = tinyMCE.get(props.id), existingHtml; |
| | | if (thisMCE.plugins.spellchecker && thisMCE.plugins.spellchecker.active) |
| | | thisMCE.execCommand('mceSpellCheck', false); |
| | | |
| | | if (existingHtml) { |
| | | if (existingHtml = thisMCE.getContent()) { |
| | | if (!confirm(this.get_label('editorwarning'))) { |
| | | return false; |
| | | } |
| | | } |
| | | this.html2plain(existingHtml, props.id); |
| | | } |
| | | tinyMCE.execCommand('mceRemoveControl', false, props.id); |
| | |
| | | if (value != '') { |
| | | var addurl = ''; |
| | | if (this.message_list) { |
| | | this.message_list.clear(); |
| | | this.clear_message_list(); |
| | | if (this.env.search_mods) { |
| | | var mods = this.env.search_mods[this.env.mailbox] ? this.env.search_mods[this.env.mailbox] : this.env.search_mods['*']; |
| | | if (mods) { |
| | |
| | | this.contact_list.remove_row(cid); |
| | | this.contact_list.init_row(row); |
| | | this.contact_list.selection[0] = newcid; |
| | | ow.style.display = ''; |
| | | row.style.display = ''; |
| | | } |
| | | |
| | | return true; |
| | |
| | | |
| | | if (!this.name_input) { |
| | | this.name_input = $('<input>').attr('type', 'text'); |
| | | this.name_input.bind('keypress', function(e){ return rcmail.add_input_keypress(e); }); |
| | | this.name_input.bind('keydown', function(e){ return rcmail.add_input_keydown(e); }); |
| | | this.name_input_li = $('<li>').addClass('contactgroup').append(this.name_input); |
| | | |
| | | var li = this.get_folder_li(this.env.source) |
| | | this.name_input_li.insertAfter(li); |
| | | } |
| | | |
| | | this.name_input.select(); |
| | | this.name_input.select().focus(); |
| | | }; |
| | | |
| | | this.group_rename = function() |
| | |
| | | if (!this.name_input) { |
| | | this.enable_command('list', 'listgroup', false); |
| | | this.name_input = $('<input>').attr('type', 'text').val(this.env.contactgroups['G'+this.env.source+this.env.group].name); |
| | | this.name_input.bind('keypress', function(e){ return rcmail.add_input_keypress(e); }); |
| | | this.name_input.bind('keydown', function(e){ return rcmail.add_input_keydown(e); }); |
| | | this.env.group_renaming = true; |
| | | |
| | | var link, li = this.get_folder_li(this.env.source+this.env.group, 'rcmliG'); |
| | |
| | | } |
| | | } |
| | | |
| | | this.name_input.select(); |
| | | this.name_input.select().focus(); |
| | | }; |
| | | |
| | | this.group_delete = function() |
| | |
| | | }; |
| | | |
| | | // handler for keyboard events on the input field |
| | | this.add_input_keypress = function(e) |
| | | this.add_input_keydown = function(e) |
| | | { |
| | | var key = rcube_event.get_keycode(e); |
| | | |
| | |
| | | if (action=='edit-identity' && (!id || id==this.env.iid)) |
| | | return false; |
| | | |
| | | var add_url = '', target = window; |
| | | var add_url = '', target = window; |
| | | |
| | | if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { |
| | | add_url = '&_framed=1'; |
| | |
| | | |
| | | reg = new RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$'); |
| | | this.name_input.__parent = this.env.subscriptionrows[id][0].replace(reg, ''); |
| | | this.name_input.onkeypress = function(e){ rcmail.name_input_keypress(e); }; |
| | | this.name_input.onkeydown = function(e){ rcmail.name_input_keydown(e); }; |
| | | |
| | | row.cells[0].replaceChild(this.name_input, row.cells[0].firstChild); |
| | | this.edit_folder = id; |
| | |
| | | }; |
| | | |
| | | // handler for keyboard events on the input field |
| | | this.name_input_keypress = function(e) |
| | | this.name_input_keydown = function(e) |
| | | { |
| | | var key = rcube_event.get_keycode(e); |
| | | |
| | |
| | | cont = '<div class="'+type+'">'+cont+'</div>'; |
| | | |
| | | var obj = $(this.gui_objects.message).html(cont).show(); |
| | | this.gui_objects.message.__type = type; |
| | | |
| | | if (type!='loading') |
| | | obj.bind('mousedown', function(){ ref.hide_message(); return true; }); |