mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
pull in some changes from private branch
This commit is contained in:
@@ -71,8 +71,9 @@ get('/:uidParam?', function(page, model, _arg, next) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ready(function(model) {
|
ready(function(model) {
|
||||||
var poormanscron, setupSortable, step, tour, type, _i, _j, _len, _len1, _ref1, _ref2;
|
var pathParts, poormanscron, setupSortable, step, tour, type, _i, _j, _len, _len1, _ref1, _ref2;
|
||||||
$('#purl-link').val(window.location.toString() + model.get('_userId'));
|
pathParts = window.location.toString().split('/');
|
||||||
|
$('#purl').val("" + pathParts[0] + "//" + pathParts[2] + "/" + (model.get('_userId')));
|
||||||
$('[rel=tooltip]').tooltip();
|
$('[rel=tooltip]').tooltip();
|
||||||
$('[rel=popover]').popover();
|
$('[rel=popover]').popover();
|
||||||
model.on('set', '*', function() {
|
model.on('set', '*', function() {
|
||||||
@@ -278,7 +279,7 @@ ready(function(model) {
|
|||||||
return chart.draw(data, options);
|
return chart.draw(data, options);
|
||||||
};
|
};
|
||||||
exports.buyItem = function(e, el, next) {
|
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');
|
user = model.at('_user');
|
||||||
money = user.get('stats.money');
|
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];
|
_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;
|
hp = 50;
|
||||||
}
|
}
|
||||||
return user.set('stats.hp', hp);
|
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) {
|
exports.vote = function(e, el, next) {
|
||||||
|
|||||||
@@ -66,13 +66,13 @@ habitrpgMiddleware = function(req, res, next) {
|
|||||||
|
|
||||||
expressApp.use(express.favicon()).use(gzippo.staticGzip(publicPath, {
|
expressApp.use(express.favicon()).use(gzippo.staticGzip(publicPath, {
|
||||||
maxAge: ONE_YEAR
|
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',
|
secret: process.env.SESSION_SECRET || 'YOUR SECRET HERE',
|
||||||
cookie: {
|
cookie: {
|
||||||
maxAge: ONE_YEAR
|
maxAge: ONE_YEAR
|
||||||
},
|
},
|
||||||
store: new MongoStore({
|
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));
|
})).use(store.modelMiddleware()).use(habitrpgMiddleware).use(app.router()).use(expressApp.router).use(serverError(root));
|
||||||
|
|
||||||
|
|||||||
@@ -64,10 +64,10 @@ get '/:uidParam?', (page, model, {uidParam}, next) ->
|
|||||||
|
|
||||||
ready (model) ->
|
ready (model) ->
|
||||||
|
|
||||||
# TODO should all UI stuff be placed in this.on('render',function(){}) ? see chat example
|
# protocol+host+port = window.location.origin, only webkit. stupid.
|
||||||
|
# also, {_purl} in template won't register, have to use $().val something is messed up
|
||||||
# FIXME weirdest thing: doing model.set('_purl',...) and binding {_purl} in the view does not work
|
pathParts = window.location.toString().split('/')
|
||||||
$('#purl-link').val(window.location.toString() + model.get('_userId'))
|
$('#purl').val "#{pathParts[0]}//#{pathParts[2]}/#{model.get('_userId')}"
|
||||||
|
|
||||||
$('[rel=tooltip]').tooltip()
|
$('[rel=tooltip]').tooltip()
|
||||||
$('[rel=popover]').popover()
|
$('[rel=popover]').popover()
|
||||||
@@ -246,11 +246,6 @@ ready (model) ->
|
|||||||
hp += 15
|
hp += 15
|
||||||
hp = 50 if hp > 50
|
hp = 50 if hp > 50
|
||||||
user.set 'stats.hp', hp
|
user.set 'stats.hp', hp
|
||||||
else if type == 'reroll'
|
|
||||||
for taskId of user.get('tasks')
|
|
||||||
task = model.at('_user.tasks.'+taskId)
|
|
||||||
task.set('value', 0) unless task.get('type')=='reward'
|
|
||||||
|
|
||||||
|
|
||||||
exports.vote = (e, el, next) ->
|
exports.vote = (e, el, next) ->
|
||||||
direction = $(el).attr('data-direction')
|
direction = $(el).attr('data-direction')
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ expressApp
|
|||||||
.use(express.compress())
|
.use(express.compress())
|
||||||
|
|
||||||
# Uncomment to add form data parsing support
|
# Uncomment to add form data parsing support
|
||||||
# .use(express.bodyParser())
|
.use(express.bodyParser())
|
||||||
# .use(express.methodOverride())
|
# .use(express.methodOverride())
|
||||||
|
|
||||||
# Uncomment and supply secret to add Derby session handling
|
# Uncomment and supply secret to add Derby session handling
|
||||||
@@ -72,7 +72,7 @@ expressApp
|
|||||||
.use(store.sessionMiddleware
|
.use(store.sessionMiddleware
|
||||||
secret: process.env.SESSION_SECRET || 'YOUR SECRET HERE'
|
secret: process.env.SESSION_SECRET || 'YOUR SECRET HERE'
|
||||||
cookie: {maxAge: ONE_YEAR}
|
cookie: {maxAge: ONE_YEAR}
|
||||||
store: new MongoStore(db: 'habitrpg')
|
store: new MongoStore(url: process.env.NODE_DB_URI)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Adds req.getModel method
|
# Adds req.getModel method
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<p>Authentication isn't yet available (<a href="https://github.com/lefnire/habitrpg#how-do-i-log-in--save-my-data">follow progress here</a>),<br/>
|
<p>Authentication isn't yet available (<a href="https://github.com/lefnire/habitrpg#how-do-i-log-in--save-my-data">follow progress here</a>),<br/>
|
||||||
In the meantime a persistent URL can be used accross <br/>
|
In the meantime a persistent URL can be used accross <br/>
|
||||||
browsers to access your data. Bookmark the following URL.</p>
|
browsers to access your data. Bookmark the following URL.</p>
|
||||||
<input id="purl-link" type=text class=input-xlarge value="" />
|
<input id='purl' type=text class=input-xlarge value="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@
|
|||||||
{#with _items.armor as :item}<app:item />{/}
|
{#with _items.armor as :item}<app:item />{/}
|
||||||
{#with _items.weapon as :item}<app:item />{/}
|
{#with _items.weapon as :item}<app:item />{/}
|
||||||
{#with _items.potion as :item}<app:item />{/}
|
{#with _items.potion as :item}<app:item />{/}
|
||||||
{#with _items.reroll as :item}<app:item />{/}
|
{#with _items.reroll as :item}<app:item reroll=true/>{/}
|
||||||
</ul>
|
</ul>
|
||||||
{/}
|
{/}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user