mirror of
https://github.com/SuperBFG7/ympd
synced 2024-11-29 16:09:55 +00:00
merge branch touch
This commit is contained in:
commit
b59c06b922
@ -16,6 +16,7 @@
|
|||||||
<!-- Custom styles for this template -->
|
<!-- Custom styles for this template -->
|
||||||
<link href="css/mpd.min.css" rel="stylesheet">
|
<link href="css/mpd.min.css" rel="stylesheet">
|
||||||
<link href="assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
|
<link href="assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
|
||||||
|
<script src="js/modernizr-custom.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
4
htdocs/js/modernizr-custom.js
Normal file
4
htdocs/js/modernizr-custom.js
Normal file
File diff suppressed because one or more lines are too long
@ -28,6 +28,7 @@ var MAX_ELEMENTS_PER_PAGE = 512;
|
|||||||
var dirble_selected_cat = "";
|
var dirble_selected_cat = "";
|
||||||
var dirble_catid = "";
|
var dirble_catid = "";
|
||||||
var dirble_page = 1;
|
var dirble_page = 1;
|
||||||
|
var isTouch = Modernizr.touch ? 1 : 0;
|
||||||
|
|
||||||
var app = $.sammy(function() {
|
var app = $.sammy(function() {
|
||||||
|
|
||||||
@ -230,7 +231,12 @@ function webSocketConnect() {
|
|||||||
$('#next').removeClass('hide');
|
$('#next').removeClass('hide');
|
||||||
if(pagination > 0)
|
if(pagination > 0)
|
||||||
$('#prev').removeClass('hide');
|
$('#prev').removeClass('hide');
|
||||||
|
if ( isTouch ) {
|
||||||
|
$('#salamisandwich > tbody > tr > td:last-child').append(
|
||||||
|
"<a class=\"pull-right btn-group-hover\" href=\"#/\" " +
|
||||||
|
"onclick=\"socket.send('MPD_API_RM_TRACK,' + $(this).parents('tr').attr('trackid')); $(this).parents('tr').remove();\">" +
|
||||||
|
"<span class=\"glyphicon glyphicon-trash\"></span></a>");
|
||||||
|
} else {
|
||||||
$('#salamisandwich > tbody > tr').on({
|
$('#salamisandwich > tbody > tr').on({
|
||||||
mouseover: function(){
|
mouseover: function(){
|
||||||
if($(this).children().last().has("a").length == 0)
|
if($(this).children().last().has("a").length == 0)
|
||||||
@ -240,14 +246,18 @@ function webSocketConnect() {
|
|||||||
"<span class=\"glyphicon glyphicon-trash\"></span></a>")
|
"<span class=\"glyphicon glyphicon-trash\"></span></a>")
|
||||||
.find('a').fadeTo('fast',1);
|
.find('a').fadeTo('fast',1);
|
||||||
},
|
},
|
||||||
|
mouseleave: function(){
|
||||||
|
$(this).children().last().find("a").stop().remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$('#salamisandwich > tbody > tr').on({
|
||||||
click: function() {
|
click: function() {
|
||||||
$('#salamisandwich > tbody > tr').removeClass('active');
|
$('#salamisandwich > tbody > tr').removeClass('active');
|
||||||
socket.send('MPD_API_PLAY_TRACK,'+$(this).attr('trackid'));
|
socket.send('MPD_API_PLAY_TRACK,'+$(this).attr('trackid'));
|
||||||
$(this).addClass('active');
|
$(this).addClass('active');
|
||||||
},
|
},
|
||||||
mouseleave: function(){
|
|
||||||
$(this).children().last().find("a").stop().remove();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
//Helper function to keep table row from collapsing when being sorted
|
//Helper function to keep table row from collapsing when being sorted
|
||||||
var fixHelperModified = function(e, tr) {
|
var fixHelperModified = function(e, tr) {
|
||||||
@ -330,7 +340,7 @@ function webSocketConnect() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function appendClickableIcon(appendTo, onClickAction, glyphicon) {
|
function appendClickableIcon(appendTo, onClickAction, glyphicon) {
|
||||||
$(appendTo).children().last().append(
|
$(appendTo).append(
|
||||||
"<a role=\"button\" class=\"pull-right btn-group-hover\">" +
|
"<a role=\"button\" class=\"pull-right btn-group-hover\">" +
|
||||||
"<span class=\"glyphicon glyphicon-" + glyphicon + "\"></span></a>")
|
"<span class=\"glyphicon glyphicon-" + glyphicon + "\"></span></a>")
|
||||||
.find('a').click(function(e) {
|
.find('a').click(function(e) {
|
||||||
@ -343,13 +353,23 @@ function webSocketConnect() {
|
|||||||
}).fadeTo('fast',1);
|
}).fadeTo('fast',1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( isTouch ) {
|
||||||
|
appendClickableIcon($("#salamisandwich > tbody > tr.dir > td:last-child"), 'MPD_API_ADD_TRACK', 'plus');
|
||||||
|
appendClickableIcon($("#salamisandwich > tbody > tr.song > td:last-child"), 'MPD_API_ADD_TRACK', 'play');
|
||||||
|
} else {
|
||||||
$('#salamisandwich > tbody > tr').on({
|
$('#salamisandwich > tbody > tr').on({
|
||||||
mouseenter: function() {
|
mouseenter: function() {
|
||||||
if($(this).is(".dir"))
|
if($(this).is(".dir"))
|
||||||
appendClickableIcon($(this), 'MPD_API_ADD_TRACK', 'plus');
|
appendClickableIcon($(this).children().last(), 'MPD_API_ADD_TRACK', 'plus');
|
||||||
else if($(this).is(".song"))
|
else if($(this).is(".song"))
|
||||||
appendClickableIcon($(this), 'MPD_API_ADD_PLAY_TRACK', 'play');
|
appendClickableIcon($(this).children().last(), 'MPD_API_ADD_PLAY_TRACK', 'play');
|
||||||
},
|
},
|
||||||
|
mouseleave: function(){
|
||||||
|
$(this).children().last().find("a").stop().remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
$('#salamisandwich > tbody > tr').on({
|
||||||
click: function() {
|
click: function() {
|
||||||
switch($(this).attr('class')) {
|
switch($(this).attr('class')) {
|
||||||
case 'dir':
|
case 'dir':
|
||||||
@ -375,9 +395,6 @@ function webSocketConnect() {
|
|||||||
}).show();
|
}).show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mouseleave: function(){
|
|
||||||
$(this).children().last().find("a").stop().remove();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user