Commit f238c4f9 authored by Vincent Bechu's avatar Vincent Bechu

erp5_officejs: add bootloader in zip export

parent a072b4af
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
<title> OfficeJS Install </title> <title> OfficeJS Install </title>
<script src="rsvp.js"></script> <script src="${latest_version}/rsvp.js"></script>
<script src="renderjs.js"></script> <script src="${latest_version}/renderjs.js"></script>
<script src="jiodev.js"></script> <script src="${latest_version}/jiodev.js"></script>
<script src="jio_appcachestorage.js"></script> <script src="jio_appcachestorage.js"></script>
<script src="gadget_officejs_bootloader.js"></script> <script src="gadget_officejs_bootloader.js"></script>
......
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.44234.50599.921</string> </value> <value> <string>958.64448.11495.58999</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1492159460.13</float> <float>1493373509.97</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -141,6 +141,7 @@ var repair = false; ...@@ -141,6 +141,7 @@ var repair = false;
if (!gadget.props.sub) { if (!gadget.props.sub) {
window.location.pathname += gadget.props.version_url; window.location.pathname += gadget.props.version_url;
} }
return;
}) })
.push(undefined, function (error) { .push(undefined, function (error) {
if (error instanceof ProgressEvent) { if (error instanceof ProgressEvent) {
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.43127.34376.48742</string> </value> <value> <string>958.61634.43604.13073</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1492093057.34</float> <float>1493203361.07</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<link rel="stylesheet" href="gadget_officejs_bootloader_presentation.css"> <link rel="stylesheet" href="gadget_officejs_bootloader_presentation.css">
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script> <script src="development/rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="development/renderjs.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
<script src="gadget_officejs_bootloader_presentation.js" type="text/javascript"></script> <script src="gadget_officejs_bootloader_presentation.js" type="text/javascript"></script>
......
...@@ -101,6 +101,12 @@ ...@@ -101,6 +101,12 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>text_content_substitution_mapping_method_id</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Officejs BootLoader Presentation Gadget</string> </value> <value> <string>Officejs BootLoader Presentation Gadget</string> </value>
...@@ -240,7 +246,7 @@ ...@@ -240,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.64506.921.51985</string> </value> <value> <string>958.64452.27945.28586</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +264,7 @@ ...@@ -258,7 +264,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1485770530.16</float> <float>1493372430.42</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -14,7 +14,7 @@ var global = self, window = self; ...@@ -14,7 +14,7 @@ var global = self, window = self;
self.DOMError = {}; self.DOMError = {};
self.postMessage = function () {return; }; self.postMessage = function () {return; };
self.importScripts('rsvp.js', 'jiodev.js'); self.importScripts('development/rsvp.js', 'development/jiodev.js');
self.storage = {}; self.storage = {};
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.43172.7083.11724</string> </value> <value> <string>958.61563.34886.11246</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1492095766.17</float> <float>1493383031.83</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -5,12 +5,28 @@ ...@@ -5,12 +5,28 @@
function AppCacheStorage(spec) { function AppCacheStorage(spec) {
this._manifest = spec.manifest; this._manifest = spec.manifest;
this._take_installer = spec.take_installer || false;
this._origin_url = spec.origin_url !== undefined ? spec.origin_url : this._origin_url = spec.origin_url !== undefined ? spec.origin_url :
(window.location.origin + window.location.pathname + (window.location.origin + window.location.pathname +
(window.location.pathname.endsWith('/') ? '' : '/') + (window.location.pathname.endsWith('/') ? '' : '/') +
((spec.version !== undefined) ? ((spec.version !== undefined) ?
(spec.version + (spec.version.endsWith('/') ? '' : '/')) : "")); (spec.version + (spec.version.endsWith('/') ? '' : '/')) : ""));
this._relative_url_list = [this._origin_url, spec.manifest]; this._relative_url_list = [this._origin_url, spec.manifest];
if (this._take_installer) {
this._relative_url_list = [
this._origin_url,
"development/" + spec.manifest,
this._origin_url + "development/",
"gadget_officejs_bootloader.js",
"gadget_officejs_bootloader.appcache",
"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) { AppCacheStorage.prototype.get = function (id) {
...@@ -50,7 +66,8 @@ ...@@ -50,7 +66,8 @@
}; };
AppCacheStorage.prototype.repair = function () { AppCacheStorage.prototype.repair = function () {
var storage = this; var storage = this,
prefix = storage._take_installer ? "development/" : "";
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return jIO.util.ajax({ return jIO.util.ajax({
...@@ -78,7 +95,7 @@ ...@@ -78,7 +95,7 @@
relative_url_list[i].charAt(0) !== '#' && relative_url_list[i].charAt(0) !== '#' &&
relative_url_list[i].charAt(0) !== ' ') { relative_url_list[i].charAt(0) !== ' ') {
relative_url_list[i].replace("\r", ""); relative_url_list[i].replace("\r", "");
storage._relative_url_list.push(relative_url_list[i]); storage._relative_url_list.push(prefix + relative_url_list[i]);
} }
if (relative_url_list[i].indexOf("CACHE:") >= 0) { if (relative_url_list[i].indexOf("CACHE:") >= 0) {
take = true; take = true;
......
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.41792.31362.1314</string> </value> <value> <string>958.64585.2539.29713</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1492082677.03</float> <float>1493380404.6</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
var gadget = this, var gadget = this,
file_storage = jIO.createJIO({ file_storage = jIO.createJIO({
type: "replicate", type: "replicate",
parallel_operation_attachment_amount: 400,
parallel_operation_amount: 400,
check_remote_attachment_creation: true, check_remote_attachment_creation: true,
check_local_creation: false, check_local_creation: false,
check_local_modification: false, check_local_modification: false,
...@@ -49,8 +51,9 @@ ...@@ -49,8 +51,9 @@
document: site_url, document: site_url,
sub_storage: { sub_storage: {
type: "appcache", type: "appcache",
take_installer: true,
manifest: cache_file, manifest: cache_file,
url: site_url origin_url: site_url
} }
}, },
signature_storage: { signature_storage: {
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.33101.25469.11605</string> </value> <value> <string>958.64457.39610.60262</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1491491776.79</float> <float>1493379956.25</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
function FileSystemStorage(spec) { function FileSystemStorage(spec) {
this._document = spec.document; this._document = spec.document;
this._sub_storage = jIO.createJIO(spec.sub_storage); this._sub_storage = jIO.createJIO(spec.sub_storage);
this._id_dict = {"/": {"index.html": {}}}; this._id_dict = {
"/": {"index.html": {}},
"/development/": {"index.html": {}}
};
} }
FileSystemStorage.prototype.get = function (url) { FileSystemStorage.prototype.get = function (url) {
...@@ -20,9 +23,9 @@ ...@@ -20,9 +23,9 @@
FileSystemStorage.prototype.getAttachment = function (doc_id, attachment_id) { FileSystemStorage.prototype.getAttachment = function (doc_id, attachment_id) {
return this._sub_storage.getAttachment( return this._sub_storage.getAttachment(
this._document, this._document,
(attachment_id === "index.html") ? (attachment_id === "index.html") ? ((doc_id === "/") ?
"/" : (doc_id === "/") ? "/" : "development/") : ((doc_id === "/") ?
attachment_id : doc_id + attachment_id attachment_id : doc_id + attachment_id)
); );
}; };
...@@ -66,9 +69,8 @@ ...@@ -66,9 +69,8 @@
} }
if (!context._id_dict.hasOwnProperty(path)) { if (!context._id_dict.hasOwnProperty(path)) {
context._id_dict[path] = {}; context._id_dict[path] = {};
} else {
context._id_dict[path][filename] = {};
} }
context._id_dict[path][filename] = {};
} }
} }
}); });
......
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.33063.40118.853</string> </value> <value> <string>958.64589.19815.17083</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1491489660.03</float> <float>1493382071.89</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment