[Slim-Checkins] r12577 - in /trunk/server/HTML/Maestro: html/index.js index.html

mherger at svn.slimdevices.com mherger at svn.slimdevices.com
Thu Aug 16 08:19:51 PDT 2007


Author: mherger
Date: Thu Aug 16 08:19:51 2007
New Revision: 12577

URL: http://svn.slimdevices.com?rev=12577&view=rev
Log:
Bug: n/a
Description: navigation (skip forward/backward) in playlist

Modified:
    trunk/server/HTML/Maestro/html/index.js
    trunk/server/HTML/Maestro/index.html

Modified: trunk/server/HTML/Maestro/html/index.js
URL: http://svn.slimdevices.com/trunk/server/HTML/Maestro/html/index.js?rev=12577&r1=12576&r2=12577&view=diff
==============================================================================
--- trunk/server/HTML/Maestro/html/index.js (original)
+++ trunk/server/HTML/Maestro/html/index.js Thu Aug 16 08:19:51 2007
@@ -10,8 +10,8 @@
 
 	return {
 		init : function(){
-			pollTimer = new Ext.util.DelayedTask(Main.pollStatus, this);
-			this.pollStatus();
+			pollTimer = new Ext.util.DelayedTask(Main.getStatus, this);
+			this.getStatus();
 
 			var layout = new Ext.BorderLayout('mainbody', {
 				north: {
@@ -115,14 +115,40 @@
 			}
 			pollTimer.delay(5000);
 		},
+
+		getUpdate : function(response){
+			Ext.Ajax.request({
+				method: 'POST',
+				url: '/jsonrpc.js', 
+				timeout: 4000,
+				failure: this.updateStatus,
+				success: this.updateStatus,
+
+				params: Ext.util.JSON.encode({
+					id: 1, 
+					method: "slim.request", 
+					params: [ 
+						playerid,
+						[ 
+							"status",
+							"-",
+							1,
+							"tags:gabehldiqtyru"
+						]
+					]
+				}),
+				scope: this
+			});
+		},
 		
 		
 		// only poll to see whether the currently playing song has changed
 		// don't request all status info to minimize performance impact on the server
-		pollStatus : function() {
+		getStatus : function() {
 			Ext.Ajax.request({
 				url: '/jsonrpc.js',
 				method: 'POST',
+				timeout: 4000,
 				params: Ext.util.JSON.encode({
 					id: 1, 
 					method: "slim.request", 
@@ -149,47 +175,40 @@
 								(result.current_title && result.current_title != playerStatus.title) ||
 								(result.playlist_tracks > 0 && result.playlist_loop[0].url != playerStatus.track))
 							{
-								
-								Ext.Ajax.request({
-									method: 'POST',
-									url: '/jsonrpc.js', 
-									timeout: 4000,
-//									failure: this.updateStatus,
-//									success: this.updateStatus,
-
-									failure: function(response){
-										this.updateStatus(response);
-									},
-
-									success: function(response){
-										this.updateStatus(response);
-									},
-
-									params: Ext.util.JSON.encode({
-										id: 1, 
-										method: "slim.request", 
-										params: [ 
-											playerid,
-											[ 
-												"status",
-												"-",
-												1,
-												"tags:gabehldiqtyru"
-											]
-										]
-									}),
-									scope: this
-								});
+								this.getUpdate();
 							}
 						}
 					}
 				},
-				
+
 				scope: this
 			});
 			
 			pollTimer.delay(5000);
-		}
+		},
+
+		playerControl : function(action){
+			Ext.Ajax.request({
+				method: 'POST',
+				url: '/jsonrpc.js', 
+				timeout: 4000,
+				params: Ext.util.JSON.encode({
+					id: 1, 
+					method: "slim.request", 
+					params: [ 
+						playerid,
+						action
+					]
+				}),
+				success: function(response){
+					this.getUpdate(response);
+				},
+				scope: this
+			});
+		},
+
+		ctrlNext : function(){ this.playerControl(['playlist', 'index', '+1']) },
+		ctrlPrevious : function(){ this.playerControl(['playlist', 'index', '-1']) }
 
 	};   
 }();

Modified: trunk/server/HTML/Maestro/index.html
URL: http://svn.slimdevices.com/trunk/server/HTML/Maestro/index.html?rev=12577&r1=12576&r2=12577&view=diff
==============================================================================
--- trunk/server/HTML/Maestro/index.html (original)
+++ trunk/server/HTML/Maestro/index.html Thu Aug 16 08:19:51 2007
@@ -34,7 +34,16 @@
 				scroll
 			}
 
-			.section_header { color: #fff; font-size: 13px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; padding-left: 6px; }
+			#ctrlCurrentArt {
+				height: 96px;
+			}
+	
+			.section_header { 
+				height: 16px;
+				font-size: 13px; 
+				font-weight: bold; 
+				padding-left: 6px; 
+			}
 			.selector { color: #333; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; line-height: 16px; padding-left: 6px; }
 			.current_track { color: white; font-size: 10px; font-family: Arial, Verdana, Helvetica, sans-serif; padding-left: 4px; }
 			.current_track_exp { color: white; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; padding-left: 6px; }
@@ -78,11 +87,11 @@
 												<td>
 													<table border="0" cellspacing="0" cellpadding="0">
 														<tr>
-															<td><img src="[% webroot %]html/images/btn_previous_normal.png" alt="" height="22" width="28" border="0" /></td>
+															<td><img src="[% webroot %]html/images/btn_previous_normal.png" alt="" height="22" width="28" border="0" onclick="Main.ctrlPrevious();" /></td>
 															<td><img src="[% webroot %]html/images/spacer.gif" alt="" height="10" width="5" border="0" /></td>
 															<td><img src="[% webroot %]html/images/btn_play_normal.png" alt="" height="22" width="51" border="0" /></td>
 															<td><img src="[% webroot %]html/images/spacer.gif" alt="" height="10" width="5" border="0" /></td>
-															<td><img src="[% webroot %]html/images/btn_next_normal.png" alt="" height="22" width="28" border="0" /></td>
+															<td><img src="[% webroot %]html/images/btn_next_normal.png" alt="" height="22" width="28" border="0" onclick="Main.ctrlNext();" /></td>
 														</tr>
 													</table>
 												</td>



More information about the checkins mailing list