X-Git-Url: http://cgit.babelmonkeys.de/?p=adhocweb.git;a=blobdiff_plain;f=js%2Fmain.js;h=73ace060a8394f96a984b32e9ba61fa9080e287c;hp=955ceb9f5d9a0795529b5f9a9d577e134789b73c;hb=e55b23864a9911c15d930b43ed9afe1df5943bf7;hpb=c61edf2757c92c0460b9e0581771f7a9b06ed1ba diff --git a/js/main.js b/js/main.js index 955ceb9..73ace06 100644 --- a/js/main.js +++ b/js/main.js @@ -1,15 +1,8 @@ var BOSH_SERVICE = 'http://localhost:5280/http-bind/'; var show_log = true; -Strophe.addNamespace("ADHOC", "http://jabber.org/protocol/commands"); - var localJID = null; var connection = null; -var adhoc_status = { - sessionid: null, - cmdNode: null, - queryJID: null -}; function log(msg) { var entry = $('
').append(document.createTextNode(msg)); @@ -42,243 +35,12 @@ function onConnect(status) { } } else if (status == Strophe.Status.CONNECTED) { log('Strophe is connected.'); - adhoc_status.queryJID = connection.domain; - $('#queryJID').val(adhoc_status.queryJID); + $('#queryJID').val(connection.domain); $('#query').show(); - checkFeatures(); - } -} - -function addNote(elem, text, type) { - if (!type) { - type = "info"; - } - text = text.replace(/\n/g, "
"); - $(elem).append("

" + text + "

"); -} - -function addForm(elem, x) { - var form = $("
"); - form.submit(function(event){event.preventDefault();}); - var fieldset = $("
"); - form.append(fieldset); - if ($(x).find("title").length > 0) - $("").text($(x).find("title").text()).appendTo(fieldset); - if ($(x).find("instructions").length > 0) - $("

").text($(x).find("instructions").text()).appendTo(fieldset); - $(x).find("field").each(function() { - var item = null; - var type = $(this).attr("type"); - if($(this).attr("label")) { - $("