1 | /* ***** BEGIN LICENSE BLOCK ***** |
---|
2 | This program is free software; you can redistribute it and/or modify |
---|
3 | it under the terms of the GNU General Public License as published by |
---|
4 | the Free Software Foundation; either version 2 of the License, or |
---|
5 | (at your option) any later version. |
---|
6 | |
---|
7 | This program is distributed in the hope that it will be useful, |
---|
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
10 | GNU General Public License for more details. |
---|
11 | |
---|
12 | You should have received a copy of the GNU General Public License |
---|
13 | along with this program; if not, write to the Free Software |
---|
14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
15 | |
---|
16 | The Original Code is the Virtual Identity Extension. |
---|
17 | |
---|
18 | The Initial Developer of the Original Code is Rene Ejury. |
---|
19 | Portions created by the Initial Developer are Copyright (C) 2007 |
---|
20 | the Initial Developer. All Rights Reserved. |
---|
21 | |
---|
22 | Contributor(s): |
---|
23 | * ***** END LICENSE BLOCK ***** */ |
---|
24 | |
---|
25 | var vI_smartReply_dialog = { |
---|
26 | Obj_radioGroup : null, |
---|
27 | all_addresses : null, |
---|
28 | |
---|
29 | init : function() { |
---|
30 | vI_smartReply_dialog.Obj_radioGroup = document.getElementById("replySelector.radiogroup"); |
---|
31 | vI_smartReply_dialog.all_addresses = window.arguments[0]; |
---|
32 | for (var index = 0; index < vI_smartReply_dialog.all_addresses.number; index++) { |
---|
33 | var menuentry = vI_smartReply_dialog.all_addresses.identityDataCollection[index].combinedName; |
---|
34 | |
---|
35 | var id = null; var smtp = null; |
---|
36 | |
---|
37 | if (vI_smartReply_dialog.all_addresses.identityDataCollection[index].id) |
---|
38 | id = vI_smartReply_dialog.all_addresses.identityDataCollection[index].id.value; |
---|
39 | if (vI_smartReply_dialog.all_addresses.identityDataCollection[index].smtp) |
---|
40 | smtp = vI_smartReply_dialog.all_addresses.identityDataCollection[index].smtp.value; |
---|
41 | |
---|
42 | menuentry += (id?" (" + id + "," + |
---|
43 | (smtp?smtp:document.getElementById("bundle_messenger").getString("defaultServerTag")) + |
---|
44 | ")":"") |
---|
45 | vI_smartReply_dialog.add_row(menuentry); |
---|
46 | } |
---|
47 | }, |
---|
48 | |
---|
49 | add_row : function(combinedName) { |
---|
50 | var radio = document.createElement("radio"); |
---|
51 | radio.setAttribute("label",combinedName); |
---|
52 | vI_smartReply_dialog.Obj_radioGroup.appendChild(radio); |
---|
53 | }, |
---|
54 | |
---|
55 | accept : function() { |
---|
56 | /* window.argument[1] stores callback function */ |
---|
57 | window.arguments[1](vI_smartReply_dialog.all_addresses, vI_smartReply_dialog.Obj_radioGroup.selectedIndex); |
---|
58 | document.documentElement.acceptDialog(); |
---|
59 | } |
---|
60 | } |
---|
61 | window.addEventListener("load", vI_smartReply_dialog.init, false); |
---|