<!-- Start Primary Links -->
<nav id="demo-info">
<ul>
- <li><a href="#" onclick="javascript:void();" class="clickhere green"><img src="images/video_icon.png" alt="" width="18" height="14" />watch a video and learn more about this demo</a></li>
+ <li><a href="#" onClick="javascript:void();" class="clickhere green"><img src="images/video_icon.png" alt="" width="18" height="14" />watch a video and learn more about this demo</a></li>
</ul>
</nav>
<!-- End Primary Links -->
};
Popcorn.VideoManager.prototype.loaded = function() {
for (var i in this.commandObjects) {
- if (this.commandObjects[i].name === 'flickr' || this.commandObjects[i].name === 'footnote' || this.commandObjects[i].name === 'location' || this.commandObjects[i].name === 'twitter' || this.commandObjects[i].name === 'wiki') {
+ if (this.commandObjects[i].name === 'flickr' || this.commandObjects[i].name === 'footnote' || this.commandObjects[i].name === 'location' || this.commandObjects[i].name === 'twitter' || this.commandObjects[i].name === 'wiki' || this.commandObjects[i].name === 'lastfm') {
this.commandObjects[i].extension.image = createImage("images/overlay/" + this.commandObjects[i].name + ".png");
this.commandObjects[i].extension.onIn = function() {
this.image.setAttribute('style', "display:inline");
<h3><img src="images/logo_google_news.png" alt="Google News" width="74" height="33" />
</h3>
<div id="googlenewsdiv"><div class="overlay"></div><div class="inactive"></div></div>
+ </section>
+ <section>
+ <h3><img src="images/logo_lastfm.png" alt="Lastfm" width="80" height="24" /></h3>
+ <a href="#" class="collapse"><span>Collapse</span></a>
+ <div class="content" id="lastfmdiv"><div class="overlay"></div><div class="inactive"></div></div>
</section>
</div>
<!-- End Column B -->
};
};
+ ////////////////////////////////////////////////////////////////////////////
+ // Lastfm Command
+ ////////////////////////////////////////////////////////////////////////////
+
+ Popcorn.LastfmCommand = function(name, params, text, videoManager) {
+ Popcorn.VideoCommand.call(this, name, params, text, videoManager);
+ // Setup a default, hidden div to hold the images
+ var target = document.createElement('div');
+ target.setAttribute('id', this.id);
+ document.getElementById(this.params.target).appendChild(target);
+ // Div is hidden by default
+ target.setAttribute('style', 'display:none');
+ // This uses jquery
+ $.getJSON("http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist="+ this.params.resourceid +"&api_key=30ac38340e8be75f9268727cb4526b3d&format=json&callback=?",
+ function(data){
+ htmlString = '';
+ //console.log(data.artist.image[2]['#text']);
+ htmlString += '<h3>'+data.artist.name+'</h3>';
+ htmlString += '<a href="'+data.artist.url+'" target="_blank" style="float:left;margin:0 10px 0 0;"><img src="'+ data.artist.image[2]['#text'] +'" alt=""></a>';
+ htmlString += '<p>'+ data.artist.bio.summary +'</p>';
+ htmlString += '<hr /><p><h4>Tags</h4><ul>';
+ jQuery.each(data.artist.tags.tag, function(i,val) {
+ htmlString += '<li><a href="'+ this.url +'">'+ this.name +'</a></li>';
+ });
+ htmlString += '</ul></p>';
+ htmlString += '<hr /><p><h4>Similar</h4><ul>';
+ jQuery.each(data.artist.similar.artist, function(i,val) {
+ htmlString += '<li><a href="'+ this.url +'">'+ this.name +'</a></li>';
+ });
+ htmlString += '</ul></p>';
+ target.innerHTML = htmlString;
+ }
+ );
+
+ this.target = target;
+ this.onIn = function() {
+ this.target.setAttribute('style', 'display:inline');
+ };
+ this.onOut = function() {
+ this.target.setAttribute('style', 'display:none');
+ };
+ this.preload = function() {}; // Probably going to need to preload this.
+ };
+
////////////////////////////////////////////////////////////////////////////
// Twitter Command
////////////////////////////////////////////////////////////////////////////
create: function(name, params, text, videoManager) {
return new Popcorn.WikiCommand(name, params, text, videoManager);
}
+ },
+ lastfm: {
+ create: function(name, params, text, videoManager) {
+ return new Popcorn.LastfmCommand(name, params, text, videoManager);
+ }
},
lowerthird: {
create: function(name, params, text, videoManager) {