| | |
| | | /* |
| | | +-----------------------------------------------------------------------+ |
| | | | RoundCube Webmail Client Script | |
| | | | Roundcube Webmail Client Script | |
| | | | | |
| | | | This file is part of the RoundCube Webmail client | |
| | | | Copyright (C) 2005-2010, RoundCube Dev, - Switzerland | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2010, Roundcube Dev, - Switzerland | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | |
| | | $.ajaxSetup({ |
| | | cache:false, |
| | | error:function(request, status, err){ ref.http_error(request, status, err); }, |
| | | beforeSend:function(xmlhttp){ xmlhttp.setRequestHeader('X-RoundCube-Request', ref.env.request_token); } |
| | | beforeSend:function(xmlhttp){ xmlhttp.setRequestHeader('X-Roundcube-Request', ref.env.request_token); } |
| | | }); |
| | | |
| | | // set environment variable(s) |
| | |
| | | if (this.env.cid) |
| | | this.enable_command('show', 'edit', true); |
| | | |
| | | if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform) |
| | | if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform) { |
| | | this.enable_command('save', true); |
| | | else |
| | | $("input[type='text']").first().select(); |
| | | } |
| | | else if (this.gui_objects.qsearchbox) { |
| | | this.enable_command('search', 'reset-search', 'moveto', true); |
| | | $(this.gui_objects.qsearchbox).select(); |
| | | } |
| | | |
| | | if (this.contact_list && this.contact_list.rowcount > 0) |
| | | this.enable_command('export', true); |
| | |
| | | } |
| | | } |
| | | |
| | | this.http_post('utils/save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders)); |
| | | this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders)); |
| | | this.set_unread_count_display(id, false); |
| | | }; |
| | | |
| | |
| | | if ((found = $.inArray('subject', this.env.coltypes)) >= 0) |
| | | this.set_env('subject_col', found); |
| | | |
| | | this.http_post('utils/save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' }); |
| | | this.http_post('save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' }); |
| | | }; |
| | | |
| | | this.check_droptarget = function(id) |
| | |
| | | |
| | | this.goto_url = function(action, query, lock) |
| | | { |
| | | var querystring = query ? '&'+query : ''; |
| | | this.redirect(this.env.comm_path+'&_action='+action+querystring, lock); |
| | | var url = this.env.comm_path, |
| | | querystring = query ? '&'+query : ''; |
| | | |
| | | // overwrite task name |
| | | if (action.match(/([a-z]+)\/([a-z-_]+)/)) { |
| | | action = RegExp.$2; |
| | | url = url.replace(/\_task=[a-z]+/, '_task='+RegExp.$1); |
| | | } |
| | | |
| | | this.redirect(url+'&_action='+action+querystring, lock); |
| | | }; |
| | | |
| | | // send a http request to the server |
| | | this.http_request = function(action, querystring, lock) |
| | | this.http_request = function(action, query, lock) |
| | | { |
| | | var url = this.env.comm_path; |
| | | |
| | |
| | | } |
| | | |
| | | // trigger plugin hook |
| | | var result = this.triggerEvent('request'+action, querystring); |
| | | var result = this.triggerEvent('request'+action, query); |
| | | |
| | | if (typeof result != 'undefined') { |
| | | // abort if one the handlers returned false |
| | | if (result === false) |
| | | return false; |
| | | else |
| | | querystring = result; |
| | | query = result; |
| | | } |
| | | |
| | | url += '&_remote=1&_action=' + action + (querystring ? '&' : '') + querystring; |
| | | url += '&_remote=1&_action=' + action + (query ? '&' : '') + query; |
| | | |
| | | // send request |
| | | console.log('HTTP GET: ' + url); |