Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js') (more/less context) (show whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js index ab8a38c..69c1ede 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js | |||
@@ -1,120 +1,117 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.RulerComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.RulerComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | Clipperz.PM.UI.Web.Components.RulerComponent.superclass.constructor.apply(this, arguments); | 30 | Clipperz.PM.UI.Web.Components.RulerComponent.superclass.constructor.apply(this, arguments); |
34 | 31 | ||
35 | this._translationContext = args.translationContext|| Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._translationContext = args.translationContext|| Clipperz.Base.exception.raise('MandatoryParameter'); |
36 | // this._steps = args.steps || Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | // this._steps = args.steps || Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._steps = args.steps; | 34 | this._steps = args.steps; |
38 | 35 | ||
39 | this._currentStep = -1; | 36 | this._currentStep = -1; |
40 | 37 | ||
41 | return this; | 38 | return this; |
42 | } | 39 | } |
43 | 40 | ||
44 | //============================================================================= | 41 | //============================================================================= |
45 | 42 | ||
46 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 43 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'toString': function () { | 47 | 'toString': function () { |
51 | return "Clipperz.PM.UI.Web.Components.RulerComponent component"; | 48 | return "Clipperz.PM.UI.Web.Components.RulerComponent component"; |
52 | }, | 49 | }, |
53 | 50 | ||
54 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
55 | 52 | ||
56 | 'resetStatus': function (args) { | 53 | 'resetStatus': function (args) { |
57 | args = args || {}; | 54 | args = args || {}; |
58 | 55 | ||
59 | if (this.currentStep() != 0) { | 56 | if (this.currentStep() != 0) { |
60 | var shouldAnimateTransition; | 57 | var shouldAnimateTransition; |
61 | 58 | ||
62 | shouldAnimateTransition = args.animateTransition || false; | 59 | shouldAnimateTransition = args.animateTransition || false; |
63 | 60 | ||
64 | if (shouldAnimateTransition) { | 61 | if (shouldAnimateTransition) { |
65 | this.moveToFirstStep(MochiKit.Base.method(this, 'cursorMoved')); | 62 | this.moveToFirstStep(MochiKit.Base.method(this, 'cursorMoved')); |
66 | } else { | 63 | } else { |
67 | this._currentStep = 0; | 64 | this._currentStep = 0; |
68 | this.cursorMoved(); | 65 | this.cursorMoved(); |
69 | } | 66 | } |
70 | } | 67 | } |
71 | }, | 68 | }, |
72 | 69 | ||
73 | //------------------------------------------------------------------------- | 70 | //------------------------------------------------------------------------- |
74 | 71 | ||
75 | 'translationContext': function () { | 72 | 'translationContext': function () { |
76 | return this._translationContext; | 73 | return this._translationContext; |
77 | }, | 74 | }, |
78 | 75 | ||
79 | 'steps': function () { | 76 | 'steps': function () { |
80 | return this._steps; | 77 | return this._steps; |
81 | }, | 78 | }, |
82 | 79 | ||
83 | 'setSteps': function (aValue) { | 80 | 'setSteps': function (aValue) { |
84 | this._steps = aValue; | 81 | this._steps = aValue; |
85 | this.renderStepsComponents(); | 82 | this.renderStepsComponents(); |
86 | this.resetStatus(); | 83 | this.resetStatus(); |
87 | }, | 84 | }, |
88 | 85 | ||
89 | 'translatedStepDescription': function (aStep) { | 86 | 'translatedStepDescription': function (aStep) { |
90 | return Clipperz.PM.Strings.getValue(this.translationContext() + '.' + aStep + '.' + 'name'); | 87 | return Clipperz.PM.Strings.getValue(this.translationContext() + '.' + aStep + '.' + 'name'); |
91 | }, | 88 | }, |
92 | 89 | ||
93 | //------------------------------------------------------------------------- | 90 | //------------------------------------------------------------------------- |
94 | 91 | ||
95 | 'renderSelf': function(/*aContainer, aPosition*/) { | 92 | 'renderSelf': function(/*aContainer, aPosition*/) { |
96 | this.setElement(this.append(MochiKit.DOM.currentDocument().body, [ | 93 | this.setElement(this.append(MochiKit.DOM.currentDocument().body, [ |
97 | {tag:'div', id:this.getId('rulerWrapper'), cls:'rulerWrapper fixed', children:[ | 94 | {tag:'div', id:this.getId('rulerWrapper'), cls:'rulerWrapper fixed', children:[ |
98 | {tag:'div', cls:'ruler', children:[ | 95 | {tag:'div', cls:'ruler', children:[ |
99 | {tag:'a', href:'#', id:this.getId('exit'), cls:'exit', html:' '}, | 96 | {tag:'a', href:'#', id:this.getId('exit'), cls:'exit', html:' '}, |
100 | {tag:'a', href:'#', id:this.getId('smallPreviousButton'),cls:'smallButton previous', html:' '}, | 97 | {tag:'a', href:'#', id:this.getId('smallPreviousButton'),cls:'smallButton previous', html:' '}, |
101 | {tag:'a', href:'#', id:this.getId('smallNextButton'), cls:'smallButton next', html:' '}, | 98 | {tag:'a', href:'#', id:this.getId('smallNextButton'), cls:'smallButton next', html:' '}, |
102 | {tag:'div', cls:'marker', id:this.getId('marker'), children:[ | 99 | {tag:'div', cls:'marker', id:this.getId('marker'), children:[ |
103 | {tag:'div', cls:'previous', id:this.getId('previousButton')}, | 100 | {tag:'div', cls:'previous', id:this.getId('previousButton')}, |
104 | {tag:'div', cls:'markerBody'}, | 101 | {tag:'div', cls:'markerBody'}, |
105 | {tag:'div', cls:'next', id:this.getId('nextButton')} | 102 | {tag:'div', cls:'next', id:this.getId('nextButton')} |
106 | ]}, | 103 | ]}, |
107 | {tag:'div', cls:'steps', id:this.getId('stepsFrame')}, | 104 | {tag:'div', cls:'steps', id:this.getId('stepsFrame')}, |
108 | // {tag:'div', cls:'steps' + ' ' + 'steps_' + this.steps().length, children:[ | 105 | // {tag:'div', cls:'steps' + ' ' + 'steps_' + this.steps().length, children:[ |
109 | // {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map(MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), this.steps())} | 106 | // {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map(MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), this.steps())} |
110 | // ]}, | 107 | // ]}, |
111 | {tag:'div', cls:'dots', id:this.getId('dotsFrame')} | 108 | {tag:'div', cls:'dots', id:this.getId('dotsFrame')} |
112 | // {tag:'div', cls:'dots' + ' ' + 'steps_' + this.steps().length, children:[ | 109 | // {tag:'div', cls:'dots' + ' ' + 'steps_' + this.steps().length, children:[ |
113 | // {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map(function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}}, this.steps())} | 110 | // {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map(function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}}, this.steps())} |
114 | // ]} | 111 | // ]} |
115 | ]} | 112 | ]} |
116 | ]} | 113 | ]} |
117 | ])); | 114 | ])); |
118 | //console.log("ELEMENT", this.element()); | 115 | //console.log("ELEMENT", this.element()); |
119 | 116 | ||
120 | MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit'); | 117 | MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit'); |