Permalink
Browse files

Add resources file for web.

  • Loading branch information...
llun committed Apr 7, 2013
1 parent a2b658b commit a996b9254c6e15c999ba98a5bb2c81472a027b4c
Showing with 10,635 additions and 29 deletions.
  1. +1 −0 .gitignore
  2. +48 −7 app.js
  3. +5 −3 package.json
  4. +6,039 −0 public/css/bootstrap.css
  5. +2,533 −0 public/css/flat-ui.css
  6. +14 −0 public/css/mailpipe.less
  7. +112 −0 public/fonts/Flat-UI-Icons-16.dev.svg
  8. BIN public/fonts/Flat-UI-Icons-16.eot
  9. +112 −0 public/fonts/Flat-UI-Icons-16.svg
  10. BIN public/fonts/Flat-UI-Icons-16.ttf
  11. BIN public/fonts/Flat-UI-Icons-16.woff
  12. +111 −0 public/fonts/Flat-UI-Icons-24.dev.svg
  13. BIN public/fonts/Flat-UI-Icons-24.eot
  14. +111 −0 public/fonts/Flat-UI-Icons-24.svg
  15. BIN public/fonts/Flat-UI-Icons-24.ttf
  16. BIN public/fonts/Flat-UI-Icons-24.woff
  17. BIN public/images/checkbox-2x.png
  18. BIN public/images/checkbox.png
  19. BIN public/images/demo/browser-2x.png
  20. BIN public/images/demo/browser-author.jpg
  21. BIN public/images/demo/browser-pic-1.jpg
  22. BIN public/images/demo/browser-pic-2.jpg
  23. BIN public/images/demo/browser-pic-3.jpg
  24. BIN public/images/demo/browser-pic-4.jpg
  25. BIN public/images/demo/browser-pic-5.jpg
  26. BIN public/images/demo/browser-pic-6.jpg
  27. BIN public/images/demo/browser.png
  28. BIN public/images/demo/html-icon.png
  29. BIN public/images/demo/logo-mask-2x.png
  30. BIN public/images/demo/logo-mask.png
  31. BIN public/images/demo/video.jpg
  32. BIN public/images/favicon.ico
  33. BIN public/images/footer/logo.png
  34. BIN public/images/illustrations/bag.png
  35. BIN public/images/illustrations/book.png
  36. BIN public/images/illustrations/calendar.png
  37. BIN public/images/illustrations/clipboard.png
  38. BIN public/images/illustrations/colors.png
  39. BIN public/images/illustrations/compass.png
  40. BIN public/images/illustrations/gift.png
  41. BIN public/images/illustrations/infinity.png
  42. BIN public/images/illustrations/mail.png
  43. BIN public/images/illustrations/map.png
  44. BIN public/images/illustrations/paper.png
  45. BIN public/images/illustrations/retina.png
  46. BIN public/images/illustrations/share.png
  47. BIN public/images/illustrations/time.png
  48. BIN public/images/login/icon.png
  49. BIN public/images/login/imac-2x.png
  50. BIN public/images/login/imac.png
  51. BIN public/images/pager/next.png
  52. BIN public/images/pager/previous.png
  53. BIN public/images/radio-2x.png
  54. BIN public/images/radio.png
  55. BIN public/images/select/toggle.png
  56. BIN public/images/tile/ribbon-2x.png
  57. BIN public/images/tile/ribbon.png
  58. BIN public/images/todo/done-2x.png
  59. BIN public/images/todo/done.png
  60. BIN public/images/todo/search-2x.png
  61. BIN public/images/todo/search.png
  62. BIN public/images/todo/todo-2x.png
  63. BIN public/images/todo/todo.png
  64. BIN public/images/toggle/block-off.png
  65. BIN public/images/toggle/block-on.png
  66. BIN public/images/toggle/icon-off-2x.png
  67. BIN public/images/toggle/icon-off.png
  68. BIN public/images/toggle/icon-on-2x.png
  69. BIN public/images/toggle/icon-on.png
  70. BIN public/images/video/fullscreen-2x.png
  71. BIN public/images/video/fullscreen.png
  72. BIN public/images/video/pause-2x.png
  73. BIN public/images/video/pause.png
  74. BIN public/images/video/play-2x.png
  75. BIN public/images/video/play.png
  76. BIN public/images/video/poster.jpg
  77. BIN public/images/video/volume-full-2x.png
  78. BIN public/images/video/volume-full.png
  79. BIN public/images/video/volume-off-2x.png
  80. BIN public/images/video/volume-off.png
  81. +51 −0 public/javascripts/application.js
  82. +353 −0 public/javascripts/bootstrap-tooltip.js
  83. +53 −0 public/javascripts/custom_checkbox_and_radio.js
  84. +28 −0 public/javascripts/custom_radio.js
  85. +8 −0 public/javascripts/html5shiv.js
  86. +44 −0 public/javascripts/icon-font-ie7.js
  87. +2 −0 public/javascripts/jquery-1.8.2.min.js
  88. +6 −0 public/javascripts/jquery-ui-1.10.0.custom.min.js
  89. +400 −0 public/javascripts/jquery.dropkick-1.0.0.js
  90. +157 −0 public/javascripts/jquery.placeholder.js
  91. +354 −0 public/javascripts/jquery.tagsinput.js
  92. +44 −0 public/javascripts/lte-ie7-24.js
  93. +0 −8 public/stylesheets/style.css
  94. +0 −11 views/index.hjs
  95. +15 −0 views/index.jade
  96. +34 −0 views/layout.jade
View
@@ -5,3 +5,4 @@
node_modules
+mailpipe.css
View
55 app.js
@@ -5,16 +5,31 @@
var express = require('express')
, routes = require('./routes')
+ , less_middleware = require('less-middleware')
, user = require('./routes/user')
, http = require('http')
- , path = require('path');
+ , path = require('path')
+ , fs = require('fs')
+ , simplesmtp = require('simplesmtp');
var app = express();
+app.configure('development', function(){
+ app.use(express.errorHandler());
+ app.use(less_middleware({
+ src: __dirname + '/public',
+ force: true
+ }));
+});
+
+app.configure('production', function() {
+ app.use(less_middleware({src: __dirname + '/public'}));
+});
+
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
-app.set('view engine', 'hjs');
+app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
@@ -24,14 +39,40 @@ app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
-// development only
-if ('development' == app.get('env')) {
- app.use(express.errorHandler());
-}
-
app.get('/', routes.index);
app.get('/users', user.list);
http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});
+
+var smtp = simplesmtp.createServer({
+ debug: false,
+ SMTPBanner: 'Hello, This is redirector'
+});
+smtp.listen(process.env.SMTP || 2525, function () {
+ console.log ('Redirector server listen on port ' + (process.env.SMTP || 2525));
+});
+smtp.on('startData', function (connection) {
+ console.log ('Message from:', connection.from);
+ console.log ('Message to:', connection.to);
+ connection.saveStream = fs.createWriteStream("/tmp/message.txt");
+});
+smtp.on('data', function (connection, chunk) {
+ connection.saveStream.write(chunk);
+});
+smtp.on('dataReady', function (connection, callback) {
+ connection.saveStream.end();
+ console.log("Incoming message saved to /tmp/message.txt");
+ callback(null, 'D1');
+});
+smtp.on('validateRecipient', function (connection, email, callback) {
+ var domain = 'llun.in.th';
+ var pattern = new RegExp('@' + domain + '$');
+ if (pattern.test(email)) {
+ callback(null, 'A2');
+ }
+ else {
+ callback(new Error('Not allow recipient, we redirect to other webservice only, not email'));
+ }
+});
View
@@ -6,8 +6,10 @@
"start": "node app.js"
},
"dependencies": {
- "express": "3.1.1",
- "hjs": "*",
- "simplesmtp": "*"
+ "express": "3.x",
+ "less-middleware": "0.1.x",
+ "jade": "0.27.x",
+ "simplesmtp": "0.2.x",
+ "mailparser": "0.3.x"
}
}
Oops, something went wrong.

0 comments on commit a996b92

Please sign in to comment.