Skip to content

Commit

Permalink
Merge pull request #1836 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored Dec 8, 2024
2 parents 56a9a26 + bec6e5a commit 83d84f3
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 98 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ alias=r1

. /srv/http/bash/settings/addons.sh

# 20241206
# 20241208
rm -f $dirshm/playlist*

dir=/srv/http/assets/img/guide
Expand Down
7 changes: 5 additions & 2 deletions srv/http/assets/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
#loader { z-index: 120 }
#infoOverlay,
#keyboard,
#button-data { z-index: 115 }
#data,
#degug { z-index: 110 }
.head { z-index: 95 }
.albumrefresh { z-index: 1 }

@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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion srv/http/assets/css/hovercursor.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ li:not( .licover ),
#artist,
#bar-bottom,
#bar-top i,
#button-data i,
#button-library,
#button-lib-back,
#button-lib-update,
Expand Down
37 changes: 18 additions & 19 deletions srv/http/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 }
}
Expand All @@ -2077,13 +2067,23 @@ 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% }
#coverart-block,
#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 }
Expand Down Expand Up @@ -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 }
}
Expand Down
2 changes: 1 addition & 1 deletion srv/http/assets/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ heading i.disabled {
float: right;
}
.page-icon {
float: left;
color: var( --cw ) !important;
background: var( --cm );
}
Expand Down Expand Up @@ -733,7 +734,6 @@ input.disabled + .switchlabel:after {
.wiring,
#backend,
#bar-bottom i,
#button-data,
#ffmpegfiletype,
#menu {
cursor: pointer
Expand Down
6 changes: 0 additions & 6 deletions srv/http/assets/js/addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 0 additions & 1 deletion srv/http/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ function errorDisplay( msg, list ) {
$( '#data' )
.html( error )
.removeClass( 'hide' );
$( '#button-data' ).addClass( 'hide' );
loaderHide();
}

Expand Down
1 change: 1 addition & 0 deletions srv/http/assets/js/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down
38 changes: 14 additions & 24 deletions srv/http/assets/js/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -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 => {
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 ) +'<span id="mode-title" '+ ( root ? 'class="spaced"' : '' ) +'>'+ modetitle +'</span>';
var htmlmodetitle = ico( V.mode ) +'<span id="mode-title">'+ modetitle;
if ( 'count' in data && V.mode !== 'latest' ) {
$( '#lib-path' ).css( 'max-width', 40 );
$( '#lib-list' ).css( 'width', '100%' );
Expand Down Expand Up @@ -1253,6 +1240,7 @@ function renderLibraryList( data ) { // V.librarylist
} else if ( V.mode === 'latest' ) {
htmlpath += ico( 'flash btntitle button-latest-clear' );
}
htmlpath += '</span>';
$( '#lib-title' )
.html( htmlpath )
.removeClass( 'hide' );
Expand All @@ -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( '<span class="button-coverart"><img src="'+ $( this ).attr( 'src' ) +'"></span>' );
$( '#mode-title' ).append( '<span class="button-coverart"><img src="'+ $( this ).attr( 'src' ) +'"></span>' );
} );
if ( V.iactive ) $( '#lib-list .coverart' ).eq( V.iactive ).addClass( 'active' );
} else {
Expand Down Expand Up @@ -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 );
Expand All @@ -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
}

Expand Down Expand Up @@ -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
Expand All @@ -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 ) {
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -1927,8 +1916,9 @@ function setStatusData() {
}
var html = '';
$.each( list, ( k, v ) => html += '"'+ k +'": '+ highlightJSON( v ) +'<br>' );
$( '#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() );
Expand Down
Loading

0 comments on commit 83d84f3

Please sign in to comment.