@@ -30,6 +30,24 @@ let currently_editing_app;
30
30
let dropped_items ;
31
31
let search_query ;
32
32
33
+ const APP_CATEGORIES = [
34
+ { id : 'games' , label : 'Games' } ,
35
+ { id : 'developer-tools' , label : 'Developer Tools' } ,
36
+ { id : 'photo-video' , label : 'Photo & Video' } ,
37
+ { id : 'productivity' , label : 'Productivity' } ,
38
+ { id : 'utilities' , label : 'Utilities' } ,
39
+ { id : 'education' , label : 'Education' } ,
40
+ { id : 'business' , label : 'Business' } ,
41
+ { id : 'social' , label : 'Social' } ,
42
+ { id : 'graphics-design' , label : 'Graphics & Design' } ,
43
+ { id : 'music-audio' , label : 'Music & Audio' } ,
44
+ { id : 'news' , label : 'News' } ,
45
+ { id : 'entertainment' , label : 'Entertainment' } ,
46
+ { id : 'finance' , label : 'Finance' } ,
47
+ { id : 'health-fitness' , label : 'Health & Fitness' } ,
48
+ { id : 'lifestyle' , label : 'Lifestyle' } ,
49
+ ] ;
50
+
33
51
const deploying_spinner = `<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_P7sC{transform-origin:center;animation:spinner_svv2 .75s infinite linear}@keyframes spinner_svv2{100%{transform:rotate(360deg)}}</style><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_P7sC"/></svg>` ;
34
52
const loading_spinner = `<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_P7sC{transform-origin:center;animation:spinner_svv2 .75s infinite linear}@keyframes spinner_svv2{100%{transform:rotate(360deg)}}</style><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_P7sC"/></svg>` ;
35
53
const drop_area_placeholder = `<p>Drop your app folder and files here to deploy.</p><p style="font-size: 16px; margin-top: 0px;">HTML, JS, CSS, ...</p>` ;
@@ -526,6 +544,14 @@ function generate_edit_app_section(app) {
526
544
<label for="edit-app-description">Description</label>
527
545
<textarea id="edit-app-description">${ html_encode ( app . description ) } </textarea>
528
546
547
+ <label for="edit-app-category">Category</label>
548
+ <select id="edit-app-category" class="category-select">
549
+ <option value="">Select a category</option>
550
+ ${ APP_CATEGORIES . map ( category =>
551
+ `<option value="${ html_encode ( category . id ) } " ${ app . metadata ?. category === category . id ? 'selected' : '' } >${ html_encode ( category . label ) } </option>`
552
+ ) . join ( '' ) }
553
+ </select>
554
+
529
555
<label for="edit-app-filetype-associations">File Associations</label>
530
556
<p style="margin-top: 10px; font-size:13px;">A comma-separated list of file type specifiers. For example if you include <code>.txt</code>, your apps could be opened when a user clicks on a TXT file.</p>
531
557
<textarea id="edit-app-filetype-associations" placeholder=".txt, .jpg, application/json">${ app . filetype_associations } </textarea>
@@ -881,6 +907,7 @@ $(document).on('click', '.edit-app-save-btn', async function (e) {
881
907
const width = $ ( '#edit-app-window-width' ) . val ( ) ;
882
908
const top = $ ( '#edit-app-window-top' ) . val ( ) ;
883
909
const left = $ ( '#edit-app-window-left' ) . val ( ) ;
910
+ const category = $ ( '#edit-app-category' ) . val ( ) ;
884
911
885
912
let filetype_associations = $ ( '#edit-app-filetype-associations' ) . val ( ) ;
886
913
@@ -978,6 +1005,7 @@ $(document).on('click', '.edit-app-save-btn', async function (e) {
978
1005
metadata : {
979
1006
fullpage_on_landing : $ ( '#edit-app-fullpage-on-landing' ) . is ( ":checked" ) ,
980
1007
social_image : socialImageUrl ,
1008
+ category : category || null ,
981
1009
window_size : {
982
1010
width : width ?? 800 ,
983
1011
height : height ?? 600 ,
@@ -1263,6 +1291,16 @@ function generate_app_card(app) {
1263
1291
h += `<div style="float:left; padding-left: 10px;">` ;
1264
1292
// Title
1265
1293
h += `<h3 class="got-to-edit-app app-card-title" data-app-name="${ html_encode ( app . name ) } " data-app-title="${ html_encode ( app . title ) } " data-app-uid="${ html_encode ( app . uid ) } ">${ html_encode ( app . title ) } ${ app . metadata ?. locked ? '<svg style="width: 20px; height: 20px; margin-bottom: -5px; margin-left: 5px; opacity: 0.5;" width="59px" height="59px" stroke-width="1.9" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="#000000"><path d="M16 12H17.4C17.7314 12 18 12.2686 18 12.6V19.4C18 19.7314 17.7314 20 17.4 20H6.6C6.26863 20 6 19.7314 6 19.4V12.6C6 12.2686 6.26863 12 6.6 12H8M16 12V8C16 6.66667 15.2 4 12 4C8.8 4 8 6.66667 8 8V12M16 12H8" stroke="#000000" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"></path></svg>' : '' } </h3>` ;
1294
+ // // Category
1295
+ // if (app.metadata?.category) {
1296
+ // const category = APP_CATEGORIES.find(c => c.id === app.metadata.category);
1297
+ // if (category) {
1298
+ // h += `<div class="app-categories">`;
1299
+ // h += `<span class="app-category">${category.label}</span>`;
1300
+ // h += `</div>`;
1301
+ // }
1302
+ // }
1303
+
1266
1304
// link
1267
1305
h += `<a class="app-card-link" href="${ html_encode ( applink ( app ) ) } " target="_blank">${ html_encode ( applink ( app ) ) } </a>` ;
1268
1306
0 commit comments