enhance(frontend): ノート作成画面の添付メニューから直接ファイルを消せるように (#12858)
* (enhance) 添付画面から直接ファイルを消せるように * Update Changelog --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
		
							parent
							
								
									fcd7ffe956
								
							
						
					
					
						commit
						576484835e
					
				
					 4 changed files with 27 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -38,6 +38,7 @@
 | 
			
		|||
- Enhance: 絵文字ピッカー・オートコンプリートで、完全一致した絵文字を優先的に表示するように
 | 
			
		||||
- Enhance: Playの説明欄にMFMを使えるように
 | 
			
		||||
- Enhance: チャンネルノートの場合は詳細ページからその前後のノートを見れるように
 | 
			
		||||
- Enhance: ノート作成画面のファイル添付メニューから直接ファイルを削除できるように
 | 
			
		||||
- Enhance: MFMの属性でオートコンプリートが使用できるように #12735
 | 
			
		||||
- Fix: ネイティブモードの絵文字がモノクロにならないように
 | 
			
		||||
- Fix: v2023.12.0で追加された「モデレーターがユーザーのアイコンもしくはバナー画像を未設定状態にできる機能」が管理画面上で正しく表示されていない問題を修正
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								locales/index.d.ts
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								locales/index.d.ts
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -536,6 +536,7 @@ export interface Locale extends ILocale {
 | 
			
		|||
     * 添付取り消し
 | 
			
		||||
     */
 | 
			
		||||
    "attachCancel": string;
 | 
			
		||||
    "deleteFile": string;
 | 
			
		||||
    /**
 | 
			
		||||
     * センシティブとして設定
 | 
			
		||||
     */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -130,6 +130,7 @@ overwriteFromPinnedEmojis: "全般設定から上書きする"
 | 
			
		|||
reactionSettingDescription2: "ドラッグして並び替え、クリックして削除、+を押して追加します。"
 | 
			
		||||
rememberNoteVisibility: "公開範囲を記憶する"
 | 
			
		||||
attachCancel: "添付取り消し"
 | 
			
		||||
deleteFile: "ファイルを削除"
 | 
			
		||||
markAsSensitive: "センシティブとして設定"
 | 
			
		||||
unmarkAsSensitive: "センシティブを解除する"
 | 
			
		||||
enterFileName: "ファイル名を入力"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,6 +56,23 @@ function detachMedia(id: string) {
 | 
			
		|||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function detachAndDeleteMedia(file: Misskey.entities.DriveFile) {
 | 
			
		||||
	if (mock) return;
 | 
			
		||||
 | 
			
		||||
	detachMedia(file.id);
 | 
			
		||||
 | 
			
		||||
	const { canceled } = await os.confirm({
 | 
			
		||||
		type: 'warning',
 | 
			
		||||
		text: i18n.t('driveFileDeleteConfirm', { name: file.name }),
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	if (canceled) return;
 | 
			
		||||
 | 
			
		||||
	os.apiWithDialog('drive/files/delete', {
 | 
			
		||||
		fileId: file.id,
 | 
			
		||||
	});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function toggleSensitive(file) {
 | 
			
		||||
	if (mock) {
 | 
			
		||||
		emit('changeSensitive', file, !file.isSensitive);
 | 
			
		||||
| 
						 | 
				
			
			@ -138,6 +155,13 @@ function showFileMenu(file: Misskey.entities.DriveFile, ev: MouseEvent): void {
 | 
			
		|||
		text: i18n.ts.attachCancel,
 | 
			
		||||
		icon: 'ti ti-circle-x',
 | 
			
		||||
		action: () => { detachMedia(file.id); },
 | 
			
		||||
	}, {
 | 
			
		||||
		type: 'divider',
 | 
			
		||||
	}, {
 | 
			
		||||
		text: i18n.ts.deleteFile,
 | 
			
		||||
		icon: 'ti ti-trash',
 | 
			
		||||
		danger: true,
 | 
			
		||||
		action: () => { detachAndDeleteMedia(file); },
 | 
			
		||||
	}], ev.currentTarget ?? ev.target).then(() => menuShowing = false);
 | 
			
		||||
	menuShowing = true;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue