/* External API ================================================== */ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { VMM.ExternalAPI = ({ keys: { google: "", flickr: "", twitter: "" }, keys_master: { vp: "Pellentesque nibh felis, eleifend id, commodo in, interdum vitae, leo", flickr: "RAIvxHY4hE/Elm5cieh4X5ptMyDpj7MYIxziGxi0WGCcy1s+yr7rKQ==", google: "jwNGnYw4hE9lmAez4ll0QD+jo6SKBJFknkopLS4FrSAuGfIwyj57AusuR0s8dAo=", twitter: "" }, init: function() { return this; }, setKeys: function(d) { VMM.ExternalAPI.keys = d; }, pushQues: function() { if (VMM.master_config.googlemaps.active) { VMM.ExternalAPI.googlemaps.pushQue(); } if (VMM.master_config.youtube.active) { VMM.ExternalAPI.youtube.pushQue(); } if (VMM.master_config.soundcloud.active) { VMM.ExternalAPI.soundcloud.pushQue(); } if (VMM.master_config.googledocs.active) { VMM.ExternalAPI.googledocs.pushQue(); } if (VMM.master_config.googleplus.active) { VMM.ExternalAPI.googleplus.pushQue(); } if (VMM.master_config.wikipedia.active) { VMM.ExternalAPI.wikipedia.pushQue(); } if (VMM.master_config.vimeo.active) { VMM.ExternalAPI.vimeo.pushQue(); } if (VMM.master_config.vine.active) { VMM.ExternalAPI.vine.pushQue(); } if (VMM.master_config.twitter.active) { VMM.ExternalAPI.twitter.pushQue(); } if (VMM.master_config.flickr.active) { VMM.ExternalAPI.flickr.pushQue(); } if (VMM.master_config.webthumb.active) { VMM.ExternalAPI.webthumb.pushQue(); } }, twitter: { tweetArray: [], get: function(m) { var tweet = {mid: m.id, id: m.uid}; VMM.master_config.twitter.que.push(tweet); VMM.master_config.twitter.active = true; //VMM.master_config.api.pushques.push(VMM.ExternalAPI.twitter.pushQue); }, create: function(tweet, callback) { var id = tweet.mid.toString(), error_obj = { twitterid: tweet.mid }, the_url = "//api.twitter.com/1/statuses/show.json?id=" + tweet.mid + "&include_entities=true&callback=?"; //twitter_timeout = setTimeout(VMM.ExternalAPI.twitter.errorTimeOut, VMM.master_config.timers.api, tweet), //callback_timeout= setTimeout(callback, VMM.master_config.timers.api, tweet); VMM.ExternalAPI.twitter.getOEmbed(tweet, callback); /* // Disabled thanks to twitter's new api VMM.getJSON(the_url, function(d) { var id = d.id_str, twit = "
"; // TWEET MEDIA if (typeof d.entities.media != 'undefined') { if (d.entities.media[0].type == "photo") { //twit += "" } } // TWEET AUTHOR twit += " "; VMM.attachElement("#"+tweet.id.toString(), twit ); VMM.attachElement("#text_thumb_"+tweet.id.toString(), d.text ); VMM.attachElement("#marker_content_" + tweet.id.toString(), d.text ); }) .error(function(jqXHR, textStatus, errorThrown) { trace("TWITTER error"); trace("TWITTER ERROR: " + textStatus + " " + jqXHR.responseText); VMM.attachElement("#"+tweet.id, VMM.MediaElement.loadingmessage("ERROR LOADING TWEET " + tweet.mid) ); }) .success(function(d) { clearTimeout(twitter_timeout); clearTimeout(callback_timeout); callback(); }); */ }, errorTimeOut: function(tweet) { trace("TWITTER JSON ERROR TIMEOUT " + tweet.mid); VMM.attachElement("#"+tweet.id.toString(), VMM.MediaElement.loadingmessage("Still waiting on Twitter: " + tweet.mid) ); // CHECK RATE STATUS VMM.getJSON("//api.twitter.com/1/account/rate_limit_status.json", function(d) { trace("REMAINING TWITTER API CALLS " + d.remaining_hits); trace("TWITTER RATE LIMIT WILL RESET AT " + d.reset_time); var mes = ""; if (d.remaining_hits == 0) { mes = "", td = VMM.Util.linkify_with_twitter(d.text, "_blank"); // TWEET CONTENT twit += td; twit += "
You've reached the maximum number of tweets you can load in an hour.
"; mes += "You can view tweets again starting at:
" + d.reset_time + "
Still waiting on Twitter. " + tweet.mid + "
"; //mes = "Tweet " + id + " was not found.
"; } VMM.attachElement("#"+tweet.id.toString(), VMM.MediaElement.loadingmessage(mes) ); }); }, errorTimeOutOembed: function(tweet) { trace("TWITTER JSON ERROR TIMEOUT " + tweet.mid); VMM.attachElement("#"+tweet.id.toString(), VMM.MediaElement.loadingmessage("Still waiting on Twitter: " + tweet.mid) ); }, pushQue: function() { if (VMM.master_config.twitter.que.length > 0) { VMM.ExternalAPI.twitter.create(VMM.master_config.twitter.que[0], VMM.ExternalAPI.twitter.pushQue); VMM.Util.removeRange(VMM.master_config.twitter.que,0); } }, getOEmbed: function(tweet, callback) { var the_url = "https://api.twitter.com/1/statuses/oembed.json?id=" + tweet.mid + "&omit_script=true&include_entities=true&callback=?", twitter_timeout = setTimeout(VMM.ExternalAPI.twitter.errorTimeOutOembed, VMM.master_config.timers.api, tweet); //callback_timeout= setTimeout(callback, VMM.master_config.timers.api, tweet); VMM.getJSON(the_url, function(d) { var twit = "", tuser = ""; // TWEET CONTENT twit += d.html.split("<\/p>\—")[0] + ""; tuser = d.author_url.split("twitter.com\/")[1]; // TWEET AUTHOR twit += " "; VMM.attachElement("#"+tweet.id.toString(), twit ); VMM.attachElement("#text_thumb_"+tweet.id.toString(), d.html ); VMM.attachElement("#marker_content_" + tweet.id.toString(), d.html ); }) .error(function(jqXHR, textStatus, errorThrown) { trace("TWITTER error"); trace("TWITTER ERROR: " + textStatus + " " + jqXHR.responseText); clearTimeout(twitter_timeout); //clearTimeout(callback_timeout); VMM.attachElement("#"+tweet.id, VMM.MediaElement.loadingmessage("ERROR LOADING TWEET " + tweet.mid) ); }) .success(function(d) { clearTimeout(twitter_timeout); // clearTimeout(callback_timeout); callback(); }); }, getHTML: function(id) { //var the_url = document.location.protocol + "//api.twitter.com/1/statuses/oembed.json?id=" + id+ "&callback=?"; var the_url = "https://api.twitter.com/1/statuses/oembed.json?id=" + id+ "&omit_script=true&include_entities=true&callback=?"; VMM.getJSON(the_url, VMM.ExternalAPI.twitter.onJSONLoaded); }, onJSONLoaded: function(d) { trace("TWITTER JSON LOADED"); var id = d.id; VMM.attachElement("#"+id, VMM.Util.linkify_with_twitter(d.html) ); }, parseTwitterDate: function(d) { var date = new Date(Date.parse(d)); /* var t = d.replace(/(\d{1,2}[:]\d{2}[:]\d{2}) (.*)/, '$2 $1'); t = t.replace(/(\+\S+) (.*)/, '$2 $1'); var date = new Date(Date.parse(t)).toLocaleDateString(); var time = new Date(Date.parse(t)).toLocaleTimeString(); */ return date; }, prettyParseTwitterDate: function(d) { var date = new Date(Date.parse(d)); return VMM.Date.prettyDate(date, true); }, getTweets: function(tweets) { var tweetArray = []; var number_of_tweets = tweets.length; for(var i = 0; i < tweets.length; i++) { var twitter_id = ""; /* FIND THE TWITTER ID ================================================== */ if (tweets[i].tweet.match("status\/")) { twitter_id = tweets[i].tweet.split("status\/")[1]; } else if (tweets[i].tweet.match("statuses\/")) { twitter_id = tweets[i].tweet.split("statuses\/")[1]; } else { twitter_id = ""; } /* FETCH THE DATA ================================================== */ var the_url = "//api.twitter.com/1/statuses/show.json?id=" + twitter_id + "&include_entities=true&callback=?"; VMM.getJSON(the_url, function(d) { var tweet = {} /* FORMAT RESPONSE ================================================== */ var twit = ""; var td = VMM.Util.linkify_with_twitter(d.text, "_blank"); twit += td; twit += "
"; twit += "— " + d.user.name + " (@" + d.user.screen_name + ") " + VMM.ExternalAPI.twitter.prettyParseTwitterDate(d.created_at) + "
"; var td = VMM.Util.linkify_with_twitter(d.results[i].text, "_blank"); twit += td; twit += "
"; twit += "— " + d.results[i].from_user_name + " (@" + d.results[i].from_user + ") " + VMM.ExternalAPI.twitter.prettyParseTwitterDate(d.results[i].created_at) + "
ERROR LOADING TWEET " + id + "
" ); }) .success(function(d) { clearTimeout(twitter_timeout); if (secondary) { VMM.ExternalAPI.twitter.secondaryMedia(d); } }); }, formatJSON: function(d) { var id = d.id_str; var twit = ""; //twit += " " + "" + " "; twit += " "; if (typeof d.entities.media != 'undefined') { if (d.entities.media[0].type == "photo") { twit += "" } } VMM.attachElement("#twitter_"+id.toString(), twit ); VMM.attachElement("#text_thumb_"+id.toString(), d.text ); } }, googlemaps: { maptype: "TERRAIN", // see also below for default if this is a google type setMapType: function(d) { if (d != "") { VMM.ExternalAPI.googlemaps.maptype = d; } }, get: function(m) { var timer, api_key, map_url; m.vars = VMM.Util.getUrlVars(m.id); if (VMM.ExternalAPI.keys.google != "") { api_key = VMM.ExternalAPI.keys.google; } else { api_key = Aes.Ctr.decrypt(VMM.ExternalAPI.keys_master.google, VMM.ExternalAPI.keys_master.vp, 256); } /* Investigating a google map api change on the latest release that causes custom map types to stop working http://stackoverflow.com/questions/13486271/google-map-markermanager-cannot-call-method-substr-of-undefined soulution is to use api ver 3.9 */ map_url = "//maps.googleapis.com/maps/api/js?key=" + api_key + "&v=3.9&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady"; if (VMM.master_config.googlemaps.active) { VMM.master_config.googlemaps.que.push(m); } else { VMM.master_config.googlemaps.que.push(m); if (VMM.master_config.googlemaps.api_loaded) { } else { LoadLib.js(map_url, function() { trace("Google Maps API Library Loaded"); }); } } }, create: function(m) { VMM.ExternalAPI.googlemaps.createAPIMap(m); }, createiFrameMap: function(m) { var embed_url = m.id + "&output=embed", mc = "", unique_map_id = m.uid.toString() + "_gmap"; mc += ""; var td = VMM.Util.linkify_with_twitter(d.text, "_blank"); //td = td.replace(/(@([\w]+))/g,"$1"); //td = td.replace(/(#([\w]+))/g,"$1"); twit += td; twit += "
" + a_data.object.attachments[k].content + "
"; g_attachments += ""; g_attachments += "" + a_data.object.attachments[k].content + "
"; g_attachments += ""; g_attachments += "ERROR LOADING GOOGLE+
" + error_obj.error.message + "
")); }) .success(function(d) { clearTimeout(googleplus_timeout); clearTimeout(callback_timeout); callback(); }); }, pushQue: function() { if (VMM.master_config.googleplus.que.length > 0) { VMM.ExternalAPI.googleplus.create(VMM.master_config.googleplus.que[0], VMM.ExternalAPI.googleplus.pushQue); VMM.Util.removeRange(VMM.master_config.googleplus.que,0); } /* for(var i = 0; i < VMM.master_config.googleplus.que.length; i++) { VMM.ExternalAPI.googleplus.create(VMM.master_config.googleplus.que[i]); } VMM.master_config.googleplus.que = []; */ }, errorTimeOut: function(gplus) { trace("GOOGLE+ JSON ERROR TIMEOUT " + gplus.activity); VMM.attachElement("#googleplus_" + gplus.activity, VMM.MediaElement.loadingmessage("Still waiting on GOOGLE+
" + gplus.activity + "
")); } }, googledocs: { get: function(m) { VMM.master_config.googledocs.que.push(m); VMM.master_config.googledocs.active = true; }, create: function(m) { var mediaElem = ""; if (m.id.match(/docs.google.com/i)) { mediaElem = ""; } else { mediaElem = ""; } VMM.attachElement("#"+m.uid, mediaElem); }, pushQue: function() { for(var i = 0; i < VMM.master_config.googledocs.que.length; i++) { VMM.ExternalAPI.googledocs.create(VMM.master_config.googledocs.que[i]); } VMM.master_config.googledocs.que = []; } }, flickr: { get: function(m) { VMM.master_config.flickr.que.push(m); VMM.master_config.flickr.active = true; }, create: function(m, callback) { var api_key, callback_timeout= setTimeout(callback, VMM.master_config.timers.api, m); if (typeof VMM.master_config.Timeline != 'undefined' && VMM.master_config.Timeline.api_keys.flickr != "") { api_key = VMM.master_config.Timeline.api_keys.flickr; } else { api_key = Aes.Ctr.decrypt(VMM.master_config.api_keys_master.flickr, VMM.master_config.vp, 256) } var the_url = "https://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=" + api_key + "&photo_id=" + m.id + "&format=json&jsoncallback=?"; VMM.getJSON(the_url, function(d) { var flickr_id = VMM.ExternalAPI.flickr.getFlickrIdFromUrl(d.sizes.size[0].url); var flickr_large_id = "#" + m.uid, flickr_thumb_id = "#" + m.uid + "_thumb"; //flickr_thumb_id = "flickr_" + uid + "_thumb"; var flickr_img_size, flickr_img_thumb, flickr_size_found = false, flickr_best_size = "Large"; flickr_best_size = VMM.ExternalAPI.flickr.sizes(VMM.master_config.sizes.api.height); for(var i = 0; i < d.sizes.size.length; i++) { if (d.sizes.size[i].label == flickr_best_size) { flickr_size_found = true; flickr_img_size = d.sizes.size[i].source; } } if (!flickr_size_found) { flickr_img_size = d.sizes.size[d.sizes.size.length - 2].source; } flickr_img_thumb = d.sizes.size[0].source; VMM.Lib.attr(flickr_large_id, "src", flickr_img_size); //VMM.attachElement(flickr_large_id, ""); VMM.attachElement(flickr_thumb_id, ""); }) .error(function(jqXHR, textStatus, errorThrown) { trace("FLICKR error"); trace("FLICKR ERROR: " + textStatus + " " + jqXHR.responseText); }) .success(function(d) { clearTimeout(callback_timeout); callback(); }); }, pushQue: function() { if (VMM.master_config.flickr.que.length > 0) { VMM.ExternalAPI.flickr.create(VMM.master_config.flickr.que[0], VMM.ExternalAPI.flickr.pushQue); VMM.Util.removeRange(VMM.master_config.flickr.que,0); } }, sizes: function(s) { var _size = ""; if (s <= 75) { _size = "Thumbnail"; } else if (s <= 180) { _size = "Small"; } else if (s <= 240) { _size = "Small 320"; } else if (s <= 375) { _size = "Medium"; } else if (s <= 480) { _size = "Medium 640"; } else if (s <= 600) { _size = "Large"; } else { _size = "Large"; } return _size; }, getFlickrIdFromUrl: function(url) { var idx = url.indexOf("flickr.com/photos/"); if (idx == -1) return null; var pos = idx + "flickr.com/photos/".length; var photo_info = url.substr(pos) if (photo_info.indexOf('/') == -1) return null; if (photo_info.indexOf('/') == 0) photo_info = photo_info.substr(1); return photo_info.split("/")[1]; } }, instagram: { get: function(m, thumb) { if (thumb) { return "//instagr.am/p/" + m.id + "/media/?size=t"; } else { return "//instagr.am/p/" + m.id + "/media/?size=" + VMM.ExternalAPI.instagram.sizes(VMM.master_config.sizes.api.height); } }, sizes: function(s) { var _size = ""; if (s <= 150) { _size = "t"; } else if (s <= 306) { _size = "m"; } else { _size = "l"; } return _size; }, isInstagramUrl: function(url) { return url.match("instagr.am/p/") || url.match("instagram.com/p/"); }, getInstagramIdFromUrl: function(url) { try { return url.split("\/p\/")[1].split("/")[0]; } catch(e) { trace("Invalid Instagram url: " + url); return null; } } }, soundcloud: { get: function(m) { VMM.master_config.soundcloud.que.push(m); VMM.master_config.soundcloud.active = true; }, create: function(m, callback) { var the_url = "//soundcloud.com/oembed?url=" + m.id + "&maxheight=168&format=js&callback=?"; VMM.getJSON(the_url, function(d) { VMM.attachElement("#"+m.uid, d.html); callback(); }); }, pushQue: function() { if (VMM.master_config.soundcloud.que.length > 0) { VMM.ExternalAPI.soundcloud.create(VMM.master_config.soundcloud.que[0], VMM.ExternalAPI.soundcloud.pushQue); VMM.Util.removeRange(VMM.master_config.soundcloud.que,0); } } }, wikipedia: { get: function(m) { VMM.master_config.wikipedia.que.push(m); VMM.master_config.wikipedia.active = true; }, create: function(m, callback) { var the_url = "//" + m.lang + ".wikipedia.org/w/api.php?action=query&prop=extracts&redirects=&titles=" + m.id + "&exintro=1&format=json&callback=?"; callback_timeout= setTimeout(callback, VMM.master_config.timers.api, m); if ( VMM.Browser.browser == "Explorer" && parseInt(VMM.Browser.version, 10) >= 7 && window.XDomainRequest) { var temp_text = "Wikipedia entry unable to load using Internet Explorer 8 or below.
"; VMM.attachElement("#"+m.uid, temp_text ); } VMM.getJSON(the_url, function(d) { if (d.query) { var wiki_extract, wiki_title, _wiki = "", wiki_text = "", wiki_number_of_paragraphs = 1, wiki_text_array = []; wiki_extract = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).extract; wiki_title = VMM.Util.getObjectAttributeByIndex(d.query.pages, 0).title; if (wiki_extract.match("")) { wiki_text_array = wiki_extract.split("
"); } else { wiki_text_array.push(wiki_extract); } for(var i = 0; i < wiki_text_array.length; i++) { if (i+1 <= wiki_number_of_paragraphs && i+1 < wiki_text_array.length) { wiki_text += "
" + wiki_text_array[i+1]; } } _wiki = "
Wikipedia is not responding
")); // TRY AGAIN? clearTimeout(callback_timeout); if (VMM.master_config.wikipedia.tries < 4) { trace("WIKIPEDIA ATTEMPT " + VMM.master_config.wikipedia.tries); trace(m); VMM.master_config.wikipedia.tries++; VMM.ExternalAPI.wikipedia.create(m, callback); } else { callback(); } }) .success(function(d) { VMM.master_config.wikipedia.tries = 0; clearTimeout(callback_timeout); callback(); }); }, pushQue: function() { if (VMM.master_config.wikipedia.que.length > 0) { trace("WIKIPEDIA PUSH QUE " + VMM.master_config.wikipedia.que.length); VMM.ExternalAPI.wikipedia.create(VMM.master_config.wikipedia.que[0], VMM.ExternalAPI.wikipedia.pushQue); VMM.Util.removeRange(VMM.master_config.wikipedia.que,0); } } }, youtube: { get: function(m) { var the_url = "//gdata.youtube.com/feeds/api/videos/" + m.id + "?v=2&alt=jsonc&callback=?"; VMM.master_config.youtube.que.push(m); if (!VMM.master_config.youtube.active) { if (!VMM.master_config.youtube.api_loaded) { LoadLib.js('//www.youtube.com/player_api', function() { trace("YouTube API Library Loaded"); }); } } // THUMBNAIL VMM.getJSON(the_url, function(d) { VMM.ExternalAPI.youtube.createThumb(d, m) }); }, create: function(m) { if (typeof(m.start) != 'undefined') { var vidstart = m.start.toString(), vid_start_minutes = 0, vid_start_seconds = 0; if (vidstart.match('m')) { vid_start_minutes = parseInt(vidstart.split("m")[0], 10); vid_start_seconds = parseInt(vidstart.split("m")[1].split("s")[0], 10); m.start = (vid_start_minutes * 60) + vid_start_seconds; } else { m.start = 0; } } else { m.start = 0; } var p = { active: false, player: {}, name: m.uid, playing: false, hd: false }; if (typeof(m.hd) != 'undefined') { p.hd = true; } p.player[m.id] = new YT.Player(m.uid, { height: '390', width: '640', playerVars: { enablejsapi: 1, color: ("dark" == VMM.master_config.Timeline.youtubeTheme) ? "red" : "white", // https://developers.google.com/youtube/player_parameters#color showinfo: 0, theme: ("undefined" !== VMM.master_config.Timeline.youtubeTheme) ? VMM.master_config.Timeline.youtubeTheme : "light", // https://developers.google.com/youtube/player_parameters#theme start: m.start, rel: 0 }, videoId: m.id, events: { 'onReady': VMM.ExternalAPI.youtube.onPlayerReady, 'onStateChange': VMM.ExternalAPI.youtube.onStateChange } }); VMM.master_config.youtube.array.push(p); }, createThumb: function(d, m) { trace("CREATE THUMB"); trace(d); trace(m); if (typeof d.data != 'undefined') { var thumb_id = "#" + m.uid + "_thumb"; VMM.attachElement(thumb_id, ""); } }, pushQue: function() { for(var i = 0; i < VMM.master_config.youtube.que.length; i++) { VMM.ExternalAPI.youtube.create(VMM.master_config.youtube.que[i]); } VMM.master_config.youtube.que = []; }, onAPIReady: function() { VMM.master_config.youtube.active = true; VMM.ExternalAPI.youtube.pushQue(); }, stopPlayers: function() { for(var i = 0; i < VMM.master_config.youtube.array.length; i++) { if (VMM.master_config.youtube.array[i].playing) { if (typeof VMM.master_config.youtube.array[i].player.the_name !== 'undefined') { VMM.master_config.youtube.array[i].player.the_name.stopVideo(); } } } }, onStateChange: function(e) { for(var i = 0; i < VMM.master_config.youtube.array.length; i++) { for (var z in VMM.master_config.youtube.array[i].player) { if (VMM.master_config.youtube.array[i].player[z] == e.target) { VMM.master_config.youtube.array[i].player.the_name = VMM.master_config.youtube.array[i].player[z]; } } if (VMM.master_config.youtube.array[i].player.the_name == e.target) { if (e.data == YT.PlayerState.PLAYING) { VMM.master_config.youtube.array[i].playing = true; if (VMM.master_config.youtube.array[i].hd === false) { VMM.master_config.youtube.array[i].hd = true; VMM.master_config.youtube.array[i].player.the_name.setPlaybackQuality("hd720"); } } } } }, onPlayerReady: function(e) { } }, vimeo: { get: function(m) { VMM.master_config.vimeo.que.push(m); VMM.master_config.vimeo.active = true; }, create: function(m, callback) { trace("VIMEO CREATE"); // THUMBNAIL var thumb_url = "//vimeo.com/api/v2/video/" + m.id + ".json", video_url = "//player.vimeo.com/video/" + m.id + "?title=0&byline=0&portrait=0&color=ffffff"; VMM.getJSON(thumb_url, function(d) { VMM.ExternalAPI.vimeo.createThumb(d, m); callback(); }); // VIDEO VMM.attachElement("#" + m.uid, ""); }, createThumb: function(d, m) { trace("VIMEO CREATE THUMB"); var thumb_id = "#" + m.uid + "_thumb"; VMM.attachElement(thumb_id, ""); }, pushQue: function() { if (VMM.master_config.vimeo.que.length > 0) { VMM.ExternalAPI.vimeo.create(VMM.master_config.vimeo.que[0], VMM.ExternalAPI.vimeo.pushQue); VMM.Util.removeRange(VMM.master_config.vimeo.que,0); } } }, vine: { get: function(m) { VMM.master_config.vine.que.push(m); VMM.master_config.vine.active = true; }, create: function(m, callback) { trace("VINE CREATE"); var video_url = "https://vine.co/v/" + m.id + "/embed/simple"; // VIDEO // TODO: NEED TO ADD ASYNC SCRIPT TO TIMELINE FLOW VMM.attachElement("#" + m.uid, ""); }, pushQue: function() { if (VMM.master_config.vine.que.length > 0) { VMM.ExternalAPI.vine.create(VMM.master_config.vine.que[0], VMM.ExternalAPI.vine.pushQue); VMM.Util.removeRange(VMM.master_config.vine.que,0); } } }, webthumb: { get: function(m, thumb) { VMM.master_config.webthumb.que.push(m); VMM.master_config.webthumb.active = true; }, sizes: function(s) { var _size = ""; if (s <= 150) { _size = "t"; } else if (s <= 306) { _size = "m"; } else { _size = "l"; } return _size; }, create: function(m) { trace("WEB THUMB CREATE"); var thumb_url = "//api.pagepeeker.com/v2/thumbs.php?"; url = m.id.replace("http://", "");//.split("/")[0]; // Main Image VMM.attachElement("#" + m.uid, ""); // Thumb VMM.attachElement("#" + m.uid + "_thumb", ""); }, pushQue: function() { for(var i = 0; i < VMM.master_config.webthumb.que.length; i++) { VMM.ExternalAPI.webthumb.create(VMM.master_config.webthumb.que[i]); } VMM.master_config.webthumb.que = []; } } }).init(); } /* YOUTUBE API READY Can't find a way to customize this callback and keep it in the VMM namespace Youtube wants it to be this function. ================================================== */ function onYouTubePlayerAPIReady() { trace("GLOBAL YOUTUBE API CALLED") VMM.ExternalAPI.youtube.onAPIReady(); }