/* MediaElement ================================================== */ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { VMM.MediaElement = ({ init: function() { return this; }, thumbnail: function(data, w, h, uid) { var _w = 16, _h = 24, _uid = ""; if (w != null && w != "") {_w = w}; if (h != null && h != "") {_h = h}; if (uid != null && uid != "") {_uid = uid}; if (data.media != null && data.media != "") { var _valid = true, mediaElem = "", m = VMM.MediaType(data.media); //returns an object with .type and .id // CREATE MEDIA CODE if (m.type == "image") { mediaElem = "
"; return mediaElem; } else if (m.type == "flickr") { mediaElem = "
"; return mediaElem; } else if (m.type == "instagram") { mediaElem = "
"; return mediaElem; } else if (m.type == "youtube") { mediaElem = "
"; return mediaElem; } else if (m.type == "googledoc") { mediaElem = "
"; return mediaElem; } else if (m.type == "vimeo") { mediaElem = "
"; return mediaElem; } else if (m.type == "dailymotion") { mediaElem = "
"; return mediaElem; } else if (m.type == "twitter"){ mediaElem = "
"; return mediaElem; } else if (m.type == "twitter-ready") { mediaElem = "
"; return mediaElem; } else if (m.type == "soundcloud") { mediaElem = "
"; return mediaElem; } else if (m.type == "google-map") { mediaElem = "
"; return mediaElem; } else if (m.type == "googleplus") { mediaElem = "
"; return mediaElem; } else if (m.type == "wikipedia") { mediaElem = "
"; return mediaElem; } else if (m.type == "storify") { mediaElem = "
"; return mediaElem; } else if (m.type == "quote") { mediaElem = "
"; return mediaElem; } else if (m.type == "unknown") { if (m.id.match("blockquote")) { mediaElem = "
"; } else { mediaElem = "
"; } return mediaElem; } else if (m.type == "website") { mediaElem = "
"; return mediaElem; } else { mediaElem = "
"; return mediaElem; } } }, create: function(data, uid) { var _valid = false, loading_messege = "

" + VMM.master_config.language.messages.loading + "

"; if (data.media != null && data.media != "") { var mediaElem = "", captionElem = "", creditElem = "", _id = "", isTextMedia = false, m; m = VMM.MediaType(data.media); //returns an object with .type and .id _valid = true; // CREDIT if (data.credit != null && data.credit != "") { creditElem = "
" + VMM.Util.linkify_with_twitter(data.credit, "_blank") + "
"; } // CAPTION if (data.caption != null && data.caption != "") { captionElem = "
" + VMM.Util.linkify_with_twitter(data.caption, "_blank") + "
"; } // IMAGE if (m.type == "image") { mediaElem = "
"; // FLICKR } else if (m.type == "flickr") { _id = "flickr_" + uid; mediaElem = "
"; VMM.ExternalAPI.flickr.get(m.id, uid); // INSTAGRAM } else if (m.type == "instagram") { mediaElem = "
"; // GOOGLE DOCS } else if (m.type == "googledoc") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.googledocs.get(m.id, uid); // YOUTUBE } else if (m.type == "youtube") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.youtube.get(m.id); // VIMEO } else if (m.type == "vimeo") { mediaElem = "
"; VMM.ExternalAPI.vimeo.get(m.id); // DAILYMOTION } else if (m.type == "dailymotion") { mediaElem = "
"; // TWITTER } else if (m.type == "twitter"){ mediaElem = "
" + loading_messege + "
"; isTextMedia = true; VMM.ExternalAPI.twitter.get(m.id, uid); // TWITTER } else if (m.type == "twitter-ready") { isTextMedia = true; mediaElem = m.id; // SOUNDCLOUD } else if (m.type == "soundcloud") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.soundcloud.get(m.id, uid); // GOOGLE MAPS } else if (m.type == "google-map") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.googlemaps.get(m.id, uid); // GOOGLE PLUS } else if (m.type == "googleplus") { _id = "googleplus_" + m.id; mediaElem = "
" + loading_messege + "
"; isTextMedia = true; VMM.ExternalAPI.googleplus.get(m.user, m.id); // WIKIPEDIA } else if (m.type == "wikipedia") { mediaElem = "
" + loading_messege + "
"; isTextMedia = true; VMM.ExternalAPI.wikipedia.get(m.id, m.uniqueid, m.lang); // STORIFY } else if (m.type == "storify") { isTextMedia = true; mediaElem = "
" + m.id + "
"; // QUOTE } else if (m.type == "quote") { isTextMedia = true; mediaElem = "
" + m.id + "
"; // UNKNOWN } else if (m.type == "unknown") { trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML"); isTextMedia = true; mediaElem = "
" + VMM.Util.properQuotes(m.id) + "
"; // WEBSITE } else if (m.type == "website") { //mediaElem = "
"; //mediaElem = "" + ""; mediaElem = "
" + "
"; // NO MATCH } else { trace("NO KNOWN MEDIA TYPE FOUND"); trace(m.type); } // WRAP THE MEDIA ELEMENT mediaElem = "
" + mediaElem + creditElem + captionElem + "
"; // RETURN if (isTextMedia) { return "
" + mediaElem + "
"; } else { return "
" + mediaElem + "
"; } }; } }).init(); }