]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Style cleanup
authorChristopher De Cairos <chris.decairos@gmail.com>
Fri, 23 Sep 2011 17:36:24 +0000 (13:36 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Fri, 23 Sep 2011 17:36:24 +0000 (13:36 -0400)
plugins/gml/popcorn.gml.js
plugins/processing/popcorn.processing.js

index 10db08311c7c6499f0293ad371d9db4f74e17012..9de47032faa251385c9a013ae27f7981dd96e1b8 100755 (executable)
@@ -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,
           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({
    */
   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
         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 ) {
 
 
         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 ) {
       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 ) {
index 81623581d948c7ffa5d97c4e05148724944b9a2a..622b6b46dd210a285ee1ade99a0c7388cd383506 100644 (file)
 
 (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();
             }
 
               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;
 
       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 ));