attrib += ", <a href='" + options.licenseurl + "' target='_blank'>license</a> ";
}
options._container.innerHTML = attrib;
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).appendChild( options._container );
- }
+
+ document.getElementById( options.target ) && document.getElementById( options.target ).appendChild( options._container );
},
/**
* @member attribution
options._container.style.display = "none";
},
_teardown: function( options ) {
- document.getElementById( options.target ).removeChild( options._container );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( options._container );
}
};
})());
containerDiv.style.display = "none";
},
_teardown: function( options ) {
- document.getElementById( options.target ).removeChild( containerDiv );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( containerDiv );
}
};
},
options._container = document.createElement( 'div' );
options._container.style.display = "none";
options._container.innerHTML = options.text;
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).appendChild( options._container );
- }
+
+ document.getElementById( options.target ) && document.getElementById( options.target ).appendChild( options._container );
},
/**
* @member footnote
options._container.style.display = "none";
},
_teardown: function( options ) {
- document.getElementById( options.target ).removeChild( options._container );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( options._container );
}
});
newdiv.style.width = "100%";
newdiv.style.height = "100%";
i++;
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).appendChild( newdiv );
- }
+
+ document.getElementById( options.target ) && document.getElementById( options.target ).appendChild( newdiv );
var initialize = function() {
//ensure that the script has been loaded
}, 5);
} else {
// Create the feed control using the user entered url and title
- var tmp = new GFdynamicFeedControl( options.url, newdiv, {
+ options.feed = 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"
newdiv.setAttribute( "style", "display:none" );
},
_teardown: function( options ) {
- document.getElementById( options.target ).removeChild( newdiv );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( newdiv );
+ delete options.feed;
}
};
},
plus();
popped.pause().removeTrackEvent( setupId );
- ok( !document.getElementById('feed1').children[0], "removed footnote was properly destroyed" );
+ ok( !document.getElementById('feed1').children[0], "removed feed was properly destroyed" );
plus();
});
},
_teardown: function( options ) {
// the map must be manually removed
- document.getElementById( options.target ).removeChild( newdiv );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( newdiv );
newdiv = map = location = null;
}
};
_teardown: function( options ) {
// google news does not like this, throws an error "a is null"
// doesn't hurt popcorn, and only happens once
- document.getElementById( options.target ).removeChild( options.container );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( options.container );
options.newsShow = null;
}
});
var img = document.createElement( 'img' );
img.addEventListener( "load", function() {
- img.style.borderStyle = "none"; // borders look really bad, if someone wants it they can put it on their div target
+
+ // borders look really bad, if someone wants it they can put it on their div target
+ img.style.borderStyle = "none";
if ( options.href ) {
options.link.href = options.href;
}
options.link.target = "_blank";
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).appendChild( options.link ); // add the widget's div to the target div
- }
+
+ // add the widget's div to the target div
+ document.getElementById( options.target ) && document.getElementById( options.target ).appendChild( options.link );
var fontHeight = ( img.height / 12 ) + "px";
options.link.style.display = "none";
},
_teardown: function( options ) {
- document.getElementById( options.target ).removeChild( options.link );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( options.link );
}
});
options._container.innerHTML = "";
options.artist = options.artist.toLowerCase();
-
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).appendChild( options._container );
- }
+
+ document.getElementById( options.target ) && document.getElementById( options.target ).appendChild( options._container );
if(!_artists[options.artist]) {
_teardown: function( options ) {
// cleaning possible reference to _artist array;
--_artists[ options.artist ].count || delete _artists[ options.artist ];
- document.getElementById( options.target ).removeChild( options._container );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( options._container );
}
};
})());
document.getElementById( options.target ).innerHTML = '';
},
_teardown: function( options ) {
- getData, data, getTemplate, template = null;
+ getData = data = getTemplate = template = null;
}
};
},
newdiv.style.width = "100%";
newdiv.style.height = "100%";
i++;
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).appendChild( newdiv );
- }
+
+ document.getElementById( options.target ) && document.getElementById( options.target ).appendChild( newdiv );
+
// callback function fires when the script is run
var isGeoReady = function() {
if ( !_mapLoaded ) {
},
_teardown: function( options ) {
- document.getElementById( options.target ).removeChild( newdiv );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( newdiv );
newdiv = map = centerlonlat = projection = displayProjection = pointLayer = selectControl = popup = null;
}
};
options._p.contains[ options.person ] = ( options.image ) ? "<img src='" + options.image + "'/> " : "" ;
options._p.contains[ options.person ] += ( options.href ) ? "<a href='" + options.href + "' target='_blank'> " + options.person + "</a>" : options.person ;
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).innerHTML = options._p.toString();
- }
+ document.getElementById( options.target ).innerHTML = options._p.toString();
},
/**
* @member tagthisperson
*/
end: function( event, options ){
delete options._p.contains[ options.person ];
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).innerHTML = options._p.toString();
- }
+
+ document.getElementById( options.target ).innerHTML = options._p.toString();
}
};
})());
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
options.container.style.display = "none"; // display none by default
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).appendChild( options.container ); // add the widget's div to the target div
- }
+
+ // add the widget's div to the target div
+ document.getElementById( options.target ) && document.getElementById( options.target ).appendChild( options.container );
+
// setup info for the widget
var src = options.src || "",
width = options.width || 250,
},
_teardown: function( options ) {
- document.getElementById( options.target ).removeChild( options.container );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( options.container );
}
});
options._iframe.id = options.id;
options._iframe.src = options.src;
options._iframe.style.display = 'none';
+
// add the hidden iframe to the DOM
- if ( document.getElementById( options.target ) ) {
- document.getElementById( options.target ).appendChild(options._iframe);
- }
+ document.getElementById( options.target ) && document.getElementById( options.target ).appendChild(options._iframe);
},
/**
},
_teardown: function( options ) {
- document.getElementById( options.target ).removeChild( options._iframe );
+ document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( options._iframe );
}
});
})( Popcorn );