Optim: populate html template with resource links and hash

This commit is contained in:
fecaille
2016-03-31 16:22:15 +02:00
parent 2115d30c32
commit 6251fcf075
6 changed files with 66 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOMServer from 'react-dom/server';
import App from './app.jsx';
import $ from 'jquery';
require('bootstrap/dist/css/bootstrap.css');
@@ -25,3 +26,6 @@ global.renderServer = function (comments) {
);
};
if( !global.nashorn ) {
renderClient(initialData);
};

View File

@@ -1,5 +1,7 @@
var global = window = this;
global.nashorn = true;
var console = {
debug: print,
warn: print,

View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head lang="en">
<meta charset="UTF-8" />
<title>Comments channel</title>
</head>
<body>
<div th:replace="fragments/header"></div>
<div class="container">
<div id="content" th:utext="${markup}"></div>
</div>
<div th:replace="fragments/footer"></div>
<script th:inline="javascript">
var initialData = JSON.parse(/*[[${data}]]*/ '[]');
</script>
</body>
</html>