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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
e0d2316e
Commit
e0d2316e
authored
Dec 15, 2021
by
Roque
Browse files
Options
Browse Files
Download
Plain Diff
[ERP5 Master appstore_base] Officejs appstore service worker
See merge request
nexedi/erp5!1512
parents
eed0e738
250fdf8a
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
598 additions
and
23 deletions
+598
-23
bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_web_officejs_ui/WebSection_viewOfficeJSApplicationPreference.xml
...icejs_ui/WebSection_viewOfficeJSApplicationPreference.xml
+1
-0
bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_web_officejs_ui/WebSection_viewOfficeJSApplicationPreference/my_configuration_precache_manifest_script.xml
...nPreference/my_configuration_precache_manifest_script.xml
+96
-0
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_html.html
...b_page_module/gadget_ojs_appstore_redirect_page_html.html
+10
-17
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_html.xml
...eb_page_module/gadget_ojs_appstore_redirect_page_html.xml
+2
-2
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_js.js
...m/web_page_module/gadget_ojs_appstore_redirect_page_js.js
+27
-0
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_js.xml
.../web_page_module/gadget_ojs_appstore_redirect_page_js.xml
+342
-0
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_site_module/application-list/template.xml
...emplateItem/web_site_module/application-list/template.xml
+31
-3
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/WebSection_getAppstorePrecacheManifest.py
...s_appstore_base/WebSection_getAppstorePrecacheManifest.py
+11
-0
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/WebSection_getAppstorePrecacheManifest.xml
..._appstore_base/WebSection_getAppstorePrecacheManifest.xml
+74
-0
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py
...em/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py
+4
-1
No files found.
bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_web_officejs_ui/WebSection_viewOfficeJSApplicationPreference.xml
View file @
e0d2316e
...
...
@@ -80,6 +80,7 @@
<string>
my_configuration_cache_file
</string>
<string>
my_configuration_webapp_manifest_url
</string>
<string>
my_configuration_redirect_url
</string>
<string>
my_configuration_precache_manifest_script
</string>
</list>
</value>
</item>
...
...
bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_web_officejs_ui/WebSection_viewOfficeJSApplicationPreference/my_configuration_precache_manifest_script.xml
0 → 100644
View file @
e0d2316e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_configuration_precache_manifest_script
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_reference
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Precache Manifest Script
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_html.html
View file @
e0d2316e
<!DOCTYPE html>
<html
manifest=
"WebSection_renderOfficeJSRedirectAppCache"
>
<body>
<script
language=
"JavaScript"
>
function
redirect_version
()
{
document
.
location
.
replace
(
"
${latest_version}/
"
+
document
.
location
.
hash
)
};
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"officejs-redirect.js"
></script>
<title>
OfficeJS Redirect
</title>
<script
data-appconfig=
"latest_version"
type=
"text/x-renderjs-configuration"
>
$
{
latest_version
}
</script>
</head>
var
timeout_duration
=
10000
;
try
{
window
.
applicationCache
.
addEventListener
(
'
cached
'
,
redirect_version
);
window
.
applicationCache
.
addEventListener
(
'
noupdate
'
,
redirect_version
);
window
.
applicationCache
.
addEventListener
(
'
error
'
,
redirect_version
);
window
.
applicationCache
.
addEventListener
(
'
updateready
'
,
function
(){
window
.
location
.
reload
()});
}
catch
(
e
)
{
timeout_duration
=
1
;
}
// XXX This is a hack for when the network is too slow, or if appcache is not supported anymore
window
.
setTimeout
(
redirect_version
,
timeout_duration
);
</script>
<body>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_html.xml
View file @
e0d2316e
...
...
@@ -248,7 +248,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
84.41193.2075.29252
</string>
</value>
<value>
<string>
9
96.46889.45254.33041
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
1
599639175.46
</float>
<float>
1
639062670.98
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_js.js
0 → 100644
View file @
e0d2316e
/*globals window, document, RSVP, rJS, navigator*/
/*jslint indent: 2, maxlen: 80, nomen: true*/
(
function
(
window
,
document
,
RSVP
,
rJS
,
navigator
)
{
"
use strict
"
;
rJS
(
window
)
.
declareService
(
function
()
{
var
latest_version
=
document
.
head
.
querySelector
(
'
script[data-appconfig="latest_version"]
'
).
textContent
,
queue
=
new
RSVP
.
Queue
();
// Make this redirection compatible with no-service-worker browsers
if
(
'
serviceWorker
'
in
navigator
)
{
queue
.
push
(
function
()
{
return
navigator
.
serviceWorker
.
register
(
"
gadget_erp5_serviceworker.js
"
);
});
}
return
queue
.
push
(
function
()
{
document
.
location
.
replace
(
latest_version
+
"
/
"
+
document
.
location
.
hash
);
});
});
}(
window
,
document
,
RSVP
,
rJS
,
navigator
));
\ No newline at end of file
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_page_module/gadget_ojs_appstore_redirect_page_js.xml
0 → 100644
View file @
e0d2316e
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs_appstore_base/PathTemplateItem/web_site_module/application-list/template.xml
View file @
e0d2316e
...
...
@@ -144,6 +144,26 @@
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
configuration_latest_version
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
configuration_precache_manifest_script
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
...
...
@@ -176,7 +196,15 @@
</item>
<item>
<key>
<string>
configuration_content_security_policy
</string>
</key>
<value>
<string>
default-src \'self\'; script-src \'unsafe-inline\';
</string>
</value>
<value>
<string>
default-src \'self\';
</string>
</value>
</item>
<item>
<key>
<string>
configuration_latest_version
</string>
</key>
<value>
<string>
development
</string>
</value>
</item>
<item>
<key>
<string>
configuration_precache_manifest_script
</string>
</key>
<value>
<string>
WebSection_getAppstorePrecacheManifest
</string>
</value>
</item>
<item>
<key>
<string>
configuration_x_frame_options
</string>
</key>
...
...
@@ -425,7 +453,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
75.65259.47363.59801
</string>
</value>
<value>
<string>
9
96.31313.30780.31453
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -443,7 +471,7 @@
</tuple>
<state>
<tuple>
<float>
1
559055460.25
</float>
<float>
1
639493797.36
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/WebSection_getAppstorePrecacheManifest.py
0 → 100644
View file @
e0d2316e
# minimum list of required files for appstore service worker
url_list
=
[
'./'
,
'rsvp.js'
,
'renderjs.js'
,
'officejs-redirect.js'
,
'favicon.ico'
]
return
list
(
set
(
url_list
))
bt5/erp5_officejs_appstore_base/SkinTemplateItem/portal_skins/erp5_officejs_appstore_base/WebSection_getAppstorePrecacheManifest.xml
0 → 100644
View file @
e0d2316e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_Cacheable__manager_id
</string>
</key>
<value>
<string>
must_revalidate_http_cache
</string>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
REQUEST=None
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSection_getAppstorePrecacheManifest
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py
View file @
e0d2316e
...
...
@@ -33,7 +33,10 @@ if (portal_type == "Web Script"):
web_content
=
web_page
.
TextDocument_substituteTextContent
(
web_content
,
mapping_dict
=
{
'modification_date'
:
modification_date_string
,
# Make JSLint happy for the service worker code
'required_url_list'
:
json
.
dumps
(
web_section
.
WebSection_getPrecacheManifest
())
'required_url_list'
:
json
.
dumps
(
getattr
(
web_section
,
web_section
.
getLayoutProperty
(
"configuration_precache_manifest_script"
,
default
=
"WebSection_getPrecacheManifest"
))()
)
})
elif
(
portal_type
==
"Web Style"
):
...
...
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