luci2: implement LuCI2.cbi.ButtonValue widget
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 31 Jan 2014 21:44:49 +0000 (21:44 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 31 Jan 2014 21:44:49 +0000 (21:44 +0000)
luci2/htdocs/luci2/luci2.js

index fe73a95..fc3c3fc 100644 (file)
@@ -5915,6 +5915,21 @@ function LuCI2()
                }
        });
 
                }
        });
 
+       this.cbi.ButtonValue = this.cbi.AbstractValue.extend({
+               widget: function(sid)
+               {
+                       this.options.optional = true;
+
+                       var btn = $('<button />')
+                               .addClass('btn btn-default')
+                               .attr('id', this.id(sid))
+                               .attr('type', 'button')
+                               .text(this.label('text'));
+
+                       return this.validator(sid, btn);
+               }
+       });
+
        this.cbi.NetworkList = this.cbi.AbstractValue.extend({
                load: function(sid)
                {
        this.cbi.NetworkList = this.cbi.AbstractValue.extend({
                load: function(sid)
                {