Diffstat (limited to 'frontend/gamma/js/Clipperz/Visual.js') (more/less context) (show whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/Visual.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/Visual.js b/frontend/gamma/js/Clipperz/Visual.js index b907d5c..c2da3b7 100644 --- a/frontend/gamma/js/Clipperz/Visual.js +++ b/frontend/gamma/js/Clipperz/Visual.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 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
30 | if (typeof(Clipperz.Visual) == 'undefined') { Clipperz.Visual = {}; } | 27 | if (typeof(Clipperz.Visual) == 'undefined') { Clipperz.Visual = {}; } |
31 | 28 | ||
32 | Clipperz.Visual.VERSION = "0.1"; | 29 | Clipperz.Visual.VERSION = "0.1"; |
33 | Clipperz.Visual.NAME = "Clipperz.Visual"; | 30 | Clipperz.Visual.NAME = "Clipperz.Visual"; |
34 | 31 | ||
35 | MochiKit.Base.update(Clipperz.Visual, { | 32 | MochiKit.Base.update(Clipperz.Visual, { |
36 | 33 | ||
37 | //------------------------------------------------------------------------- | 34 | //------------------------------------------------------------------------- |
38 | 35 | ||
39 | '__repr__': function () { | 36 | '__repr__': function () { |
40 | return "[" + this.NAME + " " + this.VERSION + "]"; | 37 | return "[" + this.NAME + " " + this.VERSION + "]"; |
41 | }, | 38 | }, |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return this.__repr__(); | 43 | return this.__repr__(); |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'deferredResize': function (anElement, someOptions) { | 48 | 'deferredResize': function (anElement, someOptions) { |
52 | var deferredResult; | 49 | var deferredResult; |
53 | var moveTransition; | 50 | var moveTransition; |
54 | var scaleTransition; | 51 | var scaleTransition; |
55 | var duration; | 52 | var duration; |
56 | 53 | ||
57 | duration = someOptions.duration || 0.5; | 54 | duration = someOptions.duration || 0.5; |
58 | 55 | ||
59 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredResize", {trace:false}); | 56 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredResize", {trace:false}); |
60 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | 57 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); |
61 | 58 | ||
62 | moveTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; | 59 | moveTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; |
63 | scaleTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; | 60 | scaleTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; |
64 | 61 | ||
65 | MochiKit.Style.setElementPosition(anElement, {x:someOptions.from.position.x, y:someOptions.from.position.y }, 'px'); | 62 | MochiKit.Style.setElementPosition(anElement, {x:someOptions.from.position.x, y:someOptions.from.position.y }, 'px'); |
66 | 63 | ||
67 | new MochiKit.Visual.Parallel([ | 64 | new MochiKit.Visual.Parallel([ |
68 | new MochiKit.Visual.Move(anElement, {x:someOptions.to.position.x, y:someOptions.to.position.y, mode:'absolute', transition:moveTransition, sync:true}), | 65 | new MochiKit.Visual.Move(anElement, {x:someOptions.to.position.x, y:someOptions.to.position.y, mode:'absolute', transition:moveTransition, sync:true}), |
69 | new Clipperz.Visual.Resize(anElement, {fromSize:{h:someOptions.from.dimensions.h, w:someOptions.from.dimensions.w}, toSize:{h:someOptions.to.dimensions.h, w:someOptions.to.dimensions.w}, transition:scaleTransition, scaleContent:false, scaleFromCenter:false, restoreAfterFinish:true, sync:true}) | 66 | new Clipperz.Visual.Resize(anElement, {fromSize:{h:someOptions.from.dimensions.h, w:someOptions.from.dimensions.w}, toSize:{h:someOptions.to.dimensions.h, w:someOptions.to.dimensions.w}, transition:scaleTransition, scaleContent:false, scaleFromCenter:false, restoreAfterFinish:true, sync:true}) |
70 | ], {duration:duration, afterFinish:MochiKit.Base.method(deferredResult, 'callback')}) | 67 | ], {duration:duration, afterFinish:MochiKit.Base.method(deferredResult, 'callback')}) |
71 | 68 | ||
72 | return deferredResult; | 69 | return deferredResult; |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //------------------------------------------------------------------------- | 72 | //------------------------------------------------------------------------- |
76 | 73 | ||
77 | 'deferredAnimation': function (anAnimation, someParameters, someOptions) { | 74 | 'deferredAnimation': function (anAnimation, someParameters, someOptions) { |
78 | vardeferredResult; | 75 | vardeferredResult; |
79 | var afterFinishCallback; | 76 | var afterFinishCallback; |
80 | var options; | 77 | var options; |
81 | 78 | ||
82 | deferredResult = new Clipperz.Async.Deferred("Clipperz.Visual.deferredAnimation", {trace:false}); | 79 | deferredResult = new Clipperz.Async.Deferred("Clipperz.Visual.deferredAnimation", {trace:false}); |
83 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | 80 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); |
84 | 81 | ||
85 | if (MochiKit.Base.isUndefinedOrNull(someOptions)) { | 82 | if (MochiKit.Base.isUndefinedOrNull(someOptions)) { |
86 | options = {} | 83 | options = {} |
87 | } else { | 84 | } else { |
88 | options = someOptions; | 85 | options = someOptions; |
89 | } | 86 | } |
90 | 87 | ||
91 | if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) { | 88 | if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) { |
92 | options['afterFinish'] = MochiKit.Base.noop; | 89 | options['afterFinish'] = MochiKit.Base.noop; |
93 | } | 90 | } |
94 | 91 | ||
95 | MochiKit.Base.update(options, { | 92 | MochiKit.Base.update(options, { |
96 | 'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback')) | 93 | 'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback')) |
97 | }); | 94 | }); |
98 | 95 | ||
99 | new anAnimation(someParameters, options); | 96 | new anAnimation(someParameters, options); |
100 | 97 | ||
101 | return deferredResult; | 98 | return deferredResult; |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //------------------------------------------------------------------------- | 101 | //------------------------------------------------------------------------- |
105 | 102 | ||
106 | 'deferredAnimations': function (aSinchronizationType, someAnimations, someOptions) { | 103 | 'deferredAnimations': function (aSinchronizationType, someAnimations, someOptions) { |
107 | var deferredResult; | 104 | var deferredResult; |
108 | varoptions; | 105 | varoptions; |
109 | 106 | ||
110 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredParallelAnimations", {trace:false}); | 107 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredParallelAnimations", {trace:false}); |
111 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | 108 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); |
112 | 109 | ||
113 | options = someOptions; | 110 | options = someOptions; |
114 | if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) { | 111 | if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) { |
115 | options['afterFinish'] = MochiKit.Base.noop; | 112 | options['afterFinish'] = MochiKit.Base.noop; |
116 | } | 113 | } |
117 | MochiKit.Base.update(options, { | 114 | MochiKit.Base.update(options, { |
118 | 'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback')) | 115 | 'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback')) |
119 | }); | 116 | }); |
120 | 117 | ||