Commit 5d6d2ec7 authored by Roque's avatar Roque

erp5_officejs: control export pdf action submit

- this change relies on erp5_notebook bt changes done in this MR: nexedi/erp5-bin!6
parent e45dd6bd
...@@ -35,32 +35,39 @@ ...@@ -35,32 +35,39 @@
}) })
.push(function (result) { .push(function (result) {
var print_preview_window, var print_preview_window,
pagedjs_style = document.createElement('link'), pagedjs_style = document.createElement('link'),
pagedjs_script = document.createElement('script'), pagedjs_script = document.createElement('script'),
html_data = result.element html_data = result.element
.querySelector('[data-gadget-scope="editor"]').firstChild .querySelector('[data-gadget-scope="editor"]').firstChild
.contentDocument.body.firstChild.contentDocument.firstChild; .contentDocument.body.firstChild.contentDocument.firstChild;
pagedjs_style.setAttribute('type', 'text/css'); var notebook_execution_done = html_data.querySelector('[id="jsmd_eval_done"]');
pagedjs_style.setAttribute('href', 'interface.css'); if (!notebook_execution_done) {
pagedjs_script.setAttribute('src', 'paged.polyfill.js'); return_submit_dict.notify = {
pagedjs_script.setAttribute('id', 'paged-js-source'); message: "Wait until the notebook is fully executed",
print_preview_window = window.open('', '', 'height=400,width=800'); status: "error"
print_preview_window.document.write(html_data.innerHTML); };
print_preview_window.document.head.appendChild(pagedjs_style); } else {
print_preview_window.document.head.appendChild(pagedjs_script); pagedjs_style.setAttribute('type', 'text/css');
print_preview_window.document.close(); pagedjs_style.setAttribute('href', 'interface.css');
print_preview_window.print(); pagedjs_script.setAttribute('src', 'paged.polyfill.js');
}) pagedjs_script.setAttribute('id', 'paged-js-source');
.push(function () { print_preview_window = window.open('', '', 'height=400,width=800');
return_submit_dict.redirect = { print_preview_window.document.write(html_data.innerHTML);
command: 'display', print_preview_window.document.head.appendChild(pagedjs_style);
options: { print_preview_window.document.head.appendChild(pagedjs_script);
jio_key: parent_options.jio_key, print_preview_window.document.close();
editable: true print_preview_window.print();
} return_submit_dict.redirect = {
}; command: 'display',
options: {
jio_key: parent_options.jio_key,
editable: true
}
};
}
return return_submit_dict; return return_submit_dict;
}, function (error) { })
.push(undefined, function (error) {
console.log("ERROR:", error); console.log("ERROR:", error);
return_submit_dict.notify = { return_submit_dict.notify = {
message: "Failure exporting document", message: "Failure exporting document",
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.17537.2534.409</string> </value> <value> <string>987.17718.49419.27716</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602602949.99</float> <float>1602614478.01</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