Path: blob/trunk/third_party/closure/goog/fx/transition.js
2868 views
// Copyright 2011 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314/**15* @fileoverview An interface for transition animation. This is a simple16* interface that allows for playing and stopping a transition. It adds17* a simple event model with BEGIN and END event.18*19* @author [email protected] (Chris Henry)20*/2122goog.provide('goog.fx.Transition');23goog.provide('goog.fx.Transition.EventType');24252627/**28* An interface for programmatic transition. Must extend29* {@code goog.events.EventTarget}.30* @interface31*/32goog.fx.Transition = function() {};333435/**36* Transition event types.37* @enum {string}38*/39goog.fx.Transition.EventType = {40/** Dispatched when played for the first time OR when it is resumed. */41PLAY: 'play',4243/** Dispatched only when the animation starts from the beginning. */44BEGIN: 'begin',4546/** Dispatched only when animation is restarted after a pause. */47RESUME: 'resume',4849/**50* Dispatched when animation comes to the end of its duration OR stop51* is called.52*/53END: 'end',5455/** Dispatched only when stop is called. */56STOP: 'stop',5758/** Dispatched only when animation comes to its end naturally. */59FINISH: 'finish',6061/** Dispatched when an animation is paused. */62PAUSE: 'pause'63};646566/**67* @type {function()}68* Plays the transition.69*/70goog.fx.Transition.prototype.play;717273/**74* @type {function()}75* Stops the transition.76*/77goog.fx.Transition.prototype.stop;787980