X-Git-Url: http://cgit.babelmonkeys.de/?p=adhocweb.git;a=blobdiff_plain;f=js%2Fmain.js;h=6bd32412743739166210a6cc07f5d3c9e3df1a29;hp=3c42647592beb91644d684c169fc7af0a459ed29;hb=e5d4fe480e02907b80e91d9ed42854700c5866c1;hpb=907bec3b47789820c53a68559c5ca15d9f899bec diff --git a/js/main.js b/js/main.js index 3c42647..6bd3241 100644 --- a/js/main.js +++ b/js/main.js @@ -1,5 +1,4 @@ var BOSH_SERVICE = 'http://localhost:5280/http-bind/'; - var show_log = false; Strophe.addNamespace("ADHOC", "http://jabber.org/protocol/commands"); @@ -8,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)); @@ -40,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(); } } @@ -48,12 +51,13 @@ 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(){return false;}); + form.submit(function(event){event.preventDefault();}); var fieldset = $("
"); form.append(fieldset); if ($(x).find("title").length > 0) @@ -65,6 +69,7 @@ function addForm(elem, x) { var type = $(this).attr("type"); if($(this).attr("label")) { $("