diff --git a/install.sh b/install.sh index 2c86767b0..1bcd89fb5 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ alias=r1 . /srv/http/bash/settings/addons.sh -# 20241206 +# 20241208 rm -f $dirshm/playlist* dir=/srv/http/assets/img/guide diff --git a/srv/http/assets/css/common.css b/srv/http/assets/css/common.css index 1707ff202..1660e6828 100644 --- a/srv/http/assets/css/common.css +++ b/srv/http/assets/css/common.css @@ -2,7 +2,6 @@ #loader { z-index: 120 } #infoOverlay, #keyboard, -#button-data { z-index: 115 } #data, #degug { z-index: 110 } .head { z-index: 95 } @@ -10,7 +9,7 @@ @font-face { font-family : rern; - src : url( '/assets/fonts/rern.woff2?v=1733139637' ); + src : url( '/assets/fonts/rern.woff2?v=1733554181' ); } @font-face { font-family : Lato; @@ -376,7 +375,10 @@ codered { color: var( --cm ); } .head .title { + display: inline-block; margin-left: 15px; + width: calc( 100% - 135px ); + line-height: 40px; font-size: 26px; font-weight: 300; letter-spacing: 20px; @@ -415,6 +417,7 @@ code { background: linear-gradient( to right, var( --cm ) calc( 100% - 100px ), rgba( 0,0,0,0 ) 100% ); } .ellipsis, +.head .title, .infoheader, .infomessage, .infofooter, diff --git a/srv/http/assets/css/hovercursor.css b/srv/http/assets/css/hovercursor.css index 4c4afcd26..8d34b7365 100644 --- a/srv/http/assets/css/hovercursor.css +++ b/srv/http/assets/css/hovercursor.css @@ -112,7 +112,6 @@ li:not( .licover ), #artist, #bar-bottom, #bar-top i, -#button-data i, #button-library, #button-lib-back, #button-lib-update, diff --git a/srv/http/assets/css/main.css b/srv/http/assets/css/main.css index 816512ecf..87e7141a2 100644 --- a/srv/http/assets/css/main.css +++ b/srv/http/assets/css/main.css @@ -1355,6 +1355,7 @@ i.map.disabled, .map.disabled i { padding-right: 10px; } .content-top .title { + display: inline-block; margin-left: 15px; height: 40px; line-height: 40px; @@ -1377,29 +1378,29 @@ i.map.disabled, .map.disabled i { } #button-lib-update, #button-lib-search, +#button-lib-back, #button-pl-search, #button-pl-playlists { float: right; } #button-lib-back { - position: relative; - float: right; font-size: 28px; color: var( --cm ); z-index: 115; } .i-back.left { float: left !important; - margin-left: 5px; } #countsong, #countradio { margin-left: 10px; } -#lib-title { +#lib-title, +#mode-title { width: calc( 100% - 120px ); } #pl-title { + display: inline-block; width: calc( 100% - 80px ); } .lialbum, @@ -1445,9 +1446,6 @@ i.map.disabled, .map.disabled i { font-weight: 300; color: var( --cw ); } -.spaced { - letter-spacing: 4px; -} #button-pl-back { float: right; font-size: 28px !important; @@ -1656,7 +1654,7 @@ i.map.disabled, .map.disabled i { .list .single { display: inline-block; max-width: calc( 100% - 90px ); - line-height: 48px; + line-height: 48px !important; vertical-align: 5%; } .list .name { @@ -2015,11 +2013,6 @@ li.active .li2 bl { #page-playback { --scale: 0.75 } #page-playback.barsalways { --scale: 0.65 } } - @media ( max-height: 335px ) { - #bar-top, - #bar-bottom, - #page-playback { padding-top: 20px !important } - } /*----------------------------------------------------------------------------------*/ #coverart-block, #divcover { max-width: 50vh } @media ( max-height: 540px ) { @@ -2059,9 +2052,6 @@ li.active .li2 bl { #coverart-block { width: 50% } #volume-knob { margin: 20px 0 70px 0 } } - @media ( max-width: 735px ) { - .title { display: none } - } @media ( max-width: 700px ) { .liinfo { display: none } } @@ -2077,6 +2067,7 @@ li.active .li2 bl { @media ( max-width: 500px ) { #page-playback { padding-top: 60px } #playback-row { margin-top: 20px } + #debug, #time-knob { display: none } #volume-knob, #coverart-block { width: 100% } @@ -2084,6 +2075,15 @@ li.active .li2 bl { #volume-knob { width: auto } #coverart-block, #divcover { max-width: 100% } + #bar-bottom.hide { + display: block !important; + opacity: 0 !important; + } + #bar-bottom.translucent { opacity: 0.6 !important } + .wl { width: 46% } + .c1 { margin-left: 5% } + .c2 { margin-left: 27% } + .c3 { margin-left: 73% } } @media ( max-width: 480px ) { #playback-controls i { margin: 0 5px } @@ -2118,13 +2118,12 @@ li.active .li2 bl { } } @media ( max-width: 400px ) { - #button-settings { right: 10px } .content-top { padding-right: 0 } - #li-count { margin-left: 10px } + #button-settings { right: 10px } + #lib-home-title a { display: none } #pl-manage i { width: 37px } } @media ( max-width: 360px ) { - #li-count { display: none } #playback-controls i { margin: 0 3px } #pl-manage i { width: 36px } } diff --git a/srv/http/assets/css/settings.css b/srv/http/assets/css/settings.css index b957ce442..e3452135a 100644 --- a/srv/http/assets/css/settings.css +++ b/srv/http/assets/css/settings.css @@ -269,6 +269,7 @@ heading i.disabled { float: right; } .page-icon { + float: left; color: var( --cw ) !important; background: var( --cm ); } @@ -733,7 +734,6 @@ input.disabled + .switchlabel:after { .wiring, #backend, #bar-bottom i, - #button-data, #ffmpegfiletype, #menu { cursor: pointer diff --git a/srv/http/assets/js/addons.js b/srv/http/assets/js/addons.js index 0d43354da..e40313c10 100644 --- a/srv/http/assets/js/addons.js +++ b/srv/http/assets/js/addons.js @@ -3,16 +3,10 @@ var icon = 'addons'; var keys = [ 'installurl', 'postinfo', 'title', 'uninstall', 'version' ]; if ( [ 'localhost', '127.0.0.1' ].includes( location.hostname ) ) $( 'a' ).removeAttr( 'href' ); -$( '.helphead' ).off( 'click' ).on( 'click', function() { - var hidden = $( '.revisiontext' ).hasClass( 'hide' ); - $( this ).toggleClass( 'bl', hidden ); - $( '.revisiontext' ).toggleClass( 'hide', ! hidden ); -} ); $( '.container' ).on( 'click', '.revision', function() { $this = $( this ); $revisiontext = $this.parent().next(); var hidden = $revisiontext.hasClass( 'hide' ); - $( '.helphead' ).toggleClass( 'bl', hidden ); $revisiontext.toggleClass( 'hide', ! hidden ); $this.toggleClass( 'active' ); } ).on( 'click', '#list li', function() { diff --git a/srv/http/assets/js/common.js b/srv/http/assets/js/common.js index 9bd484709..c2dd47eee 100644 --- a/srv/http/assets/js/common.js +++ b/srv/http/assets/js/common.js @@ -84,7 +84,6 @@ function errorDisplay( msg, list ) { $( '#data' ) .html( error ) .removeClass( 'hide' ); - $( '#button-data' ).addClass( 'hide' ); loaderHide(); } diff --git a/srv/http/assets/js/context.js b/srv/http/assets/js/context.js index 540b8fb79..0ec1ee581 100644 --- a/srv/http/assets/js/context.js +++ b/srv/http/assets/js/context.js @@ -711,6 +711,7 @@ $( '.contextmenu a, .contextmenu .submenu' ).on( 'click', function() { _replace _replaceplay */ + if ( [ 'add', 'replace' ].includes( cmd.replace( 'play', '' ) ) ) V.playlisthtml = ''; var path = V.list.path; // mpccmd: // [ 'mpcadd', path ] diff --git a/srv/http/assets/js/function.js b/srv/http/assets/js/function.js index 9cfa1a02a..5862a3b6d 100644 --- a/srv/http/assets/js/function.js +++ b/srv/http/assets/js/function.js @@ -981,16 +981,8 @@ function playbackStatusGet( withdisplay ) { if ( V.volumeactive ) delete status.volume; // immediately change volume when pageInactive > pageActive $.each( status, ( k, v ) => { S[ k ] = v } ); // need braces V.volumecurrent = S.volume; - var dataerror = $( '#data .copy' ).length; - if ( $( '#data' ).hasClass( 'hide' ) || dataerror ) { - if ( dataerror ) { - $( '#data' ).empty(); - $( '#button-data, #data' ).addClass( 'hide' ); - } - renderPlaybackAll(); - } else { - setStatusData(); - } + renderPlaybackAll(); + if ( ! $( '#data' ).hasClass( 'hide' ) ) setStatusData(); } ); } function playlistBlink( off ) { @@ -1009,9 +1001,6 @@ function playlistGet() { if ( $( '#pl-list' ).is( ':empty' ) ) { if ( $( '#bar-top' ).hasClass( 'hide' ) ) banner( 'playlist blink', 'Playlist', 'Get ...', -1 ) - } else { - if ( ! V.playlist ) switchPage( 'playlist' ); - setPlaylistScroll(); } playlistBlink(); list( { playlist: 'current' }, data => { @@ -1135,9 +1124,7 @@ function refreshData() { } else { if ( [ 'sd', 'nas', 'usb' ].includes( V.mode ) ) return - if ( V.mode === 'album' && $( '#lib-list .coverart' ).length ) { - $( '.mode.album' ).trigger( 'click' ); - } else if ( V.query.length ) { + if ( V.query.length ) { var query = V.query.slice( -1 )[ 0 ]; list( query, function( html ) { var data = { @@ -1225,7 +1212,7 @@ function renderLibraryList( data ) { // V.librarylist var modetitle = ! root ? data.modetitle : data.modetitle .replace( 'MARTIST', 'M ARTIST' ) .replace( 'BRADIO', 'B RADIO' ); - var htmlmodetitle = ico( V.mode ) +''+ modetitle +''; + var htmlmodetitle = ico( V.mode ) +''+ modetitle; if ( 'count' in data && V.mode !== 'latest' ) { $( '#lib-path' ).css( 'max-width', 40 ); $( '#lib-list' ).css( 'width', '100%' ); @@ -1253,6 +1240,7 @@ function renderLibraryList( data ) { // V.librarylist } else if ( V.mode === 'latest' ) { htmlpath += ico( 'flash btntitle button-latest-clear' ); } + htmlpath += ''; $( '#lib-title' ) .html( htmlpath ) .removeClass( 'hide' ); @@ -1274,7 +1262,7 @@ function renderLibraryList( data ) { // V.librarylist if ( V.mode === 'album' ) { // V.albumlist V.albumlist = true; if ( ! $( '.licover' ).length ) $( '#lib-list img' ).eq( 0 ).on( 'load', function() { - $( '#lib-title' ).append( '' ); + $( '#mode-title' ).append( '' ); } ); if ( V.iactive ) $( '#lib-list .coverart' ).eq( V.iactive ).addClass( 'active' ); } else { @@ -1369,6 +1357,7 @@ function renderPlaylist( data ) { // V.playlisthome - current playlist V.playlisthome = true; V.playlistlist = false; V.playlisttrack = false; + if ( ! V.playlist ) switchPage( 'playlist' ); $( '#button-pl-back' ).addClass( 'hide' ); $( '#pl-search-close' ).trigger( 'click' ); $( '#button-pl-playlists' ).toggleClass( 'disabled', C.playlists === 0 ); @@ -1388,7 +1377,6 @@ function renderPlaylist( data ) { // V.playlisthome - current playlist $( '#pl-list' ).empty(); $( '.playlist, #page-playlist .emptyadd' ).removeClass( 'hide' ); pageScroll( 0 ); - switchPage( 'playlist' ); return } @@ -1774,8 +1762,9 @@ function setPlaylistInfoWidth() { $title.css( 'max-width', iWdW + titleW < cW ? '' : cW - iWdW ); } function setPlaylistScroll() { + if ( ! V.playlist || ! V.playlisthome ) return + intervalClear(); - switchPage( 'playlist' ); if ( V.sortable || [ 'airplay', 'spotify' ].includes( S.player ) || ( D.audiocd && $( '#pl-list li' ).length < S.song + 1 ) // on eject cd S.song not yet refreshed @@ -1786,7 +1775,7 @@ function setPlaylistScroll() { var litop = barVisible( 80, 40 ); $( '#menu-plaction' ).addClass( 'hide' ); $( '#pl-list li' ).removeClass( 'active updn' ); - $liactive = $( '#pl-list li' ).eq( S.song || 0 ); + $liactive = $( '#pl-list li' ).eq( S.song ); $liactive.addClass( 'active' ); if ( ! $( '.pl-remove' ).length && ! I.active ) { if ( $( '#pl-list li' ).length < 5 ) { @@ -1833,7 +1822,7 @@ function setPlaylistScroll() { intervalClear(); S.elapsed = 0; $elapsed.empty(); - setPlaylistScroll(); + if ( V.playlist && V.playlisthome ) setPlaylistScroll(); } else { elapsedtxt = second2HMS( S.elapsed ); $elapsed.html( ico( 'play' ) + elapsedtxt + slash ); @@ -1927,8 +1916,9 @@ function setStatusData() { } var html = ''; $.each( list, ( k, v ) => html += '"'+ k +'": '+ highlightJSON( v ) +'
' ); - $( '#data' ).html( html ); - $( '#button-data, #data' ).removeClass( 'hide' ); + $( '#data' ) + .html( html ) + .removeClass( 'hide' ); } function setTrackCoverart() { if ( V.mode === 'album' ) $( '#mode-title' ).html( $( '.liinfo .lialbum' ).text() ); diff --git a/srv/http/assets/js/main.js b/srv/http/assets/js/main.js index c74744af4..fc9110eff 100644 --- a/srv/http/assets/js/main.js +++ b/srv/http/assets/js/main.js @@ -169,10 +169,7 @@ $( '#logo, #refresh' ).on( 'click', function() { $( '#debug' ).on( 'click', function() { if ( V.press ) return - $( '#data' ).hasClass( 'hide' ) ? setStatusData() : $( '#button-data, #data' ).addClass( 'hide' ); -} ); -$( '#button-data' ).on( 'click', function() { - $( '#button-data, #data' ).addClass( 'hide' ); + $( '#data' ).hasClass( 'hide' ) ? setStatusData() : $( '#data' ).addClass( 'hide' ); } ); $( '#button-settings' ).on( 'click', function( e ) { e.stopPropagation(); @@ -460,7 +457,7 @@ $( 'body' ).on( 'click', '#colorok', function() { V.colorpicker = false; V.colorelements.removeAttr( 'style' ); V.colorelements = ''; - if ( V.playlist && V.playlisthome ) setPlaylistScroll(); + setPlaylistScroll(); if ( S.player !== 'mpd' ) switchPage( 'playback' ); } ); $( '#library, #button-library' ).on( 'click', function() { @@ -489,8 +486,6 @@ $( '#playlist, #button-playlist' ).on( 'click', function() { } else { V.playlisthome ? playlistGet() : switchPage( 'playlist' ); } -} ).press( function() { - bash( [ 'plcacheremove' ] ); } ); $( '#bar-top' ).on( 'click', function( e ) { if ( e.target.id !== 'button-settings' ) $( '#settings' ).addClass( 'hide ' ); @@ -1106,7 +1101,7 @@ $( '#button-lib-update' ).on( 'click', function() { } ); $( '#button-lib-search' ).on( 'click', function() { if ( $( '#lib-search' ).hasClass( 'hide' ) ) { - $( '#lib-path span, #button-lib-back, #button-lib-update' ).addClass( 'hide' ); + $( '#page-library .content-top .title, #lib-path span, #button-lib-back, #button-lib-update' ).addClass( 'hide' ); $( '#page-library .search:not( i )' ).removeClass( 'hide' ); $( '#lib-search-close' ).empty(); $( '#lib-path' ).css( 'max-width', 40 ); @@ -1168,11 +1163,8 @@ $( '#lib-search-close' ).on( 'click', function( e ) { e.stopPropagation(); V.searchlist = false; $( '#search-list' ).remove(); - if ( V.libraryhome ) { - $( '#lib-mode-list' ).removeClass( 'hide' ); - } else { - $( '#button-lib-back, #lib-list, #page-library .index' ).removeClass( 'hide' ); - } + $( '#page-library .content-top .title' ).removeClass( 'hide' ); + if ( ! V.libraryhome ) $( '#button-lib-back, #lib-list, #page-library .index' ).removeClass( 'hide' ); $( '#page-library .search' ).addClass( 'hide' ); $( '#lib-search-close' ).empty(); $( '#lib-search-input' ).val( '' ); @@ -1733,9 +1725,9 @@ $( '#button-pl-clear' ).on( 'click', function() { case 'crop': bash( [ 'mpccrop' ] ); $( '#pl-list li:not( .active )' ).remove(); + $( '#infoX' ).trigger( 'click' ); break; } - $( '#infoX' ).trigger( 'click' ); } ); } , ok : () => { diff --git a/srv/http/assets/js/passive.js b/srv/http/assets/js/passive.js index a280ef251..cd1f6b5b2 100644 --- a/srv/http/assets/js/passive.js +++ b/srv/http/assets/js/passive.js @@ -191,7 +191,7 @@ ps = { setProgress( 0 ); setBlinkDot(); } - if ( V.playlist ) setPlaylistScroll(); + setPlaylistScroll(); } , mpdUpdate : data => { if ( 'counts' in data ) { diff --git a/srv/http/assets/js/settings.js b/srv/http/assets/js/settings.js index ef5a3c686..c20c6fa46 100644 --- a/srv/http/assets/js/settings.js +++ b/srv/http/assets/js/settings.js @@ -123,16 +123,11 @@ function refreshData() { } bash( page +'-data.sh', data => { - if ( ! list2JSON( data ) ) return // on load, try catching any errors - - if ( $( '#data' ).hasClass( 'hide' ) || $( '#data .infobtn' ).length ) { - $( '#data' ).empty(); - $( '#button-data, #data' ).addClass( 'hide' ); + // on load, try catching any errors + if ( list2JSON( data ) ) { switchSet(); renderPage(); - } else { - $( '#data' ).html( highlightJSON( S ) ); - $( '#button-data, #data' ).removeClass( 'hide' ); + if ( ! $( '#data' ).hasClass( 'hide' ) ) $( '#data' ).html( highlightJSON( S ) ) } } ); } @@ -362,7 +357,7 @@ $( document ).on( 'keydown', function( e ) { } else if ( V.select2 ) { $( '.select2-hidden-accessible' ).select2( 'close' ); } else if ( ! $( '#data' ).hasClass( 'hide' ) ) { - $( '#button-data' ).trigger( 'click' ); + $( '.page-icon' ).trigger( 'click' ); } else if ( $( '#bar-bottom div:focus' ).length ) { $( '#fader' ).addClass( 'hide' ); $( '#bar-bottom div' ).removeAttr( 'tabindex' ); @@ -388,7 +383,7 @@ $( document ).on( 'keydown', function( e ) { case 'x': if ( ! e.ctrlKey ) return - var close = $( '#data' ).hasClass( 'hide' ) ? '#close' : '#button-data .i-close'; + var close = $( '#data' ).hasClass( 'hide' ) ? '#close' : '.page-icon'; $( close ).trigger( 'click' ); break case 'MediaPause': @@ -401,13 +396,13 @@ $( document ).on( 'keydown', function( e ) { $( '.page-icon' ).on( 'click', function() { if ( $.isEmptyObject( S ) ) return - $( '#data' ).html( highlightJSON( S ) ) - $( '#button-data, #data' ).removeClass( 'hide' ); -} ); -$( '#button-data' ).on( 'click', function() { - switchSet(); - renderPage(); - $( '#button-data, #data' ).addClass( 'hide' ); + if ( $( '#data' ).hasClass( 'hide' ) ) { + $( '#data' ) + .html( highlightJSON( S ) ) + .removeClass( 'hide' ); + } else { + $( '#data' ).addClass( 'hide' ); + } } ); $( '.container' ).on( 'click', '.status .headtitle, .col-l.status', function() { var $this = $( this ); diff --git a/srv/http/bash/cmd.sh b/srv/http/bash/cmd.sh index 1fbf1521e..4412b582f 100644 --- a/srv/http/bash/cmd.sh +++ b/srv/http/bash/cmd.sh @@ -613,7 +613,6 @@ mpcremove ) for (( i=$TO; i >= $POS; i-- )); do mpc -q del $i done - pushPlaylist else if [[ $songpos == $POS ]]; then [[ $pllength == $POS ]] && next=$(( POS -1 )) || next=$POS @@ -623,8 +622,8 @@ mpcremove ) mpc -q play $next mpc -q stop fi - pushPlaylist fi + pushPlaylist ;; mpcseek ) if [[ $STATE == stop ]]; then @@ -737,9 +736,6 @@ order ) pladdrandom ) plAddRandom ;; -plcacheremove ) - rm -f $dirshm/playlist* - ;; playerstart ) playerStart ;; diff --git a/srv/http/common.php b/srv/http/common.php index a6d7e217d..d61f6dc26 100644 --- a/srv/http/common.php +++ b/srv/http/common.php @@ -18,7 +18,7 @@ $pages = [ 'features', 'player', 'networks', 'system', 'addons', 'addonsprogress', 'camilla', 'guide' ]; foreach( $pages as $p ) $$p = false; $$page = true; -$hash = '?v=1733402613'; +$hash = '?v='.time(); $css = [ 'colors', 'common' ]; $logosvg = file_get_contents( '/srv/http/assets/img/icon.svg' ); $filelogin = '/srv/http/data/system/login'; @@ -103,7 +103,7 @@
'.$logosvg.'
-
'.$pageicon.i( 'close' ).''.$title.'-DATA
+
'.i( 'close' ).''.$title.'

 ';
 }
diff --git a/srv/http/settings.php b/srv/http/settings.php
index 8f7c249ac..641fec151 100644
--- a/srv/http/settings.php
+++ b/srv/http/settings.php
@@ -1,7 +1,13 @@
 '.i( $icon.' page-icon' ).''.$title.'
 '.i( 'close close', 'close' ).$iconhead.'
diff --git a/srv/http/settings/addonsprogress.php b/srv/http/settings/addonsprogress.php
index 94aad089a..1111d1a38 100644
--- a/srv/http/settings/addonsprogress.php
+++ b/srv/http/settings/addonsprogress.php
@@ -56,7 +56,7 @@
 
-
+
OK
@@ -69,7 +69,7 @@ //if ( window.history.replaceState ) window.history.replaceState( null, null, '' ); // on refresh page document.title = 'Addons'; E = {}; -[ 'close', 'container', 'info', 'infobtn', 'infomessage', 'infox', 'progress', 'titleicon' ].forEach( ( el ) => { +[ 'close', 'container', 'info', 'infobtn', 'infomessage', 'progress', 'titleicon' ].forEach( ( el ) => { E[ el ] = document.getElementsByClassName( el )[ 0 ]; } ); E.container.classList.remove( 'hide' ); @@ -84,7 +84,7 @@ fetch( 'cmd.php', { method: 'POST', body: formdata } ); } } ); -[ E.infobtn, E.infox ].forEach( el => el.addEventListener( 'click', () => E.info.remove() ) ); +E.infobtn.addEventListener( 'click', () => E.info.remove() ); scroll = setInterval( () => E.progress.scrollTop = E.progress.scrollHeight, 500 ); document.body.addEventListener( 'keydown', e => { switch( e.key ) {