mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
fad868c78f
Upgrade jquery I made this commit cause my JS debugging CDN support added a header and wanted we bump cache everywhere
39 lines
899 B
JavaScript
39 lines
899 B
JavaScript
/**
|
|
Our data model for interacting with custom site content
|
|
|
|
@class SiteContent
|
|
@extends Discourse.Model
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
Discourse.SiteContent = 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 the content
|
|
|
|
@method save
|
|
@return {jqXHR} a jQuery Promise object
|
|
**/
|
|
save: function() {
|
|
return Discourse.ajax("/admin/site_contents/" + this.get('content_type'), {
|
|
type: 'PUT',
|
|
data: {content: this.get('content')}
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
Discourse.SiteContent.reopenClass({
|
|
|
|
find: function(type) {
|
|
return Discourse.ajax("/admin/site_contents/" + type).then(function (data) {
|
|
return Discourse.SiteContent.create(data.site_content);
|
|
});
|
|
}
|
|
|
|
});
|