From: Matthew Schranz Date: Tue, 27 Sep 2011 20:44:44 +0000 (-0400) Subject: [#734]Removed Whitespace X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=7c2b51209e94e07027d4763ae15abc7684ea8ec6;p=popcorn-js.git [#734]Removed Whitespace --- diff --git a/plugins/facebook/popcorn.facebook.js b/plugins/facebook/popcorn.facebook.js index 50c8977..64e68e7 100755 --- a/plugins/facebook/popcorn.facebook.js +++ b/plugins/facebook/popcorn.facebook.js @@ -47,7 +47,7 @@ */ var ranOnce = false; - + Popcorn.plugin( "facebook" , { manifest: { about: { @@ -188,11 +188,11 @@ }); }; } - - + + // Lowercase to make value consistent no matter what user inputs _type = _type.toLowerCase(); - + var validType = function( type ) { return ( ["like", "like-box", "activity", "facepile", "live-stream", "send"].indexOf( type ) > -1 ); }; @@ -201,10 +201,10 @@ if ( !validType( _type ) ) { throw new Error( "Facebook plugin type was invalid." ); } - - + + options._container = document.createElement( "fb:" +_type ); - + // All the the "types" for facebook share largely identical attributes, for loop suffices. // ** Credit to Rick Waldron, it's essentially all his code in this function. var setOptions = function() { @@ -212,11 +212,11 @@ var attr = _type === "activity" ? "site" : "href"; options._container.setAttribute( attr, ( options[ attr ] || document.URL ) ); - + // create an array of Facebook widget attributes - var fbAttrs = ( - "width height layout show_faces stream header colorscheme" + - " maxrows border_color recommendations font always_post_to_friends xid" + var fbAttrs = ( + "width height layout show_faces stream header colorscheme" + + " maxrows border_color recommendations font always_post_to_friends xid" ).split(" "); Popcorn.forEach( fbAttrs, function( attr ) { @@ -226,9 +226,9 @@ } }); }; - + setOptions(); - + if ( !target && Popcorn.plugin.debug ) { throw new Error( "Facebook target container doesn't exist" ); } diff --git a/plugins/facebook/popcorn.facebook.unit.js b/plugins/facebook/popcorn.facebook.unit.js index 6b59433..f6cf09a 100755 --- a/plugins/facebook/popcorn.facebook.unit.js +++ b/plugins/facebook/popcorn.facebook.unit.js @@ -1,5 +1,5 @@ test("Popcorn Facebook Plugin", function () { - + var popped = Popcorn("#video"), expects = 5, count = 0, @@ -65,16 +65,16 @@ test( "Test Initialized Facebook Blocks", function () { Popcorn.plugin.debug = true; var pop = Popcorn( "#video" ); - + expect( 2 ); - + // Tests for thrown Error on emtpy block try { pop.facebook({}); } catch( e ) { ok( true, "Empty event was caught by debugger" ); } - + // Tests for thrown Error on invalid plugin type try { pop.facebook({ @@ -84,7 +84,7 @@ test( "Test Initialized Facebook Blocks", function () { end : 6 }); } catch( e ) { - ok( true, "Facebook plugin type was invalid." ); - } + ok( true, "Facebook plugin type was invalid." ); + } });