projects
/
mpd-web.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e05325c
)
Подтверждение удаления и прочие визуальные доработки.
author
Roman Bazalevsky
<rvb@rvb.name>
Wed, 28 Sep 2016 17:38:48 +0000
(20:38 +0300)
committer
Roman Bazalevsky
<rvb@rvb.name>
Wed, 28 Sep 2016 17:38:48 +0000
(20:38 +0300)
ajax/editplaylist.php
patch
|
blob
|
history
ajax/mpd.js
patch
|
blob
|
history
ajax/mpd.php
patch
|
blob
|
history
ajax/trackinfo.php
patch
|
blob
|
history
css/general.css
patch
|
blob
|
history
index.php
patch
|
blob
|
history
system/mpd_class.php
patch
|
blob
|
history
view/default/tmpl/playlistmenu.php
patch
|
blob
|
history
diff --git
a/ajax/editplaylist.php
b/ajax/editplaylist.php
index b7e8bf44ae65b46534c0e5828535a5dbff57c9c9..28a6d3a6246b9e631dd2d619f28bf46e9f638133 100644
(file)
--- a/
ajax/editplaylist.php
+++ b/
ajax/editplaylist.php
@@
-18,7
+18,7
@@
$dir = $_REQUEST['dir'];
<table>
<tr>
<td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td>
<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>
<td><span class="button" onclick="PlaylistEditItemsCommand('addselected','<?php echo escapePhpString($dir);?>')"><img width="20" src="images/addselected.png"></span><td>
</tr>
</table>
@@
-65,7
+65,7
@@
$dir = $_REQUEST['dir'];
<table>
<tr>
<td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td>
<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>
<td><span class="button" onclick="PlaylistEditItemsCommand('addselected','<?php echo escapePhpString($dir);?>')"><img width="20" src="images/addselected.png"></span><td>
</tr>
</table>
diff --git
a/ajax/mpd.js
b/ajax/mpd.js
index 5d64a923c719731bcd24427078dd2135760ce94b..1fe1a829a2d24d79ad1382ff509e130e12a4816e 100644
(file)
--- a/
ajax/mpd.js
+++ b/
ajax/mpd.js
@@
-142,6
+142,11
@@
function PlaylistEditCommand(cmd,item) {
var req = new XMLHttpRequest();
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();
req.open("GET", "ajax/playlist-command.php?item="+item+"&task="+cmd, true);
req.send();
@@
-189,10
+194,15
@@
params=selected.map(function(el) {
return 'itemlist[]=' + encodeURIComponent(el);
}).join('&');
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);
}
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, 5
000);
+
setInterval(RefreshPageStatus, 10
000);
diff --git
a/ajax/mpd.php
b/ajax/mpd.php
index 9f435e2853b1968b0a49c7d2628a111c506543d5..86ea78ed09410a12eed4b6d1d231b9ea7b019b53 100644
(file)
--- a/
ajax/mpd.php
+++ b/
ajax/mpd.php
@@
-7,7
+7,7
@@
include('../system/helper.php');
$mpd = new mpd($mpd_host,$mpd_port,$mpd_password);
if($mpd->connected != 1){
$mpd = new mpd($mpd_host,$mpd_port,$mpd_password);
if($mpd->connected != 1){
- echo "
Not Connected to Server
";
+ echo "
Нет соединения с сервером!
";
exit(1);
}
exit(1);
}
diff --git
a/ajax/trackinfo.php
b/ajax/trackinfo.php
index e5cc464fbcca3dc978b942c4ae43deb4edfefaa6..f1c4b362b8fbc2ed04d86a617d56a0b6ace778fd 100644
(file)
--- a/
ajax/trackinfo.php
+++ b/
ajax/trackinfo.php
@@
-2,16
+2,25
@@
include('mpd.php');
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']) {
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 {
} 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>";
+}
?>
?>
diff --git
a/css/general.css
b/css/general.css
index 19078d40271b416d26240a192b6fdd94fd56e25e..b41b3ec41bb73e31c098ffc33759da02c99f5d81 100644
(file)
--- a/
css/general.css
+++ b/
css/general.css
@@
-49,6
+49,13
@@
padding : 0px;
cursor : pointer;
}
cursor : pointer;
}
+.trackno
+{
+text-align: right;
+vertical-align: top;
+padding: 0px 0px 5px 0px;
+}
+
#heading_tbl {
width: 400px
}
#heading_tbl {
width: 400px
}
@@
-75,7
+82,8
@@
cursor : pointer;
text-align: center;
border: 1px solid #525356;
width: 380px;
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;
background:url(../images/playing_bg.png);
font-weight: bold;
color: #fff;
diff --git
a/index.php
b/index.php
index 40c64d8a6b1b990939f0380b2bba2bd0b2b4bbcf..7ed34f33557a1215f8f0332b1c9583a5d47e45cf 100644
(file)
--- a/
index.php
+++ b/
index.php
@@
-6,7
+6,7
@@
include('system/helper.php');
$mpd = new mpd($mpd_host,$mpd_port,$mpd_password);
if($mpd->connected != 1){
$mpd = new mpd($mpd_host,$mpd_port,$mpd_password);
if($mpd->connected != 1){
- echo "
Not Connected to Server
";
+ echo "
Нет соединения с сервером!
";
exit(1);
}
exit(1);
}
diff --git
a/system/mpd_class.php
b/system/mpd_class.php
index 8ffddcd45dcf16087766f83b806d2f4a94a9bd8b..6f9f1acee54e5307d6f8da8be764c4153b5fd1e0 100644
(file)
--- a/
system/mpd_class.php
+++ b/
system/mpd_class.php
@@
-852,7
+852,7
@@
class mpd {
// Get the Playlist
\r
$plStr = $this->SendCommand(MPD_CMD_PLLIST);
\r
$this->playlist = $this->_parseFileListResponse($plStr);
\r
// 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
\r
// Set Misc Other Variables
\r
$this->state = $status['state'];
\r
diff --git
a/view/default/tmpl/playlistmenu.php
b/view/default/tmpl/playlistmenu.php
index bc0f8f06bd2f7e137a577c96ec63b2c1289abe26..cb8113a7bb3c754cdafbbce4ab2f11461736337f 100644
(file)
--- a/
view/default/tmpl/playlistmenu.php
+++ b/
view/default/tmpl/playlistmenu.php
@@
-2,7
+2,7
@@
<table>
<tr>
<td><span class="button" onclick="EditPlayList()"><img width="20" src="images/songs.png"></span><td>
<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>
<td><span class="button" onclick="PlaylistItemsCommand('removeselected')"><img width="20" src="images/removeselected.png"></span><td>
</tr>
</table>