Merge branch 'develop' into paglias/realtime-chat-v1

This commit is contained in:
Matteo Pagliazzi
2016-09-08 19:12:05 +02:00
53 changed files with 272 additions and 172 deletions

View File

@@ -1,6 +1,6 @@
.2014_Fall_HealerPROMO2 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1044px -1378px;
background-position: -1331px -1275px;
width: 90px;
height: 90px;
}
@@ -12,13 +12,13 @@
}
.2014_Fall_RoguePROMO3 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -562px -1378px;
background-position: -758px -1275px;
width: 105px;
height: 90px;
}
.2014_Fall_Warrior_PROMO {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -673px;
background-position: -726px -1378px;
width: 90px;
height: 90px;
}
@@ -30,13 +30,13 @@
}
.promo_backgrounds_armoire_201602 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1134px -199px;
background-position: -1276px -199px;
width: 141px;
height: 294px;
}
.promo_backgrounds_armoire_201603 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1276px -199px;
background-position: -1134px -199px;
width: 141px;
height: 294px;
}
@@ -78,7 +78,7 @@
}
.promo_backtoschool {
background-image: url(spritesmith-largeSprites-0.png);
background-position: 0px -1378px;
background-position: -302px -1378px;
width: 150px;
height: 150px;
}
@@ -90,7 +90,7 @@
}
.promo_chairs_glasses {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -593px -831px;
background-position: -1633px 0px;
width: 51px;
height: 210px;
}
@@ -108,7 +108,7 @@
}
.promo_dilatoryDistress {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -491px;
background-position: -999px -1378px;
width: 90px;
height: 90px;
}
@@ -126,7 +126,7 @@
}
.promo_enchanted_armoire_201507 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -250px -1275px;
background-position: -839px -967px;
width: 217px;
height: 90px;
}
@@ -138,7 +138,7 @@
}
.promo_enchanted_armoire_201509 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -946px;
background-position: -1181px -1378px;
width: 90px;
height: 90px;
}
@@ -150,7 +150,7 @@
}
.promo_enchanted_armoire_201601 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -1128px;
background-position: 0px -1529px;
width: 90px;
height: 90px;
}
@@ -174,7 +174,7 @@
}
.promo_haunted_hair {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -593px -587px;
background-position: -593px -734px;
width: 100px;
height: 137px;
}
@@ -186,19 +186,19 @@
}
.promo_mystery_201405 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -1401px;
background-position: -91px -1529px;
width: 90px;
height: 90px;
}
.promo_mystery_201406 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -212px;
background-position: -635px -1378px;
width: 90px;
height: 96px;
}
.promo_mystery_201407 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -645px -901px;
background-position: -1633px -412px;
width: 42px;
height: 62px;
}
@@ -210,7 +210,7 @@
}
.promo_mystery_201409 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1135px -1378px;
background-position: -273px -1529px;
width: 90px;
height: 90px;
}
@@ -222,31 +222,31 @@
}
.promo_mystery_201411 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1226px -1378px;
background-position: -182px -1529px;
width: 90px;
height: 90px;
}
.promo_mystery_201412 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -688px -831px;
background-position: -1633px -345px;
width: 42px;
height: 66px;
}
.promo_mystery_201501 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1057px -967px;
background-position: -1633px -211px;
width: 48px;
height: 63px;
}
.promo_mystery_201502 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1317px -1378px;
background-position: -1363px -1378px;
width: 90px;
height: 90px;
}
.promo_mystery_201503 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -1219px;
background-position: -1272px -1378px;
width: 90px;
height: 90px;
}
@@ -258,43 +258,43 @@
}
.promo_mystery_201505 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -1037px;
background-position: -1240px -1275px;
width: 90px;
height: 90px;
}
.promo_mystery_201506 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -645px -831px;
background-position: -1633px -275px;
width: 42px;
height: 69px;
}
.promo_mystery_201507 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -106px;
background-position: -544px -1378px;
width: 90px;
height: 105px;
}
.promo_mystery_201508 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -950px -1378px;
background-position: -1146px -1275px;
width: 93px;
height: 90px;
}
.promo_mystery_201509 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -764px;
background-position: -908px -1378px;
width: 90px;
height: 90px;
}
.promo_mystery_201510 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -856px -1378px;
background-position: -1052px -1275px;
width: 93px;
height: 90px;
}
.promo_mystery_201511 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -582px;
background-position: -817px -1378px;
width: 90px;
height: 90px;
}
@@ -312,55 +312,55 @@
}
.promo_mystery_201602 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -400px;
background-position: -1513px -1275px;
width: 90px;
height: 90px;
}
.promo_mystery_201603 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -309px;
background-position: -1422px -1275px;
width: 90px;
height: 90px;
}
.promo_mystery_201604 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -762px -1378px;
background-position: -864px -1275px;
width: 93px;
height: 90px;
}
.promo_mystery_201605 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -855px;
background-position: -1090px -1378px;
width: 90px;
height: 90px;
}
.promo_mystery_201606 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px 0px;
background-position: -453px -1378px;
width: 90px;
height: 105px;
}
.promo_mystery_201607 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1633px -1310px;
background-position: -1454px -1378px;
width: 90px;
height: 90px;
}
.promo_mystery_201608 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -668px -1378px;
background-position: -958px -1275px;
width: 93px;
height: 90px;
}
.promo_mystery_3014 {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -839px -967px;
background-position: -250px -1275px;
width: 217px;
height: 90px;
}
.promo_orca {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -593px -725px;
background-position: -593px -872px;
width: 105px;
height: 105px;
}
@@ -372,37 +372,37 @@
}
.promo_pastel_skin {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -331px -1191px;
background-position: 0px -1191px;
width: 330px;
height: 83px;
}
.customize-option.promo_pastel_skin {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -356px -1206px;
background-position: -25px -1206px;
width: 60px;
height: 60px;
}
.promo_peppermint_flame {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -452px -882px;
background-position: -306px -220px;
width: 140px;
height: 147px;
}
.promo_pet_skins {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -306px -220px;
background-position: -452px -882px;
width: 140px;
height: 147px;
}
.customize-option.promo_pet_skins {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -331px -235px;
background-position: -477px -897px;
width: 60px;
height: 60px;
}
.promo_shimmer_hair {
background-image: url(spritesmith-largeSprites-0.png);
background-position: 0px -1191px;
background-position: -331px -1191px;
width: 330px;
height: 83px;
}
@@ -438,13 +438,19 @@
}
.promo_staff_spotlight_Lemoness {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1004px -392px;
background-position: -593px -439px;
width: 102px;
height: 146px;
}
.promo_staff_spotlight_Viirus {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -1004px -392px;
width: 119px;
height: 147px;
}
.promo_staff_spotlight_paglias {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -593px -439px;
background-position: -593px -586px;
width: 99px;
height: 147px;
}
@@ -474,7 +480,7 @@
}
.promo_takethis_armor {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -649px -1275px;
background-position: -593px -978px;
width: 114px;
height: 87px;
}
@@ -522,7 +528,7 @@
}
.npc_viirus {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -453px -1378px;
background-position: -649px -1275px;
width: 108px;
height: 90px;
}
@@ -540,7 +546,7 @@
}
.scene_phone_peek {
background-image: url(spritesmith-largeSprites-0.png);
background-position: -302px -1378px;
background-position: 0px -1378px;
width: 150px;
height: 150px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 KiB

After

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@@ -48,6 +48,8 @@
"leaveQuest": "Leave Quest",
"sureLeave": "Are you sure you want to leave the active quest? All your quest progress will be lost.",
"questOwner": "Quest Owner",
"questTaskDamage": "+<%= damage %> pending damage to boss",
"questTaskCollection": "<%= items %> items collected today",
"questOwnerNotInPendingQuest": "The quest owner has left the quest and can no longer begin it. It is recommended that you cancel it now. The quest owner will retain possession of the quest scroll.",
"questOwnerNotInRunningQuest": "The quest owner has left the quest. You can abort the quest if you need to. You can also allow it to keep running and all remaining participants will receive the quest rewards when the quest finishes.",
"questOwnerNotInPendingQuestParty": "The quest owner has left the party and can no longer begin the quest. It is recommended that you cancel it now. The quest scroll will be returned to the quest owner.",

View File

@@ -68,6 +68,7 @@
"APIv3": "API v3",
"APIText": "Copy these for use in third party applications. However, think of your API Token like a password, and do not share it publicly. You may occasionally be asked for your User ID, but never post your API Token where others can see it, including on Github.",
"APIToken": "API Token (this is a password - see warning above!)",
"APITokenWarning": "If you need a new API Token (e.g., if you accidentally shared it), email <a href='mailto:admin@habitica.com'>admin@habitica.com</a> with your User ID and current Token. Once it is reset you will need to re-authorize everything by logging out of the website and mobile app and by providing the new Token to any other Habitica tools that you use.",
"thirdPartyApps": "Third Party Apps",
"dataToolDesc": "A webpage that shows you certain information from your Habitica account, such as statistics about your tasks, equipment, and skills.",
"beeminder": "Beeminder",

2
npm-shrinkwrap.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "habitica",
"version": "3.38.0",
"version": "3.39.1",
"dependencies": {
"abbrev": {
"version": "1.0.9",

View File

@@ -1,7 +1,7 @@
{
"name": "habitica",
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "3.38.0",
"version": "3.39.1",
"main": "./website/server/index.js",
"dependencies": {
"@slack/client": "slackhq/node-slack-sdk#2ee794cd31326c54f38c518eef2b9d223327d939",

View File

@@ -90,7 +90,10 @@ gulp.task('test:sanity', (cb) => {
let runner = exec(
testBin(SANITY_TEST_COMMAND),
(err, stdout, stderr) => {
cb(err);
if (err) {
process.exit(1);
}
cb();
}
);
pipe(runner);
@@ -100,7 +103,10 @@ gulp.task('test:common', ['test:prepare:build'], (cb) => {
let runner = exec(
testBin(COMMON_TEST_COMMAND),
(err, stdout, stderr) => {
cb(err);
if (err) {
process.exit(1);
}
cb();
}
);
pipe(runner);
@@ -135,7 +141,10 @@ gulp.task('test:content', ['test:prepare:build'], (cb) => {
testBin(CONTENT_TEST_COMMAND),
CONTENT_OPTIONS,
(err, stdout, stderr) => {
cb(err);
if (err) {
process.exit(1);
}
cb();
}
);
pipe(runner);
@@ -196,7 +205,10 @@ gulp.task('test:karma', ['test:prepare:build'], (cb) => {
let runner = exec(
testBin(KARMA_TEST_COMMAND),
(err, stdout) => {
cb(err);
if (err) {
process.exit(1);
}
cb();
}
);
pipe(runner);
@@ -243,7 +255,10 @@ gulp.task('test:e2e', ['test:prepare', 'test:prepare:server'], (cb) => {
'npm run test:e2e',
(err, stdout, stderr) => {
support.forEach(kill);
cb(err);
if (err) {
process.exit(1);
}
cb();
}
);
pipe(runner);
@@ -282,7 +297,12 @@ gulp.task('test:e2e:safe', ['test:prepare', 'test:prepare:server'], (cb) => {
gulp.task('test:api-v3:unit', (done) => {
let runner = exec(
testBin('mocha test/api/v3/unit --recursive'),
(err, stdout, stderr) => done(err)
(err, stdout, stderr) => {
if (err) {
process.exit(1);
}
done();
}
)
pipe(runner);
@@ -296,7 +316,12 @@ gulp.task('test:api-v3:integration', (done) => {
let runner = exec(
testBin('mocha test/api/v3/integration --recursive'),
{maxBuffer: 500*1024},
(err, stdout, stderr) => done(err)
(err, stdout, stderr) => {
if (err) {
process.exit(1);
}
done();
}
)
pipe(runner);

View File

@@ -6,7 +6,9 @@ describe('GET /tags', () => {
let user;
before(async () => {
user = await generateUser();
user = await generateUser({
tags: [],
});
});
it('returns all user\'s tags', async () => {
@@ -15,8 +17,8 @@ describe('GET /tags', () => {
let tags = await user.get('/tags');
expect(tags.length).to.equal(2 + 3); // + 3 because 1 is a default task
expect(tags[tags.length - 2].name).to.equal(tag1.name);
expect(tags[tags.length - 1].name).to.equal(tag2.name);
expect(tags.length).to.equal(2);
expect(tags[0].name).to.equal(tag1.name);
expect(tags[1].name).to.equal(tag2.name);
});
});

View File

@@ -7,7 +7,9 @@ describe('POST /reorder-tags', () => {
let user;
before(async () => {
user = await generateUser();
user = await generateUser({
tags: [],
});
});
it('returns error when no parameters are provided', async () => {
@@ -35,10 +37,10 @@ describe('POST /reorder-tags', () => {
await user.post('/tags', {name: tag2Name});
await user.sync();
await user.post('/reorder-tags', {tagId: user.tags[4].id, to: 3});
await user.post('/reorder-tags', {tagId: user.tags[0].id, to: 1});
await user.sync();
expect(user.tags[3].name).to.equal(tag2Name);
expect(user.tags[4].name).to.equal(tag1Name);
expect(user.tags[0].name).to.equal(tag2Name);
expect(user.tags[1].name).to.equal(tag1Name);
});
});

View File

@@ -1,8 +1,8 @@
'use strict';
angular.module('habitrpg')
.controller('MenuCtrl', ['$scope', '$rootScope', '$http', 'Chat',
function($scope, $rootScope, $http, Chat) {
.controller('MenuCtrl', ['$scope', '$rootScope', '$http', 'Chat', 'Content',
function($scope, $rootScope, $http, Chat, Content) {
$scope.logout = function() {
localStorage.clear();
@@ -26,6 +26,41 @@ angular.module('habitrpg')
}
}
$scope.hasQuestProgress = function() {
var user = $scope.user;
if (user.party.quest) {
var userQuest = Content.quests[user.party.quest.key];
if (!userQuest) {
return false;
}
if (userQuest.boss && user.party.quest.progress.up > 0) {
return true;
}
if (userQuest.collect && user.party.quest.progress.collectedItems > 0) {
return true;
}
}
return false;
};
$scope.getQuestInfo = function() {
var user = $scope.user;
var questInfo = {};
if (user.party.quest) {
var userQuest = Content.quests[user.party.quest.key];
questInfo.title = userQuest.text();
if (userQuest.boss) {
questInfo.body = window.env.t('questTaskDamage', { damage: user.party.quest.progress.up.toFixed(1) });
} else if (userQuest.collect) {
questInfo.body = window.env.t('questTaskCollection', { items: user.party.quest.progress.collectedItems });
}
}
return questInfo;
};
$scope.clearMessages = Chat.markChatSeen;
$scope.clearCards = Chat.clearCards;

View File

@@ -70,7 +70,7 @@ angular.module('habitrpg')
// When the user correctly enters the party channel
partyChannel.bind('pusher:subscription_succeeded', function(pusherMembers) {
// Wait for the party to be loaded
Groups.party(reconnecting ? true : false).then(function (party) {
Groups.party(reconnecting).then(function (party) {
// If we just reconnected after some inactivity, sync the party
if (reconnecting === true) {
_.assign($rootScope.party, party);
@@ -182,6 +182,7 @@ angular.module('habitrpg')
partyId = user && $rootScope.user.party && $rootScope.user.party._id;
if (!partyId) return;
// See if another tab is already connected to Pusher
if (!localStorage.getItem(tabIdKey)) {
connectToPusher(partyId);
}

View File

@@ -230,6 +230,7 @@ script(type='text/ng-template', id='partials/options.settings.api.html')
pre.prettyprint {{user.id}}
h6=env.t('APIToken')
pre.prettyprint {{User.settings.auth.apiToken}}
small!=env.t("APITokenWarning")
h6=env.t('qrCode')
img.img-rendering-auto(src='https://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=%7B%22address%22%3A%22https%3A%2F%2Fhabitrpg.com%22%2C%22user%22%3A%22{{user.id}}%22%2C%22key%22%3A%22{{User.settings.auth.apiToken}}%22%7D&choe=UTF-8&chld=L', alt='qrcode')
br

View File

@@ -174,6 +174,9 @@ nav.toolbar(ng-controller='MenuCtrl')
li.toolbar-subscribe-button
button.highlight(ui-sref='options.settings.subscription',popover-trigger='mouseenter',popover-placement='bottom',popover-title=env.t('subscriptions'),popover=env.t('subDescription'),popover-append-to-body='true')=env.t('subscribe')
ul.toolbar-options
li.toolbar-quest-detail(ng-if='hasQuestProgress()')
a(ng-click='$state.go("options.social.party");', popover-placement='bottom',popover-trigger='mouseenter',popover-title='{{getQuestInfo().title}}', popover='{{getQuestInfo().body}}',popover-append-to-body='true')
span.glyphicon.glyphicon-screenshot
li.toolbar-notifs
a(data-expand-menu, menu='notifs')
span.glyphicon(ng-class='iconClasses()')

View File

@@ -1,6 +1,33 @@
h2 9/7/2016 - STAFF SPOTLIGHT: VIIRUS, BRAZILIAN PORTUGUESE LANGUAGE SUPPORT; COSTUME CHALLENGE COMING SOON
hr
tr
td
.promo_staff_spotlight_Viirus.pull-right
h3 Staff Spotlight: Phillip AKA Viirus
p There's a new <a href='https://habitica.wordpress.com/category/staff-spotlight/' target='_blank'>Staff Spotlight</a> on the blog, featuring an interview with Phillip (aka viirus)! Check it out to learn how he went from a volunteer contributor to our main mobile developer.
p.small.muted by viirus and Lemoness
tr
td
h3 Brazilian Portuguese Language Support
p Habitica has been translated into Brazilian Portuguese! If you'd like to use the site in Brazilian Portuguese and it doesn't change automatically for you, change your language to "Português Brasileiro" on the <a href='/#/options/settings/settings'>Settings page</a>. Many thanks to our dedicated volunteer translators for their work!
p.small.muted by the Brazilian Portuguese translation team
tr
td
h3 Get Ready for the Community Costume Challenge!
p We've got an exciting event coming up this October - the annual Community Costume Challenge is returning! In the spirit of the season, Habiticans who dress up in real-life versions of their avatar's armor (or in any Habitica costume) will receive a special badge. (No, just wearing a colored shirt doesn't count. Where's the fun in that?)
br
p The Community Costume Challenge will start on October 1st, but we're announcing it early so that people have time to get their costumes together.
br
p Instructions on how to participate in the CCC will be posted when the Challenge is live. We can't wait to see your costumes!
p.small.muted by Lemoness
if menuItem !== 'oldNews'
hr
a(href='/static/old-news', target='_blank') Read older news
mixin oldNews
h2 9/1/2016 - NEW BACKGROUNDS, ARMOIRE ITEMS, AND TAKE THIS CHALLENGE
.promo_backgrounds_armoire_201609.pull-right
hr
tr
td
h3 September Backgrounds and Armoire Items!
@@ -19,11 +46,6 @@ h2 9/1/2016 - NEW BACKGROUNDS, ARMOIRE ITEMS, AND TAKE THIS CHALLENGE
p Congratulations to the winners of the last Take This Challenge, "<a href='/#/options/groups/challenges/22db61a5-1022-4f1a-87f6-ad7552bf740e'>Cast of Characters!</a>": grand prize winner Dragonezss, and runners-up elizacorps, jwmeyer86, chady025, Max Yong, and Nightstalker_oL. Plus, all participants in that Challenge have received a piece of the <a href='http://habitica.wikia.com/wiki/Event_Item_Sequences#Take_This_Armor_Set' target='_blank'>Take This item set</a>. It is located in your Rewards column. Enjoy!
p.small.muted by Lemoness, SabreCat, Doctor B, Gordon Shippey, and the Take This team
if menuItem !== 'oldNews'
hr
a(href='/static/old-news', target='_blank') Read older news
mixin oldNews
h2 8/30/2016 - LAST CHANCE FOR THUNDERSTORM ITEMS; BACK TO SCHOOL GUILD SPOTLIGHT
tr
td

View File

@@ -33,7 +33,7 @@
ng-change='changeCheck(task)'
ui-keypress='{13:"task.completed = !task.completed; changeCheck(task)"}' )
input.visuallyhidden.focusable(id='box-{{::obj._id}}_{{::task._id}}', type='checkbox',
ng-disabled='$state.includes("options.social.challenges")')
ng-if='!$state.includes("tasks")')
label(for='box-{{::obj._id}}_{{::task._id}}')
// main content