From f4ad23eafa3a754457e00aeeb1486e6f7091dba0 Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Thu, 24 Feb 2011 16:40:47 -0500 Subject: [PATCH] [#316] added documentation to lowerthird, googlename and subtitle plugin.js files --- plugins/googlenews/popcorn.googlenews.js | 21 ++++++++++++++++ plugins/lowerthird/popcorn.lowerthird.js | 27 +++++++++++++++++++- plugins/subtitle/popcorn.subtitle.js | 32 ++++++++++++++++-------- 3 files changed, 68 insertions(+), 12 deletions(-) diff --git a/plugins/googlenews/popcorn.googlenews.js b/plugins/googlenews/popcorn.googlenews.js index 69cfaf9..b80b554 100644 --- a/plugins/googlenews/popcorn.googlenews.js +++ b/plugins/googlenews/popcorn.googlenews.js @@ -3,6 +3,27 @@ (function (Popcorn) { /** + * Google News popcorn plug-in + * Displays Google News information on a topic in a targeted div. + * Options parameter will need a start, end and target. + * Optional parameters are topic. topic defaults to "top stories" + * Start is the time that you want this plug-in to execute + * End is the time that you want this plug-in to stop executing + * Target is the id of the document element that the content is + * appended to, this target element must exist on the DOM + * Topic is the topic of news articles you want to display. + * + * @param {Object} options + * + * Example: + var p = Popcorn('#video') + .footnote({ + start: 5, // seconds, mandatory + end: 15, // seconds, mandatory + topic: 'oil spill', // optional + target: 'newsdiv' // mandatory + } ) + * */ Popcorn.plugin( "googlenews" , { diff --git a/plugins/lowerthird/popcorn.lowerthird.js b/plugins/lowerthird/popcorn.lowerthird.js index 23e42bc..d655ee5 100644 --- a/plugins/lowerthird/popcorn.lowerthird.js +++ b/plugins/lowerthird/popcorn.lowerthird.js @@ -3,7 +3,32 @@ (function (Popcorn) { /** - */ + * Lower Third popcorn plug-in + * Displays information about a speaker over the video, or in the target div + * Options parameter will need a start, and end. + * Optional parameters are target, salutation, name and role. + * Start is the time that you want this plug-in to execute + * End is the time that you want this plug-in to stop executing + * Target is the id of the document element that the content is + * appended to, this target element must exist on the DOM + * salutation is the speaker's Mr. Ms. Dr. etc. + * name is the speaker's name. + * role is information about the speaker, example Engineer. + * + * @param {Object} options + * + * Example: + var p = Popcorn('#video') + .footnote({ + start: 5, // seconds, mandatory + end: 15, // seconds, mandatory + salutation: 'Mr', // optional + name: 'Scott Downe', // optional + role: 'Programmer', // optional + target: 'subtitlediv' // optional + } ) + * + */ // just a little tool function // calculates the top and left position of an element diff --git a/plugins/subtitle/popcorn.subtitle.js b/plugins/subtitle/popcorn.subtitle.js index 27ad26b..21fdb27 100644 --- a/plugins/subtitle/popcorn.subtitle.js +++ b/plugins/subtitle/popcorn.subtitle.js @@ -3,6 +3,27 @@ (function (Popcorn) { /** + * Subtitle popcorn plug-in + * Displays a subtitle over the video, or in the target div + * Options parameter will need a start, and end. + * Optional parameters are target and text. + * Start is the time that you want this plug-in to execute + * End is the time that you want this plug-in to stop executing + * Target is the id of the document element that the content is + * appended to, this target element must exist on the DOM + * Text is the text of the subtitle you want to display. + * + * @param {Object} options + * + * Example: + var p = Popcorn('#video') + .footnote({ + start: 5, // seconds, mandatory + end: 15, // seconds, mandatory + text: 'Hellow world', // optional + target: 'subtitlediv' // optional + } ) + * */ // just a little tool function @@ -34,17 +55,6 @@ } ); }; - -/* - // Find element offset - if (element.offsetParent) { - do { - offsetX += element.offsetLeft; - offsetY += element.offsetTop; - } while ((element = element.offsetParent)); - } -*/ - Popcorn.plugin( "subtitle" , { manifest: { -- 2.43.0