Diffstat (limited to 'frontend/gamma/js/Clipperz/Visual.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/Visual.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/gamma/js/Clipperz/Visual.js b/frontend/gamma/js/Clipperz/Visual.js index c2da3b7..93ed725 100644 --- a/frontend/gamma/js/Clipperz/Visual.js +++ b/frontend/gamma/js/Clipperz/Visual.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * 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 |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.Visual) == 'undefined') { Clipperz.Visual = {}; } | 25 | if (typeof(Clipperz.Visual) == 'undefined') { Clipperz.Visual = {}; } |
28 | 26 | ||
29 | Clipperz.Visual.VERSION = "0.1"; | 27 | Clipperz.Visual.VERSION = "0.1"; |
30 | Clipperz.Visual.NAME = "Clipperz.Visual"; | 28 | Clipperz.Visual.NAME = "Clipperz.Visual"; |
31 | 29 | ||
32 | MochiKit.Base.update(Clipperz.Visual, { | 30 | MochiKit.Base.update(Clipperz.Visual, { |
33 | 31 | ||
34 | //------------------------------------------------------------------------- | 32 | //------------------------------------------------------------------------- |
35 | 33 | ||
36 | '__repr__': function () { | 34 | '__repr__': function () { |
37 | return "[" + this.NAME + " " + this.VERSION + "]"; | 35 | return "[" + this.NAME + " " + this.VERSION + "]"; |
38 | }, | 36 | }, |
39 | 37 | ||
40 | //------------------------------------------------------------------------- | 38 | //------------------------------------------------------------------------- |
41 | 39 | ||
42 | 'toString': function () { | 40 | 'toString': function () { |
43 | return this.__repr__(); | 41 | return this.__repr__(); |
44 | }, | 42 | }, |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'deferredResize': function (anElement, someOptions) { | 46 | 'deferredResize': function (anElement, someOptions) { |
49 | var deferredResult; | 47 | var deferredResult; |
50 | var moveTransition; | 48 | var moveTransition; |
51 | var scaleTransition; | 49 | var scaleTransition; |
52 | var duration; | 50 | var duration; |
53 | 51 | ||
54 | duration = someOptions.duration || 0.5; | 52 | duration = someOptions.duration || 0.5; |
55 | 53 | ||
56 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredResize", {trace:false}); | 54 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredResize", {trace:false}); |
57 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | 55 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); |
58 | 56 | ||
59 | moveTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; | 57 | moveTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; |
60 | scaleTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; | 58 | scaleTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; |
61 | 59 | ||
62 | MochiKit.Style.setElementPosition(anElement, {x:someOptions.from.position.x, y:someOptions.from.position.y }, 'px'); | 60 | MochiKit.Style.setElementPosition(anElement, {x:someOptions.from.position.x, y:someOptions.from.position.y }, 'px'); |
63 | 61 | ||
64 | new MochiKit.Visual.Parallel([ | 62 | new MochiKit.Visual.Parallel([ |
65 | new MochiKit.Visual.Move(anElement, {x:someOptions.to.position.x, y:someOptions.to.position.y, mode:'absolute', transition:moveTransition, sync:true}), | 63 | new MochiKit.Visual.Move(anElement, {x:someOptions.to.position.x, y:someOptions.to.position.y, mode:'absolute', transition:moveTransition, 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}) | 64 | 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}) |
67 | ], {duration:duration, afterFinish:MochiKit.Base.method(deferredResult, 'callback')}) | 65 | ], {duration:duration, afterFinish:MochiKit.Base.method(deferredResult, 'callback')}) |
68 | 66 | ||
69 | return deferredResult; | 67 | return deferredResult; |
70 | }, | 68 | }, |
71 | 69 | ||
72 | //------------------------------------------------------------------------- | 70 | //------------------------------------------------------------------------- |
73 | 71 | ||
74 | 'deferredAnimation': function (anAnimation, someParameters, someOptions) { | 72 | 'deferredAnimation': function (anAnimation, someParameters, someOptions) { |
75 | vardeferredResult; | 73 | vardeferredResult; |
76 | var afterFinishCallback; | 74 | var afterFinishCallback; |
77 | var options; | 75 | var options; |
78 | 76 | ||
79 | deferredResult = new Clipperz.Async.Deferred("Clipperz.Visual.deferredAnimation", {trace:false}); | 77 | deferredResult = new Clipperz.Async.Deferred("Clipperz.Visual.deferredAnimation", {trace:false}); |
80 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | 78 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); |
81 | 79 | ||
82 | if (MochiKit.Base.isUndefinedOrNull(someOptions)) { | 80 | if (MochiKit.Base.isUndefinedOrNull(someOptions)) { |
83 | options = {} | 81 | options = {} |
84 | } else { | 82 | } else { |
85 | options = someOptions; | 83 | options = someOptions; |
86 | } | 84 | } |