wn.ui.AppFrame = Class.extend({ init: function(parent, title) { this.buttons = {}; this.$w = $('
').appendTo(parent); this.$titlebar = $(' ').appendTo(this.$w); this.$w.find('.close').click(function() { window.history.back(); }) if(title) this.title(title); }, title: function(txt) { this.$titlebar.find('.appframe-title').html(txt); }, add_button: function(label, click, icon) { this.add_toolbar(); args = { label: label, icon:'' }; if(icon) { args.icon = ''; } this.buttons[label] = $(repl('', args)) .click(click) .appendTo(this.toolbar); return this.buttons[label]; }, clear_buttons: function() { this.toolbar && this.toolbar.empty(); }, add_toolbar: function() { if(!this.toolbar) this.$w.append(''); this.toolbar = this.$w.find('.appframe-toolbar'); }, add_label: function(label) { return $(""+label+" ").appendTo(this.toolbar); }, add_select: function(label, options) { this.add_toolbar(); return $("