| | |
| | | |
| | | // check for locally stored compose data |
| | | if (window.localStorage) { |
| | | var key, formdata, index = this.local_storage_get_item('compose.index', []); |
| | | this.compose_restore_dialog(0, html_mode) |
| | | } |
| | | |
| | | for (i = 0; i < index.length; i++) { |
| | | if (input_to.val() == '') |
| | | input_to.focus(); |
| | | else if (input_subject.val() == '') |
| | | input_subject.focus(); |
| | | else if (input_message) |
| | | input_message.focus(); |
| | | |
| | | this.env.compose_focus_elem = document.activeElement; |
| | | |
| | | // get summary of all field values |
| | | this.compose_field_hash(true); |
| | | |
| | | // start the auto-save timer |
| | | this.auto_save_start(); |
| | | }; |
| | | |
| | | this.compose_restore_dialog = function(j, html_mode) |
| | | { |
| | | var i, key, formdata, index = this.local_storage_get_item('compose.index', []); |
| | | |
| | | var show_next = function(i) { |
| | | if (++i < index.length) |
| | | ref.compose_restore_dialog(i, html_mode) |
| | | } |
| | | |
| | | for (i = j || 0; i < index.length; i++) { |
| | | key = index[i]; |
| | | formdata = this.local_storage_get_item('compose.' + key, null, true); |
| | | if (!formdata) { |
| | |
| | | click: function(){ |
| | | ref.remove_compose_data(key); |
| | | $(this).dialog('close'); |
| | | show_next(i); |
| | | } |
| | | }, |
| | | { |
| | | text: this.get_label('ignore'), |
| | | click: function(){ |
| | | $(this).dialog('close'); |
| | | show_next(i); |
| | | } |
| | | }] |
| | | ); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (input_to.val() == '') |
| | | input_to.focus(); |
| | | else if (input_subject.val() == '') |
| | | input_subject.focus(); |
| | | else if (input_message) |
| | | input_message.focus(); |
| | | |
| | | this.env.compose_focus_elem = document.activeElement; |
| | | |
| | | // get summary of all field values |
| | | this.compose_field_hash(true); |
| | | |
| | | // start the auto-save timer |
| | | this.auto_save_start(); |
| | | }; |
| | | |
| | | this.init_address_input_events = function(obj, props) |
| | | { |