Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
987d2a74
Commit
987d2a74
authored
Jan 27, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: duplicate files by adding language prefix
parent
60470ed3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
182 additions
and
167 deletions
+182
-167
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_serviceworker.js
...lateItem/web_page_module/rjs_gadget_erp5_serviceworker.js
+19
-16
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_serviceworker.xml
...ateItem/web_page_module/rjs_gadget_erp5_serviceworker.xml
+163
-151
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_serviceworker.js
View file @
987d2a74
/*jslint indent: 2*/
/*global self, caches, fetch, Promise, URL, location, Response*/
/*global self, caches, fetch, Promise, URL, location, Response
, console
*/
(
function
(
self
,
caches
,
fetch
,
Promise
,
URL
,
location
,
Response
)
{
"
use strict
"
;
...
...
@@ -7,9 +7,10 @@
// CLIENT_CACHE_MAPPING_NAME must not start with `prefix`
// else it may be used as a normal content cache.
CLIENT_CACHE_MAPPING_NAME
=
'
__erp5js_
'
+
location
.
toString
(),
CACHE_NAME
=
prefix
+
'
_000
1
'
,
CACHE_NAME
=
prefix
+
'
_000
7
'
,
CACHE_MAP
=
{},
// Files required to make this app work offline
REQUIRED_LANGUAGE_PREFIX_LIST
=
[
''
,
'
fr/
'
],
REQUIRED_FILES
=
[
'
favicon.ico
'
,
'
font-awesome/font-awesome-webfont.eot
'
,
...
...
@@ -158,13 +159,15 @@
],
required_url_list
=
[],
i
,
len
=
REQUIRED_FILES
.
length
;
j
;
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
REQUIRED_FILES
.
length
;
i
+=
1
)
{
for
(
j
=
0
;
j
<
REQUIRED_LANGUAGE_PREFIX_LIST
.
length
;
j
+=
1
)
{
required_url_list
.
push
(
new
URL
(
REQUIRED_FILES
[
i
],
location
.
toString
()).
toString
()
new
URL
(
REQUIRED_LANGUAGE_PREFIX_LIST
[
j
]
+
REQUIRED_FILES
[
i
],
location
.
toString
()).
toString
()
);
}
}
self
.
addEventListener
(
'
install
'
,
function
(
event
)
{
// Perform install step: loading each required file into cache
event
.
waitUntil
(
...
...
@@ -181,13 +184,13 @@
.
then
(
function
(
cache
)
{
// Add all offline dependencies to the cache
return
Promise
.
all
(
REQUIRED_FILES
required_url_list
.
map
(
function
(
url
)
{
/* Return a promise that's fulfilled
when each url is cached.
*/
// Use cache.add because safari does not support cache.addAll.
console
.
log
(
"
Install
"
+
CACHE_NAME
+
"
=
"
+
url
);
//
console.log("Install " + CACHE_NAME + " = " + url);
return
cache
.
add
(
url
);
})
);
...
...
@@ -253,12 +256,12 @@
// and don't get cache_key from CACHE_MAP and erp5js_cache.
cache_key
=
CACHE_MAP
[
client_id
];
}
console
.
log
(
"
Client Id =
"
+
client_id
);
//
console.log("Client Id = " + client_id);
/*
if (cache_key) {
console.log("cache_key from CACHE_MAP " + cache_key);
}
*/
if
((
event
.
request
.
method
!==
'
GET
'
)
||
(
required_url_list
.
indexOf
(
url
.
toString
())
===
-
1
))
{
// Try not to use the untrustable fetch function
...
...
@@ -282,7 +285,7 @@
// We use Cache Storage as a persistent database.
cache_key
=
response
.
statusText
;
CACHE_MAP
[
client_id
]
=
cache_key
;
console
.
log
(
"
cache_key from Cache Storage
"
+
cache_key
);
//
console.log("cache_key from Cache Storage " + cache_key);
}
});
});
...
...
@@ -295,7 +298,7 @@
return
caches
.
keys
()
.
then
(
function
(
keys
)
{
keys
=
keys
.
filter
(
function
(
key
)
{
return
key
.
startsWith
(
prefix
);
});
console
.
log
(
"
KEYS =
"
+
keys
);
//
console.log("KEYS = " + keys);
if
(
keys
.
length
)
{
cache_key
=
keys
.
sort
().
reverse
()[
0
];
if
(
client_id
)
{
...
...
@@ -323,7 +326,7 @@
// Don't give request object itself. Firefox's Cache Storage
// does not work properly when VARY contains Accept-Language.
// Give URL string instead, then cache.match works on both Firefox and Chrome.
console
.
log
(
"
MATCH
"
+
cache_key
+
"
"
+
url
);
//
console.log("MATCH " + cache_key + " " + url);
return
cache
.
match
(
event
.
request
.
url
);
})
.
then
(
function
(
response
)
{
...
...
@@ -333,7 +336,7 @@
}
// Not in cache - return the result from the live server
// `fetch` is essentially a "fallback"
console
.
log
(
"
MISS
"
+
cache_key
+
"
"
+
url
);
//
console.log("MISS " + cache_key + " " + url);
return
fetch
(
event
.
request
);
})
);
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_serviceworker.xml
View file @
987d2a74
...
...
@@ -148,11 +148,13 @@
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
...
...
@@ -196,16 +198,20 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
...
...
@@ -228,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
976.56996.62202.6543
3
</string>
</value>
<value>
<string>
981.29187.20499.5275
3
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1562322109.66
</float>
<float>
1580141240.29
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
@@ -255,16 +261,20 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
...
...
@@ -312,7 +322,9 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment