function on_event(t, k, v) {
window.dbui.client.on_event(t, k, v);
};
function activate_tab(id, idx) {
UIkit.tab(document.getElementById(id)).show(idx);
};
function wire_textarea(id) {
var el = document.getElementById(id);
var savedValue = el.value;
el.value = '';
el.baseScrollHeight = el.scrollHeight;
el.value = savedValue;
el.oninput = function() {
var minRows = this.getAttribute('data-min-rows')|0, rows;
this.rows = minRows;
rows = Math.ceil((this.scrollHeight - this.baseScrollHeight + 48) / 24);
this.rows = minRows + rows;
}
el.oninput();
};
function notify(level, content) {
UIkit.notification(content, { status: level });
};
window.dbui = {
on_event: on_event,
activate_tab: activate_tab,
wire_textarea: wire_textarea,
notify: notify
};