Commit d6a86166 authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: schema_editor: remove unused code

parent c9f2cb68
...@@ -3,17 +3,6 @@ ...@@ -3,17 +3,6 @@
(function (window, rJS, RSVP) { (function (window, rJS, RSVP) {
"use strict"; "use strict";
var content_type = {
Spreadsheet: 'application/x-asc-spreadsheet',
Presentation: 'application/x-asc-presentation',
Text: 'application/x-asc-text'
},
file_ext = {
Spreadsheet: 'xlsy',
Presentation: 'ppty',
Text: 'docy'
};
rJS(window) rJS(window)
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Acquired methods // Acquired methods
...@@ -31,18 +20,12 @@ ...@@ -31,18 +20,12 @@
var gadget = this; var gadget = this;
return RSVP.Queue() return RSVP.Queue()
.push(function () { .push(function () {
var portal_type = options.portal_type, var ret = {
ext = file_ext[portal_type],
ret = {
title: "Untitled Document", title: "Untitled Document",
portal_type: "JSON Document", portal_type: "JSON Document",
schema: options.schema, schema: options.schema,
parent_relative_url: "document_module", parent_relative_url: "document_module"
content_type: content_type[portal_type] || undefined
}; };
if (ext) {
ret.filename = "default." + ext;
}
return gadget.jio_post(ret); return gadget.jio_post(ret);
}) })
.push(function (id) { .push(function (id) {
......
...@@ -3,18 +3,6 @@ ...@@ -3,18 +3,6 @@
(function (window, rJS, RSVP, Blob) { (function (window, rJS, RSVP, Blob) {
"use strict"; "use strict";
var content_type = {
Spreadsheet: 'application/x-asc-spreadsheet',
Presentation: 'application/x-asc-presentation',
Text: 'application/x-asc-text'
};
var file_ext = {
Spreadsheet: 'xlsy',
Presentation: 'ppty',
Text: 'docy'
};
rJS(window) rJS(window)
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Acquired methods // Acquired methods
...@@ -30,21 +18,15 @@ ...@@ -30,21 +18,15 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// declared methods // declared methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) { .declareMethod("render", function () {
var gadget = this, var gadget = this,
portal_type = options.portal_type,
ext = file_ext[portal_type],
ret = { ret = {
title: "Untitled Schema", title: "Untitled Schema",
portal_type: "JSON Schema", portal_type: "JSON Schema",
parent_relative_url: "schema_module", parent_relative_url: "schema_module"
content_type: content_type[portal_type] || undefined
}; };
return RSVP.Queue() return RSVP.Queue()
.push(function () { .push(function () {
if (ext) {
ret.filename = "default." + ext;
}
return gadget.jio_post(ret); return gadget.jio_post(ret);
}) })
.push(function (id) { .push(function (id) {
......
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