Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
94b1246a
Commit
94b1246a
authored
Aug 03, 2017
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_officejs] Bootloader retry and inform on error
parent
be529d05
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
235 additions
and
607 deletions
+235
-607
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader.html.html
...Item/web_page_module/gadget_officejs_bootloader.html.html
+1
-3
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader.html.xml
...eItem/web_page_module/gadget_officejs_bootloader.html.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_appcache.xml
...m/web_page_module/gadget_officejs_bootloader_appcache.xml
+0
-352
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.js
...lateItem/web_page_module/gadget_officejs_bootloader_js.js
+108
-156
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.xml
...ateItem/web_page_module/gadget_officejs_bootloader_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.js
...page_module/gadget_officejs_bootloader_presentation_js.js
+15
-14
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.xml
...age_module/gadget_officejs_bootloader_presentation_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_serviceworker_js.js
...age_module/gadget_officejs_bootloader_serviceworker_js.js
+11
-10
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_serviceworker_js.xml
...ge_module/gadget_officejs_bootloader_serviceworker_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_appcachestorage_js.js
...web_page_module/gadget_officejs_jio_appcachestorage_js.js
+90
-62
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_appcachestorage_js.xml
...eb_page_module/gadget_officejs_jio_appcachestorage_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader.html.html
View file @
94b1246a
<!DOCTYPE html>
<html
manifest=
"gadget_officejs_bootloader.appcache"
>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
...
...
@@ -21,7 +21,5 @@
<script
data-install-configuration=
"redirect_url"
type=
"text/x-renderjs-configuration"
>
$
{
redirect_url
}
/
</script>
<script
data-install-configuration=
"cache_file"
type=
"text/x-renderjs-configuration"
>
$
{
cache_file
}
</script>
<script
data-install-configuration=
"app_name"
type=
"text/x-renderjs-configuration"
>
$
{
application_name
}
</script>
<script
data-install-configuration=
"landing_page"
type=
"text/x-renderjs-configuration"
>
$
{
landing_page
}
</script>
<script
data-install-configuration=
"sub_app_installer"
type=
"text/x-renderjs-configuration"
>
$
{
sub_gadget_installer
}
</script>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader.html.xml
View file @
94b1246a
...
...
@@ -241,7 +241,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
59.27737.62903.2116
</string>
</value>
<value>
<string>
9
61.282.28573.14114
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -259,7 +259,7 @@
</tuple>
<state>
<tuple>
<float>
1
496242886.73
</float>
<float>
1
501754635.21
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_appcache.xml
deleted
100644 → 0
View file @
be529d05
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.js
View file @
94b1246a
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.xml
View file @
94b1246a
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
0.25484.60987.38638
</string>
</value>
<value>
<string>
96
1.10581.61261.18995
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
1
499245437.8
</float>
<float>
1
501763880.35
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.js
View file @
94b1246a
...
...
@@ -5,18 +5,8 @@ var IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABUCAYAAAACoiByA
"
use strict
"
;
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
})
.
ready
(
function
(
g
)
{
return
g
.
getElement
()
.
push
(
function
(
element
)
{
g
.
props
.
element
=
element
;
});
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
this
.
props
.
element
.
querySelector
(
"
center
"
)
.
innerHTML
=
var
inner
=
"
<header>OfficeJS Installer</header>
"
+
"
<br>
"
+
"
<br>
"
+
...
...
@@ -27,10 +17,21 @@ var IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABUCAYAAAACoiByA
"
<br>
"
+
'
<img width="100" height="100" title="" alt="" src="
'
+
IMAGE
+
'
" />
'
+
"
<br>
"
+
'
<div>
Install
ing
'
+
options
.
app_name
+
'
</div>
'
+
'
<div>
Prepar
ing
'
+
options
.
app_name
+
'
</div>
'
+
"
<br> We prepare your application for a 100 % offline mode
"
+
'
<div class="loader"></div>
'
;
return
{};
'
<div class="loader"></div>
'
,
error_message
;
if
(
options
.
retry
>
0
)
{
error_message
=
options
.
error
.
message
||
'
Unknow Error
'
;
inner
+=
"
<br>
"
+
"
<div> Last Error:
"
+
error_message
+
"
</div>
"
+
"
<div>Retry n°
"
+
options
.
retry
+
"
</div>
"
;
}
inner
+=
'
<div><a href="
'
+
options
.
redirect_url
+
'
">Skip</a></div>
'
;
this
.
element
.
querySelector
(
"
center
"
)
.
innerHTML
=
inner
;
return
;
});
}(
window
,
rJS
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_presentation_js.xml
View file @
94b1246a
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
56.64509.32061.2201
</string>
</value>
<value>
<string>
9
61.10577.42640.30924
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
1
485770737.14
</float>
<float>
1
501764672.06
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_serviceworker_js.js
View file @
94b1246a
...
...
@@ -5,8 +5,6 @@ var global = self, window = self;
(
function
(
self
,
fetch
,
Request
,
Response
)
{
"
use strict
"
;
self
.
IDBTransaction
=
self
.
IDBTransaction
||
self
.
webkitIDBTransaction
||
self
.
msIDBTransaction
||
{
READ_WRITE
:
"
readwrite
"
};
self
.
IDBKeyRange
=
self
.
IDBKeyRange
||
self
.
webkitIDBKeyRange
||
self
.
msIDBKeyRange
;
self
.
DOMParser
=
{};
self
.
sessionStorage
=
{};
self
.
localStorage
=
{};
...
...
@@ -41,13 +39,17 @@ var global = self, window = self;
if
(
relative_url
===
""
)
{
relative_url
=
"
/
"
;
}
if
(
relative_url
===
'
no-cache
'
)
{
event
.
respondWith
(
new
Response
(
self
.
cache_list
));
return
;
}
event
.
respondWith
(
new
self
.
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
self
.
storage
.
get
===
undefined
)
{
self
.
storage
=
createStorage
(
self
.
registration
.
scope
);
self
.
storage
=
createStorage
(
"
ojs_source_code
"
);
}
return
self
.
storage
.
getAttachment
(
"
/
"
,
relative_url
)
return
self
.
storage
.
getAttachment
(
self
.
registration
.
scope
,
relative_url
)
.
push
(
function
(
blob
)
{
return
new
Response
(
blob
,
{
'
headers
'
:
{
...
...
@@ -58,12 +60,11 @@ var global = self, window = self;
})
.
push
(
undefined
,
function
(
error
)
{
if
(
error
instanceof
self
.
jIO
.
util
.
jIOError
)
{
self
.
console
.
log
(
"
Relative_Url:
"
,
relative_url
,
"
\n
Cause:
"
,
error
.
message
);
if
(
relative_url
.
indexOf
(
'
http
'
)
===
-
1
)
{
if
(
self
.
cache_list
.
indexOf
(
relative_url
)
===
-
1
)
{
self
.
cache_list
.
push
(
relative_url
);
}
}
return
fetch
(
event
.
request
);
}
return
new
Response
(
error
,
{
"
statusText
"
:
error
.
message
,
"
status
"
:
500
});
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_serviceworker_js.xml
View file @
94b1246a
...
...
@@ -227,7 +227,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
0.4199.25759.2730
</string>
</value>
<value>
<string>
96
1.10426.22931.29952
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -245,7 +245,7 @@
</tuple>
<state>
<tuple>
<float>
1
497613210.46
</float>
<float>
1
501754543.53
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_appcachestorage_js.js
View file @
94b1246a
/*jslint indent:2, maxlen: 80, nomen: true */
/*global jIO, RSVP, window,
console, Blob
*/
(
function
(
window
,
jIO
,
RSVP
,
console
,
Blob
)
{
/*global jIO, RSVP, window,
Rusha, Blob, URL
*/
(
function
(
window
,
jIO
,
RSVP
,
Rusha
,
Blob
,
URL
)
{
"
use strict
"
;
var
rusha
=
new
Rusha
();
function
AppCacheStorage
(
spec
)
{
this
.
_manifest
=
spec
.
manifest
;
this
.
_gadget
=
spec
.
gadget
;
this
.
_take_installer
=
spec
.
take_installer
||
false
;
this
.
_origin_url
=
spec
.
origin_url
!==
undefined
?
spec
.
origin_url
:
(
window
.
location
.
origin
+
window
.
location
.
pathname
+
(
window
.
location
.
pathname
.
endsWith
(
'
/
'
)
?
''
:
'
/
'
)
+
((
spec
.
version
!==
undefined
)
?
(
spec
.
version
+
(
spec
.
version
.
endsWith
(
'
/
'
)
?
''
:
'
/
'
))
:
""
));
this
.
_prefix
=
spec
.
prefix
||
""
;
this
.
_relative_url_list
=
[
"
/
"
,
this
.
_prefix
+
spec
.
manifest
];
if
(
this
.
_take_installer
)
{
this
.
_relative_url_list
=
[
this
.
_prefix
||
"
/
"
,
this
.
_prefix
+
"
development/
"
+
spec
.
manifest
,
this
.
_prefix
+
"
development/
"
,
this
.
_prefix
+
"
gadget_officejs_bootloader.js
"
,
this
.
_prefix
+
"
gadget_officejs_bootloader.appcache
"
,
this
.
_prefix
+
"
gadget_officejs_bootloader_presentation.html
"
,
this
.
_prefix
+
"
gadget_officejs_bootloader_presentation.js
"
,
this
.
_prefix
+
"
gadget_officejs_bootloader_presentation.css
"
,
this
.
_prefix
+
"
gadget_officejs_bootloader_serviceworker.js
"
,
this
.
_prefix
+
"
gadget_erp5_nojqm.css
"
,
this
.
_prefix
+
"
jio_appcachestorage.js
"
];
}
this
.
_origin_url
=
spec
.
origin_url
!==
undefined
?
spec
.
origin_url
:
new
URL
(
window
.
location
);
this
.
_version
=
spec
.
version
||
""
;
this
.
_gadget_list
=
[];
this
.
_documents
=
{};
// Harcoded here, find a better way.
this
.
_relative_url_list
=
[
"
/
"
,
"
gadget_officejs_bootloader.js
"
,
"
gadget_officejs_bootloader_presentation.html
"
,
"
gadget_officejs_bootloader_presentation.js
"
,
"
gadget_officejs_bootloader_presentation.css
"
,
"
gadget_officejs_bootloader_serviceworker.js
"
,
"
gadget_erp5_nojqm.css
"
,
"
jio_appcachestorage.js
"
];
}
AppCacheStorage
.
prototype
.
get
=
function
(
id
)
{
return
{};
if
(
this
.
_documents
.
hasOwnProperty
(
id
))
{
return
this
.
_documents
[
id
];
}
throw
new
jIO
.
util
.
jIOError
(
'
can not find document :
'
+
id
,
404
);
};
AppCacheStorage
.
prototype
.
hasCapacity
=
function
(
name
)
{
return
(
name
===
"
list
"
)
;
AppCacheStorage
.
prototype
.
hasCapacity
=
function
()
{
return
true
;
};
AppCacheStorage
.
prototype
.
getAttachment
=
function
(
doc_id
,
attachment_id
)
{
var
storage
=
this
,
url
=
attachment_id
;
AppCacheStorage
.
prototype
.
getAttachment
=
function
(
origin_url
,
relative_url
)
{
var
storage
=
this
;
if
(
storage
.
_gadget_list
.
indexOf
(
relative_url
)
>=
0
)
{
return
window
.
Bootloader
.
declareAndInstall
(
relative_url
)
.
push
(
function
()
{
return
new
Blob
([]);
});
}
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
jIO
.
util
.
ajax
({
type
:
"
GET
"
,
url
:
((
url
.
startsWith
(
"
http
"
)
||
url
.
startsWith
(
"
//
"
))
?
url
:
storage
.
_origin_url
)
+
url
,
dataType
:
"
blob
"
.
push
(
function
()
{
return
jIO
.
util
.
ajax
({
type
:
"
GET
"
,
url
:
(
relative_url
.
startsWith
(
"
http
"
)
||
relative_url
.
startsWith
(
"
//
"
))
?
relative_url
:
origin_url
+
relative_url
,
dataType
:
"
blob
"
});
})
.
push
(
function
(
result
)
{
return
result
.
target
.
response
;
});
})
.
push
(
function
(
result
)
{
return
result
.
target
.
response
;
});
};
AppCacheStorage
.
prototype
.
allAttachments
=
function
(
url
)
{
AppCacheStorage
.
prototype
.
allAttachments
=
function
()
{
var
result
=
{},
i
,
len
=
this
.
_relative_url_list
.
length
;
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
result
[
this
.
_relative_url_list
[
i
]]
=
{};
}
for
(
i
=
0
;
i
<
this
.
_gadget_list
.
length
;
i
+=
1
)
{
result
[
this
.
_gadget_list
[
i
]]
=
{};
}
return
result
;
};
AppCacheStorage
.
prototype
.
buildQuery
=
function
(
options
)
{
return
[{
id
:
"
/
"
,
doc
:
{},
value
:
{}}];
AppCacheStorage
.
prototype
.
buildQuery
=
function
()
{
var
result
=
[],
id
;
for
(
id
in
this
.
_documents
)
{
if
(
this
.
_documents
.
hasOwnProperty
(
id
))
{
result
.
push
({
'
id
'
:
id
,
'
value
'
:
this
.
_documents
[
id
],
'
doc
'
:
this
.
_documents
[
id
]
});
}
}
return
result
;
};
AppCacheStorage
.
prototype
.
repair
=
function
()
{
var
storage
=
this
,
prefix
=
storage
.
_prefix
+
(
storage
.
_take_installer
?
"
development/
"
:
""
);
var
storage
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
jIO
.
util
.
ajax
({
type
:
"
GET
"
,
url
:
storage
.
_origin_url
+
storage
.
_
prefix
+
storage
.
_manifest
url
:
storage
.
_origin_url
+
storage
.
_
version
+
storage
.
_manifest
});
})
.
push
(
function
(
response
)
{
var
text
=
response
.
target
.
responseText
,
relative_url_list
=
text
.
split
(
'
\
r\
n
'
),
relative_url_list
=
text
.
split
(
'
\n
'
),
i
,
take
=
false
;
if
(
relative_url_list
.
length
===
1
)
{
relative_url_list
=
text
.
split
(
'
\n
'
);
}
if
(
relative_url_list
.
length
===
1
)
{
relative_url_list
=
text
.
split
(
'
\r
'
);
}
take
=
false
,
hash
=
rusha
.
digestFromString
(
text
);
storage
.
_documents
[
storage
.
_origin_url
]
=
{
'
hash
'
:
hash
};
storage
.
_relative_url_list
.
push
(
storage
.
_version
);
storage
.
_relative_url_list
.
push
(
storage
.
_version
+
storage
.
_manifest
);
for
(
i
=
0
;
i
<
relative_url_list
.
length
;
i
+=
1
)
{
if
(
relative_url_list
[
i
].
indexOf
(
"
NETWORK:
"
)
>=
0
)
{
take
=
false
;
}
if
(
take
&&
relative_url_list
[
i
]
!==
""
&&
take
=
3
;
}
else
if
(
relative_url_list
[
i
].
indexOf
(
'
GADGET:
'
)
>=
0
)
{
take
=
2
;
}
else
if
(
relative_url_list
[
i
]
!==
""
&&
relative_url_list
[
i
].
charAt
(
0
)
!==
'
#
'
&&
relative_url_list
[
i
].
charAt
(
0
)
!==
'
'
)
{
relative_url_list
[
i
].
replace
(
"
\r
"
,
""
);
storage
.
_relative_url_list
.
push
(
prefix
+
relative_url_list
[
i
]);
if
(
take
===
1
)
{
storage
.
_relative_url_list
.
push
(
storage
.
_version
+
relative_url_list
[
i
]
);
}
else
if
(
take
===
2
)
{
storage
.
_gadget_list
.
push
(
relative_url_list
[
i
]);
}
}
if
(
relative_url_list
[
i
].
indexOf
(
"
CACHE:
"
)
>=
0
)
{
take
=
true
;
take
=
1
;
}
}
})
.
push
(
undefined
,
function
(
error
)
{
if
(
!
error
.
message
)
{
error
.
message
=
"
Can't get manifest
"
;
}
throw
error
;
});
};
jIO
.
addStorage
(
'
appcache
'
,
AppCacheStorage
);
}(
window
,
jIO
,
RSVP
,
console
,
Blob
));
\ No newline at end of file
}(
window
,
jIO
,
RSVP
,
Rusha
,
Blob
,
URL
));
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_appcachestorage_js.xml
View file @
94b1246a
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
0.14254.57744.3293
</string>
</value>
<value>
<string>
96
1.10590.54524.11827
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
1
498139825.46
</float>
<float>
1
501764524.91
</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