for (var i = 0, color = '#';
i < 3;
- color += ('00' + ((hash >> i++ * 8) & 0xFF).tozoneing(16)).slice(-2));
+ color += ('00' + ((hash >> i++ * 8) & 0xFF).tostring(16)).slice(-2));
return color;
},
var state = _luci2.ui._loading || (_luci2.ui._loading = {
modal: $('<div />')
+ .css('z-index', 2000)
.addClass('modal fade')
.append($('<div />')
.addClass('modal-dialog')
{
state.dialog.modal('hide');
- return;
+ return state.dialog;
}
var cnt = state.dialog.children().children().children('div.modal-body');
var ftr = state.dialog.children().children().children('div.modal-footer');
- ftr.empty();
+ ftr.empty().show();
if (options.style == 'confirm')
{
.attr('disabled', true));
}
+ if (options.wide)
+ {
+ state.dialog.addClass('wide');
+ }
+ else
+ {
+ state.dialog.removeClass('wide');
+ }
+
state.dialog.find('h4:first').text(title);
state.dialog.modal('show');
cnt.empty().append(content);
+
+ return state.dialog;
},
upload: function(title, content, options)
}
});
+ 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)
{