diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2022-03-26 19:19:17 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2022-03-26 19:19:17 +0100 |
commit | eaecff23868edec4e313735b492bc00090d85c4e (patch) | |
tree | fbaf50700383e5d4785cbf234c60261d7516830e | |
parent | ddd8eba57685112295baa0d6883b8e1b128a1257 (diff) | |
download | hesla-eaecff23868edec4e313735b492bc00090d85c4e.tar.gz |
Fix icons, so the website could be installed (tested on Android).
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | android-chrome-192x192.png | bin | 0 -> 29352 bytes | |||
-rw-r--r-- | android-chrome-512x512.png | bin | 0 -> 103139 bytes | |||
-rw-r--r-- | apple-touch-icon.png | bin | 0 -> 26063 bytes | |||
-rw-r--r-- | favicon-16x16.png | bin | 0 -> 844 bytes | |||
-rw-r--r-- | favicon-32x32.png | bin | 0 -> 2237 bytes | |||
-rw-r--r-- | favicon.ico | bin | 9662 -> 15406 bytes | |||
-rwxr-xr-x | generate_html_cs.py | 31 | ||||
-rw-r--r-- | hesla.webapp | 5 | ||||
-rw-r--r-- | icon-128.png | bin | 16569 -> 0 bytes | |||
-rw-r--r-- | icon-30.png | bin | 2582 -> 0 bytes | |||
-rw-r--r-- | icon-48.png | bin | 5197 -> 0 bytes | |||
-rw-r--r-- | icon-60.png | bin | 6810 -> 0 bytes | |||
-rw-r--r-- | site.webmanifest | 1 | ||||
-rw-r--r-- | sworker.js | 13 | ||||
-rw-r--r-- | templates/base.html | 4 |
16 files changed, 35 insertions, 25 deletions
@@ -1,7 +1,7 @@ BABEL=node node_modules/babel-cli/bin/babel.js FILES=hesla.js hesla.js.map require.js config.js config.js.map \ - activePage.js activePage.js.map icon-*.png lamb-of-God.svg sworker.js \ - index_de.html index.html screen.css hesla.webapp favicon.ico \ + activePage.js activePage.js.map favicon-*.png a*.png lamb-of-God.svg sworker.js \ + index_de.html index.html screen.css hesla.webapp site.webmanifest favicon.ico \ google9815148f4ac1407f.html config.es hesla.es activePage.es %.js: %.es @@ -17,7 +17,7 @@ index_de.html: generate_html_de.py hernnhut/2022/Losungen\ Free\ 2022.xml templa hesla-chrome.zip: zip -9vT $@ google9815148f4ac1407f.html \ - hesla.js icon-128.png icon-30.png icon-60.png \ + hesla.js favicon*.png a*.png \ index_de.html index.html manifest.json screen.css install: $(FILES) diff --git a/android-chrome-192x192.png b/android-chrome-192x192.png Binary files differnew file mode 100644 index 0000000..e1335e6 --- /dev/null +++ b/android-chrome-192x192.png diff --git a/android-chrome-512x512.png b/android-chrome-512x512.png Binary files differnew file mode 100644 index 0000000..899ff64 --- /dev/null +++ b/android-chrome-512x512.png diff --git a/apple-touch-icon.png b/apple-touch-icon.png Binary files differnew file mode 100644 index 0000000..5960d80 --- /dev/null +++ b/apple-touch-icon.png diff --git a/favicon-16x16.png b/favicon-16x16.png Binary files differnew file mode 100644 index 0000000..c65df0b --- /dev/null +++ b/favicon-16x16.png diff --git a/favicon-32x32.png b/favicon-32x32.png Binary files differnew file mode 100644 index 0000000..40a57a1 --- /dev/null +++ b/favicon-32x32.png diff --git a/favicon.ico b/favicon.ico Binary files differindex 0f20c3c..63b7f64 100644 --- a/favicon.ico +++ b/favicon.ico diff --git a/generate_html_cs.py b/generate_html_cs.py index a9cf382..01db782 100755 --- a/generate_html_cs.py +++ b/generate_html_cs.py @@ -103,7 +103,8 @@ def parse_verses(lines): <BR> elements where necessary). """ out = "" - logging.debug("lines = %s", lines) + logging.debug("lines = %s", ",".join( + [et.tostring(l, encoding='unicode') for l in lines])) logging.debug("lines = len %s", len(lines)) if len(lines) > 0: out = lines[0].text @@ -126,12 +127,13 @@ def parse_body(elem): <SL>Žalm 91,9</SL> </OT> """ + logging.debug('elem:%s', et.tostring(elem, encoding='unicode')) if len(list(elem)) == 0: return None wword = {"text": ""} source_elem = elem.find("S") - logging.debug("S elem = %s", source_elem) + logging.debug("S elem = %s", et.tostring(source_elem, encoding='unicode')) logging.debug("S elem = attrib %s", source_elem.attrib) # biblical reference (computer readable) @@ -146,6 +148,7 @@ def parse_body(elem): try: wword["int_ref_id"] = wword["ref_id"].copy() wword["int_ref_id"]["book"] = book_abbrs[wword["ref_id"]["book"]] + logging.debug("book = %s / %s", wword["ref_id"], wword["int_ref_id"]) except KeyError: logging.error("book = %s", wword["ref_id"]) raise @@ -155,9 +158,9 @@ def parse_body(elem): # references ref = elem.find("SL") - logging.debug("ref = %s", ref) - logging.debug("ref = len %s", len(ref)) + logging.debug("ref = %s", et.tostring(ref, encoding='unicode')) if ref is not None: + logging.debug("ref.text = %s", ref.text) wword["ref"] = ref.text return wword @@ -206,7 +209,7 @@ def parse_losung(elem): <CR><SL>Lukáš 3,1-6</SL></CR> </LOSUNG> """ - logging.debug("losung = %s", elem) + logging.debug("losung = %s\n", et.tostring(elem, encoding='unicode')) out = {} date_id = ( cur_year, @@ -226,13 +229,14 @@ def parse_losung(elem): out["readings"] = [] for read in ["SR", "CR", "Ev", "Ep", "Pr", "AT", "Bl"]: sect = elem.find(read) - logging.debug("read %s = %s", read, sect) - try: - out["readings"].append( - "\n".join([el.text for el in sect.findall("SL")]) - ) - except AttributeError: - logging.exception("Parsing heslo pro %s", sect) + if sect is not None: + try: + out["readings"].append( + "\n".join([el.text for el in sect.findall("SL")]) + ) + except AttributeError: + logging.exception("Parsing heslo pro %s", sect) + logging.debug("readings = %s", out['readings']) out["chronicles"] = [] for chron in elem.findall("C"): @@ -302,8 +306,7 @@ def parse_file(filename): parse_day(los, article_dict) article_list = [] - article_keys = sorted(article_dict.keys()) - for key in article_keys: + for key in sorted(article_dict.keys()): article_list.append(article_dict[key]) return template.render(articles=article_list) diff --git a/hesla.webapp b/hesla.webapp index 33ea2a9..f033c72 100644 --- a/hesla.webapp +++ b/hesla.webapp @@ -1,5 +1,5 @@ { - "version": "0.4.1", + "version": "0.4.2", "name": "Hesla", "description": "Display today's Hesla (Losungen, Watchwords) from Bible.", "display": "standalone", @@ -8,7 +8,7 @@ "60": "/icon-60.png", "128": "/icon-128.png" }, - "launch_path": "/index.html", + "launch_path": "/index.html", "developer": { "name": "Matěj Cepl", "url": "http://matej.ceplovi.cz" @@ -16,7 +16,6 @@ "installs_allowed_from": [ "*" ], - "appcache_path": "/hesla.appcache", "locales": { "cs": { "description": "Zobrazí dnešní Hesla Jednoty bratrské" diff --git a/icon-128.png b/icon-128.png Binary files differdeleted file mode 100644 index 795802a..0000000 --- a/icon-128.png +++ /dev/null diff --git a/icon-30.png b/icon-30.png Binary files differdeleted file mode 100644 index 93362f5..0000000 --- a/icon-30.png +++ /dev/null diff --git a/icon-48.png b/icon-48.png Binary files differdeleted file mode 100644 index 19b5183..0000000 --- a/icon-48.png +++ /dev/null diff --git a/icon-60.png b/icon-60.png Binary files differdeleted file mode 100644 index fdc297b..0000000 --- a/icon-60.png +++ /dev/null diff --git a/site.webmanifest b/site.webmanifest new file mode 100644 index 0000000..45dc8a2 --- /dev/null +++ b/site.webmanifest @@ -0,0 +1 @@ +{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
\ No newline at end of file @@ -1,4 +1,4 @@ -var VERSION = 'v55 - 2022-01-01'; +var VERSION = 'v56 - 2022-03-26'; var toCache = [ '/', 'activePage.js', @@ -9,14 +9,17 @@ var toCache = [ 'hesla.js', 'hesla.js.map', 'hesla.webapp', - 'icon-128.png', - 'icon-30.png', - 'icon-60.png', + 'android-chrome-192x192.png', + 'android-chrome-512x512.png', + 'apple-touch-icon.png', + 'favicon-16x16.png', + 'favicon-32x32.png', 'lamb-of-God.svg', 'index_de.html', 'index.html', 'require.js', - 'screen.css' + 'screen.css', + 'site.webmanifest' ]; self.addEventListener('install', event => { diff --git a/templates/base.html b/templates/base.html index ca6ea59..5018bbe 100644 --- a/templates/base.html +++ b/templates/base.html @@ -17,6 +17,10 @@ <meta charset="utf-8"/> <meta content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" name="viewport"/> <link href="screen.css" type="text/css" rel="stylesheet"/> + <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> + <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> + <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> + <link rel="manifest" href="/site.webmanifest"> <title>{{ title }}</title> <script data-main="config" type="text/javascript" src="require.js" defer></script> <style> |