Difference between revisions of "User:Minooz/OSD600/popcorn/doc"

From CDOT Wiki
Jump to: navigation, search
(Documentation for tagthisperson plugin)
(Documentation for tagthisperson plugin)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
===Documentation for <TT> tagthisperson </TT> plugin===
 
===Documentation for <TT> tagthisperson </TT> plugin===
  
: Name
+
Name
:: <TT>tagthisperson</TT>
+
<pre>tagthisperson</pre>
  
 +
Example
 +
<pre>
 +
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 );
 +
</pre>
 +
Description
 +
<pre>Adds people's names that are tagged in a subtitle to an element on the page
 +
If the person has an image or a url to his/her webpage, it will be attached to the person</pre>
  
: Example
+
Syntax
::
+
<pre>
var p = Popcorn('#video')
+
Popcorn.plugin( "tagthisperson" , ( function() {
.tagthisperson({
+
  return {
start: 0, // seconds
+
    manifest:
end: 10, // seconds
+
    options:{
person: 'Anna Sob',
+
      start    : {elem:'input', type:'text', label:'In'},
image: 'http://newshour.s3.amazonaws.com/RichardNSmith_thumbnail.jpg',
+
      end      : {elem:'input', type:'text', label:'Out'},
href: 'http://annasob.wordpress.com',
+
      target  : 'tag-container',
target: 'tagdiv'
+
      person  : {elem:'input', type:'text', label:'Name'},
} )
+
      image    : {elem:'input', type:'text', label:'Image Src'},
.tagthisperson({
+
      href    : {elem:'input', type:'text', label:'href Src'}
start: 5, // seconds
+
  }
end: 15, // seconds
+
  _setup:
person: 'Scott',
+
  _start:
target: 'tagdiv'
+
  _end:
} )
+
};
: Description
+
})());
:: Adds people's names to an element on the page
+
</pre>
:: Options parameter will need a start, end, target, image and person.
 
:: 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
 
:: Person is the name of the person who you want to tag
 
:: Image is the url to the image of the person - optional
 
:: Target is the id of the document element that the text needs to be
 
:: attached to, this target element must exist on the DOM
 
  
: Parameters
+
Parameters
:: {Object} options
+
<pre>
 +
  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
 +
</pre>

Latest revision as of 23:12, 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
If the person has an image or a url to his/her webpage, it will be attached to the person

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