Commit 05778cfc authored by Hamza Chahed's avatar Hamza Chahed

update notebook module to synchronize with officejs_notebook

parent bfa143c0
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_list</string> <string>action_type/object_view</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_list</string> </value> <value> <string>object_view</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>icon</string> </key> <key> <string>icon</string> </key>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
</permission> </permission>
<permission type='tuple'> <permission type='tuple'>
<name>Access contents information</name> <name>Access contents information</name>
<role>Anonymous</role>
<role>Assignee</role> <role>Assignee</role>
<role>Assignor</role> <role>Assignor</role>
<role>Associate</role> <role>Associate</role>
......
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
<item> <item>
<key> <string>group_list</string> </key> <key> <string>group_list</string> </key>
<value> <value>
<tuple> <tuple/>
<string>document</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -74,6 +74,10 @@ ...@@ -74,6 +74,10 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </tuple>
<tuple>
<string>filename</string>
<string>Filename</string>
</tuple>
<tuple> <tuple>
<string>reference</string> <string>reference</string>
<string>Reference</string> <string>Reference</string>
......
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
<string>my_effective_date</string> <string>my_effective_date</string>
<string>my_revision</string> <string>my_revision</string>
<string>my_translated_portal_type</string> <string>my_translated_portal_type</string>
<string>my_filename</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_filename</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_filename</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -512,31 +512,6 @@ ...@@ -512,31 +512,6 @@
}; };
} }
///P
function download() {
//remove the default margin
var style = document.createElement('style');
style.setAttribute("type", "text/css");
style.setAttribute("media", "print");
var multiStr = [
"@page{",
"size: auto;",
"margin: 0mm;",
"margin-right: 3%;",
"margin-left:3%;}"
].join("\n");
style.innerHTML = multiStr;
document.head.appendChild(style);
// remove-insert download-button
var button = document.createElement('botton');
button = document.body.firstChild;
document.body.removeChild(button);
window.print();
document.body.insertBefore(button, document.body.firstChild);
}
///P
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
var jsmd = document.querySelector('[type="text/x-jsmd"]').textContent, var jsmd = document.querySelector('[type="text/x-jsmd"]').textContent,
...@@ -549,22 +524,6 @@ ...@@ -549,22 +524,6 @@
queue.push(deferCellExecution(cell_list[i])); queue.push(deferCellExecution(cell_list[i]));
} }
return queue return queue
///P
.push(function () {
var button = document.createElement('botton');
button.innerHTML = "Download As PDF";
button.setAttribute("type", "button");
document.body.insertBefore(button, document.body.firstChild);
document.querySelector('[type="button"]').addEventListener("click", download);
//
var script = document.createElement('script');
script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js");
document.head.appendChild(script);
script.setAttribute("src", "https://html2canvas.hertzen.com/dist/html2canvas.min.js");
document.head.appendChild(script);
//
})
///P
.push(function () { .push(function () {
console.info('JSMD executed.'); console.info('JSMD executed.');
}, function (error) { }, function (error) {
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
.push(function (evt) { .push(function (evt) {
*/ */
// XXX Insecure // XXX Insecure
iframe.setAttribute("sandbox", "allow-scripts allow-same-origin allow-modals");///P iframe.setAttribute("sandbox", "allow-scripts allow-same-origin allow-modals");
// iframe.setAttribute("csp", "default-src *; script-src * 'unsafe-inline';"); // iframe.setAttribute("csp", "default-src *; script-src * 'unsafe-inline';");
// iframe.setAttribute("src", evt.target.result); // iframe.setAttribute("src", evt.target.result);
iframe.setAttribute("srcdoc", doc.documentElement.outerHTML); iframe.setAttribute("srcdoc", doc.documentElement.outerHTML);
......
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