From: David Seifried Date: Fri, 26 Aug 2011 18:27:30 +0000 (-0400) Subject: fixed merge conflict X-Git-Tag: v0.8^2~7^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=cdee0db70923666283b1f2a7c645d528929c49d7;p=popcorn-js.git fixed merge conflict --- cdee0db70923666283b1f2a7c645d528929c49d7 diff --cc plugins/linkedin/popcorn.linkedin.js index 75363af,bd50029..1777d8a --- a/plugins/linkedin/popcorn.linkedin.js +++ b/plugins/linkedin/popcorn.linkedin.js @@@ -69,19 -125,17 +125,19 @@@ if ( apikey ) { script.innerHTML = "api_key: " + apikey; } - - options.type = options.type.toLowerCase(); + + options.type = options.type && options.type.toLowerCase() || ""; - + // Replace the LinkedIn plugin's error message to something more helpful var errorMsg = function() { - options._container = document.createElement( "p" ); options._container.innerHTML = "Plugin requires a valid apikey"; - document.getElementById( options.target ).appendChild( options._container ); + if ( !target && Popcorn.plugin.debug ) { + throw ( "target container doesn't exist" ); + } + target && target.appendChild( options._container ); }; - + var setOptions = (function ( options ) { return { @@@ -168,9 -221,9 +224,9 @@@ * 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 ) { - options._container.parentNode.style.display = "none"; + options._container.style.display = "none"; }, _teardown: function( options ) { var tar = document.getElementById( options.target ); diff --cc plugins/wikipedia/popcorn.wikipedia.unit.js index 88863bc,6ed4207..80bb046 --- a/plugins/wikipedia/popcorn.wikipedia.unit.js +++ b/plugins/wikipedia/popcorn.wikipedia.unit.js @@@ -64,19 -72,7 +72,19 @@@ test("Popcorn wikipedia Plugin", functi popped.exec( 6, function() { popped.pause().removeTrackEvent( popped.data.trackEvents.byStart[ 4 ]._id ); - equals ( theArticle.innerHTML, "", "wikidiv is now empty" ); + equals( theArticle.innerHTML, "", "wikidiv is now empty" ); plus(); }); + + // empty track events should be safe + popped.wikipedia({}); + + // debug should log errors on empty track events + Popcorn.plugin.debug = true; + try { + popped.wikipedia({}); + } catch( e ) { + ok(true, 'empty event was caught by debug'); + plus(); + } });