disable nav elements that don't work
This commit is contained in:
parent
00b523ddac
commit
8a77bbccc0
8 changed files with 161 additions and 147 deletions
|
@ -55,18 +55,18 @@
|
|||
:title="$t('nav.public_tl')"
|
||||
/>
|
||||
</router-link>
|
||||
<router-link
|
||||
v-if="bubbleTimelineVisible"
|
||||
:to="{ name: 'bubble-timeline' }"
|
||||
class="nav-icon"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="circle"
|
||||
:title="$t('nav.bubble_timeline')"
|
||||
/>
|
||||
</router-link>
|
||||
<!-- <router-link -->
|
||||
<!-- v-if="bubbleTimelineVisible" -->
|
||||
<!-- :to="{ name: 'bubble-timeline' }" -->
|
||||
<!-- class="nav-icon" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110 fa-old-padding" -->
|
||||
<!-- icon="circle" -->
|
||||
<!-- :title="$t('nav.bubble_timeline')" -->
|
||||
<!-- /> -->
|
||||
<!-- </router-link> -->
|
||||
<router-link
|
||||
v-if="federatedTimelineVisible"
|
||||
:to="{ name: 'public-external-timeline' }"
|
||||
|
@ -130,18 +130,18 @@
|
|||
<!-- :title="$t('nav.lists')" -->
|
||||
<!-- /> -->
|
||||
<!-- </router-link> -->
|
||||
<router-link
|
||||
v-if="currentUser"
|
||||
:to="{ name: 'bookmarks' }"
|
||||
class="nav-icon"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="bookmark"
|
||||
:title="$t('nav.bookmarks')"
|
||||
/>
|
||||
</router-link>
|
||||
<!-- <router-link -->
|
||||
<!-- v-if="currentUser" -->
|
||||
<!-- :to="{ name: 'bookmarks' }" -->
|
||||
<!-- class="nav-icon" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110 fa-old-padding" -->
|
||||
<!-- icon="bookmark" -->
|
||||
<!-- :title="$t('nav.bookmarks')" -->
|
||||
<!-- /> -->
|
||||
<!-- </router-link> -->
|
||||
</div>
|
||||
<button
|
||||
class="button-unstyled nav-icon"
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
v-if="!mergedConfig.hidePostStats && status.fave_num > 0"
|
||||
class="action-counter"
|
||||
>
|
||||
<!-- SHARKEY-SPECIFIC: disable favorite count because devs make them hearts for some reason -->
|
||||
<!-- {{ status.fave_num }} -->
|
||||
{{ status.fave_num }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -26,18 +26,18 @@
|
|||
</div>
|
||||
</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: '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" -->
|
||||
|
|
|
@ -560,52 +560,48 @@ const Status = {
|
|||
},
|
||||
'isSuspendable': function (val) {
|
||||
this.suspendable = val
|
||||
},
|
||||
'status.emoji_reactions': {
|
||||
|
||||
// since the sharkey mastoapi doesn't support reactions we have to do an additional fetch to origin server for every note. not good!
|
||||
async handler (reactions) {
|
||||
for (let reaction of reactions) {
|
||||
if (reaction.name.startsWith(':')) continue;
|
||||
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;
|
||||
}
|
||||
console.log(reactions);
|
||||
|
||||
if (reactions.some(reaction => reaction.name.startsWith(':'))) {
|
||||
let data = await fetch("/api/notes/show", {
|
||||
"headers": {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
"referrer": "https://grimgreenfo.rest/",
|
||||
"body": JSON.stringify({ "noteId": this.status.id, }),
|
||||
"method": "POST",
|
||||
"mode": "cors"
|
||||
});
|
||||
if (data.ok) {
|
||||
let json = await data.json();
|
||||
|
||||
for (let reaction of reactions) {
|
||||
if (!reaction.name.startsWith(':')) continue;
|
||||
let image = json.reactionEmojis[reaction.name.substring(1).substring(0, reaction.name.length - 2)];
|
||||
reaction.url = image;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
async mounted () {
|
||||
if (this.status.refetched) return;
|
||||
|
||||
if (this.status.emoji_reactions.length > 1 && this.status.emoji_reactions.some(reaction => reaction.name.startsWith(':'))) {
|
||||
let data = await fetch("/api/notes/show", {
|
||||
"headers": {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
"referrer": "https://grimgreenfo.rest/",
|
||||
"body": JSON.stringify({ "noteId": this.status.id, }),
|
||||
"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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let reaction of this.status.emoji_reactions) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Status
|
||||
|
|
|
@ -32,22 +32,23 @@
|
|||
>{{ $t("nav.public_tl") }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
<li v-if="bubbleTimelineVisible">
|
||||
<router-link
|
||||
class="menu-item"
|
||||
:to="{ name: 'bubble-timeline' }"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding "
|
||||
icon="circle"
|
||||
/>
|
||||
<span
|
||||
:title="$t('nav.bubble_timeline_description')"
|
||||
:aria-label="$t('nav.bubble_timeline_description')"
|
||||
>{{ $t("nav.bubble_timeline") }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
<!-- no bubble timeline in mastoapi -->
|
||||
<!-- <li v-if="bubbleTimelineVisible"> -->
|
||||
<!-- <router-link -->
|
||||
<!-- class="menu-item" -->
|
||||
<!-- :to="{ name: 'bubble-timeline' }" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110 fa-old-padding " -->
|
||||
<!-- icon="circle" -->
|
||||
<!-- /> -->
|
||||
<!-- <span -->
|
||||
<!-- :title="$t('nav.bubble_timeline_description')" -->
|
||||
<!-- :aria-label="$t('nav.bubble_timeline_description')" -->
|
||||
<!-- >{{ $t("nav.bubble_timeline") }}</span> -->
|
||||
<!-- </router-link> -->
|
||||
<!-- </li> -->
|
||||
<li v-if="federatedTimelineVisible">
|
||||
<router-link
|
||||
class="menu-item"
|
||||
|
@ -64,38 +65,38 @@
|
|||
>{{ $t("nav.twkn") }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
<li v-if="currentUser">
|
||||
<router-link
|
||||
class="menu-item"
|
||||
:to="{ name: 'bookmarks'}"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding "
|
||||
icon="bookmark"
|
||||
/>
|
||||
<span
|
||||
:title="$t('nav.bookmarks')"
|
||||
:aria-label="$t('nav.bookmarks')"
|
||||
>{{ $t("nav.bookmarks") }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
<li v-if="currentUser">
|
||||
<router-link
|
||||
class="menu-item"
|
||||
:to="{ name: 'dms', params: { username: currentUser.screen_name } }"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding "
|
||||
icon="envelope"
|
||||
/>
|
||||
<span
|
||||
:title="$t('nav.dms')"
|
||||
:aria-label="$t('nav.dms')"
|
||||
>{{ $t("nav.dms") }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
<!-- <li v-if="currentUser"> -->
|
||||
<!-- <router-link -->
|
||||
<!-- class="menu-item" -->
|
||||
<!-- :to="{ name: 'bookmarks'}" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110 fa-old-padding " -->
|
||||
<!-- icon="bookmark" -->
|
||||
<!-- /> -->
|
||||
<!-- <span -->
|
||||
<!-- :title="$t('nav.bookmarks')" -->
|
||||
<!-- :aria-label="$t('nav.bookmarks')" -->
|
||||
<!-- >{{ $t("nav.bookmarks") }}</span> -->
|
||||
<!-- </router-link> -->
|
||||
<!-- </li> -->
|
||||
<!-- <li v-if="currentUser"> -->
|
||||
<!-- <router-link -->
|
||||
<!-- class="menu-item" -->
|
||||
<!-- :to="{ name: 'dms', params: { username: currentUser.screen_name } }" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110 fa-old-padding " -->
|
||||
<!-- icon="envelope" -->
|
||||
<!-- /> -->
|
||||
<!-- <span -->
|
||||
<!-- :title="$t('nav.dms')" -->
|
||||
<!-- :aria-label="$t('nav.dms')" -->
|
||||
<!-- >{{ $t("nav.dms") }}</span> -->
|
||||
<!-- </router-link> -->
|
||||
<!-- </li> -->
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -81,20 +81,20 @@
|
|||
</router-link>
|
||||
</li>
|
||||
<li v-if="currentUser">
|
||||
<router-link
|
||||
class="menu-item"
|
||||
:to="{ name: 'bookmarks'}"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding "
|
||||
icon="bookmark"
|
||||
/>
|
||||
<span
|
||||
:title="$t('nav.bookmarks')"
|
||||
:aria-label="$t('nav.bookmarks')"
|
||||
>{{ $t("nav.bookmarks") }}</span>
|
||||
</router-link>
|
||||
<!-- <router-link -->
|
||||
<!-- class="menu-item" -->
|
||||
<!-- :to="{ name: 'bookmarks'}" -->
|
||||
<!-- > -->
|
||||
<!-- <FAIcon -->
|
||||
<!-- fixed-width -->
|
||||
<!-- class="fa-scale-110 fa-old-padding " -->
|
||||
<!-- icon="bookmark" -->
|
||||
<!-- /> -->
|
||||
<!-- <span -->
|
||||
<!-- :title="$t('nav.bookmarks')" -->
|
||||
<!-- :aria-label="$t('nav.bookmarks')" -->
|
||||
<!-- >{{ $t("nav.bookmarks") }}</span> -->
|
||||
<!-- </router-link> -->
|
||||
</li>
|
||||
<li v-if="currentUser">
|
||||
<router-link
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue