Skip to content

Commit

Permalink
added Bogomil's wiki language fix [mozilla#101 state:peer-review-requ…
Browse files Browse the repository at this point in the history
…ested]
  • Loading branch information
annasob committed Oct 5, 2010
1 parent d001ef2 commit ffacb69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion demos/semantic_video/xml/webMadeMovies.xml
Expand Up @@ -91,7 +91,7 @@
<videotag target="inthisvideo" in="00:00:05:02" out="00:00:10:07">Steve Song</videotag>
<attribution in="00:00:05:02" out="00:00:10:07" target="container5" resourceid="villagetelcoattrib"></attribution>
<twitter in="00:00:05:02" out="00:00:10:07" title="Steve Song" source="from:stevesong" target="personaltwitter" width="238" height="120"/>
<wiki in="00:00:05:02" out="00:00:10:07" resourceid="villagetelco" numberOfWords="200" target="wikidiv"/>
<wiki in="00:00:05:02" out="00:00:10:07" resourceid="villagetelco" numberOfWords="200" lang="bg" target="wikidiv"/>
<flickr in="00:00:05:02" out="00:00:10:07" target="personalflickr" userid="78868639@N00" numberofimages="8" padding="4px"/>
<googlenews in="00:00:05:02" out="00:00:10:07" target="googlenewsdiv" topic="Village Telco"/>

Expand Down
11 changes: 7 additions & 4 deletions popcorn.js
Expand Up @@ -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');
Expand All @@ -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');
Expand All @@ -764,15 +767,15 @@
target.appendChild(desc);
}
});

this.target = target;
this.onIn = function() {
this.target.setAttribute('style', 'display:inline');
};
this.onOut = function() {
this.target.setAttribute('style', 'display:none');
};
};
};
////////////////////////////////////////////////////////////////////////////
// Footnote Command
////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit ffacb69

Please sign in to comment.