total5 0.0.1-33 → 0.0.1-35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/controller.js CHANGED
@@ -397,6 +397,11 @@ Controller.prototype.fallback = function(code, err) {
397
397
  }
398
398
  };
399
399
 
400
+ Controller.prototype.layout = function(name) {
401
+ var ctrl = this;
402
+ ctrl.response.layout = name;
403
+ };
404
+
400
405
  Controller.prototype.view = function(name, model) {
401
406
 
402
407
  var ctrl = this;
@@ -405,6 +410,7 @@ Controller.prototype.view = function(name, model) {
405
410
  return;
406
411
 
407
412
  var view = new F.TViewEngine.View(ctrl);
413
+ ctrl.response.layout && view.layout(ctrl.response.layout);
408
414
  var output = view.render(name, model);
409
415
  ctrl.html(output);
410
416
  };
@@ -1039,7 +1045,7 @@ function authorize(ctrl) {
1039
1045
  execute(ctrl);
1040
1046
  }
1041
1047
 
1042
- function execute(ctrl) {
1048
+ function execute(ctrl, skipmiddleware) {
1043
1049
 
1044
1050
  ctrl.timeout = ctrl.route.timeout || F.config.$httptimeout;
1045
1051
 
@@ -1053,7 +1059,7 @@ function execute(ctrl) {
1053
1059
  ctrl.uri.cache += ctrl.language;
1054
1060
  }
1055
1061
 
1056
- if (ctrl.route.middleware.length) {
1062
+ if (!skipmiddleware && ctrl.route.middleware.length) {
1057
1063
  middleware(ctrl);
1058
1064
  } else {
1059
1065
 
@@ -1403,7 +1409,7 @@ function middleware(ctrl) {
1403
1409
  else
1404
1410
  run(index + 1);
1405
1411
  } else
1406
- ctrl.route.action(ctrl);
1412
+ execute(ctrl, true);
1407
1413
  };
1408
1414
  run(0);
1409
1415
  }
package/cron.js CHANGED
@@ -28,7 +28,7 @@ function cronexec(output, date) {
28
28
  break;
29
29
  }
30
30
  } else if (m.type === 'every') {
31
- if (m.value % val !== 0) {
31
+ if (m.value[i] !== '*' && m.value[i] % val !== 0) {
32
32
  is = false;
33
33
  break;
34
34
  }
@@ -799,7 +799,7 @@ function send(self, id, data, callback) {
799
799
  } else if (id[0] === '#') {
800
800
  id = id.substring(1);
801
801
  for (let key in instances) {
802
- if (instances[key].module && instances[key].module.id === id) {
802
+ if (instances[key].module.name === id) {
803
803
  instance = instances[key];
804
804
  break;
805
805
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "total5",
3
- "version": "0.0.1-33",
3
+ "version": "0.0.1-35",
4
4
  "description": "Total.js framework v5",
5
5
  "main": "index.js",
6
6
  "directories": {
package/routing.js CHANGED
@@ -58,10 +58,10 @@ function Route(url, action, size) {
58
58
 
59
59
  if (url[0] === '#') {
60
60
  // internal routing
61
- t.url = [url[0].substring(1)];
61
+ t.url = [url.substring(1)];
62
62
  t.action = action;
63
63
  t.fallback = true;
64
- F.routes.fallback[t.url[0]] = t;
64
+ F.routes.fallback[t.url] = t;
65
65
  return;
66
66
  }
67
67