| | |
| | | } |
| | | // show printing dialog |
| | | else if (this.env.action == 'print' && this.env.uid) |
| | | window.print(); |
| | | if (bw.safari) |
| | | window.setTimeout('window.print()', 10); |
| | | else |
| | | window.print(); |
| | | |
| | | // get unread count for each mailbox |
| | | if (this.gui_objects.mailboxlist) { |
| | |
| | | this.start_keepalive(); |
| | | }; |
| | | |
| | | this.log = function(msg) |
| | | { |
| | | if (window.console && console.log) |
| | | console.log(msg); |
| | | }; |
| | | |
| | | /*********************************************************/ |
| | | /********* client command interface *********/ |
| | |
| | | if (action == 'preview' && String(target.location.href).indexOf(url) >= 0) |
| | | this.show_contentframe(true); |
| | | else { |
| | | if (!this.env.frame_lock) { |
| | | (this.is_framed() ? parent.rcmail : this).env.frame_lock = this.set_busy(true, 'loading'); |
| | | } |
| | | this.lock_frame(); |
| | | this.location_href(this.env.comm_path+url, target); |
| | | |
| | | // mark as read and change mbox unread counter |
| | |
| | | |
| | | if (!show && this.busy) |
| | | this.set_busy(false, null, this.env.frame_lock); |
| | | }; |
| | | |
| | | this.lock_frame = function() |
| | | { |
| | | if (!this.env.frame_lock) |
| | | (this.is_framed() ? parent.rcmail : this).env.frame_lock = this.set_busy(true, 'loading'); |
| | | }; |
| | | |
| | | // list a specific page |
| | |
| | | if (this.env.group) |
| | | add_url += '&_gid='+urlencode(this.env.group); |
| | | |
| | | this.set_busy(true); |
| | | this.location_href(this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_cid='+urlencode(cid) + add_url, target); |
| | | this.lock_frame(); |
| | | this.location_href(this.env.comm_path+'&_action='+action |
| | | +'&_source='+urlencode(this.env.source) |
| | | +'&_cid='+urlencode(cid) + add_url, target); |
| | | } |
| | | return true; |
| | | }; |
| | |
| | | this.contact_list.clear_selection(); |
| | | } |
| | | |
| | | this.lock_frame(); |
| | | this.location_href(this.env.comm_path+'&_action=search'+add_url, target); |
| | | |
| | | return true; |
| | |
| | | add_url = '&_framed=1'; |
| | | target = window.frames[this.env.contentframe]; |
| | | } |
| | | this.lock_frame(); |
| | | this.location_href(this.env.comm_path+'&_action=edit-prefs&_section='+id+add_url, target); |
| | | } |
| | | |
| | |
| | | this.show_contentframe(true); |
| | | } |
| | | else { |
| | | if (!this.env.frame_lock) { |
| | | (parent.rcmail ? parent.rcmail : this).env.frame_lock = this.set_busy(true, 'loading'); |
| | | } |
| | | this.lock_frame(); |
| | | this.location_href(this.env.comm_path+url, target); |
| | | } |
| | | }; |
| | |
| | | obj.click(function() { return ref.hide_message(obj); }); |
| | | } |
| | | |
| | | window.setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout); |
| | | if (timeout > 0) |
| | | window.setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout); |
| | | return id; |
| | | }; |
| | | |
| | |
| | | url = '?_task=utils&_action=html2text', |
| | | lock = this.set_busy(true, 'converting'); |
| | | |
| | | console.log('HTTP POST: ' + url); |
| | | this.log('HTTP POST: ' + url); |
| | | |
| | | $.ajax({ type: 'POST', url: url, data: htmlText, contentType: 'application/octet-stream', |
| | | error: function(o, status, err) { rcmail.http_error(o, status, err, lock); }, |
| | | success: function(data) { rcmail.set_busy(false, null, lock); $(document.getElementById(id)).val(data); console.log(data); } |
| | | success: function(data) { rcmail.set_busy(false, null, lock); $(document.getElementById(id)).val(data); rcmail.log(data); } |
| | | }); |
| | | }; |
| | | |
| | |
| | | url += '&_remote=1'; |
| | | |
| | | // send request |
| | | console.log('HTTP GET: ' + url); |
| | | this.log('HTTP GET: ' + url); |
| | | |
| | | return $.ajax({ |
| | | type: 'GET', url: url, data: { _unlock:(lock?lock:0) }, dataType: 'json', |
| | |
| | | } |
| | | |
| | | // send request |
| | | console.log('HTTP POST: ' + url); |
| | | this.log('HTTP POST: ' + url); |
| | | |
| | | return $.ajax({ |
| | | type: 'POST', url: url, data: postdata, dataType: 'json', |
| | |
| | | |
| | | // if we get javascript code from server -> execute it |
| | | if (response.exec) { |
| | | console.log(response.exec); |
| | | this.log(response.exec); |
| | | eval(response.exec); |
| | | } |
| | | |