From d3f35d7886d6c4ebe82bffd3d7823783b25a532d Mon Sep 17 00:00:00 2001 From: Mohammed Buttu Date: Fri, 13 May 2011 17:12:58 -0400 Subject: [PATCH] #332 Changed api key to make it work on localhost. Made api key optional. Added start and end times so that the linkedin plugins show and disappear at certain times in certain places --- plugins/linkedin/popcorn.linkedin.html | 31 +++++++++++++++------- plugins/linkedin/popcorn.linkedin.js | 36 +++++++++++++------------- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/plugins/linkedin/popcorn.linkedin.html b/plugins/linkedin/popcorn.linkedin.html index 9eef967..145309c 100644 --- a/plugins/linkedin/popcorn.linkedin.html +++ b/plugins/linkedin/popcorn.linkedin.html @@ -2,10 +2,8 @@ Popcorn LinkedIn Plug-in Demo + - -

Popcorn Facebook Plug-in Demo

+

Popcorn LinkedIn Plug-in Demo

Right of video: share button, recommend button, member profile.
Below video: company insider, company profile.
For a description of each plugin's purpose, go to: LinkedIn Plugins

diff --git a/plugins/linkedin/popcorn.linkedin.js b/plugins/linkedin/popcorn.linkedin.js index 35ca14c..20ca09b 100644 --- a/plugins/linkedin/popcorn.linkedin.js +++ b/plugins/linkedin/popcorn.linkedin.js @@ -43,28 +43,19 @@ type : {elem:"input", type:'text', label:"Type"}, target : 'linkedin-container' } - }, + }, _setup: function( options ) { - // similar to facebook script load idea - if ( !document.getElementById("linkedin-root") ) { - var r = document.createElement( 'div' ); - r.setAttribute( 'div', "linkedin-root" ); - document.body.appendChild( r ); - - (function() { - var s = document.createElement( 'script' ); - s.setAttribute( 'src', "http://platform.linkedin.com/in.js" ); - s.setAttribute( 'type', "text/javascript" ); - s.setAttribute( 'async', 'true' ); - if ( typeof( api_key ) !== "undefined" ) { - s.innerHTML = 'api_key: ' + api_key; - } - r.appendChild( s ); - }()); + var api_key = options.api_key, + target = document.getElementById( options.target ); + + options._container = document.createElement( 'script' ); + + options._container.setAttribute( 'async', 'true' ); + if ( typeof( api_key ) !== "undefined" ) { + options._container.innerHTML = 'api_key: ' + api_key; } - options._container = document.createElement( 'script' ); options.type = options.type.toLowerCase(); // Replace the LinkedIn plugin's error message to something more helpful @@ -132,6 +123,15 @@ if ( document.getElementById( options.target ) ) { document.getElementById( options.target ).appendChild( options._container ); } + target.style.display = 'none'; + }, + + start: function( event, options ) { + options._container.parentNode.style.display = 'block'; + }, + + end: function( event, options ) { + options._container.parentNode.style.display = 'none'; } }); -- 2.43.0