Clean up JS, add YUIDoc support, automatically create IIFE via asset pipeline

This commit is contained in:
Robin Ward
2013-02-22 15:41:12 -05:00
parent 0321643636
commit e461c84253
217 changed files with 11996 additions and 12131 deletions

View File

@ -1,63 +1,59 @@
(function() {
/**
This controller supports interface for creating custom CSS skins in Discourse.
@class AdminCustomizeController
@extends Ember.Controller
@namespace Discourse
@module Discourse
**/
Discourse.AdminCustomizeController = Ember.Controller.extend({
/**
This controller supports interface for creating custom CSS skins in Discourse.
Create a new customization style
@class AdminCustomizeController
@extends Ember.Controller
@namespace Discourse
@module Discourse
**/
window.Discourse.AdminCustomizeController = Ember.Controller.extend({
@method newCustomization
**/
newCustomization: function() {
var item = Discourse.SiteCustomization.create({name: 'New Style'});
this.get('content').pushObject(item);
this.set('content.selectedItem', item);
},
/**
Create a new customization style
/**
Select a given style
@method newCustomization
**/
newCustomization: function() {
var item = Discourse.SiteCustomization.create({name: 'New Style'});
this.get('content').pushObject(item);
this.set('content.selectedItem', item);
},
@method selectStyle
@param {Discourse.SiteCustomization} style The style we are selecting
**/
selectStyle: function(style) {
this.set('content.selectedItem', style);
},
/**
Select a given style
/**
Save the current customization
@method selectStyle
@param {Discourse.SiteCustomization} style The style we are selecting
**/
selectStyle: function(style) {
this.set('content.selectedItem', style);
},
@method save
**/
save: function() {
this.get('content.selectedItem').save();
},
/**
Save the current customization
/**
Destroy the current customization
@method save
**/
save: function() {
this.get('content.selectedItem').save();
},
@method destroy
**/
destroy: 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);
}
});
}
/**
Destroy the current customization
@method destroy
**/
destroy: 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);
});