move arbitrary html content out of noscript and into the preloadstore

This commit is contained in:
Régis Hanol
2013-12-17 18:25:27 +01:00
parent 1b6050bdb0
commit 4c6b535cc0
3 changed files with 11 additions and 12 deletions
@@ -2,13 +2,10 @@ Discourse.HtmlView = Ember.View.extend({
render: function(buffer) {
var key = this.get("key"),
noscript = $("noscript").text();
htmlContent = PreloadStore.get("htmlContent");
if (noscript.length) {
var regexp = new RegExp("<!-- " + key + ": -->((?:.|[\\n\\r])*)<!-- :" + key + " -->"),
content = noscript.match(regexp)[1];
buffer.push(content);
if (htmlContent && htmlContent[key] && htmlContent[key].length) {
buffer.push(htmlContent[key]);
}
}