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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
erp5
Commits
50ec4832
Commit
50ec4832
authored
Apr 13, 2017
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Allow to define and use a service worker
parent
692e466e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
116 additions
and
15 deletions
+116
-15
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.html
...teItem/web_page_module/rjs_gadget_erp5_launcher_html.html
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml
...ateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
...mplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
+14
-12
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
...plateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_viewRenderJSPreference.xml
...s/erp5_web_renderjs/WebSection_viewRenderJSPreference.xml
+1
-0
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_viewRenderJSPreference/my_configuration_service_worker_url.xml
...enderJSPreference/my_configuration_service_worker_url.xml
+96
-0
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebSection_renderDefaultPageAsGadget.py
...5_web_renderjs_ui/WebSection_renderDefaultPageAsGadget.py
+1
-0
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.html
View file @
50ec4832
...
...
@@ -20,6 +20,7 @@
<script
data-renderjs-configuration=
"language_map"
type=
"text/x-renderjs-configuration"
>
$
{
language_map
}
</script>
<script
data-renderjs-configuration=
"default_selected_language"
type=
"text/x-renderjs-configuration"
>
$
{
default_selected_language
}
</script>
<script
data-renderjs-configuration=
"website_url_set"
type=
"text/x-renderjs-configuration"
>
$
{
website_url_set
}
</script>
<script
data-renderjs-configuration=
"service_worker_url"
type=
"text/x-renderjs-configuration"
>
$
{
service_worker_url
}
</script>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml
View file @
50ec4832
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
149208
5733.75
</float>
<float>
149208
6207.22
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
50ec4832
/*globals window, document, RSVP, rJS,
URI, location, XMLHttpRequest, console*/
URI, location, XMLHttpRequest, console
, navigator
*/
/*jslint indent: 2, maxlen: 80*/
(
function
(
window
,
document
,
RSVP
,
rJS
,
XMLHttpRequest
,
location
,
console
)
{
XMLHttpRequest
,
location
,
console
,
navigator
)
{
"
use strict
"
;
/*
if (navigator.hasOwnProperty('serviceWorker')) {
// Check if a ServiceWorker already controls the site on load
if (!navigator.serviceWorker.controller) {
// Register the ServiceWorker
navigator.serviceWorker.register('gadget_erp5_serviceworker.js');
}
}
*/
var
MAIN_SCOPE
=
"
m
"
;
function
renderMainGadget
(
gadget
,
url
,
options
)
{
...
...
@@ -239,6 +230,17 @@
.
absoluteTo
(
location
.
href
)
.
toString
();
if
(
setting
.
hasOwnProperty
(
'
service_worker_url
'
)
&&
(
setting
.
service_worker_url
!==
''
))
{
if
(
navigator
.
serviceWorker
!==
undefined
)
{
// Check if a ServiceWorker already controls the site on load
if
(
!
navigator
.
serviceWorker
.
controller
)
{
// Register the ServiceWorker
navigator
.
serviceWorker
.
register
(
setting
.
service_worker_url
);
}
}
}
return
setting_gadget
.
put
(
"
setting
"
,
setting
);
})
.
push
(
function
()
{
...
...
@@ -584,4 +586,4 @@
});
}(
window
,
document
,
RSVP
,
rJS
,
XMLHttpRequest
,
location
,
console
));
\ No newline at end of file
XMLHttpRequest
,
location
,
console
,
navigator
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
50ec4832
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
7.35152.14703.9045
</string>
</value>
<value>
<string>
95
8.43029.38869.9284
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
14
87941504.18
</float>
<float>
14
92087071.7
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_viewRenderJSPreference.xml
View file @
50ec4832
...
...
@@ -97,6 +97,7 @@
<list>
<string>
my_configuration_panel_gadget_url
</string>
<string>
my_configuration_manifest_url
</string>
<string>
my_configuration_service_worker_url
</string>
<string>
my_configuration_jio_gadget_url
</string>
<string>
my_configuration_translation_gadget_url
</string>
<string>
my_configuration_router_gadget_url
</string>
...
...
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_viewRenderJSPreference/my_configuration_service_worker_url.xml
0 → 100644
View file @
50ec4832
<?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_service_worker_url
</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>
Service Worker URL
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebSection_renderDefaultPageAsGadget.py
View file @
50ec4832
...
...
@@ -44,6 +44,7 @@ mapping_dict = {
"jio_gadget"
:
web_section
.
getLayoutProperty
(
"configuration_jio_gadget_url"
,
default
=
"gadget_jio.html"
),
"translation_gadget"
:
web_section
.
getLayoutProperty
(
"configuration_translation_gadget_url"
,
default
=
"gadget_translation.html"
),
"manifest_url"
:
web_section
.
getLayoutProperty
(
"configuration_manifest_url"
,
default
=
"gadget_erp5.appcache"
),
"service_worker_url"
:
web_section
.
getLayoutProperty
(
"configuration_service_worker_url"
,
default
=
""
),
"language_map"
:
json
.
dumps
({
tmp
[
'id'
]:
portal
.
Base_translateString
(
tmp
[
'title'
],
lang
=
tmp
[
'id'
])
for
tmp
in
portal
.
Localizer
.
get_languages_map
()
if
tmp
[
'id'
]
in
available_language_set
}),
"default_selected_language"
:
portal
.
Localizer
.
get_selected_language
(),
"website_url_set"
:
json
.
dumps
(
website_url_set
),
...
...
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