From: David Seifried Date: Fri, 29 Jul 2011 16:07:58 +0000 (-0400) Subject: Fixed merge conflict X-Git-Tag: v0.8^2~7^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=94786850cbf7d0c37f7b2caca7b9cd8c039183ff;p=popcorn-js.git Fixed merge conflict --- 94786850cbf7d0c37f7b2caca7b9cd8c039183ff diff --cc plugins/flickr/popcorn.flickr.js index 955108f,dfd6031..a4d9738 --- a/plugins/flickr/popcorn.flickr.js +++ b/plugins/flickr/popcorn.flickr.js @@@ -63,14 -64,13 +64,14 @@@ containerDiv.style.height = "100%"; containerDiv.style.display = "none"; idx++; - + // ensure the target container the user chose exists - if ( document.getElementById( options.target ) ) { - document.getElementById( options.target ).appendChild( containerDiv ); - } else { - throw ( "flickr target container doesn't exist" ); ++ + if ( !target && Popcorn.plugin.debug ) { + throw new Error( "flickr target container doesn't exist" ); } + target && target.appendChild( containerDiv ); - + // get the userid from Flickr API by using the username and apikey var isUserIDReady = function() { if ( !_userid ) { diff --cc plugins/footnote/popcorn.footnote.js index 44ce4e3,436f7dc..2f4781c --- a/plugins/footnote/popcorn.footnote.js +++ b/plugins/footnote/popcorn.footnote.js @@@ -24,59 -24,56 +24,60 @@@ } ) * */ - Popcorn.plugin( "footnote" , { - - manifest: { - about:{ - name: "Popcorn Footnote Plugin", - version: "0.1", - author: "@annasob", - website: "annasob.wordpress.com" + + Popcorn.forEach( [ "footnote", "text" ], function( name ) { + + Popcorn.plugin( name , { + + manifest: { + about: { + name: "Popcorn " + name + " Plugin", + version: "0.2", + author: "@annasob, @rwaldron", + website: "annasob.wordpress.com" + }, + options: { + start: { elem: "input", type: "text", label: "In" }, + end: { elem: "input", type: "text", label: "Out" }, + text: { elem: "input", type: "text", label: "Text" }, + target: name + "-container" + } }, - _setup: function( options ) { - options._container = document.createElement( "div" ); - options._container.style.display = "none"; - options._container.innerHTML = options.text; - options:{ - start : {elem:'input', type:'text', label:'In'}, - end : {elem:'input', type:'text', label:'Out'}, - target : 'footnote-container', - text : {elem:'input', type:'text', label:'Text'} - } - }, + _setup: function(options) { - var target = document.getElementById( options.target ); + var target = document.getElementById( options.target ); - target && target.appendChild( options._container ); - }, - /** - * @member footnote - * 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.style.display = "inline"; - }, - /** - * @member footnote - * 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.style.display = "none"; - }, - _teardown: function( options ) { - - var target = document.getElementById( options.target ); + options._container = document.createElement( 'div' ); + options._container.style.display = "none"; + options._container.innerHTML = options.text; - target && target.removeChild( options._container ); + if ( !target && Popcorn.plugin.debug ) { + throw new Error( "target container doesn't exist" ); } - }); + target && target.appendChild( options._container ); + }, + /** + * @member footnote + * 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.style.display = "inline"; + }, + /** + * @member footnote + * 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.style.display = "none"; + }, + _teardown: function( options ) { + document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( options._container ); + } }); ++}); })( Popcorn ); diff --cc plugins/openmap/popcorn.openmap.js index 4a782e4,ccc3d08..b741241 --- a/plugins/openmap/popcorn.openmap.js +++ b/plugins/openmap/popcorn.openmap.js @@@ -63,19 -58,20 +63,21 @@@ pointLayer, selectControl, popup, + isGeoReady, - target; - - target = document.getElementById( options.target ); + target = document.getElementById( options.target ); // create a new div within the target div // this is later passed on to the maps api - newdiv = document.createElement( 'div' ); - newdiv.id = "openmapdiv" + i; - newdiv.style.width = "100%"; - newdiv.style.height = "100%"; + newdiv = document.createElement( "div" ); + newdiv.id = "openmapdiv" + i; + newdiv.style.width = "100%"; + newdiv.style.height = "100%"; i++; - + if ( !target && Popcorn.plugin.debug ) { + throw new Error( "target container doesn't exist" ); + } ++ target && target.appendChild( newdiv ); // callback function fires when the script is run diff --cc plugins/tagthisperson/popcorn.tagthisperson.js index 557b0fc,8bd07f0..c0db64a --- a/plugins/tagthisperson/popcorn.tagthisperson.js +++ b/plugins/tagthisperson/popcorn.tagthisperson.js @@@ -47,9 -47,30 +47,15 @@@ Popcorn.plugin( "tagthisperson" , ( function() { 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 : 'tagthisperson-container', - person : {elem:'input', type:'text', label:'Name'}, - image : {elem:'input', type:'text', label:'Image Src'}, - href : {elem:'input', type:'text', label:'URL'} - } - }, + _setup: function( options ) { - var exists = false; + var exists = false, + target = document.getElementById( options.target ); + + if ( !target && Popcorn.plugin.debug ) { + throw new Error( "target container doesn't exist" ); + } + // loop through the existing objects to ensure no duplicates // the idea here is to have one object per unique options.target for ( var i = 0; i < peopleArray.length; i++ ) {