From: Anna Sobiepanek Date: Tue, 5 Oct 2010 01:36:34 +0000 (-0400) Subject: added Bogomil's wiki language fix [#101 state:peer-review-requested] X-Git-Tag: v0.1~29 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ffacb694691c8958b4863b7f6d42559ffb7c6284;p=popcorn-js.git added Bogomil's wiki language fix [#101 state:peer-review-requested] --- diff --git a/demos/semantic_video/xml/webMadeMovies.xml b/demos/semantic_video/xml/webMadeMovies.xml index 3ff05ac..934c1ea 100644 --- a/demos/semantic_video/xml/webMadeMovies.xml +++ b/demos/semantic_video/xml/webMadeMovies.xml @@ -91,7 +91,7 @@ Steve Song - + diff --git a/popcorn.js b/popcorn.js index d66e033..ea3142f 100644 --- a/popcorn.js +++ b/popcorn.js @@ -736,8 +736,11 @@ Popcorn.WikiCommand = function(name, params, text, videoManager) { Popcorn.VideoCommand.call(this, name, params, text, videoManager); - + //L10n var src = this.params.src; + var lang = this.params.lang; + if (lang === undefined) {lang="en";} + //end L10n var length = this.params.numberOfWords; // Setup a default, hidden div to hold the images var target = document.createElement('div'); @@ -746,7 +749,7 @@ // Div is hidden by default target.setAttribute('style', 'display:none'); // This uses jquery - $.getJSON("http://en.wikipedia.org/w/api.php?action=parse&props=text&page=" + ( this.params.title || src.slice(src.lastIndexOf("/")+1) ) + "&format=json&callback=?", function(data){ + $.getJSON("http://"+lang+".wikipedia.org/w/api.php?action=parse&props=text&page=" + ( this.params.title || src.slice(src.lastIndexOf("/")+1) ) + "&format=json&callback=?", function(data){ if(data) { //make a link to the document var link = document.createElement('a'); @@ -764,7 +767,7 @@ target.appendChild(desc); } }); - + this.target = target; this.onIn = function() { this.target.setAttribute('style', 'display:inline'); @@ -772,7 +775,7 @@ this.onOut = function() { this.target.setAttribute('style', 'display:none'); }; - }; + }; //////////////////////////////////////////////////////////////////////////// // Footnote Command ////////////////////////////////////////////////////////////////////////////