From 4720baa45d75f1ed6addd033d11328decf0c4840 Mon Sep 17 00:00:00 2001 From: Anna Sobiepanek Date: Sun, 20 Jun 2010 19:24:05 -0400 Subject: [PATCH] merged scotts geo branch --- video.js | 71 -------------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 video.js diff --git a/video.js b/video.js deleted file mode 100644 index d29696e..0000000 --- a/video.js +++ /dev/null @@ -1,71 +0,0 @@ -$(function() { - $("video").each(function() { - if (lang=window.location.search.substring(1)) { - var ret=true; - $("select option").each(function() { - if ($(this).attr("val") == lang) { $(this).attr("selected",true); ret=false; } - }); - if (!ret) { - $("subtitle").each(function() { - var sub = $(this); - google.language.translate($(this).html(),"en",lang, function(r) { - sub.html(r.translation); - }); - }); - } - } - - $("#language").change(function() { window.location="?" + $("#language option:selected").attr("val"); }); - }); -}); - -var lt = 0; -function update(vid) { - var has_sub=false, - t = vid.currentTime; - if (lt>t) $("#sub span").fadeTo(1,.3); - $("subtitle").each(function() { - var from = to_secs($(this).attr("from")), - to = to_secs($(this).attr("to")); - $(this).removeClass("good"); - if (fromt) { - has_sub=true; - $(this).addClass("good"); - } - }); - if (!has_sub) { - if (!$("#sub").hasClass("fading")) - $("#sub").addClass("fading").stop().animate({ opacity:0, top:"-=30px" }, "medium", "swing"); - } else { - if ($("#sub").hasClass("fading")) - $("#sub").removeClass("fading").stop().animate({opacity:1,top:"410px"},1).html(''); - } - $("subtitle.good:last").each(function() { - if (!$(this).hasClass("on")) { - $("subtitle.on").removeClass("on"); - $(this).addClass("on"); - $("#sub").html('').hide(); - var letters = $(this).text().split(''); - $.each(letters,function(i, val) { - $("#sub").append('' + val + ''); - }); - $("#sub span").stop().fadeTo(1,.3, function() { $(this).show(); }); - } - var from = to_secs($(this).attr("from")), - to = to_secs($(this).attr("to")), - perc = ((t-from)/(to-from)), - num_letters = $(this).text().length*perc, - i = 0; - $("#sub span").each(function() { - if (i++>num_letters) return; - $(this).stop().fadeTo("fast",1); - }).parent().show(); - }); - lt = t; -} - -function to_secs(time) { - var t = time.split(":"); - return parseInt(t[0]*60,10) + parseInt(t[1],10); -} - -- 2.43.0