diff --git a/js/wn/ui/appframe.js b/js/wn/ui/appframe.js new file mode 100644 index 0000000000..3d5ee5639f --- /dev/null +++ b/js/wn/ui/appframe.js @@ -0,0 +1,33 @@ +wn.ui.AppFrame = Class.extend({ + init: function(parent) { + this.buttons = {}; + this.$w = $('
').appendTo(parent); + + this.$titlebar = $('
\ + \ + ×\ +
').appendTo(this.$w); + + this.$w.find('.close').click(function() { + window.history.back(); + }) + + }, + add_button: function(label, click, icon) { + if(!this.$w.find('.appframe-toolbar').length) + this.$w.append('
'); + + args = { label: label, icon:'' }; + if(icon) { + args.icon = ''; + } + this.buttons[label] = $(repl('', args)) + .click(click) + .appendTo(this.$w.find('.appframe-toolbar')); + return this.buttons[label]; + }, + clear_buttons: function() { + this.$w.find('.appframe-toolbar').empty(); + } +}) \ No newline at end of file