Skip to content

Commit

Permalink
Merge pull request #1527 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored Dec 9, 2023
2 parents 3f3605f + 90ca06f commit 25519cb
Show file tree
Hide file tree
Showing 41 changed files with 644 additions and 509 deletions.
40 changes: 8 additions & 32 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ alias=r1

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

# 202312010
file=$dirsystem/display.json
for k in albumyear composername conductorname; do
! grep -q $k $file && sed -i '/"artist"/ i\ "'$k'": false,' $file
done

[[ ! -e /usr/bin/websocat ]] && pacman -Sy --noconfirm websocat

# 20231125
grep -q connect $dirbash/websocket-server.py && websocketrestart=1

Expand Down Expand Up @@ -74,38 +82,6 @@ runxinitrcd=
' $file
fi

# 20231001
if [[ -e /usr/bin/upmpdcli ]]; then
! pacman -Q python-upnpp &> /dev/null && pacman -Sy --noconfirm python-upnpp
if grep -q ownqueue /etc/upmpdcli.conf; then
sed -i -e '/^ownqueue/ d
' -e 's|^onstart.*|onstart = /usr/bin/sudo /srv/http/bash/cmd.sh upnpstart|
' /etc/upmpdcli.conf
systemctl try-restart upmpdcli
fi
fi

file=$dirsystem/display.json
if ! grep -q plclear $file; then
grep 'tapreplaceplay.*true' $file && plclear=false || plclear=true
sed -i '1 a\
"plclear": '$plclear',\
"plsimilar": true,\
"audiocdplclear": false,
' $file
fi

file=$dirsystem/localbrowser.conf
if [[ ! -e /boot/kernel.img && ! -e $file ]]; then
echo "\
rotate=0
zoom=100
screenoff=0
onwhileplay=
cursor=
runxinitrcd" > $file
fi

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

Expand Down
4 changes: 2 additions & 2 deletions 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=1700315400' );
src : url( '/assets/fonts/rern.woff2?v=1701344782' );
}
@font-face {
font-family : Lato;
Expand Down Expand Up @@ -217,10 +217,10 @@ i {
.i-upmpdcli::before { content: '\F581' }
.i-upnp::before { content: '\F581' }
.i-usb::before { content: '\F553' }
.i-usbautoupdate::before { content: '\F536' }
.i-usbdrive::before { content: '\F553' }
.i-volume::before { content: '\F516' }
.i-volume.mute::before { content: '\F517' }
.i-volumeboot::before { content: '\F51E' }
.i-vuled::before { content: '\F57C' }
.i-warning::before { content: '\F562' }
.i-webradio::before { content: '\F55D' }
Expand Down
Binary file modified srv/http/assets/fonts/rern.woff2
Binary file not shown.
18 changes: 9 additions & 9 deletions srv/http/assets/js/camilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,13 +949,13 @@ var setting = {
$( '#infoContent tr' ).eq( 0 ).before( $tdname.parent() );
var $select = $( '#infoContent select' );
var $selecttype = $select.eq( 0 );
$selecttype.on( 'change', function() {
$selecttype.on( 'input', function() {
var type = $( this ).val();
var subtype = type in C.subtype ? C.subtype[ type ][ 0 ] : '';
setting.filter( type, subtype, '', infoVal().name );
} );
if ( $select.length > 1 ) {
$select.eq( 1 ).on( 'change', function() {
$select.eq( 1 ).on( 'input', function() {
var type = $selecttype.val();
var subtype = $( this ).val();
setting.filter( type, subtype, '', infoVal().name );
Expand All @@ -966,7 +966,7 @@ var setting = {
var itr = $tr.index()
var $label = $tr.find( 'td' ).eq( 0 );
var $radio = $( '#infoContent input:radio' );
$radio.on( 'change', function() {
$radio.on( 'input', function() {
var val = $( this ).filter( ':checked' ).val();
I.keys[ itr ] = val.toLowerCase();
$label.text( val );
Expand Down Expand Up @@ -1264,7 +1264,7 @@ var setting = {
$( '#infoContent input[type=number]' ).css( 'width', '70px' );
$( '#infoContent td:first-child' ).css( 'width', '128px' );
var $select = $( '#infoContent select' );
$select.eq( 0 ).on( 'change', function() {
$select.eq( 0 ).on( 'input', function() {
setting.device( dev, $( this ).val() );
} );
}
Expand Down Expand Up @@ -1297,7 +1297,7 @@ var setting = {
$( '.trselect' ).after( $( 'tr' ).last() );
var $trother = $( '.trtext' ).eq( 0 );
$trother.toggleClass( 'hide', values.samplerate !== 'Other' );
$( '.trselect select' ).on( 'change', function() {
$( '.trselect select' ).on( 'input', function() {
setting.hidetrinfo( $trother, $( this ).val() );
} );
}
Expand Down Expand Up @@ -1356,14 +1356,14 @@ var setting = {
var indextr = freeasync ? [ 2, 1, 0 ] : [ 0 ]
indextr.forEach( i => $( '.trselect' ).eq( 1 ).after( $trnumber.eq( i ) ) );
$trother.toggleClass( 'hide', values.capture_samplerate !== 'Other' );
$( '.trselect select' ).eq( 0 ).on( 'change', function() {
$( '.trselect select' ).eq( 0 ).on( 'input', function() {
if ( $( this ).val() === 'FreeAsync' ) {
setting.resampling( 'freeasync' );
} else if ( $trnumber.length > 1 ) {
setting.resampling();
}
} );
$( '.trselect select' ).eq( 1 ).on( 'change', function() {
$( '.trselect select' ).eq( 1 ).on( 'input', function() {
setting.hidetrinfo( $trother, $( this ).val() );
} );
}
Expand Down Expand Up @@ -1797,7 +1797,7 @@ $( '#divstate' ).on( 'click', '.clipped', function() {
bash( [ 'clippedreset', S.clipped, 'CMD CLIPPED' ] );
render.status();
} );
$( '#configuration' ).on( 'change', function() {
$( '#configuration' ).on( 'input', function() {
if ( V.local ) return

var name = $( this ).val();
Expand Down Expand Up @@ -2149,7 +2149,7 @@ $( '#mixers' ).on( 'click', 'li', function( e ) {
}
setting.save( 'Mixer', 'Change ...' );
}
} ).on( 'change', 'select', function() {
} ).on( 'input', 'select', function() {
var $this = $( this );
V.li = $this.parents( 'li' );
var name = V.li.data( 'name' );
Expand Down
40 changes: 22 additions & 18 deletions srv/http/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ V.consolelog - press: $( '#infoOk' ) / $( '.switch' )
console.log( data );
console.log( bashcmd );
if ( V.consoleonly ) {
V.consoleonly = false;
setTimeout( () => page ? switchCancel() : bannerHide(), 5000 );
return
}
Expand All @@ -122,6 +123,7 @@ V.consolelog - press: $( '#infoOk' ) / $( '.switch' )
);
}
// debug
$( '.page-icon' ).press( () => location.reload() );
$( '#debug' ).press( function() {
V.debug = true;
banner( 'gear', 'Debug', 'Console.log + Push status', 5000 );
Expand Down Expand Up @@ -247,13 +249,15 @@ select: [U] [D] - check
if ( ! $( '#infoOk' ).hasClass( 'disabled' ) && ! $( 'textarea' ).is( ':focus' ) ) $( '#infoOk' ).trigger( 'click' );
break;
case 'Escape':
local(); // prevent toggle setting menu
$( '#infoX' ).trigger( 'click' );
if ( I.active ) {
$( '#infoX' ).trigger( 'click' );
local(); // prevent toggle setting menu
}
break;
case 'ArrowLeft':
case 'ArrowRight':
var activeinput = $( document.activeElement ).attr( 'type' );
if ( [ 'text', 'password', 'textarea' ].includes( activeinput ) ) return
if ( [ 'text', 'number', 'password', 'range', 'textarea' ].includes( activeinput ) ) return

var $tabactive = $( '#infoTab a.active' );
if ( key === 'ArrowLeft' ) {
Expand Down Expand Up @@ -592,9 +596,19 @@ function info( json ) {
// set width: text / password / textarea
infoWidth();
if ( I.rangelabel ) {
$( '#infoRange input' ).on( 'click input keyup', function() {
$( '#infoRange input' ).on( 'input', function() {
$( '#infoRange .value' ).text( $( this ).val() );
} );
if ( I.rangeupdn ) {
$( '#infoRange a' ).on( 'click', function() {
var updn = $( this ).hasClass( 'max' ) ? 1 : -1;
var $range = $( '#infoRange input' );
var val = +$range.val() + updn;
$range.val( val );
$( '#infoRange .value' ).text( val );
if ( typeof I.rangeupdn === 'function' ) I.rangeupdn( val );
} );
}
}
if ( I.tab && $input.length === 1 ) $( '#infoContent' ).css( 'padding', '30px' );
// custom function before show
Expand Down Expand Up @@ -689,27 +703,17 @@ function infoCheckLength() {
} );
}
function infoCheckSet() {
if ( I.checkblank || I.checkip || I.checklength || I.checkchanged ) {
$inputbox.on( 'keyup paste cut', function() {
if ( I.checkchanged || I.checkblank || I.checkip || I.checklength ) {
$( '#infoContent' ).find( 'input, select, textarea' ).on( 'input', function() {
if ( I.checkchanged ) I.nochange = I.values.join( '' ) === infoVal( 'array' ).join( '' );
if ( I.checkblank ) setTimeout( infoCheckBlank, 0 ); // ios: wait for value
if ( I.checklength ) setTimeout( infoCheckLength, 25 );
if ( I.checkip ) setTimeout( infoCheckIP, 50 );
if ( I.checkchanged ) {
var values = infoVal( 'array' );
I.nochange = I.values.join( '' ) === values.join( '' );
}
setTimeout( () => {
$( '#infoOk' ).toggleClass( 'disabled', I.blank || I.notip || I.short || I.nochange )
$( '#infoOk' ).toggleClass( 'disabled', I.nochange || I.blank || I.notip || I.short )
}, 75 ); // ios: force after infoCheckLength
} );
}
if ( I.checkchanged ) {
$( '#infoContent' ).find( 'input:radio, input:checkbox, select' ).on( 'change', function() {
var values = infoVal( 'array' );
I.nochange = I.values.join( '' ) === values.join( '' );
$( '#infoOk' ).toggleClass( 'disabled', I.nochange );
} );
}
}
function infoFileImage() {
delete I.infofilegif;
Expand Down
25 changes: 13 additions & 12 deletions srv/http/assets/js/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ function addToPlaylistCommand() {
} else if ( [ 'mpcadd', 'mpcaddload' ].includes( mpccmd0 ) ) {
V.mpccmd.push( 'CMD FILE'+ varaction );
} else if ( mpccmd0 === 'mpcaddfind' ) {
if ( V.mpccmd.length < 5 ) {
V.mpccmd.push( 'CMD TYPE STRING'+ varaction );
} else {
V.mpccmd.push( 'CMD TYPE STRING TYPE2 STRING2'+ varaction );
}
var varlist = 'CMD MODE STRING';
if ( V.mpccmd.length > 3 ) varlist += ' MODE2 STRING2';
if ( V.mpccmd.length > 5 ) varlist += ' MODE3 STRING3';
V.mpccmd.push( varlist + varaction );
} else if ( mpccmd0 === 'mpcaddplaynext' ) {
V.mpccmd.push( 'CMD FILE' );
}
Expand Down Expand Up @@ -449,7 +448,7 @@ function webRadioCoverart() {
}
, buttonlabel : ico( mode ) +'Default'
, buttoncolor : orange
, button : () => bash( [ 'webradiocoverreset', imagefilenoext, mode, 'CMD FILENOEXT MODE' ] )
, button : () => bash( [ 'webradiocoverreset', imagefilenoext, 'CMD FILENOEXT' ] )
, ok : () => imageReplace( mode, imagefilenoext )
} );
}
Expand Down Expand Up @@ -704,13 +703,15 @@ $( '.contextmenu a, .contextmenu .submenu' ).on( 'click', function() {
if ( charset ) path += '#charset='+ charset
V.mpccmd = [ 'mpcadd', path ];
break;
default: // album albumartist artist composer conductor date genre
if ( ! V.list.name ) {
V.mpccmd = [ 'mpcaddfind', V.mode, path ];
if ( V.list.artist ) V.mpccmd.push( 'artist', V.list.artist );
} else {
V.mpccmd = [ 'mpcaddfind', V.mode, $( '#mode-title' ).text(), 'album', V.list.name ];
default: // MODE
if ( V.list.li.data( 'mode' ) !== 'album' ) { // 1st level
V.mpccmd = [ 'mpcaddfind', V.mode, V.list.path ];
} else { // next level: mode + album || date/genre: mode + artist + album
V.mpccmd = [ 'mpcaddfind', V.mode, $( '#lib-path .lipath' ).text() ];
if ( [ 'date', 'genre' ].includes( V.mode ) ) V.mpccmd.push( 'artist', V.list.li.find( '.name' ).text() );
V.mpccmd.push( 'album', V.list.li.find( '.liname' ).text() );
}
break
}
V.action = cmd.replace( /album|artist|composer|conductor|date|genre/g, '' ); // add addplay playnext replace replaceplay
addToPlaylist();
Expand Down
8 changes: 4 additions & 4 deletions srv/http/assets/js/equalizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ function eqOptionPreset() {
eqnames.forEach( n => optpreset += '<option>'+ n +'</option>' );
if ( ! I.active ) return optpreset

local(); // suppress change event
local(); // suppress input event
$( '#eqpreset' )
.html( optpreset )
.trigger( 'change' );
.trigger( 'input' );
I.values = [ '', E.active, ...E.preset[ E.active ] ];
infoSetValues();
}
Expand Down Expand Up @@ -122,11 +122,11 @@ $( '#infoOverlay' ).on( 'click', '#eqrename', function() {
$( '#eqdelete, #eqsave, #eqname, #eqback' ).addClass( 'hide' );
$( '#eqname' ).empty();
$( '#eqrename' ).toggleClass( 'disabled', E.active === 'Flat' );
} ).on( 'keyup paste cut', '#eqname', function( e ) {
} ).on( 'input', '#eqname', function( e ) {
var $eqsave = $( '#eqsave' );
$eqsave.toggleClass( 'disabled', $( this ).val().trim() in E.preset );
if ( e.key === 'Enter' && ! $eqsave.hasClass( 'disabled' ) ) $eqsave.trigger( 'click' );
} ).on( 'change', '#eqpreset', function() { // preset
} ).on( 'input', '#eqpreset', function() { // preset
if ( V.local ) return

var name = $( this ).val();
Expand Down
2 changes: 1 addition & 1 deletion srv/http/assets/js/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ $( '#setting-localbrowser' ).on( 'click', function() {
if ( ( up && zoom < 300 ) || ( ! up && zoom > 50 ) ) $( '#zoom' ).val( up ? zoom += 5 : zoom -= 5 );
$( '#infoOk' ).toggleClass( 'disabled', I.values.join( '' ) === infoVal( 'array' ).join( '' ) );
} );
$( '#infoContent' ).on( 'change', '#screenoff', function() {
$( '#infoContent' ).on( 'input', '#screenoff', function() {
if ( $( this ).val() != 0 ) {
$( '#onwhileplay' ).prop( 'disabled', 0 );
} else {
Expand Down
Loading

0 comments on commit 25519cb

Please sign in to comment.