summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-10-10 20:40:13 +0900
committerGitHub <noreply@github.com>2023-10-10 20:40:13 +0900
commitf964ef163b4c72d7eace319912ef139a41462344 (patch)
tree7315c9e4bf18d24124a393999ec3af194ec2bedb /packages/frontend/src/scripts
parentMerge pull request #11926 from misskey-dev/develop (diff)
parentfix(backend): センシティブ設定されたチャンネルの投稿をuse... (diff)
downloadmisskey-f964ef163b4c72d7eace319912ef139a41462344.tar.gz
misskey-f964ef163b4c72d7eace319912ef139a41462344.tar.bz2
misskey-f964ef163b4c72d7eace319912ef139a41462344.zip
Merge pull request #11963 from misskey-dev/develop
Release: 2023.10.0
Diffstat (limited to 'packages/frontend/src/scripts')
-rw-r--r--packages/frontend/src/scripts/get-drive-file-menu.ts7
-rw-r--r--packages/frontend/src/scripts/get-note-menu.ts9
-rw-r--r--packages/frontend/src/scripts/get-user-menu.ts13
-rw-r--r--packages/frontend/src/scripts/sound.ts12
-rw-r--r--packages/frontend/src/scripts/theme.ts24
-rw-r--r--packages/frontend/src/scripts/use-note-capture.ts7
-rw-r--r--packages/frontend/src/scripts/use-tooltip.ts14
7 files changed, 41 insertions, 45 deletions
diff --git a/packages/frontend/src/scripts/get-drive-file-menu.ts b/packages/frontend/src/scripts/get-drive-file-menu.ts
index 0964108249..8b2144a22f 100644
--- a/packages/frontend/src/scripts/get-drive-file-menu.ts
+++ b/packages/frontend/src/scripts/get-drive-file-menu.ts
@@ -27,7 +27,7 @@ function rename(file: Misskey.entities.DriveFile) {
function describe(file: Misskey.entities.DriveFile) {
os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), {
- default: file.comment != null ? file.comment : '',
+ default: file.comment ?? '',
file: file,
}, {
done: caption => {
@@ -113,6 +113,11 @@ export function getDriveFileMenu(file: Misskey.entities.DriveFile, folder?: Miss
icon: 'ti ti-download',
download: file.name,
}, null, {
+ type: 'link',
+ to: `/my/drive/file/${file.id}`,
+ text: i18n.ts._fileViewer.title,
+ icon: 'ti ti-file',
+ }, null, {
text: i18n.ts.delete,
icon: 'ti ti-trash',
danger: true,
diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts
index 62d9aab91b..e399145fc9 100644
--- a/packages/frontend/src/scripts/get-note-menu.ts
+++ b/packages/frontend/src/scripts/get-note-menu.ts
@@ -172,10 +172,6 @@ export function getNoteMenu(props: {
});
}
- function edit(): void {
- os.post({ initialNote: appearNote, renote: appearNote.renote, reply: appearNote.reply, channel: appearNote.channel, updateMode: true });
- }
-
function toggleFavorite(favorite: boolean): void {
claimAchievement('noteFavorited1');
os.apiWithDialog(favorite ? 'notes/favorites/create' : 'notes/favorites/delete', {
@@ -356,11 +352,6 @@ export function getNoteMenu(props: {
),
...(appearNote.userId === $i.id || $i.isModerator || $i.isAdmin ? [
null,
- appearNote.userId === $i.id && $i.policies.canEditNote ? {
- icon: 'ti ti-edit',
- text: i18n.ts.edit,
- action: edit,
- } : undefined,
appearNote.userId === $i.id ? {
icon: 'ti ti-edit',
text: i18n.ts.deleteAndEdit,
diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts
index 128cbafb15..be514be5b1 100644
--- a/packages/frontend/src/scripts/get-user-menu.ts
+++ b/packages/frontend/src/scripts/get-user-menu.ts
@@ -80,6 +80,15 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router
});
}
+ async function toggleWithReplies() {
+ os.apiWithDialog('following/update', {
+ userId: user.id,
+ withReplies: !user.withReplies,
+ }).then(() => {
+ user.withReplies = !user.withReplies;
+ });
+ }
+
async function toggleNotify() {
os.apiWithDialog('following/update', {
userId: user.id,
@@ -282,6 +291,10 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router
// フォローしたとしても user.isFollowing はリアルタイム更新されないので不便なため
//if (user.isFollowing) {
menu = menu.concat([{
+ icon: user.withReplies ? 'ti ti-messages-off' : 'ti ti-messages',
+ text: user.withReplies ? i18n.ts.hideRepliesToOthersInTimeline : i18n.ts.showRepliesToOthersInTimeline,
+ action: toggleWithReplies,
+ }, {
icon: user.notify === 'none' ? 'ti ti-bell' : 'ti ti-bell-off',
text: user.notify === 'none' ? i18n.ts.notifyNotes : i18n.ts.unnotifyNotes,
action: toggleNotify,
diff --git a/packages/frontend/src/scripts/sound.ts b/packages/frontend/src/scripts/sound.ts
index 1ef41b47d3..1ef075818f 100644
--- a/packages/frontend/src/scripts/sound.ts
+++ b/packages/frontend/src/scripts/sound.ts
@@ -7,10 +7,6 @@ import { markRaw } from 'vue';
import { Storage } from '@/pizzax.js';
export const soundConfigStore = markRaw(new Storage('sound', {
- mediaVolume: {
- where: 'device',
- default: 0.5,
- },
sound_masterVolume: {
where: 'device',
default: 0.3,
@@ -27,14 +23,6 @@ export const soundConfigStore = markRaw(new Storage('sound', {
where: 'account',
default: { type: 'syuilo/n-ea', volume: 1 },
},
- sound_chat: {
- where: 'account',
- default: { type: 'syuilo/pope1', volume: 1 },
- },
- sound_chatBg: {
- where: 'account',
- default: { type: 'syuilo/waon', volume: 1 },
- },
sound_antenna: {
where: 'account',
default: { type: 'syuilo/triple', volume: 1 },
diff --git a/packages/frontend/src/scripts/theme.ts b/packages/frontend/src/scripts/theme.ts
index 1c924e774f..b6383487c9 100644
--- a/packages/frontend/src/scripts/theme.ts
+++ b/packages/frontend/src/scripts/theme.ts
@@ -5,7 +5,11 @@
import { ref } from 'vue';
import tinycolor from 'tinycolor2';
-import { globalEvents } from '@/events';
+import { deepClone } from './clone.js';
+import { globalEvents } from '@/events.js';
+import lightTheme from '@/themes/_light.json5';
+import darkTheme from '@/themes/_dark.json5';
+import { miLocalStorage } from '@/local-storage.js';
export type Theme = {
id: string;
@@ -16,11 +20,6 @@ export type Theme = {
props: Record<string, string>;
};
-import lightTheme from '@/themes/_light.json5';
-import darkTheme from '@/themes/_dark.json5';
-import { deepClone } from './clone';
-import { miLocalStorage } from '@/local-storage.js';
-
export const themeProps = Object.keys(lightTheme.props).filter(key => !key.startsWith('X'));
export const getBuiltinThemes = () => Promise.all(
@@ -101,18 +100,11 @@ export function applyTheme(theme: Theme, persist = true) {
function compile(theme: Theme): Record<string, string> {
function getColor(val: string): tinycolor.Instance {
- // ref (prop)
- if (val[0] === '@') {
+ if (val[0] === '@') { // ref (prop)
return getColor(theme.props[val.substring(1)]);
- }
-
- // ref (const)
- else if (val[0] === '$') {
+ } else if (val[0] === '$') { // ref (const)
return getColor(theme.props[val]);
- }
-
- // func
- else if (val[0] === ':') {
+ } else if (val[0] === ':') { // func
const parts = val.split('<');
const func = parts.shift().substring(1);
const arg = parseFloat(parts.shift());
diff --git a/packages/frontend/src/scripts/use-note-capture.ts b/packages/frontend/src/scripts/use-note-capture.ts
index a4c913749e..c618532570 100644
--- a/packages/frontend/src/scripts/use-note-capture.ts
+++ b/packages/frontend/src/scripts/use-note-capture.ts
@@ -71,13 +71,6 @@ export function useNoteCapture(props: {
break;
}
- case 'updated': {
- note.value.updatedAt = new Date().toISOString();
- note.value.cw = body.cw;
- note.value.text = body.text;
- break;
- }
-
case 'deleted': {
props.isDeletedRef.value = true;
break;
diff --git a/packages/frontend/src/scripts/use-tooltip.ts b/packages/frontend/src/scripts/use-tooltip.ts
index 0a82997728..17ea380db0 100644
--- a/packages/frontend/src/scripts/use-tooltip.ts
+++ b/packages/frontend/src/scripts/use-tooltip.ts
@@ -21,6 +21,8 @@ export function useTooltip(
let changeShowingState: (() => void) | null;
+ let autoHidingTimer;
+
const open = () => {
close();
if (!isHovering) return;
@@ -33,6 +35,16 @@ export function useTooltip(
changeShowingState = () => {
showing.value = false;
};
+
+ autoHidingTimer = window.setInterval(() => {
+ if (!document.body.contains(elRef.value)) {
+ if (!isHovering) return;
+ isHovering = false;
+ window.clearTimeout(timeoutId);
+ close();
+ window.clearInterval(autoHidingTimer);
+ }
+ }, 1000);
};
const close = () => {
@@ -53,6 +65,7 @@ export function useTooltip(
if (!isHovering) return;
isHovering = false;
window.clearTimeout(timeoutId);
+ window.clearInterval(autoHidingTimer);
close();
};
@@ -67,6 +80,7 @@ export function useTooltip(
if (!isHovering) return;
isHovering = false;
window.clearTimeout(timeoutId);
+ window.clearInterval(autoHidingTimer);
close();
};