Commit 99f663ef authored by Lu Xu's avatar Lu Xu 👀

erp5_officejs: Added "reload()" to home page and added reply to sound module

parent f8b53e24
......@@ -104,6 +104,9 @@
"message": "Data created",
"status": "success"
});
})
.push(function () {
return window.location.reload();
});
}
});
......
......@@ -227,7 +227,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.54308.37653.52753</string> </value>
<value> <string>977.21650.34066.23296</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -245,7 +245,7 @@
</tuple>
<state>
<tuple>
<float>1562162159.44</float>
<float>1564133050.91</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -11,9 +11,10 @@
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateDocument", "updateDocument")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("jio_get", "jio_get")
/////////////////////////////////////////////////////////////////
......@@ -28,8 +29,11 @@
gadget.type = options.doc.type;
return RSVP.Queue()
.push(function () {
return gadget.jio_get(options.jio_key)
.push(function (content) {
state.content = content;
state.text = content.text_content;
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
......@@ -76,6 +80,12 @@
});
return queue;
})
.push(function (result1) {
var reply = result1.reply;
return gadget.updateDocument({
'text_content': gadget.state.content.text_content + "\n" + reply
});
})
.push(function () {
return gadget.notifySubmitted({
"message": "Data updated",
......@@ -136,6 +146,29 @@
"accept": "audio/*",
"capture": "microphone",
"type": "FileField"
},
"my_text_content": {
"default": gadget.state.content.text_content,
"css_class": "",
"required": 0,
"editable": 0,
"key": "text_content",
"hidden": 0,
"title": 'History',
"type": "TextAreaField"
},
"my_reply": {
"default": "",
"title": "Reply",
"css_class": "",
"required": 0,
"editable": 1,
"key": "reply",
"hidden": 0,
"renderjs_extra": '{"editor": "fck_editor"}',
"type": "GadgetField",
"url": "gadget_editor.html",
"sandbox": "public"
}
}
},
......@@ -149,7 +182,13 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_actual_audio"], ["my_audio"]]
[["my_title"], ["my_actual_audio"]]
], [
"center",
[["my_text_content"]]
], [
"bottom",
[["my_reply"]]
]]
}
});
......
......@@ -239,7 +239,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.51362.22678.44731</string> </value>
<value> <string>977.20585.17207.5017</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>1523439507.26</float>
<float>1564070446.12</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