Changeset 9a52614 in github
- Timestamp:
- Aug 6, 2006 9:24:11 AM (7 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- fb62bd9
- Parents:
- 42000a5
- File:
-
- 1 edited
-
program/js/app.js (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/js/app.js
rfa4cd20 r9a52614 19 19 var SHIFT_KEY = 2; 20 20 var CONTROL_SHIFT_KEY = 3; 21 var DRAFT_AUTOSAVE = 5; // Minutes22 21 23 22 var rcube_webmail_client; … … 41 40 this.dblclick_time = 600; 42 41 this.message_time = 5000; 43 this.request_timeout = 180000; 44 this._interval = 60000; 42 45 43 this.mbox_expression = new RegExp('[^0-9a-z\-_]', 'gi'); 46 this.env.blank_img = 'skins/default/images/blank.gif';47 44 48 45 // mimetypes supported by the browser (default settings) … … 52 49 'application/x-shockwave-flash'); 53 50 51 // default environment vars 52 this.env.keep_alive = 60; // seconds 53 this.env.request_timeout = 180; // seconds 54 this.env.draft_autosave = 300; // seconds 55 54 56 55 57 // set environment variable 56 58 this.set_env = function(name, value) 57 59 { 58 //if (!this.busy) 59 this.env[name] = value; 60 this.env[name] = value; 60 61 }; 61 62 … … 247 248 document.onmousedown = function(){ return rcube_webmail_client.reset_click(); }; 248 249 document.onkeydown = function(e){ return rcube_webmail_client.key_pressed(e, msg_list_frame); }; 249 250 // set default keep alive interval251 if (!this.keep_alive_interval)252 this.keep_alive_interval = this._interval;253 250 254 251 // flag object as complete 255 252 this.loaded = true; 256 253 257 254 // show message 258 255 if (this.pending_message) 259 256 this.display_message(this.pending_message[0], this.pending_message[1]); 260 261 // start interval for keep-alive/recent_check signal 262 if (this.keep_alive_interval && this.task=='mail' && this.gui_objects.messagelist) 263 this._int = setInterval(this.ref+'.check_for_recent()', this.keep_alive_interval); 264 else if (this.task!='login') 265 this._int = setInterval(this.ref+'.send_keep_alive()', this.keep_alive_interval); 266 }; 257 258 // start keep-alive interval 259 this.start_keepalive(); 260 }; 261 262 263 // start interval for keep-alive/recent_check signal 264 this.start_keepalive = function() 265 { 266 if (this.env.keep_alive && this.task=='mail' && this.gui_objects.messagelist) 267 this._int = setInterval(this.ref+'.check_for_recent()', this.env.keep_alive * 1000); 268 else if (this.env.keep_alive && this.task!='login') 269 this._int = setInterval(this.ref+'.send_keep_alive()', this.env.keep_alive * 1000); 270 } 271 267 272 268 273 // reset last clicked if user clicks on anything other than the message table … … 952 957 if (!this.check_compose_input()) 953 958 break; 959 960 // Reset the auto-save timer 961 self.clearTimeout(this.save_timer); 954 962 955 963 // all checks passed, send message … … 959 967 form._draft.value = ''; 960 968 form.submit(); 969 970 // clear timeout (sending could take longer) 971 clearTimeout(this.request_timer); 961 972 break; 962 973 … … 1131 1142 1132 1143 // set timer for requests 1133 if (a && this. request_timeout)1134 this.request_timer = setTimeout(this.ref+'.request_timed_out()', this. request_timeout);1144 if (a && this.env.request_timeout) 1145 this.request_timer = setTimeout(this.ref+'.request_timed_out()', this.env.request_timeout * 1000); 1135 1146 }; 1136 1147 … … 2016 2027 this.auto_save_start = function() 2017 2028 { 2018 this.save_timer = self.setTimeout('rcmail.command("savedraft","",this)', DRAFT_AUTOSAVE * 60000); 2029 if (this.env.draft_autosave) 2030 this.save_timer = self.setTimeout(this.ref+'.command("savedraft")', this.env.draft_autosave * 1000); 2019 2031 }; 2020 2032 … … 2169 2181 // add file name to attachment list 2170 2182 // called from upload page 2171 this.add2attachment_list = function(name, content)2183 this.add2attachment_list = function(name, content) 2172 2184 { 2173 2185 if (!this.gui_objects.attachmentlist) … … 2189 2201 for (i=0;i<list.length;i++) 2190 2202 if (list[i].id == name) 2191 this.gui_objects.attachmentlist.removeChild(list[i]);2203 this.gui_objects.attachmentlist.removeChild(list[i]); 2192 2204 }; 2193 2205 … … 2195 2207 { 2196 2208 if (name) 2197 this.http_request('remove-attachment', '_file name='+escape(name));2209 this.http_request('remove-attachment', '_file='+escape(name)); 2198 2210 2199 2211 return true; … … 3566 3578 this.http_error = function(request_obj) 3567 3579 { 3568 alert('Error sending request: '+request_obj.url);3580 //alert('Error sending request: '+request_obj.url); 3569 3581 3570 3582 if (request_obj.__lock) … … 3829 3841 else if(this.xmlhttp.readyState == 4) 3830 3842 { 3831 if(this.xmlhttp.status == 0) 3832 this.onabort(this); 3833 else if(this.xmlhttp.status == 200) 3834 this.oncomplete(this); 3835 else 3843 try { 3844 if (this.xmlhttp.status == 0) 3845 this.onabort(this); 3846 else if(this.xmlhttp.status == 200) 3847 this.oncomplete(this); 3848 else 3849 this.onerror(this); 3850 3851 this.busy = false; 3852 } 3853 catch(err) 3854 { 3836 3855 this.onerror(this); 3837 3838 this.busy = false;3856 this.busy = false; 3857 } 3839 3858 } 3840 3859 }
Note: See TracChangeset
for help on using the changeset viewer.
