Merge branch 'api-v3' into api-v3-client

This commit is contained in:
Matteo Pagliazzi
2016-04-30 16:51:15 +02:00
3261 changed files with 5070 additions and 4577 deletions
@@ -109,6 +109,12 @@ let armor = {
mystery: '201603',
value: 0,
},
201604: {
text: t('armorMystery201604Text'),
notes: t('armorMystery201604Notes'),
mystery: '201604',
value: 0,
},
301404: {
text: t('armorMystery301404Text'),
notes: t('armorMystery301404Notes'),
@@ -292,6 +298,12 @@ let head = {
mystery: '201603',
value: 0,
},
201604: {
text: t('headMystery201604Text'),
notes: t('headMystery201604Notes'),
mystery: '201604',
value: 0,
},
301404: {
text: t('headMystery301404Text'),
notes: t('headMystery301404Notes'),
+11 -3
View File
@@ -506,7 +506,15 @@ api.premiumHatchingPotions = {
canBuy: (function() {
return false;
})
}
},
Floral: {
value: 2,
text: t('hatchingPotionFloral'),
limited: true,
canBuy: (function() {
return true;
}),
},
};
_.each(api.dropHatchingPotions, function(pot, key) {
@@ -2564,11 +2572,11 @@ api.quests = {
items: [
{
type: 'pets',
key: 'Bumblebee-Base',
key: 'MagicalBee-Base',
text: t('questBewilderDropBumblebeePet')
}, {
type: 'mounts',
key: 'Bumblebee-Base',
key: 'MagicalBee-Base',
text: t('questBewilderDropBumblebeeMount')
}, {
type: 'food',
+4
View File
@@ -106,6 +106,10 @@ let mysterySets = {
start: '2016-03-24',
end: '2016-04-02',
},
201604: {
start: '2016-04-25',
end: '2016-05-02',
},
301404: {
start: '3014-03-24',
end: '3014-04-02',
+1 -1
View File
@@ -3,7 +3,7 @@ import content from '../content/index';
import i18n from '../i18n';
import { daysSince } from '../cron';
import { diminishingReturns } from '../statHelpers';
import { predictableRandom } from './predictableRandom';
import predictableRandom from './predictableRandom';
import randomVal from './randomVal';
// Clone a drop object maintaining its functions so that we can change it without affecting the original item
+6 -87
View File
@@ -2,85 +2,26 @@
/**
* Markdown
* See http://www.heikura.me/#!/angularjs-markdown-directive
*/
(function(){
var md = function () {
var remarkable = new Remarkable({
// TODO: Add in code highlighting?
// highlight: function (#<{(|str, lang|)}>#) { return ''; }
linkify: true
});
emoji.img_path = 'common/img/emoji/unicode/';
var mdown = window.habiticaMarkdown;
var toHtml = function (markdown) {
if (markdown == undefined)
return '';
markdown = remarkable.render(markdown);
markdown = emoji.replace_colons(markdown);
markdown = emoji.replace_unified(markdown);
markdown = mdown.render(markdown);
return markdown;
};
// This was applie to marked, the old markdown library which has an xss exploit.
// If we want this behavior again, we'll need to rewrite it.
// ---
// [nickgordon20131123] this hacky override wraps images with a link to the image in a new window, and also adds some classes in case we want to style
// marked.InlineLexer.prototype.outputLink = function(cap, link) {
// var escape = function(html, encode) {
// return html
// .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
// .replace(/</g, '&lt;')
// .replace(/>/g, '&gt;')
// .replace(/"/g, '&quot;')
// .replace(/'/g, '&#39;');
// };
// if (cap[0].charAt(0) !== '!') {
// return '<a class="markdown-link" target="_blank" href="'
// + escape(link.href)
// + '"'
// + (link.title
// ? ' title="'
// + escape(link.title)
// + '"'
// : '')
// + '>'
// + this.output(cap[1])
// + '</a>';
// } else {
// return '<a class="markdown-img-link" target="_blank" href="'
// + escape(link.href)
// + '"'
// + (link.title
// ? ' title="'
// + escape(link.title)
// + '"'
// : '')
// + '><img class="markdown-img" src="'
// + escape(link.href)
// + '" alt="'
// + escape(cap[1])
// + '"'
// + (link.title
// ? ' title="'
// + escape(link.title)
// + '"'
// : '')
// + '></a>';
// }
// }
//hljs.tabReplace = ' ';
return {
toHtml:toHtml
};
}();
habitrpg.directive('markdown', ['$timeout','MOBILE_APP', function($timeout, MOBILE_APP) {
habitrpg.directive('markdown', ['$timeout', function($timeout) {
return {
restrict: 'E',
link: function(scope, element, attrs) {
@@ -99,36 +40,16 @@
html = html.replace(userHighlight, "<u>@"+userName+"</u>");
html = html.replace(' href',' target="'+linktarget+'" href');
element.html(html);
if(MOBILE_APP) {
var elements = element.find("a");
_.forEach(elements, function(link){
if(link.href) {
link.onclick = function (e) {
scope.externalLink(this.href);
e.preventDefault();
e.stopPropagation();
};
}
});
}
if(removeWatch)
{
if (removeWatch) {
doRemoveWatch();
}
};
if(useTimeout)
{
if(useTimeout) {
$timeout(replaceMarkdown, timeoutTime);
}
else
{
} else {
replaceMarkdown();
}
});
@@ -140,8 +61,6 @@
return function(input){
var html = md.toHtml(input);
html = html.replace(' href',' target="_blank" href');
return html;
};
});