scuffed reaction emoji support and a lot of jank
This commit is contained in:
parent
b07659f474
commit
8a17e3f95e
7 changed files with 178 additions and 104 deletions
|
@ -76,6 +76,8 @@ export default {
|
|||
}
|
||||
},
|
||||
instanceFavicon(){
|
||||
// TODO: hack hack hack bad
|
||||
document.querySelector('link[rel="icon"]').href = this.$store.state.instance.iconUrl;
|
||||
return this.$store.state.instance.iconUrl
|
||||
},
|
||||
logoBgStyle () {
|
||||
|
|
|
@ -81,54 +81,55 @@
|
|||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
<router-link
|
||||
class="logo"
|
||||
:to="{ name: 'root' }"
|
||||
:style="logoBgStyle"
|
||||
>
|
||||
<div
|
||||
class="mask"
|
||||
:style="logoMaskStyle"
|
||||
/>
|
||||
<img
|
||||
:src="logo"
|
||||
:style="logoStyle"
|
||||
>
|
||||
</router-link>
|
||||
<!-- this isn't broken it's just ugly as fuck -->
|
||||
<!-- <router-link -->
|
||||
<!-- class="logo" -->
|
||||
<!-- :to="{ name: 'root' }" -->
|
||||
<!-- :style="logoBgStyle" -->
|
||||
<!-- > -->
|
||||
<!-- <div -->
|
||||
<!-- class="mask" -->
|
||||
<!-- :style="logoMaskStyle" -->
|
||||
<!-- /> -->
|
||||
<!-- <img -->
|
||||
<!-- :src="logo" -->
|
||||
<!-- :style="logoStyle" -->
|
||||
<!-- > -->
|
||||
<!-- </router-link> -->
|
||||
<div class="item right actions">
|
||||
<search-bar
|
||||
v-if="currentUser || !privateMode"
|
||||
@toggled="onSearchBarToggled"
|
||||
@click.stop
|
||||
/>
|
||||
<!-- <search-bar -->
|
||||
<!-- v-if="currentUser || !privateMode" -->
|
||||
<!-- @toggled="onSearchBarToggled" -->
|
||||
<!-- @click.stop -->
|
||||
<!-- /> -->
|
||||
<div
|
||||
v-if="(currentUser || !privateMode) && showNavShortcuts"
|
||||
class="nav-items right"
|
||||
>
|
||||
<router-link
|
||||
v-if="currentUser"
|
||||
class="nav-icon"
|
||||
:to="{ name: 'interactions', params: { username: currentUser.screen_name } }"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="bolt"
|
||||
:title="$t('nav.interactions')"
|
||||
/>
|
||||
</router-link>
|
||||
<router-link
|
||||
v-if="currentUser"
|
||||
:to="{ name: 'lists' }"
|
||||
class="nav-icon"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="list"
|
||||
:title="$t('nav.lists')"
|
||||
/>
|
||||
</router-link>
|
||||
<!-- <router-link -->
|
||||
<!-- v-if="currentUser" -->
|
||||
<!-- class="nav-icon" -->
|
||||
<!-- :to="{ name: 'interactions', params: { username: currentUser.screen_name } }" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110 fa-old-padding" -->
|
||||
<!-- icon="bolt" -->
|
||||
<!-- :title="$t('nav.interactions')" -->
|
||||
<!-- /> -->
|
||||
<!-- </router-link> -->
|
||||
<!-- <router-link -->
|
||||
<!-- v-if="currentUser" -->
|
||||
<!-- :to="{ name: 'lists' }" -->
|
||||
<!-- class="nav-icon" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110 fa-old-padding" -->
|
||||
<!-- icon="list" -->
|
||||
<!-- :title="$t('nav.lists')" -->
|
||||
<!-- /> -->
|
||||
<!-- </router-link> -->
|
||||
<router-link
|
||||
v-if="currentUser"
|
||||
:to="{ name: 'bookmarks' }"
|
||||
|
|
|
@ -60,6 +60,7 @@ const EmojiReactions = {
|
|||
}
|
||||
},
|
||||
reactWith (emoji) {
|
||||
console.log(this.status)
|
||||
this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
|
||||
const emojiObject = findEmojiByReplacement(this.$store.state, emoji)
|
||||
this.$store.commit('emojiUsed', emojiObject)
|
||||
|
|
|
@ -25,30 +25,31 @@
|
|||
<TimelineMenuContent class="timelines" />
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="currentUser">
|
||||
<router-link
|
||||
class="menu-item"
|
||||
:to="{ name: 'lists' }"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110"
|
||||
icon="list"
|
||||
/>{{ $t("nav.lists") }}
|
||||
</router-link>
|
||||
</li>
|
||||
<li v-if="currentUser">
|
||||
<router-link
|
||||
class="menu-item"
|
||||
:to="{ name: 'interactions', params: { username: currentUser.screen_name } }"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110"
|
||||
icon="bolt"
|
||||
/>{{ $t("nav.interactions") }}
|
||||
</router-link>
|
||||
</li>
|
||||
<!-- disabled: lists don't work -->
|
||||
<!-- <li v-if="currentUser"> -->
|
||||
<!-- <router-link -->
|
||||
<!-- class="menu-item" -->
|
||||
<!-- :to="{ name: 'lists' }" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110" -->
|
||||
<!-- icon="list" -->
|
||||
<!-- />{{ $t("nav.lists") }} -->
|
||||
<!-- </router-link> -->
|
||||
<!-- </li> -->
|
||||
<!-- <li v-if="currentUser"> -->
|
||||
<!-- <router-link -->
|
||||
<!-- class="menu-item" -->
|
||||
<!-- :to="{ name: 'interactions', params: { username: currentUser.screen_name } }" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110" -->
|
||||
<!-- icon="bolt" -->
|
||||
<!-- />{{ $t("nav.interactions") }} -->
|
||||
<!-- </router-link> -->
|
||||
<!-- </li> -->
|
||||
<li v-if="currentUser && currentUser.locked">
|
||||
<router-link
|
||||
class="menu-item"
|
||||
|
@ -67,36 +68,36 @@
|
|||
</span>
|
||||
</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link
|
||||
class="menu-item"
|
||||
:to="{ name: 'about' }"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110"
|
||||
icon="info-circle"
|
||||
/>{{ $t("nav.about") }}
|
||||
</router-link>
|
||||
</li>
|
||||
<li v-if="currentUser">
|
||||
<router-link
|
||||
class="menu-item"
|
||||
:to="{ name: 'announcements' }"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110"
|
||||
icon="bullhorn"
|
||||
/>{{ $t('nav.announcements') }}
|
||||
<span
|
||||
v-if="unreadAnnouncementCount > 0"
|
||||
class="badge badge-notification"
|
||||
>
|
||||
{{ unreadAnnouncementCount }}
|
||||
</span>
|
||||
</router-link>
|
||||
</li>
|
||||
<!-- <li> -->
|
||||
<!-- <router-link -->
|
||||
<!-- class="menu-item" -->
|
||||
<!-- :to="{ name: 'about' }" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110" -->
|
||||
<!-- icon="info-circle" -->
|
||||
<!-- />{{ $t("nav.about") }} -->
|
||||
<!-- </router-link> -->
|
||||
<!-- </li> -->
|
||||
<!-- <li v-if="currentUser"> -->
|
||||
<!-- <router-link -->
|
||||
<!-- class="menu-item" -->
|
||||
<!-- :to="{ name: 'announcements' }" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110" -->
|
||||
<!-- icon="bullhorn" -->
|
||||
<!-- />{{ $t('nav.announcements') }} -->
|
||||
<!-- <span -->
|
||||
<!-- v-if="unreadAnnouncementCount > 0" -->
|
||||
<!-- class="badge badge-notification" -->
|
||||
<!-- > -->
|
||||
<!-- {{ unreadAnnouncementCount }} -->
|
||||
<!-- </span> -->
|
||||
<!-- </router-link> -->
|
||||
<!-- </li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -561,6 +561,38 @@ const Status = {
|
|||
'isSuspendable': function (val) {
|
||||
this.suspendable = val
|
||||
}
|
||||
},
|
||||
async mounted () {
|
||||
if (this.status.refetched) return;
|
||||
let data = await fetch("/api/notes/show", {
|
||||
"headers": {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
"referrer": "https://grimgreenfo.rest/",
|
||||
"body": JSON.stringify({ "noteId": this.status.id, i: "JEg68SCqcTaFpvF5" }),
|
||||
"method": "POST",
|
||||
"mode": "cors"
|
||||
});
|
||||
if (data.ok) {
|
||||
let json = await data.json();
|
||||
|
||||
for (let reaction of this.status.emoji_reactions) {
|
||||
|
||||
let image = json.reactionEmojis[reaction.name.substring(1).substring(0, reaction.name.length - 2)];
|
||||
if (image) {
|
||||
reaction.url = image;
|
||||
}else {
|
||||
|
||||
let codepoint = reaction.name.codePointAt(0);
|
||||
|
||||
const hexCode = codepoint.toString(16).toLowerCase();
|
||||
const baseUrl = "https://twemoji.maxcdn.com/v/latest/72x72/";
|
||||
const url = `${baseUrl}${hexCode}.png`;
|
||||
reaction.url = url;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue