Commit f89d0a88 authored by Francois Cartegnie's avatar Francois Cartegnie

web intf: save few bytes using chaining

parent e63678cc
...@@ -29,35 +29,40 @@ function updateStatus(){ ...@@ -29,35 +29,40 @@ function updateStatus(){
$('#subtitleSlider').slider({value: ($('subtitledelay',data).text()) }); $('#subtitleSlider').slider({value: ($('subtitledelay',data).text()) });
$('#currentSubtitleDelay').append(Math.round($('subtitledelay',data).text()*100)/100+'s'); $('#currentSubtitleDelay').append(Math.round($('subtitledelay',data).text()*100)/100+'s');
$('#seekSlider').attr('totalLength',$('length',data).text()); $('#seekSlider').attr('totalLength',$('length',data).text());
$('#buttonPlay').attr('state',$('state',data).text()); $('#buttonPlay')
$('#buttonPlay').attr('mrl',$('[name="filename"]',data).text()); .attr('state',$('state',data).text())
.attr('mrl',$('[name="filename"]',data).text());
if($('state',data).text()=='playing'){ if($('state',data).text()=='playing'){
$('#buttonPlay').removeClass('paused'); $('#buttonPlay').removeClass('paused').addClass('playing');
$('#buttonPlay').addClass('playing');
}else{ }else{
$('#buttonPlay').removeClass('playing'); $('#buttonPlay').removeClass('playing').addClass('paused');
$('#buttonPlay').addClass('paused');
} }
if($('random',data).text()=='true'){ if($('random',data).text()=='true'){
$('#buttonShuffle').removeClass('ui-state-default'); $('#buttonShuffle')
$('#buttonShuffle').addClass('ui-state-active'); .removeClass('ui-state-default')
.addClass('ui-state-active');
}else{ }else{
$('#buttonShuffle').addClass('ui-state-default'); $('#buttonShuffle')
$('#buttonShuffle').removeClass('ui-state-active'); .addClass('ui-state-default')
.removeClass('ui-state-active');
} }
if($('loop',data).text()=='true'){ if($('loop',data).text()=='true'){
$('#buttonLoop').removeClass('ui-state-default'); $('#buttonLoop')
$('#buttonLoop').addClass('ui-state-active'); .removeClass('ui-state-default')
.addClass('ui-state-active');
}else{ }else{
$('#buttonLoop').addClass('ui-state-default'); $('#buttonLoop')
$('#buttonLoop').removeClass('ui-state-active'); .addClass('ui-state-default')
.removeClass('ui-state-active');
} }
if($('repeat',data).text()=='true'){ if($('repeat',data).text()=='true'){
$('#buttonRepeat').removeClass('ui-state-default'); $('#buttonRepeat')
$('#buttonRepeat').addClass('ui-state-active'); .removeClass('ui-state-default')
.addClass('ui-state-active');
}else{ }else{
$('#buttonRepeat').addClass('ui-state-default'); $('#buttonRepeat')
$('#buttonRepeat').removeClass('ui-state-active'); .addClass('ui-state-default')
.removeClass('ui-state-active');
} }
if($('[name="artwork_url"]',data).text()!=currentArt if($('[name="artwork_url"]',data).text()!=currentArt
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment