mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
fix(sharing): Better Tweet syntax
Angular bindings would fail to parse in Tweets if the expression evaluated to something with a space in it. Adding quotes stretches the Tweet by two characters, but addresses the issue. Commit also takes out a spurious console message from the Notifications service.
This commit is contained in:
@@ -66,6 +66,7 @@ habitrpg.controller('NotificationCtrl',
|
|||||||
$rootScope.playSound('Level_Up');
|
$rootScope.playSound('Level_Up');
|
||||||
if (User.user._tmp && User.user._tmp.drop && (User.user._tmp.drop.type === 'Quest')) return;
|
if (User.user._tmp && User.user._tmp.drop && (User.user._tmp.drop.type === 'Quest')) return;
|
||||||
if (after === 3) return; // Drop system unlock. FIXME can we do this without hardcoding?
|
if (after === 3) return; // Drop system unlock. FIXME can we do this without hardcoding?
|
||||||
|
if (after === 10) return; // Class system unlock. FIXME as above
|
||||||
if (after === 50) return; // Orb of Rebirth unlock FIXME as above
|
if (after === 50) return; // Orb of Rebirth unlock FIXME as above
|
||||||
if (!User.user.preferences.suppressModals.levelUp) $rootScope.openModal('levelUp', {controller:'UserCtrl', size:'sm'});
|
if (!User.user.preferences.suppressModals.levelUp) $rootScope.openModal('levelUp', {controller:'UserCtrl', size:'sm'});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ angular.module("habitrpg").factory("Notification",
|
|||||||
var stack_topright = {"dir1": "down", "dir2": "left", "spacing1": 15, "spacing2": 15, "firstpos1": 60};
|
var stack_topright = {"dir1": "down", "dir2": "left", "spacing1": 15, "spacing2": 15, "firstpos1": 60};
|
||||||
|
|
||||||
function _notify(html, type, icon) {
|
function _notify(html, type, icon) {
|
||||||
console.log(type)
|
|
||||||
var notice = $.pnotify({
|
var notice = $.pnotify({
|
||||||
type: type || 'warning', //('info', 'text', 'warning', 'success', 'gp', 'xp', 'hp', 'lvl', 'death', 'mp', 'crit')
|
type: type || 'warning', //('info', 'text', 'warning', 'success', 'gp', 'xp', 'hp', 'lvl', 'death', 'mp', 'crit')
|
||||||
text: html,
|
text: html,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ script(type='text/ng-template', id='modals/hatchPet.html')
|
|||||||
.container-fluid
|
.container-fluid
|
||||||
.row
|
.row
|
||||||
.col-xs-3
|
.col-xs-3
|
||||||
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=I just hatched a {{::hatchedPet.potion}} {{::hatchedPet.egg}} by completing my real-life tasks!&via=habitica&url=#{env.BASE_URL}/social/hatch-pet&count=none')=env.t('tweet')
|
a.twitter-share-button(href='https://twitter.com/intent/tweet?text="I just hatched a {{::hatchedPet.potion}} {{::hatchedPet.egg}} by completing my real-life tasks!"&via=habitica&url=#{env.BASE_URL}/social/hatch-pet&count=none')=env.t('tweet')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
.fb-share-button(data-href='#{env.BASE_URL}/social/hatch-pet', data-layout='button')
|
.fb-share-button(data-href='#{env.BASE_URL}/social/hatch-pet', data-layout='button')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ script(type='text/ng-template', id='modals/levelUp.html')
|
|||||||
.container-fluid
|
.container-fluid
|
||||||
.row
|
.row
|
||||||
.col-xs-3
|
.col-xs-3
|
||||||
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=I got to Level {{::user.stats.lvl}} in Habitica by improving my real-life habits!&via=habitica&url=#{env.BASE_URL}/social/level-up&count=none')=env.t('tweet')
|
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=I+got+to+Level+{{::user.stats.lvl}}+in+Habitica+by+improving+my+real-life+habits!&via=habitica&url=#{env.BASE_URL}/social/level-up&count=none')=env.t('tweet')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
.fb-share-button(data-href='#{env.BASE_URL}/social/level-up', data-layout='button')
|
.fb-share-button(data-href='#{env.BASE_URL}/social/level-up', data-layout='button')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ script(type='text/ng-template', id='modals/questDrop.html')
|
|||||||
.container-fluid
|
.container-fluid
|
||||||
.row
|
.row
|
||||||
.col-xs-3
|
.col-xs-3
|
||||||
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=I unlocked the quest {{::selectedQuest.text()}} in Habitica!&via=habitica&url=#{env.BASE_URL}/social/unlock-quest&count=none')=env.t('tweet')
|
a.twitter-share-button(href='https://twitter.com/intent/tweet?text="I unlocked the quest {{::selectedQuest.text()}} in Habitica!"&via=habitica&url=#{env.BASE_URL}/social/unlock-quest&count=none')=env.t('tweet')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
.fb-share-button(data-href='#{env.BASE_URL}/social/unlock-quest', data-layout='button')
|
.fb-share-button(data-href='#{env.BASE_URL}/social/unlock-quest', data-layout='button')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ script(type='text/ng-template', id='modals/raisePet.html')
|
|||||||
.container-fluid
|
.container-fluid
|
||||||
.row
|
.row
|
||||||
.col-xs-3
|
.col-xs-3
|
||||||
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=I just raised a {{::raisedPet.displayName}} mount by completing my real-life tasks!&via=habitica&url=#{env.BASE_URL}/social/raise-pet&count=none')=env.t('tweet')
|
a.twitter-share-button(href='https://twitter.com/intent/tweet?text="I just raised a {{::raisedPet.displayName}} mount by completing my real-life tasks!"&via=habitica&url=#{env.BASE_URL}/social/raise-pet&count=none')=env.t('tweet')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
.fb-share-button(data-href='#{env.BASE_URL}/social/raise-pet', data-layout='button')
|
.fb-share-button(data-href='#{env.BASE_URL}/social/raise-pet', data-layout='button')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ script(type='text/ng-template', id='modals/wonChallenge.html')
|
|||||||
.container-fluid
|
.container-fluid
|
||||||
.row
|
.row
|
||||||
.col-xs-3
|
.col-xs-3
|
||||||
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=I just won the Challenge {{::user.achievements.challenges[user.achievements.challenges.length - 1]}} in Habitica!&via=habitica&url=#{env.BASE_URL}/social/won-challenge&count=none')=env.t('tweet')
|
a.twitter-share-button(href='https://twitter.com/intent/tweet?text="I just won the Challenge {{::user.achievements.challenges[user.achievements.challenges.length - 1]}} in Habitica!"&via=habitica&url=#{env.BASE_URL}/social/won-challenge&count=none')=env.t('tweet')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
.fb-share-button(data-href='#{env.BASE_URL}/social/won-challenge', data-layout='button')
|
.fb-share-button(data-href='#{env.BASE_URL}/social/won-challenge', data-layout='button')
|
||||||
.col-xs-4(style='margin-left:.8em')
|
.col-xs-4(style='margin-left:.8em')
|
||||||
|
|||||||
Reference in New Issue
Block a user