Permalink
Browse files

Updated express to 3.1.x and connect to 2.7.x

  • Loading branch information...
1 parent 59edaaf commit 83e12b62ab091df06fc4897ec00828db83801941 @pksunkara committed Feb 6, 2013
Showing with 30 additions and 21 deletions.
  1. +4 −3 lib/controller.js
  2. +2 −2 lib/director.js
  3. +18 −8 lib/helper.js
  4. +1 −1 lib/session.js
  5. +1 −1 lib/template/package.json
  6. +4 −6 package.json
View
@@ -87,7 +87,7 @@ Dispatch.builder = function (scope, path) {
if (_c(action)) {
this._scope['/' + url] = _m(this._scope['/' + url] || {}, _a(action), options.via);
if (options.as) {
- app.r[options.as + '_path'] = (url == '' ? _p(this._path) : _p(this._path.concat(url)));
+ app.r[options.as + '_path'] = (url === '' ? _p(this._path) : _p(this._path.concat(url)));
}
}
};
@@ -141,8 +141,9 @@ Dispatch._pathFunction = function (path) {
});
ret = ret.slice(0,-1);
- if (c==0) return ret;
- else {
+ if (c === 0) {
+ return ret;
+ } else {
eval('var func=function(){return "' + ret + '";};');
return func;
}
View
@@ -10,14 +10,14 @@ module.exports = function (app) {
app.router = function (req, res, next) {
app.route.dispatch(req, res, function (err) {
- if (err == undefined || err) next();
+ if (err === undefined || err) next();
});
};
director.http.methods.forEach(function (method) {
app[method] = function (path, route) {
if ('get' == method && !route) return app.set(path);
return app.route.on(method, path, route);
- }
+ };
});
};
View
@@ -43,38 +43,48 @@ module.exports = function (app, pwd) {
text: function (key) {
return layout(key, '<input type="text" class="input-xlarge" id=' + id(key) + ' name=' + name(key) + ' value="' + (model[key]?model[key]:'') + '"/>');
},
+
textarea: function (key) {
return layout(key, '<textarea class="input-xxlarge" rows="10" id=' + id(key) + ' name=' + name(key) + '>' + (model[key]?model[key]:'') + '</textarea>');
},
+
select: function (key, vals, names) {
var opt = '';
names = names || vals;
- for(i=0;i<vals.length;i++) {
+
+ for (i = 0; i < vals.length; i++) {
var s = ((model[key] && model[key]==vals[i])?'" selected="selected"':'"');
- opt+= '<option value="' + vals[i] + s + '>' + names[i] + '</option>';
- };
+ opt += '<option value="' + vals[i] + s + '>' + names[i] + '</option>';
+ }
+
return layout(key, '<select class="input-xlarge" id=' + id(key) + 'name=' + name(key) + '>' + opt + '</select>');
},
+
checkbox: function (key, vals, names, inline) {
var opt = '';
inline = (inline?' inline':'');
names = names || vals;
- for(i=0;i<vals.length;i++) {
+
+ for (i = 0; i < vals.length; i++) {
var c = ((model[key] && model[key]==vals[i])?'" checked="checked"':'"');
- opt+= '<label class="checkbox' + inline + '"><input type="checkbox" name=' + name(key) + ' value="' + vals[i] + c + '/>' + names[i] + '</label>';
+ opt += '<label class="checkbox' + inline + '"><input type="checkbox" name=' + name(key) + ' value="' + vals[i] + c + '/>' + names[i] + '</label>';
}
+
return layout(key, opt);
},
+
radio: function (key, vals, names, inline) {
var opt = '';
inline = (inline?' inline':'');
names = names || vals;
- for(i=0;i<vals.length;i++) {
+
+ for (i = 0; i < vals.length; i++) {
var c = ((model[key] && model[key]==vals[i])?'" checked="checked"':'"');
- opt+= '<label class="radio' + inline + '"><input type="radio" name=' + name(key) + ' value="' + vals[i] + c + '/>' + names[i] + '</label>';
+ opt += '<label class="radio' + inline + '"><input type="radio" name=' + name(key) + ' value="' + vals[i] + c + '/>' + names[i] + '</label>';
}
+
return layout(key, opt);
- },
+ }
};
};
View
@@ -59,7 +59,7 @@ module.exports = function (app) {
var expires = 'string' == typeof session.data.cookie.expires
? new Date(session.data.cookie.expires) : session.data.cookie.expires;
- if (!session || !expires || new Date > expires) {
+ if (!session || !expires || new Date() > expires) {
return fn && fn(null, null);
} else {
return fn(null, session.data);
@@ -6,7 +6,7 @@
"start": "node app"
},
"dependencies": {
- "express": "3.0.x",
+ "express": "3.1.x",
"jade": "0.x.x",
"bullet": "0.1.x"
},
View
@@ -26,20 +26,18 @@
}
],
"dependencies": {
- "connect": "2.4.x",
+ "connect": "2.7.x",
"utile": "0.1.x",
"nconf": "0.6.x",
"resourceful": "0.3.x",
"director": "1.1.x"
},
"devDependencies": {
- "api-easy": "0.3.x",
- "express": "3.0.x",
- "jade": "*",
- "vows": "0.6.x"
+ "express": "3.1.x",
+ "jade": "0.x.x"
},
"engines": {
- "node": ">0.6.x"
+ "node": "> 0.8.x"
},
"bugs": {
"url": "https://github.com/pksunkara/bullet/issues"

0 comments on commit 83e12b6

Please sign in to comment.