From a131fcceab7cd0dbab20d8f5f45131b05e5c21ce Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Mon, 10 Jan 2011 16:09:46 -0500 Subject: [PATCH] [#249] moved code block into closure --- plugins/twitter/popcorn.twitter.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/twitter/popcorn.twitter.js b/plugins/twitter/popcorn.twitter.js index a5b88b2..0ebba93 100644 --- a/plugins/twitter/popcorn.twitter.js +++ b/plugins/twitter/popcorn.twitter.js @@ -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: { -- 2.43.0