]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
fixed linting errors [#392]
authorAnna Sobiepanek <annaopensource@gmail.com>
Thu, 17 Mar 2011 20:50:08 +0000 (16:50 -0400)
committerAnna Sobiepanek <annaopensource@gmail.com>
Thu, 17 Mar 2011 20:50:08 +0000 (16:50 -0400)
plugins/code/popcorn.code.js
plugins/googlefeed/popcorn.googlefeed.js
plugins/lowerthird/popcorn.lowerthird.js
plugins/openmap/popcorn.openmap.js
plugins/subtitle/popcorn.subtitle.js
plugins/webpage/popcorn.webpage.js

index 077d401ed497a486962f55659a643be09b4ff6ab..0fa5cc7ff761976b4223343e7a661d0365774264 100644 (file)
     
     } )();
 
-    if ( !options.onStart || !( typeof options.onStart === 'function' ) ) {
+    if ( !options.onStart || typeof options.onStart !== 'function' ) {
       throw 'Popcorn Code Plugin Error: onStart must be a function.';
     }
 
-    if ( options.onEnd && !( typeof options.onEnd === 'function' ) ) {
+    if ( options.onEnd && typeof options.onEnd !== 'function' ) {
       throw 'Popcorn Code Plugin Error: onEnd  must be a function.';
     }
 
-    if ( options.onFrame && !( typeof options.onFrame === 'function' ) ) {
+    if ( options.onFrame && typeof options.onFrame !== 'function' ) {
       throw 'Popcorn Code Plugin Error: onFrame  must be a function.';
     }
 
index 5ea9468d2219aaf90fe1dbd9a7adc6cb06e353e0..29d7b59b285f1599fbdb4f01bb20ce7723626dd6 100644 (file)
@@ -67,7 +67,7 @@
         }, 5);
       } else {
         // Create the feed control using the user entered url and title
-        new GFdynamicFeedControl( options.url, newdiv, {
+        var tmp = new GFdynamicFeedControl( options.url, newdiv, {
           vertical:   options.orientation.toLowerCase() == "vertical" ? true : false,
           horizontal: options.orientation.toLowerCase() == "horizontal" ? true : false,
           title:      options.title = options.title || "Blog"
index d655ee53093da90b63db79d26b88ff02f4eb2bba..c2072dbdd4f9473550c027aa0f7f4a978424e55c 100644 (file)
   // just a little tool function
   // calculates the top and left position of an element
   var offset = function(elem) {
-    if(!elem) elem = this;
+    if ( !elem ) { elem = this; }
 
     var x = elem.offsetLeft;
     var y = elem.offsetTop;
 
-    while (elem = elem.offsetParent) {
+    while ( elem === elem.offsetParent ) {
       x += elem.offsetLeft;
       y += elem.offsetTop;
     }
 
     return { left: x, top: y };
-  }
+  };
 
   Popcorn.plugin( "lowerthird" , {
     
index 1a65bb7d26162aaa7827470f83fdd1ba69891def..afbc3a1f9a7b86252a5fb6bbf29fbef38bcf0730 100644 (file)
@@ -102,7 +102,7 @@ var openmapCallback;
         }
         else if( options.type == "SATELLITE" ) {
           // add NASA WorldWind / LANDSAT map
-          map = new OpenLayers.Map( { div: newdiv, "maxResolution": .28125, tileSize: new OpenLayers.Size( 512, 512 ) } );
+          map = new OpenLayers.Map( { div: newdiv, "maxResolution": 0.28125, tileSize: new OpenLayers.Size( 512, 512 ) } );
           var worldwind = new OpenLayers.Layer.WorldWind( "LANDSAT", "http://worldwind25.arc.nasa.gov/tile/tile.aspx", 2.25, 4, { T: "105" } );
           map.addLayer( worldwind );
           displayProjection = new OpenLayers.Projection( "EPSG:4326" );
index 2dbfaae71a8361531b7e3f3a7da357ace8f1d246..c6db4f246d4164174315d511f0d27c96b84458f4 100644 (file)
@@ -66,7 +66,7 @@
         do {
             left += obj.offsetLeft;
             top  += obj.offsetTop;
-        } while (obj = obj.offsetParent);
+        } while (obj === obj.offsetParent);
     }
     return {
         left : left,
index 0d02fad042092565d9f757d06285dfa9afe38dea..54861ad92f53937e8ab7ac754b50bc073915dd18 100644 (file)
@@ -44,7 +44,7 @@
     },
     _setup : function( options ) {
       // make an iframe 
-      options._iframe  = document.createElement( 'iframe' ),
+      options._iframe  = document.createElement( 'iframe' );
       options._iframe.setAttribute('width', "100%");
       options._iframe.setAttribute('height', "100%");
       options._iframe.id  = options.id;