Cappuccino  1.0.0
 All Classes Files Functions Variables Typedefs Macros Groups Pages
CSSAnimation.j File Reference

Go to the source code of this file.

Variables

CSSAnimation prototype addAnimationEndEventListener
 
var ANIMATION_DURATION_PROPERTY
 
var ANIMATION_END_EVENT_NAME
 
var ANIMATION_FILL_MODE_PROPERTY
 
var ANIMATION_KEYFRAMES_RULE
 
var ANIMATION_NAME_PROPERTY
 
var ANIMATION_PROPERTY
 
var ANIMATION_TIMING_FUNCTION_PROPERTY
 
var ANIMATIONS_GLOBAL_ID = 0
 
CSSAnimation prototype appendKeyFramesRule
 
CSSAnimation prototype buildDOMElements
 
CSSAnimation prototype completionFunctionForAnimationName
 
CSSAnimation prototype createKeyFramesStyleElement
 
 CSSAnimation
 
var CURRENT_ANIMATIONS = {}
 
var defineCSSProperties
 
CSSAnimation prototype description
 
CSSAnimation prototype endEventListener
 
CSSAnimation prototype keyFrames
 
var removeFromParent
 
CSSAnimation prototype setTargetStyleProperties
 
CSSAnimation prototype start
 

Variable Documentation

CSSAnimation prototype addAnimationEndEventListener
Initial value:
= function()
{
var listener = this.endEventListener();
this.target.addEventListener(ANIMATION_END_EVENT_NAME, listener, false);
}

Definition at line 262 of file CSSAnimation.j.

var ANIMATION_DURATION_PROPERTY

Definition at line 3 of file CSSAnimation.j.

var ANIMATION_END_EVENT_NAME

Definition at line 3 of file CSSAnimation.j.

var ANIMATION_FILL_MODE_PROPERTY

Definition at line 3 of file CSSAnimation.j.

var ANIMATION_KEYFRAMES_RULE

Definition at line 3 of file CSSAnimation.j.

var ANIMATION_NAME_PROPERTY

Definition at line 3 of file CSSAnimation.j.

var ANIMATION_PROPERTY

Definition at line 3 of file CSSAnimation.j.

var ANIMATION_TIMING_FUNCTION_PROPERTY

Definition at line 3 of file CSSAnimation.j.

var ANIMATIONS_GLOBAL_ID = 0

Definition at line 2 of file CSSAnimation.j.

CSSAnimation prototype appendKeyFramesRule
Initial value:
= function()
{
var styleElement = this.createKeyFramesStyleElement(),
keyframesText = this.keyFrames(),
nodeText = document.createTextNode(keyframesText);
styleElement.appendChild(nodeText);
document.head.appendChild(styleElement);
}

Definition at line 165 of file CSSAnimation.j.

CSSAnimation prototype buildDOMElements
Initial value:
= function()
{
this.didBuildDOMElements = true;
}

Definition at line 284 of file CSSAnimation.j.

CSSAnimation prototype completionFunctionForAnimationName
Initial value:
= function(aName)
{
var propanims = this.propertyanimations,
count = propanims.length;
while (count--)
{
var anim = propanims[count];
if (anim.name === aName)
return anim.completionfunction;
}
return null;
}

Definition at line 246 of file CSSAnimation.j.

CSSAnimation prototype createKeyFramesStyleElement
Initial value:
= function()
{
if (!this.styleElement)
{
var styleElement = document.createElement("style");
styleElement.setAttribute("type", "text/css");
this.styleElement = styleElement;
}
return this.styleElement;
}

Definition at line 175 of file CSSAnimation.j.

CSSAnimation

Definition at line 37 of file CSSAnimation.j.

var CURRENT_ANIMATIONS = {}

Definition at line 3 of file CSSAnimation.j.

var defineCSSProperties
Initial value:
= function()
{
if (this.done)
return;
ANIMATION_KEYFRAMES_RULE = "@" + ANIMATION_PROPERTY.substring(0, ANIMATION_PROPERTY.indexOf("animation")) + "keyframes";
this.done = true;
}

Definition at line 13 of file CSSAnimation.j.

CSSAnimation prototype description

Definition at line 73 of file CSSAnimation.j.

CSSAnimation prototype endEventListener

Definition at line 189 of file CSSAnimation.j.

CSSAnimation prototype keyFrames

Definition at line 117 of file CSSAnimation.j.

var removeFromParent
Initial value:
= function(aNode)
{
var parentNode = aNode.parentNode;
if (parentNode)
parentNode.removeChild(aNode);
}

Definition at line 29 of file CSSAnimation.j.

CSSAnimation prototype setTargetStyleProperties
Initial value:
= function()
{
var style = this.target.style;
if (this.animationstimingfunctions.length)
style.setProperty(ANIMATION_TIMING_FUNCTION_PROPERTY, this.animationstimingfunctions.join(","));
style.setProperty(ANIMATION_DURATION_PROPERTY, this.animationsdurations.join(","));
style.setProperty(ANIMATION_FILL_MODE_PROPERTY, "forwards");
style.setProperty("-webkit-backface-visibility", "hidden");
}

Definition at line 269 of file CSSAnimation.j.

CSSAnimation prototype start
Initial value:
= function()
{
if (this.propertyanimations.length === 0 || this.islive)
return false;
if (!this.didBuildDOMElements)
this.target.style.setProperty(ANIMATION_NAME_PROPERTY, this.animationsnames.join(","));
this.islive = true;
return true;
}

Definition at line 295 of file CSSAnimation.j.