8000 new changes · nCodefresh/examples@302295e · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 302295e

Browse files
committed
new changes
1 parent 5a2536e commit 302295e

File tree

62 files changed

+195
-291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+195
-291
lines changed

framework-stop/controllers/default.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
exports.install = function(framework) {
2-
framework.route('/', view_stop);
2+
framework.route('/', stop);
33
};
44

5-
function view_stop() {
6-
var self = this;
7-
5+
function stop() {
86
// stop server
97
framework.stop();
108
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
exports.install = function(framework) {
2-
framework.route('/', viewHomepage);
2+
framework.route('/', json_usage);
33
};
44

55
exports.usage = function() {
66
return 'controller usage';
77
};
88

9-
function viewHomepage() {
9+
function json_usage() {
1010
var self = this;
11-
1211
// self.framework.usage([detailed:bool default false])
1312
self.json(framework.usage(true), true);
1413
}
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+
};

html-appcache-offline/views/_layout.html renamed to html-appcache-offline/views/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html manifest="/offline.appcache">
2+
<html manifest="/offline.manifest">
33
<head>
44
@{meta}
55
<meta charset="utf-8" />

image-resize/controllers/default.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
var path = require('path');
22

33
exports.install = function(framework) {
4-
framework.route('/', view_homepage);
4+
framework.route('/', view_index);
55

66
// the number is maximum data receive
7-
framework.route('/', view_homepage, { flags: ['upload'], length: 1024 * 1000 * 1000 });
7+
framework.route('/', view_index, ['upload'], 100); // max 100 kB
88
};
99

10-
function view_homepage() {
10+
function view_index() {
1111

1212
var self = this;
1313
var model = { info: '...' };
1414

1515
var file = self.files[0];
16-
17-
if (self.files.length === 0) {
18-
self.view('homepage', model);
19-
return;
20-
}
21-
22-
if (!file.isImage()) {
23-
self.view('homepage', model);
16+
if (self.files.length === 0 || !file.isImage()) {
17+
self.view('index', model);
2418
return;
2519
}
2620

@@ -63,10 +57,8 @@ function view_homepage() {
6357
// IMPORTANT: see here https://github.com/petersirka/total.js/tree/master/examples/routing
6458

6559
image.resizeCenter(300, 300).save(filename, function(err, filename) {
66-
6760
model.url = '<div><img src="/{0}?ts={1}" width="300" height="300" alt="Uploaded image" /></div><br />'.format(path.basename(filename), new Date().getTime());
68-
self.view('homepage', model);
69-
61+
self.view('index', model);
7062
});
7163

7264
}
File renamed without changes.
File renamed without changes.

knockoutjs-todo/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@
22

33
The obligatory TODO app featuring Knockout.js and total.js.
44

5-
Author: [Joe Conley](https://github.com/josephpconley)
6-
7-
```
8-
npm install total.js
9-
```
5+
Author: [Joe Conley](https://github.com/josephpconley)

0 commit comments

Comments
 (0)
0