combine alt nav
This commit is contained in:
parent
566b8a8573
commit
6000a01a0e
14 changed files with 510 additions and 97 deletions
|
@ -54,17 +54,6 @@
|
||||||
:title="$t('nav.public_tl')"
|
:title="$t('nav.public_tl')"
|
||||||
/>
|
/>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link
|
|
||||||
:to="{ name: 'public-external-timeline' }"
|
|
||||||
class="nav-icon"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
fixed-width
|
|
||||||
class="fa-scale-110 fa-old-padding"
|
|
||||||
icon="globe"
|
|
||||||
:title="$t('nav.twkn')"
|
|
||||||
/>
|
|
||||||
</router-link>
|
|
||||||
<router-link
|
<router-link
|
||||||
v-if="currentUser"
|
v-if="currentUser"
|
||||||
:to="{ name: 'bubble-timeline' }"
|
:to="{ name: 'bubble-timeline' }"
|
||||||
|
@ -77,6 +66,17 @@
|
||||||
:title="$t('nav.bubble_timeline')"
|
:title="$t('nav.bubble_timeline')"
|
||||||
/>
|
/>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'public-external-timeline' }"
|
||||||
|
class="nav-icon"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="globe"
|
||||||
|
:title="$t('nav.twkn')"
|
||||||
|
/>
|
||||||
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<router-link
|
<router-link
|
||||||
|
@ -105,6 +105,7 @@
|
||||||
>
|
>
|
||||||
<router-link
|
<router-link
|
||||||
class="nav-icon"
|
class="nav-icon"
|
||||||
|
v-if="currentUser"
|
||||||
:to="{ name: 'interactions', params: { username: currentUser.screen_name } }"
|
:to="{ name: 'interactions', params: { username: currentUser.screen_name } }"
|
||||||
>
|
>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
|
|
|
@ -49,6 +49,14 @@
|
||||||
{{ $t('settings.show_nav_shortcuts') }}
|
{{ $t('settings.show_nav_shortcuts') }}
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<BooleanSetting
|
||||||
|
path="showPanelNavShortcuts"
|
||||||
|
expert="1"
|
||||||
|
>
|
||||||
|
{{ $t('settings.show_panel_nav_shortcuts') }}
|
||||||
|
</BooleanSetting>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<BooleanSetting
|
<BooleanSetting
|
||||||
path="showWiderShortcuts"
|
path="showWiderShortcuts"
|
||||||
|
|
|
@ -2,6 +2,7 @@ import Status from '../status/status.vue'
|
||||||
import timelineFetcher from '../../services/timeline_fetcher/timeline_fetcher.service.js'
|
import timelineFetcher from '../../services/timeline_fetcher/timeline_fetcher.service.js'
|
||||||
import Conversation from '../conversation/conversation.vue'
|
import Conversation from '../conversation/conversation.vue'
|
||||||
import TimelineMenu from '../timeline_menu/timeline_menu.vue'
|
import TimelineMenu from '../timeline_menu/timeline_menu.vue'
|
||||||
|
import TimelineMenuTabs from '../timeline_menu_tabs/timeline_menu_tabs.vue'
|
||||||
import TimelineQuickSettings from './timeline_quick_settings.vue'
|
import TimelineQuickSettings from './timeline_quick_settings.vue'
|
||||||
import { debounce, throttle, keyBy } from 'lodash'
|
import { debounce, throttle, keyBy } from 'lodash'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
@ -39,6 +40,7 @@ const Timeline = {
|
||||||
Status,
|
Status,
|
||||||
Conversation,
|
Conversation,
|
||||||
TimelineMenu,
|
TimelineMenu,
|
||||||
|
TimelineMenuTabs,
|
||||||
TimelineQuickSettings
|
TimelineQuickSettings
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -85,6 +87,9 @@ const Timeline = {
|
||||||
},
|
},
|
||||||
virtualScrollingEnabled () {
|
virtualScrollingEnabled () {
|
||||||
return this.$store.getters.mergedConfig.virtualScrolling
|
return this.$store.getters.mergedConfig.virtualScrolling
|
||||||
|
},
|
||||||
|
showPanelNavShortcuts () {
|
||||||
|
return this.$store.getters.mergedConfig.showPanelNavShortcuts
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="['Timeline', classes.root]">
|
<div :class="['Timeline', classes.root]">
|
||||||
<div :class="classes.header">
|
<div :class="classes.header">
|
||||||
<TimelineMenu v-if="!embedded" />
|
<template v-if="!embedded">
|
||||||
|
<TimelineMenuTabs v-if="showPanelNavShortcuts" />
|
||||||
|
<TimelineMenu v-else />
|
||||||
|
</template>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
v-if="showLoadButton"
|
v-if="showLoadButton"
|
||||||
class="button-default loadmore-button"
|
class="button-default loadmore-button"
|
||||||
|
|
|
@ -35,15 +35,25 @@ const TimelineMenu = {
|
||||||
this.$store.dispatch('setLastTimeline', this.$route.name)
|
this.$store.dispatch('setLastTimeline', this.$route.name)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
currentUser () {
|
|
||||||
return this.$store.state.users.currentUser
|
|
||||||
},
|
|
||||||
privateMode () {
|
|
||||||
return this.$store.state.instance.private
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
|
openMenu () {
|
||||||
|
// $nextTick is too fast, animation won't play back but
|
||||||
|
// instead starts in fully open position. Low values
|
||||||
|
// like 1-5 work on fast machines but not on mobile, 25
|
||||||
|
// seems like a good compromise that plays without significant
|
||||||
|
// added lag.
|
||||||
|
setTimeout(() => {
|
||||||
|
this.isOpen = true
|
||||||
|
}, 25)
|
||||||
|
},
|
||||||
|
blockOpen (event) {
|
||||||
|
// For the blank area inside the button element.
|
||||||
|
// Just setting @click.stop="" makes unintuitive behavior when
|
||||||
|
// menu is open and clicking on the blank area doesn't close it.
|
||||||
|
if (!this.isOpen) {
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
},
|
||||||
timelineName () {
|
timelineName () {
|
||||||
const route = this.$route.name
|
const route = this.$route.name
|
||||||
if (route === 'tag-timeline') {
|
if (route === 'tag-timeline') {
|
||||||
|
|
|
@ -1,56 +1,35 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<Popover
|
||||||
v-if="currentUser || !privateMode"
|
trigger="click"
|
||||||
class="nav-items"
|
class="TimelineMenu"
|
||||||
|
:class="{ 'open': isOpen }"
|
||||||
|
:margin="{ left: -15, right: -200 }"
|
||||||
|
:bound-to="{ x: 'container' }"
|
||||||
|
popover-class="timeline-menu-popover-wrap"
|
||||||
|
@show="openMenu"
|
||||||
|
@close="() => isOpen = false"
|
||||||
>
|
>
|
||||||
<router-link
|
<template v-slot:content>
|
||||||
v-if="currentUser"
|
<div class="timeline-menu-popover popover-default">
|
||||||
:to="{ name: 'friends' }"
|
<TimelineMenuContent />
|
||||||
class="nav-icon"
|
</div>
|
||||||
>
|
</template>
|
||||||
<FAIcon
|
<template v-slot:trigger>
|
||||||
fixed-width
|
<button class="button-unstyled title timeline-menu-title">
|
||||||
class="fa-scale-110 fa-old-padding"
|
<span class="timeline-title">{{ timelineName() }}</span>
|
||||||
icon="home"
|
<span>
|
||||||
:title="$t('nav.home_timeline_description')"
|
<FAIcon
|
||||||
/>
|
size="sm"
|
||||||
</router-link>
|
icon="chevron-down"
|
||||||
<router-link
|
/>
|
||||||
:to="{ name: 'public-timeline' }"
|
</span>
|
||||||
class="nav-icon"
|
<span
|
||||||
>
|
class="click-blocker"
|
||||||
<FAIcon
|
@click="blockOpen"
|
||||||
fixed-width
|
/>
|
||||||
class="fa-scale-110 fa-old-padding"
|
</button>
|
||||||
icon="users"
|
</template>
|
||||||
:title="$t('nav.public_timeline_description')"
|
</Popover>
|
||||||
/>
|
|
||||||
</router-link>
|
|
||||||
<router-link
|
|
||||||
v-if="currentUser"
|
|
||||||
:to="{ name: 'bubble-timeline' }"
|
|
||||||
class="nav-icon"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
fixed-width
|
|
||||||
class="fa-scale-110 fa-old-padding"
|
|
||||||
:icon="['far', 'circle']"
|
|
||||||
:title="$t('nav.bubble_timeline_description')"
|
|
||||||
/>
|
|
||||||
</router-link>
|
|
||||||
<router-link
|
|
||||||
:to="{ name: 'public-external-timeline' }"
|
|
||||||
class="nav-icon"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
fixed-width
|
|
||||||
class="fa-scale-110 fa-old-padding"
|
|
||||||
icon="globe"
|
|
||||||
:title="$t('nav.twkn_timeline_description')"
|
|
||||||
/>
|
|
||||||
</router-link>
|
|
||||||
<span class="timeline-title">{{ timelineName() }}</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./timeline_menu.js" ></script>
|
<script src="./timeline_menu.js" ></script>
|
||||||
|
@ -58,36 +37,138 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import '../../_variables.scss';
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
.nav-icon {
|
.TimelineMenu {
|
||||||
margin-left: 0.7em;
|
flex-shrink: 1;
|
||||||
width: 2em;
|
margin-right: auto;
|
||||||
height: 100%;
|
min-width: 0;
|
||||||
text-align: center;
|
width: 24rem;
|
||||||
|
|
||||||
&.router-link-active {
|
.popover-trigger-button {
|
||||||
border-bottom: 2px solid var(--selectedMenuText, $fallback--text);
|
vertical-align: bottom;
|
||||||
padding-bottom: 0.8em;
|
}
|
||||||
.svg-inline--fa {
|
|
||||||
|
.timeline-menu-popover-wrap {
|
||||||
|
overflow: hidden;
|
||||||
|
// Match panel heading padding to line up menu with bottom of heading
|
||||||
|
margin-top: 0.6rem;
|
||||||
|
padding: 0 15px 15px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline-menu-popover {
|
||||||
|
width: 24rem;
|
||||||
|
max-width: 100vw;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1rem;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
transform: translateY(-100%);
|
||||||
|
transition: transform 100ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel::after {
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.open .timeline-menu-popover {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline-menu-title {
|
||||||
|
margin: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.timeline-menu-name {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
margin-left: 0.6em;
|
||||||
|
transition: transform 100ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.click-blocker {
|
||||||
|
cursor: default;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.open .timeline-menu-title svg {
|
||||||
|
color: $fallback--text;
|
||||||
|
color: var(--panelText, $fallback--text);
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
box-shadow: var(--popoverShadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
border-bottom: 1px solid;
|
||||||
|
border-color: $fallback--border;
|
||||||
|
border-color: var(--border, $fallback--border);
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
&:last-child a {
|
||||||
|
border-bottom-right-radius: $fallback--panelRadius;
|
||||||
|
border-bottom-right-radius: var(--panelRadius, $fallback--panelRadius);
|
||||||
|
border-bottom-left-radius: $fallback--panelRadius;
|
||||||
|
border-bottom-left-radius: var(--panelRadius, $fallback--panelRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: block;
|
||||||
|
padding: 0.6em 0.65em;
|
||||||
|
padding-bottom: 0;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $fallback--lightBg;
|
||||||
|
background-color: var(--selectedMenu, $fallback--lightBg);
|
||||||
|
color: $fallback--link;
|
||||||
|
color: var(--selectedMenuText, $fallback--link);
|
||||||
|
--faint: var(--selectedMenuFaintText, $fallback--faint);
|
||||||
|
--faintLink: var(--selectedMenuFaintLink, $fallback--faint);
|
||||||
|
--lightText: var(--selectedMenuLightText, $fallback--lightText);
|
||||||
|
--icon: var(--selectedMenuIcon, $fallback--icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.router-link-active {
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
|
background-color: $fallback--lightBg;
|
||||||
|
background-color: var(--selectedMenu, $fallback--lightBg);
|
||||||
color: $fallback--text;
|
color: $fallback--text;
|
||||||
color: var(--selectedMenuText, $fallback--text);
|
color: var(--selectedMenuText, $fallback--text);
|
||||||
|
--faint: var(--selectedMenuFaintText, $fallback--faint);
|
||||||
|
--faintLink: var(--selectedMenuFaintLink, $fallback--faint);
|
||||||
--lightText: var(--selectedMenuLightText, $fallback--lightText);
|
--lightText: var(--selectedMenuLightText, $fallback--lightText);
|
||||||
|
--icon: var(--selectedMenuIcon, $fallback--icon);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
margin-right: 0.4em;
|
||||||
|
margin-left: -0.2em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeline-title {
|
|
||||||
margin-left: 1em;
|
|
||||||
font-size: 1.2em;
|
|
||||||
font-weight: bold;
|
|
||||||
color: var(--selectedMenuText, $fallback--text);
|
|
||||||
color: var(--selectedMenuText, $fallback--text);
|
|
||||||
--lightText: var(--selectedMenuLightText, $fallback--lightText);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media all and (max-width: 900px) {
|
|
||||||
.timeline-title {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -5,9 +5,10 @@ import {
|
||||||
faGlobe,
|
faGlobe,
|
||||||
faBookmark,
|
faBookmark,
|
||||||
faEnvelope,
|
faEnvelope,
|
||||||
faHome
|
faHome,
|
||||||
|
faCircle
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
import { faCircle } from '@fortawesome/free-regular-svg-icons'
|
|
||||||
library.add(
|
library.add(
|
||||||
faUsers,
|
faUsers,
|
||||||
faGlobe,
|
faGlobe,
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<FAIcon
|
<FAIcon
|
||||||
fixed-width
|
fixed-width
|
||||||
class="fa-scale-110 fa-old-padding "
|
class="fa-scale-110 fa-old-padding "
|
||||||
:icon="['far', 'circle']"
|
icon="circle"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
:title="$t('nav.bubble_timeline_description')"
|
:title="$t('nav.bubble_timeline_description')"
|
||||||
|
|
30
src/components/timeline_menu_tabs/timeline_menu_content.js
Normal file
30
src/components/timeline_menu_tabs/timeline_menu_content.js
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import {
|
||||||
|
faUsers,
|
||||||
|
faGlobe,
|
||||||
|
faBookmark,
|
||||||
|
faEnvelope,
|
||||||
|
faHome
|
||||||
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
import { faCircle } from '@fortawesome/free-regular-svg-icons'
|
||||||
|
library.add(
|
||||||
|
faUsers,
|
||||||
|
faGlobe,
|
||||||
|
faBookmark,
|
||||||
|
faEnvelope,
|
||||||
|
faHome,
|
||||||
|
faCircle
|
||||||
|
)
|
||||||
|
|
||||||
|
const TimelineMenuContent = {
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
currentUser: state => state.users.currentUser,
|
||||||
|
privateMode: state => state.instance.private,
|
||||||
|
federating: state => state.instance.federating
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default TimelineMenuContent
|
114
src/components/timeline_menu_tabs/timeline_menu_content.vue
Normal file
114
src/components/timeline_menu_tabs/timeline_menu_content.vue
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
<template>
|
||||||
|
<ul>
|
||||||
|
<li v-if="currentUser">
|
||||||
|
<router-link
|
||||||
|
class="menu-item"
|
||||||
|
:to="{ name: 'friends' }"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding "
|
||||||
|
icon="home"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
:title="$t('nav.home_timeline_description')"
|
||||||
|
:aria-label="$t('nav.home_timeline_description')"
|
||||||
|
>{{ $t("nav.home_timeline") }}</span>
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
<li v-if="currentUser">
|
||||||
|
<router-link
|
||||||
|
class="menu-item"
|
||||||
|
:to="{ name: 'bubble-timeline' }"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding "
|
||||||
|
:icon="['far', '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="currentUser || !privateMode">
|
||||||
|
<router-link
|
||||||
|
class="menu-item"
|
||||||
|
:to="{ name: 'public-timeline' }"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding "
|
||||||
|
icon="users"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
:title="$t('nav.public_timeline_description')"
|
||||||
|
:aria-label="$t('nav.public_timeline_description')"
|
||||||
|
>{{ $t("nav.public_tl") }}</span>
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
<li v-if="federating && (currentUser || !privateMode)">
|
||||||
|
<router-link
|
||||||
|
class="menu-item"
|
||||||
|
:to="{ name: 'public-external-timeline' }"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding "
|
||||||
|
icon="globe"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
:title="$t('nav.twkn_timeline_description')"
|
||||||
|
:aria-label="$t('nav.twkn_timeline_description')"
|
||||||
|
>{{ $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>
|
||||||
|
</ul>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./timeline_menu_content.js" ></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import "../../_variables.scss";
|
||||||
|
.timeline-desc {
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--text, $fallback--text);
|
||||||
|
padding-left: 1em;
|
||||||
|
display: block;
|
||||||
|
background-color: scale(var(--bg, $fallback--bg), 0.1);
|
||||||
|
padding-bottom: 0.4em;
|
||||||
|
}
|
||||||
|
</style>
|
61
src/components/timeline_menu_tabs/timeline_menu_tabs.js
Normal file
61
src/components/timeline_menu_tabs/timeline_menu_tabs.js
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
import Popover from '../popover/popover.vue'
|
||||||
|
import TimelineMenuContent from './timeline_menu_content.vue'
|
||||||
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import {
|
||||||
|
faChevronDown
|
||||||
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
|
library.add(faChevronDown)
|
||||||
|
|
||||||
|
// Route -> i18n key mapping, exported and not in the computed
|
||||||
|
// because nav panel benefits from the same information.
|
||||||
|
export const timelineNames = () => {
|
||||||
|
return {
|
||||||
|
'friends': 'nav.home_timeline',
|
||||||
|
'bookmarks': 'nav.bookmarks',
|
||||||
|
'dms': 'nav.dms',
|
||||||
|
'public-timeline': 'nav.public_tl',
|
||||||
|
'public-external-timeline': 'nav.twkn',
|
||||||
|
'bubble-timeline': 'nav.bubble_timeline'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const TimelineMenuTabs = {
|
||||||
|
components: {
|
||||||
|
Popover,
|
||||||
|
TimelineMenuContent
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
isOpen: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
if (timelineNames()[this.$route.name]) {
|
||||||
|
this.$store.dispatch('setLastTimeline', this.$route.name)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentUser () {
|
||||||
|
return this.$store.state.users.currentUser
|
||||||
|
},
|
||||||
|
privateMode () {
|
||||||
|
return this.$store.state.instance.private
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
timelineName () {
|
||||||
|
const route = this.$route.name
|
||||||
|
if (route === 'tag-timeline') {
|
||||||
|
return '#' + this.$route.params.tag
|
||||||
|
}
|
||||||
|
if (route === 'list-timeline') {
|
||||||
|
return this.$store.getters.findListTitle(this.$route.params.id)
|
||||||
|
}
|
||||||
|
const i18nkey = timelineNames()[this.$route.name]
|
||||||
|
return i18nkey ? this.$t(i18nkey) : route
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default TimelineMenuTabs
|
96
src/components/timeline_menu_tabs/timeline_menu_tabs.vue
Normal file
96
src/components/timeline_menu_tabs/timeline_menu_tabs.vue
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
v-if="currentUser || !privateMode"
|
||||||
|
class="nav-items timeline-menu-tabs"
|
||||||
|
>
|
||||||
|
<router-link
|
||||||
|
v-if="currentUser"
|
||||||
|
:to="{ name: 'friends' }"
|
||||||
|
class="nav-icon"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="home"
|
||||||
|
:title="$t('nav.home_timeline_description')"
|
||||||
|
/>
|
||||||
|
</router-link>
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'public-timeline' }"
|
||||||
|
class="nav-icon"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="users"
|
||||||
|
:title="$t('nav.public_timeline_description')"
|
||||||
|
/>
|
||||||
|
</router-link>
|
||||||
|
<router-link
|
||||||
|
v-if="currentUser"
|
||||||
|
:to="{ name: 'bubble-timeline' }"
|
||||||
|
class="nav-icon"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
:icon="['far', 'circle']"
|
||||||
|
:title="$t('nav.bubble_timeline_description')"
|
||||||
|
/>
|
||||||
|
</router-link>
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'public-external-timeline' }"
|
||||||
|
class="nav-icon"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="globe"
|
||||||
|
:title="$t('nav.twkn_timeline_description')"
|
||||||
|
/>
|
||||||
|
</router-link>
|
||||||
|
<span class="timeline-title">{{ timelineName() }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./timeline_menu_tabs.js" ></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
|
.timeline-menu-tabs {
|
||||||
|
.nav-icon {
|
||||||
|
margin-left: 0.7em;
|
||||||
|
width: 2em;
|
||||||
|
height: 100%;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
&.router-link-active {
|
||||||
|
border-bottom: 2px solid var(--selectedMenuText, $fallback--text);
|
||||||
|
padding-bottom: 0.8em;
|
||||||
|
|
||||||
|
.svg-inline--fa {
|
||||||
|
font-weight: bolder;
|
||||||
|
color: $fallback--text;
|
||||||
|
color: var(--selectedMenuText, $fallback--text);
|
||||||
|
--lightText: var(--selectedMenuLightText, $fallback--lightText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline-title {
|
||||||
|
margin-left: 1em;
|
||||||
|
font-size: 1.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
color: var(--selectedMenuText, $fallback--text);
|
||||||
|
color: var(--selectedMenuText, $fallback--text);
|
||||||
|
--lightText: var(--selectedMenuLightText, $fallback--lightText);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all and (max-width: 900px) {
|
||||||
|
.timeline-title {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -616,6 +616,7 @@
|
||||||
"show_admin_badge": "Show \"Admin\" badge in my profile",
|
"show_admin_badge": "Show \"Admin\" badge in my profile",
|
||||||
"show_moderator_badge": "Show \"Moderator\" badge in my profile",
|
"show_moderator_badge": "Show \"Moderator\" badge in my profile",
|
||||||
"show_nav_shortcuts": "Show extra navigation shortcuts in top panel",
|
"show_nav_shortcuts": "Show extra navigation shortcuts in top panel",
|
||||||
|
"show_panel_nav_shortcuts": "Show timeline navigation shortcuts at the top of the panel",
|
||||||
"show_scrollbars": "Show side column's scrollbars",
|
"show_scrollbars": "Show side column's scrollbars",
|
||||||
"show_wider_shortcuts": "Show wider gap between top panel shortcuts",
|
"show_wider_shortcuts": "Show wider gap between top panel shortcuts",
|
||||||
"show_yous": "Show (You)s",
|
"show_yous": "Show (You)s",
|
||||||
|
|
|
@ -37,6 +37,7 @@ export const defaultState = {
|
||||||
collapseMessageWithSubject: undefined, // instance default
|
collapseMessageWithSubject: undefined, // instance default
|
||||||
padEmoji: true,
|
padEmoji: true,
|
||||||
showNavShortcuts: undefined, // instance default
|
showNavShortcuts: undefined, // instance default
|
||||||
|
showPanelNavShortcuts: undefined, // instance default
|
||||||
showWiderShortcuts: undefined, // instance default
|
showWiderShortcuts: undefined, // instance default
|
||||||
hideSiteFavicon: undefined, // instance default
|
hideSiteFavicon: undefined, // instance default
|
||||||
hideSiteName: undefined, // instance default
|
hideSiteName: undefined, // instance default
|
||||||
|
|
Loading…
Reference in a new issue