diff --git a/source/js/Media/VMM.MediaElement.js b/source/js/Media/VMM.MediaElement.js index e49b7e9..936ad30 100644 --- a/source/js/Media/VMM.MediaElement.js +++ b/source/js/Media/VMM.MediaElement.js @@ -8,19 +8,22 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { return this; }, - thumbnail: function(data, w, h) { - _w = 16; - _h = 24; + 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 != "") { - _valid = true; - var mediaElem = ""; - var m = VMM.MediaType(data.media); //returns an object with .type and .id + var _valid = true, + mediaElem = "", + m = VMM.MediaType(data.media); //returns an object with .type and .id + // CREATE MEDIA CODE if (m.type == "image") { - //mediaElem = "
"; mediaElem = "
"; return mediaElem; } else if (m.type == "flickr") { @@ -53,6 +56,9 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { } 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; @@ -64,14 +70,13 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { return mediaElem; } else if (m.type == "unknown") { if (m.id.match("blockquote")) { - mediaElem = "
"; + mediaElem = "
"; } else { - mediaElem = "
"; + mediaElem = "
"; } return mediaElem; } else if (m.type == "website") { mediaElem = "
"; - //mediaElem = "
"; return mediaElem; } else { mediaElem = "
"; @@ -81,13 +86,14 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { }, create: function(data, secondary) { - //$mediacontainer = element; - var _valid = false; + var _valid = false, + loading_messege = "

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

"; if (data.media != null && data.media != "") { - var mediaElem = "", captionElem = "", creditElem = "", _id = "", isTextMedia = false; - var m = VMM.MediaType(data.media); //returns an object with .type and .id - _valid = true; + 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 != "") { @@ -112,11 +118,11 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { // GOOGLE DOCS } else if (m.type == "googledoc") { _id = "googledoc_" + VMM.Util.unique_ID(5); - mediaElem = "

Loading Document

"; + mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.googledocs.get(m.id, _id); // YOUTUBE } else if (m.type == "youtube") { - mediaElem = "

Loading YouTube video

"; + mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.youtube.get(m.id); // VIMEO } else if (m.type == "vimeo") { @@ -127,7 +133,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { mediaElem = "
"; // TWITTER } else if (m.type == "twitter"){ - mediaElem = "

Loading Tweet

"; + mediaElem = "
" + loading_messege + "
"; isTextMedia = true; VMM.ExternalAPI.twitter.prettyHTML(m.id, secondary); // TWITTER @@ -137,17 +143,23 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { // SOUNDCLOUD } else if (m.type == "soundcloud") { _id = "soundcloud_" + VMM.Util.unique_ID(5); - mediaElem = "

Loading Sound

"; + mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.soundcloud.get(m.id, _id); // GOOGLE MAPS } else if (m.type == "google-map") { _id = "googlemap_" + VMM.Util.unique_ID(7); - mediaElem = "

Loading Map

"; + mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.googlemaps.get(m.id, _id); + // 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") { _id = "wikipedia_" + VMM.Util.unique_ID(7); - mediaElem = "

Loading Wikipedia

"; + mediaElem = "
" + loading_messege + "
"; isTextMedia = true; VMM.ExternalAPI.wikipedia.get(m.id, _id, m.lang); // STORIFY diff --git a/source/js/Media/VMM.MediaType.js b/source/js/Media/VMM.MediaType.js index a0de4f1..335940d 100644 --- a/source/js/Media/VMM.MediaType.js +++ b/source/js/Media/VMM.MediaType.js @@ -49,6 +49,17 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') { media.type = "google-map"; media.id = d.split(/src=['|"][^'|"]*?['|"]/gi); success = true; + } else if (d.match("plus.google")) { + media.type = "googleplus"; + media.id = d.split("/posts/")[1]; + //https://plus.google.com/u/0/112374836634096795698/posts/bRJSvCb5mUU + //https://plus.google.com/107096716333816995401/posts/J5iMpEDHWNL + if (d.split("/posts/")[0].match("u/0/")) { + media.user = d.split("u/0/")[1].split("/posts")[0]; + } else { + media.user = d.split("google.com/")[1].split("/posts/")[0]; + } + success = true; } else if (d.match("flickr.com/photos")) { media.type = "flickr"; media.id = d.split("photos\/")[1].split("/")[1];