diff --git a/install.sh b/install.sh index 2696993a2..2f0853545 100644 --- a/install.sh +++ b/install.sh @@ -4,6 +4,9 @@ alias=r1 . /srv/http/bash/settings/addons.sh +# 20240120 +[[ -e /boot/kernel.img ]] && echo 'Server = http://alaa.ad24.cz/repos/2022/02/06/armv6h/$repo' > /etc/pacman.d/mirrorlist + # 20240113 file=/etc/security/pam_env.conf if [[ -e /usr/bin/firefox ]] && ! grep -q MOZ_USE_XINPUT2 $file; then diff --git a/srv/http/assets/css/common.css b/srv/http/assets/css/common.css index 951b0ad0c..c96ac9a07 100644 --- a/srv/http/assets/css/common.css +++ b/srv/http/assets/css/common.css @@ -10,7 +10,7 @@ @font-face { font-family : rern; - src : url( '/assets/fonts/rern.woff2?v=1704627299' ); + src : url( '/assets/fonts/rern.woff2?v=1705130005' ); } @font-face { font-family : Lato; @@ -367,6 +367,16 @@ codered { animation: none !important; } +c, +code { + font-family: 'Inconsolata'; + font-size: 15px; + color: var( --cg75 ); + background-color: var( --cgd ); + padding: 0 4px; + border-radius: 3px; +} + /* banner() */ #banner .i-firefox::before { color: #000 } #banner { @@ -940,21 +950,12 @@ input[ type=radio ]:disabled { margin-bottom : 0; } #infoFilename { - max-width: 95%; height: 37px; + padding: 0 10px; } #infoButton { margin-top: 5px; } -#infoOverlay code { - display: inline-block; - padding: 3px; - line-height: 14px; - border-radius: 3px; - background: #000000; - font-family: Inconsolata !important; - color: var( --cw ); -} .infomenu { display: inline-block; width: 140px; diff --git a/srv/http/assets/css/settings.css b/srv/http/assets/css/settings.css index 1ebb141df..0d1fa9273 100644 --- a/srv/http/assets/css/settings.css +++ b/srv/http/assets/css/settings.css @@ -295,15 +295,6 @@ heading i.disabled { float: right; color: var( --cm ); } -c, -code { - font-family: 'Inconsolata'; - font-size: 15px; - color: var( --cg75 ); - background-color: var( --cg ); - padding: 0 4px; - border-radius: 3px; -} .entries { display: block; margin: -16px 0 10px 0; diff --git a/srv/http/assets/js/function.js b/srv/http/assets/js/function.js index 8dab12968..0cff05fa3 100644 --- a/srv/http/assets/js/function.js +++ b/srv/http/assets/js/function.js @@ -357,7 +357,7 @@ function coverartChange() { icon : icon , title : title , message : '' - +'

'+ ico( 'album wh' ) +' '+ album + +'

'+ ico( 'album wh' ) +' '+ album +'
'+ ico( 'artist wh' ) +' '+ artist +'

' , footer : embedded , file : { oklabel: ico( 'flash' ) +'Replace', type: 'image/*' } @@ -966,6 +966,38 @@ function playbackStatusGet( withdisplay ) { } } ); } +function playlistFilter() { + var keyword = $( '#pl-search-input' ).val(); + var regex = new RegExp( keyword, 'i' ); + var count = 0; + $( '#pl-list li' ).each( ( i, el ) => { + var $this = $( el ); + var name = $this.find( '.name' ).text(); + var artist = $this.find( '.artist' ).text(); + var album = $this.find( '.album' ).text(); + var txt = name + artist + album; + var match = txt.search( regex ) !== -1 ? true : false; + count = match ? ( count + 1 ) : count; + $this.toggleClass( 'hide', ! match ); + if ( match ) { + name = name.replace( regex, function( match ) { return ''+ match +'' } ); + artist = artist.replace( regex, function( match ) { return ''+ match +'' } ); + album = album.replace( regex, function( match ) { return ''+ match +'' } ); + $this.find( '.name' ).html( name ); + $this.find( '.artist' ).html( artist ); + $this.find( '.album' ).html( album ); + } + } ); + pageScroll( 0 ); + if ( keyword ) { + $( '#pl-search-close' ).html( ico( 'close' ) +''+ count +' of ' ); + } else { + $( '#pl-search-close' ).empty(); + } +} +function playlistGet() { + list( { playlist: 'current' }, data => renderPlaylist( data ), 'json' ); +} function playlistInsert( pos ) { var plname = $( '#savedpl-path .lipath' ).text(); banner( 'file-playlist', V.pladd.name, 'Add ...' ); @@ -1023,38 +1055,6 @@ function playlistInsertTarget() { } ); bannerHide(); } -function playlistFilter() { - var keyword = $( '#pl-search-input' ).val(); - var regex = new RegExp( keyword, 'i' ); - var count = 0; - $( '#pl-list li' ).each( ( i, el ) => { - var $this = $( el ); - var name = $this.find( '.name' ).text(); - var artist = $this.find( '.artist' ).text(); - var album = $this.find( '.album' ).text(); - var txt = name + artist + album; - var match = txt.search( regex ) !== -1 ? true : false; - count = match ? ( count + 1 ) : count; - $this.toggleClass( 'hide', ! match ); - if ( match ) { - name = name.replace( regex, function( match ) { return ''+ match +'' } ); - artist = artist.replace( regex, function( match ) { return ''+ match +'' } ); - album = album.replace( regex, function( match ) { return ''+ match +'' } ); - $this.find( '.name' ).html( name ); - $this.find( '.artist' ).html( artist ); - $this.find( '.album' ).html( album ); - } - } ); - pageScroll( 0 ); - if ( keyword ) { - $( '#pl-search-close' ).html( ico( 'close' ) +''+ count +' of ' ); - } else { - $( '#pl-search-close' ).empty(); - } -} -function playlistGet() { - list( { playlist: 'current' }, data => renderPlaylist( data ), 'json' ); -} function playlistRemove( $li ) { if ( $( '#pl-list li' ).length === 1 ) { bash( [ 'mpcremove' ] ); @@ -1095,6 +1095,24 @@ function playlistRemove( $li ) { $li.remove(); } } +function playlistSkip() { + intervalClear(); + if ( S.state !== 'stop' ) { + setProgress( 0 ); + $( '#elapsed, #total, #progress' ).empty(); + } + if ( $( '#pl-list li' ).length ) { + playlistSkipSet(); + } else { + list( { playlist: 'current' }, data => { + $( '#pl-list' ).html( data.html ).promise().done( playlistSkipSet ); + }, 'json' ); + } +} +function playlistSkipSet() { + var file = $( '#pl-list li' ).eq( S.song ).find( '.lipath' ).text(); + bash( [ 'mpcskip', S.song + 1, file, 'CMD POS FILE' ] ); +} function refreshData() { if ( V.library ) { if ( $( '#lib-search-input' ).val() ) return @@ -1809,15 +1827,6 @@ function setPlaylistScroll() { } } } -function setPlaylistSkip( pos ) { - intervalClear(); - if ( S.state !== 'stop' ) { - setProgress( 0 ); - $( '#elapsed, #total, #progress' ).empty(); - } - file = $( '#pl-list li' ).length ? $( '#pl-list li' ).eq( pos - 1 ).find( '.lipath' ).text() : ''; - bash( [ 'mpcskip', pos, file, 'CMD POS FILE' ] ); -} function setPlayPauseColor() { var pause = S.state === 'pause'; $( '#title' ).toggleClass( 'gr', pause ); diff --git a/srv/http/assets/js/main.js b/srv/http/assets/js/main.js index fd05f3290..286876a33 100644 --- a/srv/http/assets/js/main.js +++ b/srv/http/assets/js/main.js @@ -930,12 +930,13 @@ $( '.btn-cmd' ).on( 'click', function() { } else if ( cmd === 'previous' || cmd === 'next' ) { if ( S.pllength < 2 ) return - if ( cmd == 'next' ) { - var pos = S.song + 2 > S.pllength ? 1 : S.song + 2; - } else { - var pos = S.song === 0 ? S.pllength : S.song; + cmd == 'next' ? S.song++ : S.song--; + if ( S.song < 0 ) { + S.song = S.pllength - 1; + } else if ( S.song === S.pllength ) { + S.song = 0; } - setPlaylistSkip( pos ); + playlistSkip(); } } if ( $( '#relays' ).hasClass( 'on' ) && cmd === 'play' ) bash( [ 'relaystimerreset' ] ); @@ -945,7 +946,8 @@ $( '#previous, #next, #coverR, #coverL' ).press( function( e ) { if ( ( next && S.song + 1 === S.pllength ) || ( ! next && S.song === 0 ) ) return banner( 'playlist', 'Playlist', 'Skip to '+ ( next ? 'last ...' : 'first ...' ) ); - setPlaylistSkip( next ? S.pllength : 1 ); + S.song = next ? S.pllength - 1 : 0; + playlistSkip(); } ); $( '#bio' ).on( 'click', '.biosimilar', function() { bio( $( this ).text(), 'getsimilar' ); @@ -1411,12 +1413,10 @@ $( '#page-library' ).on( 'click', '#lib-list .coverart', function() { info( { icon : 'album' , title : 'Album Thumbnail' - , message : `\ - -${ ico( 'album' ) } ${ album } -${ ico( 'artist wh' ) } ${ artist } - -Exclude this thumbnail?` + , message : '' + +'
'+ ico( 'album' ) + album +'' + +'
'+ ico( 'artist wh' ) + artist + +'

Exclude this thumbnail?' , okcolor : orange , oklabel : ico( 'remove' ) +'Exclude' , ok : () => {