diff --git a/apps/grocery/ChangeLog b/apps/grocery/ChangeLog index cb066ef3d..38cef7076 100644 --- a/apps/grocery/ChangeLog +++ b/apps/grocery/ChangeLog @@ -2,3 +2,4 @@ 0.02: Refactor code to store grocery list in separate file 0.03: Sort selected items to bottom and enable Widgets 0.04: Add settings to edit list on device +0.05: Drop app customiser as it is redundant with download interface diff --git a/apps/grocery/app.js b/apps/grocery/app.js index a68f53010..c087f1311 100644 --- a/apps/grocery/app.js +++ b/apps/grocery/app.js @@ -1,18 +1,19 @@ -var filename = 'grocery_list.json'; -var settings = require("Storage").readJSON(filename,1)|| { products: [] }; +{ +const filename = 'grocery_list.json'; +const settings = require("Storage").readJSON(filename,1)|| { products: [] }; let menu; -function updateSettings() { +const updateSettings = function() { require("Storage").writeJSON(filename, settings); Bangle.buzz(); -} +}; -function twoChat(n){ +const twoChat = function(n) { if(n<10) return '0'+n; return ''+n; -} +}; -function sortMenu() { +const sortMenu = function() { mainMenu.sort((a,b) => { const byValue = a.value-b.value; return byValue !== 0 ? byValue : a.index-b.index; @@ -20,7 +21,7 @@ function sortMenu() { if (menu) { menu.draw(); } -} +}; const mainMenu = settings.products.map((p,i) => ({ title: twoChat(p.quantity)+' '+p.name, @@ -35,9 +36,14 @@ const mainMenu = settings.products.map((p,i) => ({ })); sortMenu(); -mainMenu[''] = { 'title': 'Grocery list' }; +mainMenu[''] = { + 'title': 'Grocery list', + remove: () => { + }, +}; mainMenu['< Back'] = ()=>{load();}; Bangle.loadWidgets(); menu = E.showMenu(mainMenu); Bangle.drawWidgets(); +} diff --git a/apps/grocery/grocery.html b/apps/grocery/grocery.html deleted file mode 100644 index e717dee2e..000000000 --- a/apps/grocery/grocery.html +++ /dev/null @@ -1,116 +0,0 @@ - -
- - - - -| name | -quantity | -actions | -
|---|