Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
rern committed Jan 14, 2024
1 parent 771fd79 commit 7fa37ab
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 74 deletions.
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 12 additions & 11 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=1704627299' );
src : url( '/assets/fonts/rern.woff2?v=1705130005' );
}
@font-face {
font-family : Lato;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions srv/http/assets/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
93 changes: 51 additions & 42 deletions srv/http/assets/js/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ function coverartChange() {
icon : icon
, title : title
, message : '<img class="imgold" src="'+ src +'">'
+'<p class="infoimgname">'+ ico( 'album wh' ) +' '+ album
+'<br><p class="infoimgname">'+ ico( 'album wh' ) +' '+ album
+'<br>'+ ico( 'artist wh' ) +' '+ artist +'</p>'
, footer : embedded
, file : { oklabel: ico( 'flash' ) +'Replace', type: 'image/*' }
Expand Down Expand Up @@ -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 '<bll>'+ match +'</bll>' } );
artist = artist.replace( regex, function( match ) { return '<bll>'+ match +'</bll>' } );
album = album.replace( regex, function( match ) { return '<bll>'+ match +'</bll>' } );
$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' ) +'<span>'+ count +' <gr>of</gr> </span>' );
} 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 ...' );
Expand Down Expand Up @@ -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 '<bll>'+ match +'</bll>' } );
artist = artist.replace( regex, function( match ) { return '<bll>'+ match +'</bll>' } );
album = album.replace( regex, function( match ) { return '<bll>'+ match +'</bll>' } );
$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' ) +'<span>'+ count +' <gr>of</gr> </span>' );
} 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' ] );
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 );
Expand Down
24 changes: 12 additions & 12 deletions srv/http/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ] );
Expand All @@ -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' );
Expand Down Expand Up @@ -1411,12 +1413,10 @@ $( '#page-library' ).on( 'click', '#lib-list .coverart', function() {
info( {
icon : 'album'
, title : 'Album Thumbnail'
, message : `\
<img src="${ src }">
<wh>${ ico( 'album' ) } ${ album }</wh>
${ ico( 'artist wh' ) } ${ artist }
Exclude this thumbnail?`
, message : '<img src="'+ src +'">'
+'<br><wh>'+ ico( 'album' ) + album +'</wh>'
+'<br>'+ ico( 'artist wh' ) + artist
+'<br><br>Exclude this thumbnail?'
, okcolor : orange
, oklabel : ico( 'remove' ) +'Exclude'
, ok : () => {
Expand Down

0 comments on commit 7fa37ab

Please sign in to comment.