<div>
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
src="../../test/trailer.mp4"
- type='viden/mp4; codecs="avc1, mp4a"'>
+ type='video/mp4; codecs="avc1, mp4a"'>
<source id="ogv"
src="../../test/trailer.ogv"
-test("Popcorn attribution Plugin", function () {
+test( "Popcorn attribution Plugin", function() {
- var popped = Popcorn("#video"),
+ var popped = Popcorn( "#video" ),
expects = 10,
count = 0,
setupId,
expect( expects );
function plus() {
- if ( ++count===expects ) {
+ if ( ++count === expects ) {
start();
}
}
stop();
- ok ( "attribution" in popped, "attribution is a method of the popped instance" );
+ ok( "attribution" in popped, "attribution is a method of the popped instance" );
plus();
- equals ( attributiondiv.childElementCount, 0, "initially, there is nothing inside the attributiondiv" );
+ equals( attributiondiv.childElementCount, 0, "initially, there is nothing inside the attributiondiv" );
plus();
popped.attribution({
setupId = popped.getLastTrackEventId();
popped.exec( 0, function() {
- equals ( attributiondiv.childElementCount, 2, "attributiondiv now has two inner elements" );
+ equals( attributiondiv.childElementCount, 2, "attributiondiv now has two inner elements" );
plus();
- equals ( attributiondiv.children[ 0 ].style.display , "inline", "attribution is visible on the page" );
+ equals( attributiondiv.children[ 0 ].style.display , "inline", "attribution is visible on the page" );
plus();
});
ok( /target="_blank"/.test( attributiondiv.innerHTML ), "attributions create anchors that target=_blank" );
plus();
- equals ( attributiondiv.children[ 1 ].style.display , "inline", "second attribution is visible on the page" );
+ equals( attributiondiv.children[ 1 ].style.display, "inline", "second attribution is visible on the page" );
plus();
- equals ( typeof popped.data.trackEvents.byStart[ 1 ]._license, "undefined", "undefined license is properly being handled" );
+ equals( typeof popped.data.trackEvents.byStart[ 1 ]._license, "undefined", "undefined license is properly being handled" );
plus();
});
popped.exec( 4, function() {
- equals( attributiondiv.children[ 1 ].style.display , "none", "second attribution is no longer visible on the page" );
+ equals( attributiondiv.children[ 1 ].style.display, "none", "second attribution is no longer visible on the page" );
plus();
- equals( attributiondiv.children[ 0 ].style.display , "none", "first attribution is no longer visible on the page" );
+ equals( attributiondiv.children[ 0 ].style.display, "none", "first attribution is no longer visible on the page" );
plus();
popped.pause().removeTrackEvent( setupId );
autobuffer
preload="auto"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
autobuffer
preload="auto"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn Code Plugin", function () {
+test( "Popcorn Code Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 9,
expect( expects );
function plus() {
- if ( ++count === expects) {
+ if ( ++count === expects ) {
start();
}
}
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({
<div>
<video id="video"
controls preload="none"
- width= "350px"
+ width="350px"
poster="../../test/poster.png">
<source id="mp4"
</div>
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn Facebook Plugin", function () {
+test( "Popcorn Facebook Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 9,
expect( expects );
function plus() {
- if ( ++count===expects ) {
+ if ( ++count === expects ) {
start();
}
}
.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)" );
+ 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)" );
+ 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)" );
+ 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)" );
+ ok( document.getElementById( "facepilediv" ).innerHTML, "Facepilediv is not empty at 0:05 (expected)" );
plus();
});
});
<div>
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test("Popcorn Flickr Plugin", function () {
+test( "Popcorn Flickr Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 11,
ok( "flickr" in popped, "flickr is a method of the popped instance" );
plus();
- equals ( flickrdiv.innerHTML, "", "initially, there is nothing inside the flickrdiv" );
+ equals( flickrdiv.innerHTML, "", "initially, there is nothing inside the flickrdiv" );
plus();
popped.flickr({
-test( "Popcorn Footnote Plugin", function () {
+test( "Popcorn Footnote Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 8,
expect( expects );
function plus() {
- if ( ++count===expects) {
+ if ( ++count===expects ) {
start();
}
}
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" );
+ equals( footnotediv.childElementCount, 0, "initially, there is nothing inside the footnotediv" );
plus();
popped.footnote({
setupId = popped.getLastTrackEventId();
popped.exec( 0, function() {
- equals ( footnotediv.childElementCount, 2, "footnotediv now has two inner elements" );
+ 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 );
});
-test( "Popcorn Text Plugin", function () {
+test( "Popcorn Text Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 2,
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();
<script src="../../popcorn.js"></script>
<script src="popcorn.gml.js"></script>
<script>
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" )
.play()
.volume( 0 )
<div>
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn GML Plugin", function () {
+test( "Popcorn GML Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 8,
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" );
+ equals( gmldiv.childElementCount, 0, "initially, there is nothing inside the gmldiv" );
plus();
popped.gml({
});
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 );
<script src="../../popcorn.js"></script>
<script src="popcorn.googlefeed.js"></script>
<script>
- document.addEventListener("DOMContentLoaded", function () {
- var p = Popcorn("#video")
+ document.addEventListener( "DOMContentLoaded", function() {
+ var p = Popcorn( "#video" )
.volume( 0 )
.play()
.googlefeed({
<div>
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
*
*/
- Popcorn.plugin( "googlefeed" , function( options ) {
+ Popcorn.plugin( "googlefeed", function( options ) {
// create a new div and append it to the parent div so nothing
// that already exists in the parent div gets overwritten
},
orientation: {
elem: "select",
- options: [ "Vertical","Horizontal" ],
+ options: [ "Vertical", "Horizontal" ],
label: "orientation"
}
}
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test("Popcorn Google Feed Plugin", function () {
+test( "Popcorn Google Feed Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 13,
expect( expects );
function plus() {
- if ( ++count === expects) {
+ if ( ++count === expects ) {
start();
}
}
plus();
ok( GFdynamicFeedControl, "Dynamic Feed Control Available" );
plus();
- ok ( document.getElementById( "_feed1" ), "First feed is on the page" );
+ ok( document.getElementById( "_feed1" ), "First feed is on the page" );
plus();
equals ( document.getElementById( "_feed1" ).offsetParent.id, "feed", "First feed is inside the 'feed' div" );
plus();
plus();
});
popped.exec( 2, function() {
- ok ( document.getElementById( "_feed2" ), "Second feed is on the page" );
+ ok( document.getElementById( "_feed2" ), "Second feed is on the page" );
plus();
- equals ( document.getElementById( "_feed2" ).offsetParent.id, "feed1", "Second feed is inside the 'feed2' div" );
+ equals( document.getElementById( "_feed2" ).offsetParent.id, "feed1", "Second feed is inside the 'feed2' div" );
plus();
});
popped.exec( 3, function() {
- ok ( document.getElementById( "_feed2" ).style.display === "none" &&
+ ok( document.getElementById( "_feed2" ).style.display === "none" &&
document.getElementById( "_feed1" ).style.display === "none", "Both feeds are no lnger visible" );
plus();
popped.pause().removeTrackEvent( setupId );
- ok( !document.getElementById( "feed1" ).children[ 0 ], "removed feed was properly destroyed" );
+ ok( !document.getElementById( "feed1" ).children[ 0 ], "removed feed was properly destroyed" );
plus();
});
<script src="../../popcorn.js"></script>
<script src="popcorn.googlemap.js"></script>
<script type="text/javascript">
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" )
.volume( 0 )
.play()
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn Google Map Plugin", function () {
+test( "Popcorn Google Map Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 15,
stop();
- ok ( "googlemap" in popped, "googlemap is a mehtod of the popped instance" );
+ ok( "googlemap" in popped, "googlemap is a method 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({
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" );
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" &&
+ 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();
-test( "Popcorn Image Plugin", function () {
+test( "Popcorn Image Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 9,
<script src="../../popcorn.js"></script>
<script src="popcorn.lastfm.js"></script>
<script>
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" )
.volume( 0 )
.play()
<div>
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
if ( data.artist ) {
var htmlString = "";
- htmlString = "<h3>"+data.artist.name+"</h3>";
+ 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>";
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn LastFM Plugin", function () {
+test( "Popcorn LastFM Plugin", function() {
/*
ATTENTION
ok( "lastfm" in popped, "lastfm is a method of the popped instance" );
plus();
- equals ( lastfmdiv.innerHTML, "", "initially, there is nothing inside the lastfmdiv" );
+ equals( lastfmdiv.innerHTML, "", "initially, there is nothing inside the lastfmdiv" );
plus();
popped.lastfm({
setupId = popped.getLastTrackEventId();
popped.exec( 2, function() {
- equals ( lastfmdiv.childElementCount, 3, "lastfmdiv now has three inner elements" );
+ 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 );
try {
popped.lastfm({});
} catch( e ) {
- ok ( true, "empty event was caught by debug" );
+ ok( true, "empty event was caught by debug" );
plus();
}
-test ("Popcorn LinkedIn Plugin", function () {
+test( "Popcorn LinkedIn Plugin", function() {
if ( /localhost/.test( location.hostname ) ) {
// 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();
});
<script src="popcorn.lowerthird.js"></script>
<script>
- document.addEventListener("DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
- var p = Popcorn("#video")
+ var p = Popcorn( "#video" )
.play()
.lowerthird({
start: 5,
*
*/
- Popcorn.plugin( "lowerthird" , {
+ Popcorn.plugin( "lowerthird", {
manifest: {
about:{
type: "text",
label: "Text"
},
- role : {
+ role: {
elem: "input",
type: "text",
label: "Text"
* of the video reaches the end time provided by the
* options variable
*/
- end: function(event, options) {
+ end: function( event, options ) {
options.container.innerHTML = "";
}
- } );
+ });
})( Popcorn );
<video id="video"
controls preload"none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn lower third Plugin", function () {
+test( "Popcorn lower third Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 8,
expect( expects );
function plus() {
- if ( ++count===expects ) {
+ if ( ++count === expects ) {
start();
}
}
stop();
- ok ( "lowerthird" in popped, "lowerthird is a method of the popped instance" );
+ ok( "lowerthird" in popped, "lowerthird is a method of the popped instance" );
plus();
equals ( lowerthirddiv.innerHTML, "", "initially, there is nothing inside the lowerthirddiv" );
.volume( 0 );
popped.exec( 1, function() {
- equals ( popped.container.innerHTML, "Mr Hyde<br>Monster", "first lowerthird is visible" );
+ equals( popped.container.innerHTML, "Mr Hyde<br>Monster", "first lowerthird is visible" );
plus();
});
popped.exec( 3, function() {
- equals ( lowerthirddiv.innerHTML, "<div>Dr Jekyll<br>Person</div>", "second lowerthird is visible" );
+ equals( lowerthirddiv.innerHTML, "<div>Dr Jekyll<br>Person</div>", "second lowerthird is visible" );
plus();
});
popped.exec( 5, function() {
- equals ( popped.container.innerHTML, "", "first lowerthird is empty" );
+ equals( popped.container.innerHTML, "", "first lowerthird is empty" );
plus();
- equals ( lowerthirddiv.innerHTML, "<div></div>", "second lowerthird is empty" );
+ equals( lowerthirddiv.innerHTML, "<div></div>", "second lowerthird is empty" );
plus();
});
*
*/
- Popcorn.plugin( "mustache" , function( options ) {
+ Popcorn.plugin( "mustache" , function( options ){
var getData, data, getTemplate, template;
autobuffer
preload="auto"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn Mustache Plugin", function () {
+test( "Popcorn Mustache Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 6,
<script src="../../popcorn.js"></script>
<script src="popcorn.openmap.js"></script>
<script>
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
Popcorn( "#video" )
.volume( 0 )
.play()
<div>
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
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
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn OpenMap Plugin", function () {
+test( "Popcorn OpenMap Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 15,
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({
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" &&
+ 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" );
<script>
var output;
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" , {
pauseOnLinkClicked: true
})
<p>The video pauses when links (anchor elements) are clicked</p>
<div>
<video id="video"
- autobuffer = "autobuffer"
+ autobuffer="autobuffer"
preload="auto"
controls="controls"
width="250px"
autobuffer="autobuffer"
preload="auto"
controls="controls"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
autobuffer="autobuffer"
preload="auto"
controls="controls"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn Pause Plugin", function () {
+test( "Popcorn Pause Plugin", function() {
var expectedTests = 3 ,
anchorA = document.getElementById( "anchorA" ),
var simulateClickOn = function ( paramElement ) {
- if ( typeof paramElement.click == "Function" ) {
+ if ( typeof paramElement.click === "Function" ) {
paramElement.click() ;
return ;
}
var otherVideo = Popcorn( "#video2" , {
pauseOnLinkClicked: true
- });
+ });
otherVideo.play() ;
var popped = Popcorn( "#video" , {
pauseOnLinkClicked: true
- });
+ });
popped.code ({
start: 2.000,
onStart: function ( options ) {
var currentTime = popped.currentTime() ;
simulateClickOn( anchorA ) ;
- ok (
+ ok(
( currentTime + tolerance >= 2 ) && ( currentTime - tolerance <= 2 ) ,
"Video successfully stopped with a click on an anchor at " +
"second 2 approximately (" + currentTime + ")"
onStart: function ( options ) {
var currentTime = popped.currentTime() ;
simulateClickOn( anchorB ) ;
- ok (
+ ok(
( currentTime + tolerance >= 5.561 ) && ( currentTime - tolerance <= 5.561 ) ,
- 'Video successfully stopped with a click on an anchor at ' +
- 'second 5.561 approximately (' + currentTime + ')'
+ "Video successfully stopped with a click on an anchor at " +
+ "second 5.561 approximately (" + currentTime + ")"
);
start() ;
}
<div>
<video id="video"
controls preload="auto"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
<div>
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
var idx = 5;
while ( --idx ) {
popped.removeTrackEvent( trackids.pop() );
- ok ( !document.getElementById( "processing-div-" + ( idx ) ).children[ 0 ], "track event was removed" );
+ ok( !document.getElementById( "processing-div-" + ( idx ) ).children[ 0 ], "track event was removed" );
plus();
}
});
try {
popped.processing({});
} catch( e ) {
- ok(true, 'empty event was caught by debug');
+ ok( true, "empty event was caught by debug" );
plus();
}
<script src="../../popcorn.js"></script>
<script src="popcorn.subtitle.js"></script>
<script>
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" )
.volume( 0 )
.play()
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
</video>
<video id="video2"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn Subtitle Plugin", function () {
+test( "Popcorn Subtitle Plugin", function() {
var popped = Popcorn( "#video" ),
popped2 = Popcorn( "#video2" ),
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({
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();
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" &&
+ 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();
<script src="../../popcorn.js"></script>
<script src="popcorn.tagthisperson.js"></script>
<script>
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" )
.play()
.volume( 0 )
<div>
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn tagthisperson Plugin", function () {
+test( "Popcorn tagthisperson Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 8,
<div>
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png"
style="float: left;">
-test( "Popcorn Timeline Plugin", function () {
+test( "Popcorn Timeline Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 17,
stop();
- ok ( "timeline" in popped, "timeline is a method of the popped instance" );
+ ok( "timeline" in popped, "timeline is a method of the popped instance" );
plus();
- equals ( document.getElementById( "timeline-up" ).firstChild, undefined, "initially, there is nothing inside the 'timeline-up' feed" );
+ equals( document.getElementById( "timeline-up" ).firstChild, undefined, "initially, there is nothing inside the 'timeline-up' feed" );
plus();
- equals ( document.getElementById( "timeline-down" ).firstChild, undefined, "initially, there is nothing inside the 'timeline-down' feed" );
+ equals( document.getElementById( "timeline-down" ).firstChild, undefined, "initially, there is nothing inside the 'timeline-down' feed" );
plus();
popped.timeline({
popped.exec( 1.5, function() {
//up
- ok ( document.getElementById( "timelineDiv1" ), "First timeline is on the page" );
+ 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" );
+ 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" );
+ 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" );
+ equals( document.getElementById("timelineDiv3" ).parentNode.parentNode.id, "timeline-down", "First Timeline is inside the 'timeline-down' div" );
plus();
});
//up
var timelinediv2 = document.getElementById( "timelineDiv2" ),
timelinediv4 = document.getElementById( "timelineDiv4" );
- ok ( timelinediv2, "Second timeline is on the page" );
+ ok( timelinediv2, "Second timeline is on the page" );
plus();
- equals ( timelinediv2 && timelinediv2.parentNode.parentNode.id, "timeline-up", "Second timelineDiv2 is inside the 'timeline-up' div" );
+ equals( timelinediv2 && timelinediv2.parentNode.parentNode.id, "timeline-up", "Second timelineDiv2 is inside the 'timeline-up' div" );
plus();
- equals ( timelineUp.firstChild.firstChild.id, "timelineDiv2", "'timelineDiv2' is the first child in 'timeline-up'" );
+ 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" );
+ ok( timelinediv4, "Second down timeline is on the page" );
plus();
- equals ( timelinediv4.parentNode.parentNode.id, "timeline-down", "timelineDiv4 is inside the 'timeline-down' div" );
+ equals( timelinediv4.parentNode.parentNode.id, "timeline-down", "timelineDiv4 is inside the 'timeline-down' div" );
plus();
- equals ( timelineDown.firstChild.firstChild.id, "timelineDiv3", "'timelineDiv3' is the first child in 'timeline-down'" );
+ equals( timelineDown.firstChild.firstChild.id, "timelineDiv3", "'timelineDiv3' is the first child in 'timeline-down'" );
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();
<script src="../../popcorn.js"></script>
<script src="popcorn.twitter.js"></script>
<script>
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" )
.twitter({
start: 5,
<div>
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
Popcorn.plugin( "twitter" , {
manifest: {
- about:{
+ about: {
name: "Popcorn Twitter Plugin",
version: "0.1",
author: "Scott Downe",
// setup widget div that is unique per track
options.container = document.createElement( "div" );
// use this id to connect it to the widget
- options.container.setAttribute( "id", Popcorn.guid());
+ options.container.setAttribute( "id", Popcorn.guid() );
// display none by default
options.container.style.display = "none";
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn Twitter Plugin", function () {
+test( "Popcorn Twitter Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 7,
<script src="../../popcorn.js"></script>
<script src="popcorn.webpage.js"></script>
<script>
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" )
.volume( 0 )
.play()
<div>
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
target: "iframe-container"
}
},
- _setup : function( options ) {
+ _setup: function( options ) {
var target = document.getElementById( options.target );
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
});
popped.exec( 2, function() {
- ok (theiFrame[ 0 ].style.display === "none" && theiFrame[ 1 ].style.display === "none", "both iframes are hidden" );
+ ok( theiFrame[ 0 ].style.display === "none" && theiFrame[ 1 ].style.display === "none", "both iframes are hidden" );
plus();
popped.pause().removeTrackEvent( setupId );
<script src="../../popcorn.js"></script>
<script src="popcorn.wikipedia.js"></script>
<script>
- document.addEventListener( "DOMContentLoaded", function () {
- var p = Popcorn( "#video' )
+ document.addEventListener( "DOMContentLoaded", function() {
+ var p = Popcorn( "#video" )
.volume( 0 )
.play()
.wikipedia({
<div>
<video id="video"
controls
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn wikipedia Plugin", function () {
+test( "Popcorn wikipedia Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 13,
stop();
- ok ( "wikipedia" in popped, "wikipedia is a mehtod of the popped instance" );
+ ok( "wikipedia" in popped, "wikipedia is a mehtod of the popped instance" );
plus();
- equals ( theArticle.innerHTML, "", "initially, there is nothing in the wikidiv" );
+ equals( theArticle.innerHTML, "", "initially, there is nothing in the wikidiv" );
plus();
popped.wikipedia({
<script src="../../popcorn.js"></script>
<script src="popcorn.wordriver.js"></script>
<script>
- document.addEventListener( "DOMContentLoaded", function () {
+ document.addEventListener( "DOMContentLoaded", function() {
var p = Popcorn( "#video" )
.volume( 0 )
.play()
type: "text",
label: "Out"
},
- target: "wordriver-container",
+ target: "wordriver-container",
text: {
elem: "input",
type: "text",
<video id="video"
controls preload="none"
- width= "250px"
+ width="250px"
poster="../../test/poster.png">
<source id="mp4"
-test( "Popcorn wordriver Plugin", function () {
+test( "Popcorn wordriver Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 17,
stop();
- ok ( "wordriver" in popped, "wordriver is a method of the popped instance" );
+ ok( "wordriver" in popped, "wordriver is a method of the popped instance" );
plus();
- equals ( wordriverdiv.childElementCount, 0, "initially, there is nothing inside the wordriverdiv" );
+ equals( wordriverdiv.childElementCount, 0, "initially, there is nothing inside the wordriverdiv" );
plus();
popped.wordriver({