popcon: add settings for reset

pull/2771/head
Rob Pilling 2023-05-24 08:19:05 +01:00
parent 8ef7b42af5
commit d5c3650007
4 changed files with 27 additions and 2 deletions

View File

@ -1,3 +1,4 @@
0.01: New App!
0.02: Trim old entries from the popcon app cache
0.03: Avoid polluting global scope
0.04: Add settings app for resetting popcon

View File

@ -2,7 +2,7 @@
"id": "popconlaunch",
"name": "Popcon Launcher",
"shortName": "Popcon",
"version": "0.03",
"version": "0.04",
"description": "Launcher modification - your launchers will display your favourite (popular) apps first. Overrides `readJSON`, may slow down your watch",
"readme": "README.md",
"icon": "app.png",
@ -11,7 +11,8 @@
"supports": ["BANGLEJS2"],
"storage": [
{"name":"popcon.boot.js","url":"boot.js"},
{"name":"popcon.img","url":"icon.js","evaluate":true}
{"name":"popcon.img","url":"icon.js","evaluate":true},
{"name":"popcon.settings.js","url":"settings.js"}
],
"data": [
{"name":"popcon.cache.json"}

View File

@ -0,0 +1,11 @@
(function (back) {
var menu = {
'': { 'title': 'Popcon' },
'< Back': back,
'Reset app popularities': function () {
require("Storage").erase("popcon.cache.json");
E.showMessage("Popcon reset", "Done");
},
};
E.showMenu(menu);
});

View File

@ -0,0 +1,12 @@
(function(back) {
const menu = {
'': {'title': 'Popcon'},
'< Back': back,
'Reset app popularities': () => {
require("Storage").erase("popcon.cache.json");
E.showMessage("Popcon reset", "Done");
},
};
E.showMenu(menu);
}) satisfies SettingsFunc