From: Christopher De Cairos Date: Fri, 23 Sep 2011 17:36:24 +0000 (-0400) Subject: Style cleanup X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=958d32275264b3a279d2151f71d79339cf897e95;p=popcorn-js.git Style cleanup --- diff --git a/plugins/gml/popcorn.gml.js b/plugins/gml/popcorn.gml.js index 10db083..9de4703 100755 --- a/plugins/gml/popcorn.gml.js +++ b/plugins/gml/popcorn.gml.js @@ -1,11 +1,11 @@ // PLUGIN: GML -(function (Popcorn) { +(function ( Popcorn ) { var gmlPlayer = function( $p ) { var _stroke = 0, - onPt = 0, + onPt = 0, onStroke = 0, x = null, y = null, @@ -121,18 +121,18 @@ dataReady(); }; }; - + /** - * Grafiti markup Language (GML) popcorn plug-in + * Grafiti markup Language (GML) popcorn plug-in * Renders a GML tag inside an HTML element * Options parameter will need a mandatory start, end, target, gmltag. * Optional parameters: none. * 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 + * End is the time that you want this plug-in to stop executing * Target is the id of the document element that you wish to render the grafiti in * gmltag is the numerical reference to a gml tag via 000000book.com * @param {Object} options - * + * * Example: var p = Popcorn('#video') .gml({ @@ -145,11 +145,11 @@ */ Popcorn.plugin( "gml" , { - _setup : function( options ) { + _setup: function( options ) { var self = this, target = document.getElementById( options.target ); - + options.endDrawing = options.endDrawing || options.end; // create a canvas to put in the target div @@ -162,7 +162,7 @@ throw new Error( "target container doesn't exist" ); } target && target.appendChild( options.container ); - + var scriptReady = function() { Popcorn.getJSONP( "http://000000book.com/data/" + options.gmltag + ".json?callback=", function( data ) { @@ -176,15 +176,15 @@ Popcorn.getScript( "http://processingjs.org/content/download/processing-js-1.3.0/processing-1.3.0.min.js", scriptReady ); } else { - + scriptReady(); } }, /** - * @member gml - * The start function will be executed when the currentTime - * of the video reaches the start time provided by the + * @member gml + * 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 ) { @@ -193,9 +193,9 @@ options.container.style.display = "block"; }, /** - * @member gml - * The end function will be executed when the currentTime - * of the video reaches the end time provided by the + * @member gml + * 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 ) { diff --git a/plugins/processing/popcorn.processing.js b/plugins/processing/popcorn.processing.js index 8162358..622b6b4 100644 --- a/plugins/processing/popcorn.processing.js +++ b/plugins/processing/popcorn.processing.js @@ -26,13 +26,13 @@ (function ( Popcorn ) { - Popcorn.plugin( "processing" , function ( options ) { + Popcorn.plugin( "processing", function( options ) { var init = function( context ) { function scriptReady( options ) { var addListeners = function() { - context.listen( "pause", function () { + context.listen( "pause", function() { if ( options.canvas.style.display === "inline" ) { options.pjsInstance.noLoop(); } @@ -64,17 +64,16 @@ options.noPause = options.noPause || false; !options.noPause && addListeners(); - options.codeReady = true; + options.codeReady = true; } }); } else if ( Popcorn.plugin.debug ) { throw new Error( "Popcorn.Processing: options.sketch is undefined" ); } - } - if (!window.Processing) { + if ( !window.Processing ) { Popcorn.getScript( "http://processingjs.org/content/download/processing-js-1.3.0/processing-1.3.0.js", function() { scriptReady( options ); }); @@ -97,7 +96,7 @@ } var canvas = document.createElement( "canvas" ); - canvas.id = Popcorn.guid( options.target + "-sketch-" ); + canvas.id = Popcorn.guid( options.target + "-sketch" ); canvas.style.display = "none"; options.canvas = canvas; @@ -133,11 +132,31 @@ website: "cadecairos.blogspot.com, ben1amin.wordpress.org" }, options: { - start : { elem: "input", type: "text", label: "In" }, - end : { elem: "input", type: "text", label: "Out" }, - target : { elem: "input", type: "text", label: "Target" }, - sketch : { elem: "input", type: "text", label: "Sketch" }, - noPause : { elem: "select", options: [ "TRUE", "FALSE" ], label: "No Loop" } + start: { + elem: "input", + type: "text", + label: "In" + }, + end: { + elem: "input", + type: "text", + label: "Out" + }, + target: { + elem: "input", + type: "text", + label: "Target" + }, + sketch: { + elem: "input", + type: "text", + label: "Sketch" + }, + noPause: { + elem: "select", + options: [ "TRUE", "FALSE" ], + label: "No Loop" + } } }); }( Popcorn ));