[#281] Finished. Meta-ticket filedd about jQuery dependency (#347)

This commit is contained in:
stevenaw 2011-02-16 11:17:23 -05:00
Родитель 33dbec582d
Коммит ea2ad66ac1
2 изменённых файлов: 18 добавлений и 54 удалений

Просмотреть файл

@ -11,37 +11,23 @@
var p = Popcorn('#video')
.flickr({
start: 5, // seconds
end: 10, // seconds
userid: '35034346917@N01',
numberofimages: '8',
target: 'flickrdiv'
} )
.flickr({
start: 10, // seconds
end: 15, // seconds
userid: '35034346917@N01',
tags: 'georgia',
numberofimages: '8',
target: 'flickrdiv'
} )
.flickr({
start: 15, // seconds
end: 20, // seconds
tags: 'georgia',
numberofimages: '8',
target: 'flickrdiv'
} )
.flickr({
start: 20, // seconds
end: 25, // seconds
tags: 'georgia,fish',
end: 30, // seconds
tags: 'georgia',
numberofimages: '8',
target: 'flickrdiv'
} )
.flickr({
start: 30, // seconds
start: 35, // seconds
end: 45, // seconds
userid: '78868639@N00',
userid: '35034346917@N01',
tags: 'georgia',
numberofimages: '8',
target: 'flickrdiv'
} )
.play();
@ -52,8 +38,9 @@
<body>
<h1 id="qunit-header">Popcorn Flickr Plug-in Demo</h1>
<p>This plugin requires jquery</p>
<p>Flickr images will appear at 5 seconds and disappear at 15 seconds.</p>
<p>More Flickr images will appear at 20 seconds and disappear at 45 seconds.</p>
<p>Flickr images by '35034346917@N01' will appear at 5 seconds and disappear at 15 seconds.
<br />Flickr images tagged 'georgia' will appear at 20 seconds and disappear at 30 seconds.
<br />Flickr images by '35034346917@N01' and tagged 'georgia' will appear at 35 seconds and disappear at 45 seconds.</p>
<div>
<video id='video'
controls

Просмотреть файл

@ -1,7 +1,6 @@
// PLUGIN: FLICKR
(function (Popcorn) {
/**
* Flickr popcorn plug-in
* Appends a users Flickr images to an element on the page.
@ -10,6 +9,7 @@
* 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
* Userid is the id of who's Flickr images you wish to show
* Tags is a mutually exclusive list of image descriptor tags
* Target is the id of the document element that the images are
* appended to, this target element must exist on the DOM
* Numberofimages specify the number of images to retreive from flickr, defaults to 8
@ -25,7 +25,8 @@
.footnote({
start: 5, // seconds, mandatory
end: 15, // seconds, mandatory
userid: '35034346917@N01', // mandatory
userid: '35034346917@N01', // optional
tags: 'dogs,cats', // optional
numberofimages: '8', // optional
height: '50px', // optional
width: '50px', // optional
@ -40,8 +41,8 @@
manifest: {
about:{
name: "Popcorn Flickr Plugin",
version: "0.1",
author: "Scott Downe",
version: "0.1.1",
author: "Scott Downe, Steven Weerdenburg",
website: "http://scottdowne.wordpress.com/"
},
options:{
@ -82,37 +83,13 @@
if ( tags ) {
uri += "tags="+tags+"&";
}
/*uri += "lang=en-us&format=json&jsoncallback=jsonp";
Popcorn.xhr.getJSONP( uri,
function( data ) {
options.container.innerHTML = "<p style='padding:" + padding + ";'>" + data.title + "<p/>";
Popcorn.forEach( data.items, function ( item, i ) {
if ( i < count ) {
var link = document.createElement('a');
link.setAttribute( 'href', item.link );
link.setAttribute( "target", "_blank" );
var image = document.createElement( 'img' );
image.setAttribute( 'src', item.media.m );
image.setAttribute( 'height', height );
image.setAttribute( 'width', width );
image.setAttribute( 'style', 'border:' + border + ';padding:' + padding );
link.appendChild( image );
options.container.appendChild( link );
} else {
return false;
}
});
}
);*/
uri += "lang=en-us&format=json&jsoncallback=?";
$.getJSON( uri, function( data ){
$.getJSON( uri, function( data ) {
options.container.innerHTML = "<p style='padding:" + padding + ";'>" + data.title + "<p/>";
$.each( data.items, function( i, item ) {
Popcorn.forEach( data.items, function ( item, i ) {
if ( i < count ) {
var link = document.createElement('a');
link.setAttribute( 'href', item.link );