kopia lustrzana https://github.com/nextcloud/social
Clicking on an external post or announce opens the corresponding
post in another window Also, implements nextcloud-logger in TimelineEntry.vue Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>pull/730/head
rodzic
83d045e5fa
commit
9920fb13fe
src
components
|
@ -30,6 +30,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Logger from '../logger'
|
||||
import TimelinePost from './TimelinePost.vue'
|
||||
|
||||
export default {
|
||||
|
@ -95,12 +96,29 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
getSinglePostTimeline(e) {
|
||||
|
||||
// Do not call the single-post view when clicking on a link, a post attachment miniature or the post's author
|
||||
|
||||
Logger.debug('Clicked on post', { post: this.item })
|
||||
// Do not call the single-post view when clicking on a link, a post attachment miniature or the post's author
|
||||
if (e.target.tagName === 'A' || e.target.tagName === 'IMG' || e.target.className.startsWith('post-author')) {
|
||||
Logger.debug('will not call single-post', { event: e })
|
||||
return
|
||||
}
|
||||
|
||||
// Display external posts
|
||||
if (!this.item.local) {
|
||||
|
||||
if (this.item.type === 'Note') {
|
||||
window.open(this.item.id)
|
||||
} else if (this.item.type === 'Announce') {
|
||||
window.open(this.item.object)
|
||||
} else {
|
||||
Logger.warn("Don't know what to do with posts of type " + this.item.type, { post: this.item })
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Display internal posts
|
||||
this.$router.push({ name: 'single-post',
|
||||
params: {
|
||||
id: this.item.id,
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
*
|
||||
* @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { getLoggerBuilder } from 'nextcloud-logger'
|
||||
import { getCurrentUser } from 'nextcloud-auth'
|
||||
|
||||
export default getLoggerBuilder()
|
||||
.setApp('social')
|
||||
.setUid(getCurrentUser().uid)
|
||||
.build()
|
Ładowanie…
Reference in New Issue