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
@@ -0,0 +1,32 @@
(function() {
Discourse.StaticController = Ember.Controller.extend({
content: null,
loadPath: function(path) {
var $preloaded, text,
_this = this;
this.set('content', null);
/* Load from <noscript> if we have it.
*/
$preloaded = jQuery("noscript[data-path=\"" + path + "\"]");
if ($preloaded.length) {
text = $preloaded.text();
text = text.replace(/<header[\s\S]*<\/header\>/, '');
return this.set('content', text);
} else {
return jQuery.ajax({
url: "" + path + ".json",
success: function(result) {
return _this.set('content', result);
}
});
}
}
});
Discourse.StaticController.reopenClass({
pages: ['faq', 'tos', 'privacy']
});
}).call(this);