Popcorn.forEach( src, function( copy ) {
for ( var prop in copy ) {
- if ( copy[prop] ) {
- dest[prop] = copy[prop];
- }
+ dest[prop] = copy[prop];
}
});
return dest;
var size = 0;
for ( var prop in obj ) {
- if ( obj[prop] ) {
- size++;
- }
+ size++;
}
return size;
// the events commence
if ( "_setup" in setup && typeof setup._setup === "function" ) {
- setup._setup.call( this, options );
+
+ setup._setup.call( this, Popcorn.extend( {}, options, {
+ target: setup.manifest.options.target || ""
+ })
+ );
}
module("Popcorn Plugin")
test("Manifest", function () {
+
+
+ var p = Popcorn("#video"),
+ expects = 2,
+ count = 0;
+
+ function plus() {
+ if ( ++count === expects ) {
+ start();
+ // clean up added events after tests
+ p.removePlugin("footnote");
+ }
+ }
+
+ stop( 10000 );
Popcorn.plugin( "footnote" , (function(){
return {
target : 'text-container'
}
},
+ _setup: function( options ) {
+ ok( options.target, "`options.target exists`" );
+ plus();
+ },
start: function(event, options){
},
})());
- expect(1);
+ expect(expects);
equal( Popcorn.sizeOf( Popcorn.manifest ), 1, "One manifest stored" );
+ plus();
// add more tests
- Popcorn("#video").removePlugin("footnote");
+ p.footnote({});
+
+
});
test("Update Timer", function () {