diff --git a/platypush/backend/http/static/js/music.mpd.js b/platypush/backend/http/static/js/music.mpd.js
deleted file mode 100644
index 81e4877f..00000000
--- a/platypush/backend/http/static/js/music.mpd.js
+++ /dev/null
@@ -1,868 +0,0 @@
-$(document).ready(function() {
- var seekInterval,
- longPressTimeout,
- curPath = [],
- curTrackUpdateHandler,
- curTrackElapsed = {
- timestamp: undefined,
- elapsed: undefined,
- },
-
- $musicSearchForm = $('#music-search-form'),
- $musicSearchResults = $('#music-search-results'),
- $musicSearchResultsContainer = $('#music-search-results-container'),
- $musicSearchResultsForm = $('#music-search-results-form'),
- $musicResultsAddBtn = $('#music-results-add'),
- $musicResultsPlayBtn = $('#music-results-play'),
- $resetSearchBtn = $('#music-search-reset');
- $doSearchBtns = $('.do-search-btns');
-
- var formatMinutes = function(time) {
- if (typeof time === 'string') {
- time = parseInt(time);
- } else if (isNaN(time)) {
- console.warn('Unexpected non-numeric value in formatMinutes');
- console.log(time);
- return undefined;
- }
-
- if (!time) {
- return '-:--';
- }
-
- var minutes = parseInt(time/60);
- var seconds = time%60;
- return (minutes < 10 ? '0' : '') + minutes + ':' + (seconds < 10 ? '0' : '') + seconds;
- };
-
- var updateControls = function(status, track) {
- var $playbackControls = $('.playback-controls');
- var $playlistContent = $('#playlist-content');
- var $curTrack = $('.track-info');
- var $volumeCtrl = $('#volume-ctrl');
- var $trackSeeker = $('#track-seeker');
- var $randomBtn = $playbackControls.find('[data-action=random]');
- var $repeatBtn = $playbackControls.find('[data-action=repeat]');
- var elapsed; var length;
-
- var timeToStr = (time) => {
- if (typeof time === 'string') {
- return time;
- }
-
- return parseInt(parseInt(time)/60) + ':'
- + (parseInt(time)%60 < 10 ? '0' : '') + (parseInt(time)%60);
- };
-
- if (status) {
- if ('position' in status) {
- elapsed = parseInt(status.position);
- $trackSeeker.val(elapsed);
- }
-
- if ('time' in status) {
- if (seekInterval) {
- clearInterval(seekInterval);
- seekInterval = undefined;
- }
-
- if (typeof status.time === 'string' && status.time.indexOf(':') > -1) {
- // backend.music.mpd time format: "elapsed:total"
- [elapsed, length] = status.time.split(':');
- elapsed = parseInt(elapsed);
- length = parseInt(length);
- } else {
- // backend.music.mopidy time format: integer with elapsed seconds
- length = parseInt(status.time);
- }
- }
-
- if (elapsed !== undefined) {
- $trackSeeker.val(elapsed);
- curTrackElapsed = {
- 'timestamp': new Date().getTime(),
- 'elapsed': elapsed,
- };
- }
-
- if (length !== undefined) {
- $trackSeeker.attr('max', length);
- }
-
- if ('state' in status) {
- switch (status.state.toLowerCase()) {
- case 'stop':
- $playbackControls.find('button[data-action=pause]').hide();
- $playbackControls.find('button[data-action=play]').show();
- $curTrack.find('.artist').hide();
- $curTrack.find('.track').hide();
- $curTrack.find('.no-track').show();
-
- $trackSeeker.prop('disabled', true);
- if (seekInterval) {
- clearInterval(seekInterval);
- seekInterval = undefined;
- }
-
- $('.seek-time').text('-:--');
- break;
-
- case 'pause':
- $playbackControls.find('button[data-action=pause]').hide();
- $playbackControls.find('button[data-action=play]').show();
- $curTrack.find('.artist').show();
- $curTrack.find('.track').show();
- $curTrack.find('.no-track').hide();
-
- $trackSeeker.prop('disabled', false);
- $('#seek-time-elapsed').text(elapsed ? timeToStr(elapsed) : '-:--');
- $('#seek-time-length').text(length ? timeToStr(length) : '-:--');
- break;
-
- case 'play':
- $playbackControls.find('button[data-action=pause]').show();
- $playbackControls.find('button[data-action=play]').hide();
- $curTrack.find('.artist').show();
- $curTrack.find('.track').show();
- $curTrack.find('.no-track').hide();
-
- $trackSeeker.prop('disabled', false);
- $('#seek-time-elapsed').text(elapsed ? timeToStr(elapsed) : '-:--');
- $('#seek-time-length').text(length ? timeToStr(length) : '-:--');
-
- seekInterval = setInterval(function() {
- if (curTrackElapsed.elapsed === undefined) {
- return;
- }
-
- var length = parseInt($trackSeeker.attr('max'));
- var value = parseInt((new Date().getTime() - curTrackElapsed.timestamp)/1000)
- + curTrackElapsed.elapsed;
-
- if (value < length) {
- $trackSeeker.val(value);
- elapsed = value;
- $('#seek-time-elapsed').text(timeToStr(elapsed));
- }
- }, 1000);
- break;
- }
- }
-
- if ('volume' in status) {
- $volumeCtrl.val(parseInt(status.volume));
- }
-
- if ('repeat' in status) {
- var repeat = parseInt(status.repeat);
- if (repeat) {
- $repeatBtn.addClass('enabled');
- } else {
- $repeatBtn.removeClass('enabled');
- }
- }
-
- if ('random' in status) {
- var random = parseInt(status.random);
- if (random) {
- $randomBtn.addClass('enabled');
- } else {
- $randomBtn.removeClass('enabled');
- }
- }
- }
-
- if (track) {
- $curTrack.find('.artist').text(track.artist);
- $curTrack.find('.track').text(track.title);
-
- var updatePlayingTrack = function(track) {
- return function() {
- var $curTrack = $playlistContent.find('.playlist-track').filter(
- function() { return $(this).data('file') === track.file });
-
- if ($curTrack.length === 0) {
- return;
- }
-
- var offset = $curTrack.offset().top
- - $playlistContent.offset().top
- + $playlistContent.scrollTop() - 10;
-
- $playlistContent.find('.playlist-track').removeClass('active');
- $curTrack.addClass('active');
- $playlistContent.animate({ scrollTop: offset }, 500)
- };
- };
-
- if ($playlistContent.find('.playlist-track').length === 0) {
- // Playlist viewer hasn't loaded yet
- curTrackUpdateHandler = updatePlayingTrack(track);
- } else {
- updatePlayingTrack(track)();
- }
- }
- };
-
- var onEvent = function(event) {
- switch (event.args.type) {
- case 'platypush.message.event.music.NewPlayingTrackEvent':
- createNotification({
- 'icon': 'play',
- 'html': '' + ('artist' in event.args.track ? event.args.track.artist : '')
- + '
'
- + ('title' in event.args.track ? event.args.track.title : '[No name]'),
- });
-
- case 'platypush.message.event.music.MusicStopEvent':
- case 'platypush.message.event.music.MusicPlayEvent':
- case 'platypush.message.event.music.MusicPauseEvent':
- case 'platypush.message.event.music.SeekChangeEvent':
- updateControls(status=event.args.status, track=event.args.track);
- break;
-
- case 'platypush.message.event.music.PlaylistChangeEvent':
- updatePlaylist(tracks=event.args.changes);
- break;
- }
- };
-
- var initStatus = function() {
- execute(
- {
- type: 'request',
- action: 'music.mpd.status',
- },
-
- onSuccess = function(response) {
- updateControls(status=response.response.output);
- }
- );
-
- execute(
- {
- type: 'request',
- action: 'music.mpd.currentsong',
- },
-
- onSuccess = function(response) {
- updateControls(status=undefined, track=response.response.output);
- }
- );
- };
-
- var onPlaylistTrackClick = function(event) {
- var $track = $(this);
-
- if (!$track.hasClass('selected')) {
- $('.playlist-track').removeClass('selected');
- $track.addClass('selected');
- } else {
- execute({
- type: 'request',
- action: 'music.mpd.playid',
- args: { track_id: $track.data('track-id') }
- });
- }
-
- if (longPressTimeout) {
- clearTimeout(longPressTimeout);
- longPressTimeout = undefined;
- }
- };
-
- var updatePlaylist = function(tracks) {
- if (tracks == null) {
- initPlaylist();
- return;
- }
-
- var $playlistContent = $('#playlist-content');
- $playlistContent.find('.playlist-track').remove();
-
- for (var track of tracks) {
- var $element = $('