]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Added support for in and out to be used instead of start and end's definition within...
authorDavid Seifried <david.c.seifried@gmail.com>
Wed, 21 Sep 2011 19:49:42 +0000 (15:49 -0400)
committerDavid Seifried <david.c.seifried@gmail.com>
Wed, 21 Sep 2011 19:49:42 +0000 (15:49 -0400)
popcorn.js
test/popcorn.unit.js

index 8c04fb288c4cff2adedcd1af16808f22a7f28d0b..6eebe506d318f6263ade36ab9e950c2ea1f1602b 100644 (file)
       options._natives.type = name;
       options._running = false;
 
+      natives[ "in" ] && ( natives.start = natives[ "in" ] );
+
+      natives[ "out" ] && ( natives.end = natives[ "out" ] );
+
       // Check for previously set default options
       defaults = this.options.defaults && this.options.defaults[ options._natives && options._natives.type ];
 
index d36bc086171e6b40f90403f09734a3bfed01aa6a..d2c6acdf964d1116189a85badfc8fd8476616046 100644 (file)
@@ -2598,10 +2598,10 @@ test( "In/Out aliases", function() {
   Popcorn.plugin( "aliasTester", function() {
 
     return {
-      start: function() {
+      in: function() {
         counter++;
       },
-      end: function() {
+      out: function() {
         counter++;
       }
     };
@@ -2614,6 +2614,11 @@ test( "In/Out aliases", function() {
 
   popcorn.currentTime( 0 ).pause();
 
+  ok( popcorn.data.events[ "in" ], "in is a valid alias for start" );
+  plus();
+
+  ok( popcorn.data.events[ "out" ], "out is a valid alias for end" ); 
+
   equals( counter, 0, "Counter is at 0, neither in or out have been called" );
   plus();