Skip to content

Commit eeb72bd

Browse files
committed
new changes
1 parent 7fa417e commit eeb72bd

File tree

25 files changed

+175
-174
lines changed

25 files changed

+175
-174
lines changed

download-file-database-nosql/controllers/default.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ function static_image(req, res, isValidation) {
2626
var db = self.database('images');
2727
var id = req.uri.pathname.replace('/', '').replace('.png', '');
2828

29-
// check client cache via etag
29+
// Check the client cache via etag
3030
// if not modified - framework send automatically 304
3131
// id === etag
32-
//if (self.notModified(req, res, id))
33-
//return;
34-
32+
33+
/*
34+
if (self.notModified(req, res, id))
35+
return;
36+
*/
37+
3538
db.binary.read(id, function(err, stream, header) {
3639

3740
if (err) {
@@ -41,16 +44,16 @@ function static_image(req, res, isValidation) {
4144

4245
// Set HTTP cache via etag
4346
// Documentation: http://docs.totaljs.com/Framework/#framework.setModified
44-
//self.setModified(req, res, id);
45-
46-
// Documentation: http://docs.totaljs.com/Framework/#framework.responseStream
47-
// self.responseStream(req, res, 'image/png', stream);
47+
// self.setModified(req, res, id);
4848

4949
// Documentation: http://docs.totaljs.com/Framework/#framework.responseImage
5050
self.responseImage(req, res, stream, function(image) {
5151
image.resize('50%');
5252
image.output('png');
5353
image.minify();
5454
});
55+
56+
// or
57+
// self.responseStream(req, res, 'image/png', stream);
5558
});
5659
}

download-stream/controllers/default.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ exports.install = function(framework) {
66

77
function file_download() {
88
var self = this;
9-
// Documentation: http://docs.totaljs.com/FrameworkController/#controller.stream
109
self.stream('application/pdf', fs.createReadStream(self.path.public('totaljs.pdf')), 'logo.pdf');
1110
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
exports.install = function(framework) {
2-
framework.route('/', view_homepage);
3-
};
4-
5-
function view_homepage() {
6-
this.view('homepage');
7-
}
2+
framework.route('/');
3+
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var sass = require('node-sass');
22

3-
// Documentation: http://docs.totaljs.com/Framework/#framework.onCompileCSS
4-
framework.onCompileCSS = function (filename, content) {
3+
framework.onCompileStyle = function (filename, content) {
4+
// if filename === '' then it is the inline style
55
return sass.renderSync({ data: content, outputStyle: 'compressed' });
66
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var uglify = require('uglify-js');
22

3-
// Documentation: http://docs.totaljs.com/Framework/#framework.onCompileJS
4-
framework.onCompileJS = function (filename, content) {
3+
framework.onCompileScript = function (filename, content) {
4+
// if filename === '' then it is the inline script
55
return uglify.minify(content, { fromString: true }).code;
66
};
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
exports.install = function(framework) {
2-
framework.route('/', view_homepage);
3-
};
4-
5-
function view_homepage() {
6-
var self = this;
7-
self.view('homepage');
8-
}
2+
framework.route('/');
3+
};

font-awesome/public/css/font-awesome.min.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

font-awesome/public/css/icons.min.css

Lines changed: 0 additions & 4 deletions
This file was deleted.
22.5 KB
Binary file not shown.
17.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)