diff --git a/assets/blog.css b/assets/blog.css index c4873b8..947e49a 100644 --- a/assets/blog.css +++ b/assets/blog.css @@ -71,15 +71,15 @@ a.img { border: none } #posts { border-left: solid 0.15em #999 ; width: 80% ; min-width: 400px - ; max-width: 800px + ; max-width: 680px ; margin: 4em auto 2em - ; padding: 0 3em + ; padding: 0 5% ; font-size: 1.2em + ; line-height: 1.4em } article { color: #222 ; padding-bottom: 1em - ; line-height: 1.2em } article:last-child { padding-bottom: 0 @@ -88,6 +88,7 @@ article:last-child { padding-bottom: 0 article h1 { text-align: left ; font-size: 2em + ; line-height: 1.1em ; font-weight: normal ; color: #222 ; margin: 1em 0 @@ -167,6 +168,8 @@ input[type=submit]:active, ; padding: 2em 0 } +#comments-spinner { text-align: center } + #comments { width: 70% ; max-width: 400px ; margin: 0 auto diff --git a/assets/blog.js b/assets/blog.js index edadf14..40e1ecd 100644 --- a/assets/blog.js +++ b/assets/blog.js @@ -55,6 +55,17 @@ $('#comment-form').submit(function() { var comment = $(this).serializeObject() + comment.name = (comment.name || '').trim() || 'anonymous' + comment.url = (comment.url || '').trim() + if (comment.url && !comment.url.match(/^https?:\/\//)) { + comment.url = 'http://' + comment.url + } + comment.body = comment.body || '' + if (!comment.body) { + alert("is that all you have to say?") + return false + } + var options = { method: 'POST' , uri: postCommentURL() , body: JSON.stringify(comment) @@ -63,13 +74,20 @@ if (err) { console.dir(err) alert('derp') - return + return false } // FIXME check for error, how do we get the returned status code? + $('#comment-form').get(0).reset() + comment.timestamp = +new Date() comment.html = showdown.makeHtml(comment.body) + comment.name = (comment.name || '').trim() || 'anonymous' + comment.url = (comment.url || '').trim() + if (comment.url && !comment.url.match(/^https?:\/\//)) { + comment.url = 'http://' + comment.url + } $('#comments').append(tmpl('comment_tmpl', comment)) }) return false diff --git a/blog/37signals-chalk-dissected.html b/blog/37signals-chalk-dissected.html index 3117f39..79e0961 100644 --- a/blog/37signals-chalk-dissected.html +++ b/blog/37signals-chalk-dissected.html @@ -285,7 +285,7 @@ addLineNumbersToAllGists();
+ 