From 88d960b9f6109c0c57958fb74d841dab9954ac33 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Mon, 31 Oct 2016 10:20:02 +0100 Subject: Make created_at_parsed reactive. --- src/modules/statuses.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/modules/statuses.js b/src/modules/statuses.js index eee368a3..c3692ae7 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -55,6 +55,9 @@ const addStatusesToTimeline = (addedStatuses, showImmediately, { statuses, visib // Add some html and nsfw to the statuses. each(addedStatuses, (status) => { const statusoid = status.retweeted_status || status + + statusoid.created_at_parsed = statusoid.created_at + if (statusoid.parsedText === undefined) { // statusoid.parsedText = statusParserService.parse(statusoid) statusoid.parsedText = statusoid.text -- cgit v1.2.3-70-g09d2 From 2917f4ab44f36aaf765f5b1b54b67551b600af77 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sat, 5 Nov 2016 11:01:17 +0100 Subject: Fix background css (partly). --- src/App.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/App.scss b/src/App.scss index a15751aa..afd65172 100644 --- a/src/App.scss +++ b/src/App.scss @@ -2,7 +2,7 @@ $main-color: #f58d2c; $main-background: white; $darkened-background: whitesmoke; -body { +#app { background-color: $main-color; background-size: cover; background-attachment: fixed; -- cgit v1.2.3-70-g09d2 From 15800bab576b1a1e1ef5eab61b6d0d16ea6dfd5e Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 17:43:31 +0100 Subject: Add mp4 to attachments. --- src/components/attachment/attachment.js | 4 ++-- src/components/attachment/attachment.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 161c6b2b..85d924d0 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -19,8 +19,8 @@ const Attachment = { type = 'image'; } - if(this.attachment.mimetype.match(/video\/webm/)) { - type = 'webm'; + if(this.attachment.mimetype.match(/video\/(webm|mp4)/)) { + type = 'video'; }; return type diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 7feab42c..09ca5fa9 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -6,7 +6,7 @@ - + Don't know how to display this... -- cgit v1.2.3-70-g09d2 From 1a94217222de1b5f61a1b88bf633d752d45ccc1f Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 17:43:43 +0100 Subject: Fix app height. --- src/App.scss | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/App.scss b/src/App.scss index afd65172..100187cf 100644 --- a/src/App.scss +++ b/src/App.scss @@ -8,6 +8,7 @@ $darkened-background: whitesmoke; background-attachment: fixed; background-repeat: no-repeat; background-position: 0 50px; + min-height: 100vh; } h4 { -- cgit v1.2.3-70-g09d2 From e1103f04a44133fa5775b0be1fd5e2acce79daef Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 17:44:05 +0100 Subject: Add fetching of older statuses. --- src/components/timeline/timeline.js | 13 +++++++++++++ src/components/timeline/timeline.vue | 7 +++++++ src/modules/statuses.js | 17 ++++++++++++----- .../timeline_fetcher/timeline_fetcher.service.js | 6 ++++-- 4 files changed, 36 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 433bca11..113455f4 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -1,4 +1,5 @@ import Status from '../status/status.vue' +import timelineFetcher from '../../services/timeline_fetcher/timeline_fetcher.service.js' const Timeline = { props: [ @@ -11,6 +12,18 @@ const Timeline = { methods: { showNewStatuses () { this.$store.commit('showNewStatuses', { timeline: this.timelineName }) + }, + fetchOlderStatuses () { + const store = this.$store + const credentials = store.state.users.currentUser.credentials + store.commit('setLoading', { timeline: this.timelineName, value: true }); + timelineFetcher.fetchAndUpdate({ + store, + credentials, + timeline: this.timelineName, + older: true, + showImmediately: true + }).then(() => store.commit('setLoading', { timeline: this.timelineName, value: false })) } } } diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue index 1e779638..2f1b8c28 100644 --- a/src/components/timeline/timeline.vue +++ b/src/components/timeline/timeline.vue @@ -8,6 +8,13 @@ + +
+

+ Load older statuses. +

+
+
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index c3692ae7..5fb57a4f 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -12,7 +12,8 @@ const defaultState = { visibleStatuses: [], newStatusCount: 0, maxId: 0, - minVisibleId: 0 + minVisibleId: 0, + loading: false }, publicAndExternal: { statuses: [], @@ -20,7 +21,8 @@ const defaultState = { visibleStatuses: [], newStatusCount: 0, maxId: 0, - minVisibleId: 0 + minVisibleId: 0, + loading: false }, friends: { statuses: [], @@ -28,7 +30,8 @@ const defaultState = { visibleStatuses: [], newStatusCount: 0, maxId: 0, - minVisibleId: 0 + minVisibleId: 0, + loading: false } } } @@ -37,7 +40,7 @@ const statusType = (status) => { return !status.is_post_verb && status.uri.match(/fave/) ? 'fave' : 'status' } -const addStatusesToTimeline = (addedStatuses, showImmediately, { statuses, visibleStatuses, newStatusCount, faves }) => { +const addStatusesToTimeline = (addedStatuses, showImmediately, { statuses, visibleStatuses, newStatusCount, faves, loading }) => { const statusesAndFaves = groupBy(addedStatuses, statusType) const addedFaves = statusesAndFaves['fave'] || [] const unseenFaves = differenceBy(addedFaves, faves, 'id') @@ -92,7 +95,8 @@ const addStatusesToTimeline = (addedStatuses, showImmediately, { statuses, visib newStatusCount: newNewStatusCount, maxId: newStatuses[0].id, minVisibleId: (last(newVisibleStatuses) || { id: undefined }).id, - faves: unionBy(faves, addedFaves, 'id') + faves: unionBy(faves, addedFaves, 'id'), + loading } } @@ -138,6 +142,9 @@ const statuses = { const newStatus = find(state.allStatuses, status) newStatus.favorited = value }, + setLoading (state, { timeline, value }) { + state.timelines[timeline].loading = value + }, setNsfw (state, { id, nsfw }) { // For now, walk through all the statuses because the stuff might be in the replied_to_status // TODO: Save the replied_tos as references. diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js index a3d9b9d1..8a39eeb5 100644 --- a/src/services/timeline_fetcher/timeline_fetcher.service.js +++ b/src/services/timeline_fetcher/timeline_fetcher.service.js @@ -16,7 +16,8 @@ const update = ({store, statuses, timeline, showImmediately}) => { const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false, showImmediately = false}) => { const args = { timeline, credentials } - const timelineData = store.rootState.statuses.timelines[camelCase(timeline)] + const rootState = store.rootState || store.state + const timelineData = rootState.statuses.timelines[camelCase(timeline)] if (older) { args['until'] = timelineData.minVisibleId @@ -24,7 +25,7 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false args['since'] = timelineData.maxId } - apiService.fetchTimeline(args) + return apiService.fetchTimeline(args) .then((statuses) => update({store, statuses, timeline, showImmediately})) } @@ -35,6 +36,7 @@ const startFetching = ({ timeline = 'friends', credentials, store }) => { setInterval(boundFetchAndUpdate, 10000) } const timelineFetcher = { + fetchAndUpdate, startFetching } -- cgit v1.2.3-70-g09d2 From a5edcef24ddf7011dff77f76679df3fe06f42786 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 17:48:56 +0100 Subject: Remove temp data. --- src/services/timeline_fetcher/.#timeline_fetcher.service.js | 1 - 1 file changed, 1 deletion(-) delete mode 120000 src/services/timeline_fetcher/.#timeline_fetcher.service.js (limited to 'src') diff --git a/src/services/timeline_fetcher/.#timeline_fetcher.service.js b/src/services/timeline_fetcher/.#timeline_fetcher.service.js deleted file mode 120000 index 8315cdae..00000000 --- a/src/services/timeline_fetcher/.#timeline_fetcher.service.js +++ /dev/null @@ -1 +0,0 @@ -roger@yuuyuu.18961 \ No newline at end of file -- cgit v1.2.3-70-g09d2 From a73916dd7f07954ee0305df822baa8068ae1df14 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 19:28:37 +0100 Subject: Add MediaUpload component. --- src/components/media_upload/media_upload.js | 22 ++++++++++++++++++++++ src/components/media_upload/media_upload.vue | 17 +++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/components/media_upload/media_upload.js create mode 100644 src/components/media_upload/media_upload.vue (limited to 'src') diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js new file mode 100644 index 00000000..c24c71e9 --- /dev/null +++ b/src/components/media_upload/media_upload.js @@ -0,0 +1,22 @@ +/* eslint-env browser */ +import statusPosterService from '../../services/status_poster/status_poster.service.js' + +const mediaUpload = { + mounted () { + const store = this.$store + const input = this.$el.querySelector('input') + const self = this + + input.addEventListener('change', ({target}) => { + const file = target.files[0]; + const formData = new FormData(); + formData.append('media', file); + statusPosterService.uploadMedia({ store, formData }) + .then((fileData) => { + self.$emit('uploaded', fileData) + }) + }) + } +} + +export default mediaUpload diff --git a/src/components/media_upload/media_upload.vue b/src/components/media_upload/media_upload.vue new file mode 100644 index 00000000..a62d8316 --- /dev/null +++ b/src/components/media_upload/media_upload.vue @@ -0,0 +1,17 @@ + + + + + -- cgit v1.2.3-70-g09d2 From 86749f759d6b2f75871242ba1edcd53e6d8ab14c Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 19:28:48 +0100 Subject: Remove superfluous css. --- src/App.scss | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/App.scss b/src/App.scss index 100187cf..a4d87308 100644 --- a/src/App.scss +++ b/src/App.scss @@ -304,11 +304,6 @@ attention { display: flex; padding: 0.5em; - media-upload { - font-size: 26px; - flex: 1; - } - button { flex: 2; } -- cgit v1.2.3-70-g09d2 From f86f0ef7f02ff68cfa2cd80ac38b0073314399b6 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 19:29:41 +0100 Subject: Add media upload to API Service. --- src/services/api/api.service.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index df7b4190..c9fcc4f6 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -6,8 +6,8 @@ const PUBLIC_AND_EXTERNAL_TIMELINE_URL = '/api/statuses/public_and_external_time const FAVORITE_URL = '/api/favorites/create' const UNFAVORITE_URL = '/api/favorites/destroy' const STATUS_UPDATE_URL = '/api/statuses/update.json' +const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload' // const CONVERSATION_URL = '/api/statusnet/conversation/'; -// const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload'; // const FORM_CONTENT_TYPE = {'Content-Type': 'application/x-www-form-urlencoded'}; @@ -75,12 +75,23 @@ const postStatus = ({credentials, status, mediaIds, inReplyToStatusId}) => { }) } +const uploadMedia = ({formData, credentials}) => { + return fetch(MEDIA_UPLOAD_URL, { + body: formData, + method: 'POST', + headers: authHeaders(credentials) + }) + .then((response) => response.text()) + .then((text) => (new DOMParser()).parseFromString(text, 'application/xml')) +} + const apiService = { verifyCredentials, fetchTimeline, favorite, unfavorite, - postStatus + postStatus, + uploadMedia } export default apiService -- cgit v1.2.3-70-g09d2 From 7e2e2d3ec3e7eb79674777c63f0d89e6d55fbbd0 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 19:30:20 +0100 Subject: Add media upload to StatusPosterService. --- src/services/status_poster/status_poster.service.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/services/status_poster/status_poster.service.js b/src/services/status_poster/status_poster.service.js index 1a96b5f6..2a324541 100644 --- a/src/services/status_poster/status_poster.service.js +++ b/src/services/status_poster/status_poster.service.js @@ -12,8 +12,21 @@ const postStatus = ({ store, status, media = [], inReplyToStatusId = undefined } }) } +const uploadMedia = ({ store, formData }) => { + const credentials = store.state.users.currentUser.credentials + + return apiService.uploadMedia({ credentials, formData }).then((xml) => { + return { + id: xml.getElementsByTagName('media_id')[0].textContent, + url: xml.getElementsByTagName('media_url')[0].textContent, + image: xml.getElementsByTagName('atom:link')[0].getAttribute('href') + } + }) +} + const statusPosterService = { - postStatus + postStatus, + uploadMedia } export default statusPosterService -- cgit v1.2.3-70-g09d2 From e21a60096c397f949848db0de4699eb41a7623de Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 19:30:35 +0100 Subject: Add media upload to PostStatusForm. --- src/components/post_status_form/post_status_form.js | 17 +++++++++++++++-- src/components/post_status_form/post_status_form.vue | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 2c015154..30a7cd40 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -1,4 +1,6 @@ import statusPoster from '../../services/status_poster/status_poster.service.js' +import MediaUpload from '../media_upload/media_upload.vue' + import { reject, map, uniqBy } from 'lodash'; const buildMentionsString = ({user, attentions}, currentUser) => { @@ -23,6 +25,9 @@ const PostStatusForm = { 'repliedUser', 'attentions' ], + components: { + MediaUpload + }, data () { let statusText = '' @@ -33,7 +38,8 @@ const PostStatusForm = { return { newStatus: { - status: statusText + status: statusText, + files: [] } } }, @@ -41,11 +47,18 @@ const PostStatusForm = { postStatus (newStatus) { statusPoster.postStatus({ status: newStatus.status, + media: newStatus.files, store: this.$store, inReplyToStatusId: this.replyTo }) - this.newStatus = { } + this.newStatus = { + status: '', + files: [] + } this.$emit('posted') + }, + addMediaFile (fileInfo) { + this.newStatus.files.push(fileInfo) } } } diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index d2106d5a..943bf422 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -10,7 +10,7 @@
- +
-- cgit v1.2.3-70-g09d2 From 521c81525147798e7de93f90c7fe1b312564fbe6 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 20:10:20 +0100 Subject: Add NavPanel. --- src/components/nav_panel/nav_panel.js | 4 +++ src/components/nav_panel/nav_panel.vue | 54 ++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 src/components/nav_panel/nav_panel.js create mode 100644 src/components/nav_panel/nav_panel.vue (limited to 'src') diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js new file mode 100644 index 00000000..318d30cc --- /dev/null +++ b/src/components/nav_panel/nav_panel.js @@ -0,0 +1,4 @@ +const NavPanel = { +} + +export default NavPanel diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue new file mode 100644 index 00000000..b535b092 --- /dev/null +++ b/src/components/nav_panel/nav_panel.vue @@ -0,0 +1,54 @@ + + + + + -- cgit v1.2.3-70-g09d2 From 7c2018108d8de90c17b09e980484495a1e90cc12 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 20:10:33 +0100 Subject: Remove fake public statuses. --- src/main.js | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/main.js b/src/main.js index 6ce2ca1b..f95d286f 100644 --- a/src/main.js +++ b/src/main.js @@ -34,9 +34,3 @@ new Vue({ template: '', components: { App } }) - -const statusesEx = require('../test/fixtures/statuses.json') - -setTimeout(() => { - store.commit('addNewStatuses', { statuses: statusesEx, timeline: 'public', showImmediately: false }) -}, 3000) -- cgit v1.2.3-70-g09d2 From 3bb2e91dbf740e77b25bc5256abfd7307a2bd04b Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 20:10:45 +0100 Subject: Return empty auth header when we don't have a user. --- src/services/api/api.service.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index c9fcc4f6..9538517d 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -14,7 +14,13 @@ const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload' // import { param, ajax } from 'jquery'; // import { merge } from 'lodash'; -const authHeaders = (user) => ({ 'Authorization': `Basic ${btoa(`${user.username}:${user.password}`)}` }) +const authHeaders = (user) => { + if (user) { + return { 'Authorization': `Basic ${btoa(`${user.username}:${user.password}`)}` } + } else { + return { } + } +} const fetchTimeline = ({timeline, credentials, since = false, until = false}) => { const timelineUrls = { -- cgit v1.2.3-70-g09d2 From c9e235f8898c4f1c4c1c2d5111ad34b1dd4ffa10 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 20:11:00 +0100 Subject: Load timeline once on creation. --- src/components/timeline/timeline.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 113455f4..e0c75d76 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -9,6 +9,17 @@ const Timeline = { components: { Status }, + created () { + const store = this.$store + const credentials = store.state.users.currentUser.credentials + + timelineFetcher.fetchAndUpdate({ + store, + credentials, + timeline: this.timelineName, + showImmediately: true + }) + }, methods: { showNewStatuses () { this.$store.commit('showNewStatuses', { timeline: this.timelineName }) -- cgit v1.2.3-70-g09d2 From 1ae5223742415d69d3b6ec9fd46d04c85d8f787b Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 20:11:23 +0100 Subject: Add NavPanel to app. --- src/App.js | 4 +++- src/App.scss | 21 --------------------- 2 files changed, 3 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/App.js b/src/App.js index 3c677566..c3e5164a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,9 +1,11 @@ import UserPanel from './components/user_panel/user_panel.vue' +import NavPanel from './components/nav_panel/nav_panel.vue' export default { name: 'app', components: { - UserPanel + UserPanel, + NavPanel }, computed: { user () { return this.$store.state.users.currentUser || {} }, diff --git a/src/App.scss b/src/App.scss index a4d87308..32e4a3eb 100644 --- a/src/App.scss +++ b/src/App.scss @@ -222,27 +222,6 @@ status.ng-enter.ng-enter-active { cursor: pointer; } -nav-panel ul { - list-style: none; - margin: 0; - padding: 0; -} - -nav-panel li { - border-bottom: 1px solid silver; - padding: 0.5em; - padding-left: 1em; -} - -nav-panel li:last-child { - border: none; -} - -nav-panel a { - display: block; - width: 100%; -} - .status-el p { margin: 0; margin-top: 0.2em; -- cgit v1.2.3-70-g09d2 From b6ac99fdf07a58efe331c82905c513ca7ceb75e1 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 20:26:07 +0100 Subject: Use history routing. --- config/index.js | 5 ----- index.html | 2 +- src/main.js | 5 ++++- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/config/index.js b/config/index.js index fdfac8b2..6652048c 100644 --- a/config/index.js +++ b/config/index.js @@ -26,11 +26,6 @@ module.exports = { target: 'https://social.heldscal.la/', changeOrigin: true, cookieDomainRewrite: 'localhost' - }, - '/main': { - target: 'https://social.heldscal.la/', - changeOrigin: true, - cookieDomainRewrite: 'localhost' } }, // CSS Sourcemaps off by default because relative paths are "buggy" diff --git a/index.html b/index.html index 713fe27c..93d9d6fd 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ Pleroma - +
diff --git a/src/main.js b/src/main.js index f95d286f..7f917128 100644 --- a/src/main.js +++ b/src/main.js @@ -24,7 +24,10 @@ const routes = [ { path: '/main/friends', component: FriendsTimeline } ] -const router = new VueRouter({routes}) +const router = new VueRouter({ + mode: 'history', + routes +}) /* eslint-disable no-new */ new Vue({ -- cgit v1.2.3-70-g09d2 From 7fcd36e2c19c29ce36086a85e59cc297d3474841 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 6 Nov 2016 20:45:26 +0100 Subject: Don't show actions when not logged in. --- src/components/status/status.js | 3 +++ src/components/status/status.vue | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/components/status/status.js b/src/components/status/status.js index 2e6565e8..6253d334 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -16,6 +16,9 @@ const Status = { } else { return this.statusoid } + }, + loggedIn () { + return !!this.$store.state.users.currentUser } }, components: { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 8361aa52..1c5dc458 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -32,7 +32,7 @@ -
+
diff --git a/src/components/public_and_external_timeline/public_and_external_timeline.js b/src/components/public_and_external_timeline/public_and_external_timeline.js new file mode 100644 index 00000000..138118ad --- /dev/null +++ b/src/components/public_and_external_timeline/public_and_external_timeline.js @@ -0,0 +1,11 @@ +import Timeline from '../timeline/timeline.vue' +const PublicAndExternalTimeline = { + components: { + Timeline + }, + computed: { + timeline () { return this.$store.state.statuses.timelines.publicAndExternal } + } +} + +export default PublicAndExternalTimeline diff --git a/src/components/public_and_external_timeline/public_and_external_timeline.vue b/src/components/public_and_external_timeline/public_and_external_timeline.vue new file mode 100644 index 00000000..94cdaf17 --- /dev/null +++ b/src/components/public_and_external_timeline/public_and_external_timeline.vue @@ -0,0 +1,10 @@ + + + diff --git a/src/main.js b/src/main.js index 7f917128..de3b2af1 100644 --- a/src/main.js +++ b/src/main.js @@ -3,6 +3,7 @@ import VueRouter from 'vue-router' import Vuex from 'vuex' import App from './App.vue' import PublicTimeline from './components/public_timeline/public_timeline.vue' +import PublicAndExternalTimeline from './components/public_and_external_timeline/public_and_external_timeline.vue' import FriendsTimeline from './components/friends_timeline/friends_timeline.vue' import statusesModule from './modules/statuses.js' @@ -19,7 +20,8 @@ const store = new Vuex.Store({ }) const routes = [ - { path: '/', redirect: '/main/public' }, + { path: '/', redirect: '/main/all' }, + { path: '/main/all', component: PublicAndExternalTimeline }, { path: '/main/public', component: PublicTimeline }, { path: '/main/friends', component: FriendsTimeline } ] diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 9538517d..06585ac7 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -26,7 +26,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false}) => const timelineUrls = { public: PUBLIC_TIMELINE_URL, friends: FRIENDS_TIMELINE_URL, - 'public-and-external': PUBLIC_AND_EXTERNAL_TIMELINE_URL + 'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL } let url = timelineUrls[timeline] -- cgit v1.2.3-70-g09d2