X-Git-Url: http://cgit.babelmonkeys.de/?p=adhocweb.git;a=blobdiff_plain;f=js%2Fmain.js;h=a0800ad54ddecfbcd4d7f0ccff4c3c48a65fe641;hp=fb76f3810bc0c361f4e453f5c137eee32cd9cc51;hb=eea26db826d1821aa4268fa8ccba484bff97a5bb;hpb=043000b3ce1e5b64299def211df4306df2b06315 diff --git a/js/main.js b/js/main.js index fb76f38..a0800ad 100644 --- a/js/main.js +++ b/js/main.js @@ -1,4 +1,5 @@ var BOSH_SERVICE = 'http://localhost:5280/http-bind/'; +var show_log = false; Strophe.addNamespace("ADHOC", "http://jabber.org/protocol/commands"); @@ -6,6 +7,7 @@ var localJID = null; var connection = null; var sessionid = null; var cmdNode = null; +var queryJID = null; function log(msg) { var entry = $('
').append(document.createTextNode(msg)); @@ -38,6 +40,9 @@ function onConnect(status) { } } else if (status == Strophe.Status.CONNECTED) { log('Strophe is connected.'); + queryJID = connection.domain; + $('#queryJID').val(queryJID); + $('#query').show(); checkFeatures(); } } @@ -51,16 +56,19 @@ function addNote(elem, text, type) { function addForm(elem, x) { var form = $("
"); - form.submit(function(){return false;}); + form.submit(function(event){event.preventDefault();}); var fieldset = $("
"); form.append(fieldset); - $("").text($(x).find("title").text()).appendTo(fieldset); - $("

").text($(x).find("instructions").text()).appendTo(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")) { $("