Convert all CoffeeScript to Javascript. See:

http://meta.discourse.org/t/is-it-better-for-discourse-to-use-javascript-or-coffeescript/3153
This commit is contained in:
Robin Ward
2013-02-20 13:15:50 -05:00
parent 68ad545f0f
commit f661fa609e
407 changed files with 13226 additions and 8953 deletions

View File

@ -0,0 +1,32 @@
(function() {
window.Discourse.AdminCustomizeController = Ember.Controller.extend({
newCustomization: function() {
var item;
item = Discourse.SiteCustomization.create({
name: 'New Style'
});
this.get('content').pushObject(item);
return this.set('content.selectedItem', item);
},
selectStyle: function(style) {
return this.set('content.selectedItem', style);
},
save: function() {
return this.get('content.selectedItem').save();
},
"delete": function() {
var _this = this;
return bootbox.confirm(Em.String.i18n("admin.customize.delete_confirm"), Em.String.i18n("no_value"), Em.String.i18n("yes_value"), function(result) {
var selected;
if (result) {
selected = _this.get('content.selectedItem');
selected["delete"]();
_this.set('content.selectedItem', null);
return _this.get('content').removeObject(selected);
}
});
}
});
}).call(this);