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
};

font-awesome/controllers/default.js

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.
Binary file not shown.

font-awesome/public/fonts/fontawesome-webfont.svg

Lines changed: 140 additions & 34 deletions
Loading
Binary file not shown.
Binary file not shown.
File renamed without changes.

font-awesome/views/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
99
<meta name="robots" content="all,follow" />
1010
@{head}
11-
@{css('icons.min.css')}
11+
@{css('font-awesome.min.css')}
1212
</head>
1313
<body>
1414

framework-async/controllers/default.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

framework-async/index.js

Lines changed: 0 additions & 7 deletions
This file was deleted.
-8.2 KB
Binary file not shown.

framework-async/views/_layout.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

framework-async/views/homepage.html

Lines changed: 0 additions & 33 deletions
This file was deleted.

framework-business-logic-source/controllers/default.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
exports.install = function(framework) {
2-
3-
framework.route('/', view_homepage);
2+
framework.route('/', view_index);
43
};
54

6-
function view_homepage() {
5+
function view_index() {
76
var self = this;
87

98
// This function does the same as require (only adds path to the source directory)

framework-eval/controllers/default.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
exports.install = function(framework) {
2-
3-
framework.route('/', view_homepage);
2+
framework.route('/', view_index);
43
framework.route('/eval/', post_eval, ['post']);
54

65
};
76

8-
function view_homepage() {
7+
function view_index() {
98
var self = this;
10-
self.view('homepage', { text: 'console.log(\'from client side ...\');' });
9+
self.view('index', { text: 'console.log(\'from client side ...\');' });
1110
}
1211

1312
function post_eval() {
File renamed without changes.
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
exports.install = function(framework) {
2-
framework.route('/', plain_homepage);
2+
framework.route('/', plain_index);
33
};
44

5-
function plain_homepage() {
5+
function plain_index() {
6+
67
var self = this;
7-
88
var now = framework.functions.now();
99

1010
// or
1111

1212
var hello = FUNCTION('hello')();
13-
1413
self.plain(now.format('dd.MM.yyyy - HH:mm:ss') + ' - ' + hello);
1514
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
exports.install = function(framework) {
2-
framework.route('/', view_homepage);
2+
framework.route('/', view_index);
33
};
44

5-
function view_homepage() {
5+
function view_index() {
66
var self = this;
77

88
// in some view: @{global.name}
99
self.json(self.global);
1010

1111
// or
12-
// self.json(self.framework.global);
12+
// self.json(framework.global);
1313
}

0 commit comments

Comments
 (0)