1- //FAV WITH PILL AND ANIM
21let appJSON = [ ] ; // List of apps and info from apps.json
32let appSortInfo = { } ; // list of data to sort by, from appdates.csv { created, modified }
43let appCounts = { } ;
@@ -503,13 +502,16 @@ function handleAppInterface(app) {
503502}
504503
505504function changeAppFavourite ( favourite , app , refresh = true ) {
505+ let inDatabase = SETTINGS . appsFavoritedThisSession . find ( obj => obj . id === app . id ) ;
506+
506507 if ( favourite ) {
507508 SETTINGS . appsFavoritedThisSession . push ( { "id" :app . id , "favs" :appSortInfo [ app . id ] && appSortInfo [ app . id ] . favourites ?appSortInfo [ app . id ] . favourites :0 } ) ;
508509 SETTINGS . favourites = SETTINGS . favourites . concat ( [ app . id ] ) ;
509510 } else {
510511 SETTINGS . appsFavoritedThisSession = SETTINGS . appsFavoritedThisSession . filter ( obj => obj . id !== app . id ) ;
511512 SETTINGS . favourites = SETTINGS . favourites . filter ( e => e != app . id ) ;
512513 }
514+
513515 saveSettings ( ) ;
514516 if ( refresh ) {
515517 refreshLibrary ( ) ;
@@ -603,7 +605,7 @@ function getAppHTML(app, appInstalled, forInterface) {
603605 // Always show a count (0 if none) and format large numbers with 'k'
604606 let n = ( cnt && typeof cnt === 'number' ) ? cnt : 0 ;
605607 let txt = ( n > 999 ) ? Math . round ( n / 1000 ) + "k" : n ;
606- return `<span class="fav-count">${ txt } </span>` ;
608+ return `<span class="fav-count" style="margin-left:-1em;margin-right:0.5em" >${ txt } </span>` ;
607609 } ;
608610
609611 let html = `<div class="tile column col-6 col-sm-12 col-xs-12 app-tile">
@@ -612,7 +614,7 @@ function getAppHTML(app, appInstalled, forInterface) {
612614 </div>
613615 <div class="tile-content">
614616 <p class="tile-title text-bold"><a name="${ appurl } "></a>${ escapeHtml ( app . name ) } ${ versionInfo } </p>
615- <p class="tile-subtitle">${ getAppDescription ( app ) } ${ app . readme ?`<br/ >${ readme } ` :"" } </p>
617+ <p class="tile-subtitle">${ getAppDescription ( app ) } ${ app . readme ?`</br >${ readme } ` :"" } </p>
616618 ${ githubLink }
617619 <a href="${ appurl } " class="link-copy-url" appid="${ app . id } " title="Copy link to app" style="position:absolute;top: 56px;left: -24px;"><img src="core/img/copy-icon.png" alt="Copy link to app"/></a>
618620 </div>
0 commit comments