move scripts
This commit is contained in:
parent
aaf02d575f
commit
434089521a
|
@ -39,7 +39,7 @@ import XVideo from '@/components/MkMediaVideo.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
|
import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { focusParent } from '@/scripts/tms/focus.js';
|
import { focusParent } from '@/scripts/focus.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
mediaList: Misskey.entities.DriveFile[];
|
mediaList: Misskey.entities.DriveFile[];
|
||||||
|
|
|
@ -108,8 +108,8 @@ import * as os from '@/os.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { isTouchUsing } from '@/scripts/touch.js';
|
import { isTouchUsing } from '@/scripts/touch.js';
|
||||||
import { type Keymap } from '@/scripts/hotkey.js';
|
import { type Keymap } from '@/scripts/hotkey.js';
|
||||||
import { focusParent, isFocusable } from '@/scripts/tms/focus.js';
|
import { focusParent, isFocusable } from '@/scripts/focus.js';
|
||||||
import { getNodeOrNull } from '@/scripts/tms/get-or-null.js';
|
import { getNodeOrNull } from '@/scripts/get-or-null.js';
|
||||||
|
|
||||||
const childrenCache = new WeakMap<MenuParent, MenuItem[]>();
|
const childrenCache = new WeakMap<MenuParent, MenuItem[]>();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -198,7 +198,7 @@ import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
|
||||||
import { shouldCollapsed } from '@/scripts/collapsed.js';
|
import { shouldCollapsed } from '@/scripts/collapsed.js';
|
||||||
import { isEnabledUrlPreview } from '@/instance.js';
|
import { isEnabledUrlPreview } from '@/instance.js';
|
||||||
import { type Keymap } from '@/scripts/hotkey.js';
|
import { type Keymap } from '@/scripts/hotkey.js';
|
||||||
import { focusPrev, focusNext } from '@/scripts/tms/focus.js';
|
import { focusPrev, focusNext } from '@/scripts/focus.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
note: Misskey.entities.Note;
|
note: Misskey.entities.Note;
|
||||||
|
|
|
@ -24,7 +24,7 @@ import MkContextMenu from '@/components/MkContextMenu.vue';
|
||||||
import { MenuItem } from '@/types/menu.js';
|
import { MenuItem } from '@/types/menu.js';
|
||||||
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
|
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
|
||||||
import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
|
import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
|
||||||
import { getHTMLElementOrNull } from '@/scripts/tms/get-or-null.js';
|
import { getHTMLElementOrNull } from '@/scripts/get-or-null.js';
|
||||||
|
|
||||||
export const openingWindowsCount = ref(0);
|
export const openingWindowsCount = ref(0);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { getElementOrNull, getNodeOrNull } from '@/scripts/tms/get-or-null.js';
|
import { getElementOrNull, getNodeOrNull } from '@/scripts/get-or-null.js';
|
||||||
|
|
||||||
type MaybeHTMLElement = EventTarget | Node | Element | HTMLElement;
|
type MaybeHTMLElement = EventTarget | Node | Element | HTMLElement;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { getHTMLElementOrNull } from "@/scripts/get-or-null.js";
|
||||||
|
|
||||||
//#region types
|
//#region types
|
||||||
export type Keymap = Record<string, CallbackFunction | CallbackObject>;
|
export type Keymap = Record<string, CallbackFunction | CallbackObject>;
|
||||||
|
@ -55,7 +56,7 @@ export const makeHotkey = (keymap: Keymap) => {
|
||||||
if ('pswp' in window && window.pswp != null) return;
|
if ('pswp' in window && window.pswp != null) return;
|
||||||
if (document.activeElement != null) {
|
if (document.activeElement != null) {
|
||||||
if (IGNORE_ELEMENTS.includes(document.activeElement.tagName.toLowerCase())) return;
|
if (IGNORE_ELEMENTS.includes(document.activeElement.tagName.toLowerCase())) return;
|
||||||
if ((document.activeElement as HTMLElement).isContentEditable) return;
|
if (getHTMLElementOrNull(document.activeElement)?.isContentEditable) return;
|
||||||
}
|
}
|
||||||
for (const action of actions) {
|
for (const action of actions) {
|
||||||
if (matchPatterns(ev, action)) {
|
if (matchPatterns(ev, action)) {
|
||||||
|
|
Loading…
Reference in New Issue