]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
fixed image plugin lint errors, unit test, added optional text -#368
authorMinoo <minoo.ziaei@gmail.com>
Sat, 16 Apr 2011 00:03:59 +0000 (20:03 -0400)
committerMinoo <minoo.ziaei@gmail.com>
Sat, 16 Apr 2011 00:03:59 +0000 (20:03 -0400)
plugins/image/popcorn.image.js
plugins/image/popcorn.image.unit.js

index c6b03d5d59199435ea4c1733e3ca930cbea4a541..734ac938048893938a998879c7965f37db825708 100644 (file)
@@ -8,10 +8,11 @@
    * Options parameter will need a start, end, href, target and src.
    * Start is the time that you want this plug-in to execute
    * End is the time that you want this plug-in to stop executing 
-   * href is the url of the destination of a link
+   * href is the url of the destination of a link - optional 
    * Target is the id of the document element that the iframe needs to be attached to, 
    * this target element must exist on the DOM
    * Src is the url of the image that you want to display
+   * text is the overlayed text on the image - optional  
    *
    * @param {Object} options
    * 
@@ -47,6 +48,7 @@
       },
 
       _setup: function( options ) {
+        var st;
 
         options.link = document.createElement( 'a' );
         options.link.style.position = "relative";
@@ -74,7 +76,7 @@
             fontSize: fontHeight,
             color: "black",
             fontWeight : "bold",
-            zIndex: "10",
+            zIndex: "10"
         };
         for ( st in divTextStyle ) {
           divText.style[ st ] = divTextStyle[ st ];
index 79b96bc6b1be384b406d4982074addc1585723ec..d556067524cf2d9f04eed845009d9445a91682f6 100644 (file)
@@ -32,24 +32,22 @@ test("Popcorn Image Plugin", function () {
     target: 'imagediv'
   } );
 
-  interval = setInterval( function() {
+  popped.exec( 2, function() {
     if( popped.currentTime() > 1 && popped.currentTime() < 3 ) {
       ok( /display: block;/.test( imagediv.innerHTML ), "Div contents are displayed" );
       plus();
       ok( /img/.test( imagediv.innerHTML ), "An image exists" );
       plus();
-      clearInterval( interval );
     }
-  }, 500);
+  });
   
-  interval2 = setInterval( function() {
+  popped.exec( 4, function() {
     if( popped.currentTime() > 3 ) {
       ok( /display: none;/.test( imagediv.innerHTML ), "Div contents are hidden again" );
       plus();
-      clearInterval( interval2 );
     }
-  }, 500);
-  popped.volume(0);
-  popped.play();
+  });
   
+  popped.volume(0);
+  popped.play();  
 });