diff --git a/lib/boards-api.js b/lib/boards-api.js index 2e3284e..4e3e97a 100644 --- a/lib/boards-api.js +++ b/lib/boards-api.js @@ -168,7 +168,7 @@ BoardsAPI.prototype.createBoard = function (board, done) { BoardsAPI.prototype.createPost = function (post, board, done) { try { - post.date = (new Date()).getTime() + post.date = parseInt((new Date()).getTime() / 1000, 10) post.op = this.id var post_str = JSON.stringify(post) } catch (e) { diff --git a/webapp/components/postlist.jsx b/webapp/components/postlist.jsx index cdbb186..61080c4 100644 --- a/webapp/components/postlist.jsx +++ b/webapp/components/postlist.jsx @@ -18,7 +18,7 @@ module.exports = React.createClass({ init (boards, props) { var onPost = (hash, date, post) => { if (!this.isMounted()) return true - var now = (new Date()).getTime() + var now = parseInt((new Date()).getTime() / 1000, 10) var posts = this.state.posts if (date === undefined || date <= 0) { posts.push(hash) diff --git a/webapp/pages/post-editor.jsx b/webapp/pages/post-editor.jsx index 2196a5f..2e0fdf6 100644 --- a/webapp/pages/post-editor.jsx +++ b/webapp/pages/post-editor.jsx @@ -52,9 +52,11 @@ module.exports = function (boardsAPI) { save () { this.setState({ updating: true }) var post = { - title: this.state.title, text: this.state.text } + if (this.state.title && this.state.title.length > 0) { + post.title = this.state.title + } boardsAPI.use(boards => { boards.createPost(post, this.props.params.boardname, err => { this.setState({ error: err, updating: false }) diff --git a/webapp/style.css b/webapp/style.css index 68a7ab1..f68a86a 100644 --- a/webapp/style.css +++ b/webapp/style.css @@ -92,6 +92,11 @@ a:hover { margin: 2rem; } +.post .content img { + margin: auto; + max-width: 60rem; +} + .icons .fa, .comment .icons .fa { color: #707070; }