bd745543b6
* upstream/develop: (176 commits) fix chrome Prevent html-minifier to remove placeholder comment in index.html template Add placeholder to insert server generated metatags. Related to #430 added condition to check for logined user fix gradients and minor artifacts keep track of new instance options fix old MR oof get rid of slots fix timeago font added hide_network option, fixed properties naming Fix fetching new users, add storing local users in usersObjects with their screen_name as well as id, so that they could be fetched zero-state with screen-name link. improve notification subscription Fix typo that prevented scope copy from working. Refactor arrays to individual options Reset enableFollowsExport to true after 2 sec when an export file is available to download added check for activatePanel is function or not addressed PR comments activate panel on user screen click added not preload check so hidden toggles asap ...
91 lines
3.0 KiB
JavaScript
91 lines
3.0 KiB
JavaScript
import UserPanel from './components/user_panel/user_panel.vue'
|
|
import NavPanel from './components/nav_panel/nav_panel.vue'
|
|
import Notifications from './components/notifications/notifications.vue'
|
|
import UserFinder from './components/user_finder/user_finder.vue'
|
|
import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
|
|
import FeaturesPanel from './components/features_panel/features_panel.vue'
|
|
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
|
|
import ChatPanel from './components/chat_panel/chat_panel.vue'
|
|
|
|
export default {
|
|
name: 'app',
|
|
components: {
|
|
UserPanel,
|
|
NavPanel,
|
|
Notifications,
|
|
UserFinder,
|
|
InstanceSpecificPanel,
|
|
FeaturesPanel,
|
|
WhoToFollowPanel,
|
|
ChatPanel
|
|
},
|
|
data: () => ({
|
|
mobileActivePanel: 'timeline',
|
|
finderHidden: true,
|
|
supportsMask: window.CSS && window.CSS.supports && (
|
|
window.CSS.supports('mask-size', 'contain') ||
|
|
window.CSS.supports('-webkit-mask-size', 'contain') ||
|
|
window.CSS.supports('-moz-mask-size', 'contain') ||
|
|
window.CSS.supports('-ms-mask-size', 'contain') ||
|
|
window.CSS.supports('-o-mask-size', 'contain')
|
|
)
|
|
}),
|
|
created () {
|
|
// Load the locale from the storage
|
|
this.$i18n.locale = this.$store.state.config.interfaceLanguage
|
|
},
|
|
computed: {
|
|
currentUser () { return this.$store.state.users.currentUser },
|
|
background () {
|
|
return this.currentUser.background_image || this.$store.state.instance.background
|
|
},
|
|
enableMask () { return this.supportsMask && this.$store.state.instance.logoMask },
|
|
logoStyle () {
|
|
return {
|
|
'visibility': this.enableMask ? 'hidden' : 'visible'
|
|
}
|
|
},
|
|
logoMaskStyle () {
|
|
return this.enableMask ? {
|
|
'mask-image': `url(${this.$store.state.instance.logo})`
|
|
} : {
|
|
'background-color': this.enableMask ? '' : 'transparent'
|
|
}
|
|
},
|
|
logoBgStyle () {
|
|
return Object.assign({
|
|
'margin': `${this.$store.state.instance.logoMargin} 0`,
|
|
opacity: this.finderHidden ? 1 : 0
|
|
}, this.enableMask ? {} : {
|
|
'background-color': this.enableMask ? '' : 'transparent'
|
|
})
|
|
},
|
|
logo () { return this.$store.state.instance.logo },
|
|
style () {
|
|
return {
|
|
'--body-background-image': `url(${this.background})`,
|
|
'background-image': `url(${this.background})`
|
|
}
|
|
},
|
|
sitename () { return this.$store.state.instance.name },
|
|
chat () { return this.$store.state.chat.channel.state === 'joined' },
|
|
suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },
|
|
showInstanceSpecificPanel () { return this.$store.state.instance.showInstanceSpecificPanel }
|
|
},
|
|
methods: {
|
|
activatePanel (panelName) {
|
|
this.mobileActivePanel = panelName
|
|
},
|
|
scrollToTop () {
|
|
window.scrollTo(0, 0)
|
|
},
|
|
logout () {
|
|
this.$router.replace('/main/public')
|
|
this.$store.dispatch('logout')
|
|
},
|
|
onFinderToggled (hidden) {
|
|
this.finderHidden = hidden
|
|
}
|
|
}
|
|
}
|