From: Anna Sobiepanek Date: Thu, 1 Jul 2010 22:57:58 +0000 (-0400) Subject: Merge branch 'translate' of github.com:annasob/popcorn-js into 0.1 X-Git-Tag: v0.1~49 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0846de00fbbd9eb841bc9661eb1cb2ca0ddc2b17;p=popcorn-js.git Merge branch 'translate' of github.com:annasob/popcorn-js into 0.1 Conflicts: xml/webMadeMovies.xml --- 0846de00fbbd9eb841bc9661eb1cb2ca0ddc2b17 diff --cc popcorn.js index db508c8,a65b698..6c122d5 --- a/popcorn.js +++ b/popcorn.js @@@ -194,46 -192,10 +199,48 @@@ this.onOut = function() { SubtitleCommand.subDiv.innerHTML = ""; }; + + }; + //////////////////////////////////////////////////////////////////////////// + // Lower third text Command + //////////////////////////////////////////////////////////////////////////// + + var LowerThirdCommand = function(name, params, text, videoManager) { + VideoCommand.call(this, name, params, text, videoManager); + + // Creates a div for all subtitles to use + if (!LowerThirdCommand.ltDiv) { + LowerThirdCommand.ltDiv = document.createElement('div'); + LowerThirdCommand.ltDiv.setAttribute('style', + 'padding-left:40px;padding-right:40px;padding-top:40px;position:absolute;top:150px;left:1px;color:white;font-weight:bold;font-family:sans-serif;text-shadow:black 1px 1px 3px;font-size:22px;width:450px;'); + document.getElementById("videoContainer").appendChild(LowerThirdCommand.ltDiv); + } + this.onIn = function() { + $(LowerThirdCommand.ltDiv).css("text-align", (this.params.align || 'left')); + var i = document.getElementById("language").selectedIndex; + google.language.translate((this.params.salutation || ""), '', document.getElementById("language").options[i].getAttribute("val"), function(result) { + var span = document.createElement('span'); + span.innerHTML = result.translation + " "; + span.setAttribute('style', 'font-size:26px;'); + LowerThirdCommand.ltDiv.appendChild(span); + }); + google.language.translate((this.params.name || ""), '', document.getElementById("language").options[i].getAttribute("val"), function(result) { + var span = document.createElement('span'); + span.innerHTML = result.translation; + span.setAttribute('style', 'font-size:26px;'); + LowerThirdCommand.ltDiv.appendChild(span); + }); + google.language.translate((this.params.role || ""), '', document.getElementById("language").options[i].getAttribute("val"), function(result) { + LowerThirdCommand.ltDiv.innerHTML += "
" + result.translation; + }); + }; + this.onOut = function() { + LowerThirdCommand.ltDiv.innerHTML = ""; + }; + }; + //////////////////////////////////////////////////////////////////////////// // GoogleNews Command //////////////////////////////////////////////////////////////////////////// diff --cc xml/webMadeMovies.xml index 4e94bf4,9ba9128..0209265 --- a/xml/webMadeMovies.xml +++ b/xml/webMadeMovies.xml @@@ -31,100 -28,93 +31,110 @@@ - + + - - - + + + + - - + + This video made exclusively for drumbeat.org + + + + Steve Song + + + + + + + Keyboard Cat + + KeyBoard Cat, Charlie Schmidt + + Geoffrey Warren + Grassroots Mapping, Tungsten Monkey + Village Telco Guy + + Geoffrey Warren + + + Village Telco Guy + + Charlie Schmidt + + Keyboard Cat + Charlie Schmidt + + Jonathan Zittrain + + + NCSA guy + Computer Chronicles guy #1 + Computer Chronicles guy #2 + Computer Chronicles guy #3 + + Jonathan Zittrain + + + Mona Kasra + Noah Workman + + Brazillian dude + + Keechang Kim + + Celine Celines + + + + + + + + + - - - This video made exclusively for drumbeat.org - - - - - - - - A Shared Culture, Jesse Dylan - - - - - - Steve Song - Keyboard Cat - Geoffrey Warren - Village Telco Guy - Geoffrey Warren - Steve Song - Village Telco Guy - Charlie Schmidt - Keyboard Cat - Charlie Schmidt - Jonathan Zittrain - NCSA guy - Computer Chronicles guy #1 - Computer Chronicles guy #2 - Computer Chronicles guy #3 - Jonathan Zittrain - Mona Kasra - Noah Workman - Brazillian dude - Keechang Kim - Celine Celines - - - - - - - - + +