]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#336] simplify webpage plugin
authorDaniel Brooks <db48x@db48x.net>
Sat, 19 Feb 2011 19:16:22 +0000 (13:16 -0600)
committerDaniel Brooks <db48x@db48x.net>
Sat, 19 Feb 2011 19:16:22 +0000 (13:16 -0600)
plugins/webpage/popcorn.webpage.js

index 5dc0eff4e2a3babeeda9f500e07dd595a2244efe..0d02fad042092565d9f757d06285dfa9afe38dea 100644 (file)
         } )
    *
    */
-  Popcorn.plugin( "webpage" , (function(){
-     
-    return {
-      manifest: {
-        about:{
-          name: "Popcorn Webpage Plugin",
-          version: "0.1",
-          author: "@annasob",
-          website: "annasob.wordpress.com"
-        },
-        options:{
-          id     : {elem:'input', type:'text', label:'Id'},
-          start  : {elem:'input', type:'text', label:'In'},
-          end    : {elem:'input', type:'text', label:'Out'},
-          src    : {elem:'input', type:'text', label:'Src'},
-          target : 'iframe-container'
-        }
+  Popcorn.plugin( "webpage" , {
+    manifest: {
+      about:{
+        name: "Popcorn Webpage Plugin",
+        version: "0.1",
+        author: "@annasob",
+        website: "annasob.wordpress.com"
       },
-      _setup : function( options ) {
-        // make an iframe 
-        options._iframe  = document.createElement( 'iframe' ),
-        options._iframe.setAttribute('width', "100%");
-        options._iframe.setAttribute('height', "100%");
-        options._iframe.id  = options.id;
-        options._iframe.src = options.src;
-        options._iframe.style.display = 'none';
-        // add the hidden iframe to the DOM
-        if ( document.getElementById( options.target ) ) {
-          document.getElementById( options.target ).appendChild(options._iframe);
-        }
-        
-      },
-      /**
-       * @member webpage 
-       * 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){
-        // make the iframe visible
-        options._iframe.style.display = 'inline';
-      },
-      /**
-       * @member webpage 
-       * 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){
-        // make the iframe invisible
-        options._iframe.style.display = 'none';
+      options:{
+        id     : {elem:'input', type:'text', label:'Id'},
+        start  : {elem:'input', type:'text', label:'In'},
+        end    : {elem:'input', type:'text', label:'Out'},
+        src    : {elem:'input', type:'text', label:'Src'},
+        target : 'iframe-container'
+      }
+    },
+    _setup : function( options ) {
+      // make an iframe 
+      options._iframe  = document.createElement( 'iframe' ),
+      options._iframe.setAttribute('width', "100%");
+      options._iframe.setAttribute('height', "100%");
+      options._iframe.id  = options.id;
+      options._iframe.src = options.src;
+      options._iframe.style.display = 'none';
+      // add the hidden iframe to the DOM
+      if ( document.getElementById( options.target ) ) {
+        document.getElementById( options.target ).appendChild(options._iframe);
       }
       
-    };
+    },
+    /**
+     * @member webpage 
+     * 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){
+      // make the iframe visible
+      options._iframe.style.display = 'inline';
+    },
+    /**
+     * @member webpage 
+     * 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){
+      // make the iframe invisible
+      options._iframe.style.display = 'none';
+    }
     
-  })());
-
-})( Popcorn );
\ No newline at end of file
+  });
+})( Popcorn );