(function(){var b={}.hasOwnProperty,c=function(g,e){for(var d in e){if(b.call(e,d)){g[d]=e[d]}}function f(){this.constructor=g}f.prototype=e.prototype;g.prototype=new f();g.__super__=e.prototype;return g},a=function(d,e){return function(){return d.apply(e,arguments)}};window.Controls.dialog=(function(e){c(d,e);function d(){return d.__super__.constructor.apply(this,arguments)}d.prototype.createDom=function(){return'<div class="control container dialog '+(this.s(this.properties.style))+'">\n    <div class="backdrop">\n        <div class="content">\n            <div class="--child-container">\n                <children>\n            </div>\n        </div>\n    </div>\n</div>'};d.prototype.setupDom=function(l){var i,h,k,g,j,f;d.__super__.setupDom.call(this,l);if(this.properties.buttons){this.buttons=$('<div class="buttons"></div>');$(this.dom).find(">.backdrop>.content").append(this.buttons);h=new Controls.hc(this.ui);h.setupDom();this.buttons.append(h.dom);j=this.properties.buttons;f=[];for(k=0,g=j.length;k<g;k++){i=j[k];f.push((function(m){return function(o){var n;n=new Controls.button(m.ui,{text:o.text,icon:o.icon,style:"normal"});n.setupDom();n.on_click=function(){return m.event("button",{button:o.id})};return h.append(n)}})(this)(i))}return f}};return d})(window.Control);window.Controls.inputdialog=(function(e){c(d,e);function d(){return d.__super__.constructor.apply(this,arguments)}d.prototype.createDom=function(){var f;this.input=new Controls.textbox(this.ui,{value:this.properties.value},[]);f=new Controls.pad(this.ui,{},[new Controls.hc(this.ui,{},[new Controls.label(this.ui,{text:this.properties.text},[]),this.input])]);return d.__super__.createDom.call(this)};d.prototype.setupDom=function(f){this.properties.buttons=[{text:"OK",id:"ok"},{text:"Cancel",id:"cancel"}];return d.__super__.setupDom.call(this,f)};d.prototype.detectUpdates=function(){var f,g;f={};g=this.input.getValue();if(g!==this.properties.value){f.value=g}this.properties.value=g;return f};return d})(Controls.dialog);window.Controls.openfiledialog=(function(e){c(d,e);function d(){return d.__super__.constructor.apply(this,arguments)}d.prototype.setupDom=function(f){this.properties.buttons=[{text:"Cancel",id:"cancel"}];return d.__super__.setupDom.call(this,f)};return d})(Controls.dialog);window.Controls.opendirdialog=(function(e){c(d,e);function d(){return d.__super__.constructor.apply(this,arguments)}d.prototype.setupDom=function(f){this.properties.buttons=[{text:"Select",id:"select"},{text:"Cancel",id:"cancel"}];return d.__super__.setupDom.call(this,f)};return d})(Controls.dialog);window.Controls.savefiledialog=(function(d){c(e,d);function e(){this.on_button=a(this.on_button,this);return e.__super__.constructor.apply(this,arguments)}e.prototype.setupDom=function(f){this.properties.buttons=[{text:"Cancel",id:"cancel"},{text:"Save",id:"ok"}];e.__super__.setupDom.call(this,f);return this.input=$(this.dom).find("input")};e.prototype.on_button=function(f){if(f.button!=="ok"){return true}if(this.input.val().length>0){return this.event("select",{path:this.properties.path+"/"+this.input.val()})}};return e})(Controls.dialog)}).call(this);