bugfixes, better swipes
This commit is contained in:
parent
bc4cd06faa
commit
029e5d44fa
@ -165,10 +165,6 @@
|
|||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pane {
|
|
||||||
min-height: 125px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************
|
/***********************
|
||||||
* Track Slider
|
* Track Slider
|
||||||
***********************/
|
***********************/
|
||||||
@ -377,16 +373,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#controlspopup, #artistpopup, #coverpopup {
|
#controlspopup, #artistpopup, #coverpopup {
|
||||||
max-width: 460px;
|
max-width: 550px;
|
||||||
background: white;
|
background: white;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
max-width: 80%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#h_artistname {
|
#h_artistname {
|
||||||
margin-bottom: 65px;
|
margin-bottom: 65px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#buttons, #controlspopupimage, #coverpopupimage, #artistpopupimage {
|
#buttons, #controlspopupimage, #coverpopupimage, #artistpopupimage {
|
||||||
display: block;
|
display: block;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@ -394,6 +390,14 @@
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#popupTracksLv li, #popupQueueLv li {
|
||||||
|
border-bottom: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popupTracksLv, #popupQueueLv {
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
/*dont hide clear buttons in text input */
|
/*dont hide clear buttons in text input */
|
||||||
.ui-input-clear-hidden {
|
.ui-input-clear-hidden {
|
||||||
display:block !important;
|
display:block !important;
|
||||||
|
|||||||
@ -192,8 +192,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- /header -->
|
<!-- /header -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div data-role="content" id="playlistspane" class="pane ui-grid-a pl-breakpoint">
|
<div data-role="content" id="playlistspane" class="pane ui-grid-a pl-breakpoint">
|
||||||
<div class="ui-block-a scroll" id="playlistslistdiv">
|
<div class="ui-block-a scroll" id="playlistslistdiv">
|
||||||
<ul id="playlistslist" class="table"></ul>
|
<ul id="playlistslist" class="table"></ul>
|
||||||
|
|||||||
1
flatclient/js/controls.js
vendored
1
flatclient/js/controls.js
vendored
@ -127,6 +127,7 @@ function playTrackByUri(uri, playlisturi){
|
|||||||
*/
|
*/
|
||||||
function playTrackQueueByUri(uri, playlisturi){
|
function playTrackQueueByUri(uri, playlisturi){
|
||||||
//stop directly, for user feedback
|
//stop directly, for user feedback
|
||||||
|
//console.log('qu');
|
||||||
mopidy.playback.stop(true);
|
mopidy.playback.stop(true);
|
||||||
$('#popupQueue').popup('close');
|
$('#popupQueue').popup('close');
|
||||||
toast('Loading...');
|
toast('Loading...');
|
||||||
|
|||||||
@ -74,11 +74,13 @@ STATUS_TIMER = 10000;
|
|||||||
|
|
||||||
var radioStations = [];
|
var radioStations = [];
|
||||||
//fill with defaults
|
//fill with defaults
|
||||||
radioStations.push(['FluxFM', 'http://www.fluxfm.de/stream-berlin']);
|
radioStations.push(['NPR 24', 'http://nprdmp.ic.llnwd.net/stream/nprdmp_live01_mp3']);
|
||||||
radioStations.push(['FM4', 'http://mp3stream1.apasf.apa.at:8000/']);
|
radioStations.push(['3FM Dutch', 'http://icecast.omroep.nl/3fm-bb-mp3']);
|
||||||
radioStations.push(['Bayern 2', 'http://gffstream.ic.llnwd.net/stream/gffstream_w11a']);
|
radioStations.push(['BBC WorldService', 'http://vprbbc.streamguys.net:8000/vprbbc24.mp3']);
|
||||||
radioStations.push(['Bayern 3', 'http://gffstream.ic.llnwd.net/stream/gffstream_w12a']);
|
radioStations.push(['Arrow Jazz', 'http://81.173.3.132:8082']);
|
||||||
radioStations.push(['Campus Crew', 'http://streamplus8.leonex.de:35132/']);
|
radioStations.push(['PBS Australia', 'http://eno.emit.com:8000/pbsfm_live_64.mp3']);
|
||||||
|
radioStations.push(['Kiss FM Berlin', 'http://stream.kissfm.de/kissfm/mp3-128/internetradio/']);
|
||||||
|
|
||||||
|
|
||||||
/*******
|
/*******
|
||||||
*
|
*
|
||||||
@ -145,7 +147,6 @@ function albumTracksToTable(pl, target, uri) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function renderSongLi(song, liID, uri){
|
function renderSongLi(song, liID, uri){
|
||||||
|
|
||||||
var hash = document.location.hash.split('?');
|
var hash = document.location.hash.split('?');
|
||||||
//this is so dirty... ... ...
|
//this is so dirty... ... ...
|
||||||
var playlistType = '';
|
var playlistType = '';
|
||||||
@ -155,6 +156,7 @@ function renderSongLi(song, liID, uri){
|
|||||||
} else {
|
} else {
|
||||||
playlistType = 'playTrackByUri';
|
playlistType = 'playTrackByUri';
|
||||||
}
|
}
|
||||||
|
console.log(playlistType);
|
||||||
|
|
||||||
// songLi = '';
|
// songLi = '';
|
||||||
songLi = '<li class="song albumli" id="' + liID + '">' +
|
songLi = '<li class="song albumli" id="' + liID + '">' +
|
||||||
@ -176,6 +178,7 @@ function resultsToTables(results, target, uri) {
|
|||||||
} else {
|
} else {
|
||||||
playlistType = 'playTrackByUri';
|
playlistType = 'playTrackByUri';
|
||||||
}
|
}
|
||||||
|
console.log(playlistType);
|
||||||
|
|
||||||
var newalbum = [];
|
var newalbum = [];
|
||||||
var nexturi = '';
|
var nexturi = '';
|
||||||
@ -215,7 +218,7 @@ function resultsToTables(results, target, uri) {
|
|||||||
'<i class="fa fa-ellipsis-vertical"></i></a>' +
|
'<i class="fa fa-ellipsis-vertical"></i></a>' +
|
||||||
'<a href="#" onclick="return ' + playlistType + '(\'' + newalbum[0].uri + '\',\'' + uri + '\');">' +
|
'<a href="#" onclick="return ' + playlistType + '(\'' + newalbum[0].uri + '\',\'' + uri + '\');">' +
|
||||||
'<h1>' + newalbum[0].name + "</h1><p>";
|
'<h1>' + newalbum[0].name + "</h1><p>";
|
||||||
/* '<span style="float: right;">' + timeFromSeconds(newalbum[0].length / 1000) + '</span>'; */
|
/* '<span style="float: right;">' + timeFromSeconds(newalbum[0].length / 1000) + '</span>'; */
|
||||||
for ( j = 0; j < newalbum[0].artists.length; j++) {
|
for ( j = 0; j < newalbum[0].artists.length; j++) {
|
||||||
html += newalbum[0].artists[j].name;
|
html += newalbum[0].artists[j].name;
|
||||||
html += (j == newalbum[0].artists.length - 1) ? '' : ' / ';
|
html += (j == newalbum[0].artists.length - 1) ? '' : ' / ';
|
||||||
@ -325,6 +328,7 @@ function getTracksFromUri(uri) {
|
|||||||
} else if (customTracklists[uri]) {
|
} else if (customTracklists[uri]) {
|
||||||
return customTracklists[uri];
|
return customTracklists[uri];
|
||||||
}
|
}
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
//convert time to human readable format
|
//convert time to human readable format
|
||||||
@ -389,4 +393,41 @@ function showOffline(on) {
|
|||||||
function validUri(str) {
|
function validUri(str) {
|
||||||
var regexp = /(mms|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
|
var regexp = /(mms|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
|
||||||
return regexp.test(str);
|
return regexp.test(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$.event.special.swipe = $.extend($.event.special.swipe, {
|
||||||
|
start: function( event ) {
|
||||||
|
var data = event.originalEvent.touches ?
|
||||||
|
event.originalEvent.touches[ 0 ] : event;
|
||||||
|
return {
|
||||||
|
time: ( new Date() ).getTime(),
|
||||||
|
coords: [ data.pageX, data.pageY ],
|
||||||
|
origin: $( event.target ),
|
||||||
|
offset: $('body').scrollTop()
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
stop: function( event ) {
|
||||||
|
var data = event.originalEvent.touches ?
|
||||||
|
event.originalEvent.touches[ 0 ] : event;
|
||||||
|
return {
|
||||||
|
time: ( new Date() ).getTime(),
|
||||||
|
coords: [ data.pageX, data.pageY ],
|
||||||
|
offset: $('body').scrollTop()
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSwipe: function( start, stop ) {
|
||||||
|
var swipe = $.event.special.swipe,
|
||||||
|
x = Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ),
|
||||||
|
y = Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ),
|
||||||
|
offset = Math.abs( start.offset - stop.offset ),
|
||||||
|
time = stop.time - start.time;
|
||||||
|
if ( time < swipe.durationThreshold && x > swipe.horizontalDistanceThreshold && ( y + offset )
|
||||||
|
< swipe.verticalDistanceThreshold ) {
|
||||||
|
|
||||||
|
start.origin.trigger( "swipe" ).trigger( ( start.coords[ 0 ] - stop.coords[ 0 ] ) ? "swipeleft" : "swiperight" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
@ -392,19 +392,12 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
initRadio();
|
initRadio();
|
||||||
|
|
||||||
if ($(window).width() < 560) {
|
if ($(window).width() <= 1024) {
|
||||||
$("#panel").panel("close");
|
$("#panel").panel("close");
|
||||||
}else{
|
}else{
|
||||||
$("#panel").panel("open");
|
$("#panel").panel("open");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* //hide fs button if mobile browser
|
|
||||||
if(isMobileSafari) {
|
|
||||||
alert(ua);
|
|
||||||
$('#navExitFullscreen').hide();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
//hide fullscreen button if in UIWebview
|
//hide fullscreen button if in UIWebview
|
||||||
if (window.navigator.standalone) {
|
if (window.navigator.standalone) {
|
||||||
$('#navExitFullscreen').hide();
|
$('#navExitFullscreen').hide();
|
||||||
@ -413,9 +406,10 @@ $(document).ready(function() {
|
|||||||
// swipe songinfo and panel
|
// swipe songinfo and panel
|
||||||
$( "#normalFooter" ).on( "swiperight", doPrevious );
|
$( "#normalFooter" ).on( "swiperight", doPrevious );
|
||||||
$( "#normalFooter" ).on( "swipeleft", doNext );
|
$( "#normalFooter" ).on( "swipeleft", doNext );
|
||||||
|
$( "#panel, .pane" ).on( "swiperight", function() { $("#panel").panel("open") } );
|
||||||
|
$( "#panel, .pane" ).on( "swipeleft", function() { $("#panel").panel("close") });
|
||||||
$( "#header" ).on( "swiperight", function() { $("#panel").panel("open") } );
|
$( "#header" ).on( "swiperight", function() { $("#panel").panel("open") } );
|
||||||
$( "#header" ).on( "swipeleft", function() { $("#panel").panel("close") });
|
$( "#header" ).on( "swipeleft", function() { $("#panel").panel("close") });
|
||||||
$( ".pane" ).on( "swiperight", function() { $("#panel").panel("open") } );
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).bind("pageinit", function() {
|
$(document).bind("pageinit", function() {
|
||||||
@ -569,6 +563,9 @@ function locationHashChanged() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).bind("mobileinit", function(){
|
$(document).bind("mobileinit", function(){
|
||||||
$.event.special.swipe.horizontalDistanceThreshold = 100; // (default: 30px) – Swipe horizontal displacement must be more than this.
|
$.event.special.swipe.horizontalDistanceThreshold = 30; // (default: 30px) Swipe horizontal displacement must be more than this.
|
||||||
$.event.special.swipe.verticalDistanceThreshold = 100; // (default: 75px) – Swipe vertical displacement must be less than this.
|
$.event.special.swipe.verticalDistanceThreshold = 75; // (default: 75px) Swipe vertical displacement must be less than this.
|
||||||
});
|
$.event.special.swipe.scrollSupressionThreshold = 30;
|
||||||
|
$.event.special.swipe.durationThreshold = 500;
|
||||||
|
|
||||||
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user