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
Paul Graydon
erp5
Commits
2dba1051
Commit
2dba1051
authored
Aug 09, 2017
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_officejs] Bootloader, test service worker presence and retry install on error
parent
2d5f45e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
34 deletions
+32
-34
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.js
...lateItem/web_page_module/gadget_officejs_bootloader_js.js
+30
-32
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.xml
...ateItem/web_page_module/gadget_officejs_bootloader_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.js
View file @
2dba1051
...
...
@@ -47,9 +47,8 @@ var repair = false;
.
ready
(
function
(
gadget
)
{
var
i
,
state
=
{},
sub_gadget_list
=
[],
element_list
=
gadget
.
element
.
querySelectorAll
(
'
[data-install-configuration]
'
);
gadget
.
element
.
querySelectorAll
(
'
[data-install-configuration]
'
);
window
.
Bootloader
=
gadget
;
for
(
i
=
0
;
i
<
element_list
.
length
;
i
+=
1
)
{
...
...
@@ -58,6 +57,14 @@ var repair = false;
}
state
.
redirect_url
=
new
URL
(
window
.
location
);
state
.
redirect_url
.
pathname
+=
state
.
version_url
;
// This is a bad hack to support dropbox.
if
(
state
.
redirect_url
.
hash
&&
state
.
redirect_url
.
hash
.
startsWith
(
'
#access_token
'
))
{
state
.
redirect_url
.
hash
=
state
.
redirect_url
.
hash
.
replace
(
'
#access_token
'
,
'
#/?page=ojs_dropbox_configurator&access_token
'
);
}
return
gadget
.
changeState
(
state
);
})
...
...
@@ -68,15 +75,7 @@ var repair = false;
.
declareService
(
function
()
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
/* Workaround for renderjs issue,
sub gadget does not have all aquired Method at this point*/
return
RSVP
.
delay
(
500
);
})
.
push
(
function
()
{
return
gadget
.
isChildren
();
})
return
gadget
.
isChildren
()
.
push
(
undefined
,
function
(
error
)
{
if
(
error
instanceof
rJS
.
AcquisitionError
)
{
return
RSVP
.
all
([
...
...
@@ -131,6 +130,7 @@ sub gadget does not have all aquired Method at this point*/
return
this
.
declareGadget
(
url
,
{
"
element
"
:
element
,
"
scope
"
:
url
,
"
sandbox
"
:
"
iframe
"
})
.
push
(
function
(
sub_gadget
)
{
...
...
@@ -141,30 +141,28 @@ sub gadget does not have all aquired Method at this point*/
.
declareMethod
(
"
install
"
,
function
()
{
var
gadget
=
this
,
storage
=
createStorage
(
gadget
);
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
navigator
.
serviceWorker
.
register
(
"
gadget_officejs_bootloader_serviceworker.js
"
);
})
.
push
(
function
()
{
return
storage
.
repair
();
})
.
push
(
undefined
,
function
(
error
)
{
if
(
gadget
.
state
.
retry
!==
undefined
)
{
if
(
navigator
.
serviceWorker
!==
undefined
)
{
return
storage
.
repair
()
.
push
(
undefined
,
function
(
error
)
{
return
gadget
.
changeState
({
retry
:
gadget
.
state
.
retry
+=
1
,
retry
:
gadget
.
state
.
retry
!==
undefined
?
gadget
.
state
.
retry
+
1
:
0
,
error
:
error
})
.
push
(
function
()
{
return
RSVP
.
delay
(
1000
);
})
.
push
(
function
()
{
return
gadget
.
install
();
});
}
throw
error
;
});
.
push
(
function
()
{
return
RSVP
.
delay
(
1000
);
})
.
push
(
function
()
{
return
gadget
.
install
();
});
})
.
push
(
function
()
{
return
navigator
.
serviceWorker
.
register
(
"
gadget_officejs_bootloader_serviceworker.js
"
);
});
}
return
;
});
}(
window
,
document
,
RSVP
,
rJS
,
jIO
,
navigator
,
URL
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.xml
View file @
2dba1051
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
961.
10581.61261.18995
</string>
</value>
<value>
<string>
961.
29242.42246.47598
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
150
1763880.35
</float>
<float>
150
2886442.31
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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