[xiph-commits] r3977 - in itext: . skins/schmucker
silvia at svn.annodex.net
silvia at svn.annodex.net
Tue Jul 21 18:45:34 PDT 2009
Author: silvia
Date: 2009-07-21 18:45:34 -0700 (Tue, 21 Jul 2009)
New Revision: 3977
Modified:
itext/
itext/skins/schmucker/tinyvid.js
Log:
Ran jslint over tinyvid.js and made it look better.
Property changes on: itext
___________________________________________________________________
Modified: bzr:revision-info
- timestamp: 2009-07-22 11:04:21.697999954 +1000
committer: Silvia Pfeiffer <silvia.pfeiffer at vquence.com>
properties:
branch-nick: silvia
+ timestamp: 2009-07-22 11:44:33.023000002 +1000
committer: Silvia Pfeiffer <silvia.pfeiffer at vquence.com>
properties:
branch-nick: silvia
Modified: bzr:file-ids
- elephant.png elephant.png-20090718094218-d45036mvytq5pecp-2
index.html index.html-20090718094218-d45036mvytq5pecp-3
javascript/subtitles.js subtitles.js-20090718094218-d45036mvytq5pecp-10
+ skins/schmucker/tinyvid.js tinyvid.js-20090718094218-d45036mvytq5pecp-53
Modified: bzr:revision-id:v4
- 1 silvia.pfeiffer at vquence.com-20090713110521-cz7evclxohf4rbs2
2 silvia.pfeiffer at vquence.com-20090714003359-apmpuor2ttarph5n
3 silvia.pfeiffer at vquence.com-20090714143931-q6j8ritt91jn5rhu
4 silvia.pfeiffer at vquence.com-20090718094222-58zgcmsg9gggbnt1
5 silvia.pfeiffer at vquence.com-20090718094708-wb83p9u6jr1xlhm6
6 silvia.pfeiffer at vquence.com-20090718095409-p6en5qufj62m8w3h
7 silvia.pfeiffer at vquence.com-20090718113424-9s8cmt1guxj6qoky
8 silvia.pfeiffer at vquence.com-20090718113445-n0q9c14w4i11pe36
9 silvia.pfeiffer at vquence.com-20090718123622-xdp52y76dvpem2ya
10 silvia.pfeiffer at vquence.com-20090718131644-69y0zml0ccbwc5er
11 silvia.pfeiffer at vquence.com-20090719002119-ekzto9pc7jqs3gw9
12 silvia.pfeiffer at vquence.com-20090719120832-srm8qemvr5jjy67w
13 silvia.pfeiffer at vquence.com-20090719130420-s7xjh35zrfj8117x
14 silvia.pfeiffer at vquence.com-20090720065454-m2g8tcjgpgw8aetr
15 silvia.pfeiffer at vquence.com-20090720131039-ivpstebztd7u3vwx
16 silvia.pfeiffer at vquence.com-20090720190949-r4ahzq2regl7opf1
17 silvia.pfeiffer at vquence.com-20090720210510-i54efp8a9sem4g6g
18 silvia.pfeiffer at vquence.com-20090721063829-4pvft92pnt7k966p
19 silvia.pfeiffer at vquence.com-20090721065410-0miir37pbb73k35r
20 silvia.pfeiffer at vquence.com-20090721065911-9ngk00aeujudpw8p
21 silvia.pfeiffer at vquence.com-20090721121059-uthu2kmvu74zjv06
22 silvia.pfeiffer at vquence.com-20090721125735-lwwo9ivbdhj0jdhp
23 silvia.pfeiffer at vquence.com-20090721130655-sdqdgbs0lexyrwh5
24 silvia.pfeiffer at vquence.com-20090721143346-065b9v0rr1tcmyg0
25 silvia.pfeiffer at vquence.com-20090722010421-9sx8ynfzcoxh1eai
+ 1 silvia.pfeiffer at vquence.com-20090713110521-cz7evclxohf4rbs2
2 silvia.pfeiffer at vquence.com-20090714003359-apmpuor2ttarph5n
3 silvia.pfeiffer at vquence.com-20090714143931-q6j8ritt91jn5rhu
4 silvia.pfeiffer at vquence.com-20090718094222-58zgcmsg9gggbnt1
5 silvia.pfeiffer at vquence.com-20090718094708-wb83p9u6jr1xlhm6
6 silvia.pfeiffer at vquence.com-20090718095409-p6en5qufj62m8w3h
7 silvia.pfeiffer at vquence.com-20090718113424-9s8cmt1guxj6qoky
8 silvia.pfeiffer at vquence.com-20090718113445-n0q9c14w4i11pe36
9 silvia.pfeiffer at vquence.com-20090718123622-xdp52y76dvpem2ya
10 silvia.pfeiffer at vquence.com-20090718131644-69y0zml0ccbwc5er
11 silvia.pfeiffer at vquence.com-20090719002119-ekzto9pc7jqs3gw9
12 silvia.pfeiffer at vquence.com-20090719120832-srm8qemvr5jjy67w
13 silvia.pfeiffer at vquence.com-20090719130420-s7xjh35zrfj8117x
14 silvia.pfeiffer at vquence.com-20090720065454-m2g8tcjgpgw8aetr
15 silvia.pfeiffer at vquence.com-20090720131039-ivpstebztd7u3vwx
16 silvia.pfeiffer at vquence.com-20090720190949-r4ahzq2regl7opf1
17 silvia.pfeiffer at vquence.com-20090720210510-i54efp8a9sem4g6g
18 silvia.pfeiffer at vquence.com-20090721063829-4pvft92pnt7k966p
19 silvia.pfeiffer at vquence.com-20090721065410-0miir37pbb73k35r
20 silvia.pfeiffer at vquence.com-20090721065911-9ngk00aeujudpw8p
21 silvia.pfeiffer at vquence.com-20090721121059-uthu2kmvu74zjv06
22 silvia.pfeiffer at vquence.com-20090721125735-lwwo9ivbdhj0jdhp
23 silvia.pfeiffer at vquence.com-20090721130655-sdqdgbs0lexyrwh5
24 silvia.pfeiffer at vquence.com-20090721143346-065b9v0rr1tcmyg0
25 silvia.pfeiffer at vquence.com-20090722010421-9sx8ynfzcoxh1eai
26 silvia.pfeiffer at vquence.com-20090722014433-yrqaapi0kmfec1oh
Modified: bzr:text-parents
- elephant.png silvia.pfeiffer at vquence.com-20090718094222-58zgcmsg9gggbnt1
index.html silvia.pfeiffer at vquence.com-20090721065410-0miir37pbb73k35r
+ skins/schmucker/tinyvid.js silvia.pfeiffer at vquence.com-20090719130420-s7xjh35zrfj8117x
Modified: itext/skins/schmucker/tinyvid.js
===================================================================
--- itext/skins/schmucker/tinyvid.js 2009-07-22 01:45:26 UTC (rev 3976)
+++ itext/skins/schmucker/tinyvid.js 2009-07-22 01:45:34 UTC (rev 3977)
@@ -3,6 +3,9 @@
*/
/* this file contains an extension for subtitles */
+// Stop JSLint whinging about globals //
+/*global document: true, window: true, ItextCollection: true, jQuery: true */
+
var das={
hardScope:function(fn,sc){
return function(){
@@ -11,8 +14,9 @@
},
EvtListener:function(el,type,call){
this.add=das.hardScope(function(el){
- if(this.bound)
+ if(this.bound) {
this.remove();
+ }
this.data.el=el;
el.addEventListener(this.data.type,this.data.call,false);
this.bound=true;
@@ -39,9 +43,9 @@
this.reference=interactiveReference;
this.onInteract=onInteract;
- if(this.interactive)
+ if(this.interactive) {
this.mouseDownListener=new das.EvtListener(this.reference,"mousedown",this.startInteract);
-
+ }
};
ThrobberHandle.prototype={
@@ -52,8 +56,9 @@
reference:null,
value:0,
setValue:function(val,overrideBlocked){
- if(this.blocked && !overrideBlocked)
+ if(this.blocked && !overrideBlocked) {
return;
+ }
this.value=val;
this.element.style.left=(this.value*100)+"%";
},
@@ -61,8 +66,9 @@
mouseMoveListener:null,
mouseUpListener:null,
startInteract:function(evt){
- if(evt.button!=0)
+ if(evt.button !== 0) {
return;
+ }
this.mouseMoveListener=new das.EvtListener(window,"mousemove",this.doInteract);
this.mouseUpListener=new das.EvtListener(window,"mouseup",this.endInteract);
this.doInteract(evt);
@@ -74,14 +80,19 @@
var x=evt.pageX-base.left;
var width=this.reference.offsetWidth;
var p=x/width;
- if(p>1) p=1;
- if(p<0) p=0;
+ if(p>1) {
+ p=1;
+ }
+ if(p<0) {
+ p=0;
+ }
this.setValue(p,true);
this.onInteract(p,!!end);
},
endInteract:function(evt){
- if(evt.button!=0)
+ if(evt.button !== 0) {
return;
+ }
this.mouseMoveListener.remove();
this.mouseMoveListener=null;
this.mouseUpListener.remove();
@@ -102,8 +113,9 @@
ProgressHandle.prototype=new ThrobberHandleInheritor();
ProgressHandle.prototype.setValue=function(val,overrideBlocked){
- if(this.blocked && !overrideBlocked)
+ if(this.blocked && !overrideBlocked) {
return;
+ }
this.value=val;
this.element.style.width=(this.value*100)+"%";
};
@@ -128,8 +140,9 @@
startWidth:0,startHeight:0,
innerOffsetX:0,innerOffsetY:0,
startResize:function(evt){
- if(evt.button!=0)
+ if(evt.button !== 0) {
return;
+ }
this.mouseMoveListener=new das.EvtListener(window,"mousemove",this.doResize);
this.mouseUpListener=new das.EvtListener(window,"mouseup",this.endResize);
@@ -149,20 +162,22 @@
var destX=Math.max(XdestX,YdestX);
- if(destX<200)
+ if(destX<200) {
destX=200;
+ }
this.target.style.width=Math.floor(destX)+"px";
},
endResize:function(evt){
- if(evt.button!=0)
+ if(evt.button !==0) {
return;
+ }
this.mouseMoveListener.remove();
this.mouseMoveListener=null;
this.mouseUpListener.remove();
this.mouseUpListener=null;
- $(".langMenu").css("height",$(".v").css("height"));
+ jQuery(".langMenu").css("height",jQuery(".v").css("height"));
},
mouseDownListener:null,
mouseMoveListener:null,
@@ -191,8 +206,8 @@
this.soundListener=new das.EvtListener(this.baseEl.querySelector("a.sound"),"click",this.sound);
// parse itexts and create an invisible menu for them
- this.itexts=new ItextCollection($(this.video));
- this.itexts.itextMenu($(".mc"));
+ this.itexts=new ItextCollection(jQuery(this.video));
+ this.itexts.itextMenu(jQuery(".mc"));
this.visitext = false;
// attach a callback to the video for the captions
@@ -256,28 +271,31 @@
this.visitext=!this.visitext;
if (this.visitext) {
// make subtitle menu visible
- $(".catMenu").css("visibility", "visible");
+ jQuery(".catMenu").css("visibility", "visible");
} else {
// make subtitle menu invisible
- $(".catMenu").css("visibility", "hidden");
+ jQuery(".catMenu").css("visibility", "hidden");
}
},
volumeChange:function(p){
this.volume=this.video.volume=p;
},
onProgress:function(evt){
- if(evt.lengthComputable && evt.total)
+ if(evt.lengthComputable && evt.total) {
this.progress.setValue(evt.loaded/evt.total);
+ }
},
onTimeChange:function(evt){
- if(this.video.duration)
+ if(this.video.duration) {
this.position.setValue(this.video.currentTime/this.video.duration);
- else
+ } else {
this.position.setValue(0);
+ }
},
seek:function(p,end){
- if(end)
+ if(end) {
this.video.currentTime=this.video.duration*p;
+ }
}
};
@@ -287,6 +305,7 @@
window.addEventListener("load",function(){
var playerElements=document.querySelectorAll("div.tinyVidPlayer");
- for(var i=0;i<playerElements.length;i++)
+ for(var i=0;i<playerElements.length;i++) {
playerControllers.push(new PlayerController(playerElements[i]));
+ }
},false);
More information about the commits
mailing list