summaryrefslogtreecommitdiffstats
path: root/src/App.vue
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-10-26 10:33:27 +0200
committerJulius Härtl <jus@bitgrid.net>2018-10-26 10:33:27 +0200
commitf7ed53a5fba82f80457677f32a972bb0bab7e32c (patch)
treefc33ae951edda30e5ffd6f8f0bf5ec80b2a49a83 /src/App.vue
parenta25b0bc69e8f346cdb1f567c46c01e99338291c3 (diff)
Add proper eslint settings
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/App.vue')
-rw-r--r--src/App.vue241
1 files changed, 122 insertions, 119 deletions
diff --git a/src/App.vue b/src/App.vue
index 805193f7..afb45277 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,10 +1,10 @@
<template>
<div class="app-social">
- <div id="app-navigation" v-if="!serverData.public">
- <app-navigation :menu="menu"></app-navigation>
+ <div v-if="!serverData.public" id="app-navigation">
+ <app-navigation :menu="menu" />
</div>
<div id="app-content">
- <router-view :key="$route.fullPath"></router-view>
+ <router-view :key="$route.fullPath" />
</div>
</div>
</template>
@@ -15,133 +15,136 @@
}
</style>
-
<script>
- import {
+import {
+ PopoverMenu,
+ AppNavigation,
+ Multiselect,
+ Avatar
+} from 'nextcloud-vue'
+import TimelineEntry from './components/TimelineEntry'
+import ProfileInfo from './components/ProfileInfo'
+
+export default {
+ name: 'App',
+ components: {
PopoverMenu,
AppNavigation,
+ TimelineEntry,
Multiselect,
- Avatar
- } from 'nextcloud-vue';
- import TimelineEntry from './components/TimelineEntry';
- import ProfileInfo from './components/ProfileInfo';
-
- export default {
- name: 'App',
- components: {
- PopoverMenu, AppNavigation, TimelineEntry, Multiselect, Avatar,
- ProfileInfo
+ Avatar,
+ ProfileInfo
+ },
+ data: function() {
+ return {
+ infoHidden: false,
+ state: []
+ }
+ },
+ computed: {
+ url: function() {
+ return OC.linkTo('social', 'img/nextcloud.png')
},
- data: function () {
- return {
- infoHidden: false,
- state: [],
- };
+ currentUser: function() {
+ return OC.getCurrentUser()
},
- beforeMount: function() {
- // 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));
- }
-
- 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 = [];
- for (let i=0; i<3; i++) {
- example.id = Math.floor((Math.random() * 100));
- data.push(example);
- }
- 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'
- })
- this.$store.commit('addToTimeline', data);
+ socialId: function() {
+ return '@' + OC.getCurrentUser().uid + '@' + OC.getHost()
},
- methods: {
- hideInfo() {
- this.infoHidden = true;
- }
+ timeline: function() {
+ return this.$store.getters.getTimeline
},
- computed: {
- url: function() {
- return OC.linkTo('social', 'img/nextcloud.png');
- },
- currentUser: function() {
- return OC.getCurrentUser();
- },
- socialId: function() {
- return '@' + OC.getCurrentUser().uid + '@' + OC.getHost();
- },
- timeline: function() {
- return this.$store.getters.getTimeline;
- },
- serverData: function() {
- return this.$store.getters.getServerData;
- },
- menu: function () {
- let defaultCategories = [
- {
- id: 'social-timeline',
- classes: [],
- icon: 'icon-category-monitoring',
- text: t('social', 'Timeline'),
- router: {
- name: 'timeline',
- },
- },
- {
- id: 'social-account',
- classes: [],
- icon: 'icon-user',
- text: t('social', 'Your account'),
- router: {
- name: 'profile',
- params: {account: this.currentUser.uid }
- },
- },
- {
- id: 'social-friends',
- classes: [],
- href: '#',
- icon: 'icon-category-social',
- text: t('social', 'Friends'),
- },
- {
- id: 'social-favorites',
- classes: [],
- href: '#',
- icon: 'icon-favorite',
- text: t('social', 'Favorites'),
- },
- {
- id: 'social-direct-messages',
- classes: [],
- href: '#',
- icon: 'icon-comment',
- utils: {
- counter: 3,
- },
- text: t('social', 'Direct messages'),
+ serverData: function() {
+ return this.$store.getters.getServerData
+ },
+ menu: function() {
+ let defaultCategories = [
+ {
+ id: 'social-timeline',
+ classes: [],
+ icon: 'icon-category-monitoring',
+ text: t('social', 'Timeline'),
+ router: {
+ name: 'timeline'
+ }
+ },
+ {
+ id: 'social-account',
+ classes: [],
+ icon: 'icon-user',
+ text: t('social', 'Your account'),
+ router: {
+ name: 'profile',
+ params: { account: this.currentUser.uid }
+ }
+ },
+ {
+ id: 'social-friends',
+ classes: [],
+ href: '#',
+ icon: 'icon-category-social',
+ text: t('social', 'Friends')
+ },
+ {
+ id: 'social-favorites',
+ classes: [],
+ href: '#',
+ icon: 'icon-favorite',
+ text: t('social', 'Favorites')
+ },
+ {
+ id: 'social-direct-messages',
+ classes: [],
+ href: '#',
+ icon: 'icon-comment',
+ utils: {
+ counter: 3
},
- ];
- return {
- items: defaultCategories,
- loading: false
+ text: t('social', 'Direct messages')
}
+ ]
+ return {
+ items: defaultCategories,
+ loading: false
}
}
+ },
+ beforeMount: function() {
+ // 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))
+ }
+
+ 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 = []
+ for (let i = 0; i < 3; i++) {
+ example.id = Math.floor((Math.random() * 100))
+ data.push(example)
+ }
+ 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'
+ })
+ this.$store.commit('addToTimeline', data)
+ },
+ methods: {
+ hideInfo() {
+ this.infoHidden = true
+ }
}
+}
</script>