X-Git-Url: http://cgit.babelmonkeys.de/?p=adhocweb.git;a=blobdiff_plain;f=js%2Fmain.js;h=9f802b5f8e8bea4f4af7bb1334e5beee1ed04384;hp=c20969d3d5a59c1e9e250eac5b5d993743aa522f;hb=38cd189c63c36d684943f0c21e32d4933e26863c;hpb=83dffb602a2d29d0f0030ba171c722ae254a37ca diff --git a/js/main.js b/js/main.js index c20969d..9f802b5 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,8 @@ function onConnect(status) { } } else if (status == Strophe.Status.CONNECTED) { log('Strophe is connected.'); + queryJID = connection.domain; + $('#query').show(); checkFeatures(); } } @@ -54,85 +58,115 @@ function addForm(elem, x) { form.submit(function(){return false;}); 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")) { - $("