]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#249] moved code block into closure
authorScottDowne <sdowne@learn.senecac.on.ca>
Mon, 10 Jan 2011 21:09:46 +0000 (16:09 -0500)
committerScottDowne <sdowne@learn.senecac.on.ca>
Mon, 10 Jan 2011 21:09:46 +0000 (16:09 -0500)
plugins/twitter/popcorn.twitter.js

index a5b88b2b84d8e170e2d349cc5a654e1b487d1b1f..0ebba9353226acda344b1f7fd2146eb4d6a7bbf8 100644 (file)
@@ -1,14 +1,5 @@
 // PLUGIN: TWITTER
 
-if ( !window.TWTR ) {
-  var head = document.getElementsByTagName("head")[0] || document.documentElement,
-      script = document.createElement("script");
-
-    script.src = "http://widgets.twimg.com/j/2/widget.js";
-
-    head.insertBefore( script, head.firstChild );
-}
-
 (function (Popcorn) {
 
   /**
@@ -38,6 +29,16 @@ if ( !window.TWTR ) {
         } )
    *
    */
+
+  if ( !window.TWTR ) {
+    var head = document.getElementsByTagName("head")[0] || document.documentElement,
+        script = document.createElement("script");
+
+    script.src = "http://widgets.twimg.com/j/2/widget.js";
+
+    head.insertBefore( script, head.firstChild );
+  }
+
   Popcorn.plugin( "twitter" , {
 
       manifest: {