integrated LESS middleware to static served CSS/less files

v1.18.x
Julian Lam 12 years ago
parent c7fb07e2e5
commit 09fb79d3a2

@ -19,7 +19,8 @@
"path": "0.4.9", "path": "0.4.9",
"crypto": "0.0.3", "crypto": "0.0.3",
"passport": "0.1.16", "passport": "0.1.16",
"passport-local": "0.1.6" "passport-local": "0.1.6",
"less-middleware": "0.1.11"
}, },
"devDependencies": {}, "devDependencies": {},
"optionalDependencies": {}, "optionalDependencies": {},

@ -0,0 +1,122 @@
@media (min-width: 979px) {
body {
padding-top: 60px;
}
}
#notification_window {
position: absolute;
right: 20px;
top: 80px;
width: 300px;
height: 0px;
}
.toaster-alert {
cursor: pointer;
}
footer.footer {
color: #555;
text-align: center;
}
footer.footer a {
color: #222;
}
#post_window {
width: 100%;
position: absolute;
height: 350px;
left: 0px;
bottom: 0px;
background: white;
}
#post_window input {
width: 100%;
height: 30px;
padding: 5px;
}
#post_window textarea {
width: 100%;
background: #222;
height: 220px;
resize: none;
border-radius: 0;
border: 1px solid #111;
font-size: 16px;
color: #bebebe;
outline: 0;
}
#post_window textarea:focus {
outline: 0;
border: none !important;
box-shadow: none !important;
}
#post_window .post-title-container {
opacity: 0.8;
height: 50px;
}
#post_window .post-content-container {
opacity: 0.8;
background: #000;
width: 100%;
height: 300px;
}
.topic-container {
list-style-type: none;
padding: 0;
margin: 0;
border: 1px solid #eee;
margin-top: 50px;
}
.topic-container a:nth-child(odd) li.topic-row {
background-color: #fdfdfd;
}
.topic-container a:nth-child(even) li.topic-row {
background-color: #fff;
}
.topic-container li.topic-row {
cursor: pointer;
border-bottom: 1px solid #eee;
padding: 10px;
}
.topic-container li:last-child {
border-bottom: 0;
}
.topic-container li.topic-row:hover {
background-color: #eee;
}
.post-container {
list-style-type: none;
padding: 0;
margin: 0;
border: 1px solid #eee;
}
.post-container li:last-child {
border-bottom: 0;
}
.post-container li.post-row {
cursor: pointer;
border-bottom: 1px solid #eee;
padding: 10px;
}
.post-container li.post-row:nth-child(odd) {
background-color: #fdfdfd;
}
.post-container li.post-row:nth-child(even) {
background-color: #fff;
}
.post-container li.post-row:hover {
background-color: #eee;
}
#user_label img {
border: 1px solid #999;
margin-right: 8px;
margin-top: -2px;
}
#user_label span {
font-size: 12px;
font-weight: bold;
}
#reply_title {
font-size: 17px;
padding-top: 14px;
font-weight: 600;
}

@ -0,0 +1,150 @@
@media (min-width: 979px) {
body {
padding-top: 60px;
}
}
#notification_window {
position: absolute;
right: 20px;
top: 80px;
width: 300px;
height: 0px;
}
.toaster-alert {
cursor: pointer;
}
footer.footer {
color: #555;
text-align: center;
a {
color: #222;
}
}
#post_window {
width: 100%;
position: absolute;
height: 350px;
left: 0px;
bottom: 0px;
background: white;
input {
width: 100%;
height: 30px;
padding: 5px;
}
textarea {
width: 100%;
background: #222;
height: 220px;
resize: none;
border-radius: 0;
border: 1px solid #111;
font-size: 16px;
color: #bebebe;
outline: 0;
&:focus {
outline: 0;
border:none !important;
box-shadow:none !important;
}
}
.post-title-container {
opacity: 0.8;
height: 50px;
}
.post-content-container {
opacity: 0.8;
background: #000;
width: 100%;
height: 300px;
}
}
.topic-container {
list-style-type: none;
padding: 0;
margin: 0;
border: 1px solid #eee;
margin-top: 50px;
a:nth-child(odd) li.topic-row {
background-color:#fdfdfd;
}
a:nth-child(even) li.topic-row {
background-color:#fff;
}
li.topic-row {
cursor: pointer;
border-bottom: 1px solid #eee;
padding: 10px;
}
li:last-child {
border-bottom: 0;
}
li.topic-row:hover {
background-color: #eee;
}
}
.post-container {
list-style-type: none;
padding: 0;
margin: 0;
border: 1px solid #eee;
li:last-child {
border-bottom: 0;
}
li.post-row {
cursor: pointer;
border-bottom: 1px solid #eee;
padding: 10px;
&:nth-child(odd) {
background-color:#fdfdfd;
}
&:nth-child(even) {
background-color:#fff;
}
&:hover {
background-color: #eee;
}
}
}
#user_label {
img {
border: 1px solid #999;
margin-right: 8px;
margin-top: -2px;
}
span {
font-size: 12px;
font-weight: bold;
}
}
#reply_title {
font-size: 17px;
padding-top: 14px;
font-weight: 600;
}

@ -11,148 +11,7 @@
<script type="text/javascript" src="/src/app.js"></script> <script type="text/javascript" src="/src/app.js"></script>
<script type="text/javascript" src="/src/templates.js"></script> <script type="text/javascript" src="/src/templates.js"></script>
<script type="text/javascript" src="/src/ajaxify.js"></script> <script type="text/javascript" src="/src/ajaxify.js"></script>
<style type="text/css"> <link rel="stylesheet" type="text/css" href="/css/style.css" />
@media (min-width: 979px) {
body {
padding-top: 60px;
}
}
#notification_window {
position: absolute;
right: 20px;
top: 80px;
width: 300px;
height: 0px;
}
.toaster-alert {
cursor: pointer;
}
footer.footer {
color: #555;
text-align: center;
}
footer.footer a {
color: #222;
}
#post_window {
width: 100%;
position: absolute;
height: 350px;
left: 0px;
bottom: 0px;
background: white;
}
#post_window input {
width: 100%;
height: 30px;
padding: 5px;
}
#post_window textarea {
width: 100%;
background: #222;
height: 220px;
resize: none;
border-radius: 0;
border: 1px solid #111;
font-size: 16px;
color: #bebebe;
outline: 0;
}
#post_window textarea:focus {
outline: 0;
border:none !important;
box-shadow:none !important;
}
#post_window .post-title-container {
opacity: 0.8;
height: 50px;
}
#post_window .post-content-container {
opacity: 0.8;
background: #000;
width: 100%;
height: 300px;
}
.topic-container {
list-style-type: none;
padding: 0;
margin: 0;
border: 1px solid #eee;
margin-top: 50px;
}
.topic-container a:nth-child(odd) li.topic-row {
background-color:#fdfdfd;
}
.topic-container a:nth-child(even) li.topic-row {
background-color:#fff;
}
.topic-container li.topic-row {
cursor: pointer;
border-bottom: 1px solid #eee;
padding: 10px;
}
.topic-container li:last-child {
border-bottom: 0;
}
.topic-container li.topic-row:hover {
background-color: #eee;
}
.post-container {
list-style-type: none;
padding: 0;
margin: 0;
border: 1px solid #eee;
}
.post-container li.post-row:nth-child(odd) {
background-color:#fdfdfd;
}
.post-container li.post-row:nth-child(even) {
background-color:#fff;
}
.post-container li.post-row {
cursor: pointer;
border-bottom: 1px solid #eee;
padding: 10px;
}
.post-container li:last-child {
border-bottom: 0;
}
.post-container li.post-row:hover {
background-color: #eee;
}
#user_label img {
border: 1px solid #999;
margin-right: 8px;
margin-top: -2px;
}
#user_label span {
font-size: 12px;
font-weight: bold;
}
#reply_title {
font-size: 17px;
padding-top: 14px;
font-weight: 600;
}
</style>
</head> </head>
<body> <body>

@ -39,6 +39,7 @@ passport.deserializeUser(function(uid, done) {
// Middlewares // Middlewares
app.use(express.favicon()); // 2 args: string path and object options (i.e. expire time etc) app.use(express.favicon()); // 2 args: string path and object options (i.e. expire time etc)
app.use(require('less-middleware')({ src: path.join(__dirname, '../', '/public') }));
app.use(express.static(path.join(__dirname, '../', 'public'))); app.use(express.static(path.join(__dirname, '../', 'public')));
app.use(express.bodyParser()); // Puts POST vars in request.body app.use(express.bodyParser()); // Puts POST vars in request.body
app.use(express.cookieParser()); // If you want to parse cookies (res.cookies) app.use(express.cookieParser()); // If you want to parse cookies (res.cookies)

Loading…
Cancel
Save