summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/MochiKit/Visual.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/MochiKit/Visual.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/MochiKit/Visual.js39
1 files changed, 20 insertions, 19 deletions
diff --git a/frontend/gamma/js/MochiKit/Visual.js b/frontend/gamma/js/MochiKit/Visual.js
index 648d82a..372d99a 100644
--- a/frontend/gamma/js/MochiKit/Visual.js
+++ b/frontend/gamma/js/MochiKit/Visual.js
@@ -8,7 +8,7 @@ See <http://mochikit.com/> for documentation, downloads, license, etc.
8 8
9***/ 9***/
10 10
11MochiKit.Base._module('Visual', '1.5', ['Base', 'DOM', 'Style', 'Color', 'Position']); 11MochiKit.Base.module(MochiKit, 'Visual', '1.5', ['Base', 'DOM', 'Style', 'Color', 'Position']);
12 12
13MochiKit.Visual._RoundCorners = function (e, options) { 13MochiKit.Visual._RoundCorners = function (e, options) {
14 e = MochiKit.DOM.getElement(e); 14 e = MochiKit.DOM.getElement(e);
@@ -469,6 +469,11 @@ MochiKit.Visual.Transitions.parabolic = function (pos) {
469 return pos * pos; 469 return pos * pos;
470}; 470};
471 471
472/** @id MochiKit.Visual.Transitions.spring */
473MochiKit.Visual.Transitions.spring = function (pos) {
474 return 1 - (Math.cos(pos * 2.5 * Math.PI) * Math.exp(-pos * 6));
475};
476
472/** @id MochiKit.Visual.Transitions.none */ 477/** @id MochiKit.Visual.Transitions.none */
473MochiKit.Visual.Transitions.none = function (pos) { 478MochiKit.Visual.Transitions.none = function (pos) {
474 return 0; 479 return 0;
@@ -534,6 +539,11 @@ MochiKit.Base.update(MochiKit.Visual.ScopedQueue.prototype, {
534 e.finalize(); 539 e.finalize();
535 }, this.effects); 540 }, this.effects);
536 break; 541 break;
542 case 'replace':
543 ma(function (e) {
544 e.cancel();
545 }, this.effects);
546 break;
537 } 547 }
538 548
539 effect.startOn += timestamp; 549 effect.startOn += timestamp;
@@ -662,8 +672,12 @@ MochiKit.Visual.Base.prototype = {
662 this.event('afterSetup'); 672 this.event('afterSetup');
663 } 673 }
664 if (this.state == 'running') { 674 if (this.state == 'running') {
665 if (this.options.transition) { 675 var trans = this.options.transition;
666 pos = this.options.transition(pos); 676 if (typeof(trans) == "string") {
677 trans = MochiKit.Visual.Transitions[trans];
678 }
679 if (typeof(trans) == "function") {
680 pos = trans(pos);
667 } 681 }
668 pos *= (this.options.to - this.options.from); 682 pos *= (this.options.to - this.options.from);
669 pos += this.options.from; 683 pos += this.options.from;
@@ -1686,8 +1700,8 @@ MochiKit.Visual.squish = function (element, /* optional */ options) {
1686 var elemClip; 1700 var elemClip;
1687 options = b.update({ 1701 options = b.update({
1688 restoreAfterFinish: true, 1702 restoreAfterFinish: true,
1689 scaleMode: {originalHeight: elementDimensions.w, 1703 scaleMode: {originalHeight: elementDimensions.h,
1690 originalWidth: elementDimensions.h}, 1704 originalWidth: elementDimensions.w},
1691 beforeSetupInternal: function (effect) { 1705 beforeSetupInternal: function (effect) {
1692 elemClip = s.makeClipping(effect.element); 1706 elemClip = s.makeClipping(effect.element);
1693 }, 1707 },
@@ -1958,18 +1972,5 @@ MochiKit.Visual.fold = function (element, /* optional */ options) {
1958}; 1972};
1959 1973
1960 1974
1961/* end of Rico adaptation */ 1975MochiKit.Base.nameFunctions(MochiKit.Visual);
1962
1963MochiKit.Visual.__new__ = function () {
1964 var m = MochiKit.Base;
1965
1966 // Backwards compatibility aliases
1967 m._deprecated(this, 'Color', 'MochiKit.Color.Color', '1.1');
1968 m._deprecated(this, 'getElementsComputedStyle', 'MochiKit.Style.getStyle', '1.1');
1969
1970 m.nameFunctions(this);
1971};
1972
1973MochiKit.Visual.__new__();
1974
1975MochiKit.Base._exportSymbols(this, MochiKit.Visual); 1976MochiKit.Base._exportSymbols(this, MochiKit.Visual);