From: ScottDowne Date: Fri, 7 Jan 2011 21:26:11 +0000 (-0500) Subject: [#168] google news plugin X-Git-Tag: v0.2~15^2~3^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a9d38b1531057688dd59de9364fff8499a4e5526;p=popcorn-js.git [#168] google news plugin --- diff --git a/plugins/googleNews/popcorn.googleNews.html b/plugins/googleNews/popcorn.googleNews.html new file mode 100644 index 0000000..81ed3c4 --- /dev/null +++ b/plugins/googleNews/popcorn.googleNews.html @@ -0,0 +1,56 @@ + + + + Popcorn google Map Plug-in Demo + + + + + + + + + + +

Popcorn google News Plug-in Demo

+

Google News topic will appear at 0 seconds and disappear at 20 seconds.

+

Google News topic will appear at 25 seconds and disappear at 30 seconds.

+
+ +
+
+ + diff --git a/plugins/googleNews/popcorn.googleNews.js b/plugins/googleNews/popcorn.googleNews.js new file mode 100644 index 0000000..54a0312 --- /dev/null +++ b/plugins/googleNews/popcorn.googleNews.js @@ -0,0 +1,59 @@ +// PLUGIN: Google News + +(function (Popcorn) { + + /** + */ + Popcorn.plugin( "googleNews" , { + + manifest: { + about:{ + name: "Popcorn Google News Plugin", + version: "0.1", + author: "Scott Downe", + website: "http://scottdowne.wordpress.com/" + }, + options:{ + start : {elem:'input', type:'text', label:'In'}, + end : {elem:'input', type:'text', label:'Out'}, + target : 'news-container', + topic : {elem:'select', type:'text', label:'Type'} + } + }, + _setup : function( options ) { + + options.container = document.createElement( 'div' ); + + document.getElementById( options.target ).appendChild( options.container ); + + var newsShow = new google.elements.NewsShow( options.container, { + format : "300x250", + queryList : [ + { q: options.topic || "Top Stories" } + ] + } ); + options.container.style.display = "none"; + + }, + /** + * @member googleNews + * The start function will be executed when the currentTime + * of the video reaches the start time provided by the + * options variable + */ + start: function( event, options ){ + options.container.setAttribute( 'style', 'display:inline' ); + }, + /** + * @member googleNews + * 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.setAttribute( 'style', 'display:none' ); + } + + }); + +})( Popcorn );