mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
fix blog comments
This commit is contained in:
parent
6bb558688e
commit
ed37be689a
7 changed files with 10 additions and 11 deletions
|
|
@ -41,6 +41,7 @@
|
|||
function showComments(cb) {
|
||||
$('#sd-container').remove()
|
||||
getComments(function(err) {
|
||||
$('#comments-spinner').hide()
|
||||
if (err) {
|
||||
$('#comments').text('derp')
|
||||
if (typeof cb === 'function') cb(err)
|
||||
|
|
@ -102,7 +103,7 @@
|
|||
document.getElementById('thoughts').focus()
|
||||
return false
|
||||
}
|
||||
comment.timestamp = +comment.timestamp + tzOffset
|
||||
comment.timestamp = +new Date() + tzOffset
|
||||
|
||||
var options = { method: 'POST'
|
||||
, uri: postCommentURL()
|
||||
|
|
@ -115,8 +116,6 @@
|
|||
return false
|
||||
}
|
||||
|
||||
// FIXME check for error, how do we get the returned status code?
|
||||
|
||||
$('#comment-form').get(0).reset()
|
||||
|
||||
comment.timestamp = +new Date()
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/// http://github.com/samsonjs/gitter
|
||||
/// @_sjs
|
||||
///
|
||||
/// Copyright 2010 Sami Samhuri <sami.samhuri@gmail.com>
|
||||
/// Copyright 2010 Sami Samhuri <sami@samhuri.net>
|
||||
/// MIT License
|
||||
|
||||
// TODO:
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
xhr.setRequestHeader(k, headers[k])
|
||||
}
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
if (xhr.status === 200 || xhr.status === 204) {
|
||||
cb(null, xhr, xhr.responseText)
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/// http://github.com/samsonjs/strftime
|
||||
/// @_sjs
|
||||
///
|
||||
/// Copyright 2010 Sami Samhuri <sami.samhuri@gmail.com>
|
||||
/// Copyright 2010 Sami Samhuri <sami@samhuri.net>
|
||||
/// MIT License
|
||||
|
||||
var strftime = (function() {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<% } else { %>
|
||||
<%= name %>
|
||||
<% } %>
|
||||
@ <%= strftime('%F %r', new Date(timestamp)) %>
|
||||
@ <%= strftime('%F %I:%M %p', new Date(timestamp)) %>
|
||||
</p>
|
||||
<blockquote><%= html %></blockquote>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -35,14 +35,14 @@
|
|||
</div>
|
||||
<script type="text/html" id="comment_tmpl">
|
||||
<div class="comment">
|
||||
<a name="comment-<%= id %>" id="comment-<%= id %>">
|
||||
<a name="comment-<%= id %>" id="comment-<%= id %>"></a>
|
||||
<p>
|
||||
<% if (url) { %>
|
||||
<a href="<%= url %>"><%= name %></a>
|
||||
<% } else { %>
|
||||
<%= name %>
|
||||
<% } %>
|
||||
@ <%= strftime('%F %r', new Date(timestamp)) %>
|
||||
@ <a href="#comment-<%= id %>"><%= strftime('%F %I:%M %p', new Date(timestamp)) %></a>
|
||||
</p>
|
||||
<blockquote><%= html %></blockquote>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@
|
|||
</div>
|
||||
<script type="text/html" id="comment_tmpl">
|
||||
<div class="comment">
|
||||
<a name="comment-<%= id %>" id="comment-<%= id %>">
|
||||
<a name="comment-<%= id %>" id="comment-<%= id %>"></a>
|
||||
<p>
|
||||
<% if (url) { %>
|
||||
<a href="<%= url %>"><%= name %></a>
|
||||
<% } else { %>
|
||||
<%= name %>
|
||||
<% } %>
|
||||
@ <%= strftime('%F %I:%M %p', new Date(timestamp)) %>
|
||||
@ <a href="#comment-<%= id %>"><%= strftime('%F %I:%M %p', new Date(timestamp)) %></a>
|
||||
</p>
|
||||
<blockquote><%= html %></blockquote>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue