Commit 81e17101 authored by Ayush Tiwari's avatar Ayush Tiwari

[erp5_officejs] Use upload_dict instead of file_extension to check for correct...

[erp5_officejs] Use upload_dict instead of file_extension to check for correct file-type during notebook upload

Also, exlicitly specify the txt extension during download
parent a1bfdf1b
......@@ -7,7 +7,7 @@
var element = gadget.element,
a = window.document.createElement("a"),
url = window.URL.createObjectURL(new Blob([text_content], {type: 'text/plain'})),
name_list = [title, ""];
name_list = [title, "txt"];
element.appendChild(a);
a.style = "display: none";
a.href = url;
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.45826.52399.62105</string> </value>
<value> <string>970.45827.27759.62020</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1538576845.41</float>
<float>1539074452.96</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -30,7 +30,7 @@
form_gadget.getContent(),
gadget.getSetting('portal_type'),
gadget.getSetting('content_type'),
gadget.getSetting('file_extension'),
gadget.getSetting('upload_dict'),
gadget.getSetting('parent_relative_url')
]);
})
......@@ -38,7 +38,7 @@
var file_name_list, data, filename, queue;
if (result[0].file !== undefined) {
file_name_list = result[0].file.file_name.split('.');
if (file_name_list[1] === result[3]) {
if (file_name_list[file_name_list.length - 1] in window.JSON.parse(result[3])) {
filename = file_name_list[0];
data = jIO.util.dataURItoBlob(result[0].file.url);
queue = new RSVP.Queue()
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.46986.44531.11520</string> </value>
<value> <string>970.53127.14817.13977</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1538753872.44</float>
<float>1539074713.77</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