| | |
| | | 'application/x-shockwave-flash'); |
| | | |
| | | // default environment vars |
| | | this.env.keep_alive = 60; // seconds |
| | | this.env.keep_alive = 50; // seconds |
| | | this.env.request_timeout = 180; // seconds |
| | | this.env.draft_autosave = 300; // seconds |
| | | this.env.draft_autosave = 0; // seconds |
| | | |
| | | |
| | | // set environment variable |
| | |
| | | { |
| | | this.enable_command('add-attachment', 'send-attachment', 'remove-attachment', 'send', true); |
| | | if (this.env.spellcheck) |
| | | this.enable_command('spellcheck', true); |
| | | { |
| | | this.env.spellcheck.spelling_state_observer = function(s){ rcube_webmail_client.set_spellcheck_state(s); }; |
| | | this.set_spellcheck_state('ready'); |
| | | } |
| | | if (this.env.drafts_mailbox) |
| | | this.enable_command('savedraft', true); |
| | | } |
| | |
| | | break; |
| | | |
| | | case 'spellcheck': |
| | | if (this.env.spellcheck && this.env.spellcheck.spellCheck) |
| | | if (this.env.spellcheck && this.env.spellcheck.spellCheck && this.spellcheck_ready) |
| | | { |
| | | this.env.spellcheck.spellCheck(this.env.spellcheck.check_link); |
| | | this.set_spellcheck_state('checking'); |
| | | } |
| | | break; |
| | | |
| | | case 'savedraft': |
| | |
| | | break; |
| | | |
| | | // if saving Drafts is disabled in main.inc.php |
| | | if (!this.env.drafts_mailbox) |
| | | // or if compose form did not change |
| | | if (!this.env.drafts_mailbox || this.cmp_hash == this.compose_field_hash()) |
| | | break; |
| | | |
| | | this.set_busy(true, 'savingmessage'); |
| | |
| | | }; |
| | | |
| | | |
| | | this.set_spellcheck_state = function(s) |
| | | { |
| | | this.spellcheck_ready = (s=='check_spelling' || s=='ready'); |
| | | this.enable_command('spellcheck', this.spellcheck_ready); |
| | | }; |
| | | |
| | | |
| | | this.auto_save_start = function() |
| | | { |
| | | if (this.env.draft_autosave) |
| | |
| | | this.reset_folder_rename = function() |
| | | { |
| | | var cell = this.name_input ? this.name_input.parentNode : null; |
| | | if (cell && this.edit_folder) |
| | | if (cell && this.edit_folder && this.env.subscriptionrows[this.edit_folder]) |
| | | cell.innerHTML = this.env.subscriptionrows[this.edit_folder][1]; |
| | | |
| | | this.edit_folder = null; |
| | |
| | | |
| | | case 'expunge': |
| | | this.enable_command('select-all', 'select-none', 'expunge', this.env.messagecount ? true : false); |
| | | break; |
| | | break; |
| | | } |
| | | |
| | | request_obj.reset(); |
| | |
| | | } // end class rcube_http_request |
| | | |
| | | |
| | | // helper function to call the init method with a delay |
| | | function call_init(o) |
| | | { |
| | | if (window[o] && window[o].init) |
| | | setTimeout(o+'.init()', 200); |
| | | } |
| | | |
| | | function console(str) |
| | | { |
| | |
| | | document.debugform.console.value += str+'\n--------------------------------------\n'; |
| | | } |
| | | |
| | | |
| | | // set onload handler |
| | | window.onload = function(e) |
| | | { |
| | | if (window.rcube_webmail_client) |
| | | rcube_webmail_client.init(); |
| | | }; |