diff --git a/.jshintrc b/.jshintrc index a2d343f..552c5cd 100644 --- a/.jshintrc +++ b/.jshintrc @@ -39,5 +39,5 @@ "expr": true, "multistr": true, "onevar": false, - "unused": true + "unused": "vars" } diff --git a/app.js b/app.js index b441fcb..c1e2e9c 100644 --- a/app.js +++ b/app.js @@ -6,11 +6,10 @@ * Module dependencies. */ -var fs = require('fs'); var path = require('path'); var express = require('express'); var ndir = require('ndir'); -var pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'))); +var pkg = require('./package.json'); var config = require('./config').config; config.version = pkg.version; diff --git a/public/stylesheets/common.css b/public/stylesheets/common.css index 5e30d4b..3354fb5 100644 --- a/public/stylesheets/common.css +++ b/public/stylesheets/common.css @@ -1,18 +1,24 @@ -div, textarea { - box-sizing: border-box; - -mox-box-sizing: border-box; -} body, p { font-size: 14px; font-family: "Helvetica Neue", Helvetica, "Microsoft Yahei", "Wenquanyi Micro Hei", Arial, sans-serif; word-break: break-all; -webkit-font-smoothing: antialiased; } -textarea, input[type="text"], input[type="password"], input[type="datetime"], -input[type="datetime-local"], input[type="date"], input[type="month"], -input[type="time"], input[type="week"], input[type="number"], -input[type="email"], input[type="url"], input[type="search"], -input[type="tel"], input[type="color"], .uneditable-input { +textarea, input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { background: hsla(0,0%,0%,0) } @@ -22,14 +28,14 @@ pre { line-height: 22px; } code { - padding: 0px; + padding: 0; border: none; line-height: 16px; } p code { background: none; color: hsl(0,0%,50%); - margin: 0px 1px; + margin: 0 1px; padding: 1px 4px; } div pre.prettyprint { @@ -40,10 +46,10 @@ div pre.prettyprint { padding: 15px; } form { - margin-bottom: 0px; + margin-bottom: 0; } textarea { - margin-bottom: 0px; + margin-bottom: 0; } input, textarea { background: hsla(0,0%,0%,0); diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 03b8f03..93d52d5 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -19,12 +19,12 @@ position: relative; } #topic_list { - margin: 0px; + margin: 0; } #content { - margin: 0px 290px 0px 0px; - padding: 0px; + padding: 0; width: 758px; + float: left; } #sidebar { width: 290px; @@ -62,39 +62,6 @@ } /* common */ -.fl { - float: left; -} -.fr { - float: right; -} -.cl { - clear: left; -} -.cr { - clear: right; -} -.cen { - text-align: center; -} -.sep5{ - height: 5px; -} -.sep10 { - height: 5px; -} -.space { - display: inline-block; - margin: 0px 4px; -} -.sp5 { - width: 5px; - display: inline-block; -} -.sp10 { - width: 10px; - display: inline-block; -} .col_fade { color: hsl(0,0%,67%); } @@ -133,11 +100,11 @@ a.light:hover { .panel { margin-bottom: 8px; - box-shadow: 0px 0px 1px hsl(0, 0%, 40%); + box-shadow: 0 0 1px hsl(0, 0%, 40%); } .panel .header { padding: 7px 10px; - background: hsl(0,0%,93%); + background-color: hsl(0,0%,93%); } .panel .moon { padding: 10px; @@ -435,6 +402,7 @@ img.unread { /* single */ #create_topic_btn { + float: right; } .board { margin-top: 10px; @@ -522,15 +490,7 @@ img.unread { border: 1px solid #ccc; padding: 4px 8px; overflow: auto; - - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -o-border-radius: 3px; border-radius: 3px; - - -webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15); - -moz-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15); - -o-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15); box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15); } textarea[id^=wmd-input] { @@ -649,15 +609,24 @@ textarea[id^=wmd-input] { .pagination a { line-height: 30px; } - .topic_content h1, .topic_content h2, -.topic_content h3, +.topic_content h3 { + line-height: 160%; +} +.topic_content h1 { + margin: 23px 0; +} +.topic_content h2 { + margin: 16px 0; +} +.topic_content h3 { + margin: 14px 0; +} .topic_content h4, .topic_content h5, .topic_content h6 { - margin: 0; - padding: 0; + margin: 12px 0; } .topic_content ul, .topic_content ol { @@ -725,3 +694,7 @@ textarea.editor { #submit_btn { margin-top: 10px; } + +#content .header { + line-height: 200%; +} diff --git a/views/index.html b/views/index.html index ecffab6..fa932cf 100644 --- a/views/index.html +++ b/views/index.html @@ -1,28 +1,28 @@ <%- partial('sidebar') %> -
-
-
-
- 当前话题 - <% if (locals.current_user) { %> - - - - <% } %> -
- <% if (locals.topics && topics.length > 0) { %> - <%- partial('topic/list', { - topics: topics, - pages: pages, - current_pages: current_page, - base: keyword ? ('/?q=' + keyword) : '/' - }) %> - <% } else { %> -
-

无话题

-
- <% } %> -
-
+
+
+
+
+ 当前话题 + <% if (locals.current_user) { %> + + + + <% } %> +
+ <% if (locals.topics && topics.length > 0) { %> + <%- partial('topic/list', { + topics: topics, + pages: pages, + current_pages: current_page, + base: keyword ? ('/?q=' + keyword) : '/' + }) %> + <% } else { %> +
+

无话题

+
+ <% } %> +
+
diff --git a/views/layout.html b/views/layout.html index 8df0b8b..44402fa 100644 --- a/views/layout.html +++ b/views/layout.html @@ -77,15 +77,12 @@
<%- body %>
-
回到顶部