diff --git a/source/js/Media/VMM.ExternalAPI.js b/source/js/Media/VMM.ExternalAPI.js index c4efb82..b365786 100644 --- a/source/js/Media/VMM.ExternalAPI.js +++ b/source/js/Media/VMM.ExternalAPI.js @@ -194,13 +194,13 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { //td = td.replace(/(#([\w]+))/g,"$1"); twit += td; twit += "
"; - twit += " " + "" + " "; + //twit += " " + "" + " "; twit += " "; @@ -619,14 +619,15 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { wikipedia: { - get: function(url, id) { - var api_obj = {url: url, id: id}; + get: function(url, id, lang) { + var api_obj = {url: url, id: id, lang: lang}; VMM.master_config.wikipedia.que.push(api_obj); VMM.master_config.wikipedia.active = true; }, create: function(api_obj) { - var the_url = "http://" + VMM.master_config.language.api.wikipedia + ".wikipedia.org/w/api.php?action=query&prop=extracts&redirects=&titles=" + api_obj.url + "&exintro=1&format=json&callback=?"; + var the_url = "http://" + api_obj.lang + ".wikipedia.org/w/api.php?action=query&prop=extracts&redirects=&titles=" + api_obj.url + "&exintro=1&format=json&callback=?"; + if ( VMM.Browser.browser == "Explorer" && parseInt(VMM.Browser.version, 10) >= 7 && window.XDomainRequest) { var temp_text = ""); - var wiki_number_of_paragraphs = 1; + 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) { diff --git a/source/js/Media/VMM.MediaElement.js b/source/js/Media/VMM.MediaElement.js index 568f67d..e49b7e9 100644 --- a/source/js/Media/VMM.MediaElement.js +++ b/source/js/Media/VMM.MediaElement.js @@ -149,7 +149,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { _id = "wikipedia_" + VMM.Util.unique_ID(7); mediaElem = "
Loading Wikipedia