Concrete.UI.PreferencesDialog = Class.create(Concrete.UI.AbstractDialog, { initialize: function($super, options) { options = options || {}; var dialogElement = this._createDomElement(); $super(dialogElement, options); this.syntaxInput = dialogElement.down(".syntax_input"); }, _createDomElement: function() { if ($('ct_preferences_dialog')) return $('ct_preferences_dialog'); Element.insert($$('body').first(), { bottom: "" }); return $('ct_preferences_dialog'); }, _proceed: function() { new Ajax.Request("/setConcreteSyntax", { method: 'get', parameters: {"ident": this.syntaxInput.value}, onSuccess: function(transport) { }, onFailure: function() { } }); }, _buttonPressed: function(element) { if (element == this.dialogElement.down(".cancel_button")) { this.close(); } }, open: function($super, options) { $super(); new Ajax.Request("/concreteSyntaxes", { method: 'get', onSuccess: function(transport) { if (transport.responseText.isJSON()) { var synDesc = transport.responseText.evalJSON(); Element.replace(this.syntaxInput, "" ); this.syntaxInput = this.dialogElement.down(".syntax_input"); } }.bind(this), }); } });