From 7f68fd017a76c5b2e7fc3ffe6bdd5936a68ca855 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 2 Sep 2013 17:15:12 -0400 Subject: [PATCH] rewrite: add big update notification, small bug fixes --- assets/js/services/userServices.js | 22 ++++++++------- src/controllers/user.js | 24 ++++++++-------- src/models/user.js | 9 ++---- views/shared/modals/new-stuff.jade | 45 ++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 28 deletions(-) diff --git a/assets/js/services/userServices.js b/assets/js/services/userServices.js index 78f847265f..2d0e1dab66 100644 --- a/assets/js/services/userServices.js +++ b/assets/js/services/userServices.js @@ -132,16 +132,6 @@ angular.module('userServices', []). return this.settings.auth.apiId !== ""; }, - /* - Very simple path-set. `set('preferences.gender','m')` for example. We'll deprecate this once we have a complete API - */ - set: function(k, v) { - var log = { op: 'set', data: {} }; - window.habitrpgShared.helpers.dotSet(k, v, this.user); - log.data[k] = v; - this.log(log); - }, - log: function (action, cb) { //push by one buy one if an array passed in. if (_.isArray(action)) { @@ -155,6 +145,18 @@ angular.module('userServices', []). save(); syncQueue(cb); }, + + /* + Very simple path-set. `set('preferences.gender','m')` for example. We'll deprecate this once we have a complete API + */ + set: function(k, v) { + var self = userServices; + var log = { op: 'set', data: {} }; + window.habitrpgShared.helpers.dotSet(k, v, userServices.user); + log.data[k] = v; + userServices.log(log); + }, + settings: settings }; diff --git a/src/controllers/user.js b/src/controllers/user.js index cc1c4b70f6..8cb4f9d31b 100644 --- a/src/controllers/user.js +++ b/src/controllers/user.js @@ -826,29 +826,29 @@ api.batchUpdate = function(req, res, next) { }; switch (action.op) { case "score": - return api.scoreTask(req, res); + api.scoreTask(req, res); case "buy": - return api.buy(req, res); + api.buy(req, res); case "sortTask": - return api.verifyTaskExists(req, res, function() { - return api.sortTask(req, res); + api.verifyTaskExists(req, res, function() { + api.sortTask(req, res); }); case "addTask": - return api.createTask(req, res); + api.createTask(req, res); case "delTask": - return api.verifyTaskExists(req, res, function() { - return api.deleteTask(req, res); + api.verifyTaskExists(req, res, function() { + api.deleteTask(req, res); }); case "set": - return api.updateUser(req, res); + api.updateUser(req, res); case "revive": - return api.revive(req, res); + api.revive(req, res); case "clear-completed": - return api.clearCompleted(req, res); + api.clearCompleted(req, res); case "reroll": - return api.reroll(req, res); + api.reroll(req, res); default: - return cb(); + cb(); } }; /* Setup the array of functions we're going to call in parallel with async*/ diff --git a/src/models/user.js b/src/models/user.js index 95f6590035..02d8e4296d 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -65,14 +65,11 @@ var UserSchema = new Schema({ ads: String, dropsEnabled: Boolean, itemsEnabled: Boolean, - /*FIXME to boolean (currently show/hide)*/ - - newStuff: String, + newStuff: String, //FIXME to boolean (currently show/hide) + rewrite: Boolean, partyEnabled: Boolean, petsEnabled: Boolean, - /* FIXME remove?*/ - - rest: Boolean + rest: Boolean // fixme - change to preferences.resting once we're off derby }, history: { exp: [ diff --git a/views/shared/modals/new-stuff.jade b/views/shared/modals/new-stuff.jade index 83c8864233..8ee81a9e71 100644 --- a/views/shared/modals/new-stuff.jade +++ b/views/shared/modals/new-stuff.jade @@ -1,3 +1,48 @@ +div(modal='user.flags.rewrite !== false') + .modal-header + h3 Mega Ultra Update! + .modal-body + table + tr + td + .NPC-Bailey + td + .popover.static-popover.fade.right.in(style='max-width:400px') + .arrow + h3.popover-title + a(target='_blank', href='http://www.kickstarter.com/profile/mihakuu') Bailey + .popover-content + p. + Hello my Habiteers! I have some amazing news to share with you, it's huge! + Has Habit ever crashed for you? (Joke). Well we re-wrote the website from the ground up + so we could conquor all the bugs once and for all (more from Tyler in a bit). If you haven't seen me for a while (due to a bug in the old site), be sure to catch up with me on the right side of the screen for any missed news. Importantly, the following happened: + h4. + Android & iOS Apps are out! + p They're open source, so help us make them awesome. + + table(style='clear:both;') + tr + td + .popover.static-popover.fade.left.in(style='max-width:400px') + .arrow + h3.popover-title + a(target='_blank', href='https://twitter.com/lefnire') Tyler + .popover-content + p. + JavaScript developers! To me! We must finish vanquising the old site, as not all features have been ported. + We rewrote Habit on AngularJS + Express. + We desparately need your help porting the rest of the features, and polishing off the bugs. Read this guide to getting started. + Each of your pull requests shall grant you a special Contributor Gear piece. Thanks + everyone for all your support and patience! + + td + img.pull-right(src='/bower_components/habitrpg-shared/img/unprocessed/efbd21c4-82a1-11e2-8190-fbc609b5c58b.png', style='height:72px') + + .modal-footer + button.btn.btn-default.cancel(ng-click='user.flags.rewrite = false') Read Later + button.btn.btn-warning.cancel(ng-click='set("flags.rewrite", false)') Dismiss + + div(modal='modals.newStuff') .modal-header h3 New Stuff