From ffacb694691c8958b4863b7f6d42559ffb7c6284 Mon Sep 17 00:00:00 2001 From: Anna Sobiepanek Date: Mon, 4 Oct 2010 21:36:34 -0400 Subject: [PATCH] added Bogomil's wiki language fix [#101 state:peer-review-requested] --- demos/semantic_video/xml/webMadeMovies.xml | 2 +- popcorn.js | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/demos/semantic_video/xml/webMadeMovies.xml b/demos/semantic_video/xml/webMadeMovies.xml index 3ff05acb7..934c1ea7c 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 d66e03395..ea3142f56 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 ////////////////////////////////////////////////////////////////////////////