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