pull in some changes from private branch

This commit is contained in:
Tyler Renelle
2012-09-06 15:33:06 -04:00
parent da6b3d32af
commit 9fd4367a8a
5 changed files with 16 additions and 31 deletions
+4 -14
View File
@@ -71,8 +71,9 @@ get('/:uidParam?', function(page, model, _arg, next) {
});
ready(function(model) {
var poormanscron, setupSortable, step, tour, type, _i, _j, _len, _len1, _ref1, _ref2;
$('#purl-link').val(window.location.toString() + model.get('_userId'));
var pathParts, poormanscron, setupSortable, step, tour, type, _i, _j, _len, _len1, _ref1, _ref2;
pathParts = window.location.toString().split('/');
$('#purl').val("" + pathParts[0] + "//" + pathParts[2] + "/" + (model.get('_userId')));
$('[rel=tooltip]').tooltip();
$('[rel=popover]').popover();
model.on('set', '*', function() {
@@ -278,7 +279,7 @@ ready(function(model) {
return chart.draw(data, options);
};
exports.buyItem = function(e, el, next) {
var hp, index, money, task, taskId, user, value, _ref3, _results;
var hp, index, money, user, value, _ref3;
user = model.at('_user');
money = user.get('stats.money');
_ref3 = [$(el).attr('data-type'), $(el).attr('data-value'), $(el).attr('data-index')], type = _ref3[0], value = _ref3[1], index = _ref3[2];
@@ -299,17 +300,6 @@ ready(function(model) {
hp = 50;
}
return user.set('stats.hp', hp);
} else if (type === 'reroll') {
_results = [];
for (taskId in user.get('tasks')) {
task = model.at('_user.tasks.' + taskId);
if (task.get('type') !== 'reward') {
_results.push(task.set('value', 0));
} else {
_results.push(void 0);
}
}
return _results;
}
};
exports.vote = function(e, el, next) {
+2 -2
View File
@@ -66,13 +66,13 @@ habitrpgMiddleware = function(req, res, next) {
expressApp.use(express.favicon()).use(gzippo.staticGzip(publicPath, {
maxAge: ONE_YEAR
})).use(express.compress()).use(express.cookieParser()).use(store.sessionMiddleware({
})).use(express.compress()).use(express.bodyParser()).use(express.cookieParser()).use(store.sessionMiddleware({
secret: process.env.SESSION_SECRET || 'YOUR SECRET HERE',
cookie: {
maxAge: ONE_YEAR
},
store: new MongoStore({
db: 'habitrpg'
url: process.env.NODE_DB_URI
})
})).use(store.modelMiddleware()).use(habitrpgMiddleware).use(app.router()).use(expressApp.router).use(serverError(root));