| | |
| | | |
| | | // webmail client settings |
| | | this.dblclick_time = 500; |
| | | this.message_time = 5000; |
| | | this.message_time = 3000; |
| | | |
| | | this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi'); |
| | | |
| | |
| | | break; |
| | | |
| | | case 'logout': |
| | | this.goto_url('logout'); |
| | | this.goto_url('logout', true); |
| | | break; |
| | | |
| | | // commands to switch task |
| | |
| | | } |
| | | } |
| | | |
| | | this.goto_url('get', qstring+'&_download=1'); |
| | | this.goto_url('get', qstring+'&_download=1', false); |
| | | break; |
| | | |
| | | case 'select-all': |
| | |
| | | this.unfocus_folder(id); |
| | | this.command('moveto', id); |
| | | } |
| | | |
| | | |
| | | // Hide message command buttons until a message is selected |
| | | this.enable_command('reply', 'reply-all', 'forward', 'delete', 'print', false); |
| | | return false; |
| | | }; |
| | | |
| | |
| | | clearTimeout(this.preview_timer); |
| | | |
| | | var selected = list.selection.length==1; |
| | | |
| | | // Hide certain command buttons when Drafts folder is selected |
| | | if (this.env.mailbox == this.env.drafts_mailbox) |
| | | { |
| | | this.enable_command('show', selected); |
| | | this.enable_command('delete', 'moveto', list.selection.length>0 ? true : false); |
| | | this.enable_command('reply', 'reply-all', 'forward', false); |
| | | this.enable_command('show', 'delete', 'moveto', selected); |
| | | } |
| | | else |
| | | { |
| | | this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected); |
| | | this.enable_command('delete', 'moveto', list.selection.length>0 ? true : false); |
| | | this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', 'delete', 'moveto', selected); |
| | | } |
| | | |
| | | // start timer for message preview (wait for double click) |
| | |
| | | if (!page && mbox != this.env.mailbox) |
| | | { |
| | | page = 1; |
| | | add_url += '&_refresh=1'; |
| | | this.env.current_page = page; |
| | | if (this.message_list) |
| | | this.message_list.clear_selection(); |
| | | this.show_contentframe(false); |
| | | } |
| | | |
| | | if (mbox != this.env.mailbox || (mbox == this.env.mailbox && !page && !sort)) |
| | | add_url += '&_refresh=1'; |
| | | |
| | | this.select_folder(mbox, this.env.mailbox); |
| | | this.env.mailbox = mbox; |
| | |
| | | } |
| | | |
| | | // check for empty body |
| | | if ((input_message.value=='')&&(tinyMCE.getContent()=='')) |
| | | if ((input_message.value == '' || (window.tinyMCE && tinyMCE.getContent() == '')) && !confirm(this.get_label('nobodywarning'))) |
| | | { |
| | | if (!confirm(this.get_label('nobodywarning'))) |
| | | { |
| | | input_message.focus(); |
| | | return false; |
| | | } |
| | | input_message.focus(); |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | |
| | | { |
| | | if (this.env.draft_autosave) |
| | | this.save_timer = self.setTimeout(function(){ ref.command("savedraft"); }, this.env.draft_autosave * 1000); |
| | | |
| | | // Unlock interface now that saving is complete |
| | | this.busy = false; |
| | | }; |
| | | |
| | | |
| | |
| | | // display a system message |
| | | this.display_message = function(msg, type, hold) |
| | | { |
| | | // pass command to parent window |
| | | if (this.env.framed && parent.rcmail ) |
| | | return parent.rcmail.display_message(msg, type, hold); |
| | | |
| | | this.set_busy(false); |
| | | if (!this.loaded) // save message in order to display after page loaded |
| | | { |
| | | this.pending_message = new Array(msg, type); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | // pass command to parent window |
| | | if (this.env.framed && parent.rcmail) |
| | | return parent.rcmail.display_message(msg, type, hold); |
| | | |
| | | if (!this.gui_objects.message) |
| | | return false; |
| | | |
| | |
| | | if (type) |
| | | cont = '<div class="'+type+'">'+cont+'</div>'; |
| | | |
| | | this.gui_objects.message._rcube = this; |
| | | var _rcube = this; |
| | | this.gui_objects.message.innerHTML = cont; |
| | | this.gui_objects.message.style.display = 'block'; |
| | | |
| | | |
| | | if (type!='loading') |
| | | this.gui_objects.message.onmousedown = function(){ this._rcube.hide_message(); return true; }; |
| | | this.gui_objects.message.onmousedown = function(){ _rcube.hide_message(); return true; }; |
| | | |
| | | if (!hold) |
| | | this.message_timer = setTimeout(function(){ ref.hide_message(); }, this.message_time); |
| | |
| | | /********* remote request methods *********/ |
| | | /********************************************************/ |
| | | |
| | | this.redirect = function(url) |
| | | this.redirect = function(url, lock) |
| | | { |
| | | this.set_busy(true); |
| | | if (lock || lock === null) |
| | | this.set_busy(true); |
| | | |
| | | if (this.env.framed && window.parent) |
| | | parent.location.href = url; |
| | | else |
| | |
| | | |
| | | this.goto_url = function(action, query, lock) |
| | | { |
| | | if (lock) |
| | | this.set_busy(true); |
| | | |
| | | var querystring = query ? '&'+query : ''; |
| | | this.redirect(this.env.comm_path+'&_action='+action+querystring); |
| | | this.redirect(this.env.comm_path+'&_action='+action+querystring, lock); |
| | | }; |
| | | |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | var ref = this; |
| | | var _ref = this; |
| | | this.url = url; |
| | | this.busy = true; |
| | | |
| | | this.xmlhttp.onreadystatechange = function(){ ref.xmlhttp_onreadystatechange(); }; |
| | | this.xmlhttp.onreadystatechange = function(){ _ref.xmlhttp_onreadystatechange(); }; |
| | | this.xmlhttp.open('GET', url); |
| | | this.xmlhttp.setRequestHeader('X-RoundCube-Referer', bw.get_cookie('sessid')); |
| | | this.xmlhttp.send(null); |
| | | }; |
| | | |
| | |
| | | this.xmlhttp.onreadystatechange = function() { ref.xmlhttp_onreadystatechange(); }; |
| | | this.xmlhttp.open('POST', url, true); |
| | | this.xmlhttp.setRequestHeader('Content-Type', contentType); |
| | | this.xmlhttp.setRequestHeader('X-RoundCube-Referer', bw.get_cookie('sessid')); |
| | | this.xmlhttp.send(req_body); |
| | | }; |
| | | |