Merge branch 'release' into develop

This commit is contained in:
Sabe Jones 2018-06-29 19:06:20 +00:00
commit b16a245d61
8 changed files with 26 additions and 9 deletions

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "habitica",
"version": "4.50.2",
"version": "4.50.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,7 +1,7 @@
{
"name": "habitica",
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "4.50.2",
"version": "4.50.3",
"main": "./website/server/index.js",
"dependencies": {
"@slack/client": "^3.8.1",

View file

@ -85,6 +85,12 @@ export default {
showApiToken: false,
};
},
mounted () {
window.addEventListener('message', this.receiveMessage, false);
},
destroy () {
window.removeEventListener('message', this.receiveMessage);
},
computed: {
...mapState({user: 'user.data', credentials: 'credentials'}),
apiToken () {
@ -92,6 +98,15 @@ export default {
},
},
methods: {
receiveMessage (eventFrom) {
if (event.origin !== 'https://www.spritely.app') return;
const creds = {
userId: this.user._id,
apiToken: this.credentials.API_TOKEN,
};
eventFrom.source.postMessage(creds, event.origin);
},
async addWebhook (url) {
let webhookInfo = {
id: uuid(),

View file

@ -195,7 +195,7 @@
"hatchingPotionFairy": "Fada",
"hatchingPotionStarryNight": "Noite Estrelada",
"hatchingPotionRainbow": "Arco-Íris",
"hatchingPotionGlass": "Glass",
"hatchingPotionGlass": " de Vidro",
"hatchingPotionNotes": "Utilize isto num ovo, e ele chocará como um mascote <%= potText(locale) %>.",
"premiumPotionAddlNotes": "Não utilizável nos ovos de mascote de missão.",
"foodMeat": "Carne",

View file

@ -112,7 +112,7 @@
"marketing2Lead3Title": "Desafiem-se Uns aos Outros",
"marketing2Lead3": "Os desafios permitem-te competir com amigos e desconhecidos. Quem tiver o melhor desempenho ao fim de um desafio ganha prémios especiais.",
"marketing3Header": "Aplicações e Extensões",
"marketing3Lead1": "The **iPhone & Android** apps let you take care of business on the go. We realize that logging into the website to click buttons can be a drag.",
"marketing3Lead1": "As aplicações para **iPhone & Android** permitem-te tratar dos assuntos em movimento. Temos noção de que entrar no site para clicar em botões pode ser aborrecido.",
"marketing3Lead2Title": "Integrações",
"marketing3Lead2": "Other **3rd Party Tools** tie Habitica into various aspects of your life. Our API provides easy integration for things like the [Chrome Extension](https://chrome.google.com/webstore/detail/habitica/pidkmpibnnnhneohdgjclfdjpijggmjj?hl=en-US), for which you lose points when browsing unproductive websites, and gain points when on productive ones. [See more here](http://habitica.wikia.com/wiki/Extensions,_Add-Ons,_and_Customizations).",
"marketing4Header": "Utilização Organizacional",
@ -139,7 +139,7 @@
"playButtonFull": "Entrar no Habitica",
"presskit": "Pacote de Imprensa",
"presskitDownload": "Baixar todas as imagens:",
"presskitText": "Thanks for your interest in Habitica! The following images can be used for articles or videos about Habitica. For more information, please contact us at <%= pressEnquiryEmail %>.",
"presskitText": "Obrigada pelo teu interesse no Habitica! As imagens seguintes podem ser usadas em artigos ou vídeos ou o Habitica. Para mais informações, por favor contacta-nos aqui: <%= pressEnquiryEmail %>.",
"pkQuestion1": "O que inspirou o Habitica? Como é que começou?",
"pkAnswer1": "If youve ever invested time in leveling up a character in a game, its hard not to wonder how great your life would be if you put all of that effort into improving your real-life self instead of your avatar. We starting building Habitica to address that question. <br /> Habitica officially launched with a Kickstarter in 2013, and the idea really took off. Since then, its grown into a huge project, supported by our awesome open-source volunteers and our generous users.",
"pkQuestion2": "Porque é que o Habitica funciona?",

View file

@ -5,7 +5,7 @@
"sureDeleteCompletedTodos": "Tens a certeza de que queres apagar os teus Afazeres concluídos?",
"lotOfToDos": "Os seus 30 Afazeres mais recentes são mostrados aqui. Pode ver os afazeres concluídos mais antigos de Dados > Ferramenta de Exibição de Dados ou Dados > Exportar Dados > Dados do Utilizador.",
"deleteToDosExplanation": "Se carregar no botão abaixo, todos os seus Afazeres completos e arquivados serão permanentemente apagados, excepto Afazeres pertencentes a desafios correntemente ativos ou Planos de Grupo. Exporte-os primeiro se quiser manter um registo dos mesmos.",
"addMultipleTip": "<strong>Tip:</strong> To add multiple <%= taskType %>, separate each one using a line break (Shift + Enter) and then press \"Enter.\"",
"addMultipleTip": "<strong>Dica:</strong> Para adicionar <%= taskType %> em simultâneo, separa cada um usando um parágrafo (Shift + Enter) e no fim pressiona \"Enter\".",
"addsingle": "Adicionar Único",
"addATask": "Adicionar <%= type %>",
"editATask": "Editar <%= type %>",

View file

@ -70,8 +70,8 @@
"APIv3": "API v3",
"APIText": "這個是使用再第三方應用上面的。但是,你的 API Token 相當於密碼請不要公開它。有時候別人可能會向你要UUID但是永遠不要把你的 API token 分享給其他人,包括在 Github 上。",
"APIToken": "API Token這相當於密碼——注意看上面的警告",
"showAPIToken": "Show API Token",
"hideAPIToken": "Hide API Token",
"showAPIToken": "顯示API Token",
"hideAPIToken": "隱藏API Token",
"APITokenWarning": "If you need a new API Token (e.g., if you accidentally shared it), email <%= hrefTechAssistanceEmail %> 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": "第三方應用程式",
"dataToolDesc": "A webpage that shows you certain information from your Habitica account, such as statistics about your tasks, equipment, and skills.",
@ -105,7 +105,7 @@
"usernameOrEmail": "登入名稱或電子郵件",
"email": "Email",
"registerWithSocial": "使用<%= network %>註冊",
"registeredWithSocial": "Registered with <%= network %>",
"registeredWithSocial": "已使用<%= network %>註冊",
"loginNameDescription": "This is what you use to log in to Habitica. To change it, use the form below. If instead you want to change the Display Name that appears on your avatar and in chat messages, go to the User Icon &gt; Profile and click the Edit button.",
"emailNotifications": "電子郵件通知",
"wonChallenge": "你贏得一個挑戰!",

View file

@ -41,6 +41,7 @@ export function preenHistory (history, isSubscribed, timezoneOffset = 0, dayStar
// Keep uncompressed entries (modifies history and returns removed items)
let newHistory = _.remove(history, entry => {
if (!entry) return true; // sometimes entries are `null`
const entryDate = moment(entry.date).zone(timezoneOffset);
if (entryDate.hour() < dayStart) entryDate.subtract(1, 'day');
return entryDate.isSame(cutOff) || entryDate.isAfter(cutOff);
@ -49,6 +50,7 @@ export function preenHistory (history, isSubscribed, timezoneOffset = 0, dayStar
// Date after which to begin compressing data by year
let monthsCutOff = cutOff.subtract(isSubscribed ? 12 : 10, 'months').startOf('day');
let aggregateByMonth = _.remove(history, entry => {
if (!entry) return true; // sometimes entries are `null`
const entryDate = moment(entry.date).zone(timezoneOffset);
if (entryDate.hour() < dayStart) entryDate.subtract(1, 'day');
return entryDate.isSame(monthsCutOff) || entryDate.isAfter(monthsCutOff);