diff --git a/apps.json b/apps.json index 1455a2b13..822af47f2 100644 --- a/apps.json +++ b/apps.json @@ -1,25 +1,35 @@ --- +# ================================================================= +# ALL THE INFORMATION INSIDE APPS.JSON HAS NOW BEEN MOVED +# +# You'll find it inside a file called apps/yourapp/metadata.json +# +# Otherwise nothing has changed. GitHub Pages will automatically +# create apps.json as your site is hosted, or if you're hosting +# yourself you can run bin/create_apps_json.sh +# +# ================================================================= + +# Uncomment the following line if you only want explicitly listed +# apps to be available on your site + +# restricted: ["boot", "launch", "antonclk", "health", "setting", "about", "widbat", "widbt", "widlock", "widid"] --- -{% comment %} -================================================================= - ALL THE INFORMATION INSIDE APPS.JSON HAS NOW BEEN MOVED - - You'll find it inside a file called apps/yourapp/metadata.json - - Otherwise nothing has changed. GitHub Pages will automatically - create apps.json as your site is hosted, or if you're hosting - yourself you can run bin/create_apps_json.sh - -================================================================= -{% endcomment %} -{%- assign apps = site.static_files | where: "name", "metadata.json" -%} +{%- if page.restricted == nil -%} + {%- assign apps = site.static_files | where: "name", "metadata.json" | map: "path" -%} +{%- else -%} + {%- capture temp -%} + {%- for app in page.restricted %} /apps/{{app}}/metadata.json {%- endfor -%} + {%- endcapture -%} + {%- assign apps = temp | strip | split: " " -%} +{%- endif -%} [ -{%- include_relative {{ apps.first.path }} -%} +{%- include_relative {{ apps.first }} -%} {%- for app in apps offset:1 -%} -,{%- include_relative {{ app.path }} -%} +,{%- include_relative {{ app }} -%} {%- endfor -%} ] diff --git a/apps/daysl/app.js b/apps/daysl/app.js index 56f85e615..51b5a84ad 100644 --- a/apps/daysl/app.js +++ b/apps/daysl/app.js @@ -26,7 +26,7 @@ function showMenu() { '': { 'title': 'Set Date', 'predraw': function() { - datemenu.Date.value = settings.day; + datemenu.Day.value = settings.day; datemenu.Month.value = settings.month; datemenu.Year.value = settings.year; } @@ -64,4 +64,5 @@ function showMenu() { return E.showMenu(datemenu); } -showMenu(); \ No newline at end of file +showMenu(); + diff --git a/apps/daysl/metadata.json b/apps/daysl/metadata.json index f68e0e8ac..3dfeea745 100644 --- a/apps/daysl/metadata.json +++ b/apps/daysl/metadata.json @@ -5,7 +5,7 @@ "description": "Shows you the days left until a certain date. Date can be set with a settings app and is written to a file.", "icon": "app.png", "tags": "", - "supports": ["BANGLEJS"], + "supports": ["BANGLEJS", "BANGLEJS2"], "allow_emulator": false, "storage": [ {"name":"daysl.app.js","url":"app.js"}, diff --git a/apps/hourstrike/metadata.json b/apps/hourstrike/metadata.json index 04614373d..b99e8e667 100644 --- a/apps/hourstrike/metadata.json +++ b/apps/hourstrike/metadata.json @@ -6,7 +6,7 @@ "description": "Strike the clock on the hour. A great tool to remind you an hour has passed!", "icon": "app-icon.png", "tags": "tool,alarm", - "supports": ["BANGLEJS"], + "supports": ["BANGLEJS", "BANGLEJS2"], "readme": "README.md", "storage": [ {"name":"hourstrike.app.js","url":"app.js"}, diff --git a/apps/widbata/ChangeLog b/apps/widbata/ChangeLog index 42293a3aa..f23705341 100644 --- a/apps/widbata/ChangeLog +++ b/apps/widbata/ChangeLog @@ -1,2 +1,3 @@ 0.01: Created 0.02: Set sort order to -10 so always display in right hand corner +0.03: Set sort order from the code diff --git a/apps/widbata/metadata.json b/apps/widbata/metadata.json index fcfafd04e..d8149d13f 100644 --- a/apps/widbata/metadata.json +++ b/apps/widbata/metadata.json @@ -4,13 +4,12 @@ "shortName":"Battery Theme", "icon": "widbata.png", "screenshots": [{"url":"screenshot_widbata_1.png"}], - "version":"0.02", + "version":"0.03", "type": "widget", "supports": ["BANGLEJS", "BANGLEJS2"], "readme": "README.md", "description": "Shows the current battery level status in the top right using the clocks colour theme", "tags": "widget,battery", - "sortorder": -10, "storage": [ {"name":"widbata.wid.js","url":"widbata.wid.js"} ] diff --git a/apps/widbata/widbata.wid.js b/apps/widbata/widbata.wid.js index 1c04bf8ae..1de4c2fe9 100644 --- a/apps/widbata/widbata.wid.js +++ b/apps/widbata/widbata.wid.js @@ -2,7 +2,7 @@ setInterval(()=>WIDGETS["bata"].draw(), 60000); Bangle.on('lcdPower', function(on) { if (on) WIDGETS["bata"].draw(); }); -WIDGETS["bata"]={area:"tr",width:27,draw:function() { +WIDGETS["bata"]={area:"tr",sortorder:-10,width:27,draw:function() { var s = 26; var t = 13; // thickness var x = this.x, y = this.y; diff --git a/apps/widlock/ChangeLog b/apps/widlock/ChangeLog index 2ac70f875..bb84c2d44 100644 --- a/apps/widlock/ChangeLog +++ b/apps/widlock/ChangeLog @@ -3,3 +3,4 @@ 0.03: Don't try to be fancy - just bail out on firmwares without a lock event 0.04: Set sortorder to -1 so that widget always takes up the furthest left position 0.05: Set sortorder to -10 so that others can take -1 etc +0.06: Set sortorder to -10 in widget code diff --git a/apps/widlock/metadata.json b/apps/widlock/metadata.json index 0f642b192..8635a5434 100644 --- a/apps/widlock/metadata.json +++ b/apps/widlock/metadata.json @@ -1,13 +1,12 @@ { "id": "widlock", "name": "Lock Widget", - "version": "0.05", + "version": "0.06", "description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked", "icon": "widget.png", "type": "widget", "tags": "widget,lock", "supports": ["BANGLEJS","BANGLEJS2"], - "sortorder": -10, "storage": [ {"name":"widlock.wid.js","url":"widget.js"} ] diff --git a/apps/widlock/widget.js b/apps/widlock/widget.js index 4c59e6575..592361cd9 100644 --- a/apps/widlock/widget.js +++ b/apps/widlock/widget.js @@ -4,7 +4,7 @@ WIDGETS["lock"].width = Bangle.isLocked()?16:0; Bangle.drawWidgets(); }); - WIDGETS["lock"]={area:"tl",width:Bangle.isLocked()?16:0,draw:function(w) { + WIDGETS["lock"]={area:"tl",sortorder:10,width:Bangle.isLocked()?16:0,draw:function(w) { if (Bangle.isLocked()) g.reset().drawImage(atob("DhABH+D/wwMMDDAwwMf/v//4f+H/h/8//P/z///f/g=="), w.x+1, w.y+4); }}; diff --git a/apps/widpa/ChangeLog b/apps/widpa/ChangeLog index eb7e543a5..4a8809923 100644 --- a/apps/widpa/ChangeLog +++ b/apps/widpa/ChangeLog @@ -1,3 +1,4 @@ 0.01: First release 0.02: Size widget after step count is reset 0.03: set sortorder to -1 +0.04: set sortorder through code diff --git a/apps/widpa/metadata.json b/apps/widpa/metadata.json index 9fd9311c1..95a8a8a9c 100644 --- a/apps/widpa/metadata.json +++ b/apps/widpa/metadata.json @@ -4,13 +4,12 @@ "shortName":"Simple Pedometer", "icon": "screenshot_widpa.png", "screenshots": [{"url":"screenshot_widpa.png"}], - "version":"0.03", + "version":"0.04", "type": "widget", "supports": ["BANGLEJS", "BANGLEJS2"], "readme": "README.md", "description": "Displays the current step count from `Bangle.getHealthStatus(\"day\").steps` in 12x16 font, requires firmware v2.11.21 or later", "tags": "widget,battery", - "sortorder": -1, "storage": [ {"name":"widpa.wid.js","url":"widpa.wid.js"} ] diff --git a/apps/widpa/widpa.wid.js b/apps/widpa/widpa.wid.js index 1c0f27394..8cde29bc1 100644 --- a/apps/widpa/widpa.wid.js +++ b/apps/widpa/widpa.wid.js @@ -2,7 +2,7 @@ Bangle.on('step', function(s) { WIDGETS["widpa"].draw(); }); Bangle.on('lcdPower', function(on) { if (on) WIDGETS["widpa"].draw(); }); -WIDGETS["widpa"]={area:"tl",width:13,draw:function() { +WIDGETS["widpa"]={area:"tl",sortorder:-1,width:13,draw:function() { if (!Bangle.isLCDOn()) return; // dont redraw if LCD is off var steps = Bangle.getHealthStatus("day").steps; var w = 1 + (steps.toString().length)*12; diff --git a/apps/widpb/ChangeLog b/apps/widpb/ChangeLog index 8f8b3c5e4..8a4a48b56 100644 --- a/apps/widpb/ChangeLog +++ b/apps/widpb/ChangeLog @@ -2,3 +2,4 @@ 0.02: Fixed widget id to wibpb, Size widget after step count is reset 0.03: Fixed widget id in onStep() come on get it right! 0.04: set sortorder to -1 +0.05: set sortorder through code diff --git a/apps/widpb/metadata.json b/apps/widpb/metadata.json index 222b96c83..0c2ed747a 100644 --- a/apps/widpb/metadata.json +++ b/apps/widpb/metadata.json @@ -4,13 +4,12 @@ "shortName":"Lato Pedometer", "icon": "screenshot_widpb.png", "screenshots": [{"url":"screenshot_widpb.png"}], - "version":"0.04", + "version":"0.05", "type": "widget", "supports": ["BANGLEJS", "BANGLEJS2"], "readme": "README.md", "description": "Displays the current step count from `Bangle.getHealthStatus(\"day\").steps` in the Lato font, requires firmware v2.11.21 or later", "tags": "widget,battery", - "sortorder": -1, "storage": [ {"name":"widpb.wid.js","url":"widpb.wid.js"} ] diff --git a/apps/widpb/widpb.wid.js b/apps/widpb/widpb.wid.js index cd830ae4f..ceebb9937 100644 --- a/apps/widpb/widpb.wid.js +++ b/apps/widpb/widpb.wid.js @@ -3,7 +3,7 @@ Bangle.on('step', function(s) { WIDGETS["widpb"].draw(); }); Bangle.on('lcdPower', function(on) { if (on) WIDGETS["widpb"].draw(); }); -WIDGETS["widpb"]={area:"tl",width:13,draw:function() { +WIDGETS["widpb"]={area:"tl",sortorder:-1,width:13,draw:function() { if (!Bangle.isLCDOn()) return; // dont redraw if LCD is off var steps = Bangle.getHealthStatus("day").steps; var w = 1 + (steps.toString().length)*12; diff --git a/bin/firmwaremaker.js b/bin/firmwaremaker.js index 4bc2a70b2..9f7758ee5 100755 --- a/bin/firmwaremaker.js +++ b/bin/firmwaremaker.js @@ -10,7 +10,6 @@ var SETTINGS = { var path = require('path'); var ROOTDIR = path.join(__dirname, '..'); var APPDIR = ROOTDIR+'/apps'; -var APPJSON = ROOTDIR+'/apps.json'; var OUTFILE = ROOTDIR+'/firmware.js'; var DEVICE = "BANGLEJS"; var APPS = [ // IDs of apps to install @@ -28,7 +27,6 @@ global.Const = { }; var AppInfo = require(ROOTDIR+"/core/js/appinfo.js"); -var appjson = JSON.parse(fs.readFileSync(APPJSON).toString()); var appfiles = []; function fileGetter(url) { @@ -58,8 +56,11 @@ function fileGetter(url) { } Promise.all(APPS.map(appid => { - var app = appjson.find(app=>app.id==appid); - if (app===undefined) throw new Error(`App ${appid} not found`); + try { + var app = JSON.parse(fs.readFileSync(APPDIR + "/" + appid + "metadata.json").toString()); + } catch (e) { + throw new Error(`App ${appid} not found`); + } return AppInfo.getFiles(app, { fileGetter : fileGetter, settings : SETTINGS, diff --git a/bin/firmwaremaker_c.js b/bin/firmwaremaker_c.js index 14ced9ef8..e7042d2c3 100755 --- a/bin/firmwaremaker_c.js +++ b/bin/firmwaremaker_c.js @@ -16,7 +16,6 @@ var DEVICE = process.argv[2]; var path = require('path'); var ROOTDIR = path.join(__dirname, '..'); var APPDIR = ROOTDIR+'/apps'; -var APPJSON = ROOTDIR+'/apps.json'; var MINIFY = true; var OUTFILE, APPS; @@ -86,7 +85,6 @@ function atob(input) { } var AppInfo = require(ROOTDIR+"/core/js/appinfo.js"); -var appjson = JSON.parse(fs.readFileSync(APPJSON).toString()); var appfiles = []; function fileGetter(url) { @@ -134,8 +132,11 @@ function evaluateFile(file) { } Promise.all(APPS.map(appid => { - var app = appjson.find(app=>app.id==appid); - if (app===undefined) throw new Error(`App ${appid} not found`); + try { + var app = JSON.parse(fs.readFileSync(APPDIR + "/" + appid + "metadata.json").toString()); + } catch (e) { + throw new Error(`App ${appid} not found`); + } return AppInfo.getFiles(app, { fileGetter : fileGetter, settings : SETTINGS, diff --git a/lang/cs_CZ.json b/lang/cs_CZ.json new file mode 100644 index 000000000..3f4fc87f1 --- /dev/null +++ b/lang/cs_CZ.json @@ -0,0 +1,53 @@ +{ + "//":"Czech language translations", + "GLOBAL": { + "//":"Translations that apply for all apps", + "Alarm" : "Budík", + "Hour" : "Hodina", + "Hours" : "Hodiny", + "Minute" : "Minuta", + "Minutes" : "Minuty", + "Second" : "Sekunda", + "Seconds" : "Sekundy", + "Month" : "Měsíc", + "Enabled" : "Povoleno", + "Background" : "Pozadí", + "Connected" : "Připojeno", + "Settings" : "Nastavení", + "Save" : "Uložit", + "Back" : "Zpět", + "Repeat" : "Opakovat", + "Delete" : "Smazat", + "Sleep" : "Uspat", + "Alarms" : "Budíky", + "ALARM!" : "BUDÍK!", + + " (repeat)" : " (opakovat)", + "< Back" : "< Zpět", + "> Delete" : "> Smazat", + "> Save" : " > Uložit", + "ALARM " : "BUDÍK ", + + "Add Device" : "Přidat zařízení", + "App Settings" : "Nast. Aplikací", + "Apps" : "Aplikace" + + }, + "alarm": { + "//":"App-specific overrides", + "Alarm/Timer" : "Budik/Časovač", + "rpt" : "Opk.", + "New Alarm" : "Nový budík", + "New Timer" : "Nový časovač", + "Auto snooze" : "Auto odložit" + }, + "setting" : { + "Quiet Mode" : "Tichý režim" + + }, + "messages": { + "Are you sure?" : "Opravdu?" + } + + +} diff --git a/lang/index.json b/lang/index.json index f17bf5e03..3d492783d 100644 --- a/lang/index.json +++ b/lang/index.json @@ -1,5 +1,6 @@ [ {"code":"en_GB","name":"British English","url":"en_GB.json"}, + {"code":"cs_CZ","name":"Czech","url":"cs_CZ.json"}, {"code":"de_DE","name":"German","url":"de_DE.json"}, {"code":"es_ES","name":"Spanish","url":"es_ES.json"}, {"code":"fi_FI","name":"Finnish","url":"fi_FI.json"},