Commit d6a86166 authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: schema_editor: remove unused code

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