1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
movim_ynh/sources/app/widgets/AdHoc/adhoc.js

33 lines
878 B
JavaScript

var AdHoc = {
refresh: function() {
var items = document.querySelectorAll('#adhoc_widget li');
var i = 0;
while(i < items.length)
{
items[i].onclick = function() {
AdHoc_ajaxCommand(this.dataset.jid, this.dataset.node);
};
i++;
}
},
initForm: function() {
var textareas = document.querySelectorAll('#dialog form[name=command] textarea');
var i = 0;
while(i < textareas.length)
{
movim_textarea_autoheight(textareas[i]);
i++;
}
},
submit: function() {
var form = document.querySelector('#dialog form[name=command]');
AdHoc_ajaxSubmit(movim_parse_form('command'), form.dataset.node, form.dataset.sessionid);
}
}
MovimWebsocket.attach(function() {
AdHoc_ajaxGet();
});