-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
302295e
commit c3cd274
Showing
78 changed files
with
109 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
framework.route('/', function() { | ||
var self = this; | ||
self.view('homepage'); | ||
}); | ||
exports.install = function() { | ||
framework.route('/'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
framework.resize('/img/small/', 100, 100, {}, '/img/'); | ||
framework.resize('/img/grayscale/', null, null, { grayscale: true }, '/img/'); | ||
framework.resize('/img/grayscale/', null, null, { cache: false, grayscale: true }, '/img/'); | ||
framework.resize('/img/filters/', null, null, { blur: true, sepia: true, flip: true, flop: true }, '/img/'); | ||
framework.resize('/img/50percent/', '50%', null, {}, '/img/'); | ||
framework.resize('/img/medium/', '70%', null, {}, '/img/', ['.png']); | ||
framework.resize('/img/medium/', '70%', null, {}, '/img/', ['.png']); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
exports.install = function(framework) { | ||
exports.install = function() { | ||
|
||
framework.route('/', view_homepage, ['#session']); | ||
framework.route('/', view_index, ['#session']); | ||
|
||
// Or set a global middleware | ||
// framework.use('session'); | ||
}; | ||
|
||
function view_homepage() { | ||
function view_index() { | ||
var self = this; | ||
|
||
if (typeof(self.session.counter) === 'undefined') | ||
self.session.counter = 0; | ||
self.session.counter++; | ||
|
||
self.view('homepage'); | ||
self.view('index'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
|
||
// Install session module | ||
framework.install('module', 'https://modules.totaljs.com/session/v1.00/session.js'); | ||
INSTALL('module', 'https://modules.totaljs.com/session/v1.00/session.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
exports.install = function(framework) { | ||
framework.route('/', view_homepage); | ||
}; | ||
|
||
function view_homepage() { | ||
var self = this; | ||
self.view('homepage'); | ||
} | ||
framework.route('/'); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div>CSS: @{routeStyle('style.css')}</div> | ||
<div>JS: @{routeScript('script.js')}</div> | ||
<div>IMG: @{routeImage('logo.png')}</div> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,18 @@ | ||
exports.install = function(framework) { | ||
framework.route('/', view_homepage); | ||
framework.route('/'); | ||
framework.file('All (.jpg, .png, .gif) images', image_resize); | ||
}; | ||
|
||
function view_homepage() { | ||
this.view('homepage'); | ||
} | ||
|
||
function image_resize(req, res, isValidation) { | ||
|
||
if (isValidation) | ||
return req.url.contains(['.jpg', '.png', '.gif']); | ||
|
||
// generate response | ||
// this === framework | ||
// Documentation: http://docs.totaljs.com/Framework/#framework.responseImage | ||
framework.responseImage(req, res, this.path.public(req.url), function (image) { | ||
|
||
// image === FrameworkImage | ||
// http://docs.totaljs.com/FrameworkImage/ | ||
|
||
image.resize('50%'); | ||
image.quality(80); | ||
image.minify(); | ||
|
||
}); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
static-version/views/homepage.html → static-version/views/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<div>CSS: @{routeCSS('style.css')}</div> | ||
<div>JS: @{routeJS('script.js')}</div> | ||
<div>CSS: @{routeStyle('style.css')}</div> | ||
<div>JS: @{routeScript('script.js')}</div> | ||
<div>IMG: @{routeImage('logo.png')}</div> | ||
<div>IMG (CUSTOM): @{routeImage('custom.png')}</div> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
exports.install = function(framework) { | ||
exports.install = function() { | ||
framework.route('/', view_homepage); | ||
|
||
// the number is maximum data receive | ||
framework.route('/', view_homepage, { flags: ['upload'], length: 1024 * 20 }); // 1 === 1 kB | ||
framework.route('/', view_homepage, ['upload'], 100); // 100 kB | ||
}; | ||
|
||
function view_homepage() { | ||
var self = this; | ||
|
||
var model = { info: '...' }; | ||
|
||
// self.files array of HttpFile === http://docs.totaljs.com/HttpFile/ | ||
if (self.files.length > 0) | ||
model.info = self.files[0].filename + ' ({0} kB - {1}x{2})'.format(Math.floor(self.files[0].length / 1024, 2), self.files[0].width, self.files[0].height); | ||
|
||
self.view('homepage', model); | ||
self.view('index', model); | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
exports.install = function(framework) { | ||
framework.route('/', view_homepage); | ||
}; | ||
|
||
function view_homepage() { | ||
var self = this; | ||
self.view('homepage'); | ||
} | ||
exports.install = function() { | ||
framework.route('/'); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
views-current/views/homepage.html → views-current/views/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
exports.install = function(framework) { | ||
framework.route('/', view_homepage); | ||
}; | ||
|
||
function view_homepage() { | ||
var self = this; | ||
self.view('homepage'); | ||
} | ||
exports.install = function() { | ||
framework.route('/'); | ||
}; |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.