mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-11 00:02:05 -05:00
21 lines
635 B
JavaScript
21 lines
635 B
JavaScript
Discourse.SiteText = Discourse.Model.extend({
|
|
markdown: Em.computed.equal('format', 'markdown'),
|
|
plainText: Em.computed.equal('format', 'plain'),
|
|
html: Em.computed.equal('format', 'html'),
|
|
css: Em.computed.equal('format', 'css'),
|
|
|
|
save: function() {
|
|
return Discourse.ajax("/admin/customize/site_text/" + this.get('text_type'), {
|
|
type: 'PUT',
|
|
data: {value: this.get('value')}
|
|
});
|
|
}
|
|
});
|
|
|
|
Discourse.SiteText.reopenClass({
|
|
find: function(type) {
|
|
return Discourse.ajax("/admin/customize/site_text/" + type).then(function (data) {
|
|
return Discourse.SiteText.create(data.site_text);
|
|
});
|
|
}
|
|
});
|