diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-02 14:44:28 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-02 14:44:28 +0000 |
| commit | c325b272256bcb015a85b33688caa2cc2401eae4 (patch) | |
| tree | d99a12c34aa6787457a5b56437bb5c9eb114e9ee /roundcubemail/program/js | |
| parent | 53ceff9e06567b39576591d2a4f82088e60468ee (diff) | |
Use iframes for identity management
git-svn-id: https://svn.roundcube.net/trunk@5686 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js')
| -rw-r--r-- | roundcubemail/program/js/app.js | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index be6ca8d7e..27af1ff88 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/program/js/app.js @@ -351,11 +351,18 @@ function rcube_webmail() this.enable_command('preferences', 'identities', 'save', 'folders', true); if (this.env.action == 'identities') { - this.enable_command('add', this.env.identities_level < 2); + this.enable_command('add', 'delete', this.env.identities_level < 2); } else if (this.env.action == 'edit-identity' || this.env.action == 'add-identity') { this.enable_command('add', this.env.identities_level < 2); - this.enable_command('save', 'delete', 'edit', 'toggle-editor', true); + this.enable_command('save', 'edit', 'toggle-editor', true); + if (this.is_framed() && this.env.identities_level < 2) + this.set_button('delete', 'act'); // activate button but delegate command to parent + else + this.enable_command('delete', this.env.identities_level < 2); + + if (this.env.action == 'add-identity') + $("input[type='text']").first().select(); } else if (this.env.action == 'folders') { this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'rename-folder', true); @@ -4770,11 +4777,28 @@ function rcube_webmail() if (!id) id = this.env.iid ? this.env.iid : selection[0]; - // append token to request - this.goto_url('delete-identity', '_iid='+id+'&_token='+this.env.request_token, true); + // submit request with appended token + if (confirm(this.get_label('deleteidentityconfirm'))) + this.goto_url('delete-identity', '_iid='+id+'&_token='+this.env.request_token, true); return true; }; + + this.update_identity_row = function(id, name, add) + { + var row, col, list = this.identity_list, + rid = this.html_identifier(id); + + if (list.rows[rid] && (row = list.rows[rid].obj)) { + $(row.cells[0]).html(name); + } + else if (add) { + row = $('<tr>').attr('id', 'rcmrow'+rid).get(0); + col = $('<td>').addClass('mail').html(name).appendTo(row); + list.insert_row(row); + list.select(rid); + } + }; /*********************************************************/ |
