2018-08-26 09:35:53 +00:00
|
|
|
|
<template>
|
2018-10-23 13:38:03 +00:00
|
|
|
|
<div class="app-social">
|
|
|
|
|
<div id="app-navigation" v-if="!serverData.public">
|
2018-10-10 07:11:37 +00:00
|
|
|
|
<app-navigation :menu="menu"></app-navigation>
|
2018-08-26 09:35:53 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div id="app-content">
|
2018-10-23 13:38:03 +00:00
|
|
|
|
<router-view :key="$route.fullPath"></router-view>
|
2018-08-26 09:35:53 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2018-10-10 07:11:37 +00:00
|
|
|
|
<style scoped>
|
2018-10-23 13:38:03 +00:00
|
|
|
|
.app-social {
|
2018-10-10 07:11:37 +00:00
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
2018-08-26 09:35:53 +00:00
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
PopoverMenu,
|
2018-10-23 13:38:03 +00:00
|
|
|
|
AppNavigation,
|
|
|
|
|
Multiselect,
|
|
|
|
|
Avatar
|
2018-10-01 15:32:51 +00:00
|
|
|
|
} from 'nextcloud-vue';
|
2018-10-10 07:11:37 +00:00
|
|
|
|
import TimelineEntry from './components/TimelineEntry';
|
2018-10-23 13:38:03 +00:00
|
|
|
|
import ProfileInfo from './components/ProfileInfo';
|
2018-08-26 09:35:53 +00:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'App',
|
|
|
|
|
components: {
|
2018-10-23 13:38:03 +00:00
|
|
|
|
PopoverMenu, AppNavigation, TimelineEntry, Multiselect, Avatar,
|
|
|
|
|
ProfileInfo
|
2018-08-26 09:35:53 +00:00
|
|
|
|
},
|
|
|
|
|
data: function () {
|
|
|
|
|
return {
|
2018-10-10 10:20:42 +00:00
|
|
|
|
infoHidden: false,
|
2018-10-23 13:38:03 +00:00
|
|
|
|
state: [],
|
2018-08-26 09:35:53 +00:00
|
|
|
|
};
|
|
|
|
|
},
|
2018-10-10 07:46:26 +00:00
|
|
|
|
beforeMount: function() {
|
2018-10-23 13:38:03 +00:00
|
|
|
|
// importing server data into the store
|
|
|
|
|
const serverDataElmt = document.getElementById('serverData');
|
|
|
|
|
if (serverDataElmt !== null) {
|
|
|
|
|
this.$store.commit('setServerData', JSON.parse(document.getElementById('serverData').dataset.server));
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-10 07:46:26 +00:00
|
|
|
|
let example = {
|
|
|
|
|
message: 'Want to #DropDropbox? #DeleteGoogle? #decentralize? We got you covered, easy as a piece of 🥞\n' +
|
|
|
|
|
'\n' +
|
|
|
|
|
'Get started right now: https://nextcloud.com/signup',
|
|
|
|
|
author: 'Nextcloud 📱☁️💻',
|
|
|
|
|
authorId: '@nextcloud@mastodon.xyz',
|
|
|
|
|
authorAvatar: OC.linkTo('social', 'img/nextcloud.png'),
|
|
|
|
|
timestamp: '1 day ago'
|
|
|
|
|
};
|
|
|
|
|
let data = [];
|
2018-10-23 13:38:03 +00:00
|
|
|
|
for (let i=0; i<3; i++) {
|
2018-10-10 07:46:26 +00:00
|
|
|
|
example.id = Math.floor((Math.random() * 100));
|
|
|
|
|
data.push(example);
|
|
|
|
|
}
|
2018-10-23 13:38:03 +00:00
|
|
|
|
data.push({
|
|
|
|
|
message: 'Want to #DropDropbox? #DeleteGoogle? #decentralize? We got you covered, easy as a piece of 🥞\n' +
|
|
|
|
|
'\n' +
|
|
|
|
|
'Get started right now: https://nextcloud.com/signup',
|
|
|
|
|
author: 'Admin☁️💻',
|
|
|
|
|
authorId: 'admin',
|
|
|
|
|
authorAvatar: OC.linkTo('social', 'img/nextcloud.png'),
|
|
|
|
|
timestamp: '1 day ago'
|
|
|
|
|
})
|
2018-10-10 07:46:26 +00:00
|
|
|
|
this.$store.commit('addToTimeline', data);
|
|
|
|
|
},
|
2018-10-10 10:20:42 +00:00
|
|
|
|
methods: {
|
|
|
|
|
hideInfo() {
|
|
|
|
|
this.infoHidden = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
2018-08-26 09:35:53 +00:00
|
|
|
|
computed: {
|
2018-10-23 13:38:03 +00:00
|
|
|
|
url: function() {
|
|
|
|
|
return OC.linkTo('social', 'img/nextcloud.png');
|
|
|
|
|
},
|
2018-10-10 10:20:42 +00:00
|
|
|
|
currentUser: function() {
|
|
|
|
|
return OC.getCurrentUser();
|
|
|
|
|
},
|
2018-10-10 07:11:37 +00:00
|
|
|
|
socialId: function() {
|
|
|
|
|
return '@' + OC.getCurrentUser().uid + '@' + OC.getHost();
|
|
|
|
|
},
|
|
|
|
|
timeline: function() {
|
2018-10-10 07:46:26 +00:00
|
|
|
|
return this.$store.getters.getTimeline;
|
2018-10-10 07:11:37 +00:00
|
|
|
|
},
|
2018-10-23 13:38:03 +00:00
|
|
|
|
serverData: function() {
|
|
|
|
|
return this.$store.getters.getServerData;
|
|
|
|
|
},
|
2018-08-26 09:35:53 +00:00
|
|
|
|
menu: function () {
|
|
|
|
|
let defaultCategories = [
|
|
|
|
|
{
|
2018-09-05 11:00:10 +00:00
|
|
|
|
id: 'social-timeline',
|
2018-08-26 09:35:53 +00:00
|
|
|
|
classes: [],
|
2018-09-05 11:00:10 +00:00
|
|
|
|
icon: 'icon-category-monitoring',
|
|
|
|
|
text: t('social', 'Timeline'),
|
2018-10-23 13:38:03 +00:00
|
|
|
|
router: {
|
|
|
|
|
name: 'timeline',
|
|
|
|
|
},
|
2018-08-26 09:35:53 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
2018-10-23 13:38:03 +00:00
|
|
|
|
id: 'social-account',
|
2018-09-05 11:00:10 +00:00
|
|
|
|
classes: [],
|
|
|
|
|
icon: 'icon-user',
|
2018-10-23 13:38:03 +00:00
|
|
|
|
text: t('social', 'Your account'),
|
|
|
|
|
router: {
|
|
|
|
|
name: 'profile',
|
|
|
|
|
params: {account: this.currentUser.uid }
|
|
|
|
|
},
|
2018-09-05 11:00:10 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'social-friends',
|
|
|
|
|
classes: [],
|
|
|
|
|
href: '#',
|
|
|
|
|
icon: 'icon-category-social',
|
|
|
|
|
text: t('social', 'Friends'),
|
2018-08-26 09:35:53 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
2018-09-05 11:00:10 +00:00
|
|
|
|
id: 'social-favorites',
|
2018-08-26 09:35:53 +00:00
|
|
|
|
classes: [],
|
|
|
|
|
href: '#',
|
2018-09-05 11:00:10 +00:00
|
|
|
|
icon: 'icon-favorite',
|
|
|
|
|
text: t('social', 'Favorites'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'social-direct-messages',
|
|
|
|
|
classes: [],
|
|
|
|
|
href: '#',
|
|
|
|
|
icon: 'icon-comment',
|
2018-08-26 09:35:53 +00:00
|
|
|
|
utils: {
|
2018-09-05 11:00:10 +00:00
|
|
|
|
counter: 3,
|
2018-08-26 09:35:53 +00:00
|
|
|
|
},
|
2018-09-05 11:00:10 +00:00
|
|
|
|
text: t('social', 'Direct messages'),
|
2018-08-26 09:35:53 +00:00
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
return {
|
|
|
|
|
items: defaultCategories,
|
|
|
|
|
loading: false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|