Difference between revisions of "User:Minooz/OSD600/popcorn/doc"
(→Documentation for tagthisperson plugin) |
(→Documentation for tagthisperson plugin) |
||
Line 29: | Line 29: | ||
<pre> | <pre> | ||
Popcorn.plugin( "tagthisperson" , ( function() { | Popcorn.plugin( "tagthisperson" , ( function() { | ||
+ | return { | ||
+ | manifest: | ||
+ | options:{ | ||
+ | start : {elem:'input', type:'text', label:'In'}, | ||
+ | end : {elem:'input', type:'text', label:'Out'}, | ||
+ | target : 'tag-container', | ||
+ | person : {elem:'input', type:'text', label:'Name'}, | ||
+ | image : {elem:'input', type:'text', label:'Image Src'}, | ||
+ | href : {elem:'input', type:'text', label:'href Src'} | ||
+ | } | ||
+ | _setup: | ||
+ | _start: | ||
+ | _end: | ||
+ | }; | ||
− | + | })()); | |
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> |
Revision as of 22:00, 26 February 2011
Documentation for tagthisperson plugin
Name
- tagthisperson
Example
var p = Popcorn('#video') .tagthisperson( { start: 0, // seconds end: 10, // seconds person: 'Anna Sob', image: 'http://newshour.s3.amazonaws.com/RichardNSmith_thumbnail.jpg', href: 'http://annasob.wordpress.com', target: 'tagdiv' } ) .tagthisperson( { start: 5, // seconds end: 15, // seconds person: 'Scott', target: 'tagdiv' } ) }, false );
Description
- Adds people's names that are tagged in a subtitle to an element on the page
- Syntax
Popcorn.plugin( "tagthisperson" , ( function() { return { manifest: options:{ start : {elem:'input', type:'text', label:'In'}, end : {elem:'input', type:'text', label:'Out'}, target : 'tag-container', person : {elem:'input', type:'text', label:'Name'}, image : {elem:'input', type:'text', label:'Image Src'}, href : {elem:'input', type:'text', label:'href Src'} } _setup: _start: _end: }; })());
- Parameters
start - The time that you want this plug-in to execute end - The time that you want this plug-in to stop executing person - The name of the person who you want to tag image - The url to the image of the person - optional href - The url to the webpage of the person - optional target - The id of the document element that the text needs to be - attached to, this target element must exist on the DOM
// Keep track of qty and sequence of options' objects based on the options' target var count = 0; var targetObj = {}; function addCount( target ) { targetObj[ target ] = ++count; } return { manifest: { about:{ name: "Popcorn tagthisperson Plugin", version: "0.1", author: "@annasob", website: "annasob.wordpress.com" }, options:{ start : {elem:'input', type:'text', label:'In'}, end : {elem:'input', type:'text', label:'Out'}, target : 'tag-container', person : {elem:'input', type:'text', label:'Name'}, image : {elem:'input', type:'text', label:'Image Src'}, href : {elem:'input', type:'text', label:'href Src'} } }, _setup: function( options ) {