]> cgit.babelmonkeys.de Git - adhocweb.git/blobdiff - js/adhoc.js
Move Strophe.addNamespace call to adhoc.js
[adhocweb.git] / js / adhoc.js
index 574c5a65fb24949b4e052ea71640669afceaffba..02be46c6342512080f728e4c18c5a8261c54321f 100644 (file)
@@ -1,3 +1,5 @@
+Strophe.addNamespace("ADHOC", "http://jabber.org/protocol/commands");
+
 var Adhoc = {
     status: {
         sessionid: null,
@@ -148,10 +150,7 @@ var Adhoc = {
         if (status == "executing") {
             for (kind in kinds) {
                 input = $("<input type='button' disabled='disabled' value='" + kinds[kind] + "'/>").click(function() {
-                    if (kind == 'prev')
-                        Adhoc.executeCommand(kind, false, function(e) { Adhoc.displayResult(elem, e) });
-                    else
-                        Adhoc.executeCommand(kind, Adhoc.serializeToDataform('form'), function(e) { Adhoc.displayResult(elem, e) });
+                    Adhoc.executeCommand(kind, (kind != 'prev') && Adhoc.serializeToDataform('form'), function(e) { Adhoc.displayResult(elem, e) });
                 });
                 if ($(result).find('actions ' + kind).length > 0)
                     input.removeAttr("disabled");