Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Printing/Record.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/Printing/Record.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Printing/Record.js b/frontend/beta/js/Clipperz/PM/Components/Printing/Record.js index 910d4b1..5f5c29f 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Printing/Record.js +++ b/frontend/beta/js/Clipperz/PM/Components/Printing/Record.js | |||
@@ -1,95 +1,92 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | it and/or modify it under the terms of the GNU Affero General Public |
15 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
30 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
31 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 28 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
32 | if (typeof(Clipperz.PM.Components.Printing) == 'undefined') { Clipperz.PM.Components.Printing = {}; } | 29 | if (typeof(Clipperz.PM.Components.Printing) == 'undefined') { Clipperz.PM.Components.Printing = {}; } |
33 | 30 | ||
34 | Clipperz.PM.Components.Printing.Record = function(args) { | 31 | Clipperz.PM.Components.Printing.Record = function(args) { |
35 | args = args || {}; | 32 | args = args || {}; |
36 | 33 | ||
37 | this._record = args['record']; | 34 | this._record = args['record']; |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | MochiKit.Base.update(Clipperz.PM.Components.Printing.Record.prototype, { | 39 | MochiKit.Base.update(Clipperz.PM.Components.Printing.Record.prototype, { |
43 | 40 | ||
44 | 'record': function() { | 41 | 'record': function() { |
45 | return this._record; | 42 | return this._record; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'deferredDrawToWindow': function(aWindow) { | 47 | 'deferredDrawToWindow': function(aWindow) { |
51 | vardeferredResult; | 48 | vardeferredResult; |
52 | 49 | ||
53 | deferredResult = new MochiKit.Async.Deferred(); | 50 | deferredResult = new MochiKit.Async.Deferred(); |
54 | deferredResult.addCallback(MochiKit.Base.method(this.record(), 'deferredData')); | 51 | deferredResult.addCallback(MochiKit.Base.method(this.record(), 'deferredData')); |
55 | deferredResult.addCallback(MochiKit.Base.method(this, 'appendToWindow', aWindow)); | 52 | deferredResult.addCallback(MochiKit.Base.method(this, 'appendToWindow', aWindow)); |
56 | deferredResult.callback(); | 53 | deferredResult.callback(); |
57 | return deferredResult; | 54 | return deferredResult; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
61 | 58 | ||
62 | 'appendToWindow': function(aWindow) { | 59 | 'appendToWindow': function(aWindow) { |
63 | MochiKit.DOM.withWindow(aWindow, MochiKit.Base.bind(function() { | 60 | MochiKit.DOM.withWindow(aWindow, MochiKit.Base.bind(function() { |
64 | var newBlock; | 61 | var newBlock; |
65 | var fields; | 62 | var fields; |
66 | 63 | ||
67 | fields = MochiKit.Base.concat( | 64 | fields = MochiKit.Base.concat( |
68 | MochiKit.Base.map(MochiKit.Base.bind(function(aField) { | 65 | MochiKit.Base.map(MochiKit.Base.bind(function(aField) { |
69 | var result; | 66 | var result; |
70 | var dt, dd; | 67 | var dt, dd; |
71 | var label, value; | 68 | var label, value; |
72 | 69 | ||
73 | label = aField.label(); | 70 | label = aField.label(); |
74 | value = aField.value(); | 71 | value = aField.value(); |
75 | dt = MochiKit.DOM.createDOM('DT', null, label); | 72 | dt = MochiKit.DOM.createDOM('DT', null, label); |
76 | dd = MochiKit.DOM.createDOM('DD', null, value) | 73 | dd = MochiKit.DOM.createDOM('DD', null, value) |
77 | result = [dt, dd]; | 74 | result = [dt, dd]; |
78 | 75 | ||
79 | return result | 76 | return result |
80 | }, this), MochiKit.Base.values(this.record().currentVersion().fields())) | 77 | }, this), MochiKit.Base.values(this.record().currentVersion().fields())) |
81 | ); | 78 | ); |
82 | 79 | ||
83 | newBlock = MochiKit.DOM.DIV({'class': 'recordBlock'}, | 80 | newBlock = MochiKit.DOM.DIV({'class': 'recordBlock'}, |
84 | MochiKit.DOM.H2(null, this.record().label()), | 81 | MochiKit.DOM.H2(null, this.record().label()), |
85 | MochiKit.DOM.DIV({'class': 'recordNotes'}, MochiKit.Base.map(MochiKit.Base.partial(MochiKit.DOM.P, null), this.record().notes().split("\n"))), | 82 | MochiKit.DOM.DIV({'class': 'recordNotes'}, MochiKit.Base.map(MochiKit.Base.partial(MochiKit.DOM.P, null), this.record().notes().split("\n"))), |
86 | MochiKit.DOM.createDOM('DL', null, fields) | 83 | MochiKit.DOM.createDOM('DL', null, fields) |
87 | ); | 84 | ); |
88 | MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body, newBlock); | 85 | MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body, newBlock); |
89 | 86 | ||
90 | }, this)); | 87 | }, this)); |
91 | }, | 88 | }, |
92 | 89 | ||
93 | //------------------------------------------------------------------------- | 90 | //------------------------------------------------------------------------- |
94 | __syntaxFix__: "syntax fix" | 91 | __syntaxFix__: "syntax fix" |
95 | }); | 92 | }); |