(function (Popcorn) {
var i = 1,
- scriptLoaded = false,
- callBack = function( data ) {
+ scriptLoading = false,
+ scriptLoaded = false,
+ callBack = function( data ) {
if ( typeof google !== 'undefined' && google.load ) {
}
};
- Popcorn.getScript( "http://www.google.com/jsapi", callBack );
- Popcorn.getScript( "http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js" );
-
- //Doing this because I cannot find something similar to getScript() for css files
- var head = document.getElementsByTagName("head")[0];
- var css = document.createElement('link');
- css.type = "text/css";
- css.rel = "stylesheet";
- css.href = "http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css";
- head.insertBefore( css, head.firstChild );
-
/**
* googlefeed popcorn plug-in
* Adds a feed from the specified blog url at the target div
}
};
+ if ( !scriptLoading ) {
+
+ scriptLoading = true;
+
+ Popcorn.getScript( "http://www.google.com/jsapi", callBack );
+ Popcorn.getScript( "http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js" );
+
+ //Doing this because I cannot find something similar to getScript() for css files
+ var head = document.getElementsByTagName("head")[0];
+ var css = document.createElement('link');
+ css.type = "text/css";
+ css.rel = "stylesheet";
+ css.href = "http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css";
+ head.insertBefore( css, head.firstChild );
+ }
+
initialize();
return {
// PLUGIN: Google Maps
var googleCallback;
(function (Popcorn) {
+
var newdiv,
i = 1,
_mapFired = false,
}, 1);
}
};
- // if this is the firest time running the plugins
- // call the function that gets the sctipt
- if ( !_mapFired ) {
- loadMaps();
- }
/**
* googlemap popcorn plug-in
var newdiv,
map,
location;
+
+ // if this is the firest time running the plugins
+ // call the function that gets the sctipt
+ if ( !_mapFired ) {
+ loadMaps();
+ }
// create a new div this way anything in the target div is left intact
// this is later passed on to the maps api
(function (Popcorn) {
var scriptLoaded = false,
+ scriptLoading = false,
callBack = function( data ) {
if ( typeof google !== 'undefined' && google.load ) {
}
};
- Popcorn.getScript( "http://www.google.com/jsapi", callBack );
-
/**
* Google News popcorn plug-in
* Displays Google News information on a topic in a targeted div.
}
},
_setup : function( options ) {
+
+ if ( !scriptLoading ) {
+
+ scriptLoading = true;
+ Popcorn.getScript( "http://www.google.com/jsapi", callBack );
+ }
options.container = document.createElement( 'div' );
if ( document.getElementById( options.target ) ) {
(function (Popcorn) {
- Popcorn.getScript('https://github.com/janl/mustache.js/raw/master/mustache.js');
-
/**
* Mustache Popcorn Plug-in
*
*/
Popcorn.plugin( 'mustache' , function( options ) {
+
+ Popcorn.getScript('https://github.com/janl/mustache.js/raw/master/mustache.js');
+
var getData, data, getTemplate, template;
var shouldReload = !!options.dynamic,
_mapFired = false,
_mapLoaded = false;
- // insert openlayers api script once
- if ( !_mapFired ) {
- _mapFired = true;
- Popcorn.getScript('http://openlayers.org/api/OpenLayers.js',
- function() {
- _mapLoaded = true;
- } );
- }
-
Popcorn.plugin( "openmap" , function( options ){
var newdiv,
map,
selectControl,
popup;
+ // insert openlayers api script once
+ if ( !_mapFired ) {
+ _mapFired = true;
+ Popcorn.getScript('http://openlayers.org/api/OpenLayers.js',
+ function() {
+ _mapLoaded = true;
+ } );
+ }
+
// create a new div within the target div
// this is later passed on to the maps api
newdiv = document.createElement( 'div' );
// PLUGIN: TWITTER
(function (Popcorn) {
+ var scriptLoading = false;
/**
* Twitter popcorn plug-in
*
*/
- if ( !window.TWTR ) {
- Popcorn.getScript("http://widgets.twimg.com/j/2/widget.js");
- }
-
Popcorn.plugin( "twitter" , {
manifest: {
_setup: function( options ) {
+ if ( !window.TWTR && !scriptLoading ) {
+ scriptLoading = true;
+ Popcorn.getScript("http://widgets.twimg.com/j/2/widget.js");
+ }
+
// setup widget div that is unique per track
options.container = document.createElement( 'div' ); // create the div to store the widget
options.container.setAttribute('id', Popcorn.guid()); // use this id to connect it to the widget