<html>
<head>
<title>Popcorn LinkedIn Plug-in Demo</title>
+ <script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
<script src="../../popcorn.js"></script>
- <script>
- var api_key = 'ND1uSIEUBH8MkI8E7g41kgGlWUexzvFL9uB2ihJbIrFuqunFq8aVmUrxyfAqxCBX';
- </script>
<script src="popcorn.linkedin.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
type : 'share',
counter : 'right',
url : "http://www.google.ca",
- target : "sharediv"
+ target : "sharediv",
+ api_key : 'ZOLRI2rzQS_oaXELpPF0aksxwFFEvoxAFZRLfHjaAhcGPfOX0Ds4snkJpWwKs8gk',
+ start : 1,
+ end : 3
} )
.linkedin({
type : 'recommendproduct',
counter : 'top',
target : "recommenddiv",
companyid : 'LinkedIn',
- productid : '201714'
+ productid : '201714',
+ api_key : 'ZOLRI2rzQS_oaXELpPF0aksxwFFEvoxAFZRLfHjaAhcGPfOX0Ds4snkJpWwKs8gk',
+ start : 4,
+ end : 7
} )
.linkedin({
type : 'memberprofile',
memberid : '/in/jeffweiner08',
format : 'inline',
- target : "memberprofilediv"
+ target : "memberprofilediv",
+ api_key : 'ZOLRI2rzQS_oaXELpPF0aksxwFFEvoxAFZRLfHjaAhcGPfOX0Ds4snkJpWwKs8gk',
+ start : 9,
+ end : 11
} )
.linkedin({
type : 'companyinsider',
companyid : '1441',
- target : "bottomdiv"
+ target : "bottomdiv",
+ api_key : 'ZOLRI2rzQS_oaXELpPF0aksxwFFEvoxAFZRLfHjaAhcGPfOX0Ds4snkJpWwKs8gk',
+ start : 9,
+ end : 11
} )
.linkedin({
type : 'companyprofile',
companyid : '1441',
format : 'inline',
- target : "bottomdiv"
+ target : "bottomdiv",
+ api_key : 'ZOLRI2rzQS_oaXELpPF0aksxwFFEvoxAFZRLfHjaAhcGPfOX0Ds4snkJpWwKs8gk',
+ start : 13,
+ end : 17
} )
}, false);
</script>
</head>
<body>
-<h1 id="qunit-header">Popcorn Facebook Plug-in Demo</h1>
+<h1 id="qunit-header">Popcorn LinkedIn Plug-in Demo</h1>
<p>Right of video: share button, recommend button, member profile. <br />
Below video: company insider, company profile.<br />
For a description of each plugin's purpose, go to: <a href="http://developer.linkedin.com/community/plugins">LinkedIn Plugins</a></p>
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
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';
}
});