From: ScottDowne Date: Tue, 1 Mar 2011 16:24:52 +0000 (-0500) Subject: [#340] plugins now using getScript X-Git-Tag: v0.4~20^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=4c4061ad1832b0b7c17f8593e28a525910f45d7b;p=popcorn-js.git [#340] plugins now using getScript --- diff --git a/plugins/flickr/popcorn.flickr.js b/plugins/flickr/popcorn.flickr.js index 6a731f5..e7ccf89 100644 --- a/plugins/flickr/popcorn.flickr.js +++ b/plugins/flickr/popcorn.flickr.js @@ -87,7 +87,6 @@ uri += "lang=en-us&format=json&jsoncallback=flickr"; Popcorn.xhr.getJSONP( uri, function( data ) { - //$.getJSON( uri, function( data ) { options.container.innerHTML = "

" + data.title + "

"; Popcorn.forEach( data.items, function ( item, i ) { diff --git a/plugins/googlemap/popcorn.googlemap.js b/plugins/googlemap/popcorn.googlemap.js index 3c76523..1a45eaf 100644 --- a/plugins/googlemap/popcorn.googlemap.js +++ b/plugins/googlemap/popcorn.googlemap.js @@ -32,7 +32,10 @@ var googleCallback; * */ - var newdiv, i = 1, _mapFired = false, _mapLoaded = false; + var newdiv, + i = 1, + _mapFired = false, + _mapLoaded = false; // callback function fires when the script is run googleCallback = function() { @@ -41,23 +44,19 @@ var googleCallback; // insert google api script once if (!_mapFired) { _mapFired = true; - var loadScriptTime = (new Date).getTime(); - var head = document.getElementsByTagName("head")[0]; - var script = document.createElement("script"); - - script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=googleCallback"; - script.type = "text/javascript"; - head.insertBefore( script, head.firstChild ); + Popcorn.getScript("http://maps.google.com/maps/api/js?sensor=false&callback=googleCallback"); } Popcorn.plugin( "googlemap" , function( options ) { - var newdiv, map, location; + var newdiv, + map, + location; // create a new div this way anything in the target div // this is later passed on to the maps api newdiv = document.createElement("div"); - newdiv.id = "actualmap"+i; + newdiv.id = "actualmap" + i; newdiv.style.width = "100%"; newdiv.style.height = "100%"; i++; diff --git a/plugins/googlenews/popcorn.googlenews.html b/plugins/googlenews/popcorn.googlenews.html index 908eaf5..a35a344 100644 --- a/plugins/googlenews/popcorn.googlenews.html +++ b/plugins/googlenews/popcorn.googlenews.html @@ -5,9 +5,6 @@ - - - - -