Commit e3cf9fd9 authored by Vincent Bechu's avatar Vincent Bechu

officejs: adapt officejs to have same site in zip

fix jslint issues.
this commit concern 3 bt5: erp5_officejs, erp5_officejs_jquery_appn erp5_officejs_ooffice
parent 7f7a6be0
......@@ -18,6 +18,6 @@
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">bookmark_module</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Bookmark</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Bookmarks</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -275,7 +275,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>959.26235.2442.22272</string> </value>
<value> <string>959.26241.25958.12748</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -293,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>1494925169.96</float>
<float>1495026940.62</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -19,6 +19,6 @@
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">web_page_module</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Source Code</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Source Code</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -276,7 +276,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.15146.58776.63982</string> </value>
<value> <string>958.44217.46814.8652</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -294,7 +294,7 @@
</tuple>
<state>
<tuple>
<float>1486742099.77</float>
<float>1495026926.96</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -8,7 +8,7 @@
doc = gadget.options.doc,
now = new Date(),
dict_map = {"text/html": "Web Page", "text/javascript": "Web Script", "text/css": "Web Style", "text/cache-manifest": "Web Manifest"};
doc.modification_date = now.toISOString();
for (i = 0; i < submit_event.target.length; i += 1) {
// XXX Should check input type instead
......@@ -44,7 +44,6 @@
return gadget.getSetting("edited_application_name");
})
.push(function (app_name) {
return gadget.updateHeader({
title: doc.reference + ' | ' + app_name
});
......@@ -159,7 +158,7 @@
})
.push(function () {
return gadget.declareGadget(
"../../officejs_codemirror/development/",
"../officejs_codemirror/development/",
{
scope: "my_text_content",
sandbox: "iframe",
......
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.15181.33148.7270</string> </value>
<value> <string>958.44217.46814.8652</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1486976002.41</float>
<float>1495027908.84</float>
<string>UTC</string>
</tuple>
</state>
......
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, URL*/
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, Blob, jIO*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, RSVP, rJS, Handlebars, loopEventListener, URL) {
(function (window, RSVP, rJS, Handlebars, loopEventListener, Blob, jIO) {
"use strict";
function saveContent(gadget, submit_event) {
var i,
doc = gadget.options.doc,
now = new Date(),
blob;
now = new Date();
doc.parent_relative_url = "document_module";
doc.portal_type = "PDF";
doc.modification_date = now.toISOString();
......@@ -29,9 +28,9 @@
if (dataURI.text_content === "data:") {
return new Blob([''], {type: 'application/pdf'});
}
return jIO.util.dataURItoBlob(dataURI['text_content']);
return jIO.util.dataURItoBlob(dataURI.text_content);
})
.push(function(blob) {
.push(function (blob) {
return RSVP.all([
gadget.put(gadget.options.jio_key, doc),
gadget.putAttachment(gadget.options.jio_key, "data", blob)
......@@ -50,8 +49,8 @@
iframe.setAttribute('class', iframe_class_string);
return;
}
iframe_class_string = iframe_class_string.substring(0, class_index)
+ iframe_class_string.substring(class_index + class_name.length);
iframe_class_string = iframe_class_string.substring(0, class_index) +
iframe_class_string.substring(class_index + class_name.length);
iframe.setAttribute('style', 'width:100%; border: 0 none; height: 600px');
iframe.setAttribute('class', iframe_class_string);
return;
......@@ -133,20 +132,22 @@
maximized: gadget.options.doc.title !== ""
});
})
.push(function() {
.push(function () {
return gadget.getAttachment(gadget.options.jio_key, "data");
})
.push(
function (blob_result) {
gadget.props.blob = blob_result;
return gadget.props.deferred.resolve();
}, function (error) {
},
function (error) {
if (error.status_code === 404) {
gadget.props.blob = new Blob([''], {type: 'application/pdf'});
return gadget.props.deferred.resolve();
}
throw new Error(error);
});
}
);
})
/////////////////////////////////////////
......@@ -162,7 +163,7 @@
})
.push(function () {
return gadget.declareGadget(
"../../officejs_pdf_viewer_gadget/development/",
"../officejs_pdf_viewer_gadget/development/",
{
scope: "my_text_content",
sandbox: "iframe",
......@@ -177,16 +178,16 @@
'style',
'width:100%; border: 0 none; height: 600px'
);
iframe.setAttribute(
'allowFullScreen',''
)
iframe.setAttribute('allowFullScreen', '');
return jIO.util.readBlobAsDataURL(gadget.props.blob);
})
.push(function (dataURL) {
if (dataURL.target.result.split('data:')[1] === '') {
dataURL = '';
} else {
dataURL = dataURL.target.result.split(/data:application\/.*;base64,/)[1];
dataURL = dataURL.target.result.split(
/data:application\/.*;base64,/
)[1];
}
return image_content_gadget.render({
"key": 'text_content',
......@@ -206,8 +207,8 @@
gadget.props.element.querySelector(
"form div.center"
);
display_error_element.innerHTML =
'<br/><p style="color: red"></p><br/><br/>' +
display_error_element.innerHTML =
'<br/><p style="color: red"></p><br/><br/>' +
display_error_element.innerHTML;
display_error_element.querySelector('p').textContent =
"TIMEOUT: The editor gadget is taking too long to load but is" +
......@@ -241,4 +242,4 @@
});
});
}(window, RSVP, rJS, Handlebars, loopEventListener, URL));
\ No newline at end of file
}(window, RSVP, rJS, Handlebars, loopEventListener, Blob, jIO));
\ No newline at end of file
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.14783.11634.53896</string> </value>
<value> <string>959.27955.14286.61081</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1486720491.17</float>
<float>1495028385.85</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -40,8 +40,8 @@
iframe.setAttribute('class', iframe_class_string);
return;
}
iframe_class_string = iframe_class_string.substring(0, class_index)
+ iframe_class_string.substring(class_index + class_name.length);
iframe_class_string = iframe_class_string.substring(0, class_index) +
iframe_class_string.substring(class_index + class_name.length);
iframe.setAttribute('style', 'width:100%; border: 0 none; height: 600px');
iframe.setAttribute('class', iframe_class_string);
return;
......@@ -127,7 +127,7 @@
})
.push(function () {
return gadget.declareGadget(
"../../officejs_svg_editor_gadget/development/",
"../officejs_svg_editor_gadget/development/",
{
scope: "my_text_content",
sandbox: "iframe",
......
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.64903.6566.48281</string> </value>
<value> <string>958.44217.46814.8652</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1486559958.6</float>
<float>1495028700.52</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -128,7 +128,7 @@
})
.push(function () {
return gadget.declareGadget(
"../../officejs_ckeditor_gadget/development/",
"../officejs_ckeditor_gadget/development/",
{
scope: "my_text_content",
sandbox: "iframe",
......
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.64903.6566.48281</string> </value>
<value> <string>958.44217.46814.8652</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1486128468.99</float>
<float>1494929588.66</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -19,6 +19,6 @@
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">PDF</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">PDFs</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration">/{+id}/Base_downloadWithCors</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -237,7 +237,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.14778.51039.24610</string> </value>
<value> <string>958.44217.46814.8652</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -255,7 +255,7 @@
</tuple>
<state>
<tuple>
<float>1486719114.33</float>
<float>1495026916.02</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -18,6 +18,6 @@
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">web_page_module</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Illustration</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Illustrations</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -275,7 +275,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.64903.6566.48281</string> </value>
<value> <string>959.27929.64299.36027</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -293,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>1486569304.73</float>
<float>1495026990.92</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -18,6 +18,6 @@
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">web_page_module</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Text Document</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Text Documents</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -279,7 +279,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.64196.10129.12987</string> </value>
<value> <string>959.26305.63504.15360</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -297,7 +297,7 @@
</tuple>
<state>
<tuple>
<float>1481897751.13</float>
<float>1494929538.99</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -465,7 +465,8 @@
</item>
<item>
<key> <string>configuration_sub_gadget_installer</string> </key>
<value> <string>../officejs_ckeditor_gadget/</string> </value>
<value> <string>../officejs_ckeditor_gadget/\n
../officejs_setting_gadget/</string> </value>
</item>
<item>
<key> <string>configuration_translation_gadget_url</string> </key>
......@@ -716,7 +717,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.28725.17257.33109</string> </value>
<value> <string>959.27690.34017.30446</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -734,7 +735,7 @@
</tuple>
<state>
<tuple>
<float>1491232125.67</float>
<float>1495012577.11</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -19,6 +19,6 @@
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Image</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Images</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration">/{+id}/Base_downloadWithCors</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -276,7 +276,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.13501.4478.21947</string> </value>
<value> <string>958.44228.61941.16025</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -294,7 +294,7 @@
</tuple>
<state>
<tuple>
<float>1486654784.41</float>
<float>1495027052.72</float>
<string>UTC</string>
</tuple>
</state>
......
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, URL*/
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, jIO, Blob*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, RSVP, rJS, Handlebars, loopEventListener, URL) {
(function (window, RSVP, rJS, Handlebars, loopEventListener, jIO, Blob) {
"use strict";
function saveContent(gadget, submit_event) {
var i,
doc = gadget.options.doc,
now = new Date(),
blob;
now = new Date();
doc.parent_relative_url = "image_module";
doc.portal_type = "Image";
doc.modification_date = now.toISOString();
......@@ -28,7 +27,7 @@
.push(function (dataURI) {
return jIO.util.dataURItoBlob(dataURI);
})
.push(function(blob) {
.push(function (blob) {
console.log(gadget.options.jio_key);
return RSVP.all([
gadget.put(gadget.options.jio_key, doc),
......@@ -48,8 +47,8 @@
iframe.setAttribute('class', iframe_class_string);
return;
}
iframe_class_string = iframe_class_string.substring(0, class_index)
+ iframe_class_string.substring(class_index + class_name.length);
iframe_class_string = iframe_class_string.substring(0, class_index) +
iframe_class_string.substring(class_index + class_name.length);
iframe.setAttribute('style', 'width:100%; border: 0 none; height: 600px');
iframe.setAttribute('class', iframe_class_string);
return;
......@@ -131,20 +130,22 @@
maximized: gadget.options.doc.title !== ""
});
})
.push(function() {
.push(function () {
return gadget.getAttachment(gadget.options.jio_key, "data");
})
.push(
function (blob_result) {
gadget.props.blob = blob_result;
return gadget.props.deferred.resolve();
}, function (error) {
},
function (error) {
if (error.status_code === 404) {
gadget.props.blob = new Blob([''], {type: 'image/png'});
return gadget.props.deferred.resolve();
}
throw new Error(error);
});
}
);
})
/////////////////////////////////////////
......@@ -160,7 +161,7 @@
})
.push(function () {
return gadget.declareGadget(
"../../officejs_image_editor_gadget/development/",
"../officejs_image_editor_gadget/development/",
{
scope: "my_text_content",
sandbox: "iframe",
......@@ -196,8 +197,8 @@
gadget.props.element.querySelector(
"form div.center"
);
display_error_element.innerHTML =
'<br/><p style="color: red"></p><br/><br/>' +
display_error_element.innerHTML =
'<br/><p style="color: red"></p><br/><br/>' +
display_error_element.innerHTML;
display_error_element.querySelector('p').textContent =
"TIMEOUT: The editor gadget is taking too long to load but is" +
......@@ -231,4 +232,4 @@
});
});
}(window, RSVP, rJS, Handlebars, loopEventListener, URL));
\ No newline at end of file
}(window, RSVP, rJS, Handlebars, loopEventListener, jIO, Blob));
\ No newline at end of file
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.13364.62517.12032</string> </value>
<value> <string>959.27951.29914.64921</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1486634237.39</float>
<float>1495028150.62</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -19,6 +19,6 @@
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Jquery Sheet Document</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Jquery Sheet Documents</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration">/{+id}?format=</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -137,6 +137,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -196,4 +202,63 @@
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.44228.61941.16025</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1495027032.87</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -40,8 +40,8 @@
iframe.setAttribute('class', iframe_class_string);
return;
}
iframe_class_string = iframe_class_string.substring(0, class_index)
+ iframe_class_string.substring(class_index + class_name.length);
iframe_class_string = iframe_class_string.substring(0, class_index) +
iframe_class_string.substring(class_index + class_name.length);
iframe.setAttribute('style', 'width:100%; border: 0 none; height: 600px');
iframe.setAttribute('class', iframe_class_string);
return;
......@@ -140,7 +140,7 @@
})
.push(function () {
return gadget.declareGadget(
"../../officejs_web_table_editor_gadget/development/",
"../officejs_web_table_editor_gadget/development/",
{
scope: "my_text_content",
sandbox: "iframe",
......@@ -164,15 +164,15 @@
return text_gadget.getElement();
}, function (error) {
var display_error_element;
if (error.message.indexOf("Timeout while loading:") === 0
|| error.indexOf("Timed out after ") === 0) {
if (error.message.indexOf("Timeout while loading:") === 0 ||
error.indexOf("Timed out after ") === 0) {
display_error_element =
gadget.props.element.querySelector(
"form div.center"
);
display_error_element.innerHTML =
'<br/><p style="color: red"></p><br/><br/>' +
display_error_element.innerHTML =
'<br/><p style="color: red"></p><br/><br/>' +
display_error_element.innerHTML;
display_error_element.querySelector('p').textContent =
"TIMEOUT: The editor gadget is taking too long to load but is" +
......
......@@ -133,6 +133,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -192,4 +198,63 @@
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.44228.61941.16025</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1495028870.93</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, document, jIO*/
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, document, jIO, Blob*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, document, RSVP, rJS, Handlebars, loopEventListener, jIO) {
(function (window, document, RSVP, rJS, Handlebars, loopEventListener, jIO,
Blob) {
"use strict";
function this_func_link(name) {
......@@ -12,7 +13,7 @@
function renderOnlyOfficeGadget(gadget) {
var text_gadget;
return gadget.declareGadget(
"../../ooffice_presentation_gadget/development/",
"../ooffice_presentation_gadget/development/",
{
scope: "my_text_content",
sandbox: "iframe",
......@@ -61,7 +62,7 @@
}
return undefined;
})
.push(function(datauri) {
.push(function (datauri) {
if (datauri !== undefined) {
return gadget.jio_putAttachment(gadget.options.jio_key, 'data',
jIO.util.dataURItoBlob(datauri.text_content));
......@@ -108,8 +109,8 @@
iframe.setAttribute('class', iframe_class_string);
return true;
}
iframe_class_string = iframe_class_string.substring(0, class_index)
+ iframe_class_string.substring(class_index + class_name.length);
iframe_class_string = iframe_class_string.substring(0, class_index) +
iframe_class_string.substring(class_index + class_name.length);
iframe.setAttribute('style', 'width:100%; border: 0 none; height: 600px');
iframe.setAttribute('class', iframe_class_string);
return false;
......@@ -240,9 +241,9 @@
})
.push(function () {
var iframe;
if (gadget.options.doc.content_type === undefined
|| gadget.options.doc.content_type.indexOf("application/x-asc")
=== 0) {
if (gadget.options.doc.content_type === undefined ||
gadget.options.doc.content_type.indexOf("application/x-asc") === 0
) {
return renderOnlyOfficeGadget(gadget);
}
iframe = document.createElement("iframe");
......@@ -284,4 +285,4 @@
});
});
}(window, document, RSVP, rJS, Handlebars, loopEventListener, jIO));
\ No newline at end of file
}(window, document, RSVP, rJS, Handlebars, loopEventListener, jIO, Blob));
\ No newline at end of file
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.24259.25538.21094</string> </value>
<value> <string>959.27957.34340.51609</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1493306235.69</float>
<float>1495028506.86</float>
<string>UTC</string>
</tuple>
</state>
......
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, document, jIO*/
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, document, jIO, Blob*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, document, RSVP, rJS, Handlebars, loopEventListener, jIO) {
(function (window, document, RSVP, rJS, Handlebars, loopEventListener, jIO,
Blob) {
"use strict";
function this_func_link(name) {
......@@ -12,7 +13,7 @@
function renderOnlyOfficeGadget(gadget) {
var text_gadget;
return gadget.declareGadget(
"../../ooffice_spreadsheet_gadget/development/",
"../ooffice_spreadsheet_gadget/development/",
{
scope: "my_text_content",
sandbox: "iframe",
......@@ -61,7 +62,7 @@
}
return undefined;
})
.push(function(datauri) {
.push(function (datauri) {
if (datauri !== undefined) {
return gadget.jio_putAttachment(gadget.options.jio_key, 'data',
jIO.util.dataURItoBlob(datauri.text_content));
......@@ -108,8 +109,8 @@
iframe.setAttribute('class', iframe_class_string);
return true;
}
iframe_class_string = iframe_class_string.substring(0, class_index)
+ iframe_class_string.substring(class_index + class_name.length);
iframe_class_string = iframe_class_string.substring(0, class_index) +
iframe_class_string.substring(class_index + class_name.length);
iframe.setAttribute('style', 'width:100%; border: 0 none; height: 600px');
iframe.setAttribute('class', iframe_class_string);
return false;
......@@ -240,9 +241,9 @@
})
.push(function () {
var iframe;
if (gadget.options.doc.content_type === undefined
|| gadget.options.doc.content_type.indexOf("application/x-asc")
=== 0) {
if (gadget.options.doc.content_type === undefined ||
gadget.options.doc.content_type.indexOf("application/x-asc") === 0
) {
return renderOnlyOfficeGadget(gadget);
}
iframe = document.createElement("iframe");
......@@ -284,4 +285,4 @@
});
});
}(window, document, RSVP, rJS, Handlebars, loopEventListener, jIO));
\ No newline at end of file
}(window, document, RSVP, rJS, Handlebars, loopEventListener, jIO, Blob));
\ No newline at end of file
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.19300.20652.41830</string> </value>
<value> <string>958.44217.46814.8652</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1486992101.0</float>
<float>1495028583.24</float>
<string>UTC</string>
</tuple>
</state>
......
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, document, jIO*/
/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, document, jIO, Blob*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, document, RSVP, rJS, Handlebars, loopEventListener, jIO) {
(function (window, document, RSVP, rJS, Handlebars, loopEventListener, jIO,
Blob) {
"use strict";
function this_func_link(name) {
......@@ -12,7 +13,7 @@
function renderOnlyOfficeGadget(gadget) {
var text_gadget;
return gadget.declareGadget(
"../../ooffice_text_gadget/development/",
"../ooffice_text_gadget/development/",
{
scope: "my_text_content",
sandbox: "iframe",
......@@ -61,7 +62,7 @@
}
return undefined;
})
.push(function(datauri) {
.push(function (datauri) {
if (datauri !== undefined) {
return gadget.jio_putAttachment(gadget.options.jio_key, 'data',
jIO.util.dataURItoBlob(datauri.text_content));
......@@ -108,8 +109,8 @@
iframe.setAttribute('class', iframe_class_string);
return true;
}
iframe_class_string = iframe_class_string.substring(0, class_index)
+ iframe_class_string.substring(class_index + class_name.length);
iframe_class_string = iframe_class_string.substring(0, class_index) +
iframe_class_string.substring(class_index + class_name.length);
iframe.setAttribute('style', 'width:100%; border: 0 none; height: 600px');
iframe.setAttribute('class', iframe_class_string);
return false;
......@@ -240,9 +241,9 @@
})
.push(function () {
var iframe;
if (gadget.options.doc.content_type === undefined
|| gadget.options.doc.content_type.indexOf("application/x-asc")
=== 0) {
if (gadget.options.doc.content_type === undefined ||
gadget.options.doc.content_type.indexOf("application/x-asc") === 0
) {
return renderOnlyOfficeGadget(gadget);
}
iframe = document.createElement("iframe");
......@@ -284,4 +285,4 @@
});
});
}(window, document, RSVP, rJS, Handlebars, loopEventListener, jIO));
\ No newline at end of file
}(window, document, RSVP, rJS, Handlebars, loopEventListener, jIO, Blob));
\ No newline at end of file
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.24259.25538.21094</string> </value>
<value> <string>959.27960.13177.14967</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1493306197.28</float>
<float>1495099711.3</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -19,6 +19,6 @@
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Presentation</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Presentations</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration">/{+id}/Base_downloadWithCors</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -237,7 +237,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.19397.34664.30720</string> </value>
<value> <string>958.44217.46814.8652</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -255,7 +255,7 @@
</tuple>
<state>
<tuple>
<float>1486996412.14</float>
<float>1495027013.03</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -19,6 +19,6 @@
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Spreadsheet</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Spreadsheets</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration">/{+id}/Base_downloadWithCors</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -237,7 +237,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.19401.10682.18107</string> </value>
<value> <string>959.27932.5510.44339</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -255,7 +255,7 @@
</tuple>
<state>
<tuple>
<float>1486997081.8</float>
<float>1495026996.37</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -19,6 +19,6 @@
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Text</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Text documents</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration">/{+id}/Base_downloadWithCors</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -237,7 +237,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.19360.26821.41676</string> </value>
<value> <string>958.44217.46814.8652</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -255,7 +255,7 @@
</tuple>
<state>
<tuple>
<float>1486996407.54</float>
<float>1495026951.51</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