Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9df81d1939 | ||
![]() |
3be0079868 | ||
![]() |
9b253ccb3a | ||
![]() |
dded76099c | ||
![]() |
41a7ec7d3d | ||
![]() |
168c773ba0 | ||
![]() |
9abed92196 | ||
![]() |
4a75e3602a | ||
![]() |
1a689f6641 | ||
![]() |
9535759787 | ||
![]() |
f8fc31f14a | ||
![]() |
b74bf97761 | ||
![]() |
a090b908bd | ||
![]() |
b9290a021b | ||
![]() |
129ce93868 | ||
![]() |
5f41e5d6d0 | ||
![]() |
c706d030ea | ||
![]() |
34716a34f8 |
@@ -34,7 +34,7 @@ common:
|
|||||||
paragraph4: "Pour terminer la personnalisation, cliquez sur \"Terminer\" dans le coin supérieur droit."
|
paragraph4: "Pour terminer la personnalisation, cliquez sur \"Terminer\" dans le coin supérieur droit."
|
||||||
gotit: "Compris !"
|
gotit: "Compris !"
|
||||||
notification:
|
notification:
|
||||||
file-uploaded: "Le fichier a été téléversé !"
|
file-uploaded: "Le fichier a été transféré !"
|
||||||
message-from: "Message de {} :"
|
message-from: "Message de {} :"
|
||||||
reversi-invited: "Invité à jouer"
|
reversi-invited: "Invité à jouer"
|
||||||
reversi-invited-by: "Invité par {} :"
|
reversi-invited-by: "Invité par {} :"
|
||||||
@@ -136,7 +136,7 @@ common:
|
|||||||
memo: "Pense-bête"
|
memo: "Pense-bête"
|
||||||
trends: "Tendances"
|
trends: "Tendances"
|
||||||
photo-stream: "Flux de photos"
|
photo-stream: "Flux de photos"
|
||||||
posts-monitor: "Graphe des publications"
|
posts-monitor: "Graph des publications"
|
||||||
slideshow: "Diaporama"
|
slideshow: "Diaporama"
|
||||||
version: "Version"
|
version: "Version"
|
||||||
broadcast: "Diffusion"
|
broadcast: "Diffusion"
|
||||||
@@ -434,7 +434,7 @@ common/views/widgets/photo-stream.vue:
|
|||||||
title: "Flux de photos"
|
title: "Flux de photos"
|
||||||
no-photos: "Pas de photo"
|
no-photos: "Pas de photo"
|
||||||
common/views/widgets/posts-monitor.vue:
|
common/views/widgets/posts-monitor.vue:
|
||||||
title: "Graphe des publications"
|
title: "Graph des publications"
|
||||||
toggle: "Basculer entre les vues"
|
toggle: "Basculer entre les vues"
|
||||||
common/views/widgets/hashtags.vue:
|
common/views/widgets/hashtags.vue:
|
||||||
title: "Hashtags"
|
title: "Hashtags"
|
||||||
@@ -582,7 +582,7 @@ desktop/views/components/drive.vue:
|
|||||||
unable-to-process: "L'opération n'a pas pu être complétée"
|
unable-to-process: "L'opération n'a pas pu être complétée"
|
||||||
circular-reference-detected: "Le dossier de destination est un sous-dossier du dossier que vous souhaitez déplacer."
|
circular-reference-detected: "Le dossier de destination est un sous-dossier du dossier que vous souhaitez déplacer."
|
||||||
unhandled-error: "Erreur inconnue"
|
unhandled-error: "Erreur inconnue"
|
||||||
url-upload: "Uploader d'un URL"
|
url-upload: "Téléverser via une URL"
|
||||||
url-of-file: "URL de l'image que vous souhaitez uploader."
|
url-of-file: "URL de l'image que vous souhaitez uploader."
|
||||||
url-upload-requested: "Upload requested"
|
url-upload-requested: "Upload requested"
|
||||||
may-take-time: "L'upload de votre fichier peut prendre un certain temps."
|
may-take-time: "L'upload de votre fichier peut prendre un certain temps."
|
||||||
@@ -590,8 +590,8 @@ desktop/views/components/drive.vue:
|
|||||||
folder-name: "Nom du dossier"
|
folder-name: "Nom du dossier"
|
||||||
contextmenu:
|
contextmenu:
|
||||||
create-folder: "Créer un dossier"
|
create-folder: "Créer un dossier"
|
||||||
upload: "Uploader un fichier"
|
upload: "Transférer un fichier"
|
||||||
url-upload: "Uploader d'un URL"
|
url-upload: "Transférer à partir d’une URL"
|
||||||
desktop/views/components/media-image.vue:
|
desktop/views/components/media-image.vue:
|
||||||
sensitive: "Le contenu est NSFW"
|
sensitive: "Le contenu est NSFW"
|
||||||
click-to-show: "Cliquer pour afficher"
|
click-to-show: "Cliquer pour afficher"
|
||||||
@@ -658,21 +658,21 @@ desktop/views/components/post-form.vue:
|
|||||||
add-visible-user: "+Ajouter un utilisateur"
|
add-visible-user: "+Ajouter un utilisateur"
|
||||||
attach-location-information: "Attacher des informations de localisation"
|
attach-location-information: "Attacher des informations de localisation"
|
||||||
hide-contents: "Masquer les contenus"
|
hide-contents: "Masquer les contenus"
|
||||||
reply-placeholder: "Répondre à cette note"
|
reply-placeholder: "Répondre à cette note …"
|
||||||
quote-placeholder: "Citer cette note"
|
quote-placeholder: "Citer cette note …"
|
||||||
submit: "Poster"
|
submit: "Publier"
|
||||||
reply: "Répondre"
|
reply: "Répondre"
|
||||||
renote: "Republier"
|
renote: "Republier"
|
||||||
posted: "Posté!"
|
posted: "Publié !"
|
||||||
replied: "Répondu!"
|
replied: "Répondu !"
|
||||||
reposted: "Reposté!"
|
reposted: "Reposté !"
|
||||||
note-failed: "La note à échoué"
|
note-failed: "La note à échoué"
|
||||||
reply-failed: "La réponse à échoué"
|
reply-failed: "La réponse à échoué"
|
||||||
renote-failed: "La renote à échoué"
|
renote-failed: "Échec lors de la republication"
|
||||||
posting: "Publication..."
|
posting: "Publication …"
|
||||||
attach-media-from-local: "Joindre un media depuis votre PC"
|
attach-media-from-local: "Joindre un média depuis votre appareil"
|
||||||
attach-media-from-drive: "Joindre un media depuis votre Drive"
|
attach-media-from-drive: "Joindre un média depuis votre Drive"
|
||||||
attach-cancel: "Annuler la jointure de fichier"
|
attach-cancel: "Annuler le fichier attaché"
|
||||||
insert-a-kao: "v('ω')v"
|
insert-a-kao: "v('ω')v"
|
||||||
create-poll: "Créer un sondage"
|
create-poll: "Créer un sondage"
|
||||||
text-remain: "{} charactères restants"
|
text-remain: "{} charactères restants"
|
||||||
@@ -687,15 +687,15 @@ desktop/views/components/post-form-window.vue:
|
|||||||
note: "Nouvelle note"
|
note: "Nouvelle note"
|
||||||
reply: "Répondre"
|
reply: "Répondre"
|
||||||
attaches: "{} media joint(s)"
|
attaches: "{} media joint(s)"
|
||||||
uploading-media: "Upload du media {}"
|
uploading-media: "Transfert du média {}"
|
||||||
desktop/views/components/progress-dialog.vue:
|
desktop/views/components/progress-dialog.vue:
|
||||||
waiting: "En attente"
|
waiting: "En attente"
|
||||||
desktop/views/components/renote-form.vue:
|
desktop/views/components/renote-form.vue:
|
||||||
quote: "Citer..."
|
quote: "Citer..."
|
||||||
cancel: "Annuler"
|
cancel: "Annuler"
|
||||||
renote: "Republier"
|
renote: "Republier"
|
||||||
reposting: "Repost en cours..."
|
reposting: "Republication en cours …"
|
||||||
success: "Reposté!"
|
success: "Republié !"
|
||||||
failure: "La renote a échoué"
|
failure: "La renote a échoué"
|
||||||
desktop/views/components/renote-form-window.vue:
|
desktop/views/components/renote-form-window.vue:
|
||||||
title: "Êtes vous sûr de vouloir renote cette note?"
|
title: "Êtes vous sûr de vouloir renote cette note?"
|
||||||
@@ -878,7 +878,7 @@ desktop/views/components/ui.header.nav.vue:
|
|||||||
desktop/views/components/ui.header.notifications.vue:
|
desktop/views/components/ui.header.notifications.vue:
|
||||||
title: "Notifications"
|
title: "Notifications"
|
||||||
desktop/views/components/ui.header.post.vue:
|
desktop/views/components/ui.header.post.vue:
|
||||||
post: "Composer un nouveau post"
|
post: "Rédiger une nouvelle publication"
|
||||||
desktop/views/components/ui.header.search.vue:
|
desktop/views/components/ui.header.search.vue:
|
||||||
placeholder: "Chercher"
|
placeholder: "Chercher"
|
||||||
desktop/views/components/received-follow-requests-window.vue:
|
desktop/views/components/received-follow-requests-window.vue:
|
||||||
@@ -969,7 +969,7 @@ desktop/views/pages/selectdrive.vue:
|
|||||||
title: "Choisir fichier(s)"
|
title: "Choisir fichier(s)"
|
||||||
ok: "OK"
|
ok: "OK"
|
||||||
cancel: "Annuler"
|
cancel: "Annuler"
|
||||||
upload: "Uploader un ou plusieurs fichier(s) depuis votre PC"
|
upload: "Téléverser des fichiers à partir de votre ordinateur"
|
||||||
desktop/views/pages/search.vue:
|
desktop/views/pages/search.vue:
|
||||||
not-available: "La fonction de recherche est désactivée dans les paramètres de l’instance."
|
not-available: "La fonction de recherche est désactivée dans les paramètres de l’instance."
|
||||||
not-found: "Aucun message trouvé pour '{}'"
|
not-found: "Aucun message trouvé pour '{}'"
|
||||||
@@ -1029,8 +1029,8 @@ desktop/views/widgets/polls.vue:
|
|||||||
refresh: "Afficher d'autres"
|
refresh: "Afficher d'autres"
|
||||||
nothing: "Rien"
|
nothing: "Rien"
|
||||||
desktop/views/widgets/post-form.vue:
|
desktop/views/widgets/post-form.vue:
|
||||||
title: "Post"
|
title: "Publication"
|
||||||
note: "Post"
|
note: "Publication"
|
||||||
desktop/views/widgets/profile.vue:
|
desktop/views/widgets/profile.vue:
|
||||||
update-banner: "Cliquer pour éditer votre bannière"
|
update-banner: "Cliquer pour éditer votre bannière"
|
||||||
update-avatar: "Cliquer pour éditer votre avatar"
|
update-avatar: "Cliquer pour éditer votre avatar"
|
||||||
@@ -1092,7 +1092,7 @@ mobile/views/components/friends-maker.vue:
|
|||||||
refresh: "Voir plus"
|
refresh: "Voir plus"
|
||||||
close: "Fermer"
|
close: "Fermer"
|
||||||
mobile/views/components/note.vue:
|
mobile/views/components/note.vue:
|
||||||
reposted-by: "Renoté par {}"
|
reposted-by: "Republié par {}"
|
||||||
private: "cette publication est privée"
|
private: "cette publication est privée"
|
||||||
deleted: "cette publication a été supprimée"
|
deleted: "cette publication a été supprimée"
|
||||||
location: "Géolocalisation"
|
location: "Géolocalisation"
|
||||||
@@ -1119,7 +1119,7 @@ mobile/views/components/notifications.vue:
|
|||||||
empty: "Pas de notifications"
|
empty: "Pas de notifications"
|
||||||
mobile/views/components/post-form.vue:
|
mobile/views/components/post-form.vue:
|
||||||
add-visible-user: "Ajouter un utilisateur"
|
add-visible-user: "Ajouter un utilisateur"
|
||||||
submit: "Poster"
|
submit: "Publier"
|
||||||
reply: "Répondre"
|
reply: "Répondre"
|
||||||
renote: "Republier"
|
renote: "Republier"
|
||||||
quote-placeholder: "Citer ce billet ... (Facultatif)"
|
quote-placeholder: "Citer ce billet ... (Facultatif)"
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"author": "syuilo <i@syuilo.com>",
|
"author": "syuilo <i@syuilo.com>",
|
||||||
"version": "10.9.1",
|
"version": "10.10.0",
|
||||||
"clientVersion": "1.0.10448",
|
"clientVersion": "1.0.10466",
|
||||||
"codename": "nighthike",
|
"codename": "nighthike",
|
||||||
"main": "./built/index.js",
|
"main": "./built/index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
161
src/client/app/common/scripts/note-mixin.ts
Normal file
161
src/client/app/common/scripts/note-mixin.ts
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
import parse from '../../../../mfm/parse';
|
||||||
|
import { sum } from '../../../../prelude/array';
|
||||||
|
import MkNoteMenu from '..//views/components/note-menu.vue';
|
||||||
|
import MkReactionPicker from '../views/components/reaction-picker.vue';
|
||||||
|
|
||||||
|
function focus(el, fn) {
|
||||||
|
const target = fn(el);
|
||||||
|
if (target) {
|
||||||
|
if (target.hasAttribute('tabindex')) {
|
||||||
|
target.focus();
|
||||||
|
} else {
|
||||||
|
focus(target, fn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type Opts = {
|
||||||
|
mobile?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (opts: Opts = {}) => ({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showContent: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
keymap(): any {
|
||||||
|
return {
|
||||||
|
'r|left': () => this.reply(true),
|
||||||
|
'e|a|plus': () => this.react(true),
|
||||||
|
'q|right': () => this.renote(true),
|
||||||
|
'ctrl+q|ctrl+right': this.renoteDirectly,
|
||||||
|
'up|k|shift+tab': this.focusBefore,
|
||||||
|
'down|j|tab': this.focusAfter,
|
||||||
|
'esc': this.blur,
|
||||||
|
'm|o': () => this.menu(true),
|
||||||
|
's': this.toggleShowContent,
|
||||||
|
'1': () => this.reactDirectly('like'),
|
||||||
|
'2': () => this.reactDirectly('love'),
|
||||||
|
'3': () => this.reactDirectly('laugh'),
|
||||||
|
'4': () => this.reactDirectly('hmm'),
|
||||||
|
'5': () => this.reactDirectly('surprise'),
|
||||||
|
'6': () => this.reactDirectly('congrats'),
|
||||||
|
'7': () => this.reactDirectly('angry'),
|
||||||
|
'8': () => this.reactDirectly('confused'),
|
||||||
|
'9': () => this.reactDirectly('rip'),
|
||||||
|
'0': () => this.reactDirectly('pudding'),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
isRenote(): boolean {
|
||||||
|
return (this.note.renote &&
|
||||||
|
this.note.text == null &&
|
||||||
|
this.note.fileIds.length == 0 &&
|
||||||
|
this.note.poll == null);
|
||||||
|
},
|
||||||
|
|
||||||
|
appearNote(): any {
|
||||||
|
return this.isRenote ? this.note.renote : this.note;
|
||||||
|
},
|
||||||
|
|
||||||
|
reactionsCount(): number {
|
||||||
|
return this.appearNote.reactionCounts
|
||||||
|
? sum(Object.values(this.appearNote.reactionCounts))
|
||||||
|
: 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
title(): string {
|
||||||
|
return new Date(this.appearNote.createdAt).toLocaleString();
|
||||||
|
},
|
||||||
|
|
||||||
|
urls(): string[] {
|
||||||
|
if (this.appearNote.text) {
|
||||||
|
const ast = parse(this.appearNote.text);
|
||||||
|
return ast
|
||||||
|
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
|
||||||
|
.map(t => t.url);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
reply(viaKeyboard = false) {
|
||||||
|
(this as any).apis.post({
|
||||||
|
reply: this.appearNote,
|
||||||
|
animation: !viaKeyboard,
|
||||||
|
cb: () => {
|
||||||
|
this.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
renote(viaKeyboard = false) {
|
||||||
|
(this as any).apis.post({
|
||||||
|
renote: this.appearNote,
|
||||||
|
animation: !viaKeyboard,
|
||||||
|
cb: () => {
|
||||||
|
this.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
renoteDirectly() {
|
||||||
|
(this as any).api('notes/create', {
|
||||||
|
renoteId: this.appearNote.id
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
react(viaKeyboard = false) {
|
||||||
|
this.blur();
|
||||||
|
(this as any).os.new(MkReactionPicker, {
|
||||||
|
source: this.$refs.reactButton,
|
||||||
|
note: this.appearNote,
|
||||||
|
showFocus: viaKeyboard,
|
||||||
|
animation: !viaKeyboard,
|
||||||
|
compact: opts.mobile,
|
||||||
|
big: opts.mobile
|
||||||
|
}).$once('closed', this.focus);
|
||||||
|
},
|
||||||
|
|
||||||
|
reactDirectly(reaction) {
|
||||||
|
(this as any).api('notes/reactions/create', {
|
||||||
|
noteId: this.appearNote.id,
|
||||||
|
reaction: reaction
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
menu(viaKeyboard = false) {
|
||||||
|
(this as any).os.new(MkNoteMenu, {
|
||||||
|
source: this.$refs.menuButton,
|
||||||
|
note: this.appearNote,
|
||||||
|
animation: !viaKeyboard,
|
||||||
|
compact: opts.mobile,
|
||||||
|
}).$once('closed', this.focus);
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleShowContent() {
|
||||||
|
this.showContent = !this.showContent;
|
||||||
|
},
|
||||||
|
|
||||||
|
focus() {
|
||||||
|
this.$el.focus();
|
||||||
|
},
|
||||||
|
|
||||||
|
blur() {
|
||||||
|
this.$el.blur();
|
||||||
|
},
|
||||||
|
|
||||||
|
focusBefore() {
|
||||||
|
focus(this.$el, e => e.previousElementSibling);
|
||||||
|
},
|
||||||
|
|
||||||
|
focusAfter() {
|
||||||
|
focus(this.$el, e => e.nextElementSibling);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
@@ -6,13 +6,17 @@ export default (os: OS) => opts => {
|
|||||||
const o = opts || {};
|
const o = opts || {};
|
||||||
if (o.renote) {
|
if (o.renote) {
|
||||||
const vm = os.new(RenoteFormWindow, {
|
const vm = os.new(RenoteFormWindow, {
|
||||||
note: o.renote
|
note: o.renote,
|
||||||
|
animation: o.animation == null ? true : o.animation
|
||||||
});
|
});
|
||||||
|
if (opts.cb) vm.$once('closed', opts.cb);
|
||||||
document.body.appendChild(vm.$el);
|
document.body.appendChild(vm.$el);
|
||||||
} else {
|
} else {
|
||||||
const vm = os.new(PostFormWindow, {
|
const vm = os.new(PostFormWindow, {
|
||||||
reply: o.reply
|
reply: o.reply,
|
||||||
|
animation: o.animation == null ? true : o.animation
|
||||||
});
|
});
|
||||||
|
if (opts.cb) vm.$once('closed', opts.cb);
|
||||||
document.body.appendChild(vm.$el);
|
document.body.appendChild(vm.$el);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="note" tabindex="-1" v-hotkey="keymap" :title="title">
|
<div class="note" v-show="appearNote.deletedAt == null" :tabindex="appearNote.deletedAt == null ? '-1' : null" v-hotkey="keymap" :title="title">
|
||||||
<div class="reply-to" v-if="p.reply && (!$store.getters.isSignedIn || $store.state.settings.showReplyTarget)">
|
<div class="reply-to" v-if="appearNote.reply && (!$store.getters.isSignedIn || $store.state.settings.showReplyTarget)">
|
||||||
<x-sub :note="p.reply"/>
|
<x-sub :note="appearNote.reply"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="renote" v-if="isRenote">
|
<div class="renote" v-if="isRenote">
|
||||||
<mk-avatar class="avatar" :user="note.user"/>
|
<mk-avatar class="avatar" :user="note.user"/>
|
||||||
@@ -12,228 +12,76 @@
|
|||||||
<mk-time :time="note.createdAt"/>
|
<mk-time :time="note.createdAt"/>
|
||||||
</div>
|
</div>
|
||||||
<article>
|
<article>
|
||||||
<mk-avatar class="avatar" :user="p.user"/>
|
<mk-avatar class="avatar" :user="appearNote.user"/>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<mk-note-header class="header" :note="p"/>
|
<mk-note-header class="header" :note="appearNote"/>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p v-if="p.cw != null" class="cw">
|
<p v-if="appearNote.cw != null" class="cw">
|
||||||
<span class="text" v-if="p.cw != ''">{{ p.cw }}</span>
|
<span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span>
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="p.cw == null || showContent">
|
<div class="content" v-show="appearNote.cw == null || showContent">
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<span v-if="p.isHidden" style="opacity: 0.5">%i18n:@private%</span>
|
<span v-if="appearNote.isHidden" style="opacity: 0.5">%i18n:@private%</span>
|
||||||
<span v-if="p.deletedAt" style="opacity: 0.5">%i18n:@deleted%</span>
|
<a class="reply" v-if="appearNote.reply">%fa:reply%</a>
|
||||||
<a class="reply" v-if="p.reply">%fa:reply%</a>
|
<misskey-flavored-markdown v-if="appearNote.text" :text="appearNote.text" :i="$store.state.i" :class="$style.text"/>
|
||||||
<misskey-flavored-markdown v-if="p.text" :text="p.text" :i="$store.state.i" :class="$style.text"/>
|
<a class="rp" v-if="appearNote.renote">RP:</a>
|
||||||
<a class="rp" v-if="p.renote">RP:</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="files" v-if="p.files.length > 0">
|
<div class="files" v-if="appearNote.files.length > 0">
|
||||||
<mk-media-list :media-list="p.files"/>
|
<mk-media-list :media-list="appearNote.files"/>
|
||||||
</div>
|
</div>
|
||||||
<mk-poll v-if="p.poll" :note="p" ref="pollViewer"/>
|
<mk-poll v-if="appearNote.poll" :note="appearNote" ref="pollViewer"/>
|
||||||
<a class="location" v-if="p.geo" :href="`https://maps.google.com/maps?q=${p.geo.coordinates[1]},${p.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% 位置情報</a>
|
<a class="location" v-if="appearNote.geo" :href="`https://maps.google.com/maps?q=${appearNote.geo.coordinates[1]},${appearNote.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% 位置情報</a>
|
||||||
<div class="map" v-if="p.geo" ref="map"></div>
|
<div class="renote" v-if="appearNote.renote"><mk-note-preview :note="appearNote.renote"/></div>
|
||||||
<div class="renote" v-if="p.renote"><mk-note-preview :note="p.renote"/></div>
|
|
||||||
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer v-if="p.deletedAt == null">
|
<footer v-if="appearNote.deletedAt == null">
|
||||||
<mk-reactions-viewer :note="p" ref="reactionsViewer"/>
|
<mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/>
|
||||||
<button class="replyButton" @click="reply()" title="%i18n:@reply%">
|
<button class="replyButton" @click="reply()" title="%i18n:@reply%">
|
||||||
<template v-if="p.reply">%fa:reply-all%</template>
|
<template v-if="appearNote.reply">%fa:reply-all%</template>
|
||||||
<template v-else>%fa:reply%</template>
|
<template v-else>%fa:reply%</template>
|
||||||
<p class="count" v-if="p.repliesCount > 0">{{ p.repliesCount }}</p>
|
<p class="count" v-if="appearNote.repliesCount > 0">{{ appearNote.repliesCount }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button class="renoteButton" @click="renote()" title="%i18n:@renote%">
|
<button class="renoteButton" @click="renote()" title="%i18n:@renote%">
|
||||||
%fa:retweet%<p class="count" v-if="p.renoteCount > 0">{{ p.renoteCount }}</p>
|
%fa:retweet%<p class="count" v-if="appearNote.renoteCount > 0">{{ appearNote.renoteCount }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button class="reactionButton" :class="{ reacted: p.myReaction != null }" @click="react()" ref="reactButton" title="%i18n:@add-reaction%">
|
<button class="reactionButton" :class="{ reacted: appearNote.myReaction != null }" @click="react()" ref="reactButton" title="%i18n:@add-reaction%">
|
||||||
%fa:plus%<p class="count" v-if="p.reactions_count > 0">{{ p.reactions_count }}</p>
|
%fa:plus%<p class="count" v-if="appearNote.reactions_count > 0">{{ appearNote.reactions_count }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button @click="menu()" ref="menuButton">
|
<button @click="menu()" ref="menuButton">
|
||||||
%fa:ellipsis-h%
|
%fa:ellipsis-h%
|
||||||
</button>
|
</button>
|
||||||
<!-- <button title="%i18n:@detail">
|
|
||||||
<template v-if="!isDetailOpened">%fa:caret-down%</template>
|
|
||||||
<template v-if="isDetailOpened">%fa:caret-up%</template>
|
|
||||||
</button> -->
|
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<div class="detail" v-if="isDetailOpened">
|
|
||||||
<mk-note-status-graph width="462" height="130" :note="p"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import parse from '../../../../../mfm/parse';
|
|
||||||
|
|
||||||
import MkPostFormWindow from './post-form-window.vue';
|
import MkPostFormWindow from './post-form-window.vue';
|
||||||
import MkRenoteFormWindow from './renote-form-window.vue';
|
import MkRenoteFormWindow from './renote-form-window.vue';
|
||||||
import MkNoteMenu from '../../../common/views/components/note-menu.vue';
|
|
||||||
import MkReactionPicker from '../../../common/views/components/reaction-picker.vue';
|
|
||||||
import XSub from './notes.note.sub.vue';
|
import XSub from './notes.note.sub.vue';
|
||||||
import { sum } from '../../../../../prelude/array';
|
import noteMixin from '../../../common/scripts/note-mixin';
|
||||||
import noteSubscriber from '../../../common/scripts/note-subscriber';
|
import noteSubscriber from '../../../common/scripts/note-subscriber';
|
||||||
|
|
||||||
function focus(el, fn) {
|
|
||||||
const target = fn(el);
|
|
||||||
if (target) {
|
|
||||||
if (target.hasAttribute('tabindex')) {
|
|
||||||
target.focus();
|
|
||||||
} else {
|
|
||||||
focus(target, fn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
components: {
|
components: {
|
||||||
XSub
|
XSub
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [noteSubscriber('note')],
|
mixins: [
|
||||||
|
noteMixin(),
|
||||||
|
noteSubscriber('note')
|
||||||
|
],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
note: {
|
note: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
showContent: false,
|
|
||||||
isDetailOpened: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
keymap(): any {
|
|
||||||
return {
|
|
||||||
'r|left': () => this.reply(true),
|
|
||||||
'e|a|plus': () => this.react(true),
|
|
||||||
'q|right': () => this.renote(true),
|
|
||||||
'ctrl+q|ctrl+right': this.renoteDirectly,
|
|
||||||
'up|k|shift+tab': this.focusBefore,
|
|
||||||
'down|j|tab': this.focusAfter,
|
|
||||||
'esc': this.blur,
|
|
||||||
'm|o': () => this.menu(true),
|
|
||||||
's': this.toggleShowContent,
|
|
||||||
'1': () => this.reactDirectly('like'),
|
|
||||||
'2': () => this.reactDirectly('love'),
|
|
||||||
'3': () => this.reactDirectly('laugh'),
|
|
||||||
'4': () => this.reactDirectly('hmm'),
|
|
||||||
'5': () => this.reactDirectly('surprise'),
|
|
||||||
'6': () => this.reactDirectly('congrats'),
|
|
||||||
'7': () => this.reactDirectly('angry'),
|
|
||||||
'8': () => this.reactDirectly('confused'),
|
|
||||||
'9': () => this.reactDirectly('rip'),
|
|
||||||
'0': () => this.reactDirectly('pudding'),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
isRenote(): boolean {
|
|
||||||
return (this.note.renote &&
|
|
||||||
this.note.text == null &&
|
|
||||||
this.note.fileIds.length == 0 &&
|
|
||||||
this.note.poll == null);
|
|
||||||
},
|
|
||||||
|
|
||||||
p(): any {
|
|
||||||
return this.isRenote ? this.note.renote : this.note;
|
|
||||||
},
|
|
||||||
|
|
||||||
reactionsCount(): number {
|
|
||||||
return this.p.reactionCounts
|
|
||||||
? sum(Object.values(this.p.reactionCounts))
|
|
||||||
: 0;
|
|
||||||
},
|
|
||||||
|
|
||||||
title(): string {
|
|
||||||
return new Date(this.p.createdAt).toLocaleString();
|
|
||||||
},
|
|
||||||
|
|
||||||
urls(): string[] {
|
|
||||||
if (this.p.text) {
|
|
||||||
const ast = parse(this.p.text);
|
|
||||||
return ast
|
|
||||||
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
|
|
||||||
.map(t => t.url);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
reply(viaKeyboard = false) {
|
|
||||||
(this as any).os.new(MkPostFormWindow, {
|
|
||||||
reply: this.p,
|
|
||||||
animation: !viaKeyboard
|
|
||||||
}).$once('closed', this.focus);
|
|
||||||
},
|
|
||||||
|
|
||||||
renote(viaKeyboard = false) {
|
|
||||||
(this as any).os.new(MkRenoteFormWindow, {
|
|
||||||
note: this.p,
|
|
||||||
animation: !viaKeyboard
|
|
||||||
}).$once('closed', this.focus);
|
|
||||||
},
|
|
||||||
|
|
||||||
renoteDirectly() {
|
|
||||||
(this as any).api('notes/create', {
|
|
||||||
renoteId: this.p.id
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
react(viaKeyboard = false) {
|
|
||||||
this.blur();
|
|
||||||
(this as any).os.new(MkReactionPicker, {
|
|
||||||
source: this.$refs.reactButton,
|
|
||||||
note: this.p,
|
|
||||||
showFocus: viaKeyboard,
|
|
||||||
animation: !viaKeyboard
|
|
||||||
}).$once('closed', this.focus);
|
|
||||||
},
|
|
||||||
|
|
||||||
reactDirectly(reaction) {
|
|
||||||
(this as any).api('notes/reactions/create', {
|
|
||||||
noteId: this.p.id,
|
|
||||||
reaction: reaction
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
menu(viaKeyboard = false) {
|
|
||||||
(this as any).os.new(MkNoteMenu, {
|
|
||||||
source: this.$refs.menuButton,
|
|
||||||
note: this.p,
|
|
||||||
animation: !viaKeyboard
|
|
||||||
}).$once('closed', this.focus);
|
|
||||||
},
|
|
||||||
|
|
||||||
toggleShowContent() {
|
|
||||||
this.showContent = !this.showContent;
|
|
||||||
},
|
|
||||||
|
|
||||||
focus() {
|
|
||||||
this.$el.focus();
|
|
||||||
},
|
|
||||||
|
|
||||||
blur() {
|
|
||||||
this.$el.blur();
|
|
||||||
},
|
|
||||||
|
|
||||||
focusBefore() {
|
|
||||||
focus(this.$el, e => e.previousElementSibling);
|
|
||||||
},
|
|
||||||
|
|
||||||
focusAfter() {
|
|
||||||
focus(this.$el, e => e.nextElementSibling);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -445,10 +293,6 @@ export default Vue.extend({
|
|||||||
&.reacted, &.reacted:hover
|
&.reacted, &.reacted:hover
|
||||||
color var(--noteActionsReactionHover)
|
color var(--noteActionsReactionHover)
|
||||||
|
|
||||||
> .detail
|
|
||||||
padding-top 4px
|
|
||||||
background rgba(#000, 0.0125)
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="stylus" module>
|
<style lang="stylus" module>
|
||||||
|
@@ -310,7 +310,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> header
|
> header
|
||||||
display flex
|
display flex
|
||||||
z-index 1
|
z-index 2
|
||||||
line-height $header-height
|
line-height $header-height
|
||||||
padding 0 16px
|
padding 0 16px
|
||||||
font-size 14px
|
font-size 14px
|
||||||
|
@@ -1,7 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="!mediaView" class="zyjjkidcqjnlegkqebitfviomuqmseqk" :class="{ renote: isRenote }">
|
<div
|
||||||
<div class="reply-to" v-if="p.reply && (!$store.getters.isSignedIn || $store.state.settings.showReplyTarget)">
|
v-if="!mediaView"
|
||||||
<x-sub :note="p.reply"/>
|
v-show="appearNote.deletedAt == null"
|
||||||
|
:tabindex="appearNote.deletedAt == null ? '-1' : null"
|
||||||
|
class="zyjjkidcqjnlegkqebitfviomuqmseqk"
|
||||||
|
:class="{ renote: isRenote }"
|
||||||
|
v-hotkey="keymap"
|
||||||
|
:title="title"
|
||||||
|
>
|
||||||
|
<div class="reply-to" v-if="appearNote.reply && (!$store.getters.isSignedIn || $store.state.settings.showReplyTarget)">
|
||||||
|
<x-sub :note="appearNote.reply"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="renote" v-if="isRenote">
|
<div class="renote" v-if="isRenote">
|
||||||
<mk-avatar class="avatar" :user="note.user"/>
|
<mk-avatar class="avatar" :user="note.user"/>
|
||||||
@@ -12,43 +20,42 @@
|
|||||||
<mk-time :time="note.createdAt"/>
|
<mk-time :time="note.createdAt"/>
|
||||||
</div>
|
</div>
|
||||||
<article>
|
<article>
|
||||||
<mk-avatar class="avatar" :user="p.user"/>
|
<mk-avatar class="avatar" :user="appearNote.user"/>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<mk-note-header class="header" :note="p" :mini="true"/>
|
<mk-note-header class="header" :note="appearNote" :mini="true"/>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p v-if="p.cw != null" class="cw">
|
<p v-if="appearNote.cw != null" class="cw">
|
||||||
<span class="text" v-if="p.cw != ''">{{ p.cw }}</span>
|
<span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span>
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="p.cw == null || showContent">
|
<div class="content" v-show="appearNote.cw == null || showContent">
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<span v-if="p.isHidden" style="opacity: 0.5">(%i18n:@private%)</span>
|
<span v-if="appearNote.isHidden" style="opacity: 0.5">(%i18n:@private%)</span>
|
||||||
<span v-if="p.deletedAt" style="opacity: 0.5">(%i18n:@deleted%)</span>
|
<a class="reply" v-if="appearNote.reply">%fa:reply%</a>
|
||||||
<a class="reply" v-if="p.reply">%fa:reply%</a>
|
<misskey-flavored-markdown v-if="appearNote.text" :text="appearNote.text" :i="$store.state.i"/>
|
||||||
<misskey-flavored-markdown v-if="p.text" :text="p.text" :i="$store.state.i"/>
|
<a class="rp" v-if="appearNote.renote != null">RP:</a>
|
||||||
<a class="rp" v-if="p.renote != null">RP:</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="files" v-if="p.files.length > 0">
|
<div class="files" v-if="appearNote.files.length > 0">
|
||||||
<mk-media-list :media-list="p.files"/>
|
<mk-media-list :media-list="appearNote.files"/>
|
||||||
</div>
|
</div>
|
||||||
<mk-poll v-if="p.poll" :note="p" ref="pollViewer"/>
|
<mk-poll v-if="appearNote.poll" :note="appearNote" ref="pollViewer"/>
|
||||||
<a class="location" v-if="p.geo" :href="`https://maps.google.com/maps?q=${p.geo.coordinates[1]},${p.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% %i18n:@location%</a>
|
<a class="location" v-if="appearNote.geo" :href="`https://maps.google.com/maps?q=${appearNote.geo.coordinates[1]},${appearNote.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% %i18n:@location%</a>
|
||||||
<div class="renote" v-if="p.renote">
|
<div class="renote" v-if="appearNote.renote">
|
||||||
<mk-note-preview :note="p.renote" :mini="true"/>
|
<mk-note-preview :note="appearNote.renote" :mini="true"/>
|
||||||
</div>
|
</div>
|
||||||
<mk-url-preview v-for="url in urls" :url="url" :key="url" :detail="false" :mini="true"/>
|
<mk-url-preview v-for="url in urls" :url="url" :key="url" :detail="false" :mini="true"/>
|
||||||
</div>
|
</div>
|
||||||
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
|
<span class="app" v-if="appearNote.app">via <b>{{ appearNote.app.name }}</b></span>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<mk-reactions-viewer :note="p" ref="reactionsViewer"/>
|
<mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/>
|
||||||
<button @click="reply">
|
<button @click="reply()">
|
||||||
<template v-if="p.reply">%fa:reply-all%</template>
|
<template v-if="appearNote.reply">%fa:reply-all%</template>
|
||||||
<template v-else>%fa:reply%</template>
|
<template v-else>%fa:reply%</template>
|
||||||
</button>
|
</button>
|
||||||
<button @click="renote" title="Renote">%fa:retweet%</button>
|
<button @click="renote()" title="Renote">%fa:retweet%</button>
|
||||||
<button :class="{ reacted: p.myReaction != null }" @click="react" ref="reactButton">%fa:plus%</button>
|
<button :class="{ reacted: appearNote.myReaction != null }" @click="react()" ref="reactButton">%fa:plus%</button>
|
||||||
<button class="menu" @click="menu" ref="menuButton">%fa:ellipsis-h%</button>
|
<button class="menu" @click="menu()" ref="menuButton">%fa:ellipsis-h%</button>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
@@ -65,11 +72,10 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import parse from '../../../../../../mfm/parse';
|
import MkPostFormWindow from '../../components/post-form-window.vue';
|
||||||
|
import MkRenoteFormWindow from '../../components/renote-form-window.vue';
|
||||||
import MkNoteMenu from '../../../../common/views/components/note-menu.vue';
|
|
||||||
import MkReactionPicker from '../../../../common/views/components/reaction-picker.vue';
|
|
||||||
import XSub from './deck.note.sub.vue';
|
import XSub from './deck.note.sub.vue';
|
||||||
|
import noteMixin from '../../../../common/scripts/note-mixin';
|
||||||
import noteSubscriber from '../../../../common/scripts/note-subscriber';
|
import noteSubscriber from '../../../../common/scripts/note-subscriber';
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
@@ -77,7 +83,10 @@ export default Vue.extend({
|
|||||||
XSub
|
XSub
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [noteSubscriber('note')],
|
mixins: [
|
||||||
|
noteMixin(),
|
||||||
|
noteSubscriber('note')
|
||||||
|
],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
note: {
|
note: {
|
||||||
@@ -89,66 +98,6 @@ export default Vue.extend({
|
|||||||
required: false,
|
required: false,
|
||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
showContent: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
isRenote(): boolean {
|
|
||||||
return (this.note.renote &&
|
|
||||||
this.note.text == null &&
|
|
||||||
this.note.fileIds.length == 0 &&
|
|
||||||
this.note.poll == null);
|
|
||||||
},
|
|
||||||
|
|
||||||
p(): any {
|
|
||||||
return this.isRenote ? this.note.renote : this.note;
|
|
||||||
},
|
|
||||||
|
|
||||||
urls(): string[] {
|
|
||||||
if (this.p.text) {
|
|
||||||
const ast = parse(this.p.text);
|
|
||||||
return ast
|
|
||||||
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
|
|
||||||
.map(t => t.url);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
reply() {
|
|
||||||
(this as any).apis.post({
|
|
||||||
reply: this.p
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
renote() {
|
|
||||||
(this as any).apis.post({
|
|
||||||
renote: this.p
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
react() {
|
|
||||||
(this as any).os.new(MkReactionPicker, {
|
|
||||||
source: this.$refs.reactButton,
|
|
||||||
note: this.p,
|
|
||||||
compact: true
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
menu() {
|
|
||||||
(this as any).os.new(MkNoteMenu, {
|
|
||||||
source: this.$refs.menuButton,
|
|
||||||
note: this.p,
|
|
||||||
compact: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -168,6 +117,20 @@ export default Vue.extend({
|
|||||||
font-size 13px
|
font-size 13px
|
||||||
border-bottom solid 1px var(--faceDivider)
|
border-bottom solid 1px var(--faceDivider)
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
z-index 1
|
||||||
|
|
||||||
|
&:after
|
||||||
|
content ""
|
||||||
|
pointer-events none
|
||||||
|
position absolute
|
||||||
|
top 2px
|
||||||
|
right 2px
|
||||||
|
bottom 2px
|
||||||
|
left 2px
|
||||||
|
border 2px solid var(--primaryAlpha03)
|
||||||
|
border-radius 4px
|
||||||
|
|
||||||
&:last-of-type
|
&:last-of-type
|
||||||
border-bottom none
|
border-bottom none
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@ export default (os) => (opts) => {
|
|||||||
}).$mount();
|
}).$mount();
|
||||||
vm.$once('cancel', recover);
|
vm.$once('cancel', recover);
|
||||||
vm.$once('posted', recover);
|
vm.$once('posted', recover);
|
||||||
|
if (opts.cb) vm.$once('closed', opts.cb);
|
||||||
document.body.appendChild(vm.$el);
|
document.body.appendChild(vm.$el);
|
||||||
(vm as any).focus();
|
(vm as any).focus();
|
||||||
};
|
};
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="note" :class="{ renote: isRenote, smart: $store.state.device.postStyle == 'smart' }">
|
<div
|
||||||
<div class="reply-to" v-if="p.reply && (!$store.getters.isSignedIn || $store.state.settings.showReplyTarget)">
|
class="note"
|
||||||
<x-sub :note="p.reply"/>
|
v-show="appearNote.deletedAt == null"
|
||||||
|
:tabindex="appearNote.deletedAt == null ? '-1' : null"
|
||||||
|
:class="{ renote: isRenote, smart: $store.state.device.postStyle == 'smart' }"
|
||||||
|
v-hotkey="keymap"
|
||||||
|
>
|
||||||
|
<div class="reply-to" v-if="appearNote.reply && (!$store.getters.isSignedIn || $store.state.settings.showReplyTarget)">
|
||||||
|
<x-sub :note="appearNote.reply"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="renote" v-if="isRenote">
|
<div class="renote" v-if="isRenote">
|
||||||
<mk-avatar class="avatar" :user="note.user"/>
|
<mk-avatar class="avatar" :user="note.user"/>
|
||||||
@@ -12,47 +18,45 @@
|
|||||||
<mk-time :time="note.createdAt"/>
|
<mk-time :time="note.createdAt"/>
|
||||||
</div>
|
</div>
|
||||||
<article>
|
<article>
|
||||||
<mk-avatar class="avatar" :user="p.user" v-if="$store.state.device.postStyle != 'smart'"/>
|
<mk-avatar class="avatar" :user="appearNote.user" v-if="$store.state.device.postStyle != 'smart'"/>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<mk-note-header class="header" :note="p" :mini="true"/>
|
<mk-note-header class="header" :note="appearNote" :mini="true"/>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p v-if="p.cw != null" class="cw">
|
<p v-if="appearNote.cw != null" class="cw">
|
||||||
<span class="text" v-if="p.cw != ''">{{ p.cw }}</span>
|
<span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span>
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="p.cw == null || showContent">
|
<div class="content" v-show="appearNote.cw == null || showContent">
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<span v-if="p.isHidden" style="opacity: 0.5">(%i18n:@private%)</span>
|
<span v-if="appearNote.isHidden" style="opacity: 0.5">(%i18n:@private%)</span>
|
||||||
<span v-if="p.deletedAt" style="opacity: 0.5">(%i18n:@deleted%)</span>
|
<a class="reply" v-if="appearNote.reply">%fa:reply%</a>
|
||||||
<a class="reply" v-if="p.reply">%fa:reply%</a>
|
<misskey-flavored-markdown v-if="appearNote.text" :text="appearNote.text" :i="$store.state.i" :class="$style.text"/>
|
||||||
<misskey-flavored-markdown v-if="p.text" :text="p.text" :i="$store.state.i" :class="$style.text"/>
|
<a class="rp" v-if="appearNote.renote != null">RP:</a>
|
||||||
<a class="rp" v-if="p.renote != null">RP:</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="files" v-if="p.files.length > 0">
|
<div class="files" v-if="appearNote.files.length > 0">
|
||||||
<mk-media-list :media-list="p.files"/>
|
<mk-media-list :media-list="appearNote.files"/>
|
||||||
</div>
|
</div>
|
||||||
<mk-poll v-if="p.poll" :note="p" ref="pollViewer"/>
|
<mk-poll v-if="appearNote.poll" :note="appearNote" ref="pollViewer"/>
|
||||||
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
||||||
<a class="location" v-if="p.geo" :href="`https://maps.google.com/maps?q=${p.geo.coordinates[1]},${p.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% %i18n:@location%</a>
|
<a class="location" v-if="appearNote.geo" :href="`https://maps.google.com/maps?q=${appearNote.geo.coordinates[1]},${appearNote.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% %i18n:@location%</a>
|
||||||
<div class="map" v-if="p.geo" ref="map"></div>
|
<div class="renote" v-if="appearNote.renote"><mk-note-preview :note="appearNote.renote"/></div>
|
||||||
<div class="renote" v-if="p.renote"><mk-note-preview :note="p.renote"/></div>
|
|
||||||
</div>
|
</div>
|
||||||
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
|
<span class="app" v-if="appearNote.app">via <b>{{ appearNote.apappearNote.name }}</b></span>
|
||||||
</div>
|
</div>
|
||||||
<footer v-if="p.deletedAt == null">
|
<footer v-if="appearNote.deletedAt == null">
|
||||||
<mk-reactions-viewer :note="p" ref="reactionsViewer"/>
|
<mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/>
|
||||||
<button @click="reply">
|
<button @click="reply()">
|
||||||
<template v-if="p.reply">%fa:reply-all%</template>
|
<template v-if="appearNote.reply">%fa:reply-all%</template>
|
||||||
<template v-else>%fa:reply%</template>
|
<template v-else>%fa:reply%</template>
|
||||||
<p class="count" v-if="p.repliesCount > 0">{{ p.repliesCount }}</p>
|
<p class="count" v-if="appearNote.repliesCount > 0">{{ appearNote.repliesCount }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button @click="renote" title="Renote">
|
<button @click="renote()" title="Renote">
|
||||||
%fa:retweet%<p class="count" v-if="p.renoteCount > 0">{{ p.renoteCount }}</p>
|
%fa:retweet%<p class="count" v-if="appearNote.renoteCount > 0">{{ appearNote.renoteCount }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button :class="{ reacted: p.myReaction != null }" @click="react" ref="reactButton">
|
<button :class="{ reacted: appearNote.myReaction != null }" @click="react()" ref="reactButton">
|
||||||
%fa:plus%<p class="count" v-if="p.reactions_count > 0">{{ p.reactions_count }}</p>
|
%fa:plus%<p class="count" v-if="appearNote.reactions_count > 0">{{ appearNote.reactions_count }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button class="menu" @click="menu" ref="menuButton">
|
<button class="menu" @click="menu()" ref="menuButton">
|
||||||
%fa:ellipsis-h%
|
%fa:ellipsis-h%
|
||||||
</button>
|
</button>
|
||||||
</footer>
|
</footer>
|
||||||
@@ -63,12 +67,9 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import parse from '../../../../../mfm/parse';
|
|
||||||
|
|
||||||
import MkNoteMenu from '../../../common/views/components/note-menu.vue';
|
|
||||||
import MkReactionPicker from '../../../common/views/components/reaction-picker.vue';
|
|
||||||
import XSub from './note.sub.vue';
|
import XSub from './note.sub.vue';
|
||||||
import { sum } from '../../../../../prelude/array';
|
import noteMixin from '../../../common/scripts/note-mixin';
|
||||||
import noteSubscriber from '../../../common/scripts/note-subscriber';
|
import noteSubscriber from '../../../common/scripts/note-subscriber';
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
@@ -76,74 +77,17 @@ export default Vue.extend({
|
|||||||
XSub
|
XSub
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [noteSubscriber('note')],
|
mixins: [
|
||||||
|
noteMixin({
|
||||||
|
mobile: true
|
||||||
|
}),
|
||||||
|
noteSubscriber('note')
|
||||||
|
],
|
||||||
|
|
||||||
props: ['note'],
|
props: {
|
||||||
|
note: {
|
||||||
data() {
|
type: Object,
|
||||||
return {
|
required: true
|
||||||
showContent: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
isRenote(): boolean {
|
|
||||||
return (this.note.renote &&
|
|
||||||
this.note.text == null &&
|
|
||||||
this.note.fileIds.length == 0 &&
|
|
||||||
this.note.poll == null);
|
|
||||||
},
|
|
||||||
|
|
||||||
p(): any {
|
|
||||||
return this.isRenote ? this.note.renote : this.note;
|
|
||||||
},
|
|
||||||
|
|
||||||
reactionsCount(): number {
|
|
||||||
return this.p.reactionCounts
|
|
||||||
? sum(Object.values(this.p.reactionCounts))
|
|
||||||
: 0;
|
|
||||||
},
|
|
||||||
|
|
||||||
urls(): string[] {
|
|
||||||
if (this.p.text) {
|
|
||||||
const ast = parse(this.p.text);
|
|
||||||
return ast
|
|
||||||
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
|
|
||||||
.map(t => t.url);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
reply() {
|
|
||||||
(this as any).apis.post({
|
|
||||||
reply: this.p
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
renote() {
|
|
||||||
(this as any).apis.post({
|
|
||||||
renote: this.p
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
react() {
|
|
||||||
(this as any).os.new(MkReactionPicker, {
|
|
||||||
source: this.$refs.reactButton,
|
|
||||||
note: this.p,
|
|
||||||
compact: true,
|
|
||||||
big: true
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
menu() {
|
|
||||||
(this as any).os.new(MkNoteMenu, {
|
|
||||||
source: this.$refs.menuButton,
|
|
||||||
note: this.p,
|
|
||||||
compact: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -154,6 +98,20 @@ export default Vue.extend({
|
|||||||
font-size 12px
|
font-size 12px
|
||||||
border-bottom solid 1px var(--faceDivider)
|
border-bottom solid 1px var(--faceDivider)
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
z-index 1
|
||||||
|
|
||||||
|
&:after
|
||||||
|
content ""
|
||||||
|
pointer-events none
|
||||||
|
position absolute
|
||||||
|
top 2px
|
||||||
|
right 2px
|
||||||
|
bottom 2px
|
||||||
|
left 2px
|
||||||
|
border 2px solid var(--primaryAlpha03)
|
||||||
|
border-radius 4px
|
||||||
|
|
||||||
&:last-of-type
|
&:last-of-type
|
||||||
border-bottom none
|
border-bottom none
|
||||||
|
|
||||||
|
@@ -58,6 +58,8 @@ export default async (params: any, user: ILocalUser) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
|
deletedAt: null,
|
||||||
|
|
||||||
// public only
|
// public only
|
||||||
visibility: 'public',
|
visibility: 'public',
|
||||||
|
|
||||||
|
@@ -129,6 +129,8 @@ export default async (params: any, user: ILocalUser) => {
|
|||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
$and: [{
|
$and: [{
|
||||||
|
deletedAt: null,
|
||||||
|
|
||||||
$or: [{
|
$or: [{
|
||||||
// フォローしている人の投稿
|
// フォローしている人の投稿
|
||||||
$or: followQuery
|
$or: followQuery
|
||||||
|
@@ -71,6 +71,8 @@ export default async (params: any, user: ILocalUser) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
|
deletedAt: null,
|
||||||
|
|
||||||
// public only
|
// public only
|
||||||
visibility: 'public',
|
visibility: 'public',
|
||||||
|
|
||||||
|
@@ -45,6 +45,8 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
|
|||||||
|
|
||||||
// Construct query
|
// Construct query
|
||||||
const query = {
|
const query = {
|
||||||
|
deletedAt: null,
|
||||||
|
|
||||||
$or: [{
|
$or: [{
|
||||||
mentions: user._id
|
mentions: user._id
|
||||||
}, {
|
}, {
|
||||||
|
@@ -132,6 +132,8 @@ export default async (params: any, user: ILocalUser) => {
|
|||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
$and: [{
|
$and: [{
|
||||||
|
deletedAt: null,
|
||||||
|
|
||||||
// フォローしている人の投稿
|
// フォローしている人の投稿
|
||||||
$or: followQuery,
|
$or: followQuery,
|
||||||
|
|
||||||
|
@@ -137,6 +137,8 @@ export default async (params: any, user: ILocalUser) => {
|
|||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
$and: [{
|
$and: [{
|
||||||
|
deletedAt: null,
|
||||||
|
|
||||||
// リストに入っている人のタイムラインへの投稿
|
// リストに入っている人のタイムラインへの投稿
|
||||||
$or: listQuery,
|
$or: listQuery,
|
||||||
|
|
||||||
|
@@ -136,6 +136,7 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
|
|||||||
};
|
};
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
|
deletedAt: null,
|
||||||
userId: user._id
|
userId: user._id
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
|
@@ -69,13 +69,10 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
|
|||||||
$nin: followingIds.concat(mutedUserIds)
|
$nin: followingIds.concat(mutedUserIds)
|
||||||
},
|
},
|
||||||
isLocked: { $ne: true },
|
isLocked: { $ne: true },
|
||||||
$or: [{
|
lastUsedAt: {
|
||||||
lastUsedAt: {
|
$gte: new Date(Date.now() - ms('7days'))
|
||||||
$gte: new Date(Date.now() - ms('7days'))
|
},
|
||||||
}
|
host: null
|
||||||
}, {
|
|
||||||
host: null
|
|
||||||
}]
|
|
||||||
}, {
|
}, {
|
||||||
limit: limit,
|
limit: limit,
|
||||||
skip: offset,
|
skip: offset,
|
||||||
|
@@ -9,9 +9,9 @@ const limit = promiseLimit(16);
|
|||||||
|
|
||||||
DriveFile.find({
|
DriveFile.find({
|
||||||
$or: [{
|
$or: [{
|
||||||
withoutChunks: { $exists: false }
|
'metadata.withoutChunks': { $exists: false }
|
||||||
}, {
|
}, {
|
||||||
withoutChunks: false
|
'metadata.withoutChunks': false
|
||||||
}],
|
}],
|
||||||
'metadata.deletedAt': { $exists: false }
|
'metadata.deletedAt': { $exists: false }
|
||||||
}, {
|
}, {
|
||||||
@@ -31,7 +31,7 @@ async function job(file: IDriveFile): Promise<any> {
|
|||||||
|
|
||||||
const minio = new Minio.Client(config.drive.config);
|
const minio = new Minio.Client(config.drive.config);
|
||||||
|
|
||||||
const name = file.filename;
|
const name = file.filename.substr(0, 50);
|
||||||
const keyDir = `${config.drive.prefix}/${uuid.v4()}`;
|
const keyDir = `${config.drive.prefix}/${uuid.v4()}`;
|
||||||
const key = `${keyDir}/${name}`;
|
const key = `${keyDir}/${name}`;
|
||||||
const thumbnailKeyDir = `${config.drive.prefix}/${uuid.v4()}`;
|
const thumbnailKeyDir = `${config.drive.prefix}/${uuid.v4()}`;
|
||||||
|
Reference in New Issue
Block a user