summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/Visual.js
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/Clipperz/Visual.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/Visual.js22
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,118 +1,116 @@
/*
-Copyright 2008-2011 Clipperz Srl
+Copyright 2008-2013 Clipperz Srl
-This file is part of Clipperz Community Edition.
-Clipperz Community Edition is an online password manager.
+This file is part of Clipperz, the online password manager.
For further information about its features and functionalities please
refer to http://www.clipperz.com.
-* Clipperz Community Edition is free software: you can redistribute
- it and/or modify it under the terms of the GNU Affero General Public
- License as published by the Free Software Foundation, either version
- 3 of the License, or (at your option) any later version.
+* Clipperz is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
-* Clipperz Community Edition is distributed in the hope that it will
- be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* Clipperz is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public
- License along with Clipperz Community Edition. If not, see
- <http://www.gnu.org/licenses/>.
+ License along with Clipperz. If not, see http://www.gnu.org/licenses/.
*/
if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
if (typeof(Clipperz.Visual) == 'undefined') { Clipperz.Visual = {}; }
Clipperz.Visual.VERSION = "0.1";
Clipperz.Visual.NAME = "Clipperz.Visual";
MochiKit.Base.update(Clipperz.Visual, {
//-------------------------------------------------------------------------
'__repr__': function () {
return "[" + this.NAME + " " + this.VERSION + "]";
},
//-------------------------------------------------------------------------
'toString': function () {
return this.__repr__();
},
//-------------------------------------------------------------------------
'deferredResize': function (anElement, someOptions) {
var deferredResult;
var moveTransition;
var scaleTransition;
var duration;
duration = someOptions.duration || 0.5;
deferredResult = new Clipperz.Async.Deferred("Visual.deferredResize", {trace:false});
deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]);
moveTransition = MochiKit.Visual.Transitions.linear; //MochiKit.Visual.Transitions.sinoidal;
scaleTransition = MochiKit.Visual.Transitions.linear; //MochiKit.Visual.Transitions.sinoidal;
MochiKit.Style.setElementPosition(anElement, {x:someOptions.from.position.x, y:someOptions.from.position.y }, 'px');
new MochiKit.Visual.Parallel([
new MochiKit.Visual.Move(anElement, {x:someOptions.to.position.x, y:someOptions.to.position.y, mode:'absolute', transition:moveTransition, sync:true}),
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})
], {duration:duration, afterFinish:MochiKit.Base.method(deferredResult, 'callback')})
return deferredResult;
},
//-------------------------------------------------------------------------
'deferredAnimation': function (anAnimation, someParameters, someOptions) {
var deferredResult;
var afterFinishCallback;
var options;
deferredResult = new Clipperz.Async.Deferred("Clipperz.Visual.deferredAnimation", {trace:false});
deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]);
if (MochiKit.Base.isUndefinedOrNull(someOptions)) {
options = {}
} else {
options = someOptions;
}
if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) {
options['afterFinish'] = MochiKit.Base.noop;
}
MochiKit.Base.update(options, {
'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback'))
});
new anAnimation(someParameters, options);
return deferredResult;
},
//-------------------------------------------------------------------------
'deferredAnimations': function (aSinchronizationType, someAnimations, someOptions) {
var deferredResult;
var options;
deferredResult = new Clipperz.Async.Deferred("Visual.deferredParallelAnimations", {trace:false});
deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]);
options = someOptions;
if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) {
options['afterFinish'] = MochiKit.Base.noop;
}
MochiKit.Base.update(options, {
'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback'))
});
new aSinchronizationType(someAnimations, options)