slove-conflict

This commit is contained in:
Hakaba Hitoyo 2018-02-04 08:36:10 +09:00
commit 013f11497f
17 changed files with 1780 additions and 1594 deletions

View File

@ -24,13 +24,13 @@
"phoenix": "^1.3.0", "phoenix": "^1.3.0",
"sanitize-html": "^1.13.0", "sanitize-html": "^1.13.0",
"sass-loader": "^4.0.2", "sass-loader": "^4.0.2",
"vue": "^2.3.4", "vue": "^2.5.13",
"vue-chat-scroll": "^1.2.1", "vue-chat-scroll": "^1.2.1",
"vue-i18n": "^7.3.2", "vue-i18n": "^7.3.2",
"vue-router": "^2.5.3", "vue-router": "^3.0.1",
"vue-template-compiler": "^2.3.4", "vue-template-compiler": "^2.3.4",
"vue-timeago": "^3.1.2", "vue-timeago": "^3.1.2",
"vuex": "^2.3.1", "vuex": "^3.0.1",
"whatwg-fetch": "^2.0.3" "whatwg-fetch": "^2.0.3"
}, },
"devDependencies": { "devDependencies": {

View File

@ -26,7 +26,7 @@ export default {
logoStyle () { return { 'background-image': `url(${this.$store.state.config.logo})` } }, logoStyle () { return { 'background-image': `url(${this.$store.state.config.logo})` } },
style () { return { 'background-image': `url(${this.background})` } }, style () { return { 'background-image': `url(${this.background})` } },
sitename () { return this.$store.state.config.name }, sitename () { return this.$store.state.config.name },
chat () { return this.$store.state.chat.channel }, chat () { return this.$store.state.chat.channel.state === 'joined' },
showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel} showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel}
}, },
methods: { methods: {

View File

@ -1,5 +1,5 @@
const FavoriteButton = { const FavoriteButton = {
props: ['status'], props: ['status', 'loggedIn'],
data () { data () {
return { return {
animated: false animated: false

View File

@ -1,6 +1,10 @@
<template> <template>
<div> <div v-if="loggedIn">
<i :class='classes' class='favorite-button base09' @click.prevent='favorite()'/> <i :class='classes' class='favorite-button fav-active base09' @click.prevent='favorite()'/>
<span v-if='status.fave_num > 0'>{{status.fave_num}}</span>
</div>
<div v-else>
<i :class='classes' class='favorite-button base09'/>
<span v-if='status.fave_num > 0'>{{status.fave_num}}</span> <span v-if='status.fave_num > 0'>{{status.fave_num}}</span>
</div> </div>
</template> </template>
@ -8,7 +12,7 @@
<script src="./favorite_button.js" ></script> <script src="./favorite_button.js" ></script>
<style lang='scss'> <style lang='scss'>
.favorite-button { .fav-active {
cursor: pointer; cursor: pointer;
animation-duration: 0.6s; animation-duration: 0.6s;
&:hover { &:hover {

View File

@ -64,14 +64,15 @@ const PostStatusForm = {
img: profile_image_url_original img: profile_image_url_original
})) }))
} else if (firstchar === ':') { } else if (firstchar === ':') {
const matchedEmoji = filter(this.emoji, (emoji) => emoji.shortcode.match(this.textAtCaret.slice(1))) const matchedEmoji = filter(this.emoji.concat(this.customEmoji), (emoji) => emoji.shortcode.match(this.textAtCaret.slice(1)))
if (matchedEmoji.length <= 0) { if (matchedEmoji.length <= 0) {
return false return false
} }
return map(take(matchedEmoji, 5), ({shortcode, image_url}) => ({ return map(take(matchedEmoji, 5), ({shortcode, image_url, utf}) => ({
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
screen_name: `:${shortcode}:`, screen_name: `:${shortcode}:`,
name: '', name: '',
utf: utf || '',
img: image_url img: image_url
})) }))
} else { } else {
@ -90,6 +91,9 @@ const PostStatusForm = {
}, },
emoji () { emoji () {
return this.$store.state.config.emoji || [] return this.$store.state.config.emoji || []
},
customEmoji () {
return this.$store.state.config.customEmoji || []
} }
}, },
methods: { methods: {
@ -104,6 +108,7 @@ const PostStatusForm = {
}, },
postStatus (newStatus) { postStatus (newStatus) {
if (this.posting) { return } if (this.posting) { return }
if (this.submitDisabled) { return }
if (this.newStatus.status === '') { if (this.newStatus.status === '') {
if (this.newStatus.files.length > 0) { if (this.newStatus.files.length > 0) {

View File

@ -6,8 +6,9 @@
</div> </div>
<div style="position:relative;" v-if="candidates"> <div style="position:relative;" v-if="candidates">
<div class="autocomplete-panel base05-background"> <div class="autocomplete-panel base05-background">
<div v-for="candidate in candidates" @click="replace(candidate.screen_name + ' ')" class="autocomplete base02"> <div v-for="candidate in candidates" @click="replace(candidate.utf || (candidate.screen_name + ' '))" class="autocomplete base02">
<img :src="candidate.img"></img> <span v-if="candidate.img"><img :src="candidate.img"></img></span>
<span v-else>{{candidate.utf}}</span>
<span> <span>
{{candidate.screen_name}} {{candidate.screen_name}}
<small class="base02">{{candidate.name}}</small> <small class="base02">{{candidate.name}}</small>

View File

@ -1,5 +1,5 @@
const RetweetButton = { const RetweetButton = {
props: ['status'], props: ['status', 'loggedIn'],
data () { data () {
return { return {
animated: false animated: false

View File

@ -1,6 +1,10 @@
<template> <template>
<div> <div v-if="loggedIn">
<i :class='classes' class='icon-retweet base09' v-on:click.prevent='retweet()'></i> <i :class='classes' class='icon-retweet rt-active base09' v-on:click.prevent='retweet()'></i>
<span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span>
</div>
<div v-else>
<i :class='classes' class='icon-retweet base09'></i>
<span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span> <span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span>
</div> </div>
</template> </template>
@ -9,7 +13,7 @@
<style lang='scss'> <style lang='scss'>
@import '../../_variables.scss'; @import '../../_variables.scss';
.icon-retweet { .rt-active {
cursor: pointer; cursor: pointer;
animation-duration: 0.6s; animation-duration: 0.6s;
&:hover { &:hover {

View File

@ -8,8 +8,8 @@
<i class="base09 icon-reply" :class="{'icon-reply-active': replying}"></i> <i class="base09 icon-reply" :class="{'icon-reply-active': replying}"></i>
</a> </a>
</div> </div>
<retweet-button :status=status></retweet-button> <retweet-button :loggedIn="loggedIn" :status=status></retweet-button>
<favorite-button :status=status></favorite-button> <favorite-button :loggedIn="loggedIn" :status=status></favorite-button>
</div> </div>
</div> </div>
<post-status-form class="reply-body" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" v-on:posted="toggleReplying" v-if="replying"/> <post-status-form class="reply-body" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" v-on:posted="toggleReplying" v-if="replying"/>
@ -105,17 +105,15 @@
</div> </div>
</div> </div>
<div v-if="loggedIn"> <div class='status-actions'>
<div class='status-actions'> <div v-if="loggedIn">
<div> <a href="#" v-on:click.prevent="toggleReplying">
<a href="#" v-on:click.prevent="toggleReplying"> <i class="base09 icon-reply" :class="{'icon-reply-active': replying}"></i>
<i class="base09 icon-reply" :class="{'icon-reply-active': replying}"></i> </a>
</a>
</div>
<retweet-button :status=status></retweet-button>
<favorite-button :status=status></favorite-button>
<delete-button :status=status></delete-button>
</div> </div>
<retweet-button :loggedIn="loggedIn" :status=status></retweet-button>
<favorite-button :loggedIn="loggedIn" :status=status></favorite-button>
<delete-button :status=status></delete-button>
</div> </div>
</div> </div>
</div> </div>
@ -248,6 +246,7 @@
img, video { img, video {
max-width: 100%; max-width: 100%;
max-height: 400px; max-height: 400px;
vertical-align: middle;
object-fit: contain; object-fit: contain;
} }

View File

@ -22,6 +22,11 @@ export default {
isOtherUser () { isOtherUser () {
return this.user.id !== this.$store.state.users.currentUser.id return this.user.id !== this.$store.state.users.currentUser.id
}, },
subscribeUrl () {
// eslint-disable-next-line no-undef
const serverUrl = new URL(this.user.statusnet_profile_url)
return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`
},
loggedIn () { loggedIn () {
return this.$store.state.users.currentUser return this.$store.state.users.currentUser
}, },

View File

@ -46,6 +46,15 @@
</button> </button>
</span> </span>
</div> </div>
<div class="remote-follow" v-if='!loggedIn && user.is_local'>
<form method="POST" :action='subscribeUrl'>
<input type="hidden" name="nickname" :value="user.screen_name">
<input type="hidden" name="profile" value="">
<button click="submit" class="remote-button base05 base02-background">
{{ $t('user_card.remote_follow') }}
</button>
</form>
</div>
<div class='block' v-if='isOtherUser && loggedIn'> <div class='block' v-if='isOtherUser && loggedIn'>
<span v-if='user.statusnet_blocking'> <span v-if='user.statusnet_blocking'>
<button @click="unblockUser" class="base04 base00-background pressed"> <button @click="unblockUser" class="base04 base00-background pressed">
@ -182,6 +191,11 @@
min-height: 28px; min-height: 28px;
} }
.remote-follow {
max-width: 220px;
min-height: 28px;
}
.follow { .follow {
max-width: 220px; max-width: 220px;
min-height: 28px; min-height: 28px;
@ -191,6 +205,12 @@
width: 92%; width: 92%;
height: 100%; height: 100%;
} }
.remote-button {
height: 28px !important;
width: 92%;
}
.pressed { .pressed {
border-bottom-color: rgba(255, 255, 255, 0.2); border-bottom-color: rgba(255, 255, 255, 0.2);
border-top-color: rgba(0, 0, 0, 0.2); border-top-color: rgba(0, 0, 0, 0.2);

View File

@ -7,7 +7,7 @@
<div class="setting-item"> <div class="setting-item">
<h3>{{$t('settings.name_bio')}}</h3> <h3>{{$t('settings.name_bio')}}</h3>
<p>{{$t('settings.name')}}</p> <p>{{$t('settings.name')}}</p>
<input class='name-changer base03-border' id='username' v-model="newname" :value="user.screen_name"></input> <input class='name-changer base03-border' id='username' v-model="newname"></input>
<p>{{$t('settings.bio')}}</p> <p>{{$t('settings.bio')}}</p>
<textarea class="bio base03-border" v-model="newbio"></textarea> <textarea class="bio base03-border" v-model="newbio"></textarea>
<button :disabled='newname.length <= 0' class="btn btn-default base05 base02-background" @click="updateProfile">{{$t('general.submit')}}</button> <button :disabled='newname.length <= 0' class="btn btn-default base05 base02-background" @click="updateProfile">{{$t('general.submit')}}</button>

View File

@ -208,7 +208,8 @@ const en = {
muted: 'Muted', muted: 'Muted',
followers: 'Followers', followers: 'Followers',
followees: 'Following', followees: 'Following',
per_day: 'per day' per_day: 'per day',
remote_follow: 'Remote follow'
}, },
timeline: { timeline: {
show_new: 'Show new', show_new: 'Show new',
@ -922,7 +923,11 @@ const es = {
} }
const pt = { const pt = {
chat: {
title: 'Chat'
},
nav: { nav: {
chat: 'Chat Local',
timeline: 'Linha do tempo', timeline: 'Linha do tempo',
mentions: 'Menções', mentions: 'Menções',
public_tl: 'Linha do tempo pública', public_tl: 'Linha do tempo pública',
@ -963,6 +968,12 @@ const pt = {
set_new_profile_background: 'Mudar o plano de fundo de perfil', set_new_profile_background: 'Mudar o plano de fundo de perfil',
settings: 'Configurações', settings: 'Configurações',
theme: 'Tema', theme: 'Tema',
presets: 'Predefinições',
theme_help: 'Use cores em códigos hexadecimais (#aabbcc) para personalizar seu esquema de cores.',
background: 'Plano de Fundo',
foreground: 'Primeiro Plano',
text: 'Texto',
links: 'Links',
filtering: 'Filtragem', filtering: 'Filtragem',
filtering_explanation: 'Todas as postagens contendo estas palavras serão silenciadas, uma por linha.', filtering_explanation: 'Todas as postagens contendo estas palavras serão silenciadas, uma por linha.',
attachments: 'Anexos', attachments: 'Anexos',
@ -970,7 +981,12 @@ const pt = {
hide_attachments_in_convo: 'Ocultar anexos em conversas', hide_attachments_in_convo: 'Ocultar anexos em conversas',
nsfw_clickthrough: 'Habilitar clique para ocultar anexos NSFW', nsfw_clickthrough: 'Habilitar clique para ocultar anexos NSFW',
autoload: 'Habilitar carregamento automático quando a rolagem chegar ao fim.', autoload: 'Habilitar carregamento automático quando a rolagem chegar ao fim.',
reply_link_preview: 'Habilitar a pré-visualização de link de respostas ao passar o mouse.' streaming: 'Habilitar o fluxo automático de postagens quando ao topo da página',
reply_link_preview: 'Habilitar a pré-visualização de link de respostas ao passar o mouse.',
follow_import: 'Importar seguidas',
import_followers_from_a_csv_file: 'Importe os perfis que tu segues apartir de um arquivo CSV',
follows_imported: 'Seguidas importadas! O processamento das mesmas pode demorar um pouco.',
follow_import_error: 'Erro ao importar seguidas'
}, },
notifications: { notifications: {
notifications: 'Notificações', notifications: 'Notificações',
@ -1000,7 +1016,8 @@ const pt = {
error_fetching_user: 'Erro procurando usuário' error_fetching_user: 'Erro procurando usuário'
}, },
general: { general: {
submit: 'Enviar' submit: 'Enviar',
apply: 'Aplicar'
} }
} }

View File

@ -138,7 +138,7 @@ window.fetch('/api/pleroma/emoji.json')
const emoji = Object.keys(values).map((key) => { const emoji = Object.keys(values).map((key) => {
return { shortcode: key, image_url: values[key] } return { shortcode: key, image_url: values[key] }
}) })
store.dispatch('setOption', { name: 'emoji', value: emoji }) store.dispatch('setOption', { name: 'customEmoji', value: emoji })
store.dispatch('setOption', { name: 'pleromaBackend', value: true }) store.dispatch('setOption', { name: 'pleromaBackend', value: true })
}, },
(failure) => { (failure) => {
@ -148,9 +148,19 @@ window.fetch('/api/pleroma/emoji.json')
(error) => console.log(error) (error) => console.log(error)
) )
window.fetch('/static/emoji.json')
.then((res) => res.json())
.then((values) => {
const emoji = Object.keys(values).map((key) => {
return { shortcode: key, image_url: false, 'utf': values[key] }
})
store.dispatch('setOption', { name: 'emoji', value: emoji })
})
window.fetch('/instance/panel.html') window.fetch('/instance/panel.html')
.then((res) => res.text()) .then((res) => res.text())
.then((html) => { .then((html) => {
store.dispatch('setOption', { name: 'instanceSpecificPanelContent', value: html }) store.dispatch('setOption', { name: 'instanceSpecificPanelContent', value: html })
}) })

View File

@ -1,7 +1,7 @@
const chat = { const chat = {
state: { state: {
messages: [], messages: [],
channel: null channel: {state: ''}
}, },
mutations: { mutations: {
setChannel (state, channel) { setChannel (state, channel) {

1
static/emoji.json Normal file

File diff suppressed because one or more lines are too long

3240
yarn.lock

File diff suppressed because it is too large Load Diff