<table>
<tr>
<td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td>
- <td><span class="button" onclick="PlaylistEditCommand('addall','<?php echo escapePhpString($dir);?>')" ><img width="20" src="images/addall.png"></span><td>
+ <td><span class="button" onclick="return confirm('Добавить все. Вы уверены?') ? PlaylistEditCommand('addall','<?php echo escapePhpString($dir);?>') : false;" ><img width="20" src="images/addall.png"></span><td>
<td><span class="button" onclick="PlaylistEditItemsCommand('addselected','<?php echo escapePhpString($dir);?>')"><img width="20" src="images/addselected.png"></span><td>
</tr>
</table>
<table>
<tr>
<td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td>
- <td><span class="button" onclick="PlaylistEditCommand('addall','<?php echo escapePhpString($dir);?>')" ><img width="20" src="images/addall.png"></span><td>
+ <td><span class="button" onclick="return confirm('Добавить все. Вы уверены?') ? PlaylistEditCommand('addall','<?php echo escapePhpString($dir);?>') : false;" ><img width="20" src="images/addall.png"></span><td>
<td><span class="button" onclick="PlaylistEditItemsCommand('addselected','<?php echo escapePhpString($dir);?>')"><img width="20" src="images/addselected.png"></span><td>
</tr>
</table>
var req = new XMLHttpRequest();
+req.onreadystatechange = function () {
+ if (this.readyState != 4 || this.status != 200) return;
+ RefreshPageStatus();
+};
+
req.open("GET", "ajax/playlist-command.php?item="+item+"&task="+cmd, true);
req.send();
return 'itemlist[]=' + encodeURIComponent(el);
}).join('&');
+req.onreadystatechange = function () {
+ if (this.readyState != 4 || this.status != 200) return;
+ RefreshPageStatus();
+};
+
req.open("POST", "ajax/playlist-command.php?dir="+dir+"&task="+cmd, true);
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.send(params);
}
-// setInterval(RefreshPageStatus, 5000);
+setInterval(RefreshPageStatus, 10000);
$mpd = new mpd($mpd_host,$mpd_port,$mpd_password);
if($mpd->connected != 1){
- echo "Not Connected to Server";
+ echo "Нет соединения с сервером!";
exit(1);
}
include('mpd.php');
-$cur_track= $mpd->current_track_id;
-$playlist= $mpd->playlist;
-if($cur_track !=-1)
+$cur_track = $mpd->current_track_id;
+$playlist = $mpd->playlist;
+$playlist_count = $mpd->playlist_count;
+
+if($cur_track !=-1) {
+
+ $trackno=$cur_track+1;
+
+ echo "<div class=\"trackno\">#$trackno/$playlist_count</div>";
if ($playlist[$cur_track]['name']==$playlist[$cur_track]['title']) {
- echo htmlentities(cut_file($playlist[$cur_track]['name']));
+ echo "<div class=\"trackname\">".htmlentities(cut_file($playlist[$cur_track]['name']))."</div>";
} else {
- echo htmlentities($playlist[$cur_track]['title']);
+ echo "<div class=\"trackname\">".htmlentities($playlist[$cur_track]['title'])."</div>";
}
-else
- echo "No Track selected";
+
+} else {
+ echo "<div class=\"trackno\">#-/$playlist_count</div>";
+ echo "<div class=\"trackname\">Трек не выбран</div>";
+}
?>
cursor : pointer;
}
+.trackno
+{
+text-align: right;
+vertical-align: top;
+padding: 0px 0px 5px 0px;
+}
+
#heading_tbl {
width: 400px
}
text-align: center;
border: 1px solid #525356;
width: 380px;
- padding: 30px 0px 30px 0px;
+ height: 60px;
+ padding: 10px 0px 5px 0px;
background:url(../images/playing_bg.png);
font-weight: bold;
color: #fff;
$mpd = new mpd($mpd_host,$mpd_port,$mpd_password);
if($mpd->connected != 1){
- echo "Not Connected to Server";
+ echo "Нет соединения с сервером!";
exit(1);
}
// Get the Playlist\r
$plStr = $this->SendCommand(MPD_CMD_PLLIST);\r
$this->playlist = $this->_parseFileListResponse($plStr);\r
- $this->playlist_count = count($this->playlist);\r
+ $this->playlist_count = count($this->playlist);\r
\r
// Set Misc Other Variables\r
$this->state = $status['state'];\r
<table>
<tr>
<td><span class="button" onclick="EditPlayList()"><img width="20" src="images/songs.png"></span><td>
- <td><span class="button" onclick="PlaylistCommand('clear')" ><img width="20" src="images/removeall.png"></span><td>
+ <td><span class="button" onclick="return confirm('Очистить список. Вы уверены?') ? PlaylistCommand('clear') : false;" ><img width="20" src="images/removeall.png"></span><td>
<td><span class="button" onclick="PlaylistItemsCommand('removeselected')"><img width="20" src="images/removeselected.png"></span><td>
</tr>
</table>