-
- {{ title }}
-
+
diff --git a/src/components/timeline_menu/timeline_menu.js b/src/components/timeline_menu/timeline_menu.js
new file mode 100644
index 00000000..c0d75c54
--- /dev/null
+++ b/src/components/timeline_menu/timeline_menu.js
@@ -0,0 +1,57 @@
+import Popover from '../popover/popover.vue'
+import { mapState } from 'vuex'
+
+// Route -> i18n key mapping, exported andnot in the computed
+// because nav panel benefits from the same information.
+export const timelineNames = () => {
+ return {
+ 'friends': 'nav.timeline',
+ 'bookmarks': 'nav.bookmarks',
+ 'dms': 'nav.dms',
+ 'public-timeline': 'nav.public_tl',
+ 'public-external-timeline': 'nav.twkn'
+ }
+}
+
+const TimelineMenu = {
+ components: {
+ Popover
+ },
+ data () {
+ return {
+ isOpen: false
+ }
+ },
+ created () {
+ if (this.currentUser && this.currentUser.locked) {
+ this.$store.dispatch('startFetchingFollowRequests')
+ }
+ if (timelineNames()[this.$route.name]) {
+ this.$store.dispatch('setLastTimeline', this.$route.name)
+ }
+ },
+ 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)
+ }
+ },
+ computed: {
+ ...mapState({
+ currentUser: state => state.users.currentUser,
+ privateMode: state => state.instance.private,
+ federating: state => state.instance.federating
+ }),
+ timelineNames () {
+ return timelineNames()
+ }
+ }
+}
+
+export default TimelineMenu
diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue
new file mode 100644
index 00000000..add8a6eb
--- /dev/null
+++ b/src/components/timeline_menu/timeline_menu.vue
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
diff --git a/src/i18n/de.json b/src/i18n/de.json
index 413b9bfc..3014b870 100644
--- a/src/i18n/de.json
+++ b/src/i18n/de.json
@@ -58,7 +58,7 @@
"dms": "Direktnachrichten",
"public_tl": "Öffentliche Zeitleiste",
"timeline": "Zeitleiste",
- "twkn": "Das gesamte bekannte Netzwerk",
+ "twkn": "Bekannte Netzwerk",
"user_search": "Benutzersuche",
"search": "Suche",
"preferences": "Voreinstellungen",
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 6bc63cfd..e05ac907 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -120,12 +120,13 @@
"dms": "Direct Messages",
"public_tl": "Public Timeline",
"timeline": "Timeline",
- "twkn": "The Whole Known Network",
+ "twkn": "Known Network",
"bookmarks": "Bookmarks",
"user_search": "User Search",
"search": "Search",
"who_to_follow": "Who to follow",
"preferences": "Preferences",
+ "timelines": "Timelines",
"chats": "Chats"
},
"notifications": {
diff --git a/src/i18n/fi.json b/src/i18n/fi.json
index 6170303f..510b2234 100644
--- a/src/i18n/fi.json
+++ b/src/i18n/fi.json
@@ -63,7 +63,7 @@
"dms": "Yksityisviestit",
"public_tl": "Julkinen Aikajana",
"timeline": "Aikajana",
- "twkn": "Koko Tunnettu Verkosto",
+ "twkn": "Tunnettu Verkosto",
"user_search": "Käyttäjähaku",
"who_to_follow": "Seurausehdotukset",
"preferences": "Asetukset",
diff --git a/src/modules/interface.js b/src/modules/interface.js
index ec08ac0a..748d3025 100644
--- a/src/modules/interface.js
+++ b/src/modules/interface.js
@@ -16,7 +16,8 @@ const defaultState = {
},
mobileLayout: false,
globalNotices: [],
- layoutHeight: 0
+ layoutHeight: 0,
+ lastTimeline: null
}
const interfaceMod = {
@@ -69,6 +70,9 @@ const interfaceMod = {
},
setLayoutHeight (state, value) {
state.layoutHeight = value
+ },
+ setLastTimeline (state, value) {
+ state.lastTimeline = value
}
},
actions: {
@@ -117,6 +121,9 @@ const interfaceMod = {
},
setLayoutHeight ({ commit }, value) {
commit('setLayoutHeight', value)
+ },
+ setLastTimeline ({ commit }, value) {
+ commit('setLastTimeline', value)
}
}
}
diff --git a/src/modules/users.js b/src/modules/users.js
index 16c1e566..9245db5c 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -499,6 +499,7 @@ const users = {
store.commit('clearNotifications')
store.commit('resetStatuses')
store.dispatch('resetChats')
+ store.dispatch('setLastTimeline', 'public-timeline')
})
},
loginUser (store, accessToken) {