Skip to content

Commit b447419

Browse files
update SW, shrink image
1 parent af3f507 commit b447419

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

docs/build_cache_file_list.py

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#! /usr/bin/env python
22
from pathlib import Path
3-
43
from pprint import pprint
54

65
# source = '' # when using root - check
@@ -16,13 +15,29 @@ def get_list_of_potential_files_to_cache(search_path, cache_root):
1615
paths = []
1716
dir_before_root = str(search_path).split('/')[str(search_path).split('/').index(cache_root)-1]
1817

18+
print(dir_before_root)
19+
print(search_path)
20+
1921
print('const FILES_TO_CACHE = [')
2022

2123
for p in search_path.glob('**/*'):
22-
if p.is_dir() or '.DS_Store' in str(p): continue
24+
path = str(p)
25+
if 'node_modules' in path or 'scratch' in path or p.is_dir() or '.DS_Store' in path: continue
2326
comps = str(p).split(dir_before_root)
24-
cache_targets = Path(comps[1])
27+
cache_targets = Path(comps.pop())
28+
#non of comented work - w
29+
# root_cache = Path('js_canvas_IO_docs').joinpath(comps.pop() )
30+
#root_cache = PurePath('/',repo_name).joinpath(comps.pop())
31+
#root_cache = Path('/').joinpath(comps.pop(), 'js_canvas_IO_docs', 'twat' )
32+
#root_cache = Path('/').joinpath('js_canvas_IO_docs', comps.pop() )
33+
#root_cache = Path('/').joinpath('js_canvas_IO_docs', str(comps.pop()) )
34+
# root_cache = Path('js_canvas_IO_docs').joinpath(str(comps.pop()) )
35+
# print(f" '{root_cache}',")
36+
#print(f"ct:{cache_targets}<")
2537
print(f" '/{repo_name}{cache_targets}',")
38+
39+
40+
#print(f" '/{cache_targets}',")
2641
paths.append(cache_targets)
2742

2843
print('];')

docs/service_worker.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ let verion_numner_passed_in = '00';
1919
const CACHE_NAME = `dtk-gitio-cache_${verion_numner_passed_in}`; // TODO add version number for ServWrkr updates
2020

2121
// run
22-
// build_cache_file_list.py from project root
22+
// build_cache_file_list.py from /js_canvas_IO_docs/docs
2323
// to create updated list
2424

25-
const FILES_TO_CACHE = [
25+
// dont cache SW - chanes to SW force and update of SW and consequently caches - update version above
2626
//'/js_canvas_IO_docs/service_worker.js', // https://stackoverflow.com/questions/55027512/should-i-cache-the-serviceworker-file-in-a-pwa
27-
'/js_canvas_IO_docs/',
28-
'/js_canvas_IO_docs/index.html',
27+
const FILES_TO_CACHE = [
2928
'/js_canvas_IO_docs/static/offline.html',
3029
'/js_canvas_IO_docs/static/favicon.ico',
3130
'/js_canvas_IO_docs/static/manifest.json',
3231
'/js_canvas_IO_docs/static/css/bootstrap.min.css',
3332
'/js_canvas_IO_docs/static/css/styles.css',
3433
'/js_canvas_IO_docs/static/css/weigh_in.css',
3534
'/js_canvas_IO_docs/static/images/s&p pork arancini.jpg',
35+
'/js_canvas_IO_docs/static/images/20170918_164301_banh_xeo.jpg',
3636
'/js_canvas_IO_docs/static/images/mathPaint.png',
3737
'/js_canvas_IO_docs/static/images/20200625_224208_kofte & couscous salad sandwich.jpg',
3838
'/js_canvas_IO_docs/static/images/svg/cog.svg',
@@ -72,11 +72,13 @@ const FILES_TO_CACHE = [
7272
'/js_canvas_IO_docs/static/js_modules/navbarMod.js',
7373
'/js_canvas_IO_docs/static/js_modules/module_page_home.js',
7474
'/js_canvas_IO_docs/static/js_modules/module_page_tracker.js',
75+
'/js_canvas_IO_docs/static/js_modules/module_page_mathPaintCanvas.js',
7576
'/js_canvas_IO_docs/static/js_modules/dtk_storage.js',
7677
'/js_canvas_IO_docs/static/js_modules/module_page_blank.js',
7778
'/js_canvas_IO_docs/static/js_modules/app.js',
7879
'/js_canvas_IO_docs/static/js_modules/module_page_weigh_in.js',
7980
'/js_canvas_IO_docs/static/js_modules/content/mathTiles.js',
81+
'/js_canvas_IO_docs/static/js_modules/content/mathTilesCanvas.js',
8082
];
8183

8284

-5.94 MB
Loading

0 commit comments

Comments
 (0)