| | |
| | | |
| | | // webmail client settings |
| | | this.dblclick_time = 500; |
| | | this.message_time = 4000; |
| | | this.message_time = 5000; |
| | | this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi'); |
| | | |
| | | // environment defaults |
| | |
| | | |
| | | if (this.env.permaurl) |
| | | this.enable_command('permaurl', 'extwin', true); |
| | | |
| | | this.local_storage_prefix = 'roundcube.' + (this.env.user_id || 'anonymous') + '.'; |
| | | |
| | | switch (this.task) { |
| | | |
| | |
| | | extwin.document.write('<html><body>' + this.get_label('loading') + '</body></html>'); |
| | | } |
| | | |
| | | // allow plugins to grab the window reference (#1489413) |
| | | this.triggerEvent('openwindow', { url:url, handle:extwin }); |
| | | |
| | | // focus window, delayed to bring to front |
| | | window.setTimeout(function() { extwin && extwin.focus(); }, 10); |
| | | |
| | |
| | | { |
| | | this.env.recipients_delimiter = this.env.recipients_separator + ' '; |
| | | |
| | | obj[bw.ie || bw.safari || bw.chrome ? 'keydown' : 'keypress'](function(e) { return ref.ksearch_keydown(e, this, props); }) |
| | | obj.keydown(function(e) { return ref.ksearch_keydown(e, this, props); }) |
| | | .attr('autocomplete', 'off'); |
| | | }; |
| | | |
| | |
| | | target = win; |
| | | } |
| | | |
| | | if (action && (id || action == 'add-identity')) { |
| | | this.set_busy(true); |
| | | this.location_href(url, target); |
| | | if (id || action == 'add-identity') { |
| | | this.location_href(url, target, true); |
| | | } |
| | | |
| | | return true; |
| | |
| | | this.triggerEvent('message', { message:msg, type:type, timeout:timeout, object:obj }); |
| | | |
| | | if (timeout > 0) |
| | | setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout); |
| | | setTimeout(function() { ref.hide_message(id, type != 'loading'); }, timeout); |
| | | return id; |
| | | }; |
| | | |
| | |
| | | |
| | | if ((response.action == 'list' || response.action == 'search') && this.message_list) { |
| | | this.msglist_select(this.message_list); |
| | | this.message_list.resize(); |
| | | this.triggerEvent('listupdate', { folder:this.env.mailbox, rowcount:this.message_list.rowcount }); |
| | | } |
| | | } |
| | |
| | | this.enable_command('search-create', this.env.source == ''); |
| | | this.enable_command('search-delete', this.env.search_id); |
| | | this.update_group_commands(); |
| | | this.contact_list.resize(); |
| | | this.triggerEvent('listupdate', { folder:this.env.source, rowcount:this.contact_list.rowcount }); |
| | | } |
| | | } |
| | |
| | | setCookie(name, value, expires, this.env.cookie_path, this.env.cookie_domain, this.env.cookie_secure); |
| | | }; |
| | | |
| | | this.get_local_storage_prefix = function() |
| | | { |
| | | if (!this.local_storage_prefix) |
| | | this.local_storage_prefix = 'roundcube.' + (this.env.user_id || 'anonymous') + '.'; |
| | | |
| | | return this.local_storage_prefix; |
| | | }; |
| | | |
| | | // wrapper for localStorage.getItem(key) |
| | | this.local_storage_get_item = function(key, deflt, encrypted) |
| | | { |
| | | |
| | | // TODO: add encryption |
| | | var item = localStorage.getItem(this.local_storage_prefix + key); |
| | | var item = localStorage.getItem(this.get_local_storage_prefix() + key); |
| | | return item !== null ? JSON.parse(item) : (deflt || null); |
| | | }; |
| | | |
| | |
| | | this.local_storage_set_item = function(key, data, encrypted) |
| | | { |
| | | // TODO: add encryption |
| | | return localStorage.setItem(this.local_storage_prefix + key, JSON.stringify(data)); |
| | | return localStorage.setItem(this.get_local_storage_prefix() + key, JSON.stringify(data)); |
| | | }; |
| | | |
| | | // wrapper for localStorage.removeItem(key) |
| | | this.local_storage_remove_item = function(key) |
| | | { |
| | | return localStorage.removeItem(this.local_storage_prefix + key); |
| | | return localStorage.removeItem(this.get_local_storage_prefix() + key); |
| | | }; |
| | | |
| | | } // end object rcube_webmail |