init
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
var AdHoc = {
|
||||
refresh: function () {
|
||||
var items = document.querySelectorAll('.adhoc_widget .actions li:not(.subheader)');
|
||||
var i = 0;
|
||||
|
||||
while (i < items.length) {
|
||||
items[i].onclick = function () {
|
||||
Drawer.clear();
|
||||
AdHoc_ajaxCommand(this.dataset.jid, this.dataset.node);
|
||||
};
|
||||
|
||||
i++;
|
||||
}
|
||||
},
|
||||
initForm: function () {
|
||||
var form = document.querySelector('#dialog form[name=command]');
|
||||
|
||||
if (form) {
|
||||
form.addEventListener('input', e => AdHoc.checkFormValidity());
|
||||
}
|
||||
|
||||
AdHoc.checkFormValidity();
|
||||
},
|
||||
submit: function (jid, action) {
|
||||
var form = document.querySelector('#dialog form[name=command]');
|
||||
AdHoc_ajaxSubmit(
|
||||
jid,
|
||||
form.dataset.node,
|
||||
MovimUtils.formToJson('command'),
|
||||
form.dataset.sessionid,
|
||||
action
|
||||
);
|
||||
},
|
||||
checkFormValidity: function () {
|
||||
var form = document.querySelector('#dialog form[name=command]');
|
||||
var action = document.querySelector('#dialog #adhoc_action');
|
||||
|
||||
if (form && action) {
|
||||
if (form.checkValidity()) {
|
||||
action.classList.remove('disabled');
|
||||
} else {
|
||||
action.classList.add('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MovimWebsocket.attach(function () {
|
||||
var parts = MovimUtils.urlParts();
|
||||
|
||||
if (parts.page === "configuration") {
|
||||
AdHoc_ajaxGet();
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
[adhoc]
|
||||
title = Actions
|
||||
completed = Action completed
|
||||
|
||||
[tools]
|
||||
title = Developer Tools
|
||||
sdp_to_jingle = Convert SDP to Jingle
|
||||
sdp_title = SDP
|
||||
jingle_to_sdp = Convert Jingle to SDP
|
||||
jingle_title = Jingle stanza
|
||||
Reference in New Issue
Block a user