// adhocweb // Copyright (c) 2010-2013 Florian Zeitz // This project is MIT licensed. // http://git.babelmonkeys.de/?p=adhocweb.git;a=blob_plain;f=js/adhoc.js Strophe.addNamespace('ADHOC', 'http://jabber.org/protocol/commands') function Adhoc (view, readycb) { this.status = { sessionid: null, cmdNode: null, queryJID: null, readycb: readycb, view: view } } Adhoc.prototype = { constructor: Adhoc, addNote: function (text, type) { if (!type) { type = 'info' } text = text.replace(/\n/g, '
') $(this.status.view).append(`

${text}

`) }, addForm: function (x) { let self = this let form = $(`
`) form.submit(function (event) { self.executeCommand('execute', self.serializeToDataform('form'), function (e) { self.displayResult(e) }) event.preventDefault() }) let fieldset = $('
') form.append(fieldset) $(x).find('title').each(function () { $('').text($(this).text()).appendTo(fieldset) }) $(x).find('instructions').each(function () { $('

').text($(this).text()).appendTo(fieldset) }) $(x).find('field').each(function () { let clearfix = $(`

`) let item = self.buildHTMLField(this) let label = $(this).attr('label') if (label) { $('