mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
change references to imported libs
This commit is contained in:
@@ -6,7 +6,7 @@ module.exports = function(user, req, cb) {
|
|||||||
}
|
}
|
||||||
user.tags.push({
|
user.tags.push({
|
||||||
name: req.body.name,
|
name: req.body.name,
|
||||||
id: req.body.id || api.uuid()
|
id: req.body.id || uuid()
|
||||||
});
|
});
|
||||||
return typeof cb === "function" ? cb(null, user.tags) : void 0;
|
return typeof cb === "function" ? cb(null, user.tags) : void 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import i18n from '../i18n';
|
|||||||
|
|
||||||
module.exports = function(user, req, cb) {
|
module.exports = function(user, req, cb) {
|
||||||
var task;
|
var task;
|
||||||
task = api.taskDefaults(req.body);
|
task = taskDefaults(req.body);
|
||||||
if (user.tasks[task.id] != null) {
|
if (user.tasks[task.id] != null) {
|
||||||
return typeof cb === "function" ? cb({
|
return typeof cb === "function" ? cb({
|
||||||
code: 409,
|
code: 409,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import refPush from '../libs/refPush';
|
|||||||
module.exports = function(user, req, cb) {
|
module.exports = function(user, req, cb) {
|
||||||
var wh;
|
var wh;
|
||||||
wh = user.preferences.webhooks;
|
wh = user.preferences.webhooks;
|
||||||
api.refPush(wh, {
|
refPush(wh, {
|
||||||
url: req.body.url,
|
url: req.body.url,
|
||||||
enabled: req.body.enabled || true,
|
enabled: req.body.enabled || true,
|
||||||
id: req.body.id
|
id: req.body.id
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ module.exports = function(user, req, cb, analytics) {
|
|||||||
image: '<span class="shop_' + drop.key + ' pull-left"></span>',
|
image: '<span class="shop_' + drop.key + ' pull-left"></span>',
|
||||||
dropText: drop.text(req.language)
|
dropText: drop.text(req.language)
|
||||||
}, req.language);
|
}, req.language);
|
||||||
if (api.count.remainingGearInSet(user.items.gear.owned, 'armoire') === 0) {
|
if (count.remainingGearInSet(user.items.gear.owned, 'armoire') === 0) {
|
||||||
user.flags.armoireEmpty = true;
|
user.flags.armoireEmpty = true;
|
||||||
}
|
}
|
||||||
armoireResp = {
|
armoireResp = {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ module.exports = function(user, req, cb, analytics) {
|
|||||||
con: 0,
|
con: 0,
|
||||||
per: 0,
|
per: 0,
|
||||||
int: 0,
|
int: 0,
|
||||||
points: api.capByLevel(user.stats.lvl)
|
points: capByLevel(user.stats.lvl)
|
||||||
});
|
});
|
||||||
user.flags.classSelected = false;
|
user.flags.classSelected = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ module.exports = function(user, req, cb) {
|
|||||||
user.flags.classSelected = true;
|
user.flags.classSelected = true;
|
||||||
user.preferences.disableClasses = true;
|
user.preferences.disableClasses = true;
|
||||||
user.preferences.autoAllocate = true;
|
user.preferences.autoAllocate = true;
|
||||||
user.stats.str = api.capByLevel(user.stats.lvl);
|
user.stats.str = capByLevel(user.stats.lvl);
|
||||||
user.stats.points = 0;
|
user.stats.points = 0;
|
||||||
return typeof cb === "function" ? cb(null, _.pick(user, splitWhitespace('stats flags preferences'))) : void 0;
|
return typeof cb === "function" ? cb(null, _.pick(user, splitWhitespace('stats flags preferences'))) : void 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ module.exports = function(user, req, cb, analytics) {
|
|||||||
var analyticsData, convCap, convRate, item, key, price, ref, ref1, ref2, ref3, type;
|
var analyticsData, convCap, convRate, item, key, price, ref, ref1, ref2, ref3, type;
|
||||||
ref = req.params, type = ref.type, key = ref.key;
|
ref = req.params, type = ref.type, key = ref.key;
|
||||||
if (type === 'gems' && key === 'gem') {
|
if (type === 'gems' && key === 'gem') {
|
||||||
ref1 = api.planGemLimits, convRate = ref1.convRate, convCap = ref1.convCap;
|
ref1 = planGemLimits, convRate = ref1.convRate, convCap = ref1.convCap;
|
||||||
convCap += user.purchased.plan.consecutive.gemCapExtra;
|
convCap += user.purchased.plan.consecutive.gemCapExtra;
|
||||||
if (!((ref2 = user.purchased) != null ? (ref3 = ref2.plan) != null ? ref3.customerId : void 0 : void 0)) {
|
if (!((ref2 = user.purchased) != null ? (ref3 = ref2.plan) != null ? ref3.customerId : void 0 : void 0)) {
|
||||||
return typeof cb === "function" ? cb({
|
return typeof cb === "function" ? cb({
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { MAX_LEVEL } from '../constants';
|
|||||||
|
|
||||||
module.exports = function(user, req, cb, analytics) {
|
module.exports = function(user, req, cb, analytics) {
|
||||||
var analyticsData, flags, gear, lvl, stats;
|
var analyticsData, flags, gear, lvl, stats;
|
||||||
if (user.balance < 2 && user.stats.lvl < api.maxLevel) {
|
if (user.balance < 2 && user.stats.lvl < MAX_LEVEL) {
|
||||||
return typeof cb === "function" ? cb({
|
return typeof cb === "function" ? cb({
|
||||||
code: 401,
|
code: 401,
|
||||||
message: i18n.t('notEnoughGems', req.language)
|
message: i18n.t('notEnoughGems', req.language)
|
||||||
@@ -16,7 +16,7 @@ module.exports = function(user, req, cb, analytics) {
|
|||||||
uuid: user._id,
|
uuid: user._id,
|
||||||
category: 'behavior'
|
category: 'behavior'
|
||||||
};
|
};
|
||||||
if (user.stats.lvl < api.maxLevel) {
|
if (user.stats.lvl < MAX_LEVEL) {
|
||||||
user.balance -= 2;
|
user.balance -= 2;
|
||||||
analyticsData.acquireMethod = 'Gems';
|
analyticsData.acquireMethod = 'Gems';
|
||||||
analyticsData.gemCost = 8;
|
analyticsData.gemCost = 8;
|
||||||
@@ -27,7 +27,7 @@ module.exports = function(user, req, cb, analytics) {
|
|||||||
if (analytics != null) {
|
if (analytics != null) {
|
||||||
analytics.track('Rebirth', analyticsData);
|
analytics.track('Rebirth', analyticsData);
|
||||||
}
|
}
|
||||||
lvl = api.capByLevel(user.stats.lvl);
|
lvl = capByLevel(user.stats.lvl);
|
||||||
_.each(user.tasks, function(task) {
|
_.each(user.tasks, function(task) {
|
||||||
if (task.type !== 'reward') {
|
if (task.type !== 'reward') {
|
||||||
task.value = 0;
|
task.value = 0;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module.exports = function(user, req, cb) {
|
|||||||
}
|
}
|
||||||
tasks = user[task.type + "s"];
|
tasks = user[task.type + "s"];
|
||||||
if (task.type === 'todo' && tasks[from] !== task) {
|
if (task.type === 'todo' && tasks[from] !== task) {
|
||||||
preenedTasks = api.preenTodos(tasks);
|
preenedTasks = preenTodos(tasks);
|
||||||
if (to !== -1) {
|
if (to !== -1) {
|
||||||
to = tasks.indexOf(preenedTasks[to]);
|
to = tasks.indexOf(preenedTasks[to]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user