From a8e5bc73578d1b07f214a177b669bd8609eba549 Mon Sep 17 00:00:00 2001 From: MasterOfTheTiger Date: Mon, 23 Apr 2018 11:14:10 -0700 Subject: [PATCH 1/5] Add icon and version numbers in info --- app/icon.png | Bin 0 -> 1389 bytes app/index.html | 6 ++++++ app/style.css | 9 +++++++++ 3 files changed, 15 insertions(+) create mode 100644 app/icon.png diff --git a/app/icon.png b/app/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b2346ef95099e3e7aa5d08cb82552e3b26580ba1 GIT binary patch literal 1389 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7xzrU^Ve{aSW-r_2%wt{}@-9V}<{e zg@qS)?yY#~G~K%~DkpdPu_L#X6xdt1_GMghNnW%ls8?-SPVTCp>@C}3qRPcv;vRKp zJ@$^5SRY|>Y|(`!3UB5ezZu!5qE;kuW~S=z+K(v;mXgoRpBI-+o_n@`)7-a0ns*r% z$TFzz=VVa83xE6%+CQ!3jHj(Mi^JaMvkTv@{J!POW*PN}?&c~pr3R;ktye0uJq_Fq zcAfncbuG|;_wK4wF*aY*w%ojGmv8ia{-uOZ0lydBU6Y`9eSK1yZk*o!eWodPH~JUM z3t~ukvOTr*@0Y~CW`8y;J7@mt`N7(SI}7Xfr|DgLz4e}BsEPM(t4-?|C3-Bc+GyHd zvt4?!`1jZD$mdrQl-7s^7d!3edwcP^yjf=cbKR@kR(@fqsec!knY6hm*)a3XLD9#v zQ`}E4)h^er%yHPL-o@^)m9bz$dJy-|ueGz{UvIlm^~Ut^_s9#K=Vo4F`SAAU@waWM zmqSmbYB_J7v2J5R-}kwiP7L;$dZD_hk5;czoxRdX;FM`@9OL)WbJNrs-rLzFFxVuR zA32}H-`%>X)AyBr5JUa4RZA}ZiF&+xg?b*tkuSeJm>GB){v4ZmDnMr*ztLHFz){;ca-meD@OX*;CHuzl+!@l9}|${q*$wU29vn17&OMF67=` zH#7UqGpm!A&YCJSEMog`^uT4d17XI~of!^lGcep?zOZ64CewqAKm6Oblc7WA!1VN6OIDX_S?{|VCmi~x^K5HjjrRp6vv}_LEN<)v zwznIeOn#sJ=t;4cYJAYIBi*N5rioAS`u6J7%Ef85g_?)e8!yghopB_(=IE@YpVIET zOkBE1b@}hvOI)sBxfJQZn$9?J9&1IJ-S4o3x_%p8+3s)8Ol?0aFK;~8*WCO#QvcD1 z+J+=czB0jm0*As6Q8UUQW-WNaz`{E%?35dmfDl6j!~Hq78Rm(FQ`g=V3$o79Kk&F# zUPQIw_WUamXKt31M(8ekmeu|A*@t?z+I&ivzPNzn&t%i8_+{PVlW zXpvIIqWkQ6`OA9?N@FUjcb@*9VHUg6<$6!q6d4Bn<>mJ)qBSpP

About this Program

+
+ +

Heb12 version: 0.1.0

+

Website: heb12.github.io

+
+

This program was built by MasterOfTheTiger (mtiger.tk) as a simple Bible program for desktop systems.

1 Therefore, since we are surrounded by such a great cloud of witnesses, we must get rid of every weight and the sin that clings so closely, and run with endurance the race set out for us, 2 keeping our eyes fixed on Jesus, the pioneer and perfecter of our faith. For the joy set out for him he endured the cross, disregarding its shame, and has taken his seat at the right hand of the throne of God. Hebrews 12:1-2

Credits

diff --git a/app/style.css b/app/style.css index d6de732..06a9814 100644 --- a/app/style.css +++ b/app/style.css @@ -205,6 +205,15 @@ and (max-width : 1000px) { } } +#technicalInfo { + display: block; + margin-bottom: 20px; +} +#technicalInfo img { + float: left; + margin-right: 20px; +} + /* This button CSS is from https://github.com/MasterOfTheTiger/apod-extension/blob/master/css/style.css under the MIT license */ button { border-radius: 5px; From 1d32c3e3a5c8e05a3b933317b9f770b23822071b Mon Sep 17 00:00:00 2001 From: MasterOfTheTiger Date: Mon, 23 Apr 2018 12:06:29 -0700 Subject: [PATCH 2/5] Add basic updating system --- app/index.html | 4 +++- app/updater.js | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 app/updater.js diff --git a/app/index.html b/app/index.html index f684593..cdce161 100644 --- a/app/index.html +++ b/app/index.html @@ -102,7 +102,8 @@

About this Program

-

Heb12 version: 0.1.0

+

Version: 0.1.0

+

Website: heb12.github.io



@@ -189,6 +190,7 @@

Reset

+ diff --git a/app/updater.js b/app/updater.js new file mode 100644 index 0000000..fc3f97a --- /dev/null +++ b/app/updater.js @@ -0,0 +1,35 @@ +// Update this version number for every release: +const version = '0-1-0' +let timesChecked = localStorage.getItem('timesChecked'); + +function checkUpdates() { + console.log(timesChecked); + url = 'https://heb12.github.io/updater/desktop/' + version + '.json' + '?' + timesChecked; + console.log(url); + if (navigator.onLine) { + console.log("Checking for updates..."); + timesChecked = Number(timesChecked) + 1; + localStorage.setItem('timesChecked', timesChecked); + fetch(url) + .then(response => response.text()) + .then(result => { + result = JSON.parse(result); + if (result != '') { + console.log(result); + if (result.outdated == true) { + console.log('This version is outdated. The newest version is ' + result.newest); + document.getElementById('latestUpdate').innerHTML = 'Latest version: ' + result.newest + ' (get the newest version from heb12.github.io/update)'; + document.getElementById('latestUpdate').style.display = 'block'; + } else { + console.log('Using latest version.'); + } + } else { + // If for some reason the request returned as blank, it sends an error + console.log('Error requesting information for program version ' + version); + } + }); + } else { + console.log('No internet connection!'); + } + return result; +} From ffbc0fe6e5094af2891a162b897c45dd7f6ad593 Mon Sep 17 00:00:00 2001 From: MasterOfTheTiger Date: Mon, 23 Apr 2018 12:50:56 -0700 Subject: [PATCH 3/5] Add response if using latest version --- app/updater.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/updater.js b/app/updater.js index fc3f97a..4e74c91 100644 --- a/app/updater.js +++ b/app/updater.js @@ -22,6 +22,7 @@ function checkUpdates() { document.getElementById('latestUpdate').style.display = 'block'; } else { console.log('Using latest version.'); + document.getElementById('latestUpdate').innerHTML = 'Latest version: ' + result.newest; } } else { // If for some reason the request returned as blank, it sends an error From e0221177b70264796c207ca83012b9373628b055 Mon Sep 17 00:00:00 2001 From: MasterOfTheTiger Date: Mon, 23 Apr 2018 13:50:40 -0700 Subject: [PATCH 4/5] Update response if using latest version --- app/updater.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/updater.js b/app/updater.js index 4e74c91..43d8c9b 100644 --- a/app/updater.js +++ b/app/updater.js @@ -22,7 +22,8 @@ function checkUpdates() { document.getElementById('latestUpdate').style.display = 'block'; } else { console.log('Using latest version.'); - document.getElementById('latestUpdate').innerHTML = 'Latest version: ' + result.newest; + document.getElementById('latestUpdate').innerHTML = 'Latest version: ' + result.newest + ' (up to date)'; + document.getElementById('latestUpdate').style.display = 'block'; } } else { // If for some reason the request returned as blank, it sends an error From 3c9935fdeb926c59e1929e37767bed0bb9a3eedd Mon Sep 17 00:00:00 2001 From: MasterOfTheTiger Date: Mon, 23 Apr 2018 18:10:25 -0700 Subject: [PATCH 5/5] Change requested file --- app/updater.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/updater.js b/app/updater.js index 43d8c9b..744eac7 100644 --- a/app/updater.js +++ b/app/updater.js @@ -1,10 +1,10 @@ // Update this version number for every release: -const version = '0-1-0' +const version = '0.1.0' let timesChecked = localStorage.getItem('timesChecked'); function checkUpdates() { console.log(timesChecked); - url = 'https://heb12.github.io/updater/desktop/' + version + '.json' + '?' + timesChecked; + url = 'https://heb12.github.io/updater/desktop/latest.json' + '?' + timesChecked; console.log(url); if (navigator.onLine) { console.log("Checking for updates..."); @@ -16,13 +16,13 @@ function checkUpdates() { result = JSON.parse(result); if (result != '') { console.log(result); - if (result.outdated == true) { + if (result.version != version) { console.log('This version is outdated. The newest version is ' + result.newest); - document.getElementById('latestUpdate').innerHTML = 'Latest version: ' + result.newest + ' (get the newest version from heb12.github.io/update)'; + document.getElementById('latestUpdate').innerHTML = 'Latest version: ' + result.version + ' (get the newest version from heb12.github.io/update)'; document.getElementById('latestUpdate').style.display = 'block'; } else { console.log('Using latest version.'); - document.getElementById('latestUpdate').innerHTML = 'Latest version: ' + result.newest + ' (up to date)'; + document.getElementById('latestUpdate').innerHTML = 'Latest version: ' + result.version + ' (up to date)'; document.getElementById('latestUpdate').style.display = 'block'; } } else {