]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Fixed styling in all files in all unit tests
authorDavid Seifried <david.c.seifried@gmail.com>
Tue, 13 Sep 2011 00:14:48 +0000 (20:14 -0400)
committerDavid Seifried <david.c.seifried@gmail.com>
Tue, 13 Sep 2011 00:14:48 +0000 (20:14 -0400)
79 files changed:
plugins/attribution/popcorn.attribution.html
plugins/attribution/popcorn.attribution.unit.html
plugins/code/popcorn.code.html
plugins/code/popcorn.code.js
plugins/code/popcorn.code.unit.html
plugins/code/popcorn.code.unit.js
plugins/facebook/popcorn.facebook.html
plugins/facebook/popcorn.facebook.js
plugins/facebook/popcorn.facebook.unit.html
plugins/facebook/popcorn.facebook.unit.js
plugins/flickr/popcorn.flickr.html
plugins/flickr/popcorn.flickr.unit.html
plugins/footnote/popcorn.footnote.html
plugins/footnote/popcorn.footnote.js
plugins/footnote/popcorn.footnote.unit.html
plugins/footnote/popcorn.footnote.unit.js
plugins/gml/popcorn.gml.html
plugins/gml/popcorn.gml.js
plugins/gml/popcorn.gml.unit.html
plugins/gml/popcorn.gml.unit.js
plugins/googlefeed/.swp [new file with mode: 0644]
plugins/googlefeed/popcorn.googlefeed.html
plugins/googlefeed/popcorn.googlefeed.unit.html
plugins/googlemap/popcorn.googlemap.html
plugins/googlemap/popcorn.googlemap.js
plugins/googlemap/popcorn.googlemap.unit.html
plugins/googlemap/popcorn.googlemap.unit.js
plugins/image/popcorn.image.html
plugins/image/popcorn.image.js
plugins/image/popcorn.image.unit.html
plugins/image/popcorn.image.unit.js
plugins/lastfm/popcorn.lastfm.html
plugins/lastfm/popcorn.lastfm.js
plugins/lastfm/popcorn.lastfm.unit.html
plugins/lastfm/popcorn.lastfm.unit.js
plugins/linkedin/popcorn.linkedin.html
plugins/linkedin/popcorn.linkedin.js
plugins/linkedin/popcorn.linkedin.unit.html
plugins/linkedin/popcorn.linkedin.unit.js
plugins/lowerthird/popcorn.lowerthird.html
plugins/lowerthird/popcorn.lowerthird.unit.html
plugins/mustache/popcorn.mustache.js
plugins/mustache/popcorn.mustache.unit.html
plugins/mustache/popcorn.mustache.unit.js
plugins/openmap/popcorn.openmap.html
plugins/openmap/popcorn.openmap.js
plugins/openmap/popcorn.openmap.unit.html
plugins/openmap/popcorn.openmap.unit.js
plugins/pause/popcorn.pause.html
plugins/pause/popcorn.pause.unit.html
plugins/processing/popcorn.processing.html
plugins/processing/popcorn.processing.js
plugins/processing/popcorn.processing.unit.html
plugins/processing/popcorn.processing.unit.js
plugins/subtitle/popcorn.subtitle.html
plugins/subtitle/popcorn.subtitle.js
plugins/subtitle/popcorn.subtitle.unit.html
plugins/subtitle/popcorn.subtitle.unit.js
plugins/tagthisperson/popcorn.tagthisperson.html
plugins/tagthisperson/popcorn.tagthisperson.unit.html
plugins/timeline/popcorn.timeline.html
plugins/timeline/popcorn.timeline.js
plugins/timeline/popcorn.timeline.unit.html
plugins/timeline/popcorn.timeline.unit.js
plugins/twitter/popcorn.twitter.html
plugins/twitter/popcorn.twitter.js
plugins/twitter/popcorn.twitter.unit.html
plugins/twitter/popcorn.twitter.unit.js
plugins/webpage/popcorn.webpage.html
plugins/webpage/popcorn.webpage.js
plugins/webpage/popcorn.webpage.unit.html
plugins/wikipedia/popcorn.wikipedia.html
plugins/wikipedia/popcorn.wikipedia.js
plugins/wikipedia/popcorn.wikipedia.unit.html
plugins/wikipedia/popcorn.wikipedia.unit.js
plugins/wordriver/popcorn.wordriver.html
plugins/wordriver/popcorn.wordriver.js
plugins/wordriver/popcorn.wordriver.unit.html
plugins/wordriver/popcorn.wordriver.unit.js

index 6b509e2474de249b3ffa11a328381e0f1d8a8920..14ccbf8920c6627105b812c8bac7cda72811a6ff 100755 (executable)
@@ -6,13 +6,13 @@
   <script src="../../popcorn.js"></script>
   <script src="popcorn.attribution.js"></script>
   <script>
-    document.addEventListener("DOMContentLoaded", function () {
-      var p = Popcorn("#video")
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video" )
       .play()
-      .volume(0)
+      .volume( 0 )
       .attribution({
-        start: 0, // seconds
-        end: 10, // seconds
+        start: 0,
+        end: 10,
         nameofwork: "A Shared Culture",
         copyrightholder:"Jesse Dylan",
         license: "CC-BY-N6",
@@ -20,8 +20,8 @@
         target: "attribdiv"
       })
       .attribution({
-        start: 5, // seconds
-        end: 15, // seconds
+        start: 5,
+        end: 15,
         nameofwork: "Internet",
         nameofworkurl:"http://www.archive.org/details/CC1232_internet",
         copyrightholder:"The Computer Chronicles",
 
       <source id="mp4"
         src="../../test/trailer.mp4"
-        type="viden/mp4; codecs='avc1, mp4a'">
+        type='viden/mp4; codecs="avc1, mp4a"'>
 
       <source id="ogv"
         src="../../test/trailer.ogv"
-        type="video/ogg; codecs='theora, vorbis'">
+        type='video/ogg; codecs="theora, vorbis"'>
 
       <p>Your user agent does not support the HTML5 Video element.</p>
 
index 52592b3d9df71aa8c7eb3086c103dd8b14a57ef7..92524a88af9dfd67dc303da1cfb8b91bf89bca93 100755 (executable)
 
     <source id="mp4"
       src="../../test/trailer.mp4"
-      type="video/mp4; codecs='avc1, mp4a'">
+      type='video/mp4; codecs="avc1, mp4a"'>
 
     <source id="ogv"
       src="../../test/trailer.ogv"
-      type="video/ogg; codecs='theora, vorbis'">
+      type='video/ogg; codecs="theora, vorbis"'>
 
     <p>Your user agent does not support the HTML5 Video element.</p>
 
index 0b6932b0f2236280ff17ab7e1b6680bc5a39861d..fe0b1b0a2f5688ad88e717849e71a5b44068f8ef 100755 (executable)
@@ -8,19 +8,19 @@
   <script>
    var output;
 
-   document.addEventListener('DOMContentLoaded', function () {
-     output = document.getElementById('output');
+   document.addEventListener( "DOMContentLoaded", function () {
+     output = document.getElementById( "output" );
      var $ = function( id ) {
        return document.getElementById( id.substring( 1 ) );
      };
 
-     var p = Popcorn('#video')
+     var p = Popcorn( "#video" )
 
      .code({
         start: 1,
         end: 3,
         onStart: function( options ) {
-          $('#test1').innerHTML = 'Yes';
+          $( "#test1" ).innerHTML = "Yes";
         }
      })
 
         start: 5,
         end: 8,
         onStart: function( options ) {
-          $('#test2a').innerHTML = 'Yes';
+          $( "#test2a" ).innerHTML = "Yes";
         },
         onEnd: function ( options ) {
-          $('#test2b').innerHTML = 'Yes';
+          $( "#test2b" ).innerHTML = "Yes";
         }
       })
 
         start: 10,
         end: 14,
         onStart: function( options ) {
-          $('#test3a').innerHTML = 'Yes';
+          $( "#test3a" ).innerHTML = "Yes";
         },
         onFrame: (function() {
           var count = 0;
           return function ( options ) {
-            $('#test3b').innerHTML = 'Yes (count = ' + ++count + ')';
+            $( "#test3b" ).innerHTML = "Yes (count = " + ++count + ")";
           }
         })(),
         onEnd: function ( options ) {
-          $('#test3c').innerHTML = 'Yes';
+          $( "#test3c" ).innerHTML = "Yes";
         }
       })
 
-      .volume(0)
+      .volume( 0 )
       .play();
     }, false);
   </script>
   <h1 id="qunit-header">Popcorn Code Plugin Demo</h1>
   <p>Arbitrary JavaScript functions are run.</p>
   <div>
-    <video id='video'
+    <video id="video"
       autobuffer
       preload="auto"
       controls
-      width= '250px'
+      width= "250px"
       poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
         type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
         type='video/ogg; codecs="theora, vorbis"'>
 
index 98c5d167ea184f3ae61bf79314bfb816ee45c366..214185fb854c654eda2c81d8145efa8e2a6d4b60 100755 (executable)
@@ -1,6 +1,6 @@
 // PLUGIN: Code
 
-(function (Popcorn) {
+(function ( Popcorn ) {
 
   /**
    * Code Popcorn Plug-in
   *
   */
 
-  Popcorn.plugin( 'code' , function(options) {
+  Popcorn.plugin( "code" , function( options ) {
     var running = false;
-  
+
     // Setup a proper frame interval function (60fps), favouring paint events.
-    var step = ( function() {
-    
+    var step = (function() {
+
       var buildFrameRunner = function( runner ) {
         return function( f, options ) {
-    
+
           var _f = function() {
             f();
             if ( running ) {
               runner( _f );
             }
           };
-    
+
           _f();
         };
       };
-    
+
       // Figure out which level of browser support we have for this
       if ( window.webkitRequestAnimationFrame ) {
         return buildFrameRunner( window.webkitRequestAnimationFrame );
       } else {
         return buildFrameRunner( function( f ) {
           window.setTimeout( f, 16 );
-        } );
+        });
       }
-    
-    } )();
 
-    if ( !options.onStart || typeof options.onStart !== 'function' ) {
+    })();
+
+    if ( !options.onStart || typeof options.onStart !== "function" ) {
 
       if ( Popcorn.plugin.debug ) {
-        throw new Error( 'Popcorn Code Plugin Error: onStart must be a function.' );
+        throw new Error( "Popcorn Code Plugin Error: onStart must be a function." );
       }
       options.onStart = Popcorn.nop;
     }
 
-    if ( options.onEnd && typeof options.onEnd !== 'function' ) {
+    if ( options.onEnd && typeof options.onEnd !== "function" ) {
 
       if ( Popcorn.plugin.debug ) {
-        throw new Error( 'Popcorn Code Plugin Error: onEnd  must be a function.' );
+        throw new Error( "Popcorn Code Plugin Error: onEnd  must be a function." );
       }
       options.onEnd = undefined;
     }
 
-    if ( options.onFrame && typeof options.onFrame !== 'function' ) {
+    if ( options.onFrame && typeof options.onFrame !== "function" ) {
 
       if ( Popcorn.plugin.debug ) {
-        throw new Error( 'Popcorn Code Plugin Error: onFrame  must be a function.' );
+        throw new Error( "Popcorn Code Plugin Error: onFrame  must be a function." );
       }
       options.onFrame = undefined;
     }
         }
       }
     };
-  }, 
-  { 
+  },
+  {
     about: {
-      name: 'Popcorn Code Plugin',
-      version: '0.1',
-      author: 'David Humphrey (@humphd)',
-      website: 'http://vocamus.net/dave'
+      name: "Popcorn Code Plugin",
+      version: "0.1",
+      author: "David Humphrey (@humphd)",
+      website: "http://vocamus.net/dave"
     },
     options: {
-      start: {elem:'input', type:'text', label:'In'},
-      end: {elem:'input', type:'text', label:'Out'},
-      onStart: {elem:'input', type:'function', label:'onStart'},
-      onFrame: {elem:'input', type:'function', label:'onFrame'},
-      onEnd: {elem:'input', type:'function', label:'onEnd'}
+      start: {
+       elem: "input",
+       type: "text",
+       label: "In"
+      },
+      end: {
+        elem: "input",
+        type: "text",
+        label: "Out"
+      },
+      onStart: {
+        elem: "input",
+        type: "function",
+        label: "onStart"
+      },
+      onFrame: {
+        elem: "input",
+        type: "function",
+        label: "onFrame"
+      },
+      onEnd: {
+        elem: "input",
+        type: "function",
+        label: "onEnd"
+      }
     }
   });
 })( Popcorn );
index d67e8dc242bf394bceaba5af70c0f1b07a9fdc6b..5c5b7c9cee72d1eb7664680f24776db56af56ff6 100755 (executable)
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
 
-  <video id='video'
+  <video id="video"
     autobuffer
     preload="auto"
     controls
-    width= '250px'
+    width= "250px"
     poster="../../test/poster.png">
 
-    <source id='mp4'
+    <source id="mp4"
       src="../../test/trailer.mp4"
       type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
       type='video/ogg; codecs="theora, vorbis"'>
 
index 1303b049f5903d53744ce08832c2afcd522f3b7e..441074747fc04e479e20299fb8c3fb4abfd88899 100755 (executable)
@@ -1,10 +1,10 @@
-test('Popcorn Code Plugin', function () {
+test( "Popcorn Code Plugin", function () {
 
-  var popped = Popcorn('#video'),
+  var popped = Popcorn( "#video" ),
       expects = 9,
       count = 0,
       frames = 0,
-      codeDiv = document.getElementById('code-div');
+      codeDiv = document.getElementById( "code-div" );
 
   expect( expects );
 
@@ -16,18 +16,18 @@ test('Popcorn Code Plugin', function () {
 
   stop();
 
-  ok('code' in popped, 'code is a method of the popped instance');
+  ok( "code" in popped, "code is a method of the popped instance" );
   plus();
 
-  equals ( codeDiv.innerHTML, '', 'initially, there is nothing inside the code-div' );
+  equals ( codeDiv.innerHTML, "", "initially, there is nothing inside the code-div" );
   plus();
 
   popped.code({
     start: 0,
     end: 2,
     onStart: function( options ) {
-      codeDiv.innerHTML = 'Test 1 - onStart (no onEnd)';
-      ok(true, 'Test 1 onStart was run.');
+      codeDiv.innerHTML = "Test 1 - onStart (no onEnd)";
+      ok( true, "Test 1 onStart was run." );
       plus();
     }
   });
@@ -36,13 +36,13 @@ test('Popcorn Code Plugin', function () {
     start: 2,
     end: 4,
     onStart: function( options ) {
-      codeDiv.innerHTML = 'Test 2 - onStart';
-      ok(true, 'Test 2 onStart was run.');
+      codeDiv.innerHTML = "Test 2 - onStart";
+      ok( true, "Test 2 onStart was run." );
       plus();
     },
     onEnd: function ( options ) {
-      codeDiv.innerHTML = 'Test 2 - onEnd';
-      ok(true, 'Test 2 onEnd was run.');
+      codeDiv.innerHTML = "Test 2 - onEnd";
+      ok( true, "Test 2 onEnd was run." );
       plus();
     }
   });
@@ -51,19 +51,19 @@ test('Popcorn Code Plugin', function () {
     start: 4,
     end: 6,
     onStart: function( options ) {
-      codeDiv.innerHTML = 'Test 3 - onStart [Frames: ';
-      ok(true, 'Test 3 onStart was run.');
+      codeDiv.innerHTML = "Test 3 - onStart [Frames: ";
+      ok( true, "Test 3 onStart was run." );
       plus();
     },
     onFrame: function ( options ) {
-      codeDiv.innerHTML += '.';
+      codeDiv.innerHTML += ".";
       frames++;
     },
     onEnd: function ( options ) {
-      codeDiv.innerHTML += '] Test 3 - onEnd';
-      ok(true, 'Test 3 onEnd was run.');
+      codeDiv.innerHTML += "] Test 3 - onEnd";
+      ok( true, "Test 3 onEnd was run." );
       plus();
-      ok(frames > 1, 'Test 3 onFrames was run.');
+      ok( frames > 1, "Test 3 onFrames was run." );
       plus();
       popped.pause();
     }
@@ -77,10 +77,10 @@ test('Popcorn Code Plugin', function () {
   try {
     popped.code({});
   } catch( e ) {
-    ok(true, 'empty event was caught by debug');
+    ok( true, "empty event was caught by debug" );
     plus();
   }
 
-  popped.volume(0);
+  popped.volume( 0 );
   popped.play();
 });
index 695977fd72a51d2303ed78f7e1712be8524e8880..2098e9680a0820d031ac3c2fcec3dc42969aa3f4 100755 (executable)
@@ -2,59 +2,60 @@
 <html>
 <head>
   <title>Popcorn Facebook Plug-in Demo</title>
-  
+
   <script src="../../popcorn.js"></script>
   <script src="popcorn.facebook.js"></script>
   <script>
-    document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
-      .volume(0)
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video" )
+      .volume( 0 )
       .play()
       .facebook({
-        type        : "live-stream",
-        target      : "activitydiv",
-        start       : 1,
-        end         : 10,
-        event_app_id: 174243249296725 // id is from example http://developers.facebook.com/docs/reference/plugins/live-stream/
-      } )
+        type: "live-stream",
+        target: "activitydiv",
+        start: 1,
+        end: 10,
+        // id is from example http://developers.facebook.com/docs/reference/plugins/live-stream/
+        event_app_id: 174243249296725
+      })
       .facebook({
-        type  : "LIKE",
+        type: "LIKE",
         target: "likediv",
         layout: "box_count",
-        start : 5,
-        end   : 10
-      } )
+        start: 5,
+        end: 10
+      })
       .facebook({
-        type   : "send",
-        target : "likediv",
-        start  : 1,
-        end    : 5
-      } )
+        type: "send",
+        target: "likediv",
+        start: 1,
+        end: 5
+      })
       .facebook({
-        href  : "http://www.facebook.com/senecacollege",
-        type  : "LIKE-BOX",
-        show_faces : "true",
+        href: "http://www.facebook.com/senecacollege",
+        type: "LIKE-BOX",
+        show_faces: "true",
         header: "false",
         target: "likeboxdiv",
-        start : 6,
-        end   : 10
-      } )
+        start: 6,
+        end: 10
+      })
       .facebook({
-        site  : "http://popcornjs.org/",
-        type  : "ACTIVITY",
+        site: "http://popcornjs.org/",
+        type: "ACTIVITY",
         target: "activitydiv",
         header: true,
-        start : 11,
-        end   : 15
-      } )
+        start: 11,
+        end: 15
+      })
       .facebook({
-        href  : "http://www.facebook.com/senecacollege",
-        type  : "FACEPILE",
+        href: "http://www.facebook.com/senecacollege",
+        type: "FACEPILE",
         target: "facepilediv",
-        width : 300,
-        start : 10,
-        end   : 15
-      } );
+        width: 300,
+        start: 10,
+        end: 15
+      });
     }, false);
 
   </script>
   <p>"Like" plugin directly below video. href is the page it's on. "Like box" is below "like". href is set to Seneca College's Facebook page<br/>
   "Facepile" is to the right of the video (must be logged into facebook). href is also set to Seneca College's Facebook page. <br/>
   "Activity feed" is below "Facepile". href is set to popcornjs.org.</p>
-  
+
   <div>
-    <video id='video' 
-      controls preload='none' 
-      width= '350px'
-      poster="../../test/poster.png"> 
+    <video id="video"
+      controls preload="none"
+      width= "350px"
+      poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4; codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg; codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
-    </video> 
+    </video>
   </div>
   <div>
     <div id="likediv"></div>
index 0366ed0da86c6126d37c269e455b21fca55a1947..26737ea130cc57f6f963462a88123cf84aa8ec18 100755 (executable)
@@ -2,7 +2,7 @@
 
 (function(Popcorn, global ) {
 /**
-  * Facebook Popcorn plug-in 
+  * Facebook Popcorn plug-in
   * Places Facebook's "social plugins" inside a div ( http://developers.facebook.com/docs/plugins/ )
   * Sets options according to user input or default values
   * Options parameter will need a target, type, start and end time
@@ -31,7 +31,7 @@
   * Xid - unique identifier if more than one live-streams are on one page
   *
   * @param {Object} options
-  * 
+  *
   * Example:
     var p = Popcorn('#video')
       .facebook({
   }
 
   Popcorn.plugin( "facebook" , {
-    manifest:{
-      about:{
-        name   : "Popcorn Facebook Plugin",
+    manifest: {
+      about: {
+        name: "Popcorn Facebook Plugin",
         version: "0.1",
-        author : "Dan Ventura",
+        author: "Dan Ventura",
         website: "dsventura.blogspot.com"
       },
-      options:{
-        type   : {elem:"select", options:["LIKE", "LIKE-BOX", "ACTIVITY", "FACEPILE", "LIVE-STREAM", "SEND"], label:"Type"},
-        target : "facebook-container",
-        start  : {elem:'input', type:'number', label:'In'},
-        end    : {elem:'input', type:'number', label:'Out'},
+      options: {
+        type: {
+          elem: "select",
+          options: [ "LIKE", "LIKE-BOX", "ACTIVITY", "FACEPILE", "LIVE-STREAM", "SEND" ],
+          label: "Type"
+        },
+        target: "facebook-container",
+        start: {
+          elem: "input",
+          type: "number",
+          label: "In"
+        },
+        end: {
+          elem: "input",
+          type: "number",
+          label: "Out"
+        },
         // optional parameters:
-        font   : {elem:"input", type:"text", label:"font"},        
-        xid    : {elem:"input", type:"text", label:"Xid"},
-        href   : {elem:"input", type:"text", label:"Href"},
-        site   : {elem:"input", type:"text", label:"Site"},
-        height : {elem:"input", type:"text", label:"Height"},
-        width  : {elem:"input", type:"text", label:"Width"},
-        action : {elem:"select", options:["like", "recommend"], label:"Action"},
-        stream : {elem:"select", options:["false", "true"], label:"Stream"},
-        header : {elem:"select", options:["false", "true"], label:"Header"},
-        layout : {elem:"select", options:["standard", "button_count", "box_count"], label:"Layout"},
-        max_rows     : {elem:"input", type:"text", label:"Max_rows"},
-        border_color : {elem:"input", type:"text", label:"Border_color"},
-        event_app_id : {elem:"input", type:"text", label:"Event_app_id"},
-        colorscheme  : {elem:"select", options:["light", "dark"], label:"Colorscheme"},
-        show_faces   : {elem:"select", options:["false", "true"], label:"Showfaces"},
-        recommendations        : {elem:"select", options:["false", "true"], label:"Recommendations"},
-        always_post_to_friends : {elem:"input",  options:["false", "true"], label:"Always_post_to_friends"}
+        font: {
+          elem: "input",
+          type: "text",
+          label: "font"
+        },
+        xid: {
+          elem: "input",
+          type: "text",
+          label: "Xid"
+        },
+        href: {
+          elem: "input",
+          type: "text",
+          label: "Href"
+        },
+        site: {
+          elem: "input",
+          type: "text",
+          label:"Site"
+        },
+        height: {
+          elem: "input",
+          type: "text",
+          label: "Height"
+        },
+        width: {
+          elem: "input",
+          type: "text",
+          label: "Width"
+        },
+        action: {
+          elem: "select",
+          options: [ "like", "recommend" ],
+          label: "Action"
+        },
+        stream: {
+          elem: "select",
+          options: [ "false", "true" ],
+          label: "Stream"
+        },
+        header: {
+          elem: "select",
+          options: [ "false", "true" ],
+          label: "Header"
+        },
+        layout: {
+          elem: "select",
+          options: [ "standard", "button_count", "box_count" ],
+          label: "Layout"
+        },
+        max_rows: {
+          elem: "input",
+          type: "text",
+          label: "Max_rows"
+        },
+        border_color: {
+          elem: "input",
+          type: "text",
+          label: "Border_color"
+        },
+        event_app_id: {
+          elem: "input",
+          type: "text",
+          label: "Event_app_id"
+        },
+        colorscheme: {
+           elem: "select",
+           options: [ "light", "dark" ],
+           label: "Colorscheme"
+        },
+        show_faces: {
+           elem: "select",
+           options: [ "false", "true" ],
+           label: "Showfaces"
+        },
+        recommendations: {
+           elem: "select",
+           options: [ "false", "true" ],
+           label: "Recommendations"
+        },
+        always_post_to_friends: {
+          elem: "input",
+          options: [ "false", "true" ],
+          label: "Always_post_to_friends"
+        }
       }
     },
-    
+
     _setup: function( options ) {
 
       var target = document.getElementById( options.target );
         fbRoot.setAttribute( "id", "fb-root" );
         document.body.appendChild( fbRoot );
       }
-      
+
       if ( !ranOnce || options.event_app_id ) {
         ranOnce = true;
         // initialize facebook JS SDK
-        Popcorn.getScript("http://connect.facebook.net/en_US/all.js");
+        Popcorn.getScript( "http://connect.facebook.net/en_US/all.js" );
 
         global.fbAsyncInit = function() {
           FB.init({
-            appId  : ( options.event_app_id || "" ),
-            status : true,
-            cookie : true,
-            xfbml  : true
+            appId: ( options.event_app_id || "" ),
+            status: true,
+            cookie: true,
+            xfbml: true
           });
         };
       }
 
       options._container = document.createElement( "fb:" + options.type );
 
-
       var setOptions = (function( options ) {
 
         options._container.style.display = "none";
   });
 
 })( Popcorn, this );
-
index 73bd17b745639be55ea886026af18b41a23a1881..ec90985c460279fa3b13e90f6cb0cf764fd5e3d6 100755 (executable)
@@ -4,13 +4,11 @@
   <title>Popcorn Facebook Plug-in Test</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
   <script src="../../popcorn.js"></script>
-  
   <script src="popcorn.facebook.js"></script>
   <script src="popcorn.facebook.unit.js"></script>
 </head>
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
+
   <div style="position:absolute;left:300px;">
     <div id="facepilediv"></div>
     <div id="activitydiv"></div>
   </div>
-  <video id='video' 
-    controls preload='none' 
-    width= '250px'
-    poster="../../test/poster.png"> 
+  <video id="video"
+    controls preload="none"
+    width= "250px"
+    poster="../../test/poster.png">
 
-    <source id='mp4'
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
-  </video> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
+  </video>
   <div>
     <div id="likediv"></div>
     <div id="likeboxdiv"></div>
   </div>
 </body>
 </html>
-
index 84fd5845fe98207b65b2350ae19dd8a4b95558fd..bc36a27e3cca32caf60b10527c9569cd91178a23 100755 (executable)
@@ -1,6 +1,6 @@
-test("Popcorn Facebook Plugin", function () {
-  
-  var popped = Popcorn("#video"),
+test( "Popcorn Facebook Plugin", function () {
+
+  var popped = Popcorn( "#video" ),
       expects = 9,
       count = 0,
       interval,
@@ -8,80 +8,79 @@ test("Popcorn Facebook Plugin", function () {
       interval3,
       interval4,
       subtitlediv;
-  
-  expect(expects);
-  
+
+  expect( expects );
+
   function plus() {
-    if ( ++count===expects) {
+    if ( ++count===expects ) {
       start();
     }
   }
-  
+
   stop();
-   
-  ok ('facebook' in popped, "facebook is a method of the popped instance");
+
+  ok ( "facebook" in popped, "facebook is a method of the popped instance" );
   plus();
 
   popped.facebook({
         target: "likediv",
-        start : 1,
-        end   : 6
-      } )
+        start: 1,
+        end: 6
+      })
       .facebook({
-        href  : "http://www.facebook.com/senecacollege",
-        type  : "LIKE_BOX",
+        href: "http://www.facebook.com/senecacollege",
+        type: "LIKE_BOX",
         target: "likeboxdiv",
-        start : 2,
-        end   : 6
-      } )
+        start: 2,
+        end: 6
+      })
       .facebook({
-        site   : "http://popcornjs.org/",
-        type   : "ACTIVITY",
-        target : "activitydiv",
-        start  : 3,
-        end    : 6
-      } )
+        site: "http://popcornjs.org/",
+        type: "ACTIVITY",
+        target: "activitydiv",
+        start: 3,
+        end: 6
+      })
       .facebook({
-        href   : "http://www.facebook.com/senecacollege",
-        type   : "FACEPILE",
-        target : "facepilediv",
-        start  : 4,
-        end    : 6,
-        width  : 300
-      } )
-    .volume(0)
+        href: "http://www.facebook.com/senecacollege",
+        type: "FACEPILE",
+        target: "facepilediv",
+        start: 4,
+        end: 6,
+        width: 300
+      })
+    .volume( 0 )
     .play();
-    
-  ok (document.getElementById('likediv'), "likediv exists on the page" );
+
+  ok ( document.getElementById( "likediv" ), "likediv exists on the page" );
   plus();
-  ok (document.getElementById('likeboxdiv'), "likeboxdiv exists on the page" );
+  ok ( document.getElementById( "likeboxdiv" ), "likeboxdiv exists on the page" );
   plus();
-  ok (document.getElementById('activitydiv'), "activitydiv exists on the page" );
+  ok ( document.getElementById( "activitydiv" ), "activitydiv exists on the page" );
   plus();
-  ok (document.getElementById('facepilediv'), "facepilediv exists on the page" );
+  ok ( document.getElementById( "facepilediv" ), "facepilediv exists on the page" );
   plus();
-  
+
   // I inspected the html genterated by facebook, and found that there are no uniquely identifying attributes between plug-in types
   // so right now, we just check ot make sure that facebook is returning a plugin and displaying it at the correct time.
-  
+
   popped.exec( 2, function() {
     ok ( document.getElementById( "likediv" ).innerHTML, "likediv is not empty at 0:02 (expected)" );
     plus();
   });
-  
+
   popped.exec( 3, function() {
     ok ( document.getElementById( "likeboxdiv" ).innerHTML, "likeboxdiv is not empty at 0:03 (expected)" );
     plus();
   });
-  
+
   popped.exec( 4, function() {
     ok ( document.getElementById( "activitydiv" ).innerHTML, "Activitydiv is not empty at 0:04 (expected)" );
     plus();
   });
-  
+
   popped.exec( 5, function() {
     ok ( document.getElementById( "facepilediv" ).innerHTML, "Facepilediv is not empty at 0:05 (expected)" );
     plus();
   });
 });
-
index c71e0387e76e4bce33391e0b7e27e01b62ca6315..50d3ee69df28095932f37c8221e82e058708523d 100755 (executable)
 
       <source id="mp4"
         src="../../test/trailer.mp4"
-        type="video/mp4; codecs='avc1, mp4a'">
+        type='video/mp4; codecs="avc1, mp4a"'>
 
       <source id="ogv"
         src="../../test/trailer.ogv"
-        type="video/ogg; codecs='theora, vorbis'">
+        type='video/ogg; codecs="theora, vorbis"'>
 
       <p>Your user agent does not support the HTML5 Video element.</p>
 
index f810b60009b3c6f5005b18c41cd576b37803e5d3..dd98cdcb18d79d2beb04cf5bad9136746e6112b7 100755 (executable)
 
     <source id="mp4"
       src="../../test/trailer.mp4"
-      type="video/mp4; codecs='avc1, mp4a'">
+      type='video/mp4; codecs="avc1, mp4a"'>
 
     <source id="ogv"
       src="../../test/trailer.ogv"
-      type="video/ogg; codecs='theora, vorbis'">
+      type='video/ogg; codecs="theora, vorbis"'>
 
     <p>Your user agent does not support the HTML5 Video element.</p>
 
index 8d4f4736b3ff4156e54f0884205c3aaf45838045..c2267caa5bace5019fef9920d3e6f8654868d714 100755 (executable)
@@ -2,25 +2,25 @@
 <html>
 <head>
   <title>Popcorn footnote Plug-in Demo</title>
-  
+
   <script src="../../popcorn.js"></script>
   <script src="popcorn.footnote.js"></script>
   <script>
     document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
-      .play() 
+      var p = Popcorn( "#video" )
+      .play()
       .footnote({
-        start: 5, // seconds
-        end: 15, // seconds
-        text: 'This video made exclusively for drumbeat.org',
-        target: 'footnotediv'
-      } )
+        start: 5,
+        end: 15,
+        text: "This video made exclusively for drumbeat.org",
+        target: "footnotediv"
+      })
       .footnote({
-        start: 20, // seconds
-        end: 45, // seconds
-        text: 'Visit webmademovies.org for more details',
-        target: 'footnotediv'
-      } )
+        start: 20,
+        end: 45,
+        text: "Visit webmademovies.org for more details",
+        target: "footnotediv"
+      })
 
     }, false);
 
   <p> A footnote displaying This video made exclusively for drumbeat.org' will appear at 5 seconds and disappear at 15 seconds.</p>
   <p> A footnote displaying 'Visit webmademovies.org for more details' will appear at 20 seconds and disappear at 45 seconds.</p>
   <div>
-    <video id='video' 
-      controls preload='none' 
-      width= '250px'
-      poster="../../test/poster.png"> 
+    <video id="video"
+      controls preload="none"
+      width="250px"
+      poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4; codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg; codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
-    </video> 
+    </video>
   </div>
   <div id="footnotediv" width="50%" height="50%">
   </div>
index 2f4781c2e42dfc944cf18fc56a1ef0f2457c0a5c..5b76aaab42ee9a3904dc11459425411ebc0e24fb 100755 (executable)
@@ -1,6 +1,6 @@
 // PLUGIN: Footnote/Text
 
-(function (Popcorn) {
+(function ( Popcorn ) {
 
   /**
    * Footnote popcorn plug-in
           website: "annasob.wordpress.com"
         },
         options: {
-          start: { elem: "input", type: "text", label: "In" },
-          end: { elem: "input", type: "text", label: "Out" },
-          text: { elem: "input", type: "text", label: "Text" },
+          start: {
+            elem: "input",
+            type: "text",
+            label: "In"
+          },
+          end: {
+            elem: "input",
+            type: "text",
+            label: "Out"
+          },
+          text: {
+            elem: "input",
+            type: "text",
+            label: "Text"
+          },
           target: name + "-container"
         }
       },
-    _setup: function(options) {
+    _setup: function( options ) {
 
       var target = document.getElementById( options.target );
 
-      options._container = document.createElement( 'div' );
+      options._container = document.createElement( "div" );
       options._container.style.display = "none";
       options._container.innerHTML  = options.text;
 
       target && target.appendChild( options._container );
     },
     /**
-     * @member footnote 
-     * The start function will be executed when the currentTime 
-     * of the video  reaches the start time provided by the 
+     * @member footnote
+     * The start function will be executed when the currentTime
+     * of the video  reaches the start time provided by the
      * options variable
      */
-    start: function(event, options){
+    start: function( event, options ){
       options._container.style.display = "inline";
     },
     /**
-     * @member footnote 
-     * The end function will be executed when the currentTime 
-     * of the video  reaches the end time provided by the 
+     * @member footnote
+     * The end function will be executed when the currentTime
+     * of the video  reaches the end time provided by the
      * options variable
      */
-    end: function(event, options){
+    end: function( event, options ){
       options._container.style.display = "none";
     },
     _teardown: function( options ) {
index ba39a85ffc64ee0aee84730f85c1051011cdf274..e42d2ff1c2378852851fc6b88fdea8affe7d9de4 100755 (executable)
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
 
-  <video id='video'
-    controls preload='none'
-    width= '250px'
+  <video id="video"
+    controls preload="none"
+    width="250px"
     poster="../../test/poster.png">
 
-    <source id='mp4'
+    <source id="mp4"
       src="../../test/trailer.mp4"
       type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
       type='video/ogg; codecs="theora, vorbis"'>
 
index dbdf83f16a850aa3b417da0f0240201ce39662f6..d54cd717b115301d09dbf023cd5d5b6baa11633e 100755 (executable)
@@ -1,12 +1,12 @@
-test("Popcorn Footnote Plugin", function () {
+test( "Popcorn Footnote Plugin", function () {
 
-  var popped = Popcorn("#video"),
+  var popped = Popcorn( "#video" ),
       expects = 8,
       count = 0,
       setupId,
-      footnotediv = document.getElementById("footnotediv");
+      footnotediv = document.getElementById( "footnotediv" );
 
-  expect(expects);
+  expect( expects );
 
   function plus() {
     if ( ++count===expects) {
@@ -16,21 +16,21 @@ test("Popcorn Footnote Plugin", function () {
 
   stop();
 
-  ok ("footnote" in popped, "footnote is a mehtod of the popped instance");
+  ok ( "footnote" in popped, "footnote is a mehtod of the popped instance" );
   plus();
 
   equals ( footnotediv.childElementCount, 0, "initially, there is nothing inside the footnotediv" );
   plus();
 
   popped.footnote({
-    start: 0, // seconds
-    end: 2, // seconds
+    start: 0,
+    end: 2,
     text: "This video made exclusively for drumbeat.org",
     target: "footnotediv"
   })
   .footnote({
-    start: 2, // seconds
-    end: 4, // seconds
+    start: 2,
+    end: 4,
     text: "Visit webmademovies.org for more details",
     target: "footnotediv"
   });
@@ -40,42 +40,42 @@ test("Popcorn Footnote Plugin", function () {
   popped.exec( 0, function() {
     equals ( footnotediv.childElementCount, 2, "footnotediv now has two inner elements" );
     plus();
-    equals (footnotediv.children[0].innerHTML , "This video made exclusively for drumbeat.org", "footnote displaing correct information" );
+    equals ( footnotediv.children[ 0 ].innerHTML , "This video made exclusively for drumbeat.org", "footnote displaing correct information" );
     plus();
-    equals (footnotediv.children[0].style.display , "inline", "footnote is visible on the page" );
+    equals ( footnotediv.children[ 0 ].style.display , "inline", "footnote is visible on the page" );
     plus();
   });
 
   popped.exec( 3, function() {
-    equals (footnotediv.children[1].style.display , "inline", "second footnote is visible on the page" );
+    equals ( footnotediv.children[ 1 ].style.display , "inline", "second footnote is visible on the page" );
     plus();
   });
 
   popped.exec( 4, function() {
-    ok (footnotediv.children[1].style.display === 'none' &&  footnotediv.children[0].style.display === 'none', "footnote are no longer vidible on the page" );
+    ok ( footnotediv.children[ 1 ].style.display === "none" &&  footnotediv.children[0].style.display === 'none', "footnote are no longer vidible on the page" );
     plus();
 
     popped.pause().removeTrackEvent( setupId );
-    ok( !footnotediv.children[1], "removed footnote was properly destroyed"  );
+    ok( !footnotediv.children[ 1 ], "removed footnote was properly destroyed" );
     plus();
   });
-  popped.play().volume(0);
+  popped.play().volume( 0 );
 
 });
 
 
-test("Popcorn Text Plugin", function () {
+test( "Popcorn Text Plugin", function () {
 
-  var popped = Popcorn("#video"),
+  var popped = Popcorn( "#video" ),
       expects = 2,
       count = 0,
       setupId,
       textdiv = document.getElementById( "textdiv" );
 
-  expect(expects);
+  expect( expects );
 
   function plus() {
-    if ( ++count===expects) {
+    if ( ++count===expects ) {
       start();
     }
   }
@@ -84,8 +84,8 @@ test("Popcorn Text Plugin", function () {
   plus();
 
   popped.text({
-    start: 0, // seconds
-    end: 3, // seconds
+    start: 0,
+    end: 3,
     text: "I am an alias",
     target: "textdiv"
   });
@@ -94,8 +94,8 @@ test("Popcorn Text Plugin", function () {
 
   popped.exec( 2, function() {
 
-    equal( textdiv.children[0].innerHTML , "I am an alias", "I am an alias set by Popcorn.p.text" );
+    equal( textdiv.children[ 0 ].innerHTML , "I am an alias", "I am an alias set by Popcorn.p.text" );
     plus();
 
-  }).currentTime(1).play();
+  }).currentTime( 1 ).play();
 });
index 9d46f7335cf1d2527a17dd9ba99c2137bdd331fa..d3b9f1d83de2e8c52b2de6370bda3aee46a7a73b 100755 (executable)
@@ -2,35 +2,33 @@
 <html>
 <head>
   <title>Popcorn Grafiti Markup Language Plug-in Demo</title>
-  
   <script src="../../popcorn.js"></script>
   <script src="popcorn.gml.js"></script>
   <script>
-    document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
-      .play() 
-      .volume(0)
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video" )
+      .play()
+      .volume( 0 )
       .gml({
-        start: 0, // seconds
-        end: 5, // seconds
-        gmltag: '29582',
-        target: 'gmldiv'
+        start: 0,
+        end: 5,
+        gmltag: "29582",
+        target: "gmldiv"
       })
       .gml({
-        start: 10, // seconds
-        end: 20, // seconds
-        gmltag: '155',
-        target: 'gmldiv'
+        start: 10,
+        end: 20,
+        gmltag: "155",
+        target: "gmldiv"
       })
       .gml({
-        start: 20, // seconds
-        end: 40, // seconds
-        gmltag: '161',
-        target: 'gmldiv'
+        start: 20,
+        end: 40,
+        gmltag: "161",
+        target: "gmldiv"
       });
-
     }, false);
-      
+
   </script>
 </head>
 <body>
   <p> A Processing canvas displaying the GML tag <a href="http://000000book.com/data/155">155</a> will appear at 10-20 seconds.</p>
   <p> A Processing canvas displaying the GML tag <a href="http://000000book.com/data/161">161</a> will appear at 20-40 seconds.</p>
   <div>
-    <video id='video' 
-      controls preload='none' 
-      width= '250px'
-      poster="../../test/poster.png"> 
+    <video id="video"
+      controls preload="none"
+      width= "250px"
+      poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4; codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg; codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
-    </video> 
+    </video>
   </div>
   <div id="gmldiv"></div>
 </body>
index 17cf12f4ea0d79ed763d585af3093eb30f6e0aa8..daa8c5543712812f150d83bf1167e898f63dee9d 100755 (executable)
@@ -1,11 +1,11 @@
 // PLUGIN: GML
 
-(function (Popcorn) {
+(function ( Popcorn ) {
 
   var gmlPlayer = function( $p ) {
 
         var _stroke = 0,
-            onPt = 0, 
+            onPt = 0,
             onStroke = 0,
             x = null,
             y = null,
@@ -94,9 +94,9 @@
               var tag = data.gml.tag,
                   app_name =  tag.header && tag.header.client && tag.header.client.name;
 
-              rotation = app_name === 'Graffiti Analysis 2.0: DustTag' ||
-                         app_name === 'DustTag: Graffiti Analysis 2.0' ||
-                         app_name === 'Fat Tag - Katsu Edition';
+              rotation = app_name === "Graffiti Analysis 2.0: DustTag" ||
+                         app_name === "DustTag: Graffiti Analysis 2.0" ||
+                         app_name === "Fat Tag - Katsu Edition";
 
               play = function() {
 
           dataReady();
         };
       };
-  
+
   /**
-   * Grafiti markup Language (GML) popcorn plug-in 
+   * Grafiti markup Language (GML) popcorn plug-in
    * Renders a GML tag inside an HTML element
    * Options parameter will need a mandatory start, end, target, gmltag.
    * Optional parameters: none.
    * 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 
+   * End is the time that you want this plug-in to stop executing
    * Target is the id of the document element that you wish to render the grafiti in
    * gmltag is the numerical reference to a gml tag via 000000book.com
    * @param {Object} options
-   * 
+   *
    * Example:
      var p = Popcorn('#video')
        .gml({
 
       var self = this,
           target = document.getElementById( options.target );
-      
+
       options.endDrawing = options.endDrawing || options.end;
 
       // create a canvas to put in the target div
       readyCheck();
     },
     /**
-     * @member gml 
-     * The start function will be executed when the currentTime 
-     * of the video  reaches the start time provided by the 
+     * @member gml
+     * The start function will be executed when the currentTime
+     * of the video  reaches the start time provided by the
      * options variable
      */
     start: function( event, options ) {
       options.container.style.display = "block";
     },
     /**
-     * @member gml 
-     * The end function will be executed when the currentTime 
-     * of the video  reaches the end time provided by the 
+     * @member gml
+     * The end function will be executed when the currentTime
+     * of the video  reaches the end time provided by the
      * options variable
      */
     end: function( event, options ) {
index c0761c53d93736e7d9cd8eff2da26e8953ebf4a8..d16eab85314b3a60ae6f328a7603bddee4ff06db 100755 (executable)
@@ -4,14 +4,12 @@
   <title>Popcorn GML Plugin</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
   <script src="../../popcorn.js"></script>
   <script src="popcorn.gml.js"></script>
-
   <script src="popcorn.gml.unit.js"></script>
 </head>
 <body>
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
-    controls preload='none' 
-    width= '250px'
-    poster="../../test/poster.png"> 
 
-    <source id='mp4'
+  <video id="video"
+    controls preload="none"
+    width= "250px"
+    poster="../../test/poster.png">
+
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
-  <div id="gmldiv"></div>  
+  </video>
+  <div id="gmldiv"></div>
 </body>
 </html>
index da2537537b006cd05c8ea698ffe224946e84ec61..48d9ad238229d9a8301f6a4e0a208eace2189ef7 100755 (executable)
@@ -1,56 +1,56 @@
-test("Popcorn GML Plugin", function () {
-  
-  var popped = Popcorn("#video"),
-      expects = 8, 
+test( "Popcorn GML Plugin", function () {
+
+  var popped = Popcorn( "#video" ),
+      expects = 8,
       count = 0,
       setupId,
-      gmldiv = document.getElementById('gmldiv');
+      gmldiv = document.getElementById( "gmldiv" );
+
+  expect( expects );
 
-  expect(expects);
-  
   function plus() {
-    if ( ++count===expects) {
+    if ( ++count===expects ) {
       start();
     }
   }
-  
+
   stop( 10000 );
-   
-  ok ('gml' in popped, "gml is a method of the popped instance");
+
+  ok ( "gml" in popped, "gml is a method of the popped instance" );
   plus();
-  
+
   equals ( gmldiv.childElementCount, 0, "initially, there is nothing inside the gmldiv" );
   plus();
-  
+
   popped.gml({
-    start: 0, // seconds
-    end: 2, // seconds
-    gmltag: '29582',
-    target: 'gmldiv'
+    start: 0,
+    end: 2,
+    gmltag: "29582",
+    target: "gmldiv"
   })
   .gml({
-    start: 2, // seconds
-    end: 4, // seconds
-    gmltag: '155',
-    target: 'gmldiv'
+    start: 2,
+    end: 4,
+    gmltag: "155",
+    target: "gmldiv"
   }).volume( 0 );
 
   setupId = popped.getLastTrackEventId();
 
   popped.exec( 0, function() {
-    equals( gmldiv.children[0].style.display , "block", "first GML is visible on the page" );
+    equals( gmldiv.children[ 0 ].style.display , "block", "first GML is visible on the page" );
     plus();
   });
-  
+
   popped.exec( 3, function() {
-    equals( gmldiv.children[1].style.display , "block", "second GML is visible on the page" );
+    equals( gmldiv.children[ 1 ].style.display , "block", "second GML is visible on the page" );
     plus();
   });
-  
+
   popped.exec( 4, function() {
-    equals( gmldiv.children[1].style.display , "none", "second GML is no longer visible on the page" );
+    equals( gmldiv.children[ 1 ].style.display , "none", "second GML is no longer visible on the page" );
     plus();
-    equals( gmldiv.children[0].style.display , "none", "first GML is no longer visible on the page" );
+    equals( gmldiv.children[ 0 ].style.display , "none", "first GML is no longer visible on the page" );
     plus();
 
     popped.pause().removeTrackEvent( setupId );
@@ -58,10 +58,10 @@ test("Popcorn GML Plugin", function () {
     ok( !Processing.getInstanceById( "canvas155" ), "Processing insteance was properly destroyed"  );
     plus();
 
-    ok( !gmldiv.children[1], "canvas element was properly removed"  );
+    ok( !gmldiv.children[ 1 ], "canvas element was properly removed"  );
     plus();
   });
-  
+
   popped.play();
 
 });
diff --git a/plugins/googlefeed/.swp b/plugins/googlefeed/.swp
new file mode 100644 (file)
index 0000000..d3b0a86
Binary files /dev/null and b/plugins/googlefeed/.swp differ
index e426303f867a1c50a00710cf05dde37c183d40bc..f3bb0b9129d96c8776d986dcc88f78df3f989056 100755 (executable)
 
       <source id="mp4"
         src="../../test/trailer.mp4"
-        type="video/mp4; codecs='avc1, mp4a'">
+        type='video/mp4; codecs="avc1, mp4a"'>
 
       <source id="ogv"
         src="../../test/trailer.ogv"
-        type="video/ogg; codecs='theora, vorbis'">
+        type='video/ogg; codecs="theora, vorbis"'>
 
       <p>Your user agent does not support the HTML5 Video element.</p>
 
index 59e2029c35894f135284431d861b68cb702d7489..2f63a8a7b946b2be055de07b4f0374008ca9d8dc 100755 (executable)
 
     <source id="mp4"
       src="../../test/trailer.mp4"
-      type="video/mp4; codecs='avc1, mp4a'">
+      type='video/mp4; codecs="avc1, mp4a"'>
 
     <source id="ogv"
       src="../../test/trailer.ogv"
-      type="video/ogg; codecs='theora, vorbis'">
+      type='video/ogg; codecs="theora, vorbis"'>
 
     <p>Your user agent does not support the HTML5 Video element.</p>
 
index d0cac6429c181c08213a1f3f0680eaf8ea4c4f1e..a14b6f17d8d430f1723b25465ba3ebb3ebb03c52 100755 (executable)
@@ -6,22 +6,22 @@
   <script src="../../popcorn.js"></script>
   <script src="popcorn.googlemap.js"></script>
   <script type="text/javascript">
-    document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
-      .volume(0)
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video" )
+      .volume( 0 )
       .play()
       .googlemap({
-        start: 0, // seconds
-        end: 20, // seconds
+        start: 0,
+        end: 20,
         type: "ROADMAP",
         target: "map",
         lat: 43.665429,
         lng: -79.403323,
         zoom: "10"
-      } )
+      })
       .googlemap({
-        start: 0, // seconds
-        end: 40, // seconds
+        start: 0,
+        end: 40,
         type: "STREETVIEW",
         target: "map3",
         location: "6th Line, Oakville, Ontario",
@@ -34,8 +34,8 @@
                                tween: "York university"
       })
       .googlemap({
-        start: 0, // seconds
-        end: 40, // seconds
+        start: 0,
+        end: 40,
         type: "STREETVIEW",
         target: "map5",
         location: "Buffallo",
@@ -48,8 +48,8 @@
                                tween: "Ottawa"
       })
       .googlemap({
-        start: 0, // seconds
-        end: 20, // seconds
+        start: 0,
+        end: 20,
         type: "STREETVIEW",
         target: "map4",
         lat: 35.7795324,
         zoom: "1",
         heading: "180",
         pitch: "1",
-        tween:[ 
+        tween: [
+          {
+            position: {
+              lat: 35.778056,
+              lng: -78.63903579999999
+            },
+            pov: {
+              heading: 183.5,
+              zoom: 1,
+              pitch: 1
+            },
+            interval: 2000
+          },
           {
-            position: {lat: 35.778056, lng: -78.63903579999999}, 
-            pov: {heading: 183.5, zoom: 1, pitch:1}, 
-            interval:2000 
+            position: {
+              lat: 35.7770258,
+              lng: -78.63929150000001
+            },
+            pov: {
+              heading: 180,
+              zoom: 1,
+              pitch: 1
+            },
+            interval: 2000
           },
-          {    
-            position: {lat: 35.7770258, lng: -78.63929150000001}, 
-            pov: {heading: 180, zoom: 1, pitch:1},
-            interval:2000
+          {
+            position: {
+              lat: 35.775581,
+              lng: -78.639395
+            },
+            pov: {
+              heading: 180,
+              zoom: 1,
+              pitch: 1
+            },
+            interval: 2000
           },
-          {    
-            position: {lat: 35.775581, lng: -78.639395}, 
-            pov: {heading: 180, zoom: 1, pitch:1},
-            interval:2000
-          }, 
-          {    
-            position: {lat: 35.775581, lng: -78.639395}, 
-            pov: {heading: 105, zoom: 1, pitch:1},
-            interval:2000
+          {
+            position: {
+              lat: 35.775581,
+              lng: -78.639395
+            },
+            pov: {
+              heading: 105,
+              zoom: 1,
+              pitch: 1
+            },
+            interval: 2000
           },
-          {    
-            position: {lat: 35.775581, lng: -78.639395}, 
-               pov: {heading: 0, zoom: 1, pitch:1},
-               interval:2000
-          }    
+          {
+            position: {
+              lat: 35.775581,
+              lng: -78.639395
+            },
+            pov: {
+              heading: 0,
+              zoom: 1,
+              pitch: 1
+            },
+               interval: 2000
+          }
         ]
-      } )
+      })
       .googlemap({
-        start: 0, // seconds
-        end: 30, // seconds
+        start: 0,
+        end: 30,
         type: "ROADMAP",
         target: "map2",
         location:"boston",
         zoom: 15
-      } )
+      })
       .googlemap({
-        start: 0, // seconds
-        end: 20, // seconds
+        start: 0,
+        end: 20,
         type: "STREETVIEW",
         target: "map1",
         lat: 43.665429,
         zoom: "1",
         heading: "0",
         pitch: "1"
-      } );
+      });
     }, false);
   </script>
 </head>
   <p> A Google Map Streetview tweening from Buffallo to Ottawa  will appear at 0 seconds and disaapear at 40 seconds</p>
   <div>
 
-    <video id='video'
+    <video id="video"
       controls
-      width= '250px'
+      width= "250px"
       poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
         type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
         type='video/ogg; codecs="theora, vorbis"'>
 
index 56b12ee71c955c8f149725de68b2dd9c84146f8f..358bc6503cedb9f49aa21436c2f5c012a738a1ee 100755 (executable)
@@ -1,31 +1,31 @@
 
 // PLUGIN: Google Maps
 var googleCallback;
-(function (Popcorn) {
+(function ( Popcorn ) {
 
   var i = 1,
     _mapFired = false,
     _mapLoaded = false,
     geocoder, loadMaps;
-  //google api callback 
-  googleCallback = function (data) {
-    // ensure all of the maps functions needed are loaded 
+  //google api callback
+  googleCallback = function ( data ) {
+    // ensure all of the maps functions needed are loaded
     // before setting _maploaded to true
-    if (typeof google !== "undefined" && google.maps && google.maps.Geocoder && google.maps.LatLng) {
+    if ( typeof google !== "undefined" && google.maps && google.maps.Geocoder && google.maps.LatLng ) {
       geocoder = new google.maps.Geocoder();
       _mapLoaded = true;
     } else {
       setTimeout(function () {
-        googleCallback(data);
+        googleCallback( data );
       }, 1);
     }
   };
   // function that loads the google api
   loadMaps = function () {
     // for some reason the Google Map API adds content to the body
-    if (document.body) {
+    if ( document.body ) {
       _mapFired = true;
-      Popcorn.getScript("http://maps.google.com/maps/api/js?sensor=false&callback=googleCallback");
+      Popcorn.getScript( "http://maps.google.com/maps/api/js?sensor=false&callback=googleCallback" );
     } else {
       setTimeout(function () {
         loadMaps();
@@ -75,19 +75,19 @@ var googleCallback;
    } )
    *
    */
-  Popcorn.plugin("googlemap", function (options) {
+  Popcorn.plugin( "googlemap", function ( options ) {
     var newdiv, map, location,
         target = document.getElementById( options.target );
 
     // if this is the firest time running the plugins
     // call the function that gets the sctipt
-    if (!_mapFired) {
+    if ( !_mapFired ) {
       loadMaps();
     }
 
     // create a new div this way anything in the target div is left intact
     // this is later passed on to the maps api
-    newdiv = document.createElement("div");
+    newdiv = document.createElement( "div" );
     newdiv.id = "actualmap" + i;
     newdiv.style.width = "100%";
     newdiv.style.height = "100%";
@@ -102,26 +102,26 @@ var googleCallback;
     // ensure that google maps and its functions are loaded
     // before setting up the map parameters
     var isMapReady = function () {
-      if (_mapLoaded) {
-        if (options.location) {
+      if ( _mapLoaded ) {
+        if ( options.location ) {
           // calls an anonymous google function called on separate thread
           geocoder.geocode({
             "address": options.location
-          }, function (results, status) {
-            if (status === google.maps.GeocoderStatus.OK) {
-              options.lat = results[0].geometry.location.lat();
-              options.lng = results[0].geometry.location.lng();
-              location = new google.maps.LatLng(options.lat, options.lng);
-              map = new google.maps.Map(newdiv, {
-                mapTypeId: google.maps.MapTypeId[options.type] || google.maps.MapTypeId.HYBRID
+          }, function ( results, status ) {
+            if ( status === google.maps.GeocoderStatus.OK ) {
+              options.lat = results[ 0 ].geometry.location.lat();
+              options.lng = results[ 0 ].geometry.location.lng();
+              location = new google.maps.LatLng( options.lat, options.lng );
+              map = new google.maps.Map( newdiv, {
+                mapTypeId: google.maps.MapTypeId[ options.type ] || google.maps.MapTypeId.HYBRID
               });
               map.getDiv().style.display = "none";
             }
           });
         } else {
-          location = new google.maps.LatLng(options.lat, options.lng);
-          map = new google.maps.Map(newdiv, {
-            mapTypeId: google.maps.MapTypeId[options.type] || google.maps.MapTypeId.HYBRID
+          location = new google.maps.LatLng( options.lat, options.lng );
+          map = new google.maps.Map( newdiv, {
+            mapTypeId: google.maps.MapTypeId[ options.type ] || google.maps.MapTypeId.HYBRID
           });
           map.getDiv().style.display = "none";
         }
@@ -150,7 +150,7 @@ var googleCallback;
           if ( map ) {
             map.getDiv().style.display = "block";
             // reset the location and zoom just in case the user plaid with the map
-            google.maps.event.trigger(map, 'resize');
+            google.maps.event.trigger( map, "resize" );
             map.setCenter( location );
 
             // make sure options.zoom is a number
@@ -171,8 +171,6 @@ var googleCallback;
               options.pitch = +options.pitch;
             }
 
-                                               
-
             if ( options.type === "STREETVIEW" ) {
               // Switch this map into streeview mode
               map.setStreetView(
@@ -187,7 +185,7 @@ var googleCallback;
                   }
                 })
               );
-  
+
               //  Function to handle tweening using a set timeout
               var tween = function( rM, t ) {
 
@@ -195,7 +193,7 @@ var googleCallback;
                 setTimeout(function() {
 
                   var current_time = that.media.currentTime;
-    
+
                   //  Checks whether this is a generated route or not
                   if ( typeof options.tween === "object" ) {
 
@@ -234,16 +232,16 @@ var googleCallback;
                           heading: computeHeading( rM[ k ], rM[ k + 1 ] ) || 0,
                           zoom: options.zoom,
                           pitch: options.pitch || 0
-                        }); 
+                        });
                         sView2.setPosition( checkpoints[ k ] );
                       }
                     }
 
                     tween( checkpoints, options.interval );
-                  }   
+                  }
                 }, t );
               };
-              
+
               //  Determines if we should use hardcoded values ( using options.tween ),
               //  or if we should use a start and end location and let google generate
               //  the route for us
@@ -252,7 +250,7 @@ var googleCallback;
               //  Creating another variable to hold the streetview map for tweening,
               //  Doing this because if there was more then one streetview map, the tweening would sometimes appear in other maps
               var sView2 = sView;
-                
+
                 //  Create an array to store all the lat/lang values along our route
                 var checkpoints = [];
 
@@ -280,13 +278,13 @@ var googleCallback;
                 });
 
                 var showSteps = function ( directionResult, that ) {
-                
+
                   //  Push new google map lat and lng values into an array from our list of lat and lng values
                   var routes = directionResult.routes[ 0 ].overview_path;
                   for ( var j = 0, k = routes.length; j < k; j++ ) {
                     checkpoints.push( new google.maps.LatLng( routes[ j ].lat(), routes[ j ].lng() ) );
-                  }   
-                  
+                  }
+
                   //  Check to make sure the interval exists, if not, set to a default of 1000
                   options.interval = options.interval || 1000;
                   tween( checkpoints, 10 );
@@ -298,7 +296,7 @@ var googleCallback;
                 var sView3 = sView;
 
                 for ( var i = 0, l = options.tween.length; i < l; i++ ) {
-                 
+
                   //  Make sure interval exists, if not, set to 1000
                   options.tween[ i ].interval = options.tween[ i ].interval || 1000;
                   tween( options.tween, 10 );
@@ -319,19 +317,19 @@ var googleCallback;
        * of the video reaches the end time provided by the
        * options variable
        */
-      end: function (event, options) {
+      end: function ( event, options ) {
         // if the map exists hide it do not delete the map just in
         // case the user seeks back to time b/w start and end
-        if (map) {
+        if ( map ) {
           map.getDiv().style.display = "none";
         }
       },
-      _teardown: function (options) {
+      _teardown: function ( options ) {
 
-        var target = document.getElementById(options.target);
+        var target = document.getElementById( options.target );
 
         // the map must be manually removed
-        target && target.removeChild(newdiv);
+        target && target.removeChild( newdiv );
         newdiv = map = location = null;
       }
     };
@@ -356,7 +354,7 @@ var googleCallback;
       target: "map-container",
       type: {
         elem: "select",
-        options: ["ROADMAP", "SATELLITE", "STREETVIEW", "HYBRID", "TERRAIN"],
+        options: [ "ROADMAP", "SATELLITE", "STREETVIEW", "HYBRID", "TERRAIN" ],
         label: "Type"
       },
       zoom: {
@@ -391,5 +389,5 @@ var googleCallback;
       }
     }
   });
-})(Popcorn);
+})( Popcorn );
 
index e37ab4f669d3d36b0ec077b123caec77d4343506..11db4163487a5dd051875fc6eb81841f0af3aad4 100755 (executable)
@@ -4,11 +4,11 @@
   <title>Popcorn API</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
+
   <script src="../../popcorn.js"></script>
   <script src="popcorn.googlemap.js"></script>
 
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
-    controls preload='none' 
-    width= '250px'
-    poster="../../test/poster.png"> 
 
-    <source id='mp4'
+  <video id="video"
+    controls preload="none"
+    width= "250px"
+    poster="../../test/poster.png">
+
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
-  <div id="map" style="position:relative;float:left;width:300px;height:400px"></div> 
+  </video>
+  <div id="map" style="position:relative;float:left;width:300px;height:400px"></div>
   <div id="map2" style="position:relative;float:left;width:300px;height:400px"></div>
-  <div id="map3" style="position:relative;float:left;width:300px;height:400px"></div>    
+  <div id="map3" style="position:relative;float:left;width:300px;height:400px"></div>
 </body>
 </html>
 
index d3269057d6fc93933a029212b3b46f1f9fef52f6..f242bb6f7884b0c8e505f8b97e2b35ee23d1f5af 100755 (executable)
@@ -1,51 +1,51 @@
-test("Popcorn Google Map Plugin", function () {
-  
+test( "Popcorn Google Map Plugin", function () {
+
   var popped = Popcorn( "#video" ),
-      expects = 15, 
+      expects = 15,
       count = 0,
       setupId;
-  
+
   expect( expects );
-  
+
   function plus() {
     if ( ++count === expects ) {
       start();
     }
   }
-  
+
   stop();
 
-  ok ( 'googlemap' in popped, "googlemap is a mehtod of the popped instance" );
+  ok ( "googlemap" in popped, "googlemap is a mehtod of the popped instance" );
   plus();
-  
-  ok ( document.getElementById( 'map' ).innerHTML === "", "initially, there is nothing inside the map" );
+
+  ok ( document.getElementById( "map" ).innerHTML === "", "initially, there is nothing inside the map" );
   plus();
-  
-  ok ( document.getElementById( 'map2' ).innerHTML === "", "initially, there is nothing inside the map2" );
+
+  ok ( document.getElementById( "map2" ).innerHTML === "", "initially, there is nothing inside the map2" );
   plus();
-  
-  ok ( document.getElementById( 'map3' ).innerHTML === "", "initially, there is nothing inside the map3" );
+
+  ok ( document.getElementById( "map3" ).innerHTML === "", "initially, there is nothing inside the map3" );
   plus();
-  
+
   popped.googlemap({
-    start: 0, // seconds
-    end: 2, // seconds
-    type: 'ROADMAP',
-    target: 'map',
+    start: 0,
+    end: 2,
+    type: "ROADMAP",
+    target: "map",
     lat: 43.665429,
     lng: -79.403323
   })
   .googlemap({
-      start: 0, // seconds
-      end: 2, // seconds
-      type: 'SATELLITE',
-      target: 'map2',
-      location:'toronto',
+      start: 0,
+      end: 2,
+      type: "SATELLITE",
+      target: "map2",
+      location: "toronto",
       zoom: 15
   });
   var mapz = popped.googlemap({
-    start: 2, // seconds
-    end: 4, // seconds
+    start: 2,
+    end: 4,
     type: "STREETVIEW",
     target: "map3",
     location: "6th Line, Oakville, Ontario",
@@ -55,7 +55,7 @@ test("Popcorn Google Map Plugin", function () {
          interval: 1000,
          tween: "York university"
   })
-  .volume(0);
+  .volume( 0 );
 
   setupId = popped.getLastTrackEventId();
 
@@ -64,34 +64,34 @@ test("Popcorn Google Map Plugin", function () {
     plus();
     ok( google.maps.Geocoder, "Google maps Geocoder is available" );
     plus();
-    ok ( document.getElementById( 'actualmap1' ), "First map is on the page" );
+    ok ( document.getElementById( "actualmap1" ), "First map is on the page" );
     plus();
-    equals ( document.getElementById( 'actualmap1' ).offsetParent.id, "map", "First map is inside the 'map' div" );
+    equals ( document.getElementById( "actualmap1" ).offsetParent.id, "map", "First map is inside the 'map' div" );
     plus();
-    equals( popped.data.trackEvents.byStart[1].zoom, 8, "Defaulting to zoom of 8" );
+    equals( popped.data.trackEvents.byStart[ 1 ].zoom, 8, "Defaulting to zoom of 8" );
     plus();
   });
 
   popped.exec( 1, function() {
-    ok (document.getElementById('actualmap2'), "Second map is on the page" );
+    ok ( document.getElementById( "actualmap2" ), "Second map is on the page" );
     plus();
-    equals (document.getElementById('actualmap2').offsetParent.id, "map2", "Second map is inside the 'map2' div" );
+    equals ( document.getElementById( "actualmap2" ).offsetParent.id, "map2", "Second map is inside the 'map2' div" );
     plus();
   });
 
   popped.exec( 3, function() {
-    equals (document.getElementById('actualmap3').offsetParent.id, "map3", "Tweening map is inside the 'map3' div" );
+    equals ( document.getElementById( "actualmap3" ).offsetParent.id, "map3", "Tweening map is inside the 'map3' div" );
     plus();
   });
 
   popped.exec( 5, function() {
-    ok ( document.getElementById( 'actualmap2' ).style.display === "none" && 
-        document.getElementById( 'actualmap1' ).style.display === "none" &&
-        document.getElementById( 'actualmap3' ).style.display === "none", "All maps are no longer visible" );
+    ok ( document.getElementById( "actualmap2" ).style.display === "none" && 
+        document.getElementById( "actualmap1" ).style.display === "none" &&
+        document.getElementById( "actualmap3" ).style.display === "none", "All maps are no longer visible" );
     plus();
     popped.pause().removeTrackEvent( setupId );
 
-    ok( !document.getElementById( 'actualmap4' ), "removed map was properly destroyed" );
+    ok( !document.getElementById( "actualmap4" ), "removed map was properly destroyed" );
     plus();
   });
 
@@ -103,11 +103,10 @@ test("Popcorn Google Map Plugin", function () {
   try {
     popped.googlemap({});
   } catch( e ) {
-    ok(true, 'empty event was caught by debug');
+    ok( true, "empty event was caught by debug" );
     plus();
   }
 
   popped.play();
-  
-});
 
+});
index a83045bcb8a718643d7324275057207dd8b6b403..3cd99293f8a2074eba59ec9dd9828f57448f46f4 100755 (executable)
@@ -2,7 +2,6 @@
 <html>
 <head>
   <title>Popcorn Image Plug-in Demo</title>
-  
   <script src="../../popcorn.js"></script>
   <script src="popcorn.image.js"></script>
   <script>
@@ -10,7 +9,7 @@
 
       var p = Popcorn( "#video" )
       .volume( 0 )
-      .play() 
+      .play()
       .image({
        // seconds
         start: 5,
   <p> First one (with an overlayed text) will disappear at 15 seconds.</p>
   <p> Second one (without an overlayed text) will disappear at 45 seconds.</p>
   <div>
-    <video id="video" 
+    <video id="video"
       controls
       width="250px"
-      poster="../../test/poster.png"> 
+      poster="../../test/poster.png">
 
       <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4; codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
       <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg; codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
-    </video> 
+    </video>
   </div>
   <div style="width:400px; height:400px" id="imagediv">
-  </div> 
+  </div>
 
 </body>
 </html>
index 6da4bec2453a4b992bd68e78a09233be04d918fd..9d7d220be3368dac38c55c43300b0f086e5a1348 100755 (executable)
@@ -1,21 +1,21 @@
 // PLUGIN: IMAGE
 
-(function (Popcorn) {
+(function ( Popcorn ) {
 
 /**
- * Images popcorn plug-in 
+ * Images popcorn plug-in
  * Shows an image element
  * 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 - optional 
- * Target is the id of the document element that the iframe needs to be attached to, 
+ * End is the time that you want this plug-in to stop executing
+ * 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  
+ * text is the overlayed text on the image - optional
  *
  * @param {Object} options
- * 
+ *
  * Example:
    var p = Popcorn('#video')
       .image({
@@ -30,7 +30,7 @@
  */
   Popcorn.plugin( "image", {
       manifest: {
-        about:{
+        about: {
           name: "Popcorn image Plugin",
           version: "0.1",
           author: "Scott Downe",
@@ -54,8 +54,8 @@
           },
           target: "image-container",
           src: {
-            elem: "input", 
-            type: "text",   
+            elem: "input",
+            type: "text",
             label: "Source URL"
           },
           text: {
 
           // borders look really bad, if someone wants it they can put it on their div target
           img.style.borderStyle = "none";
-          
+
           if ( options.href ) {
             options.link.href = options.href;
           }
 
           options.link.target = "_blank";
 
-          var fontHeight = ( img.height / 12 ) + "px", 
+          var fontHeight = ( img.height / 12 ) + "px",
               divText = document.createElement( "div" );
-          
+
           Popcorn.extend( divText.style, {
 
             color: "black",
           divText.innerHTML = options.text || "";
           options.link.appendChild( divText );
           options.link.appendChild( img );
-          divText.style.top = ( img.height / 2 ) - ( divText.offsetHeight / 2 ) + "px"; 
+          divText.style.top = ( img.height / 2 ) - ( divText.offsetHeight / 2 ) + "px";
           options.link.style.display = "none";
         }, false );
 
       },
 
       /**
-       * @member image 
-       * The start function will be executed when the currentTime 
-       * of the video  reaches the start time provided by the 
+       * @member image
+       * The start function will be executed when the currentTime
+       * of the video  reaches the start time provided by the
        * options variable
        */
       start: function( event, options ) {
         options.link.style.display = "block";
       },
       /**
-       * @member image 
-       * The end function will be executed when the currentTime 
-       * of the video  reaches the end time provided by the 
+       * @member image
+       * The end function will be executed when the currentTime
+       * of the video  reaches the end time provided by the
        * options variable
        */
       end: function( event, options ) {
index d78a7d4cac4273985c82cc3c17f19b214d1d1de4..fd714c048b1b774b2a2ab2d95a4978f41f18bc39 100755 (executable)
@@ -4,14 +4,12 @@
   <title>Popcorn Image Plug-in Test</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
   <script src="../../popcorn.js"></script>
   <script src="popcorn.image.js"></script>
-
   <script src="popcorn.image.unit.js"></script>
 </head>
 <body>
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id="video" 
+
+  <video id="video"
     controls
     width="250px"
-    poster="../../test/poster.png"> 
+    poster="../../test/poster.png">
 
     <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
     <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
-  <div id="imagediv"></div>  
+  </video>
+  <div id="imagediv"></div>
 </body>
 </html>
index afa2c24ff23d7f69dacc0b3777d3840b710726d4..447b17950f1784f9c61fcc25c55f4c30d104ee4e 100755 (executable)
@@ -1,4 +1,4 @@
-test("Popcorn Image Plugin", function () {
+test( "Popcorn Image Plugin", function () {
 
   var popped = Popcorn( "#video" ),
       expects = 9,
@@ -7,33 +7,33 @@ test("Popcorn Image Plugin", function () {
       imagediv = document.getElementById( "imagediv" ),
       sources = [
         "https://www.drumbeat.org/media//images/drumbeat-logo-splash.png",
-        "http://www.petmountain.com/category/mini/organic-dog-supplies/520/organic-dog-supplies.jpg", 
+        "http://www.petmountain.com/category/mini/organic-dog-supplies/520/organic-dog-supplies.jpg",
         "http://www.botskool.com/sites/default/files/images/javascript.png"
       ];
-  
+
   expect( expects );
-  
+
   function plus() {
-    if ( ++count === expects) {
+    if ( ++count === expects ) {
       start();
     }
   }
 
   stop();
- 
+
   ok( "image" in popped, "image is a method of the popped instance" );
   plus();
 
   equals( imagediv.innerHTML, "", "initially, there is nothing inside the imagediv" );
   plus();
-  
+
   popped.image({
     // seconds
     start: 1,
     // seconds
     end: 3,
     href: "http://www.drumbeat.org/",
-    src: sources[0],
+    src: sources[ 0 ],
     text: "DRUMBEAT",
     target: "imagediv"
   })
@@ -43,7 +43,7 @@ test("Popcorn Image Plugin", function () {
     // seconds
     end: 6,
     // no href
-    src: sources[1],
+    src: sources[ 1 ],
     target: "imagediv"
   })
   .image({
@@ -52,8 +52,8 @@ test("Popcorn Image Plugin", function () {
     // seconds
     end: 6,
     // no href
-    src: sources[2],
-    target: "imagediv"  
+    src: sources[ 2 ],
+    target: "imagediv"
   });
 
   setupId = popped.getLastTrackEventId();
@@ -64,24 +64,24 @@ test("Popcorn Image Plugin", function () {
     ok( /img/.test( imagediv.innerHTML ), "An image exists" );
     plus();
   });
-  
+
   popped.exec( 3, function() {
     ok( /display: none;/.test( imagediv.innerHTML ), "Div contents are hidden again" );
     plus();
   });
-  
+
   popped.exec( 5, function() {
     [].forEach.call( document.querySelectorAll( "#imagediv a img" ), function( img, idx ) {
       ok( img.src === sources[ idx ], "Image " + idx + " is in the right order" );
       plus();
     });
   });
-  
+
   popped.exec( 7, function() {
     popped.pause().removeTrackEvent( setupId );
-    ok( !imagediv.children[2], "removed image was properly destroyed" );
+    ok( !imagediv.children[ 2 ], "removed image was properly destroyed" );
     plus();
   });
 
-  popped.volume( 0 ).play();  
+  popped.volume( 0 ).play();
 });
index 2d7e5ee242b746aa170abd79470c255d18eb7b6e..c3876c4980e1b0467f6c5cffce220c0a3023417b 100755 (executable)
@@ -2,56 +2,56 @@
 <html>
 <head>
   <title>Popcorn LastFM Plug-in Demo</title>
-  
+
   <!--
     ATTENTION
-  
+
     This demo uses an API key obtained for testing the LastFM Popcorn.js
     plugin. Please do not use it for other purposes.
   -->
-  
+
   <script src="../../popcorn.js"></script>
   <script src="popcorn.lastfm.js"></script>
-  <script> 
-    document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
-      .volume(0)
+  <script>
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video" )
+      .volume( 0 )
       .play()
       .lastfm({
-        start: 5, // seconds
-        end: 15, // seconds
-        artist: 'yacht',
-        target: 'lastfmdiv',
-        apikey: '30ac38340e8be75f9268727cb4526b3d'
-      } )
+        start: 5,
+        end: 15,
+        artist: "yacht",
+        target: "lastfmdiv",
+        apikey: "30ac38340e8be75f9268727cb4526b3d"
+      })
       .lastfm({
-        start: 10, // seconds
-        end: 20, // seconds
-        artist: 'the beatles',
-        target: 'lastfmdiv',
-        apikey: '30ac38340e8be75f9268727cb4526b3d'
-      } )
+        start: 10,
+        end: 20,
+        artist: "the beatles",
+        target: "lastfmdiv",
+        apikey: "30ac38340e8be75f9268727cb4526b3d"
+      })
       .lastfm({
-        start: 15, // seconds
-        end: 30, // seconds
-        artist: 'sdfsdfsdfdsddfsdfsdfsddfsf',
-        target: 'lastfmdiv',
-        apikey: '30ac38340e8be75f9268727cb4526b3d'
-      } )
+        start: 15,
+        end: 30,
+        artist: "sdfsdfsdfdsddfsdfsdfsddfsf",
+        target: "lastfmdiv",
+        apikey: "30ac38340e8be75f9268727cb4526b3d"
+      })
            .lastfm({
-        start: 20, // seconds
-        end: 45, // seconds
-        artist: 'Coldplay',
-        target: 'lastfmdiv',
-        apikey: '30ac38340e8be75f9268727cb4526b3d'
-      } )
+        start: 20,
+        end: 45,
+        artist: "Coldplay",
+        target: "lastfmdiv",
+        apikey: "30ac38340e8be75f9268727cb4526b3d"
+      })
       .lastfm({
-        start: 25, // seconds
-        end: 40, // seconds
-        artist: 'yacht',
-        target: 'lastfmdiv',
-        apikey: '30ac38340e8be75f9268727cb4526b3d'
-      } )
+        start: 25,
+        end: 40,
+        artist: "yacht",
+        target: "lastfmdiv",
+        apikey: "30ac38340e8be75f9268727cb4526b3d"
+      })
     }, false);
   </script>
 </head>
   <p> Artist information for 'Coldplay' will appear at 20 seconds and disappear at 45 seconds.</p>
   <p> Artist information for 'yacht' will appear at 25 seconds and disappear at 40 seconds.</p>
   <div>
-    <video id='video' 
-      controls preload='none' 
-      width= '250px'
-      poster="../../test/poster.png"> 
+    <video id="video"
+      controls preload="none"
+      width= "250px"
+      poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4; codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg; codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
-    </video> 
+    </video>
   </div>
   <div id="lastfmdiv" width="50%" height="50%">
   </div>
index a38d4593dd2726f65653569f77e48730fd49b5d3..d4f0dee343b146e433746254d42aa6c05e4493c2 100755 (executable)
@@ -1,31 +1,31 @@
 // PLUGIN: LASTFM
 
-(function (Popcorn) {
+(function ( Popcorn ) {
 
   var _artists = {},
-      lastFMcallback = function(data){
-        if (data.artist) {
+      lastFMcallback = function( data ) {
+        if ( data.artist ) {
           var htmlString = "";
 
-          htmlString = '<h3>'+data.artist.name+'</h3>';
-          htmlString += '<a href="'+data.artist.url+'" target="_blank" style="float:left;margin:0 10px 0 0;"><img src="'+ data.artist.image[2]['#text'] +'" alt=""></a>';
-          htmlString += '<p>'+ data.artist.bio.summary +'</p>';
-          htmlString += '<hr /><p><h4>Tags</h4><ul>';
+          htmlString = "<h3>"+data.artist.name+"</h3>";
+          htmlString += "<a href='" + data.artist.url + "' target='_blank' style='float:left;margin:0 10px 0 0;'><img src='" + data.artist.image[ 2 ][ "#text"] + "' alt=''></a>";
+          htmlString += "<p>" + data.artist.bio.summary + "</p>";
+          htmlString += "<hr /><p><h4>Tags</h4><ul>";
 
           Popcorn.forEach( data.artist.tags.tag, function( val, i) {
-            htmlString += '<li><a href="'+ val.url +'">'+ val.name +'</a></li>';
+            htmlString += "<li><a href='" + val.url + "'>" + val.name + "</a></li>";
           });
 
-          htmlString += '</ul></p>';
-          htmlString += '<hr /><p><h4>Similar</h4><ul>';
+          htmlString += "</ul></p>";
+          htmlString += "<hr /><p><h4>Similar</h4><ul>";
 
           Popcorn.forEach( data.artist.similar.artist, function( val, i) {
-            htmlString += '<li><a href="'+ val.url +'">'+ val.name +'</a></li>';
+            htmlString += "<li><a href='" + val.url + "'>" + val.name + "</a></li>";
           });
 
-          htmlString += '</ul></p>';
+          htmlString += "</ul></p>";
 
-          _artists[data.artist.name.toLowerCase()].htmlString = htmlString;
+          _artists[ data.artist.name.toLowerCase() ].htmlString = htmlString;
         }
       };
 
@@ -39,9 +39,9 @@
    * Target is the id of the document element that the images are
    *  appended to, this target element must exist on the DOM
    * ApiKey is the API key registered with LastFM for use with their API
-   * 
+   *
    * @param {Object} options
-   *  
+   *
    * Example:
      var p = Popcorn('#video')
         .lastfm({
    *
    */
   Popcorn.plugin( "lastfm" , (function(){
-      
-    
+
+
     return {
 
       _setup: function( options ) {
-        options._container = document.createElement( 'div' );
+        options._container = document.createElement( "div" );
         options._container.style.display = "none";
         options._container.innerHTML = "";
         options.artist = options.artist && options.artist.toLowerCase() || "";
           throw new Error( "target container doesn't exist" );
         }
         target && target.appendChild( options._container );
-        
-        if(!_artists[options.artist]) {
 
-          _artists[options.artist] = {
+        if ( !_artists[ options.artist ] ) {
+
+          _artists[ options.artist ] = {
             count: 0,
             htmlString: "Unknown Artist"
           };
-          Popcorn.getJSONP("http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist="+ options.artist +"&api_key="+options.apikey+"&format=json&callback=lastFMcallback", lastFMcallback, false );
+          Popcorn.getJSONP( "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=" + options.artist + "&api_key=" + options.apikey + "&format=json&callback=lastFMcallback", lastFMcallback, false );
         }
-        _artists[options.artist].count++;
-        
+        _artists[ options.artist ].count++;
+
       },
       /**
-       * @member LastFM 
-       * The start function will be executed when the currentTime 
-       * of the video  reaches the start time provided by the 
+       * @member LastFM
+       * The start function will be executed when the currentTime
+       * of the video  reaches the start time provided by the
        * options variable
        */
       start: function( event, options ) {
-        options._container.innerHTML = _artists[options.artist].htmlString;
+        options._container.innerHTML = _artists[ options.artist ].htmlString;
         options._container.style.display = "inline";
       },
       /**
-       * @member LastFM 
-       * The end function will be executed when the currentTime 
-       * of the video  reaches the end time provided by the 
+       * @member LastFM
+       * The end function will be executed when the currentTime
+       * of the video  reaches the end time provided by the
        * options variable
        */
       end: function( event, options ) {
   })(),
   {
     about:{
-      name:    "Popcorn LastFM Plugin",
+      name: "Popcorn LastFM Plugin",
       version: "0.1",
-      author:  "Steven Weerdenburg",
+      author: "Steven Weerdenburg",
       website: "http://sweerdenburg.wordpress.com/"
     },
-    options:{
-      start    : {elem:'input', type:'text', label:'In'},
-      end      : {elem:'input', type:'text', label:'Out'},
-      target   : 'lastfm-container',
-      artist   : {elem:'input', type:'text', label:'Artist'}
+    options: {
+      start: {
+        elem: "input",
+        type: "text",
+        label: "In"
+      },
+      end: {
+        elem: "input",
+        type: "text",
+        label: "Out"
+      },
+      target: "lastfm-container",
+      artist: {
+        elem: "input",
+        type: "text",
+        label: "Artist"
+      }
     }
   });
 
index f7bf0f0c647bf372ed5286b9a22e01143d72b5c2..ad4c9e344653cadf8c1f16c5f4ce0ba28a18f126 100755 (executable)
@@ -4,11 +4,11 @@
   <title>Popcorn API</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
+
   <script src="../../popcorn.js"></script>
   <script src="../../test/jquery.js"></script>
   <script src="popcorn.lastfm.js"></script>
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
-    controls 
-    width= '250px'
-    poster="../../test/poster.png"> 
 
-    <source id='mp4'
+  <video id="video"
+    controls
+    width= "250px"
+    poster="../../test/poster.png">
+
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
-  <div id="lastfmdiv"></div>  
+  </video>
+  <div id="lastfmdiv"></div>
 </body>
 </html>
index a5c0c0a39aed9027b83a596a27811fcc88f8a326..c20aaf1f27101ab75440c403ec103961477c067a 100755 (executable)
@@ -1,51 +1,51 @@
-test("Popcorn LastFM Plugin", function () {
+test( "Popcorn LastFM Plugin", function () {
   /*
     ATTENTION
-  
+
     This demo uses an API key obtained for testing the LastFM Popcorn.js
     plugin. Please do not use it for other purposes.
   */
-  var popped = Popcorn("#video"),
-      expects = 10, 
+  var popped = Popcorn( "#video" ),
+      expects = 10,
       count = 0,
       setupId,
-      lastfmdiv = document.getElementById('lastfmdiv');
-  
+      lastfmdiv = document.getElementById( "lastfmdiv" );
+
   expect( expects );
-  
+
   function plus() {
-    if ( ++count === expects) {
+    if ( ++count === expects ) {
       start();
     }
   }
 
-  stop();   
- 
-  ok('lastfm' in popped, "lastfm is a method of the popped instance");
+  stop();
+
+  ok( "lastfm" in popped, "lastfm is a method of the popped instance" );
   plus();
 
   equals ( lastfmdiv.innerHTML, "", "initially, there is nothing inside the lastfmdiv" );
   plus();
-  
+
   popped.lastfm({
-    start: 1, // seconds
-    end: 4, // seconds
-    artist: 'yacht',
-    target: 'lastfmdiv',
-    apikey: '30ac38340e8be75f9268727cb4526b3d'
+    start: 1,
+    end: 4,
+    artist: "yacht",
+    target: "lastfmdiv",
+    apikey: "30ac38340e8be75f9268727cb4526b3d"
   })
   .lastfm({
-    start: 2, // seconds
-    end: 7, // seconds
-    artist: 'the beatles',
-    target: 'lastfmdiv',
-    apikey: '30ac38340e8be75f9268727cb4526b3d'
+    start: 2,
+    end: 7,
+    artist: "the beatles",
+    target: "lastfmdiv",
+    apikey: "30ac38340e8be75f9268727cb4526b3d"
   })
   .lastfm({
-    start: 4, // seconds
-    end: 7, // seconds
-    target: 'lastfmdiv',
-    apikey: '30ac38340e8be75f9268727cb4526b3d'
+    start: 4,
+    end: 7,
+    target: "lastfmdiv",
+    apikey: "30ac38340e8be75f9268727cb4526b3d"
   });
 
   setupId = popped.getLastTrackEventId();
@@ -53,25 +53,25 @@ test("Popcorn LastFM Plugin", function () {
   popped.exec( 2, function() {
     equals ( lastfmdiv.childElementCount, 3, "lastfmdiv now has three inner elements" );
     plus();
-    equals (lastfmdiv.children[0].style.display , "inline", "yachtdiv is visible on the page" );
+    equals ( lastfmdiv.children[0].style.display , "inline", "yachtdiv is visible on the page" );
     plus();
   });
 
   popped.exec( 3, function() {
-    equals (lastfmdiv.children[0].style.display , "inline", "yachtdiv is still visible on the page" );
+    equals ( lastfmdiv.children[ 0 ].style.display , "inline", "yachtdiv is still visible on the page" );
     plus();
-    equals (lastfmdiv.children[1].style.display , "inline", "beatlesdiv is visible on the page" );
+    equals ( lastfmdiv.children[ 1 ].style.display , "inline", "beatlesdiv is visible on the page" );
     plus();
-    equals (lastfmdiv.children[2].style.display , "none", "nulldiv is not visible on the page" );
+    equals ( lastfmdiv.children[ 2 ].style.display , "none", "nulldiv is not visible on the page" );
     plus();
   });
 
   popped.exec( 5, function() {
-    equals (lastfmdiv.children[2].innerHTML , "Unknown Artist", "Artist information could not be found" );
+    equals ( lastfmdiv.children[ 2 ].innerHTML , "Unknown Artist", "Artist information could not be found" );
     plus();
 
     popped.pause().removeTrackEvent( setupId );
-    ok( !lastfmdiv.children[2], "removed artist was properly destroyed" );
+    ok( !lastfmdiv.children[ 2 ], "removed artist was properly destroyed" );
     plus();
   });
 
@@ -83,9 +83,9 @@ test("Popcorn LastFM Plugin", function () {
   try {
     popped.lastfm({});
   } catch( e ) {
-    ok(true, 'empty event was caught by debug');
+    ok ( true, "empty event was caught by debug" );
     plus();
   }
-  
-  popped.volume(0).play();
+
+  popped.volume( 0 ).play();
 });
index cf141a343267a3f7d55dc760bb1f033a8da3a83b..15056b61d3531e0dbb3f079e37ea1a10545e5392 100755 (executable)
@@ -4,7 +4,6 @@
   <title>Popcorn LinkedIn Plug-in Demo</title>
     <!--
     ATTENTION
-  
     This demo uses an API key obtained for testing the LinkedIn Popcorn.js
     plugin. Please do not use it for other purposes. This API key is meant
     to be used on localhost (port 80). For other purposes, please obtain an API key
 </head>
 <body>
 <h1 id="qunit-header">Popcorn LinkedIn Plug-in Demo</h1>
-  Right of video: 
+  Right of video:
   <ul>
-        <li>share button: between 1 and 4 seconds</li> 
-        <li>recommend button: between 5  and 8 seconds</li> 
-        <li>member profile: between 9 and 15 seconds</li> 
+        <li>share button: between 1 and 4 seconds</li>
+        <li>recommend button: between 5  and 8 seconds</li>
+        <li>member profile: between 9 and 15 seconds</li>
   </ul>
   Below video:
-  <ul> 
-     <li>company insider: between 9 and 15 seconds</li> 
+  <ul>
+     <li>company insider: between 9 and 15 seconds</li>
      <li>company profile: between 16 and 27 seconds</li>
   </ul>
-  <p>   
+  <p>
      For a description of each plugin's purpose, go to: <a href="http://developer.linkedin.com/community/plugins">LinkedIn Plugins</a><br/>
   </p>
-  
+
   <div>
-    <video id="video" 
-      controls preload="none" 
+    <video id="video"
+      controls preload="none"
       width="350px"
-      poster="../../test/poster.png"> 
+      poster="../../test/poster.png">
 
       <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4; codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
       <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg; codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
-    </video> 
+    </video>
   </div>
   <div id="sharediv" style="position:absolute;top:400px;left:400px;"></div>
   <div id="recommenddiv" style="position:absolute;top:400px;left:400px;"></div>
index 1777d8a99ddda0622cdc5f943fdba24aa2713bcb..c20ecd3845767f61e3447ba1a20ab21625299ded 100755 (executable)
@@ -1,6 +1,6 @@
 //PLUGIN: linkedin
 
-(function (Popcorn){
+(function ( Popcorn ){
 
   /**
    * LinkedIn Popcorn plug-in
           label: "Counter"
         },
         memberid: {
-          elem:"input",
-          type:"text",
-          label:"Member ID"
+          elem: "input",
+          type: "text",
+          label: "Member ID"
         },
         format: {
-          elem:"input",
-          type:"text",
-          label:"Format"
+          elem: "input",
+          type: "text",
+          label: "Format"
         },
         companyid: {
-          elem:"input",
-          type:"text",
-          label:"Company ID"
+          elem: "input",
+          type: "text",
+          label: "Company ID"
         },
         modules: {
-          elem:"input",
-          type:"text",
-          label:"Modules"
+          elem: "input",
+          type: "text",
+          label: "Modules"
         },
         productid: {
-          elem:"input",
-          type:"text",
-          label:"productid"
+          elem: "input",
+          type: "text",
+          label: "productid"
         },
         related: {
-          elem:"input",
-          type:"text",
-          label:"related"
+          elem: "input",
+          type: "text",
+          label: "related"
         },
         start: {
-          elem:"input",
-          type:"text",
-          label:"In"
+          elem: "input",
+          type: "text",
+          label: "In"
         },
         end: {
-          elem:"input",
-          type:"text",
-          label:"Out"
+          elem: "input",
+          type: "text",
+          label: "Out"
         },
 
         target: "linkedin-container"
           target = document.getElementById( options.target ),
           script = document.createElement( "script" );
 
-      Popcorn.getScript("http://platform.linkedin.com/in.js");
+      Popcorn.getScript( "http://platform.linkedin.com/in.js" );
 
       options._container = document.createElement( "div" );
       options._container.appendChild( script );
       if ( apikey ) {
         script.innerHTML = "api_key: " + apikey;
       }
-      
+
       options.type = options.type && options.type.toLowerCase() || "";
 
       // Replace the LinkedIn plugin's error message to something more helpful
index f9caeb26d81a1263b6cba87571a76b14997f1901..0a122c9c23b8880e7d9f4a9ad879c568d8eddc76 100755 (executable)
@@ -4,13 +4,12 @@
   <title>Popcorn LinkedIn Plugin Test</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
   <script src="../../popcorn.js"></script>
-  <script src="popcorn.linkedin.js"></script>  
+  <script src="popcorn.linkedin.js"></script>
   <script src="popcorn.linkedin.unit.js"></script>
 </head>
 <body>
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
+
+  <video id="video"
     controls
-    width= '250px'
-    poster="../../test/poster.png"> 
+    width= "250px"
+    poster="../../test/poster.png">
 
-    <source id='mp4'
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
+  </video>
   <div id="sharediv"></div>
   <div id="recommenddiv"></div>
   <div id="memberprofilediv"></div>
   <div id="companyinsiderdiv"></div>
-  <div id="companyprofilediv"></div>  
+  <div id="companyprofilediv"></div>
 </body>
 </html>
index 2625bff36a221e6271bd5ae2f79b3b966840cf10..2791f886308ed7f09b0facc5dfb7730fa141023b 100755 (executable)
@@ -1,9 +1,9 @@
-test("Popcorn LinkedIn Plugin", function () {
-  
+test ("Popcorn LinkedIn Plugin", function () {
+
   if ( /localhost/.test( location.hostname ) ) {
-    
+
     // run tests on localhost
-    var popped = Popcorn("#video"),
+    var popped = Popcorn( "#video" ),
         expects = 23,
         count = 0,
         setupId,
@@ -12,25 +12,25 @@ test("Popcorn LinkedIn Plugin", function () {
         memberprofilediv = document.getElementById( "memberprofilediv" ),
         companyinsiderdiv = document.getElementById( "companyinsiderdiv" ),
         companyprofilediv = document.getElementById( "companyprofilediv" );
-    
+
     expect( expects );
-    
+
     function plus() {
-  
+
       if ( ++count === expects ) {
         start();
       }
     }
-  
+
     stop();
-   
+
     ok( "linkedin" in popped, "linkedin is a method of the popped instance" );
     plus();
-  
+
     // Testing the share plugin
     equals( sharediv.innerHTML, "", "initially, there is nothing inside the sharediv" );
     plus();
-    
+
     popped.linkedin({
       type: "share",
       counter: "right",
@@ -40,25 +40,25 @@ test("Popcorn LinkedIn Plugin", function () {
       start: 1,
       end: 3
     });
-  
+
     popped.exec( 2, function() {
-  
+
       ok( /block/.test( sharediv.children[ 0 ].style.display ), "sharediv contents are displayed" );
       plus();
       ok( /script/.test( sharediv.children[ 0 ].innerHTML ), "share plugin exists" );
       plus();
     });
-    
+
     popped.exec( 4, function() {
-  
+
       ok( /none/.test( sharediv.children[ 0 ].style.display ), "sharediv contents are hidden again" );
       plus();
     });
-    
+
     // Testing the recommendproduct plugin
     equals( recommenddiv.innerHTML, "", "initially, there is nothing inside the recommenddiv" );
     plus();
-    
+
     popped.linkedin({
       type: "recommendproduct",
       counter: "top",
@@ -69,25 +69,25 @@ test("Popcorn LinkedIn Plugin", function () {
       start: 1,
       end: 3
     });
-    
+
     popped.exec( 2, function() {
-  
+
       ok( /block/.test( recommenddiv.children[ 0 ].style.display ), "recommenddiv contents are displayed" );
       plus();
       ok( /script/.test( recommenddiv.children[ 0 ].innerHTML ), "recommend plugin exists" );
       plus();
     });
-    
+
     popped.exec( 4, function() {
-  
+
       ok( /none/.test( recommenddiv.children[ 0 ].style.display ), "recommenddiv contents are hidden again" );
       plus();
     });
-    
+
     // Testing memberprofile plugin
     equals( memberprofilediv.innerHTML, "", "initially, there is nothing inside the memberprofilediv" );
     plus();
-    
+
     popped.linkedin({
       type: "memberprofile",
       memberid: "/in/jeffweiner08",
@@ -99,23 +99,23 @@ test("Popcorn LinkedIn Plugin", function () {
     });
 
     popped.exec( 2, function() {
-  
+
       ok( /block/.test( memberprofilediv.children[ 0 ].style.display ), "memberprofilediv contents are displayed" );
       plus();
       ok( /script/.test( memberprofilediv.children[ 0 ].innerHTML ), "member profile plugin exists" );
       plus();
     });
-    
+
     popped.exec( 4, function() {
-  
+
       ok( /none/.test( memberprofilediv.children[ 0 ].style.display ), "memberprofilediv contents are hidden again" );
       plus();
     });
-    
+
     // Testing the company insider plugin
     equals( companyinsiderdiv.innerHTML, "", "initially, there is nothing inside the companyinsiderdiv" );
     plus();
-        
+
     popped.linkedin({
       type: "companyinsider",
       companyid: "1441",
@@ -126,15 +126,15 @@ test("Popcorn LinkedIn Plugin", function () {
     });
 
     popped.exec( 2, function() {
-  
+
       ok( /block/.test( companyinsiderdiv.children[ 0 ].style.display ), "companyinsiderdiv contents are displayed" );
       plus();
       ok( /script/.test( companyinsiderdiv.children[ 0 ].innerHTML ), "company insider plugin exists" );
       plus();
     });
-    
+
     popped.exec( 4, function() {
-  
+
       ok( /none/.test( companyinsiderdiv.children[ 0 ].style.display ), "companyinsiderdiv contents are hidden again" );
       plus();
     });
@@ -142,7 +142,7 @@ test("Popcorn LinkedIn Plugin", function () {
     // Testing company profile plugin
     equals( companyprofilediv.innerHTML, "", "initially, there is nothing inside the companyprofilediv" );
     plus();
-    
+
     popped.linkedin({
       type: "companyprofile",
       companyid: "1441",
@@ -152,25 +152,25 @@ test("Popcorn LinkedIn Plugin", function () {
       start: 1,
       end: 3
     });
-    
+
     setupId = popped.getLastTrackEventId();
 
     popped.exec( 2, function() {
-  
+
       ok( /block/.test( companyprofilediv.children[ 0 ].style.display ), "companyprofilediv contents are displayed" );
       plus();
       ok( /script/.test( companyprofilediv.children[ 0 ].innerHTML ), "company profile plugin exists" );
       plus();
     });
-    
+
     popped.exec( 4, function() {
-  
+
       ok( /none/.test( companyprofilediv.children[ 0 ].style.display ), "companyprofilediv contents are hidden again" );
       plus();
-      
+
       // Make sure _teardown functionality works
       popped.pause().removeTrackEvent( setupId );
-      ok( !companyprofilediv.children[1], "companyprofilediv plugin was properly destroyed"  );
+      ok( !companyprofilediv.children[ 1 ], "companyprofilediv plugin was properly destroyed"  );
       plus();
     });
 
@@ -182,13 +182,13 @@ test("Popcorn LinkedIn Plugin", function () {
     try {
       popped.linkedin({});
     } catch( e ) {
-      ok(true, 'empty event was caught by debug');
+      ok( true, "empty event was caught by debug" );
       plus();
     }
 
     popped.volume( 0 ).play();
   } else {
-    
+
     // tests must be run on localhost
     ok( false, "LinkedIn apikey will only work under localhost" );
   }
index c3cb77468020064d860356c2f546e010045a7544..60750c378622e8a5b411b6d5ad76568e988abf2b 100755 (executable)
 
       <source id="mp4"
         src="../../test/trailer.mp4"
-        type="video/mp4; codecs='avc1, mp4a'">
+        type='video/mp4; codecs="avc1, mp4a"'>
 
       <source id="ogv"
         src="../../test/trailer.ogv"
-        type="video/ogg; codecs='theora, vorbis'">
+        type='video/ogg; codecs="theora, vorbis"'>
 
       <p>Your user agent does not support the HTML5 Video element.</p>
 
index 1d549003ba0da0bb40dfec74e29f21412e5f80a3..7145840708406a0452467af31f4f57c7bfc82ceb 100755 (executable)
 
     <source id="mp4"
       src="../../test/trailer.mp4"
-      type="video/mp4; codecs='avc1, mp4a'">
+      type='video/mp4; codecs="avc1, mp4a"'>
 
     <source id="ogv"
       src="../../test/trailer.ogv"
-      type="video/ogg; codecs='theora, vorbis'">
+      type='video/ogg; codecs="theora, vorbis"'>
 
     <p>Your user agent does not support the HTML5 Video element.</p>
 
index 5d708c733560f930e6bf0d435aabf9164d95a557..ed34b7e483523000301122df12d836506e1fa745 100755 (executable)
@@ -1,6 +1,6 @@
 // PLUGIN: Mustache
 
-(function (Popcorn) {
+(function ( Popcorn ) {
 
   /**
    * Mustache Popcorn Plug-in
   *
   */
 
-  Popcorn.plugin( 'mustache' , function( options ) {
+  Popcorn.plugin( "mustache" , function( options ) {
 
     var getData, data, getTemplate, template;
 
-    Popcorn.getScript('https://github.com/janl/mustache.js/raw/master/mustache.js');
+    Popcorn.getScript( "https://github.com/janl/mustache.js/raw/master/mustache.js" );
 
     var shouldReload = !!options.dynamic,
         typeOfTemplate = typeof options.template,
     }
     options.container = target || document.createElement( "div" );
 
-    if ( typeOfTemplate === 'function' ) {
+    if ( typeOfTemplate === "function" ) {
       if ( !shouldReload ) {
         template = options.template( options );
       } else {
         getTemplate = options.template;
       }
-    } else if ( typeOfTemplate === 'string' ) {
+    } else if ( typeOfTemplate === "string" ) {
       template = options.template;
     } else if ( Popcorn.plugin.debug ) {
-      throw new Error( 'Mustache Plugin Error: options.template must be a String or a Function.' );
+      throw new Error( "Mustache Plugin Error: options.template must be a String or a Function." );
     } else {
       template = "";
     }
 
-    if ( typeOfData === 'function' ) {
+    if ( typeOfData === "function" ) {
       if ( !shouldReload ) {
-        data = options.data(options);
+        data = options.data( options );
       } else {
         getData = options.data;
       }
-    } else if ( typeOfData === 'string' ) {
+    } else if ( typeOfData === "string" ) {
       data = JSON.parse( options.data );
-    } else if ( typeOfData === 'object' ) {
+    } else if ( typeOfData === "object" ) {
       data = options.data;
     } else if ( Popcorn.plugin.debug ) {
-      throw new Error( 'Mustache Plugin Error: options.data must be a String, Object, or Function.' );
+      throw new Error( "Mustache Plugin Error: options.data must be a String, Object, or Function." );
     } else {
       data = "";
     }
 
             var html = Mustache.to_html( template,
                                          data
-                                       ).replace( /^\s*/mg, '' );
+                                       ).replace( /^\s*/mg, "" );
             options.container.innerHTML = html;
           }
         };
       },
 
       end: function( event, options ) {
-        options.container.innerHTML = '';
+        options.container.innerHTML = "";
       },
       _teardown: function( options ) {
         getData = data = getTemplate = template = null;
   },
   {
     about: {
-      name: 'Popcorn Mustache Plugin',
-      version: '0.1',
-      author: 'David Humphrey (@humphd)',
-      website: 'http://vocamus.net/dave'
+      name: "Popcorn Mustache Plugin",
+      version: "0.1",
+      author: "David Humphrey (@humphd)",
+      website: "http://vocamus.net/dave"
     },
     options: {
-      start: {elem:'input', type:'text', label:'In'},
-      end: {elem:'input', type:'text', label:'Out'},
-      target: 'mustache-container',
-      template: {elem:'input', type:'text', label:'Template'},
-      data: {elem:'input', type:'text', label:'Data'},
+      start: {
+        elem: "input",
+        type: "text",
+        label: "In"
+      },
+      end: {
+        elem: "input",
+        type: "text",
+        label: "Out"
+      },
+      target: "mustache-container",
+      template: {
+        elem: "input",
+        type: "text",
+        label: "Template"
+      },
+      data: {
+        elem: "input",
+        type: "text",
+        label: "Data"
+      },
       /* TODO: how to show a checkbox/boolean? */
-      dynamic: {elem:'input', type:'text', label:'Dynamic'}
+      dynamic: {
+        elem: "input",
+        type: "text",
+        label: "Dynamic"
+      }
     }
   });
 })( Popcorn );
index 18a329f99b1d451ff4c99a62d190b3985636700d..64d54a053086e9c07afb44c2994f14abd66a58b3 100755 (executable)
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
 
-  <video id='video'
+  <video id="video"
     autobuffer
     preload="auto"
     controls
-    width= '250px'
+    width= "250px"
     poster="../../test/poster.png">
 
-    <source id='mp4'
+    <source id="mp4"
       src="../../test/trailer.mp4"
       type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
       type='video/ogg; codecs="theora, vorbis"'>
 
index c330b60c7a727d9a553376c29c4654958f31da55..2a331ce448d2c9ba4b23d3f866d63216dc425c25 100755 (executable)
@@ -1,85 +1,85 @@
-test('Popcorn Mustache Plugin', function () {
+test( "Popcorn Mustache Plugin", function () {
 
-  var popped = Popcorn('#video'),
+  var popped = Popcorn( "#video" ),
       expects = 6,
       count = 0,
-      mustacheDiv = document.getElementById('mustache-div');
+      mustacheDiv = document.getElementById( "mustache-div" );
 
   expect( expects );
 
   function plus() {
-    if ( ++count === expects) {
+    if ( ++count === expects ) {
       start();
     }
   }
 
   stop();
 
-  ok('mustache' in popped, 'mustache is a method of the popped instance');
+  ok( "mustache" in popped, "mustache is a method of the popped instance" );
   plus();
 
-  equals ( mustacheDiv.innerHTML, '', 'initially, there is nothing inside the mustache-div' );
+  equals ( mustacheDiv.innerHTML, "", "initially, there is nothing inside the mustache-div" );
   plus();
 
   // Static strings
   popped.mustache({
-    start: 0, // seconds
-    end: 2, // seconds
-    template: '<h1>{{heading}}</h1>',
+    start: 0,
+    end: 2,
+    template: "<h1>{{heading}}</h1>",
     data: '{"heading": "mustache - test 1/3"}',
-    target: 'mustache-div',
+    target: "mustache-div",
     dynamic: false
-  } );
+  });
 
   // Dynamic functions
   popped.mustache({
-    start: 2, // seconds
-    end: 4, // seconds
-    template: function(plugin, options) {
-      return '<h1>{{heading}}</h1>';
+    start: 2,
+    end: 4,
+    template: function( plugin, options ) {
+      return "<h1>{{heading}}</h1>";
     },
-    data: function(plugin, options) {
-      return JSON.parse('{"heading": "mustache - test 2/3"}');
+    data: function( plugin, options ) {
+      return JSON.parse( '{"heading": "mustache - test 2/3"}' );
     },
-    target: 'mustache-div',
-  } );
+    target: "mustache-div",
+  });
 
   // Template + Object literal
   popped.mustache({
-    start: 4, // seconds
-    end: 5, // seconds
-    template: function(plugin, options) {
-      return '<h1>{{heading}}</h1>';
+    start: 4,
+    end: 5,
+    template: function( plugin, options ) {
+      return "<h1>{{heading}}</h1>";
     },
-    data: { heading: 'mustache - test 3/3' },
-    target: 'mustache-div',
+    data: { heading: "mustache - test 3/3" },
+    target: "mustache-div",
     dynamic: false
-  } );
+  });
 
-  var video = document.getElementById('video');
+  var video = document.getElementById( "video" );
   var two = six = ten = false;
 
-  video.addEventListener('timeupdate', function() {
+  video.addEventListener( "timeupdate", function() {
 
-    function pass(a, b) {
-      equals( mustacheDiv.innerHTML, '<h1>mustache - test ' + a + '/' + b + '<\/h1>','Mustache template rendered' );
+    function pass( a, b ) {
+      equals( mustacheDiv.innerHTML, "<h1>mustache - test " + a + "/" + b + "<\/h1>","Mustache template rendered" );
       plus();
     }
 
-    var t = Math.floor(video.currentTime);
+    var t = Math.floor( video.currentTime );
 
-    if (t === 1 && !two) {
-      pass(1, 3);
+    if ( t === 1 && !two ) {
+      pass( 1, 3 );
       two = true;
-    } else if (t === 3 && !six) {
-      pass(2, 3);
+    } else if ( t === 3 && !six ) {
+      pass( 2, 3 );
       six = true;
-    } else if (t === 4 && !ten) {
-      pass(3, 3);
+    } else if ( t === 4 && !ten ) {
+      pass( 3, 3 );
       ten = true;
     }
 
-    if (t === 6) {
+    if ( t === 6 ) {
       video.pause();
     }
 
@@ -93,10 +93,10 @@ test('Popcorn Mustache Plugin', function () {
   try {
     popped.mustache({});
   } catch( e ) {
-    ok(true, 'empty event was caught by debug');
+    ok( true, "empty event was caught by debug" );
     plus();
   }
 
-  popped.volume(0);
+  popped.volume( 0 );
   popped.play();
 });
index 571eb460b5667acf386bf8d1b9bce4ff06d14a40..204023f5ed8a1d2a0a7b123d93c2d53dc7119270 100755 (executable)
@@ -5,24 +5,24 @@
   <script src="../../popcorn.js"></script>
   <script src="popcorn.openmap.js"></script>
   <script>
-    document.addEventListener('DOMContentLoaded', function () {
-      Popcorn('#video')
+    document.addEventListener( "DOMContentLoaded", function () {
+      Popcorn( "#video" )
       .volume( 0 )
       .play()
       .openmap( {
         start: 0,
         end: 20,
-        type: 'ROADMAP',
-        target: 'map',
+        type: "ROADMAP",
+        target: "map",
         lat: 43.665429,
         lng: -79.403323,
         zoom: "10"
-      } )
+      })
       .openmap( {
         start: 0,
         end: 30,
-        type: 'SATELLITE',
-        target: 'map2',
+        type: "SATELLITE",
+        target: "map2",
         lat: 42.358544,
         lng: -71.05957,
         zoom: 9,
             text: "Another clickable marker"
           }
         ]
-      } )
-      .openmap( {
+      })
+      .openmap({
         start: 0,
         end: 20,
-        type: 'TERRAIN',
-        target: 'map3',
+        type: "TERRAIN",
+        target: "map3",
         lat: 40.943926,
         lng: -78.968525,
         zoom: 14
-      } );
+      });
     }, false);
   </script>
 </head>
   <p> An OpenLayers + NASA LandSat Map displaying Boston and a map marker will appear at 0 seconds and disappear at 30 seconds.</p>
   <p> An OpenLayers + USGS Topographic Map displaying Punxsutawney, PA will appear at 0 seconds and disappear at 20 seconds.</p>
   <div>
-    <video id='video' 
-      controls 
-      width= '250px'
-      poster="../../test/poster.png"> 
+    <video id="video"
+      controls
+      width= "250px"
+      poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4;' codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg;' codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
     </video>
   </div>
@@ -82,4 +82,4 @@
     <div id="map3" style="position:relative;float:left;width:300px;height:400px"><p>Locations in this video:</p></div>
   </div>
 </body>
-</html>
\ No newline at end of file
+</html>
index 95bfbac1f1851d5bbb90991dc56901355ad3e526..f0c93562fc98433bb6c7ea8fd62c7dab2b4925cb 100755 (executable)
@@ -1,13 +1,13 @@
 // PLUGIN: OPENMAP
 ( function ( Popcorn ) {
-  
+
   /**
-   * openmap popcorn plug-in 
+   * openmap popcorn plug-in
    * Adds an OpenLayers map and open map tiles (OpenStreetMap [default], NASA WorldWind, or USGS Topographic)
    * Based on the googlemap popcorn plug-in. No StreetView support
    * Options parameter will need a start, end, target, type, zoom, lat and lng
    * -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 
+   * -End is the time that you want this plug-in to stop executing
    * -Target is the id of the DOM element that you want the map to appear in. This element must be in the DOM
    * -Type [optional] either: ROADMAP (OpenStreetMap), SATELLITE (NASA WorldWind / LandSat), or TERRAIN (USGS).  ROADMAP/OpenStreetMap is the default.
    * -Zoom [optional] defaults to 2
@@ -20,9 +20,9 @@
    * --Lat and Lng are coordinates of the map marker if location is not specified
    * --Location is a name of a place for the map marker, geocoded to coordinates using TinyGeocoder.com
    *  Note: using location requires extra loading time, also not specifying both lat/lng and location will
-   * cause a JavaScript error. 
+   * cause a JavaScript error.
    * @param {Object} options
-   * 
+   *
    * Example:
      var p = Popcorn( '#video' )
         .openmap({
@@ -40,7 +40,7 @@
 
   function toggle( container, display ) {
     if ( container.map ) {
-      
+
       container.map.div.style.display = display;
       return;
     }
@@ -89,7 +89,7 @@
           Popcorn.getJSONP(
             "http://tinygeocoder.com/create-api.php?q=" + options.location + "&callback=jsonp",
             function( latlng ) {
-              centerlonlat = new OpenLayers.LonLat( latlng[1], latlng[0] );
+              centerlonlat = new OpenLayers.LonLat( latlng[ 1 ], latlng[ 0 ] );
               options.map.setCenter( centerlonlat );
             }
           );
           displayProjection = new OpenLayers.Projection( "EPSG:4326" );
           projection = new OpenLayers.Projection( "EPSG:4326" );
           options.map = new OpenLayers.Map( {div: newdiv, projection: projection } );
-          var relief = new OpenLayers.Layer.WMS( "USGS Terraserver", "http://terraserver-usa.org/ogcmap.ashx?", { layers: 'DRG' } ); 
+          var relief = new OpenLayers.Layer.WMS( "USGS Terraserver", "http://terraserver-usa.org/ogcmap.ashx?", { layers: 'DRG' } );
           options.map.addLayer( relief );
         } else {
           // add OpenStreetMap layer
         }
       }
     };
-    
+
     isGeoReady();
 
     return {
-    
+
       /**
-       * @member openmap 
-       * The setup function will be executed when the plug-in is instantiated 
+       * @member openmap
+       * The setup function will be executed when the plug-in is instantiated
        */
       _setup: function( options ) {
-      
+
         // insert openlayers api script once
         if ( !window.OpenLayers ) {
           Popcorn.getScript( "http://openlayers.org/api/OpenLayers.js" );
         }
-      
+
         var isReady = function() {
           // wait until OpenLayers has been loaded, and the start function is run, before adding map
           if ( !options.map ) {
               isReady();
             }, 13 );
           } else {
-          
+
             // default zoom is 2
             options.zoom = options.zoom || 2;
-            
+
             // make sure options.zoom is a number
             if ( options.zoom && typeof options.zoom !== "number" ) {
               options.zoom = +options.zoom;
             // reset the location and zoom just in case the user played with the map
             options.map.setCenter( centerlonlat, options.zoom );
             if ( options.markers ) {
-              var layerStyle = OpenLayers.Util.extend( {} , OpenLayers.Feature.Vector.style[ 'default' ] ),
+              var layerStyle = OpenLayers.Util.extend( {} , OpenLayers.Feature.Vector.style[ "default" ] ),
                   featureSelected = function( clickInfo ) {
                     clickedFeature = clickInfo.feature;
                     if ( !clickedFeature.attributes.text ) {
                     clickedFeature.popup = popup;
                     popup.feature = clickedFeature;
                     options.map.addPopup( popup );
-                  }, 
+                  },
                   featureUnSelected = function( clickInfo ) {
                     feature = clickInfo.feature;
                     if ( feature.popup ) {
                         myPointStyle.externalGraphic = myMarker.icon;
                         var myPointFeature = new OpenLayers.Feature.Vector( myPoint, null, myPointStyle );
                         if ( myMarker.text ) {
-                          myPointFeature.attributes = { 
+                          myPointFeature.attributes = {
                             text: myMarker.text
                           };
                         }
                     );
                   };
               pointLayer = new OpenLayers.Layer.Vector( "Point Layer", { style: layerStyle } );
-              options.map.addLayer( pointLayer ); 
+              options.map.addLayer( pointLayer );
               for ( var m = 0, l = options.markers.length; m < l ; m++ ) {
                 var myMarker = options.markers[ m ];
                 if( myMarker.text ){
                 }
                 if ( myMarker.location ) {
                   var geocodeThenPlotMarker = gcThenPlotMarker;
-                  geocodeThenPlotMarker(myMarker);
+                  geocodeThenPlotMarker( myMarker );
                 } else {
                   var myPoint = new OpenLayers.Geometry.Point( myMarker.lng, myMarker.lat ).transform( displayProjection, projection ),
                       myPointStyle = OpenLayers.Util.extend( {}, layerStyle );
                   myPointStyle.externalGraphic = myMarker.icon;
                   var myPointFeature = new OpenLayers.Feature.Vector( myPoint, null, myPointStyle );
                   if ( myMarker.text ) {
-                    myPointFeature.attributes = { 
+                    myPointFeature.attributes = {
                       text: myMarker.text
                     };
                   }
             }
           }
         };
-        
+
         isReady();
       },
-      
+
       /**
-       * @member openmap 
-       * The start function will be executed when the currentTime 
-       * of the video  reaches the start time provided by the 
+       * @member openmap
+       * The start function will be executed when the currentTime
+       * of the video  reaches the start time provided by the
        * options variable
        */
       start: function( event, options ) {
         toggle( options, "block" );
       },
-      
+
       /**
        * @member openmap
-       * The end function will be executed when the currentTime 
-       * of the video reaches the end time provided by the 
+       * The end function will be executed when the currentTime
+       * of the video reaches the end time provided by the
        * options variable
        */
       end: function( event, options ) {
-          toggle( options, "none" );        
+          toggle( options, "none" );
       },
-      
+
       _teardown: function( options ) {
 
         target && target.removeChild( newdiv );
       website: "mapadelsur.blogspot.com"
     },
     options:{
-      start    : { elem: 'input', type: 'text', label: 'In'},
-      end      : { elem: 'input', type: 'text', label: 'Out'},
-      target   : 'map-container',
-      type     : { elem: 'select', options:[ 'ROADMAP', 'SATELLITE', 'TERRAIN' ], label: 'Type' },
-      zoom     : { elem: 'input', type: 'text', label: 'Zoom'},
-      lat      : { elem: 'input', type: 'text', label: 'Lat'},
-      lng      : { elem: 'input', type: 'text', label: 'Lng'},
-      location : { elem: 'input', type: 'text', label: 'Location'},
-      markers  : { elem: 'input', type: 'text', label: 'List Markers'}
+      start: {
+        elem: "input",
+        type: "text",
+        label: "In"
+      },
+      end: {
+        elem: "input",
+        type: "text",
+        label: "Out"
+      },
+      target: "map-container",
+      type: {
+        elem: "select",
+        options: [ "ROADMAP", "SATELLITE", "TERRAIN" ],
+        label: "Type"
+      },
+      zoom: {
+        elem: "input",
+        type: "text",
+        label: "Zoom"
+      },
+      lat: {
+        elem: "input",
+        type: "text",
+        label: "Lat"
+      },
+      lng: {
+        elem: "input",
+        type: "text",
+        label: "Lng"
+      },
+      location: {
+        elem: "input",
+        type: "text",
+        label: "Location"
+      },
+      markers: {
+        elem: "input",
+        type: "text",
+        label: "List Markers"
+      }
     }
   });
 }) ( Popcorn );
index aa9dc9a83d2a2af13f7ae22c219220e103f14d2e..00f1a3179f5871a4522eaec495685b1d7824e51e 100755 (executable)
@@ -4,14 +4,12 @@
   <title>Popcorn Open Map Test</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
   <script src="../../popcorn.js"></script>
   <script src="popcorn.openmap.js"></script>
-
   <script src="popcorn.openmap.unit.js"></script>
 </head>
 <body>
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
-    controls preload='none' 
-    width= '250px'
-    poster="../../test/poster.png"> 
 
-    <source id='mp4'
+  <video id="video"
+    controls preload="none"
+    width= "250px"
+    poster="../../test/poster.png">
+
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4;' codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg;' codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
-  <div id="map" style="position:relative;float:left;width:300px;height:400px"></div> 
+  </video>
+  <div id="map" style="position:relative;float:left;width:300px;height:400px"></div>
   <div id="map2" style="position:relative;float:left;width:300px;height:400px"></div>
   <div id="map3" style="position:relative;float:left;width:300px;height:400px"></div>
   <div id="map4" style="position:relative;float:left;width:300px;height:400px"></div>
index b7216cef56bd6e7b083590835424c0a545ebae33..20cf256214d66e6e15501185df60ce83efb3f350 100755 (executable)
 test( "Popcorn OpenMap Plugin", function () {
-  
-  var popped = Popcorn("#video"),
-     expects = 15, 
+
+  var popped = Popcorn( "#video" ),
+     expects = 15,
      count = 0;
-  
-  expect(expects);
-  
+
+  expect( expects );
+
   function plus() {
-    if ( ++count===expects) {
+    if ( ++count===expects ) {
       start();
     }
   }
-  
+
   stop();
 
-  ok ('openmap' in popped, "openmap is a method of the popped instance");
+  ok ( "openmap" in popped, "openmap is a method of the popped instance" );
   plus();
-  
-  ok ( document.getElementById('map').innerHTML === "", "initially, there is nothing inside map" );
+
+  ok ( document.getElementById( "map" ).innerHTML === "", "initially, there is nothing inside map" );
   plus();
-  
-  ok ( document.getElementById('map2').innerHTML === "", "initially, there is nothing inside map2" );
+
+  ok ( document.getElementById( "map2" ).innerHTML === "", "initially, there is nothing inside map2" );
   plus();
 
-  ok ( document.getElementById('map3').innerHTML === "", "initially, there is nothing inside map3" );
+  ok ( document.getElementById( "map3" ).innerHTML === "", "initially, there is nothing inside map3" );
   plus();
-  
+
   popped.openmap({
     start: 0,
     end: 4,
-    type: 'ROADMAP',
-    target: 'map',
+    type: "ROADMAP",
+    target: "map",
     lat: 43.665429,
     lng: -79.403323,
     zoom: 10
-  } )
+  })
   .openmap({
     start: 0,
     end: 4,
-    type: 'SATELLITE',
-    target: 'map2',
+    type: "SATELLITE",
+    target: :map2",
     lat: 40.943926,
     lng: -78.968525,
     zoom: 9
-  } )
-  .openmap( {
+  })
+  .openmap({
     start: 0,
     end: 4,
-    type: 'TERRAIN',
-    target: 'map3',
+    type: "TERRAIN",
+    target: "map3",
     lat: 40.943926,
     lng: -78.968525,
     zoom: 14
-  } )
-  .openmap( {
+  })
+  .openmap({
     start: 0,
     end: 4,
-    target: 'map4',
+    target: "map4",
     lat: 40.943926,
     lng: -78.968525,
     zoom: "14"
-  } )
-  .volume(0)
+  })
+  .volume( 0 )
   .play();
 
   setupId = popped.getLastTrackEventId();
 
   popped.exec( 3, function() {
-    ok(OpenLayers, "OpenLayers is available");
+    ok( OpenLayers, "OpenLayers is available" );
     plus();
 
-    ok (document.getElementById('openmapdiv1'), "First map is on the page" );
+    ok ( document.getElementById( "openmapdiv1" ), "First map is on the page" );
     plus();
 
-    equals (document.getElementById('openmapdiv1').offsetParent.id, "map", "First map is inside the 'map' div" );
+    equals ( document.getElementById( "openmapdiv1" ).offsetParent.id, "map", "First map is inside the 'map' div" );
     plus();
 
-    ok (document.getElementById('openmapdiv2'), "Second map is on the page" );
+    ok ( document.getElementById( "openmapdiv2" ), "Second map is on the page" );
     plus();
 
-    equals (document.getElementById('openmapdiv2').offsetParent.id, "map2", "Second map is inside the 'map2' div" );
+    equals ( document.getElementById( "openmapdiv2" ).offsetParent.id, "map2", "Second map is inside the 'map2' div" );
     plus();
 
-    ok (document.getElementById('openmapdiv3'), "Third map is on the page" );
+    ok ( document.getElementById( "openmapdiv3" ), "Third map is on the page" );
     plus();
 
-    equals (document.getElementById('openmapdiv3').offsetParent.id, "map3", "Third map is inside the 'map3' div" );
+    equals ( document.getElementById( "openmapdiv3" ).offsetParent.id, "map3", "Third map is inside the 'map3' div" );
     plus();
 
-    ok (document.getElementById('openmapdiv4'), "Fourth map is on the page" );
+    ok ( document.getElementById( "openmapdiv4" ), "Fourth map is on the page" );
     plus();
-    equals (document.getElementById('openmapdiv4').offsetParent.id, "map4", "Fourth map is inside the 'map4' div" );
+    equals ( document.getElementById( "openmapdiv4" ).offsetParent.id, "map4", "Fourth map is inside the 'map4' div" );
     plus();
 
   } )
   .exec( 5, function() {
-    ok (document.getElementById('openmapdiv2').style.display === "none" && 
-        document.getElementById('openmapdiv3').style.display === "none" && 
-        document.getElementById('openmapdiv4').style.display === "none" &&
-        document.getElementById('openmapdiv1').style.display === "none", "All three maps are no longer visible" );
+    ok ( document.getElementById( "openmapdiv2" ).style.display === "none" &&
+        document.getElementById( "openmapdiv3" ).style.display === "none" &&
+        document.getElementById( "openmapdiv4" ).style.display === "none" &&
+        document.getElementById( "openmapdiv1" ).style.display === "none", "All three maps are no longer visible" );
     plus();
     popped.pause().removeTrackEvent( setupId );
-    ok( !document.getElementById('actualmap3'), "removed map was properly destroyed" );
+    ok( !document.getElementById( "actualmap3" ), "removed map was properly destroyed" );
     plus();
 
-  } );
-} );
+  });
+});
index 0eafa020ddf112c65e9c3f2003d1c8f121e136bd..018bba2a3104a7faeefa4a1ffa8be0171cd72249 100755 (executable)
 
       <source id="mp4"
         src="../../test/trailer.mp4"
-        type="video/mp4; codecs='avc1, mp4a'" />
+        type='video/mp4; codecs="avc1, mp4a"' />
 
       <source id="ogv"
         src="../../test/trailer.ogv"
-        type="video/ogg; codecs='theora, vorbis'" />
+        type='video/ogg; codecs="theora, vorbis"' />
 
       <p>Your user agent does not support the HTML5 Video element.</p>
 
index 90b30147650ff7c3aa4c7f79829ccfc9f7bc811f..ec84b1ddd7b647bec840e96194e3fabb17ea9b67 100755 (executable)
 
     <source id="mp4"
       src="../../test/trailer.mp4"
-      type="video/mp4; codecs='avc1, mp4a'" />
+      type='video/mp4; codecs="avc1, mp4a"' />
 
     <source id="ogv"
       src="../../test/trailer.ogv"
-      type="video/ogg; codecs='theora, vorbis'" />
+      type='video/ogg; codecs="theora, vorbis"' />
 
     <p>Your user agent does not support the HTML5 Video element.</p>
   </video>
 
     <source id="mp4"
       src="../../test/trailer.mp4"
-      type="video/mp4; codecs='avc1, mp4a'">
+      type='video/mp4; codecs="avc1, mp4a"'>
 
     <source id="ogv"
       src="../../test/trailer.ogv"
-      type="video/ogg; codecs='theora, vorbis'">
+      type='video/ogg; codecs="theora, vorbis"'>
 
     <p>Your user agent does not support the HTML5 Video element.</p>
   </video>
index 33f7a2195e63dcd2e007738f9e42089995305455..41a32b76e46c5ed44fd75ec4b391e87f9d433f0b 100644 (file)
@@ -1,10 +1,10 @@
 <html>
 <head>
-  
+
   <title>Popcorn processing Plug-in Simple Demo</title>
   <script src="../../popcorn.js"></script>
   <script src="popcorn.processing.js"></script>
-  
+
   <script>
     document.addEventListener( "DOMContentLoaded", function () {
       var p = Popcorn( "#video" )
 </head>
 <body>
   <h1 id="qunit-header">Popcorn processing Plug-in Simple Demo</h1>
-  
+
   <div>
-    <video id='video'
+    <video id="video"
       controls preload="auto"
-      width= '250px'
+      width= "250px"
       poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
         type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
         type='video/ogg; codecs="theora, vorbis"'>
 
index e1ddc5c82fa23152b05dbec26e64c2c23c45be57..47d327f9b73fcbaefeea77ccc787194d66c91dff 100644 (file)
@@ -2,9 +2,9 @@
  * Processing Popcorn Plug-In
  *
  * This plugin adds a Processing.js sketch to be added to a target div or canvas.
- * 
+ *
  * Options parameter needs to specify start, end, target and  sketch attributes
- * -Start is the time [in seconds] that you want the sketch to display and start looping. 
+ * -Start is the time [in seconds] that you want the sketch to display and start looping.
  * -End is the time [in seconds] you want the sketch to become hidden and stop looping.
  * -Target is the id of the div or canvas you want the target sketch to be displayed in. ( a target that is a div will have a canvas created and placed inside of it. )
  * -Sketch specifies the filename of the Procesing code to be loaded into Processing.js
@@ -29,7 +29,7 @@
   Popcorn.plugin( "processing" , function ( options ) {
 
     var init = function( context ) {
-    
+
       var initProcessing,
         canvas;
 
       }
 
       options.parentTarget = document.getElementById( options.target );
-      
+
       if ( !options.parentTarget && Popcorn.plugin.debug ) {
         throw new Error( "target container doesn't exist" );
       }
-      
+
       initProcessing = function() {
         var addListeners = function() {
           context.listen( "pause", function () {
@@ -57,7 +57,7 @@
             }
           });
         };
-        
+
         if ( window.Processing ) {
 
           options.pjsInstance = new Processing( options.canvas, options.processingCode );
           });
 
           options._running && !context.media.paused && options.pjsInstance.loop();
-          
+
           options.noPause = options.noPause || false;
-          !options.noPause && addListeners(); 
-          options.codeReady = true;         
+          !options.noPause && addListeners();
+          options.codeReady = true;
         } else {
           setTimeout ( function() {
             initProcessing.call( this );
             }, 10 );
         }
       };
-      
+
       canvas = document.createElement( "canvas" );
       canvas.id = Popcorn.guid( options.target + "-sketch-" );
       canvas[ "data-processing-sources" ] =  options.sketch;
-      canvas.style.display = "none";   
+      canvas.style.display = "none";
       options.canvas = canvas;
-      
+
       options.parentTarget && options.parentTarget.appendChild( options.canvas );
 
       if ( options.sketch ) {
     return {
 
       _setup: function( options ) {
-        
+
         options.codeReady = false;
 
         init( this );
       },
 
       end: function( event, options ) {
-        
+
         options.pjsInstance && options.pjsInstance.noLoop();
         options.canvas.style.display = "none";
       },
-      
+
       _teardown: function( options ) {
         options.pjsInstance && options.pjsInstance.exit();
         options.parentTarget && options.parentTarget.removeChild( options.canvas );
       website: "cadecairos.blogspot.com, ben1amin.wordpress.org"
     },
     options: {
-      start :   { elem: "input", type: "text", label: "In" },
-      end :     { elem: "input", type: "text", label: "Out" },
-      target :  { elem: "input", type: "text", label: "Target" },
-      sketch :  { elem: "input", type: "text", label: "Sketch" },
-      noPause : { elem: "select", options: [ "TRUE", "FALSE" ], label: "No Loop" }
+      start:   {
+        elem: "input",
+        type: "text",
+        label: "In"
+      },
+      end: {
+        elem: "input",
+        type: "text",
+        label: "Out"
+      },
+      target: {
+        elem: "input",
+        type: "text",
+        label: "Target"
+      },
+      sketch: {
+        elem: "input",
+        type: "text",
+        label: "Sketch"
+      },
+      noPause: {
+        elem: "select",
+        options: [ "TRUE", "FALSE" ],
+        label: "No Loop"
+      }
     }
   });
 }( Popcorn ));
index 6dd7ad75e1b668b21480ce6b1127e60b25d33d85..446d658c7d6503aea5b9b540ff038fc15674cf74 100644 (file)
@@ -1,10 +1,10 @@
 <html>
 <head>
-  
+
   <title>Popcorn processing unit Tests</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  
+
   <script src="../../popcorn.js"></script>
   <script src="popcorn.processing.js"></script>
   <script src="popcorn.processing.unit.js"></script>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
   <div>
-    <video id='video'
-      controls preload='none'
-      width= '250px'
+    <video id="video"
+      controls preload="none"
+      width= "250px"
       poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
         type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
         type='video/ogg; codecs="theora, vorbis"'>
 
index e44c5c7480dc19508f26c83cad1318d1d857ffde..881b74058a0011ca2fa482d5b52e7de65982b11a 100644 (file)
@@ -10,27 +10,27 @@ test( "Processing plugin tests", function() {
       trackids = [];
 
   expect( expects );
-  
+
   function plus() {
     if ( ++count === expects ) {
       start();
     }
   }
-  
+
   stop();
-  
+
   ok( "processing" in popped, "processing is a method of the popped instance" );
   plus();
 
   equals( processingDiv.innerHTML, "", "'processing-div-1' is empty" );
   plus();
-  
+
   equals( processingDiv2.innerHTML, "", "'processing-div-2' is empty" );
   plus();
-  
+
   equals( processingDiv3.innerHTML, "", "'processing-div-3' is empty" );
   plus();
-  
+
   equals( processingDiv4.innerHTML, "", "'processing-div-4' is empty" );
   plus();
 
@@ -41,7 +41,7 @@ test( "Processing plugin tests", function() {
     sketch: "test.pjs"
   });
   trackids.push( popped.getLastTrackEventId() );
-  
+
   popped.processing({
     start: 1,
     end: 3,
@@ -49,7 +49,7 @@ test( "Processing plugin tests", function() {
     sketch: "test2.pjs"
   });
   trackids.push( popped.getLastTrackEventId() );
-  
+
   popped.processing({
     start: 3,
     end: 4,
@@ -65,7 +65,7 @@ test( "Processing plugin tests", function() {
     sketch: "test2.pjs"
   });
   trackids.push( popped.getLastTrackEventId() );
-   
+
   popped.exec( 0.5, function() {
     equals( processingDiv.children[ 0 ].style.display, "inline", "canvas '" + processingDiv.children[ 0 ].id + "' is displayed" );
     plus();
@@ -75,7 +75,7 @@ test( "Processing plugin tests", function() {
     plus();
     equals( processingDiv4.children[ 0 ].style.display, "none", "canvas '" + processingDiv4.children[ 0 ].id + "' is hidden" );
     plus();
-    //TODO: David Humphrey has written code that allows for listening to events on Processing instances. when 
+    //TODO: David Humphrey has written code that allows for listening to events on Processing instances. when
     // it lands In the next processing release we'll be able to detect if a processing instance is looping or not.
     // this is required in order to test the noPause functionality (automatically)
   })
@@ -97,7 +97,7 @@ test( "Processing plugin tests", function() {
     plus();
     equals( processingDiv4.children[ 0 ].style.display, "inline", "canvas '" + processingDiv4.children[ 0 ].id + "' is displayed" );
     plus();
-  }).exec( 4.5, function() { 
+  }).exec( 4.5, function() {
     var idx = 5;
     while ( --idx ) {
       popped.removeTrackEvent( trackids.pop() );
@@ -105,19 +105,19 @@ test( "Processing plugin tests", function() {
       plus();
     }
   });
-  
+
   ok( "processing" in popped, "processing is a method of the popped instance" );
   plus();
-  
+
   //check that four canvases were created
-  canvases = document.querySelectorAll( "canvas" ); 
+  canvases = document.querySelectorAll( "canvas" );
   equals( canvases.length, 4, "four canvases are present" );
   plus();
 
   //enable this when ticket #583 lands
   //Popcorn.forEach( canvases, function( ctx, idx ) {
   [].forEach.call( canvases, function( ctx ) {
- 
+
     var idCount = 0, i = -1, len = canvases.length;
     for ( ; ++i < len; ){
       if ( ctx.id === canvases[ i ].id ) {
@@ -143,6 +143,6 @@ test( "Processing plugin tests", function() {
     ok(true, 'empty event was caught by debug');
     plus();
   }
-  
+
   popped.play();
 });
index bba8e96585b003c46f28c665f040d22ae86d514d..811fcb49ef8f44f8a5dd833c50b6e27523170166 100755 (executable)
@@ -2,28 +2,24 @@
 <html>
 <head>
   <title>Popcorn Subtitle Plug-in Demo</title>
-  
   <script src="../../popcorn.js"></script>
-
   <script src="popcorn.subtitle.js"></script>
   <script>
-    document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
-      .volume(0)
-      .play() 
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video" )
+      .volume( 0 )
+      .play()
       .subtitle({
-        start: 5, // seconds
-        end: 15, // seconds
-        text: 'this is the first subtitle of 2011',
-      } )
+        start: 5,
+        end: 15,
+        text: "this is the first subtitle of 2011",
+      })
       .subtitle({
-        start: 20, // seconds
-        end: 45, // seconds
-        text: 'this is the second subtitle of 2011',
-      } )
-
+        start: 20,
+        end: 45,
+        text: "this is the second subtitle of 2011",
+      })
     }, false);
-
   </script>
 </head>
 <body>
   <p> A subtitle displaying 'this is the second subtitle of 2011' will appear at 20 seconds and disappear at 45 seconds.</p>
   <div>
 
-    <video id='video' 
+    <video id="video"
       controls height="480" width="854"
-      poster="../../test/poster.png"> 
+      poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4; codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg; codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
-    </video> 
+    </video>
   </div>
 
 </body>
index 50b4043d53a681ea066c9a3a0d5b5dac1e318613..58dbd8da8cf8a2658544108af7b177b0e9c5520c 100755 (executable)
@@ -33,7 +33,7 @@
       };
 
   /**
-   * Subtitle popcorn plug-in 
+   * Subtitle popcorn plug-in
    * Displays a subtitle over the video, or in the target div
    * Options parameter will need a start, and end.
    * Optional parameters are target and text.
@@ -44,7 +44,7 @@
    * Text is the text of the subtitle you want to display.
    *
    * @param {Object} options
-   * 
+   *
    * Example:
      var p = Popcorn('#video')
         .subtitle({
@@ -57,7 +57,7 @@
    */
 
   Popcorn.plugin( "subtitle" , {
-    
+
       manifest: {
         about: {
           name: "Popcorn Subtitle Plugin",
         },
         options: {
           start: {
-            elem: "input", 
-            type: "text", 
+            elem: "input",
+            type: "text",
             label: "In"
           },
           end: {
-            elem: "input", 
-            type: "text", 
+            elem: "input",
+            type: "text",
             label: "Out"
           },
           target: "subtitle-container",
           text: {
-            elem: "input", 
-            type: "text", 
+            elem: "input",
+            type: "text",
             label: "Text"
           }
         }
         newdiv.style.display = "none";
 
         // Creates a div for all subtitles to use
-        ( !this.container && ( !options.target || options.target === "subtitle-container" ) ) && 
+        ( !this.container && ( !options.target || options.target === "subtitle-container" ) ) &&
           createDefaultContainer( this );
 
         // if a target is specified, use that
         if ( options.target && options.target !== "subtitle-container" ) {
           options.container = document.getElementById( options.target );
-        } else { 
+        } else {
           // use shared default container
           options.container = this.container;
         }
         };
       },
       /**
-       * @member subtitle 
-       * The start function will be executed when the currentTime 
-       * of the video  reaches the start time provided by the 
+       * @member subtitle
+       * The start function will be executed when the currentTime
+       * of the video  reaches the start time provided by the
        * options variable
        */
       start: function( event, options ){
         options.showSubtitle( options, options.text );
       },
       /**
-       * @member subtitle 
-       * The end function will be executed when the currentTime 
-       * of the video  reaches the end time provided by the 
+       * @member subtitle
+       * The end function will be executed when the currentTime
+       * of the video  reaches the end time provided by the
        * options variable
        */
       end: function( event, options ) {
       _teardown: function ( options ) {
         options.container.removeChild( options.innerContainer );
       }
-   
+
   });
 
 })( Popcorn );
index ff84ce35cb1e6de743d3d7edde4c4f42480bc5cc..45daaf3aa1689e52c1876637405c428fa19735c8 100755 (executable)
@@ -4,13 +4,11 @@
   <title>Popcorn Subtitle Plug-in Test</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
   <script src="../../popcorn.js"></script>
-  
   <script src="popcorn.subtitle.js"></script>
   <script src="popcorn.subtitle.unit.js"></script>
 </head>
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
-    controls preload='none' 
-    width= '250px'
-    poster="../../test/poster.png"> 
 
-    <source id='mp4'
+  <video id="video"
+    controls preload="none"
+    width= "250px"
+    poster="../../test/poster.png">
+
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
   </video>
-  <video id='video2' 
-    controls preload='none' 
-    width= '250px'
-    poster="../../test/poster.png"> 
+  <video id="video2"
+    controls preload="none"
+    width= "250px"
+    poster="../../test/poster.png">
 
-    <source id='mp4'
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
+  </video>
 </body>
 </html>
index c4c53267a5a8ef434efc5be382d2931ff5ca2f83..2bdabb5ce131c4ade331c99cb207ef007deba38b 100755 (executable)
@@ -1,5 +1,5 @@
-test("Popcorn Subtitle Plugin", function () {
- 
+test( "Popcorn Subtitle Plugin", function () {
+
   var popped = Popcorn( "#video" ),
       popped2 = Popcorn( "#video2" ),
       expects = 12,
@@ -8,36 +8,36 @@ test("Popcorn Subtitle Plugin", function () {
       subLeft = 9001,
       subtitlediv,
       subtitle2div;
- 
-  expect(expects);
- 
+
+  expect( expects );
+
   function plus() {
     if ( ++count === expects ) {
       start();
     }
   }
- 
+
   stop( 12000 );
-   
-  ok ( 'subtitle' in popped, "subtitle is a method of the popped instance" );
+
+  ok ( "subtitle" in popped, "subtitle is a method of the popped instance" );
   plus();
- 
+
   popped.subtitle({
       start: 0,
       end: 2,
-      text: 'this is the first subtitle of 2011',
-    } )
+      text: "this is the first subtitle of 2011",
+    })
   .subtitle({
       start: 2,
       end: 4,
-      text: 'this is the second subtitle of 2011',
-    } )
+      text: "this is the second subtitle of 2011",
+    })
   .subtitle({
       start: 5,
       end: 7,
-      text: 'this is the third subtitle of 2011',
+      text: "this is the third subtitle of 2011",
     } )
-    .volume(0)
+    .volume( 0 )
     .play();
 
   subtitlediv = popped.getTrackEvent( popped.getLastTrackEventId() ).container;
@@ -45,42 +45,41 @@ test("Popcorn Subtitle Plugin", function () {
   popped.subtitle({
     start: 7,
     end: 9,
-    text: 'instance one test'
+    text: "instance one test"
   });
 
   popped2.subtitle({
       start: 7,
       end: 9,
-      text: 'instance two test'
+      text: "instance two test"
     })
-    .volume(0)
+    .volume( 0 )
     .play().pause();
 
   subtitle2div = popped2.getTrackEvent( popped2.getLastTrackEventId() ).container;
 
   popped.exec( 1, function() {
-   
+
     popped.media.pause();
     equals( subtitlediv.children[ 0 ].innerHTML, "this is the first subtitle of 2011", "subtitle displaying correct information" );
     plus();
-   
- 
+
     // capturing location now, to check against later,
     // a subtitle must be displayed to get valid data
     // which is why we do this in exec
     subLeft = subtitlediv.style.left;
     subTop  = subtitlediv.style.top;
- 
+
     // changing position
     popped.media.style.position = "absolute";
     popped.media.style.left = "400px";
     popped.media.style.top = "600px";
     popped.media.play();
-   
+
   });
- 
+
   popped.exec( 3, function() {
- 
+
     popped.media.pause();
 
     // check position of subttile that should of moved with video,
@@ -89,7 +88,7 @@ test("Popcorn Subtitle Plugin", function () {
     plus();
     ok( subtitlediv.style.top !== subTop, "subtitle's top position has changed" );
     plus();
- 
+
     // we know values have changed, but how accurate are they?
     // check values against the video's values
     // we need four checks because if we just check against video's position,
@@ -98,22 +97,22 @@ test("Popcorn Subtitle Plugin", function () {
     plus();
     ok( Popcorn.position( subtitlediv ).top > popped.position().top, "subtitle top position moved" );
     plus();
- 
-    equals (subtitlediv.children[ 1 ].innerHTML, "this is the second subtitle of 2011", "subtitle displaying correct information" );
+
+    equals ( subtitlediv.children[ 1 ].innerHTML, "this is the second subtitle of 2011", "subtitle displaying correct information" );
     plus();
 
     popped.media.play();
-   
+
   });
- 
+
   popped.exec( 4, function() {
-   
+
     popped.media.pause();
-    equals (subtitlediv.children[ 1 ].innerHTML, "", "subtitle is clear" );
+    equals ( subtitlediv.children[ 1 ].innerHTML, "", "subtitle is clear" );
     plus();
 
     popped.media.play();
- 
+
   });
 
   popped.exec( 8, function() {
@@ -124,24 +123,23 @@ test("Popcorn Subtitle Plugin", function () {
   popped2.exec( 8, function() {
     popped2.media.pause();
 
-    equals (subtitlediv.children[ 3 ].innerHTML, "instance one test", "subtitle displaying correct information" );
+    equals ( subtitlediv.children[ 3 ].innerHTML, "instance one test", "subtitle displaying correct information" );
     plus();
-    equals (subtitle2div.children[ 0 ].innerHTML, "instance two test", "subtitle displaying correct information" );
+    equals ( subtitle2div.children[ 0 ].innerHTML, "instance two test", "subtitle displaying correct information" );
     plus();
 
     popped.media.play();
   });
 
   popped.exec( 10, function() {
-    ok ( document.getElementById( 'subtitle-0' ).style.display === "none" && 
-        document.getElementById( 'subtitle-1' ).style.display === "none" &&
-        document.getElementById( 'subtitle-2' ).style.display === "none", "All subtitles are no longer visible" );
+    ok ( document.getElementById( "subtitle-0" ).style.display === "none" &&
+        document.getElementById( "subtitle-1" ).style.display === "none" &&
+        document.getElementById( "subtitle-2" ).style.display === "none", "All subtitles are no longer visible" );
     plus();
 
     popped.pause().removeTrackEvent( popped.data.trackEvents.byStart[ 6 ]._id );
 
-    ok( !document.getElementById( 'subtitle-2' ), "removed subtitle div was properly destroyed"  );
+    ok( !document.getElementById( "subtitle-2" ), "removed subtitle div was properly destroyed"  );
     plus();
   });
 });
-
index 3b2ff517d327d433037bc4903d53c6e88ff243ba..c07bccb29d261d8f0f6cb86c9f6978b5f162dfae 100755 (executable)
 
       <source id="mp4"
         src="../../test/trailer.mp4"
-        type="video/mp4; codecs='avc1, mp4a'">
+        type='video/mp4; codecs="avc1, mp4a"'>
 
       <source id="ogv"
         src="../../test/trailer.ogv"
-        type="video/ogg; codecs='theora, vorbis'">
+        type='video/ogg; codecs="theora, vorbis"'>
 
       <p>Your user agent does not support the HTML5 Video element.</p> 
 
index d18dae78da6ca9415ae94c70f424f48a5d18c8e6..b06ad15dc5f908c7ae8c295105482876843beac4 100755 (executable)
 
     <source id="mp4"
       src="../../test/trailer.mp4"
-      type="video/mp4; codecs='avc1, mp4a'">
+      type='video/mp4; codecs="avc1, mp4a"'>
 
     <source id="ogv"
       src="../../test/trailer.ogv"
-      type="video/ogg; codecs='theora, vorbis'">
+      type='video/ogg; codecs="theora, vorbis"'>
 
     <p>Your user agent does not support the HTML5 Video element.</p>
 
index 3d8a48bcd8f62850f9a4cced902632e4f0d4a158..08b7934fbac02539197ad87e96c08961c30d8612 100644 (file)
@@ -2,64 +2,64 @@
 <html>
 <head>
   <title>Popcorn Google Feed Plug-in Demo</title>
-  
+
   <script src="../../popcorn.js"></script>
   <script src="popcorn.timeline.js"></script>
   <script>
     document.addEventListener('DOMContentLoaded', function () {
       var p = Popcorn('#video')
-      .volume(0)
+      .volume( 0 )
       .play()
       .timeline({
-        start: 1, // seconds
+        start: 1,
         target: "timeline",
         title: "This is a title",
         text: "this is some interesting text that goes inside",
         innerHTML: "Click here for <a href='http://www.google.ca'>Google</a>" ,
         direction: "up"
-      } )
+      })
       .timeline({
-        start: 3, // seconds
+        start: 3,
         target: "timeline",
         title: "double as interesting",
         text: "this is some interesting text that goes inside",
         innerHTML: "Maybe a button? <button onClick=\"window.location.href='http://www.google.com'\">Click Me</button>",
         direction: "up"
-      } )
+      })
      .timeline({
-        start: 7, // seconds
+        start: 7,
         end: 700,
         target: "timeline",
         title: "3x as interesting",
         text: "this is some interesting text that goes inside",
         innerHTML: "",
         direction: "up"
-      } )
+      })
       .timeline({
-        start: 1, // seconds
+        start: 1,
         target: "timeline2",
         title: "This is a title",
         text: "this is some interesting text that goes inside",
         innerHTML: "Click here for <a href='http://www.google.ca'>Google</a>" ,
         direction: "down"
-      } )
+      })
       .timeline({
-        start: 3, // seconds
+        start: 3,
         target: "timeline2",
         title: "double as interesting",
         text: "this is some interesting text that goes inside",
         innerHTML: "Maybe a button? <button onClick=\"window.location.href='http://www.google.com'\">Click Me</button>",
         direction: "down"
-      } )
+      })
      .timeline({
-        start: 7, // seconds
+        start: 7,
         end: 700,
         target: "timeline2",
         title: "3x as interesting",
         text: "this is some interesting text that goes inside",
         innerHTML: "",
         direction: "down"
-      } )
+      })
     }, false);
   </script>
 </head>
   <h1 id="qunit-header">Popcorn Timeline Plug-in Demo</h1>
   <p>Continuos timeline elements will be added to the div throughout the video</p>
   <div>
-    <video id='video'
+    <video id="video"
       controls
-      width= '250px'
+      width= "250px"
       poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
         type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
         type='video/ogg; codecs="theora, vorbis"'>
 
index c8638b2a31332431db2f7e001e6c13752007c672..b24559e5c289b31f5c7135a21eac7f75c5968b28 100644 (file)
         container.insertBefore( contentDiv, container.firstChild );
       }
       else {
-        
+
         container.appendChild( contentDiv );
       }
 
     } else if ( Popcorn.plugin.debug ) {
       throw new Error( "target container doesn't exist" );
     }
-    
+
     i++;
 
     //  Default to empty if not used
-    //options.innerHTML = options.innerHTML || "";    
+    //options.innerHTML = options.innerHTML || "";
 
     contentDiv.innerHTML = "<p><span id='big'>" + options.title + "</span><br />" +
     "<span id='mid'>" + options.text + "</span><br />" + options.innerHTML;
-    
+
     return {
 
       start: function( event, options ) {
         contentDiv.style.display = "block";
-        
+
         if( options.direction === "down" ) {
           container.scrollTop = container.scrollHeight;
         }
       },
- 
+
       end: function( event, options ) {
         contentDiv.style.display = "none";
       },
     },
 
     options: {
-      start: { 
+      start: {
         elem: "input",
         type: "text",
         label: "In"
       },
       target: "feed-container",
       title: {
-        elem: "input", 
-        type: "text", 
-        label: "title" 
+        elem: "input",
+        type: "text",
+        label: "title"
       },
       text: {
-        elem: "input", 
-        type: "text", 
-        label: "text" 
+        elem: "input",
+        type: "text",
+        label: "text"
       },
-      innerHTML: { 
-        elem: "input", 
-        type: "text", 
-        label: "innerHTML" 
+      innerHTML: {
+        elem: "input",
+        type: "text",
+        label: "innerHTML"
       },
       direction: {
         elem: "input",
       }
     }
   });
-  
+
 })( Popcorn );
index 488bf66b4cfe931bb8c67fb547f8d64ec0a1f876..902c6b56ced00304452ab6e60596deb035f93da6 100644 (file)
@@ -4,11 +4,11 @@
   <title>Popcorn API</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
+
   <script src="../../popcorn.js"></script>
   <script src="popcorn.timeline.js"></script>
 
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
-    controls preload='none' 
-    width= '250px'
+
+  <video id="video"
+    controls preload="none"
+    width= "250px"
     poster="../../test/poster.png"
-    style="float: left;"> 
+    style="float: left;">
 
-    <source id='mp4'
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
+  </video>
   <div id="timeline-up" style="float:left;width:400px;height:200px;overflow:auto"></div>
   <div id="timeline-down" style="float:left;width:400px;height:200px;overflow:auto"></div>
 </body>
index f337149754aadb696a7f68765e68a2727fe1dee0..a4c76183b1b875f535da11b09459d4fc1f0e878e 100644 (file)
@@ -1,20 +1,20 @@
-test("Popcorn Timeline Plugin", function () {
-  
+test( "Popcorn Timeline Plugin", function () {
+
   var popped = Popcorn( "#video" ),
       expects = 17,
-      upIds = downIds = [], 
+      upIds = downIds = [],
       count = 0,
       timelineUp = document.getElementById( "timeline-up" ),
       timelineDown = document.getElementById( "timeline-down" );
-  
+
   expect( expects );
-  
+
   function plus() {
     if ( ++count === expects ) {
       start();
     }
   }
-  
+
   stop();
 
     ok ( "timeline" in popped, "timeline is a method of the popped instance" );
@@ -23,60 +23,60 @@ test("Popcorn Timeline Plugin", function () {
     plus();
     equals ( document.getElementById( "timeline-down" ).firstChild, undefined, "initially, there is nothing inside the 'timeline-down' feed" );
     plus();
-  
+
     popped.timeline({
-      start: 1, // seconds
+      start: 1,
       target: "timeline-up",
       title: "This is a title",
       text: "this is some interesting text that goes inside",
       innerHTML: "Click here for <a href='http://www.google.ca'>Google</a>"
-    } );
+    });
     upIds.push( popped.getLastTrackEventId() );
-    
+
     popped.timeline({
-      start: 2, // seconds
+      start: 2,
       target: "timeline-up",
       title: "double as interesting",
       text: "this is some interesting text that goes inside",
-      innerHTML: "Maybe a button? <button onClick=\"window.location.href='http://www.google.com'\">Click Me</button>" 
-    } );
+      innerHTML: "Maybe a button? <button onClick=\"window.location.href='http://www.google.com'\">Click Me</button>"
+    });
     upIds.push( popped.getLastTrackEventId() );
-    
+
     popped.timeline({
-      start: 1, // seconds
+      start: 1,
       target: "timeline-down",
       title: "This is a title",
       text: "this is some interesting text that goes inside",
       innerHTML: "Maybe a button? <button onClick=\"window.location.href='http://www.google.com'\">Click Me</button>",
       direction: "down"
-    } );
+    });
     downIds.push( popped.getLastTrackEventId() );
-    
+
     popped.timeline({
-      start: 2, // seconds
+      start: 2,
       target: "timeline-down",
       title: "double as interesting",
       text: "this is some interesting text that goes inside",
       innerHTML: "Maybe a button? <button onClick=\"window.location.href='http://www.google.com'\">Click Me</button>",
       direction: "down"
-    } );
+    });
     downIds.push( popped.getLastTrackEventId() );
-    
-    popped.volume(0);
-  
+
+    popped.volume( 0 );
+
   popped.exec( 1.5, function() {
     //up
     ok ( document.getElementById( "timelineDiv1" ), "First timeline is on the page" );
     plus();
     equals ( document.getElementById("timelineDiv1" ).parentNode.parentNode.id, "timeline-up", "First timeline is inside the 'timeline-up' div" );
     plus();
-    
+
     //down
     ok ( document.getElementById( "timelineDiv3" ), "First timeline is on the page" );
     plus();
     equals ( document.getElementById("timelineDiv3" ).parentNode.parentNode.id, "timeline-down", "First Timeline is inside the 'timeline-down' div" );
     plus();
-    
+
   });
   popped.exec( 2.5, function() {
    //up
@@ -88,9 +88,9 @@ test("Popcorn Timeline Plugin", function () {
     plus();
     equals ( timelineUp.firstChild.firstChild.id,  "timelineDiv2", "'timelineDiv2' is the first child in 'timeline-up'" );
     plus();
-    
+
     //down
-    
+
     ok ( timelinediv4, "Second down timeline is on the page" );
     plus();
     equals ( timelinediv4.parentNode.parentNode.id, "timeline-down", "timelineDiv4 is inside the 'timeline-down' div" );
@@ -99,14 +99,14 @@ test("Popcorn Timeline Plugin", function () {
     plus();
   });
   popped.exec( 4, function() {
-    ok (document.getElementById( "timelineDiv1" ).style.display !== "none" && 
+    ok ( document.getElementById( "timelineDiv1" ).style.display !== "none" &&
         document.getElementById( "timelineDiv2" ).style.display !== "none", "Both timelines in 'timeline-up are not visible" );
          plus();
-         
-         ok (document.getElementById( "timelineDiv3" ).style.display !== "none" && 
+
+         ok ( document.getElementById( "timelineDiv3" ).style.display !== "none" &&
         document.getElementById( "timelineDiv4" ).style.display !== "none", "Both timelines in 'timeline-down' are not visible" );
          plus();
-    
+
     var uid, did;
     while ( uid = upIds.pop() ) {
       popped.removeTrackEvent( uid );
@@ -114,14 +114,14 @@ test("Popcorn Timeline Plugin", function () {
     while ( did = downIds.pop() ) {
       popped.removeTrackEvent( did );
     }
-    
+
     popped.pause();
     equals( document.getElementById( "timeline-up" ).firstChild, null, "removed timeline was properly destroyed"  );
     plus();
     equals( document.getElementById( "timeline-down" ).firstChild, null, "removed timeline was properly destroyed"  );
     plus();
   });
-  
+
   popped.play();
-  
+
 });
index 689bb796f7b91ca35bd0511e80ddb11141b3d689..d189505a4e147c86190d422f1583fd58026dc5d8 100755 (executable)
@@ -2,30 +2,27 @@
 <html>
 <head>
   <title>Popcorn Twitter Plug-in Demo</title>
-  
   <script src="../../popcorn.js"></script>
-
   <script src="popcorn.twitter.js"></script>
   <script>
-    document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video" )
       .twitter({
-        start: 5, // seconds
-        end: 15, // seconds
-        title: 'Steve Song',
-        src: '@stevesong',
-        target: 'twitterdiv',
-      } )
+        start: 5,
+        end: 15,
+        title: "Steve Song",
+        src: "@stevesong",
+        target: "twitterdiv",
+      })
       .twitter({
-        start: 20, // seconds
-        end: 45, // seconds
-        title: 'Oil Spill',
-        src: '#oilspill',
-        target: 'twitterdiv'
-      } )
+        start: 20,
+        end: 45,
+        title: "Oil Spill",
+        src: "#oilspill",
+        target: "twitterdiv"
+      })
       .play();
     }, false);
-
   </script>
 </head>
 <body>
   <p>Twitter profile '@stevesong' widget will appear at 5 seconds and disappear at 15 seconds.</p>
   <p>More Twitter hash '#oilspill' widget will appear at 20 seconds and disappear at 45 seconds.</p>
   <div>
-    <video id='video' 
+    <video id="video"
       controls
-      width= '250px'
-      poster="../../test/poster.png"> 
+      width= "250px"
+      poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4; codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg; codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
-    </video> 
+    </video>
   </div>
   <div id="twitterdiv"></div>
 </body>
index 490899cb900be709495621d9c23b647d7b50093b..885b3a32fdf527100058fc0f75d640a3cfeaf733 100755 (executable)
@@ -1,10 +1,10 @@
 // PLUGIN: TWITTER
 
-(function (Popcorn) {
+(function ( Popcorn ) {
   var scriptLoading = false;
 
   /**
-   * Twitter popcorn plug-in 
+   * Twitter popcorn plug-in
    * Appends a Twitter widget to an element on the page.
    * Options parameter will need a start, end, target and source.
    * Optional parameters are height and width.
@@ -15,9 +15,9 @@
    *  appended to, this target element must exist on the DOM
    * Height is the height of the widget, defaults to 200
    * Width is the width of the widget, defaults to 250
-   * 
+   *
    * @param {Object} options
-   * 
+   *
    * Example:
      var p = Popcorn('#video')
         .twitter({
 
       manifest: {
         about:{
-          name:    "Popcorn Twitter Plugin",
+          name: "Popcorn Twitter Plugin",
           version: "0.1",
-          author:  "Scott Downe",
+          author: "Scott Downe",
           website: "http://scottdowne.wordpress.com/"
         },
         options:{
-          start   : {elem:'input', type:'number', label:'In'},
-          end     : {elem:'input', type:'number', label:'Out'},
-          src     : {elem:'input', type:'text',   label:'Source'},
-          target  : 'twitter-container',
-          height  : {elem:'input', type:'number', label:'Height'},
-          width   : {elem:'input', type:'number', label:'Width'}
+          start: {
+            elem: "input",
+            type: "number",
+            label: "In"
+          },
+          end: {
+            elem: "input",
+            type: "number",
+            label: "Out"
+          },
+          src: {
+            elem: "input",
+            type: "text",
+            label: "Source"
+          },
+          target: "twitter-container",
+          height: {
+            elem: "input",
+            type: "number",
+            label: "Height"
+          },
+          width: {
+            elem: "input",
+            type: "number",
+            label: "Width"
+          }
         }
       },
 
 
         if ( !window.TWTR && !scriptLoading ) {
           scriptLoading = true;
-          Popcorn.getScript("http://widgets.twimg.com/j/2/widget.js");
+          Popcorn.getScript( "http://widgets.twimg.com/j/2/widget.js" );
         }
 
         var target = document.getElementById( options.target );
-
+        // create the div to store the widget
         // setup widget div that is unique per track
-        options.container = document.createElement( 'div' ); // create the div to store the widget
-        options.container.setAttribute('id', Popcorn.guid()); // use this id to connect it to the widget
-        options.container.style.display = "none"; // display none by default
+        options.container = document.createElement( "div" );
+        // use this id to connect it to the widget
+        options.container.setAttribute( "id", Popcorn.guid());
+        // display none by default
+        options.container.style.display = "none";
 
         if ( !target && Popcorn.plugin.debug ) {
           throw new Error( "target container doesn't exist" );
         target && target.appendChild( options.container );
 
         // setup info for the widget
-        var src     = options.src || "",
-            width   = options.width || 250,
-            height  = options.height || 200,
+        var src = options.src || "",
+            width = options.width || 250,
+            height = options.height || 200,
             profile = /^@/.test( src ),
-            hash    = /^#/.test( src ),
+            hash = /^#/.test( src ),
             widgetOptions = {
               version: 2,
-              id: options.container.getAttribute( 'id' ),  // use this id to connect it to the div
+              // use this id to connect it to the div
+              id: options.container.getAttribute( "id" ),
               rpp: 30,
               width: width,
               height: height,
               interval: 6000,
               theme: {
                 shell: {
-                  background: '#ffffff',
-                  color: '#000000'
+                  background: "#ffffff",
+                  color: "#000000"
                 },
                 tweets: {
-                  background: '#ffffff',
-                  color: '#444444',
-                  links: '#1985b5'
+                  background: "#ffffff",
+                  color: "#444444",
+                  links: "#1985b5"
                 }
               },
               features: {
       },
 
       /**
-       * @member Twitter 
-       * The start function will be executed when the currentTime 
-       * of the video  reaches the start time provided by the 
+       * @member Twitter
+       * The start function will be executed when the currentTime
+       * of the video  reaches the start time provided by the
        * options variable
        */
       start: function( event, options ) {
       },
 
       /**
-       * @member Twitter 
-       * The end function will be executed when the currentTime 
-       * of the video  reaches the end time provided by the 
+       * @member Twitter
+       * The end function will be executed when the currentTime
+       * of the video  reaches the end time provided by the
        * options variable
        */
       end: function( event, options ) {
index e03f454ce2110dfa21ac2aeafb9854a63b6776b8..394085f38a980b8066258f6ac6944d9309aa32c8 100755 (executable)
@@ -4,15 +4,13 @@
   <title>Popcorn API</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
   <script src="../../popcorn.js"></script>
   <script src="http://widgets.twimg.com/j/2/widget.js"></script>
   <script src="popcorn.twitter.js"></script>
-
   <script src="popcorn.twitter.unit.js"></script>
 </head>
 <body>
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
-    controls 
-    width= '250px'
-    poster="../../test/poster.png"> 
 
-    <source id='mp4'
+  <video id="video"
+    controls
+    width= "250px"
+    poster="../../test/poster.png">
+
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
-  <div id="twitterdiv"></div>  
+  </video>
+  <div id="twitterdiv"></div>
 </body>
 </html>
index 9ec9d7b802e4b3e4e661ffb40ea1fb6526e589a2..b2571a65cb7bb87631ae7f5bba11945397a41c2b 100755 (executable)
@@ -1,40 +1,40 @@
-test("Popcorn Twitter Plugin", function () {
-  
-  var popped = Popcorn("#video"),
-      expects = 7, 
+test( "Popcorn Twitter Plugin", function () {
+
+  var popped = Popcorn( "#video" ),
+      expects = 7,
       count = 0,
       setupId,
-      twitterdiv = document.getElementById('twitterdiv');
-  
+      twitterdiv = document.getElementById( "twitterdiv" );
+
   expect( expects );
-  
+
   function plus() {
-    if ( ++count === expects) {
+    if ( ++count === expects ) {
       start();
     }
   }
 
-  stop();   
- 
-  ok('twitter' in popped, "twitter is a method of the popped instance");
+  stop();
+
+  ok( "twitter" in popped, "twitter is a method of the popped instance" );
   plus();
 
   equals ( twitterdiv.innerHTML, "", "initially, there is nothing inside the twitterdiv" );
   plus();
-  
+
   try {
-    
-    ok( TWTR, "Twitter constructor exists");
+
+    ok( TWTR, "Twitter constructor exists" );
     plus();
-    
-  } catch (e) {};
+
+  } catch ( e ) {};
 
   popped.twitter({
-    start: 1, // seconds
-    end: 2, // seconds
-    title: 'Steve Song',
-    src: '@stevesong',
-    target: 'twitterdiv',
+    start: 1,
+    end: 2,
+    title: "Steve Song",
+    src: "@stevesong",
+    target: "twitterdiv",
   });
 
   setupId = popped.getLastTrackEventId();
@@ -51,10 +51,10 @@ test("Popcorn Twitter Plugin", function () {
     plus();
 
     popped.pause().removeTrackEvent( setupId );
-    ok( !twitterdiv.children[0], "removed twitter was properly destroyed" );
+    ok( !twitterdiv.children[ 0 ], "removed twitter was properly destroyed" );
     plus();
   });
-  
+
   popped.play();
-  
+
 });
index 5f0ce066322d9fe290bc90f166f95429968668d9..272a0efdfcbcb0aeef4b2900d9123f8564b0174c 100644 (file)
@@ -6,8 +6,8 @@
   <script src="../../popcorn.js"></script>
   <script src="popcorn.webpage.js"></script>
   <script>
-    document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video" )
       .volume( 0 )
       .play()
       .webpage({
 
       <source id="mp4"
         src="../../test/trailer.mp4"
-        type="video/mp4; codecs='avc1, mp4a'">
+        type='video/mp4; codecs="avc1, mp4a"'>
 
       <source id="ogv"
         src="../../test/trailer.ogv"
-        type="video/ogg; codecs='theora, vorbis'">
+        type='video/ogg; codecs="theora, vorbis"'>
 
       <p>Your user agent does not support the HTML5 Video element.</p>
 
index 7bd2feb5c75dba9c6fa37a7cb851bfc2bb78988c..33b95b5ea5e6243c3c4773df218ea41c997a4ffd 100755 (executable)
    */
   Popcorn.plugin( "webpage" , {
     manifest: {
-      about:{
+      about: {
         name: "Popcorn Webpage Plugin",
         version: "0.1",
         author: "@annasob",
         website: "annasob.wordpress.com"
       },
-      options:{
-        id     : {elem:'input', type:'text', label:'Id'},
-        start  : {elem:'input', type:'text', label:'In'},
-        end    : {elem:'input', type:'text', label:'Out'},
-        src    : {elem:'input', type:'text', label:'Src'},
-        target : 'iframe-container'
+      options: {
+        id: {
+          elem: "input",
+          type: "text",
+          label: "Id"
+        },
+        start: {
+          elem: "input",
+          type: "text",
+          label: "In"
+        },
+        end: {
+          elem: "input",
+          type: "text",
+          label: "Out"
+        },
+        src: {
+          elem: "input",
+          type: "text",
+          label: "Src"
+        },
+        target: "iframe-container"
       }
     },
     _setup : function( options ) {
       var target = document.getElementById( options.target );
 
       // make an iframe
-      options._iframe  = document.createElement( 'iframe' );
-      options._iframe.setAttribute('width', "100%");
-      options._iframe.setAttribute('height', "100%");
-      options._iframe.id  = options.id;
+      options._iframe = document.createElement( "iframe" );
+      options._iframe.setAttribute( "width", "100%" );
+      options._iframe.setAttribute( "height", "100%" );
+      options._iframe.id = options.id;
       options._iframe.src = options.src;
-      options._iframe.style.display = 'none';
+      options._iframe.style.display = "none";
 
       if ( !target && Popcorn.plugin.debug ) {
         throw new Error( "target container doesn't exist" );
       }
 
       // add the hidden iframe to the DOM
-      target && target.appendChild(options._iframe);
-      
+      target && target.appendChild( options._iframe );
+
     },
     /**
-     * @member webpage 
-     * The start function will be executed when the currentTime 
-     * of the video  reaches the start time provided by the 
+     * @member webpage
+     * The start function will be executed when the currentTime
+     * of the video  reaches the start time provided by the
      * options variable
      */
-    start: function(event, options){
+    start: function( event, options ){
       // make the iframe visible
       options._iframe.src = options.src;
-      options._iframe.style.display = 'inline';
+      options._iframe.style.display = "inline";
     },
     /**
-     * @member webpage 
-     * The end function will be executed when the currentTime 
-     * of the video  reaches the end time provided by the 
+     * @member webpage
+     * The end function will be executed when the currentTime
+     * of the video  reaches the end time provided by the
      * options variable
      */
-    end: function(event, options){
+    end: function( event, options ){
       // make the iframe invisible
-      options._iframe.style.display = 'none';
+      options._iframe.style.display = "none";
     },
     _teardown: function( options ) {
 
index 238ff9d67fd621811a6ac4730f8fad5a342e36e4..c5149d4595a4b0068338c98b712ca2b2d63ab5fb 100755 (executable)
@@ -4,11 +4,11 @@
   <title>Popcorn API</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
+
   <script src="../../popcorn.js"></script>
   <script src="popcorn.webpage.js"></script>
 
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
-    controls preload='none' 
-    width= '250px'
-    poster="../../test/poster.png"> 
 
-    <source id='mp4'
+  <video id="video"
+    controls preload="none"
+    width= "250px"
+    poster="../../test/poster.png">
+
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
-  <div id="webpagediv"></div>  
+  </video>
+  <div id="webpagediv"></div>
 </body>
 </html>
index 2ee3583e4fcac37b8df8cae75bc25810650547d4..dab08b636944dde402c54f0da22b1a5cdd7ce2c2 100755 (executable)
@@ -6,24 +6,23 @@
   <script src="../../popcorn.js"></script>
   <script src="popcorn.wikipedia.js"></script>
   <script>
-    document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
-      .volume(0)
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video' )
+      .volume( 0 )
       .play() 
       .wikipedia({
-        start: 0, // seconds
-        end: 10, // seconds
-        src: 'http://en.wikipedia.org/wiki/Cape_Town',
+        start: 0,
+        end: 10,
+        src: "http://en.wikipedia.org/wiki/Cape_Town",
         title: "this is an article",
-        target: 'wikidiv'
+        target: "wikidiv"
       })
       .wikipedia({
-        start: 7, // seconds
-        end: 20, // seconds
-        src: 'http://en.wikipedia.org/wiki/S%C3%A3o_Paulo',
-        target: 'wikidiv'
-      } );
-
+        start: 7,
+        end: 20,
+        src: "http://en.wikipedia.org/wiki/S%C3%A3o_Paulo",
+        target: "wikidiv"
+      });
     }, false);
 
   </script>
   <p> A Wiki article about Cape Town will appear at 0 seconds and disappear at 10 seconds.</p>
   <p> A Wiki article about Sao Paolo will appear at 7 seconds and disappear at 20 seconds.</p>
   <div>
-    <video id='video' 
+    <video id="video" 
       controls 
-      width= '250px'
+      width= "250px"
       poster="../../test/poster.png"> 
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
         type='video/mp4; codecs="avc1, mp4a"'> 
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
         type='video/ogg; codecs="theora, vorbis"'> 
 
index 0d6ddf07a20438ab822bf7df9a321aeaf8d3ab39..525bbdcda5fb3a861c738f420e98d49702ace545 100755 (executable)
@@ -122,7 +122,7 @@ var wikiCallback;
       
       if ( options.src ) {
         Popcorn.getScript( "http://" + options.lang + ".wikipedia.org/w/api.php?action=parse&props=text&page=" + 
-          options.src.slice( options.src.lastIndexOf("/")+1)  + "&format=json&callback=wikiCallback" + _guid);
+          options.src.slice( options.src.lastIndexOf( "/" ) + 1 )  + "&format=json&callback=wikiCallback" + _guid );
       } else if ( Popcorn.plugin.debug ) {
         throw new Error( "Wikipedia plugin needs a 'src'" );
       }
index 43cdc4b0d599c2fc7ddf568686abfba804e5fa3f..c85ea665807e423e08d1a986f848d188afd067da 100755 (executable)
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
   
-  <video id='video' 
+  <video id="video" 
     controls 
-    width= '250px'
+    width= "250px"
     poster="../../test/poster.png"> 
 
-    <source id='mp4'
+    <source id="mp4"
       src="../../test/trailer.mp4"
       type='video/mp4; codecs="avc1, mp4a"'> 
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
       type='video/ogg; codecs="theora, vorbis"'> 
 
index 80bb046ea0868baf5dae943319549588b7393409..6cc1680c1cdaefc60a472b67da8430876fefea5f 100755 (executable)
@@ -1,9 +1,9 @@
-test("Popcorn wikipedia Plugin", function () {
+test( "Popcorn wikipedia Plugin", function () {
   
-  var popped        = Popcorn( "#video" ),
-      expects       = 13, 
-      count         = 0,
-      theArticle    = document.getElementById( "wikidiv" );
+  var popped = Popcorn( "#video" ),
+      expects = 13, 
+      count = 0,
+      theArticle = document.getElementById( "wikidiv" );
        
   expect( expects );
   
@@ -22,21 +22,21 @@ test("Popcorn wikipedia Plugin", function () {
   plus();
   
   popped.wikipedia({
-      start: 1, // seconds
-      end: 3, // seconds
+      start: 1,
+      end: 3,
       src: "http://en.wikipedia.org/wiki/Cape_Town",
       title: "this is an article",
       target: "wikidiv",
       numberofwords: 22
-    } )
+    })
     .wikipedia({
-      start: 4, // seconds
-      end: 5, // seconds
+      start: 4,
+      end: 5,
       src: "http://en.wikipedia.org/wiki/S%C3%A3o_Paulo",
       target: "wikidiv",
       numberofwords: 43
-    } )
-    .volume(0)
+    })
+    .volume( 0 )
     .play();
     
   popped.exec( 2, function() {
@@ -84,7 +84,7 @@ test("Popcorn wikipedia Plugin", function () {
   try {
     popped.wikipedia({});
   } catch( e ) {
-    ok(true, 'empty event was caught by debug');
+    ok( true, "empty event was caught by debug" );
     plus();
   }
 });
index 74894224844cd329b770e122590b5ef597800244..3aa709c3a42d058a7c823604e1dd563061aa4e89 100755 (executable)
@@ -2,46 +2,42 @@
 <html>
 <head>
   <title>Popcorn Wordriver Plug-in Demo</title>
-  
   <script src="../../popcorn.js"></script>
-
   <script src="popcorn.wordriver.js"></script>
   <script>
-    document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video')
-      .volume(0)
+    document.addEventListener( "DOMContentLoaded", function () {
+      var p = Popcorn( "#video" )
+      .volume( 0 )
       .play()
       .wordriver({
-                               start: 1, // seconds
-                               end: 3, // seconds
+                               start: 1,
+                               end: 3,
                                text: "hello",
                                target: "wordriverdiv",
                                color: "red"
       })
       .wordriver({
-                               start: 3, // seconds
-                               end: 6, // seconds
+                               start: 3,
+                               end: 6,
                                text: "world",
                                target: "wordriverdiv",
                                color: "blue"
       })
       .wordriver({
-                               start: 1, // seconds
-                               end: 4, // seconds
+                               start: 1,
+                               end: 4,
                                text: "hello",
                                target: "wordriverdiv2",
                                color: "red"
       })
       .wordriver({
-                               start: 2, // seconds
-                               end: 4, // seconds
+                               start: 2,
+                               end: 4,
                                text: "world",
                                target: "wordriverdiv2",
                                color: "blue"
       });
-
     }, false);
-
   </script>
 </head>
 <body>
   <p> A "hello world" word river will appear from 1 to 6.</p>
   <div>
 
-    <video id='video' 
+    <video id="video"
       controls height="480" width="854"
-      poster="../../test/poster.png"> 
+      poster="../../test/poster.png">
 
-      <source id='mp4'
+      <source id="mp4"
         src="../../test/trailer.mp4"
-        type='video/mp4; codecs="avc1, mp4a"'> 
+        type='video/mp4; codecs="avc1, mp4a"'>
 
-      <source id='ogv'
+      <source id="ogv"
         src="../../test/trailer.ogv"
-        type='video/ogg; codecs="theora, vorbis"'> 
+        type='video/ogg; codecs="theora, vorbis"'>
 
-      <p>Your user agent does not support the HTML5 Video element.</p> 
+      <p>Your user agent does not support the HTML5 Video element.</p>
 
-    </video> 
+    </video>
   </div>
   <div id="wordriverdiv" style="height: 200px; width: 200px;"></div>
   <div id="wordriverdiv2" style="height: 200px; width: 200px;"></div>
index e727c735d031951b7fbce7998b0f8aed815ccf0e..a217c4c197770a0e360bb944f74afdaabcae0aae 100755 (executable)
@@ -1,6 +1,6 @@
 // PLUGIN: Wordriver
 
-(function (Popcorn) {
+(function ( Popcorn ) {
 
   var container = {},
       spanLocation = 0,
 
         var t = document.getElementById( target );
         t && t.appendChild( container[ target ] );
-        
+
         container[ target ].style.height = "100%";
         container[ target ].style.position = "relative";
-        
+
         return container[ target ];
       },
       // creates an object of supported, cross platform css transitions
   document.getElementsByTagName( "head" )[ 0 ].appendChild( span );
 
   /**
-   * Word River popcorn plug-in 
-   * Displays a string of text, fading it in and out 
+   * Word River popcorn plug-in
+   * Displays a string of text, fading it in and out
    * while transitioning across the height of the parent container
    * for the duration of the instance  (duration = end - start)
-   *  
+   *
    * @param {Object} options
-   * 
+   *
    * Example:
      var p = Popcorn( '#video' )
         .wordriver({
    */
 
   Popcorn.plugin( "wordriver" , {
-    
+
       manifest: {
         about:{
           name: "Popcorn WordRiver Plugin"
         },
-        options:{
-          start    : {elem:'input', type:'text', label:'In'},
-          end      : {elem:'input', type:'text', label:'Out'},
-          target  :  'wordriver-container',
-          text     : {elem:'input', type:'text', label:'Text'},
-          color    : {elem:'input', type:'text', label:'Color'}
+        options: {
+          start: {
+            elem: "input",
+            type: "text",
+            label: "In"
+          },
+          end: {
+            elem: "input",
+            type: "text",
+            label: "Out"
+          },
+          target:  "wordriver-container",
+          text: {
+            elem: "input",
+            type: "text",
+            label: "Text"
+          },
+          color: {
+            elem: "input",
+            type: "text",
+            label: "Color"
+          }
         }
       },
 
@@ -81,7 +97,7 @@
 
         if ( !document.getElementById( options.target ) && Popcorn.plugin.debug ) {
           throw new Error( "target container doesn't exist" );
-        } 
+        }
 
         options._duration = options.end - options.start;
         options._container = container[ options.target ] || setupContainer( options.target );
index 532f3defa4fd88380a952a297d006e9f52a5ad0e..cc78d2cbb9d1b0e01a9f608d872f829675402ed0 100755 (executable)
@@ -4,14 +4,12 @@
   <title>Popcorn Word River Plugin</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
-  <!-- 
-    do not move - this must be called immediately prior to 
+  <!--
+    do not move - this must be called immediately prior to
     popcorn-api-draft.js
   -->
-  
   <script src="../../popcorn.js"></script>
   <script src="popcorn.wordriver.js"></script>
-
   <script src="popcorn.wordriver.unit.js"></script>
 </head>
 <body>
   <h2 id="qunit-userAgent"></h2>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">  </div>
-  
-  <video id='video' 
-    controls preload='none' 
-    width= '250px'
-    poster="../../test/poster.png"> 
 
-    <source id='mp4'
+  <video id="video"
+    controls preload="none"
+    width= "250px"
+    poster="../../test/poster.png">
+
+    <source id="mp4"
       src="../../test/trailer.mp4"
-      type='video/mp4; codecs="avc1, mp4a"'> 
+      type='video/mp4; codecs="avc1, mp4a"'>
 
-    <source id='ogv'
+    <source id="ogv"
       src="../../test/trailer.ogv"
-      type='video/ogg; codecs="theora, vorbis"'> 
+      type='video/ogg; codecs="theora, vorbis"'>
 
-    <p>Your user agent does not support the HTML5 Video element.</p> 
+    <p>Your user agent does not support the HTML5 Video element.</p>
 
-  </video> 
-  <div id="wordriverdiv" style="height: 200px; width: 200px;"></div>  
+  </video>
+  <div id="wordriverdiv" style="height: 200px; width: 200px;"></div>
 </body>
 </html>
index 0d7a020eee12891ce384af7a3b0ba6e086f14352..281c9ccadcdcab6db3b0ab8569a7da1df83558e1 100755 (executable)
@@ -1,32 +1,31 @@
 test( "Popcorn wordriver Plugin", function () {
-  
+
   var popped = Popcorn( "#video" ),
-      expects = 17, 
+      expects = 17,
       count = 0,
       firstTrack,
       secondTrack,
       wordriverdiv = document.getElementById( "wordriverdiv" );
 
-  expect(expects);
-  
+  expect( expects );
+
   function plus() {
-    if ( ++count === expects) {
+    if ( ++count === expects ) {
       start();
     }
   }
-  
+
   stop();
-   
+
   ok ( "wordriver" in popped, "wordriver is a method of the popped instance" );
   plus();
-  
+
   equals ( wordriverdiv.childElementCount, 0, "initially, there is nothing inside the wordriverdiv" );
   plus();
-  
-  
+
   popped.wordriver({
-               start: 0, // seconds
-               end: 2, // seconds
+               start: 0,
+               end: 2,
                text: "hello",
                target: "wordriverdiv",
                color: "red"
@@ -35,8 +34,8 @@ test( "Popcorn wordriver Plugin", function () {
   firstTrack = popped.getLastTrackEventId();
 
   popped.wordriver({
-               start: 2, // seconds
-               end: 4, // seconds
+               start: 2,
+               end: 4,
                text: "world",
                target: "wordriverdiv",
                color: "blue"
@@ -45,48 +44,48 @@ test( "Popcorn wordriver Plugin", function () {
   secondTrack = popped.getLastTrackEventId();
 
   popped.wordriver({
-               start: 20, // seconds
-               end: 24, // seconds
+               start: 20,
+               end: 24,
                text: "nothing here",
                target: "wordriverdiv",
                color: "green"
   })
-  .volume(0);
+  .volume( 0 );
 
   popped.exec( 0, function() {
-    equals( wordriverdiv.children[0].childElementCount, 1, "wordriverdiv now has one inner element" );
+    equals( wordriverdiv.children[ 0 ].childElementCount, 1, "wordriverdiv now has one inner element" );
     plus();
-    equals( wordriverdiv.children[0].children[0].style.opacity, 1, "first word is visible on the page" );
+    equals( wordriverdiv.children[ 0 ].children[ 0 ].style.opacity, 1, "first word is visible on the page" );
     plus();
-    equals( wordriverdiv.children[0].children[0].innerHTML, "hello", "first word content is correct" );
+    equals( wordriverdiv.children[ 0 ].children[ 0 ].innerHTML, "hello", "first word content is correct" );
     plus();
-    ok( !wordriverdiv.children[0].children[1], "second word does not exist yet" );
+    ok( !wordriverdiv.children[ 0 ].children[ 1 ], "second word does not exist yet" );
     plus();
   });
-  
+
   popped.exec( 2, function() {
-    equals( wordriverdiv.children[0].childElementCount, 2, "wordriverdiv now has two inner elements" );
+    equals( wordriverdiv.children[ 0 ].childElementCount, 2, "wordriverdiv now has two inner elements" );
     plus();
-    equals( wordriverdiv.children[0].children[0].style.opacity, 0, "first word is not visible on the page" );
+    equals( wordriverdiv.children[ 0 ].children[ 0 ].style.opacity, 0, "first word is not visible on the page" );
     plus();
-    equals( wordriverdiv.children[0].children[0].innerHTML, "hello", "first word content is correct" );
+    equals( wordriverdiv.children[ 0 ].children[ 0 ].innerHTML, "hello", "first word content is correct" );
     plus();
-    equals( wordriverdiv.children[0].children[1].style.opacity, 1, "second word is visible on the page" );
+    equals( wordriverdiv.children[ 0 ].children[ 1 ].style.opacity, 1, "second word is visible on the page" );
     plus();
-    equals( wordriverdiv.children[0].children[1].innerHTML, "world", "second word content is correct" );
+    equals( wordriverdiv.children[ 0 ].children[ 1 ].innerHTML, "world", "second word content is correct" );
     plus();
   });
-  
+
   popped.exec( 4, function() {
-    equals( wordriverdiv.children[0].children[0].style.opacity, 0, "first word is not visible on the page" );
+    equals( wordriverdiv.children[ 0 ].children[ 0 ].style.opacity, 0, "first word is not visible on the page" );
     plus();
-    equals( wordriverdiv.children[0].children[1].style.opacity, 0, "second word is not visible on the page" );
+    equals( wordriverdiv.children[ 0 ].children[ 1 ].style.opacity, 0, "second word is not visible on the page" );
     plus();
 
     popped.pause().removeTrackEvent( firstTrack );
-    equals( wordriverdiv.children[0].childElementCount, 1, "wordriverdiv now has one inner element" );
+    equals( wordriverdiv.children[ 0 ].childElementCount, 1, "wordriverdiv now has one inner element" );
     plus();
-    equals( wordriverdiv.children[0].children[0].innerHTML, "world", "first word content is changed" );
+    equals( wordriverdiv.children[ 0 ].children[ 0 ].innerHTML, "world", "first word content is changed" );
     plus();
 
     popped.pause().removeTrackEvent( secondTrack );
@@ -102,10 +101,10 @@ test( "Popcorn wordriver Plugin", function () {
   try {
     popped.wordriver({});
   } catch( e ) {
-    ok(true, 'empty event was caught by debug');
+    ok( true, "empty event was caught by debug" );
     plus();
   }
-  
+
   popped.play();
 
 });