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 | Components.utils.import("resource://v_identity/vI_nameSpaceWrapper.js"); |
---|
26 | virtualIdentityExtension.ns(function () { |
---|
27 | with(virtualIdentityExtension.LIB) { |
---|
28 | let Log = vI.setupLogging("virtualIdentity.rdfAccountMismatchDialog"); |
---|
29 | |
---|
30 | var rdfAccountMismatchDialog = { |
---|
31 | mismatchItems: null, |
---|
32 | type: null, |
---|
33 | |
---|
34 | init: function () { |
---|
35 | rdfAccountMismatchDialog.type = window.arguments[0]; |
---|
36 | rdfAccountMismatchDialog.mismatchItems = window.arguments[1]; |
---|
37 | |
---|
38 | // display the relevant help-tags |
---|
39 | document.getElementById("virtualIdentityExtension_rdfAccountMismatchDialog_vbox_" + rdfAccountMismatchDialog.type).removeAttribute("hidden"); |
---|
40 | document.getElementById("virtualIdentityExtension_rdfAccountMismatchDialog_listhead_" + rdfAccountMismatchDialog.type).removeAttribute("hidden"); |
---|
41 | |
---|
42 | for (var i = 0; i < rdfAccountMismatchDialog.mismatchItems.length; i++) { |
---|
43 | // var label = document.createElement("label"); |
---|
44 | var listitem = document.createElement("listitem"); |
---|
45 | listitem.setAttribute("id", "virtualIdentityExtension_mismatchLine_" + i); |
---|
46 | listitem.setAttribute("class", "mismatchLine"); |
---|
47 | listitem.setAttribute("type", rdfAccountMismatchDialog.type); |
---|
48 | listitem.setAttribute("oldkey", rdfAccountMismatchDialog.mismatchItems[i].oldkey); |
---|
49 | listitem.setAttribute("label", rdfAccountMismatchDialog.mismatchItems[i].label); |
---|
50 | listitem.setAttribute("ext1", rdfAccountMismatchDialog.mismatchItems[i].ext1); |
---|
51 | listitem.setAttribute("ext2", rdfAccountMismatchDialog.mismatchItems[i].ext2); |
---|
52 | listitem.setAttribute("count", rdfAccountMismatchDialog.mismatchItems[i].count); |
---|
53 | document.getElementById("virtualIdentityExtension_rdfAccountMismatchDialog_listbox").appendChild(listitem) |
---|
54 | } |
---|
55 | }, |
---|
56 | |
---|
57 | accept: function () { |
---|
58 | for (var i = 0; i < rdfAccountMismatchDialog.mismatchItems.length; i++) { |
---|
59 | rdfAccountMismatchDialog.mismatchItems[i].key = document.getElementById("virtualIdentityExtension_mismatchLine_" + i).key |
---|
60 | } |
---|
61 | /* window.argument[2] stores callback parent */ |
---|
62 | window.arguments[2].repairAccountMismatch(rdfAccountMismatchDialog.type, rdfAccountMismatchDialog.mismatchItems); |
---|
63 | } |
---|
64 | } |
---|
65 | window.addEventListener("load", rdfAccountMismatchDialog.init, false); |
---|
66 | vI.rdfAccountMismatchDialog = rdfAccountMismatchDialog; |
---|
67 | } |
---|
68 | }); |
---|