upgrade browseridy to 2.34.x and grunt build

This commit is contained in:
Matteo Pagliazzi 2013-10-23 18:25:41 +02:00
parent 9285a3e44b
commit 79e0d5cba2
2 changed files with 71 additions and 21 deletions

View file

@ -53,7 +53,7 @@ process.chdir = function (dir) {
}; };
},{}],2:[function(require,module,exports){ },{}],2:[function(require,module,exports){
var global=self;/** var global=typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};/**
* @license * @license
* Lo-Dash 1.3.1 (Custom Build) <http://lodash.com/> * Lo-Dash 1.3.1 (Custom Build) <http://lodash.com/>
* Build: `lodash modern -o ./dist/lodash.js` * Build: `lodash modern -o ./dist/lodash.js`
@ -7347,6 +7347,7 @@ if(typeof module != 'undefined' && module.exports){
obj.revive = function(user, options) { obj.revive = function(user, options) {
var candidate, loseThisItem, owned, paths; var candidate, loseThisItem, owned, paths;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -7396,6 +7397,7 @@ if(typeof module != 'undefined' && module.exports){
obj.tnl = function(level) { obj.tnl = function(level) {
var value; var value;
if (level >= 100) { if (level >= 100) {
value = 0; value = 0;
} else { } else {
@ -7415,6 +7417,7 @@ if(typeof module != 'undefined' && module.exports){
obj.expModifier = function(value, weaponStr, level, priority) { obj.expModifier = function(value, weaponStr, level, priority) {
var exp, str, strMod, totalStr; var exp, str, strMod, totalStr;
if (priority == null) { if (priority == null) {
priority = '!'; priority = '!';
} }
@ -7437,6 +7440,7 @@ if(typeof module != 'undefined' && module.exports){
obj.hpModifier = function(value, armorDef, helmDef, shieldDef, level, priority) { obj.hpModifier = function(value, armorDef, helmDef, shieldDef, level, priority) {
var def, defMod, hp, totalDef; var def, defMod, hp, totalDef;
if (priority == null) { if (priority == null) {
priority = '!'; priority = '!';
} }
@ -7455,6 +7459,7 @@ if(typeof module != 'undefined' && module.exports){
obj.gpModifier = function(value, modifier, priority, streak, user) { obj.gpModifier = function(value, modifier, priority, streak, user) {
var afterStreak, streakBonus, val; var afterStreak, streakBonus, val;
if (priority == null) { if (priority == null) {
priority = '!'; priority = '!';
} }
@ -7481,6 +7486,7 @@ if(typeof module != 'undefined' && module.exports){
obj.taskDeltaFormula = function(currentValue, direction) { obj.taskDeltaFormula = function(currentValue, direction) {
var delta; var delta;
if (currentValue < -47.27) { if (currentValue < -47.27) {
currentValue = -47.27; currentValue = -47.27;
} else if (currentValue > 21.27) { } else if (currentValue > 21.27) {
@ -7499,7 +7505,8 @@ if(typeof module != 'undefined' && module.exports){
randomDrop = function(user, delta, priority, streak, options) { randomDrop = function(user, delta, priority, streak, options) {
var acceptableDrops, chanceMultiplier, drop, paths, rarity, reachedDropLimit, _base, _base1, _base2, _ref1; var acceptableDrops, chanceMultiplier, drop, paths, rarity, reachedDropLimit, _base, _base1, _base2, _ref1, _ref2, _ref3, _ref4;
if (streak == null) { if (streak == null) {
streak = 0; streak = 0;
} }
@ -7507,7 +7514,7 @@ if(typeof module != 'undefined' && module.exports){
options = {}; options = {};
} }
paths = options.paths || {}; paths = options.paths || {};
if ((_base = user.items).lastDrop == null) { if ((_ref1 = (_base = user.items).lastDrop) == null) {
_base.lastDrop = { _base.lastDrop = {
date: +moment().subtract('d', 1), date: +moment().subtract('d', 1),
count: 0 count: 0
@ -7521,11 +7528,11 @@ if(typeof module != 'undefined' && module.exports){
chanceMultiplier = Math.abs(delta); chanceMultiplier = Math.abs(delta);
chanceMultiplier *= obj.priorityValue(priority); chanceMultiplier *= obj.priorityValue(priority);
chanceMultiplier += streak; chanceMultiplier += streak;
if (((_ref1 = user.flags) != null ? _ref1.dropsEnabled : void 0) && Math.random() < (.05 * chanceMultiplier)) { if (((_ref2 = user.flags) != null ? _ref2.dropsEnabled : void 0) && Math.random() < (.05 * chanceMultiplier)) {
rarity = Math.random(); rarity = Math.random();
if (rarity > .5) { if (rarity > .5) {
drop = helpers.randomVal(pets); drop = helpers.randomVal(pets);
((_base1 = user.items).eggs != null ? (_base1 = user.items).eggs : _base1.eggs = []).push(drop); ((_ref3 = (_base1 = user.items).eggs) != null ? _ref3 : _base1.eggs = []).push(drop);
paths['items.eggs'] = true; paths['items.eggs'] = true;
drop.type = 'Egg'; drop.type = 'Egg';
drop.dialog = "You've found a " + drop.text + " Egg! " + drop.notes; drop.dialog = "You've found a " + drop.text + " Egg! " + drop.notes;
@ -7541,11 +7548,12 @@ if(typeof module != 'undefined' && module.exports){
acceptableDrops = ['Base', 'White', 'Desert']; acceptableDrops = ['Base', 'White', 'Desert'];
} }
acceptableDrops = hatchingPotions.filter(function(hatchingPotion) { acceptableDrops = hatchingPotions.filter(function(hatchingPotion) {
var _ref2; var _ref4;
return _ref2 = hatchingPotion.name, __indexOf.call(acceptableDrops, _ref2) >= 0;
return _ref4 = hatchingPotion.name, __indexOf.call(acceptableDrops, _ref4) >= 0;
}); });
drop = helpers.randomVal(acceptableDrops); drop = helpers.randomVal(acceptableDrops);
((_base2 = user.items).hatchingPotions != null ? (_base2 = user.items).hatchingPotions : _base2.hatchingPotions = []).push(drop.name); ((_ref4 = (_base2 = user.items).hatchingPotions) != null ? _ref4 : _base2.hatchingPotions = []).push(drop.name);
paths['items.hatchingPotions'] = true; paths['items.hatchingPotions'] = true;
drop.type = 'HatchingPotion'; drop.type = 'HatchingPotion';
drop.dialog = "You've found a " + drop.text + " Hatching Potion! " + drop.notes; drop.dialog = "You've found a " + drop.text + " Hatching Potion! " + drop.notes;
@ -7558,7 +7566,8 @@ if(typeof module != 'undefined' && module.exports){
}; };
obj.score = function(user, task, direction, options) { obj.score = function(user, task, direction, options) {
var addPoints, calculateDelta, cron, delta, exp, gp, hp, lvl, num, paths, priority, streak, subtractPoints, times, type, value, _ref1, _ref2, _ref3; var addPoints, calculateDelta, cron, delta, exp, gp, hp, lvl, num, paths, priority, streak, subtractPoints, times, type, value, _ref1, _ref2, _ref3, _ref4;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -7589,6 +7598,7 @@ if(typeof module != 'undefined' && module.exports){
} }
return _.times(times, function() { return _.times(times, function() {
var nextDelta; var nextDelta;
nextDelta = obj.taskDeltaFormula(value, direction); nextDelta = obj.taskDeltaFormula(value, direction);
if (adjustvalue) { if (adjustvalue) {
value += nextDelta; value += nextDelta;
@ -7598,6 +7608,7 @@ if(typeof module != 'undefined' && module.exports){
}; };
addPoints = function() { addPoints = function() {
var weaponStr; var weaponStr;
weaponStr = items.getItem('weapon', user.items.weapon).strength; weaponStr = items.getItem('weapon', user.items.weapon).strength;
exp += obj.expModifier(delta, weaponStr, user.stats.lvl, priority) / 2; exp += obj.expModifier(delta, weaponStr, user.stats.lvl, priority) / 2;
if (streak) { if (streak) {
@ -7608,6 +7619,7 @@ if(typeof module != 'undefined' && module.exports){
}; };
subtractPoints = function() { subtractPoints = function() {
var armorDef, headDef, shieldDef; var armorDef, headDef, shieldDef;
armorDef = items.getItem('armor', user.items.armor).defense; armorDef = items.getItem('armor', user.items.armor).defense;
headDef = items.getItem('head', user.items.head).defense; headDef = items.getItem('head', user.items.head).defense;
shieldDef = items.getItem('shield', user.items.shield).defense; shieldDef = items.getItem('shield', user.items.shield).defense;
@ -7622,7 +7634,7 @@ if(typeof module != 'undefined' && module.exports){
subtractPoints(); subtractPoints();
} }
if (task.value !== value) { if (task.value !== value) {
(task.history != null ? task.history : task.history = []).push({ ((_ref4 = task.history) != null ? _ref4 : task.history = []).push({
date: +(new Date), date: +(new Date),
value: value value: value
}); });
@ -7639,7 +7651,15 @@ if(typeof module != 'undefined' && module.exports){
addPoints(); addPoints();
if (direction === 'up') { if (direction === 'up') {
streak = streak ? streak + 1 : 1; streak = streak ? streak + 1 : 1;
if ((streak % 21) === 0) {
user.achievements.streak = user.achievements.streak ? user.achievements.streak + 1 : 1;
paths["achievements.streak"] = true;
}
} else { } else {
if ((streak % 21) === 0) {
user.achievements.streak = user.achievements.streak ? user.achievements.streak - 1 : 0;
paths["achievements.streak"] = true;
}
streak = streak ? streak - 1 : 0; streak = streak ? streak - 1 : 0;
} }
task.streak = streak; task.streak = streak;
@ -7690,7 +7710,8 @@ if(typeof module != 'undefined' && module.exports){
updateStats = function(user, newStats, options) { updateStats = function(user, newStats, options) {
var gp, paths, tnl; var gp, paths, tnl, _ref1;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -7733,7 +7754,7 @@ if(typeof module != 'undefined' && module.exports){
paths['stats.lvl'] = true; paths['stats.lvl'] = true;
paths['stats.gp'] = true; paths['stats.gp'] = true;
paths['stats.hp'] = true; paths['stats.hp'] = true;
if (user.flags == null) { if ((_ref1 = user.flags) == null) {
user.flags = {}; user.flags = {};
} }
if (!user.flags.customizationsNotification && (user.stats.exp > 10 || user.stats.lvl > 1)) { if (!user.flags.customizationsNotification && (user.stats.exp > 10 || user.stats.lvl > 1)) {
@ -7771,7 +7792,8 @@ if(typeof module != 'undefined' && module.exports){
obj.cron = function(user, options) { obj.cron = function(user, options) {
var daysMissed, expTally, lvl, now, paths, todoTally, _base, _base1, _ref1; var daysMissed, expTally, lvl, now, paths, todoTally, _base, _base1, _ref1, _ref2, _ref3, _ref4;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -7794,7 +7816,8 @@ if(typeof module != 'undefined' && module.exports){
} }
todoTally = 0; todoTally = 0;
user.todos.concat(user.dailys).forEach(function(task) { user.todos.concat(user.dailys).forEach(function(task) {
var absVal, completed, id, repeat, scheduleMisses, type; var absVal, completed, id, repeat, scheduleMisses, type, _ref2;
if (!task) { if (!task) {
return; return;
} }
@ -7805,6 +7828,7 @@ if(typeof module != 'undefined' && module.exports){
scheduleMisses = 0; scheduleMisses = 0;
_.times(daysMissed, function(n) { _.times(daysMissed, function(n) {
var thatDay; var thatDay;
thatDay = moment(now).subtract('days', n + 1); thatDay = moment(now).subtract('days', n + 1);
if (helpers.shouldDo(thatDay, repeat, user.preferences)) { if (helpers.shouldDo(thatDay, repeat, user.preferences)) {
return scheduleMisses++; return scheduleMisses++;
@ -7821,7 +7845,7 @@ if(typeof module != 'undefined' && module.exports){
} }
switch (type) { switch (type) {
case 'daily': case 'daily':
(task.history != null ? task.history : task.history = []).push({ ((_ref2 = task.history) != null ? _ref2 : task.history = []).push({
date: +(new Date), date: +(new Date),
value: task.value value: task.value
}); });
@ -7843,7 +7867,7 @@ if(typeof module != 'undefined' && module.exports){
return paths["tasks." + task.id + ".value"] = true; return paths["tasks." + task.id + ".value"] = true;
} }
}); });
((_base = (user.history != null ? user.history : user.history = {})).todos != null ? (_base = (user.history != null ? user.history : user.history = {})).todos : _base.todos = []).push({ ((_ref2 = (_base = ((_ref3 = user.history) != null ? _ref3 : user.history = {})).todos) != null ? _ref2 : _base.todos = []).push({
date: now, date: now,
value: todoTally value: todoTally
}); });
@ -7853,7 +7877,7 @@ if(typeof module != 'undefined' && module.exports){
lvl++; lvl++;
expTally += obj.tnl(lvl); expTally += obj.tnl(lvl);
} }
((_base1 = user.history).exp != null ? (_base1 = user.history).exp : _base1.exp = []).push({ ((_ref4 = (_base1 = user.history).exp) != null ? _ref4 : _base1.exp = []).push({
date: now, date: now,
value: expTally value: expTally
}); });
@ -7883,6 +7907,7 @@ var process=require("__browserify_process");(function() {
sanitizeOptions = function(o) { sanitizeOptions = function(o) {
var dayStart, now, timezoneOffset, _ref; var dayStart, now, timezoneOffset, _ref;
dayStart = o.dayStart && (0 <= (_ref = +o.dayStart) && _ref <= 24) ? +o.dayStart : 0; dayStart = o.dayStart && (0 <= (_ref = +o.dayStart) && _ref <= 24) ? +o.dayStart : 0;
timezoneOffset = o.timezoneOffset ? +o.timezoneOffset : +moment().zone(); timezoneOffset = o.timezoneOffset ? +o.timezoneOffset : +moment().zone();
now = o.now ? moment(o.now).zone(timezoneOffset) : moment(+(new Date)).zone(timezoneOffset); now = o.now ? moment(o.now).zone(timezoneOffset) : moment(+(new Date)).zone(timezoneOffset);
@ -7895,6 +7920,7 @@ var process=require("__browserify_process");(function() {
startOfWeek = function(options) { startOfWeek = function(options) {
var o; var o;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -7904,6 +7930,7 @@ var process=require("__browserify_process");(function() {
startOfDay = function(options) { startOfDay = function(options) {
var o; var o;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -7928,6 +7955,7 @@ var process=require("__browserify_process");(function() {
daysSince = function(yesterday, options) { daysSince = function(yesterday, options) {
var o; var o;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -7944,6 +7972,7 @@ var process=require("__browserify_process");(function() {
shouldDo = function(day, repeat, options) { shouldDo = function(day, repeat, options) {
var o, selected, yesterday; var o, selected, yesterday;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -7968,6 +7997,7 @@ var process=require("__browserify_process");(function() {
uuid = function() { uuid = function() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
var r, v; var r, v;
r = Math.random() * 16 | 0; r = Math.random() * 16 | 0;
v = (c === "x" ? r : r & 0x3 | 0x8); v = (c === "x" ? r : r & 0x3 | 0x8);
return v.toString(16); return v.toString(16);
@ -7977,7 +8007,8 @@ var process=require("__browserify_process");(function() {
module.exports = { module.exports = {
uuid: uuid, uuid: uuid,
taskDefaults: function(task, filters) { taskDefaults: function(task, filters) {
var defaults, self; var defaults, self, _ref;
if (filters == null) { if (filters == null) {
filters = {}; filters = {};
} }
@ -8006,13 +8037,14 @@ var process=require("__browserify_process");(function() {
}) })
}; };
_.defaults(task, defaults); _.defaults(task, defaults);
if (task.value == null) { if ((_ref = task.value) == null) {
task.value = task.type === 'reward' ? 10 : 0; task.value = task.type === 'reward' ? 10 : 0;
} }
return task; return task;
}, },
newUser: function(isDerby) { newUser: function(isDerby) {
var defaultTags, defaultTasks, guid, newUser, repeat, tag, task, userSchema, _i, _j, _len, _len1; var defaultTags, defaultTasks, guid, newUser, repeat, tag, task, userSchema, _i, _j, _len, _len1;
if (isDerby == null) { if (isDerby == null) {
isDerby = false; isDerby = false;
} }
@ -8175,16 +8207,19 @@ var process=require("__browserify_process");(function() {
dotSet: function(path, val, obj) { dotSet: function(path, val, obj) {
var arr, err; var arr, err;
if (~path.indexOf('undefined')) { if (~path.indexOf('undefined')) {
return; return;
} }
try { try {
arr = path.split('.'); arr = path.split('.');
return _.reduce(arr, function(curr, next, index) { return _.reduce(arr, function(curr, next, index) {
var _ref;
if ((arr.length - 1) === index) { if ((arr.length - 1) === index) {
curr[next] = val; curr[next] = val;
} }
return curr[next] != null ? curr[next] : curr[next] = {}; return (_ref = curr[next]) != null ? _ref : curr[next] = {};
}, obj); }, obj);
} catch (_error) { } catch (_error) {
err = _error; err = _error;
@ -8198,6 +8233,7 @@ var process=require("__browserify_process");(function() {
}, },
dotGet: function(path, obj) { dotGet: function(path, obj) {
var err; var err;
if (~path.indexOf('undefined')) { if (~path.indexOf('undefined')) {
return void 0; return void 0;
} }
@ -8227,6 +8263,7 @@ var process=require("__browserify_process");(function() {
randomVal: function(obj) { randomVal: function(obj) {
var count, key, result, val; var count, key, result, val;
result = void 0; result = void 0;
count = 0; count = 0;
for (key in obj) { for (key in obj) {
@ -8253,6 +8290,7 @@ var process=require("__browserify_process");(function() {
username: function(auth, override) { username: function(auth, override) {
var fb, _ref; var fb, _ref;
if (override) { if (override) {
return override; return override;
} }
@ -8277,6 +8315,7 @@ var process=require("__browserify_process");(function() {
encodeiCalLink: function(uid, apiToken) { encodeiCalLink: function(uid, apiToken) {
var loc, _ref; var loc, _ref;
loc = (typeof window !== "undefined" && window !== null ? window.location.host : void 0) || (typeof process !== "undefined" && process !== null ? (_ref = process.env) != null ? _ref.BASE_URL : void 0 : void 0) || ''; loc = (typeof window !== "undefined" && window !== null ? window.location.host : void 0) || (typeof process !== "undefined" && process !== null ? (_ref = process.env) != null ? _ref.BASE_URL : void 0 : void 0) || '';
return encodeURIComponent("http://" + loc + "/v1/users/" + uid + "/calendar.ics?apiToken=" + apiToken); return encodeURIComponent("http://" + loc + "/v1/users/" + uid + "/calendar.ics?apiToken=" + apiToken);
}, },
@ -8286,6 +8325,7 @@ var process=require("__browserify_process");(function() {
equipped: function(type, item, preferences, backerTier) { equipped: function(type, item, preferences, backerTier) {
var armorSet, gender; var armorSet, gender;
if (item == null) { if (item == null) {
item = 0; item = 0;
} }
@ -8382,6 +8422,7 @@ var process=require("__browserify_process");(function() {
taskClasses: function(task, filters, dayStart, lastCron, showCompleted, main) { taskClasses: function(task, filters, dayStart, lastCron, showCompleted, main) {
var classes, completed, enabled, filter, repeat, type, value, _ref; var classes, completed, enabled, filter, repeat, type, value, _ref;
if (showCompleted == null) { if (showCompleted == null) {
showCompleted = false; showCompleted = false;
} }
@ -8475,6 +8516,7 @@ var process=require("__browserify_process");(function() {
appliedTags: function(userTags, taskTags) { appliedTags: function(userTags, taskTags) {
var arr; var arr;
arr = []; arr = [];
_.each(userTags, function(t) { _.each(userTags, function(t) {
if (t == null) { if (t == null) {
@ -8495,6 +8537,7 @@ var process=require("__browserify_process");(function() {
}, },
totalStr: function(level, weapon) { totalStr: function(level, weapon) {
var str; var str;
if (weapon == null) { if (weapon == null) {
weapon = 0; weapon = 0;
} }
@ -8506,6 +8549,7 @@ var process=require("__browserify_process");(function() {
}, },
totalDef: function(level, armor, head, shield) { totalDef: function(level, armor, head, shield) {
var totalDef; var totalDef;
if (armor == null) { if (armor == null) {
armor = 0; armor = 0;
} }
@ -8526,6 +8570,7 @@ var process=require("__browserify_process");(function() {
}, },
itemStat: function(type, item) { itemStat: function(type, item) {
var i; var i;
if (item == null) { if (item == null) {
item = 0; item = 0;
} }
@ -8549,6 +8594,7 @@ var process=require("__browserify_process");(function() {
hydrate: function(spec) { hydrate: function(spec) {
var hydrated, keys, var hydrated, keys,
_this = this; _this = this;
if (_.isObject(spec) && !_.isArray(spec)) { if (_.isObject(spec) && !_.isArray(spec)) {
hydrated = {}; hydrated = {};
keys = _.keys(spec).concat(_.keys(spec.__proto__)); keys = _.keys(spec).concat(_.keys(spec.__proto__));
@ -8925,6 +8971,7 @@ try {
module.exports.buyItem = function(user, type, options) { module.exports.buyItem = function(user, type, options) {
var nextItem; var nextItem;
if (options == null) { if (options == null) {
options = {}; options = {};
} }
@ -8957,9 +9004,11 @@ try {
module.exports.updateStore = function(user) { module.exports.updateStore = function(user) {
var changes; var changes;
changes = {}; changes = {};
_.each(['weapon', 'armor', 'shield', 'head'], function(type) { _.each(['weapon', 'armor', 'shield', 'head'], function(type) {
var i, showNext, _ref, _ref1, _ref2; var i, showNext, _ref, _ref1, _ref2;
i = ~~(((_ref = user.items) != null ? _ref[type] : void 0) || 0) + 1; i = ~~(((_ref = user.items) != null ? _ref[type] : void 0) || 0) + 1;
showNext = true; showNext = true;
if (i === items[type].length - 1) { if (i === items[type].length - 1) {
@ -8987,6 +9036,7 @@ try {
module.exports.getItem = function(type, index) { module.exports.getItem = function(type, index) {
var i; var i;
if (index == null) { if (index == null) {
index = 0; index = 0;
} }

View file

@ -2,7 +2,7 @@
"name": "habitrpg-shared", "name": "habitrpg-shared",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"browserify": "~2.14.1", "browserify": "~2.34.3",
"coffeeify": "0.4.0", "coffeeify": "0.4.0",
"coffee-script": "1.6.2", "coffee-script": "1.6.2",
"relative-date": "~1.1.1", "relative-date": "~1.1.1",