Skip to content

Commit

Permalink
Merge pull request #1792 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored Oct 25, 2024
2 parents 3f5caf6 + 8050c5a commit f9812f7
Show file tree
Hide file tree
Showing 25 changed files with 337 additions and 365 deletions.
17 changes: 0 additions & 17 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,6 @@ IgnorePkg = libunwind
' $file
fi

# 20240818
file=$dirmpd/albumbyartist
[[ -e $file && $( grep -m1 . $file | cut -c 2 ) != ^ ]] && php /srv/http/cmd.php sort albumbyartist

lsblk -no path,vendor,model | grep -v ' $' > $dirshm/lsblkusb

if [[ -e /boot/kernel.img ]]; then
file=/usr/bin/mount.ntfs3
if [[ ! -e $file ]]; then
ln -s /usr/bin/ntfs-3g $file
sed -i '/^allowed_types/ s/$/, ntfs3/' /etc/udevil/udevil.conf
fi
fi

#-------------------------------------------------------------------------------
installstart "$1"

Expand All @@ -65,6 +51,3 @@ $dirbash/cmd.sh cachebust
[[ -e $dirsystem/color ]] && $dirbash/cmd.sh color

installfinish

# 20240913
$dirsettings/player-conf.sh
5 changes: 4 additions & 1 deletion srv/http/assets/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@font-face {
font-family : rern;
src : url( '/assets/fonts/rern.woff2?v=1726553295' );
src : url( '/assets/fonts/rern.woff2?v=1729647705' );
}
@font-face {
font-family : Lato;
Expand Down Expand Up @@ -75,6 +75,7 @@ i {
.i-dabupdate::before { content: '\F589' }
.i-date::before { content: '\F55C' }
.i-devices::before { content: '\F571' }
.i-dvfs::before { content: '\F52C' }
.i-edit::before { content: '\F565' }
.i-equalizer::before { content: '\F50C' }
.i-eye::before { content: '\F567' }
Expand Down Expand Up @@ -210,6 +211,7 @@ i {
.i-system::before { content: '\F590' }
.i-tag::before { content: '\F55B' }
.i-tft::before { content: '\F577' }
.i-thermometer::before { content: '\F57D' }
.i-timezone::before { content: '\F575' }
.i-title::before { content: '\F54A' }
.i-track::before { content: '\F54C' }
Expand All @@ -222,6 +224,7 @@ i {
.i-volume::before { content: '\F516' }
.i-volume.mute::before { content: '\F517' }
.i-volumelimit::before { content: '\F51E' }
.i-voltage::before { content: '\F57E' }
.i-vuled::before { content: '\F57C' }
.i-warning::before { content: '\F562' }
.i-webradio::before { content: '\F55D' }
Expand Down
22 changes: 12 additions & 10 deletions srv/http/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,18 @@ i.map.disabled, .map.disabled i {
#menu-file {
right: 50px;
}
.biosimilar p,
.bklabel,
.coverart1,
.coverart2,
.label,
.liinfo div,
.biosimilar p,
.bklabel,
.list li *,
.scrollellipse,
.tagmessage div,
#divlyricstitle,
#lib-breadcrumbs,
.list li * {
#lyricsartist,
#lyricstitle {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
Expand Down Expand Up @@ -1089,19 +1090,20 @@ i.map.disabled, .map.disabled i {
display: inline-block;
height: 40px;
}
#lyricstitle {
#lyricstitle,
#lyricsartist {
display: inline-block;
margin-left: 10px;
width: calc( 100% - 84px );
vertical-align: 10px;
}
#lyricstitle {
margin-left: 10px;
line-height: 40px;
font-size: 26px;
font-weight: 300;
}
#lyricsartist {
display: inline-block;
max-width: calc( 100% - 40px );
padding-left: 15px;
line-height: 40px;
line-height: 42px;
font-size: 18px;
font-weight: 300;
}
Expand Down
Binary file modified srv/http/assets/fonts/rern.woff2
Binary file not shown.
17 changes: 9 additions & 8 deletions srv/http/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,8 @@ function info( json ) {
updnToggle( up );
}
function updnToggle( up ) {
var v = infoVal( 'array' );
var v = [];
$( '.updn' ).parent().prev().find( 'input' ).each( ( i, el ) => v.push( +$( el ).val() ) );
if ( el.link && typeof up === 'boolean' ) {
if ( v[ 0 ] > v[ 1 ] ) {
var vlink = up ? v[ 0 ] : v[ 1 ];
Expand Down Expand Up @@ -691,8 +692,7 @@ function infoCheckSet() {
}
function infoCheckUnique() {
var infoval = infoVal( 'array' );
var vunique = [ ... new Set( infoval ) ];
I.notunique = infoval.length !== vunique.length;
I.notunique = infoval.length !== new Set( infoval ).size;
}
function infoClearTimeout( all ) { // ok for both timeout and interval
if ( ! ( 'timeout' in V ) ) return
Expand Down Expand Up @@ -826,18 +826,19 @@ function infoListAddRemove( callback ) {
$( '#infoList td' ).eq( 2 ).html( ico( 'plus edit' ) );
$( '#infoList' ).on( 'click', '.edit', function() {
var $this = $( this );
if ( $this.hasClass( 'i-plus' ) ) {
var add = $this.hasClass( 'i-plus' );
if ( add ) {
$( '#infoList select' ).select2( 'destroy' );
var $tr = $( '#infoList tr' ).last();
$tr.after( $tr.clone() );
selectSet();
} else {
$this.parents( 'tr' ).remove();
}
infoListChange( callback );
infoListChange( callback, add );
} );
}
function infoListChange( callback ) {
function infoListChange( callback, add ) {
$input = $( '#infoList' ).find( 'input, select' );
$inputbox = $( '#infoList input' );
if ( 'checkblank' in I ) {
Expand All @@ -846,7 +847,7 @@ function infoListChange( callback ) {
}
infoCheckSet();
$( '#infoList input' ).trigger( 'input' );
if ( callback ) callback();
if ( callback ) callback( add );
}
function infoPrompt( message ) {
var $toggle = $( '#infoX, #infoTab, .infoheader, #infoList, .infofooter, .infoprompt' );
Expand Down Expand Up @@ -1279,7 +1280,7 @@ function pageInactive() {
if ( typeof onPageInactive === 'function' ) onPageInactive();
if ( typeof intervalStatus === 'function' ) intervalStatus( 'clear' );
}
document.onvisibilitychange = () => document.hidden ? pageInactive() : pageActive();
document.onvisibilitychange = () => document.visibilityState === 'hidden' ? pageInactive() : pageActive();
window.onblur = pageInactive;
window.onfocus = pageActive;
window.onpagehide = pageInactive;
Expand Down
64 changes: 28 additions & 36 deletions srv/http/assets/js/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ $( '#setting-lyrics' ).on( 'click', function() {
$( '#setting-multiraudio' ).on( 'click', function() {
var list = [
[ '', '', { suffix: 'Name', sameline: true } ]
, [ '', '', { suffix: 'IP / URL' } ]
, [ '', '', { suffix: 'IP' } ]
];
var listname = [ '', 'text', { sameline: true } ];
var listip = [ '', 'text', { suffix: ico( 'remove' ) } ];
var listip = [ '', 'text' ];
if ( S.multiraudioconf ) {
var keys = Object.keys( S.multiraudioconf ).sort();
var values = [];
Expand All @@ -254,63 +254,56 @@ $( '#setting-multiraudio' ).on( 'click', function() {
} );
var iL = values.length / 2 - 1;
} else {
list.push( listname, listip );
values = [ S.hostname, S.hostip ];
list.push( listname, listip, listname, listip );
values = [ S.hostname, S.hostip, '', S.ipsub ];
}
function checkIpList( length ) {
var list = [];
for ( i = 0; i < length; i++ ) {
if ( i % 2 ) list.push( i );
}
return list
function checkIpList( ar ) {
return [ ...Array( ar.length ).keys() ].filter( ( i, el ) => el % 2 )
}
var checkip = checkIpList( values.length );
info( {
icon : SW.icon
, title : SW.title
, list : list
, boxwidth : 160
, values : values
, checkchanged : S.multiraudio
, checkblank : true
, checkip : checkip
, checkip : checkIpList( values )
, checkunique : true
, beforeshow : () => {
$( '#infoList td:first-child' ).remove();
$( '#infoList td' ).css( { width: '180px', 'padding-right': 0, 'text-align': 'left' } );
$( '#infoList td' ).css( { width: '160px', 'text-align': 'left' } );
$( '#infoList td:last-child' ).css( 'width', '40px' );
$( '#infoList tr' ).first().append( '<td>'+ ico( 'plus' ) +'</td>' );
$( '#infoList tr:first-child td' ).css( 'padding-left', '5px' );
var htmltr = $( '#infoList tr' ).last()[ 0 ].outerHTML;
$( '#infoList input' ).each( ( i, el ) => {
infoListAddRemove( add => {
if ( add ) {
var $last = $( '#infoList input' ).slice( -2 );
$last.eq( 0 ).val( '' );
$last.eq( 1 ).val( S.ipsub );
$last.removeClass( 'disabled' );
$( '.edit' ).last().removeClass( 'hide' );
}
I.checkip = checkIpList( $( '#infoList input' ) );
} );
$( '#infoList input' ).filter( ( i, el ) => {
if ( $( el ).val() === S.hostip ) {
var $tr = $( el ).parents( 'tr' );
$tr.find( 'input' ).addClass( 'disabled' );
$tr.find( 'i' ).remove();
}
} );
var okToggle = () => {
if ( ! S.multiraudio ) $( '#infoOk' ).toggleClass( 'disabled', $( '#infoList input' ).length < 3 );
}
okToggle();
$( '#infoList' ).on( 'click', 'i', function() {
var $this = $( this );
if ( $this.hasClass( 'i-plus' ) ) {
$( '#infoList tbody' ).append( htmltr );
$( '#infoList input' ).last().val( S.ipsub );
} else {
$this.parents( 'tr' ).remove();
$tr.find( 'i' ).addClass( 'hide' );
$tr.insertAfter( $( '#infoList tr' ).first() );
return false
}
I.checkip = checkIpList( $( '#infoList input' ).length );
infoListChange( okToggle );
} );
}
, cancel : switchCancel
, ok : () => {
var infoval = infoVal();
if ( infoval.length < 3 ) {
notifyCommon( 'Disable ...' );
bash( [ 'multiraudioreset' ] );
if ( S.multiraudio ) {
notifyCommon( 'Disable ...' );
bash( [ 'multiraudioreset' ] );
} else {
$( '#infoX' ).trigger( 'click' );
}
return
}

Expand Down Expand Up @@ -501,7 +494,6 @@ function passwordWrong() {
$( '#login' ).prop( 'checked', S.login );
}
function renderPage() {
$( '#dabradio' ).toggleClass( 'disabled', ! S.dabdevice );
$( '#ap' ).toggleClass( 'disabled', S.wlanconnected );
$( '#smb' ).toggleClass( 'disabled', S.nfsserver );
if ( S.nfsconnected || S.shareddata || S.smb ) {
Expand Down
14 changes: 7 additions & 7 deletions srv/http/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -986,13 +986,11 @@ $( '#previous, #next, #coverR, #coverL' ).press( function( e ) {
} );
$( '#bio' ).on( 'click', '.biosimilar', function() {
bio( $( this ).text(), 'getsimilar' );
} );
$( '#bio' ).on( 'click', '.bioback', function() {
} ).on( 'click', '.bioback', function() {
V.bioartist.pop();
var getsimilar = V.bioartist.length > 1 ? 'getsimilar' : '';
bio( V.bioartist.pop(), getsimilar );
} );
$( '#bio' ).on( 'click', '.i-close', function() {
} ).on( 'click', '.i-close', function() {
V.bioartist = [];
$( '#bio' ).addClass( 'hide' );
if ( 'observer' in V ) V.observer.disconnect();
Expand Down Expand Up @@ -1993,26 +1991,28 @@ $( '#lyricsedit' ).on( 'click', function() {
$( '#lyricstextarea' )
.val( V.lyrics )
.scrollTop( $( '#lyricstext' ).scrollTop() );
$( '#lyricsartist' ).css( 'width', 'calc( 100% - 124px )' );
} );
$( '#lyricsrefresh' ).on( 'click', function() {
$( this ).addClass( 'blink' );
lyricsGet( 'refresh' );
} );
$( '#lyrics' ).on( 'click', '.i-close', function() {
if ( $( '#lyricstextarea' ).val() === V.lyrics || ! $( '#lyricstextarea' ).val() ) {
lyricsHide();
} else {
if ( $( '#lyricsedit' ).hasClass( 'hide' ) && $( '#lyricstextarea' ).val() !== V.lyrics ) {
info( {
icon : 'lyrics'
, title : 'Lyrics'
, message : 'Discard changes made to this lyrics?'
, ok : lyricsHide
} );
} else {
lyricsHide();
}
} );
$( '#lyricsback' ).on( 'click', function() {
$( '#lyricseditbtngroup' ).addClass( 'hide' );
$( '#lyricsedit, #lyricstext' ).removeClass( 'hide' );
$( '#lyricsartist' ).css( 'width', '' );
} );
$( '#lyricsundo' ).on( 'click', function() {
info( {
Expand Down
22 changes: 13 additions & 9 deletions srv/http/assets/js/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,20 +454,24 @@ function scanBluetooth() {
function scanWlan() {
bash( [ 'settings/networks-scan.sh', 'wlan' ], data => {
if ( data ) {
data.sort( ( a, b ) => b.signal - a.signal );
S.listwlscan = data;
var icon, signal;
var htmlwl = '';
data.forEach( list => {
if ( list.signal.slice( -3 ) === 'dBm' ) {
var dbm = parseInt( list.signal.slice( 0, -4 ) );
var signal = dbm > -60 ? '' : ( dbm < -67 ? 1 : 2 );
} else {
var dbm = '';
var signal = '';
signal = list.signal;
icon = 'wifi';
icon += signal > -60 ? '' : ( signal < -67 ? 1 : 2 );
icon = ico( icon );
if ( list.current ) {
icon += '<grn>•</grn> ';
} else if ( list.profile ) {
icon += '<gr>•</gr> ';
}
htmlwl += '<li class="wlscan" data-ssid="'+ list.ssid +'" data-encrypt="'+ list.encrypt +'" data-wpa="'+ list.wpa +'">'+ ico( 'wifi'+ signal );
htmlwl += dbm && dbm < -67 ? '<gr>'+ list.ssid +'</gr>' : list.ssid;
htmlwl += '<li class="wlscan" data-ssid="'+ list.ssid +'" data-encrypt="'+ list.encrypt +'" data-wpa="'+ list.wpa +'">'+ icon;
htmlwl += signal && signal < -67 ? '<gr>'+ list.ssid +'</gr>' : list.ssid;
if ( list.encrypt === 'on') htmlwl += ' '+ ico( 'lock' );
if ( list.signal != 0 ) htmlwl += '<gr>'+ list.signal +'</gr>';
if ( signal != 0 ) htmlwl += '<gr>'+ signal +' dBm</gr>';
htmlwl += '</li>';
} );
} else {
Expand Down
Loading

0 comments on commit f9812f7

Please sign in to comment.