summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js
Unidiff
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js
index 236d7c9..ba302da 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js
@@ -1,146 +1,146 @@
1/* 1/*
2 2
3Copyright 2008-2013 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz, the online password manager. 5This file is part of Clipperz, the online password manager.
6For further information about its features and functionalities please 6For further information about its features and functionalities please
7refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
8 8
9* Clipperz is free software: you can redistribute it and/or modify it 9* Clipperz is free software: you can redistribute it and/or modify it
10 under the terms of the GNU Affero General Public License as published 10 under the terms of the GNU Affero General Public License as published
11 by the Free Software Foundation, either version 3 of the License, or 11 by the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version. 12 (at your option) any later version.
13 13
14* Clipperz is distributed in the hope that it will be useful, but 14* Clipperz is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of 15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
18 18
19* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
20 License along with Clipperz. If not, see http://www.gnu.org/licenses/. 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
21 21
22*/ 22*/
23 23
24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
26if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 26if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
27 27
28 28
29//############################################################################# 29//#############################################################################
30 30
31Clipperz.PM.DataModel.DirectLoginReference = function(args) { 31Clipperz.PM.DataModel.DirectLoginReference = function(args) {
32 args = args || {}; 32 args = args || {};
33 33
34//MochiKit.Logging.logDebug(">>> new DirectLoginReference: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args))); 34//MochiKit.Logging.logDebug(">>> new DirectLoginReference: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args)));
35//MochiKit.Logging.logDebug(">>> new DirectLoginReference - record: " + args.record); 35//MochiKit.Logging.logDebug(">>> new DirectLoginReference - record: " + args.record);
36 this._user = args.user; 36 this._user = args.user;
37 37
38 if (args.directLogin != null) { 38 if (args.directLogin != null) {
39 this._reference = args.directLogin.reference(); 39 this._reference = args.directLogin.reference();
40 this._recordReference = args.directLogin.record().reference(); 40 this._recordReference = args.directLogin.record().reference();
41 this._label = args.directLogin.label(); 41 this._label = args.directLogin.label();
42 this._favicon = args.directLogin.favicon() || null; 42 this._favicon = args.directLogin.favicon() || null;
43 43
44 this._directLogin = args.directLogin; 44 this._directLogin = args.directLogin;
45 this._record = args.directLogin.record(); 45 this._record = args.directLogin.record();
46 } else { 46 } else {
47 this._reference = args.reference; 47 this._reference = args.reference;
48 this._recordReference = args.record; 48 this._recordReference = args.record;
49 this._label = args.label; 49 this._label = args.label;
50 this._favicon = args.favicon || null; 50 this._favicon = Clipperz.Base.sanitizeFavicon(args.favicon) || null;
51 51
52 this._directLogin = null; 52 this._directLogin = null;
53 this._record = null; 53 this._record = null;
54 } 54 }
55 55
56 this._fixedFavicon = null; 56 this._fixedFavicon = null;
57 57
58 return this; 58 return this;
59} 59}
60 60
61Clipperz.PM.DataModel.DirectLoginReference.prototype = MochiKit.Base.update(null, { 61Clipperz.PM.DataModel.DirectLoginReference.prototype = MochiKit.Base.update(null, {
62 62
63 'user': function() { 63 'user': function() {
64 return this._user; 64 return this._user;
65 }, 65 },
66 66
67 //------------------------------------------------------------------------- 67 //-------------------------------------------------------------------------
68 68
69 'reference': function() { 69 'reference': function() {
70 return this._reference; 70 return this._reference;
71 }, 71 },
72 72
73 //------------------------------------------------------------------------- 73 //-------------------------------------------------------------------------
74 74
75 'synchronizeValues': function(aDirectLogin) { 75 'synchronizeValues': function(aDirectLogin) {
76 this._label = aDirectLogin.label(); 76 this._label = aDirectLogin.label();
77 this._favicon = aDirectLogin.favicon(); 77 this._favicon = aDirectLogin.favicon();
78 }, 78 },
79 79
80 //------------------------------------------------------------------------- 80 //-------------------------------------------------------------------------
81 81
82 'label': function() { 82 'label': function() {
83 return this._label; 83 return this._label;
84 }, 84 },
85 85
86 //------------------------------------------------------------------------- 86 //-------------------------------------------------------------------------
87 87
88 'recordReference': function() { 88 'recordReference': function() {
89 return this._recordReference; 89 return this._recordReference;
90 }, 90 },
91 91
92 //------------------------------------------------------------------------- 92 //-------------------------------------------------------------------------
93 93
94 'record': function() { 94 'record': function() {
95//MochiKit.Logging.logDebug(">>> DirectLoginReference.record"); 95//MochiKit.Logging.logDebug(">>> DirectLoginReference.record");
96 if (this._record == null) { 96 if (this._record == null) {
97 this._record = this.user().records()[this.recordReference()]; 97 this._record = this.user().records()[this.recordReference()];
98 } 98 }
99 99
100//MochiKit.Logging.logDebug("<<< DirectLoginReference.record"); 100//MochiKit.Logging.logDebug("<<< DirectLoginReference.record");
101 return this._record; 101 return this._record;
102 }, 102 },
103 103
104 //------------------------------------------------------------------------- 104 //-------------------------------------------------------------------------
105 105
106 'favicon': function() { 106 'favicon': function() {
107 return this._favicon; 107 return this._favicon;
108 }, 108 },
109 109
110 //------------------------------------------------------------------------- 110 //-------------------------------------------------------------------------
111 111
112 'fixedFavicon': function() { 112 'fixedFavicon': function() {
113 var result; 113 var result;
114 114
115 if (this._fixedFavicon == null) { 115 if (this._fixedFavicon == null) {
116 result = this.favicon(); 116 result = this.favicon();
117 117
118 if (Clipperz_IEisBroken && (this.user().preferences().disableUnsecureFaviconLoadingForIE()) && (result.indexOf('https://') != 0)) { 118 if (Clipperz_IEisBroken && (this.user().preferences().disableUnsecureFaviconLoadingForIE()) && (result.indexOf('https://') != 0)) {
119 result = Clipperz.PM.Strings['defaultFaviconUrl_IE']; 119 result = Clipperz.PM.Strings['defaultFaviconUrl_IE'];
120 this.setFixedFavicon(result); 120 this.setFixedFavicon(result);
121 } 121 }
122 } else { 122 } else {
123 result = this._fixedFavicon; 123 result = this._fixedFavicon;
124 } 124 }
125 125
126 return result; 126 return result;
127 }, 127 },
128 128
129 'setFixedFavicon': function(aValue) { 129 'setFixedFavicon': function(aValue) {
130 this._fixedFavicon = aValue; 130 this._fixedFavicon = aValue;
131 }, 131 },
132 132
133 //------------------------------------------------------------------------- 133 //-------------------------------------------------------------------------
134 134
135 'setupJumpPageWindow': function(aWindow) { 135 'setupJumpPageWindow': function(aWindow) {
136//MochiKit.Logging.logDebug(">>> DirectLoginReference.setupJumpPageWindow - " + aWindow); 136//MochiKit.Logging.logDebug(">>> DirectLoginReference.setupJumpPageWindow - " + aWindow);
137 try { 137 try {
138 MochiKit.DOM.withWindow(aWindow, MochiKit.Base.bind(function() { 138 MochiKit.DOM.withWindow(aWindow, MochiKit.Base.bind(function() {
139 MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body, 139 MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body,
140 MochiKit.DOM.H1(null, "Loading " + this.label()) 140 MochiKit.DOM.H1(null, "Loading " + this.label())
141 ); 141 );
142 }, this)); 142 }, this));
143 } catch(e) { 143 } catch(e) {
144 MochiKit.Logging.logDebug("EXCEPTION: " + e); 144 MochiKit.Logging.logDebug("EXCEPTION: " + e);
145 } 145 }
146//MochiKit.Logging.logDebug("<<< DirectLoginReference.setupJumpPageWindow"); 146//MochiKit.Logging.logDebug("<<< DirectLoginReference.setupJumpPageWindow");