kopia lustrzana https://github.com/nextcloud/social
Add proper eslint settings
Signed-off-by: Julius Härtl <jus@bitgrid.net>pull/8/head
rodzic
a25b0bc69e
commit
f7ed53a5fb
68
.eslintrc.js
68
.eslintrc.js
|
@ -1,3 +1,67 @@
|
|||
module.exports = {
|
||||
"extends": "standard"
|
||||
};
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
es6: true,
|
||||
node: true,
|
||||
jest: true
|
||||
},
|
||||
globals: {
|
||||
t: true,
|
||||
n: true,
|
||||
OC: true,
|
||||
OCA: true,
|
||||
Vue: true,
|
||||
VueRouter: true
|
||||
},
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint',
|
||||
ecmaVersion: 6
|
||||
},
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:node/recommended',
|
||||
'plugin:vue/essential',
|
||||
'plugin:vue/recommended',
|
||||
'standard'
|
||||
],
|
||||
plugins: ['vue', 'node'],
|
||||
rules: {
|
||||
// space before function ()
|
||||
'space-before-function-paren': ['error', 'never'],
|
||||
// curly braces always space
|
||||
'object-curly-spacing': ['error', 'always'],
|
||||
// stay consistent with array brackets
|
||||
'array-bracket-newline': ['error', 'consistent'],
|
||||
// 1tbs brace style
|
||||
'brace-style': 'error',
|
||||
// tabs only
|
||||
indent: ['error', 'tab'],
|
||||
'no-tabs': 0,
|
||||
'vue/html-indent': ['error', 'tab'],
|
||||
// only debug console
|
||||
'no-console': ['error', { allow: ['error', 'warn', 'debug'] }],
|
||||
// classes blocks
|
||||
'padded-blocks': ['error', { classes: 'always' }],
|
||||
// always have the operator in front
|
||||
'operator-linebreak': ['error', 'before'],
|
||||
// ternary on multiline
|
||||
'multiline-ternary': ['error', 'always-multiline'],
|
||||
// es6 import/export and require
|
||||
'node/no-unpublished-require': ['off'],
|
||||
'node/no-unsupported-features/es-syntax': ['off'],
|
||||
// space before self-closing elements
|
||||
'vue/html-closing-bracket-spacing': 'error',
|
||||
// code spacing with attributes
|
||||
'vue/max-attributes-per-line': [
|
||||
'error',
|
||||
{
|
||||
singleline: 3,
|
||||
multiline: {
|
||||
max: 3,
|
||||
allowFirstLine: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
241
src/App.vue
241
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',
|
||||
},
|
||||
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
|
||||
},
|
||||
{
|
||||
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'),
|
||||
},
|
||||
];
|
||||
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>
|
||||
|
|
|
@ -21,20 +21,19 @@
|
|||
-->
|
||||
|
||||
<template>
|
||||
<div class="user-profile" v-if="uid && accountInfo">
|
||||
<div v-if="uid && accountInfo" class="user-profile">
|
||||
<div class="user-profile--info">
|
||||
<avatar :user="uid" :displayName="displayName" :size="128" />
|
||||
<avatar :user="uid" :display-name="displayName" :size="128" />
|
||||
<h2>{{ displayName }}</h2>
|
||||
<p>{{ accountInfo.cloudId }}</p>
|
||||
<p v-if="accountInfo.website">Website: <a :href="accountInfo.website.value">{{accountInfo.website.value}}</a></p>
|
||||
<p v-if="accountInfo.website">Website: <a :href="accountInfo.website.value">{{ accountInfo.website.value }}</a></p>
|
||||
|
||||
<button v-if="!serverData.public" class="primary" @click="follow">Follow this user</button>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="user-profile--sections">
|
||||
<li>
|
||||
<router-link to="./" class="icon-category-monitoring" >{{ accountInfo.posts }} posts</router-link>
|
||||
<router-link to="./" class="icon-category-monitoring">{{ accountInfo.posts }} posts</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link to="./following" class="icon-category-social">{{ accountInfo.following }} following</router-link>
|
||||
|
@ -81,32 +80,36 @@
|
|||
</style>
|
||||
<script>
|
||||
|
||||
import { Avatar } from 'nextcloud-vue'
|
||||
import { Avatar } from 'nextcloud-vue'
|
||||
|
||||
export default {
|
||||
name: 'ProfileInfo',
|
||||
props: ['uid'],
|
||||
components: {
|
||||
Avatar
|
||||
export default {
|
||||
name: 'ProfileInfo',
|
||||
components: {
|
||||
Avatar
|
||||
},
|
||||
props: {
|
||||
uid: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
displayName() {
|
||||
if (typeof this.accountInfo.displayname !== 'undefined') { return this.accountInfo.displayname.value || '' }
|
||||
return this.uid
|
||||
},
|
||||
methods: {
|
||||
follow() {
|
||||
console.log('TODO: implement following users');
|
||||
}
|
||||
serverData: function() {
|
||||
return this.$store.getters.getServerData
|
||||
},
|
||||
computed: {
|
||||
displayName() {
|
||||
if (typeof this.accountInfo.displayname !== 'undefined')
|
||||
return this.accountInfo.displayname.value || '';
|
||||
return this.uid;
|
||||
},
|
||||
serverData: function() {
|
||||
return this.$store.getters.getServerData;
|
||||
},
|
||||
accountInfo: function() {
|
||||
return this.$store.getters.getAccount(this.uid);
|
||||
}
|
||||
accountInfo: function() {
|
||||
return this.$store.getters.getAccount(this.uid)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
follow() {
|
||||
// TODO: implement following users
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
<span class="post-author-id">{{ item.authorId }}</span>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="post-message" v-html="formatedMessage">
|
||||
</div>
|
||||
<div class="post-message" v-html="formatedMessage" />
|
||||
</div>
|
||||
<div class="post-timestamp">{{ item.timestamp }}</div>
|
||||
</div>
|
||||
|
@ -20,27 +19,29 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { Avatar } from 'nextcloud-vue'
|
||||
import { Avatar } from 'nextcloud-vue'
|
||||
|
||||
export default {
|
||||
name: 'TimelineEntry',
|
||||
props: ['item'],
|
||||
components: {
|
||||
Avatar
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
export default {
|
||||
name: 'TimelineEntry',
|
||||
components: {
|
||||
Avatar
|
||||
},
|
||||
props: {
|
||||
item: { type: Object, default: () => {} }
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
formatedMessage: function() {
|
||||
let message = this.item.message;
|
||||
message = message.replace(/(?:\r\n|\r|\n)/g, '<br />');
|
||||
return message;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
formatedMessage: function() {
|
||||
let message = this.item.message
|
||||
message = message.replace(/(?:\r\n|\r|\n)/g, '<br />')
|
||||
return message
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.timeline-entry {
|
||||
|
|
12
src/main.js
12
src/main.js
|
@ -19,16 +19,16 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
import "@babel/polyfill";
|
||||
import '@babel/polyfill'
|
||||
|
||||
import Vue from 'vue'
|
||||
import {sync} from 'vuex-router-sync';
|
||||
import { sync } from 'vuex-router-sync'
|
||||
|
||||
import App from './App'
|
||||
import store from './store';
|
||||
import router from './router';
|
||||
import store from './store'
|
||||
import router from './router'
|
||||
|
||||
sync(store, router);
|
||||
sync(store, router)
|
||||
|
||||
// CSP config for webpack dynamic chunk loading
|
||||
// eslint-disable-next-line
|
||||
|
@ -48,5 +48,5 @@ Vue.prototype.OCA = OCA
|
|||
new Vue({
|
||||
router: router,
|
||||
render: h => h(App),
|
||||
store: store
|
||||
store: store
|
||||
}).$mount('#vue-content')
|
||||
|
|
|
@ -21,16 +21,16 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
import Vue from 'vue';
|
||||
import Router from 'vue-router';
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
|
||||
// Dynamic loading
|
||||
const Timeline = () => import('./views/Timeline');
|
||||
const Profile = () => import('./views/Profile');
|
||||
const ProfileTimeline = () => import('./views/ProfileTimeline');
|
||||
const ProfileFollowers = () => import('./views/ProfileFollowers');
|
||||
const Timeline = () => import('./views/Timeline')
|
||||
const Profile = () => import('./views/Profile')
|
||||
const ProfileTimeline = () => import('./views/ProfileTimeline')
|
||||
const ProfileFollowers = () => import('./views/ProfileFollowers')
|
||||
|
||||
Vue.use(Router);
|
||||
Vue.use(Router)
|
||||
|
||||
export default new Router({
|
||||
mode: 'history',
|
||||
|
@ -42,7 +42,7 @@ export default new Router({
|
|||
{
|
||||
path: '/:index(index.php/)?apps/social/',
|
||||
components: {
|
||||
default: Timeline,
|
||||
default: Timeline
|
||||
},
|
||||
props: true,
|
||||
name: 'timeline'
|
||||
|
@ -50,7 +50,7 @@ export default new Router({
|
|||
{
|
||||
path: '/:index(index.php/)?apps/social/account/:account',
|
||||
components: {
|
||||
default: Profile,
|
||||
default: Profile
|
||||
},
|
||||
props: true,
|
||||
name: 'profile',
|
||||
|
@ -58,22 +58,22 @@ export default new Router({
|
|||
{
|
||||
path: '',
|
||||
components: {
|
||||
details: ProfileTimeline,
|
||||
details: ProfileTimeline
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'followers',
|
||||
components: {
|
||||
default: Profile,
|
||||
details: ProfileFollowers,
|
||||
},
|
||||
details: ProfileFollowers
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'following',
|
||||
components: {
|
||||
default: Profile,
|
||||
details: ProfileFollowers,
|
||||
},
|
||||
details: ProfileFollowers
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -81,7 +81,7 @@ export default new Router({
|
|||
path: '/:index(index.php/)?apps/social/:account',
|
||||
component: Profile,
|
||||
props: true,
|
||||
name: 'public',
|
||||
name: 'public'
|
||||
}
|
||||
]
|
||||
});
|
||||
})
|
||||
|
|
|
@ -20,29 +20,28 @@
|
|||
*
|
||||
*/
|
||||
|
||||
import axios from 'nextcloud-axios';
|
||||
import Vue from 'vue';
|
||||
import axios from 'nextcloud-axios'
|
||||
import Vue from 'vue'
|
||||
|
||||
const state = {
|
||||
accounts: {}
|
||||
};
|
||||
}
|
||||
const mutations = {
|
||||
addAccount(state, {uid, data}) {
|
||||
Vue.set(state.accounts, uid, data);
|
||||
addAccount(state, { uid, data }) {
|
||||
Vue.set(state.accounts, uid, data)
|
||||
}
|
||||
};
|
||||
}
|
||||
const getters = {
|
||||
getAccount(state) {
|
||||
return (uid) => state.accounts[uid];
|
||||
return (uid) => state.accounts[uid]
|
||||
}
|
||||
};
|
||||
}
|
||||
const actions = {
|
||||
fetchAccountInfo(context, uid) {
|
||||
axios.get(OC.generateUrl('apps/social/local/account/' + uid)).then((response) => {
|
||||
console.log(response.data);
|
||||
context.commit('addAccount', {uid: uid, data:response.data});
|
||||
});
|
||||
context.commit('addAccount', { uid: uid, data: response.data })
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default {state, mutations, getters, actions};
|
||||
export default { state, mutations, getters, actions }
|
||||
|
|
|
@ -21,15 +21,15 @@
|
|||
*
|
||||
*/
|
||||
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import timeline from './timeline';
|
||||
import account from './account';
|
||||
import settings from './settings';
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import timeline from './timeline'
|
||||
import account from './account'
|
||||
import settings from './settings'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
const debug = process.env.NODE_ENV !== 'production'
|
||||
|
||||
export default new Vuex.Store({
|
||||
modules: {
|
||||
|
@ -37,5 +37,5 @@ export default new Vuex.Store({
|
|||
account,
|
||||
settings
|
||||
},
|
||||
strict: debug,
|
||||
});
|
||||
strict: debug
|
||||
})
|
||||
|
|
|
@ -22,17 +22,17 @@
|
|||
|
||||
const state = {
|
||||
serverData: {}
|
||||
};
|
||||
}
|
||||
const mutations = {
|
||||
setServerData(state, data) {
|
||||
state.serverData = data;
|
||||
state.serverData = data
|
||||
}
|
||||
};
|
||||
}
|
||||
const getters = {
|
||||
getServerData(state) {
|
||||
return state.serverData;
|
||||
return state.serverData
|
||||
}
|
||||
};
|
||||
const actions = {};
|
||||
}
|
||||
const actions = {}
|
||||
|
||||
export default {state, mutations, getters, actions};
|
||||
export default { state, mutations, getters, actions }
|
||||
|
|
|
@ -22,19 +22,19 @@
|
|||
|
||||
const state = {
|
||||
timeline: []
|
||||
};
|
||||
}
|
||||
const mutations = {
|
||||
addToTimeline(state, data) {
|
||||
for (let item in data) {
|
||||
state.timeline.push(data[item]);
|
||||
state.timeline.push(data[item])
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
const getters = {
|
||||
getTimeline(state) {
|
||||
return state.timeline;
|
||||
return state.timeline
|
||||
}
|
||||
};
|
||||
const actions = {};
|
||||
}
|
||||
const actions = {}
|
||||
|
||||
export default {state, mutations, getters, actions};
|
||||
export default { state, mutations, getters, actions }
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
<template>
|
||||
<div class="social__wrapper">
|
||||
<profile-info :uid="uid"></profile-info>
|
||||
<profile-info :uid="uid" />
|
||||
<div class="social__container">
|
||||
<router-view name="details"></router-view>
|
||||
<router-view name="details" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -106,48 +106,51 @@
|
|||
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
import {
|
||||
import {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
Multiselect,
|
||||
Avatar
|
||||
} from 'nextcloud-vue'
|
||||
import TimelineEntry from './../components/TimelineEntry'
|
||||
import ProfileInfo from './../components/ProfileInfo'
|
||||
|
||||
export default {
|
||||
name: 'Profile',
|
||||
components: {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
TimelineEntry,
|
||||
Multiselect,
|
||||
Avatar
|
||||
} from 'nextcloud-vue';
|
||||
import TimelineEntry from './../components/TimelineEntry';
|
||||
import ProfileInfo from './../components/ProfileInfo';
|
||||
|
||||
export default {
|
||||
name: 'Profile',
|
||||
components: {
|
||||
PopoverMenu, AppNavigation, TimelineEntry, Multiselect, Avatar,
|
||||
ProfileInfo
|
||||
},
|
||||
beforeMount() {
|
||||
this.uid = this.$route.params.account;
|
||||
this.$store.dispatch('fetchAccountInfo', this.uid);
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
state: [],
|
||||
uid: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
computed: {
|
||||
serverData: function() {
|
||||
return this.$store.getters.getServerData;
|
||||
},
|
||||
currentUser: function() {
|
||||
return OC.getCurrentUser();
|
||||
},
|
||||
socialId: function() {
|
||||
return '@' + OC.getCurrentUser().uid + '@' + OC.getHost();
|
||||
},
|
||||
timeline: function() {
|
||||
return this.$store.getters.getTimeline;
|
||||
}
|
||||
Avatar,
|
||||
ProfileInfo
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
state: [],
|
||||
uid: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
serverData: function() {
|
||||
return this.$store.getters.getServerData
|
||||
},
|
||||
currentUser: function() {
|
||||
return OC.getCurrentUser()
|
||||
},
|
||||
socialId: function() {
|
||||
return '@' + OC.getCurrentUser().uid + '@' + OC.getHost()
|
||||
},
|
||||
timeline: function() {
|
||||
return this.$store.getters.getTimeline
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
this.uid = this.$route.params.account
|
||||
this.$store.dispatch('fetchAccountInfo', this.uid)
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -35,19 +35,18 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
import TimelineEntry from './../components/TimelineEntry';
|
||||
import TimelineEntry from './../components/TimelineEntry'
|
||||
|
||||
export default {
|
||||
name: 'ProfileFollowers',
|
||||
components: {
|
||||
TimelineEntry,
|
||||
},
|
||||
computed: {
|
||||
timeline: function() {
|
||||
return this.$store.getters.getTimeline;
|
||||
}
|
||||
export default {
|
||||
name: 'ProfileFollowers',
|
||||
components: {
|
||||
TimelineEntry
|
||||
},
|
||||
computed: {
|
||||
timeline: function() {
|
||||
return this.$store.getters.getTimeline
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<template>
|
||||
<div class="social__timeline">
|
||||
<timeline-entry v-for="entry in timeline" :item="entry"></timeline-entry>
|
||||
<timeline-entry v-for="entry in timeline" :item="entry" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -33,19 +33,18 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
import TimelineEntry from './../components/TimelineEntry';
|
||||
import TimelineEntry from './../components/TimelineEntry'
|
||||
|
||||
export default {
|
||||
name: 'ProfileTimeline',
|
||||
components: {
|
||||
TimelineEntry,
|
||||
},
|
||||
computed: {
|
||||
timeline: function() {
|
||||
return this.$store.getters.getTimeline;
|
||||
}
|
||||
export default {
|
||||
name: 'ProfileTimeline',
|
||||
components: {
|
||||
TimelineEntry
|
||||
},
|
||||
computed: {
|
||||
timeline: function() {
|
||||
return this.$store.getters.getTimeline
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<div class="social__wrapper">
|
||||
<div class="social__container">
|
||||
<div class="social__welcome" v-if="!infoHidden">
|
||||
<a class="close icon-close" @click="hideInfo()" href="#"><span class="hidden-visually">Close</span></a>
|
||||
<div v-if="!infoHidden" class="social__welcome">
|
||||
<a class="close icon-close" href="#" @click="hideInfo()"><span class="hidden-visually">Close</span></a>
|
||||
<h3>🎉{{ t('social', 'Nextcloud becomes part of the federated social networks!') }}</h3>
|
||||
<p>
|
||||
{{ t('social', 'We have automatically created a social account for you. Your social id is the same as the federated cloud id:') }}
|
||||
|
@ -12,19 +12,20 @@
|
|||
<div class="social__timeline">
|
||||
<div class="new-post" data-id="">
|
||||
<div class="new-post-author">
|
||||
<avatar :user="currentUser.uid" :displayName="currentUser.displayName" :size="32" />
|
||||
<avatar :user="currentUser.uid" :display-name="currentUser.displayName" :size="32" />
|
||||
</div>
|
||||
<form class="new-post-form">
|
||||
<div class="author currentUser">
|
||||
{{ currentUser.displayName }}
|
||||
<span class="social-id">{{ socialId }}</span>
|
||||
</div>
|
||||
<div contenteditable="true" class="message" placeholder="Share a thought…"></div>
|
||||
<input class="submit icon-confirm has-tooltip" type="submit" value="" title="" data-original-title="Post">
|
||||
<div class="submitLoading icon-loading-small hidden"></div>
|
||||
<div contenteditable="true" class="message" placeholder="Share a thought…" />
|
||||
<input class="submit icon-confirm has-tooltip" type="submit" value=""
|
||||
title="" data-original-title="Post">
|
||||
<div class="submitLoading icon-loading-small hidden" />
|
||||
</form>
|
||||
</div>
|
||||
<timeline-entry v-for="entry in timeline" :item="entry"></timeline-entry>
|
||||
<timeline-entry v-for="entry in timeline" :item="entry" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -116,110 +117,108 @@
|
|||
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
import {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
Multiselect,
|
||||
Avatar
|
||||
} from 'nextcloud-vue';
|
||||
import TimelineEntry from './../components/TimelineEntry';
|
||||
import {
|
||||
PopoverMenu,
|
||||
AppNavigation,
|
||||
Multiselect,
|
||||
Avatar
|
||||
} from 'nextcloud-vue'
|
||||
import TimelineEntry from './../components/TimelineEntry'
|
||||
|
||||
export default {
|
||||
name: 'Timeline',
|
||||
components: {
|
||||
PopoverMenu, AppNavigation, TimelineEntry, Multiselect, Avatar
|
||||
export default {
|
||||
name: 'Timeline',
|
||||
components: {
|
||||
PopoverMenu, AppNavigation, TimelineEntry, Multiselect, Avatar
|
||||
},
|
||||
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() {
|
||||
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<20; i++) {
|
||||
let item = Object.assign({}, example);
|
||||
item.id = i;
|
||||
data.push(item);
|
||||
}
|
||||
console.log(data);
|
||||
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;
|
||||
},
|
||||
menu: function () {
|
||||
let defaultCategories = [
|
||||
{
|
||||
id: 'social-timeline',
|
||||
classes: [],
|
||||
href: '#',
|
||||
icon: 'icon-category-monitoring',
|
||||
text: t('social', 'Timeline'),
|
||||
menu: function() {
|
||||
let defaultCategories = [
|
||||
{
|
||||
id: 'social-timeline',
|
||||
classes: [],
|
||||
href: '#',
|
||||
icon: 'icon-category-monitoring',
|
||||
text: t('social', 'Timeline')
|
||||
},
|
||||
{
|
||||
id: 'social-account',
|
||||
classes: [],
|
||||
href: '#',
|
||||
icon: 'icon-category-user',
|
||||
text: t('social', 'Your account')
|
||||
},
|
||||
{
|
||||
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
|
||||
},
|
||||
{
|
||||
id: 'social-account',
|
||||
classes: [],
|
||||
href: '#',
|
||||
icon: 'icon-category-user',
|
||||
text: t('social', 'Your account'),
|
||||
},
|
||||
{
|
||||
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'),
|
||||
},
|
||||
];
|
||||
return {
|
||||
items: defaultCategories,
|
||||
loading: false
|
||||
text: t('social', 'Direct messages')
|
||||
}
|
||||
]
|
||||
return {
|
||||
items: defaultCategories,
|
||||
loading: false
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeMount: function() {
|
||||
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 < 20; i++) {
|
||||
let item = Object.assign({}, example)
|
||||
item.id = i
|
||||
data.push(item)
|
||||
}
|
||||
this.$store.commit('addToTimeline', data)
|
||||
},
|
||||
methods: {
|
||||
hideInfo() {
|
||||
this.infoHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Ładowanie…
Reference in New Issue