]> git.babelmonkeys.de Git - adhocweb.git/commitdiff
Bootstrap compatibility
authorFlorian Zeitz <florob@babelmonkeys.de>
Thu, 19 Jan 2012 21:06:58 +0000 (22:06 +0100)
committerFlorian Zeitz <florob@babelmonkeys.de>
Thu, 19 Jan 2012 21:06:58 +0000 (22:06 +0100)
index.html
js/adhoc.js
style.css

index acf79d341defb98ddc8cc353e0f0c41f79bb192d..05983b6fe5629a92208c83034979456a20fb3960 100644 (file)
 <div id='login'>
   <form id='cred' action='#'>
     <fieldset>
-      <label for='jid'>JID:</label><br/>
+      <label for='jid'>JID:</label>
       <input type='text' id='jid' />
-      <br/>
-      <label for='pass'>Password:</label><br/>
+      <label for='pass'>Password:</label>
       <input type='password' id='pass' />
-      <br/>
       <input type='submit' id='connect' value='connect' />
     </fieldset>
   </form>
index 0266318c9e99626dd0b9d0a053ffc2899e54e02d..3638eef87a99fc4c0c86040c228b340a26a690b0 100644 (file)
@@ -46,7 +46,7 @@ Adhoc.prototype = {
 
     addForm: function (x) {
         var self = this;
-        var form = $("<form action='#'/>");
+        var form = $("<form class='form-stacked' action='#'/>");
         form.submit(function(event) {
             self.executeCommand("execute", self.serializeToDataform('form'),
                 function(e) { self.displayResult(e) });
@@ -57,17 +57,16 @@ Adhoc.prototype = {
         $(x).find("title").each(function() { $("<legend/>").text($(this).text()).appendTo(fieldset); });
         $(x).find("instructions").each(function() { $("<p/>").text($(this).text()).appendTo(fieldset); });
         $(x).find("field").each(function() {
+           var clearfix = $("<div class='clearfix'/>");
             var item = self.buildHTMLField(this);
             var label = $(this).attr("label");
             if(label) {
-                $("<label/>").text(label).attr("for", $(this).attr("var")).appendTo(fieldset);
-                $("<br/>").appendTo(fieldset);
+                $("<label/>").text(label).attr("for", $(this).attr("var")).appendTo(clearfix);
             }
             if ($(x).attr("type") === "result")
                 item.attr("readonly", true);
-            fieldset.append(item);
-            if ($(this).attr("type") !== "hidden")
-                fieldset.append("<br/>");
+            clearfix.append(item);
+            fieldset.append(clearfix);
         });
         $(self.status.view).append(form);
     },
@@ -167,24 +166,26 @@ Adhoc.prototype = {
             }
         });
         if (status === "executing") {
+           var controls = $("<div class='actions'/>");
             for (kind in kinds) {
+               var input;
                 (function(type) {
-                    input = $("<input type='button' disabled='disabled' value='" + kinds[type] + "'/>").click(function() {
+                    input = $("<input type='button' disabled='disabled' class='btn' value='" + kinds[type] + "'/>").click(function() {
                         self.executeCommand(type, (type!= 'prev') && self.serializeToDataform('form'), function(e) { self.displayResult(e) });
-                    });
+                    }).appendTo(controls);
                 })(kind);
                 if ($(result).find('actions ' + kind).length > 0)
                     input.removeAttr("disabled");
-                $(self.status.view).append(input);
             }
 
-            $("<input type='button' id='executeButton' value='Execute'/>").click(function() {
+            $("<input type='button' id='executeButton' class='btn primary' value='Execute'/>").click(function() {
                 self.executeCommand("execute", self.serializeToDataform('form'), function(e) { self.displayResult(e) });
-            }).appendTo(self.status.view);
+            }).appendTo(controls);
 
-            $("<input type='button' value='Cancel'/>").click(function() {
+            $("<input type='button' class='btn' value='Cancel'/>").click(function() {
                 self.cancelCommand(function(e) { self.displayResult(e) });
-            }).appendTo(self.status.view);
+            }).appendTo(controls);
+           $(self.status.view + " fieldset").append(controls);
         } else {
            self.status.sessionid = null;
            self.status.cmdNode = null;
index b26b844f5226fdc3be6e7c2ed05ce31f1f0fe57c..7ad659182a872adfad8f4c1496b554ef244c1f71 100644 (file)
--- a/style.css
+++ b/style.css
@@ -17,6 +17,10 @@ a {
   color: #0000FF
 }
 
+label {
+  display: block
+}
+
 #log_container {
   display: none
 }