[vlc-commits] web intf: save few bytes using chaining

Francois Cartegnie git at videolan.org
Sat Sep 24 17:57:09 CEST 2011


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Sep 24 17:55:23 2011 +0200| [f89d0a88b533bd9ca0514d7d1ecbbfd13a273c19] | committer: Francois Cartegnie

web intf: save few bytes using chaining

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f89d0a88b533bd9ca0514d7d1ecbbfd13a273c19
---

 share/lua/http/js/controlers.js |   41 +++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/share/lua/http/js/controlers.js b/share/lua/http/js/controlers.js
index b74a8de..fb21dd5 100644
--- a/share/lua/http/js/controlers.js
+++ b/share/lua/http/js/controlers.js
@@ -29,35 +29,40 @@ function updateStatus(){
 				$('#subtitleSlider').slider({value: ($('subtitledelay',data).text()) });
 				$('#currentSubtitleDelay').append(Math.round($('subtitledelay',data).text()*100)/100+'s');
 				$('#seekSlider').attr('totalLength',$('length',data).text());
-				$('#buttonPlay').attr('state',$('state',data).text());
-				$('#buttonPlay').attr('mrl',$('[name="filename"]',data).text());
+				$('#buttonPlay')
+				.attr('state',$('state',data).text())
+				.attr('mrl',$('[name="filename"]',data).text());
 				if($('state',data).text()=='playing'){
-					$('#buttonPlay').removeClass('paused');
-					$('#buttonPlay').addClass('playing');
+					$('#buttonPlay').removeClass('paused').addClass('playing');
 				}else{
-					$('#buttonPlay').removeClass('playing');
-					$('#buttonPlay').addClass('paused');
+					$('#buttonPlay').removeClass('playing').addClass('paused');
 				}
 				if($('random',data).text()=='true'){
-					$('#buttonShuffle').removeClass('ui-state-default');
-					$('#buttonShuffle').addClass('ui-state-active');
+					$('#buttonShuffle')
+					.removeClass('ui-state-default')
+					.addClass('ui-state-active');
 				}else{
-					$('#buttonShuffle').addClass('ui-state-default');
-					$('#buttonShuffle').removeClass('ui-state-active');
+					$('#buttonShuffle')
+					.addClass('ui-state-default')
+					.removeClass('ui-state-active');
 				}
 				if($('loop',data).text()=='true'){
-					$('#buttonLoop').removeClass('ui-state-default');
-					$('#buttonLoop').addClass('ui-state-active');
+					$('#buttonLoop')
+					.removeClass('ui-state-default')
+					.addClass('ui-state-active');
 				}else{
-					$('#buttonLoop').addClass('ui-state-default');
-					$('#buttonLoop').removeClass('ui-state-active');
+					$('#buttonLoop')
+					.addClass('ui-state-default')
+					.removeClass('ui-state-active');
 				}
 				if($('repeat',data).text()=='true'){
-					$('#buttonRepeat').removeClass('ui-state-default');
-					$('#buttonRepeat').addClass('ui-state-active');
+					$('#buttonRepeat')
+					.removeClass('ui-state-default')
+					.addClass('ui-state-active');
 				}else{
-					$('#buttonRepeat').addClass('ui-state-default');
-					$('#buttonRepeat').removeClass('ui-state-active');
+					$('#buttonRepeat')
+					.addClass('ui-state-default')
+					.removeClass('ui-state-active');
 				}
 
 				if($('[name="artwork_url"]',data).text()!=currentArt



More information about the vlc-commits mailing list