docs:Reformat section headers, remove old commented-out code sections.
This commit is contained in:
parent
19aa4e3cf1
commit
02112b8d61
68
mopidy_musicbox_webclient/static/js/controls.js
vendored
68
mopidy_musicbox_webclient/static/js/controls.js
vendored
@ -1,6 +1,6 @@
|
|||||||
/********************************************************
|
/***********************************
|
||||||
* play tracks from a browse list
|
* play tracks from a browse list *
|
||||||
*********************************************************/
|
***********************************/
|
||||||
function playBrowsedTracks(action, trackIndex) {
|
function playBrowsedTracks(action, trackIndex) {
|
||||||
$('#popupBrowse').popup('close');
|
$('#popupBrowse').popup('close');
|
||||||
toast('Loading...');
|
toast('Loading...');
|
||||||
@ -54,10 +54,9 @@ function playBrowsedTracks(action, trackIndex) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************
|
||||||
/********************************************************
|
* play an uri from a tracklist *
|
||||||
* play an uri from a tracklist
|
*********************************/
|
||||||
*********************************************************/
|
|
||||||
function playTrack(action) {
|
function playTrack(action) {
|
||||||
var hash = document.location.hash.split('?');
|
var hash = document.location.hash.split('?');
|
||||||
var divid = hash[0].substr(1);
|
var divid = hash[0].substr(1);
|
||||||
@ -165,7 +164,6 @@ function playTrackByUri(track_uri, playlist_uri) {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function playTrackQueueByTlid(uri, tlid) {
|
function playTrackQueueByTlid(uri, tlid) {
|
||||||
// console.log('playquuri');
|
|
||||||
//stop directly, for user feedback
|
//stop directly, for user feedback
|
||||||
mopidy.playback.stop();
|
mopidy.playback.stop();
|
||||||
$('#popupQueue').popup('close');
|
$('#popupQueue').popup('close');
|
||||||
@ -191,15 +189,14 @@ function playTrackQueueByTlid(uri, tlid) {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function playTrackQueue() {
|
function playTrackQueue() {
|
||||||
// console.log('playqu');
|
|
||||||
uri = $('#popupQueue').data("track");
|
uri = $('#popupQueue').data("track");
|
||||||
tlid = $('#popupQueue').data("tlid");
|
tlid = $('#popupQueue').data("tlid");
|
||||||
return playTrackQueueByTlid(uri, tlid);
|
return playTrackQueueByTlid(uri, tlid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************
|
/***********************************
|
||||||
* remove a track from the queue
|
* remove a track from the queue *
|
||||||
*********************************************************/
|
***********************************/
|
||||||
function removeTrack() {
|
function removeTrack() {
|
||||||
$('#popupQueue').popup('close');
|
$('#popupQueue').popup('close');
|
||||||
toast('Deleting...');
|
toast('Deleting...');
|
||||||
@ -241,15 +238,14 @@ function saveQueue() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function refreshPlaylists() {
|
function refreshPlaylists() {
|
||||||
mopidy.playlists.refresh();
|
mopidy.playlists.refresh();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/*************
|
||||||
* Buttons
|
* Buttons *
|
||||||
*/
|
*************/
|
||||||
|
|
||||||
function doShuffle() {
|
function doShuffle() {
|
||||||
mopidy.playback.stop();
|
mopidy.playback.stop();
|
||||||
@ -303,10 +299,9 @@ function backbt() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************
|
/*************
|
||||||
* Options
|
* Options *
|
||||||
***************/
|
*************/
|
||||||
|
|
||||||
function setTracklistOption(name, new_value) {
|
function setTracklistOption(name, new_value) {
|
||||||
if (!new_value) {
|
if (!new_value) {
|
||||||
$("#"+name+"bt").attr('style', 'color:#2489ce');
|
$("#"+name+"bt").attr('style', 'color:#2489ce');
|
||||||
@ -357,11 +352,10 @@ function doSingle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*********************
|
/***********************************************
|
||||||
* Track Slider
|
* Track Slider *
|
||||||
* Use a timer to prevent looping of commands
|
* Use a timer to prevent looping of commands *
|
||||||
*********************/
|
***********************************************/
|
||||||
|
|
||||||
function doSeekPos(value) {
|
function doSeekPos(value) {
|
||||||
var val = $("#trackslider").val();
|
var val = $("#trackslider").val();
|
||||||
newposition = Math.round(val);
|
newposition = Math.round(val);
|
||||||
@ -377,10 +371,7 @@ function doSeekPos(value) {
|
|||||||
function triggerPos() {
|
function triggerPos() {
|
||||||
if (mopidy) {
|
if (mopidy) {
|
||||||
posChanging = true;
|
posChanging = true;
|
||||||
// mopidy.playback.pause();
|
|
||||||
// console.log(newposition);
|
|
||||||
mopidy.playback.seek(newposition);
|
mopidy.playback.seek(newposition);
|
||||||
// mopidy.playback.resume();
|
|
||||||
resumePosTimer();
|
resumePosTimer();
|
||||||
posChanging = false;
|
posChanging = false;
|
||||||
}
|
}
|
||||||
@ -402,10 +393,10 @@ function setPosition(pos) {
|
|||||||
$("#songelapsed").html(timeFromSeconds(currentposition / 1000));
|
$("#songelapsed").html(timeFromSeconds(currentposition / 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************
|
/***********************************************
|
||||||
* Volume slider
|
* Volume slider *
|
||||||
* Use a timer to prevent looping of commands
|
* Use a timer to prevent looping of commands *
|
||||||
*/
|
***********************************************/
|
||||||
|
|
||||||
function setVolume(value) {
|
function setVolume(value) {
|
||||||
if ($("#volumeslider").val() != value) {
|
if ($("#volumeslider").val() != value) {
|
||||||
@ -439,15 +430,14 @@ function doMute() {
|
|||||||
mopidy.mixer.setMute(!mute);
|
mopidy.mixer.setMute(!mute);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******
|
/**************************
|
||||||
* Track position timer
|
* Track position timer *
|
||||||
*/
|
**************************/
|
||||||
|
|
||||||
//timer function to update interface
|
//timer function to update interface
|
||||||
function updatePosTimer() {
|
function updatePosTimer() {
|
||||||
currentposition += TRACK_TIMER;
|
currentposition += TRACK_TIMER;
|
||||||
setPosition(currentposition);
|
setPosition(currentposition);
|
||||||
// $("#songelapsed").html(timeFromSeconds(currentposition / 1000));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resumePosTimer() {
|
function resumePosTimer() {
|
||||||
@ -467,9 +457,9 @@ function pausePosTimer() {
|
|||||||
clearInterval(posTimer);
|
clearInterval(posTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************
|
/************
|
||||||
* Stream
|
* Stream *
|
||||||
*********************************/
|
************/
|
||||||
function streamPressed(key) {
|
function streamPressed(key) {
|
||||||
if (key == 13) {
|
if (key == 13) {
|
||||||
playStreamUri();
|
playStreamUri();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user