chore: lint
This commit is contained in:
parent
0d92fa303b
commit
25a1fa341a
35 changed files with 128 additions and 118 deletions
|
@ -1,11 +1,11 @@
|
||||||
|
import type { entities } from "firefish-js";
|
||||||
|
import { defineAsyncComponent } from "vue";
|
||||||
|
import { i18n } from "./i18n";
|
||||||
import { apiUrl } from "@/config";
|
import { apiUrl } from "@/config";
|
||||||
import { me } from "@/me";
|
import { me } from "@/me";
|
||||||
import { alert, api, popup, popupMenu, waiting } from "@/os";
|
import { alert, api, popup, popupMenu, waiting } from "@/os";
|
||||||
import { del, get, set } from "@/scripts/idb-proxy";
|
import { del, get, set } from "@/scripts/idb-proxy";
|
||||||
import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
|
import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
|
||||||
import type { entities } from "firefish-js";
|
|
||||||
import { defineAsyncComponent } from "vue";
|
|
||||||
import { i18n } from "./i18n";
|
|
||||||
|
|
||||||
// TODO: 他のタブと永続化されたstateを同期
|
// TODO: 他のタブと永続化されたstateを同期
|
||||||
|
|
||||||
|
|
|
@ -166,21 +166,21 @@ const texts = computed(() => {
|
||||||
return angles;
|
return angles;
|
||||||
});
|
});
|
||||||
|
|
||||||
let enabled = true,
|
let enabled = true;
|
||||||
majorGraduationColor = ref<string>(),
|
const majorGraduationColor = ref<string>();
|
||||||
// let minorGraduationColor = $ref<string>();
|
// let minorGraduationColor = $ref<string>();
|
||||||
sHandColor = ref<string>(),
|
const sHandColor = ref<string>();
|
||||||
mHandColor = ref<string>(),
|
const mHandColor = ref<string>();
|
||||||
hHandColor = ref<string>(),
|
const hHandColor = ref<string>();
|
||||||
nowColor = ref<string>(),
|
const nowColor = ref<string>();
|
||||||
h = ref<number>(0),
|
const h = ref<number>(0);
|
||||||
m = ref<number>(0),
|
const m = ref<number>(0);
|
||||||
s = ref<number>(0),
|
const s = ref<number>(0);
|
||||||
hAngle = ref<number>(0),
|
const hAngle = ref<number>(0);
|
||||||
mAngle = ref<number>(0),
|
const mAngle = ref<number>(0);
|
||||||
sAngle = ref<number>(0),
|
const sAngle = ref<number>(0);
|
||||||
disableSAnimate = ref(false),
|
const disableSAnimate = ref(false);
|
||||||
sOneRound = false;
|
let sOneRound = false;
|
||||||
|
|
||||||
function tick() {
|
function tick() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
|
@ -128,20 +128,20 @@ const getColor = (i) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
let chartInstance: Chart = null,
|
let chartInstance: Chart = null;
|
||||||
chartData: {
|
let chartData: {
|
||||||
series: {
|
series: {
|
||||||
name: string;
|
name: string;
|
||||||
type: "line" | "area";
|
type: "line" | "area";
|
||||||
color?: string;
|
color?: string;
|
||||||
dashed?: boolean;
|
dashed?: boolean;
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
data: {
|
data: {
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
}[];
|
|
||||||
}[];
|
}[];
|
||||||
} = null;
|
}[];
|
||||||
|
} = null;
|
||||||
|
|
||||||
const chartEl = ref<HTMLCanvasElement>(null);
|
const chartEl = ref<HTMLCanvasElement>(null);
|
||||||
const fetching = ref(true);
|
const fetching = ref(true);
|
||||||
|
|
|
@ -33,8 +33,8 @@ const rootEl = ref<HTMLDivElement>();
|
||||||
const zIndex = ref<number>(os.claimZIndex("high"));
|
const zIndex = ref<number>(os.claimZIndex("high"));
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let left = props.ev.pageX + 1, // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
|
let left = props.ev.pageX + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
|
||||||
top = props.ev.pageY + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
|
let top = props.ev.pageY + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
|
||||||
|
|
||||||
const width = rootEl.value.offsetWidth;
|
const width = rootEl.value.offsetWidth;
|
||||||
const height = rootEl.value.offsetHeight;
|
const height = rootEl.value.offsetHeight;
|
||||||
|
|
|
@ -64,8 +64,8 @@ const imgUrl = `${url}/proxy/image.webp?${query({
|
||||||
})}`;
|
})}`;
|
||||||
const dialogEl = ref<InstanceType<typeof XModalWindow>>();
|
const dialogEl = ref<InstanceType<typeof XModalWindow>>();
|
||||||
const imgEl = ref<HTMLImageElement>();
|
const imgEl = ref<HTMLImageElement>();
|
||||||
let cropper: Cropper | null = null,
|
let cropper: Cropper | null = null;
|
||||||
loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
||||||
const ok = async () => {
|
const ok = async () => {
|
||||||
const promise = new Promise<entities.DriveFile>(async (res) => {
|
const promise = new Promise<entities.DriveFile>(async (res) => {
|
||||||
|
|
|
@ -22,14 +22,14 @@
|
||||||
@load="onLoad"
|
@load="onLoad"
|
||||||
/>
|
/>
|
||||||
<i
|
<i
|
||||||
class="alt-indicator"
|
|
||||||
:class="icon('ph-subtitles')"
|
|
||||||
v-if="alt && showAltIndicator"
|
v-if="alt && showAltIndicator"
|
||||||
v-tooltip.noLabel="
|
v-tooltip.noLabel="
|
||||||
`${i18n.ts.alt}: ${
|
`${i18n.ts.alt}: ${
|
||||||
alt.length > 200 ? alt.trim().slice(0, 200) + '...' : alt.trim()
|
alt.length > 200 ? alt.trim().slice(0, 200) + '...' : alt.trim()
|
||||||
}`
|
}`
|
||||||
"
|
"
|
||||||
|
class="alt-indicator"
|
||||||
|
:class="icon('ph-subtitles')"
|
||||||
></i>
|
></i>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -168,10 +168,10 @@ function load() {
|
||||||
|
|
||||||
onMounted(load);
|
onMounted(load);
|
||||||
|
|
||||||
let currentRow = 0,
|
let currentRow = 0;
|
||||||
rowHeight = 0,
|
let rowHeight = 0;
|
||||||
buffer = null,
|
let buffer = null;
|
||||||
isSeeking = false;
|
const isSeeking = false;
|
||||||
|
|
||||||
function captionPopup() {
|
function captionPopup() {
|
||||||
os.alert({
|
os.alert({
|
||||||
|
|
|
@ -235,7 +235,8 @@ const align = () => {
|
||||||
const width = content.value!.offsetWidth;
|
const width = content.value!.offsetWidth;
|
||||||
const height = content.value!.offsetHeight;
|
const height = content.value!.offsetHeight;
|
||||||
|
|
||||||
let left, top;
|
let left;
|
||||||
|
let top;
|
||||||
|
|
||||||
const x = srcRect.left + (fixed.value ? 0 : window.pageXOffset);
|
const x = srcRect.left + (fixed.value ? 0 : window.pageXOffset);
|
||||||
const y = srcRect.top + (fixed.value ? 0 : window.pageYOffset);
|
const y = srcRect.top + (fixed.value ? 0 : window.pageYOffset);
|
||||||
|
@ -314,8 +315,8 @@ const align = () => {
|
||||||
left = 0;
|
left = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
let transformOriginX = "center",
|
let transformOriginX = "center";
|
||||||
transformOriginY = "center";
|
let transformOriginY = "center";
|
||||||
|
|
||||||
if (
|
if (
|
||||||
top >=
|
top >=
|
||||||
|
|
|
@ -310,7 +310,8 @@ const defaultReaction = ["⭐", "👍", "❤️"].includes(instance.defaultReact
|
||||||
? instance.defaultReaction
|
? instance.defaultReaction
|
||||||
: "⭐";
|
: "⭐";
|
||||||
|
|
||||||
let readObserver: IntersectionObserver | undefined, connection;
|
let readObserver: IntersectionObserver | undefined;
|
||||||
|
let connection;
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!props.notification.isRead) {
|
if (!props.notification.isRead) {
|
||||||
|
|
|
@ -331,8 +331,8 @@ import { vibrate } from "@/scripts/vibrate";
|
||||||
import { langmap } from "@/scripts/langmap";
|
import { langmap } from "@/scripts/langmap";
|
||||||
import {
|
import {
|
||||||
detectLanguage,
|
detectLanguage,
|
||||||
isSupportedLang,
|
|
||||||
isSameLanguage,
|
isSameLanguage,
|
||||||
|
isSupportedLang,
|
||||||
languageContains,
|
languageContains,
|
||||||
parentLanguage,
|
parentLanguage,
|
||||||
} from "@/scripts/language-utils";
|
} from "@/scripts/language-utils";
|
||||||
|
|
|
@ -45,7 +45,7 @@ const isRefreshing = ref(false);
|
||||||
const pullDistance = ref(0);
|
const pullDistance = ref(0);
|
||||||
|
|
||||||
let disabled = false;
|
let disabled = false;
|
||||||
let supportPointerDesktop = false;
|
const supportPointerDesktop = false;
|
||||||
let startScreenY: number | null = null;
|
let startScreenY: number | null = null;
|
||||||
|
|
||||||
const rootEl = shallowRef<HTMLDivElement>();
|
const rootEl = shallowRef<HTMLDivElement>();
|
||||||
|
|
|
@ -79,8 +79,8 @@ const el = ref<HTMLElement>();
|
||||||
const width = ref(0);
|
const width = ref(0);
|
||||||
const height = ref(0);
|
const height = ref(0);
|
||||||
const colors = ["#eb6f92", "#9ccfd8", "#f6c177", "#f6c177", "#f6c177"];
|
const colors = ["#eb6f92", "#9ccfd8", "#f6c177", "#f6c177", "#f6c177"];
|
||||||
let stop = false,
|
let stop = false;
|
||||||
ro: ResizeObserver | undefined;
|
let ro: ResizeObserver | undefined;
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!reducedMotion()) {
|
if (!reducedMotion()) {
|
||||||
|
|
|
@ -174,12 +174,12 @@ provide("inWindow", true);
|
||||||
|
|
||||||
const rootEl = ref<HTMLElement | null>();
|
const rootEl = ref<HTMLElement | null>();
|
||||||
const showing = ref(true);
|
const showing = ref(true);
|
||||||
let beforeClickedAt = 0,
|
let beforeClickedAt = 0;
|
||||||
maximized = ref(false),
|
const maximized = ref(false);
|
||||||
unMaximizedTop = "",
|
let unMaximizedTop = "";
|
||||||
unMaximizedLeft = "",
|
let unMaximizedLeft = "";
|
||||||
unMaximizedWidth = "",
|
let unMaximizedWidth = "";
|
||||||
unMaximizedHeight = "";
|
let unMaximizedHeight = "";
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
showing.value = false;
|
showing.value = false;
|
||||||
|
@ -280,8 +280,8 @@ function onHeaderMousedown(evt: MouseEvent) {
|
||||||
const windowHeight = main.offsetHeight;
|
const windowHeight = main.offsetHeight;
|
||||||
|
|
||||||
function move(x: number, y: number) {
|
function move(x: number, y: number) {
|
||||||
let moveLeft = x - moveBaseX,
|
let moveLeft = x - moveBaseX;
|
||||||
moveTop = y - moveBaseY;
|
let moveTop = y - moveBaseY;
|
||||||
|
|
||||||
// 下はみ出し
|
// 下はみ出し
|
||||||
if (moveTop + windowHeight > browserHeight)
|
if (moveTop + windowHeight > browserHeight)
|
||||||
|
|
|
@ -24,10 +24,10 @@ const props = withDefaults(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
let ro: ResizeObserver,
|
let ro: ResizeObserver;
|
||||||
root = ref<HTMLElement>(),
|
const root = ref<HTMLElement>();
|
||||||
content = ref<HTMLElement>(),
|
const content = ref<HTMLElement>();
|
||||||
margin = ref(0);
|
const margin = ref(0);
|
||||||
const shouldSpacerMin = inject("shouldSpacerMin", false);
|
const shouldSpacerMin = inject("shouldSpacerMin", false);
|
||||||
|
|
||||||
const adjust = (rect: { width: number; height: number }) => {
|
const adjust = (rect: { width: number; height: number }) => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { locale } from "@/config";
|
|
||||||
import { markRaw } from "vue";
|
import { markRaw } from "vue";
|
||||||
|
import { locale } from "@/config";
|
||||||
|
|
||||||
class I18n<T extends Record<string, any>> {
|
class I18n<T extends Record<string, any>> {
|
||||||
public ts: T;
|
public ts: T;
|
||||||
|
|
|
@ -22,7 +22,6 @@ if (accounts) {
|
||||||
}
|
}
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
import { set } from "@/scripts/idb-proxy";
|
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
createApp,
|
createApp,
|
||||||
|
@ -31,6 +30,7 @@ import {
|
||||||
version as vueVersion,
|
version as vueVersion,
|
||||||
watch,
|
watch,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
|
import { set } from "@/scripts/idb-proxy";
|
||||||
|
|
||||||
import { refreshAccount, signIn, signOut, updateAccount } from "@/account";
|
import { refreshAccount, signIn, signOut, updateAccount } from "@/account";
|
||||||
import components from "@/components";
|
import components from "@/components";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Account } from "@/account";
|
|
||||||
import { reactive } from "vue";
|
import { reactive } from "vue";
|
||||||
|
import type { Account } from "@/account";
|
||||||
|
|
||||||
const accountData = localStorage.getItem("account");
|
const accountData = localStorage.getItem("account");
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { computed, reactive } from "vue";
|
||||||
import { ui } from "@/config";
|
import { ui } from "@/config";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { isSignedIn, me } from "@/me";
|
import { isSignedIn, me } from "@/me";
|
||||||
|
@ -5,7 +6,6 @@ import * as os from "@/os";
|
||||||
import icon from "@/scripts/icon";
|
import icon from "@/scripts/icon";
|
||||||
import { search } from "@/scripts/search";
|
import { search } from "@/scripts/search";
|
||||||
import { unisonReload } from "@/scripts/unison-reload";
|
import { unisonReload } from "@/scripts/unison-reload";
|
||||||
import { computed, reactive } from "vue";
|
|
||||||
|
|
||||||
export const navbarItemDef = reactive({
|
export const navbarItemDef = reactive({
|
||||||
notifications: {
|
notifications: {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// NIRAX --- A lightweight router
|
// NIRAX --- A lightweight router
|
||||||
|
|
||||||
import { pleaseLogin } from "@/scripts/please-login";
|
|
||||||
import { safeURIDecode } from "@/scripts/safe-uri-decode";
|
|
||||||
import { EventEmitter } from "eventemitter3";
|
import { EventEmitter } from "eventemitter3";
|
||||||
import type { Component, ShallowRef } from "vue";
|
import type { Component, ShallowRef } from "vue";
|
||||||
import { shallowRef } from "vue";
|
import { shallowRef } from "vue";
|
||||||
|
import { safeURIDecode } from "@/scripts/safe-uri-decode";
|
||||||
|
import { pleaseLogin } from "@/scripts/please-login";
|
||||||
|
|
||||||
interface RouteDef {
|
interface RouteDef {
|
||||||
path: string;
|
path: string;
|
||||||
|
@ -93,8 +93,8 @@ export class Router extends EventEmitter<{
|
||||||
}
|
}
|
||||||
|
|
||||||
public resolve(path: string): Resolved | null {
|
public resolve(path: string): Resolved | null {
|
||||||
let queryString: string | null = null,
|
let queryString: string | null = null;
|
||||||
hash: string | null = null;
|
let hash: string | null = null;
|
||||||
if (path[0] === "/") path = path.substring(1);
|
if (path[0] === "/") path = path.substring(1);
|
||||||
if (path.includes("#")) {
|
if (path.includes("#")) {
|
||||||
hash = path.substring(path.indexOf("#") + 1);
|
hash = path.substring(path.indexOf("#") + 1);
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
||||||
|
|
||||||
import MkDialog from "@/components/MkDialog.vue";
|
|
||||||
import MkPostFormDialog from "@/components/MkPostFormDialog.vue";
|
|
||||||
import MkToast from "@/components/MkToast.vue";
|
|
||||||
import MkWaitingDialog from "@/components/MkWaitingDialog.vue";
|
|
||||||
import { url, apiUrl } from "@/config";
|
|
||||||
import { me } from "@/me";
|
|
||||||
import type { MenuItem } from "@/types/menu";
|
|
||||||
import { EventEmitter } from "eventemitter3";
|
import { EventEmitter } from "eventemitter3";
|
||||||
import { type entities, api as firefishApi } from "firefish-js";
|
import { type entities, api as firefishApi } from "firefish-js";
|
||||||
import insertTextAtCursor from "insert-text-at-cursor";
|
import insertTextAtCursor from "insert-text-at-cursor";
|
||||||
import type { Component, Ref } from "vue";
|
import type { Component, Ref } from "vue";
|
||||||
import { defineAsyncComponent, markRaw, ref } from "vue";
|
import { defineAsyncComponent, markRaw, ref } from "vue";
|
||||||
import { i18n } from "./i18n";
|
import { i18n } from "./i18n";
|
||||||
|
import MkDialog from "@/components/MkDialog.vue";
|
||||||
|
import MkPostFormDialog from "@/components/MkPostFormDialog.vue";
|
||||||
|
import MkToast from "@/components/MkToast.vue";
|
||||||
|
import MkWaitingDialog from "@/components/MkWaitingDialog.vue";
|
||||||
|
import { apiUrl, url } from "@/config";
|
||||||
|
import { me } from "@/me";
|
||||||
|
import type { MenuItem } from "@/types/menu";
|
||||||
|
|
||||||
export const pendingApiRequestsCount = ref(0);
|
export const pendingApiRequestsCount = ref(0);
|
||||||
|
|
||||||
|
@ -776,8 +776,8 @@ type AwaitType<T> = T extends Promise<infer U>
|
||||||
: T extends (...args: any[]) => Promise<infer V>
|
: T extends (...args: any[]) => Promise<infer V>
|
||||||
? V
|
? V
|
||||||
: T;
|
: T;
|
||||||
let openingEmojiPicker: AwaitType<ReturnType<typeof popup>> | null = null,
|
let openingEmojiPicker: AwaitType<ReturnType<typeof popup>> | null = null;
|
||||||
activeTextarea: HTMLTextAreaElement | HTMLInputElement | null = null;
|
let activeTextarea: HTMLTextAreaElement | HTMLInputElement | null = null;
|
||||||
export async function openEmojiPicker(
|
export async function openEmojiPicker(
|
||||||
src?: HTMLElement,
|
src?: HTMLElement,
|
||||||
opts,
|
opts,
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { defineAsyncComponent, onMounted, ref } from "vue";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { useRouter } from "@/router";
|
import { useRouter } from "@/router";
|
||||||
import { userPage } from "@/filters/user";
|
import { userPage } from "@/filters/user";
|
||||||
import { notePage } from "@/filters/note";
|
import { notePage } from "@/filters/note";
|
||||||
import { onMounted, ref, defineAsyncComponent } from "vue";
|
|
||||||
const XNotFound = defineAsyncComponent(() => import("./not-found.vue"));
|
const XNotFound = defineAsyncComponent(() => import("./not-found.vue"));
|
||||||
|
|
||||||
const err = ref(false);
|
const err = ref(false);
|
||||||
|
|
|
@ -72,8 +72,8 @@ const headerTabs = computed(() => []);
|
||||||
|
|
||||||
const list = ref<typeof MkPagination | null>(null);
|
const list = ref<typeof MkPagination | null>(null);
|
||||||
|
|
||||||
let isCached = false,
|
let isCached = false;
|
||||||
refreshTimer: number | null = null;
|
let refreshTimer: number | null = null;
|
||||||
|
|
||||||
const refresh = () => {
|
const refresh = () => {
|
||||||
if (isCached) {
|
if (isCached) {
|
||||||
|
|
|
@ -222,7 +222,10 @@ async function save() {
|
||||||
return lines;
|
return lines;
|
||||||
};
|
};
|
||||||
|
|
||||||
let softMutes, softMLangs, hardMWords, hardMPatterns;
|
let softMutes;
|
||||||
|
let softMLangs;
|
||||||
|
let hardMWords;
|
||||||
|
let hardMPatterns;
|
||||||
try {
|
try {
|
||||||
softMutes = parseSoftMutes(softMutedWords.value, i18n.ts._wordMute.soft);
|
softMutes = parseSoftMutes(softMutedWords.value, i18n.ts._wordMute.soft);
|
||||||
softMLangs = parseMutedWords(softMutedLangs.value);
|
softMLangs = parseMutedWords(softMutedLangs.value);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// PIZZAX --- A lightweight store
|
// PIZZAX --- A lightweight store
|
||||||
|
|
||||||
import { isSignedIn, me } from "@/me";
|
|
||||||
import type { Ref } from "vue";
|
import type { Ref } from "vue";
|
||||||
import { onUnmounted, ref, watch } from "vue";
|
import { onUnmounted, ref, watch } from "vue";
|
||||||
import { api } from "./os";
|
import { api } from "./os";
|
||||||
import { useStream } from "./stream";
|
import { useStream } from "./stream";
|
||||||
|
import { isSignedIn, me } from "@/me";
|
||||||
|
|
||||||
type StateDef = Record<
|
type StateDef = Record<
|
||||||
string,
|
string,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { Interpreter, Parser, utils, values } from "@syuilo/aiscript";
|
||||||
import { inputText } from "@/os";
|
import { inputText } from "@/os";
|
||||||
import { createAiScriptEnv } from "@/scripts/aiscript/api";
|
import { createAiScriptEnv } from "@/scripts/aiscript/api";
|
||||||
import {
|
import {
|
||||||
|
@ -7,7 +8,6 @@ import {
|
||||||
postFormActions,
|
postFormActions,
|
||||||
userActions,
|
userActions,
|
||||||
} from "@/store";
|
} from "@/store";
|
||||||
import { Interpreter, Parser, utils, values } from "@syuilo/aiscript";
|
|
||||||
|
|
||||||
const parser = new Parser();
|
const parser = new Parser();
|
||||||
const pluginContexts = new Map<string, Interpreter>();
|
const pluginContexts = new Map<string, Interpreter>();
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
import type { AsyncComponentLoader } from "vue";
|
||||||
|
import { defineAsyncComponent, inject } from "vue";
|
||||||
import { isEmojiMod, isModerator, me } from "@/me";
|
import { isEmojiMod, isModerator, me } from "@/me";
|
||||||
import { Router } from "@/nirax";
|
import { Router } from "@/nirax";
|
||||||
import MkError from "@/pages/_error_.vue";
|
import MkError from "@/pages/_error_.vue";
|
||||||
import MkLoading from "@/pages/_loading_.vue";
|
import MkLoading from "@/pages/_loading_.vue";
|
||||||
import type { AsyncComponentLoader } from "vue";
|
|
||||||
import { defineAsyncComponent, inject } from "vue";
|
|
||||||
|
|
||||||
const page = (loader: AsyncComponentLoader<any>) =>
|
const page = (loader: AsyncComponentLoader<any>) =>
|
||||||
defineAsyncComponent({
|
defineAsyncComponent({
|
||||||
|
|
|
@ -309,9 +309,9 @@ ChiptuneJsPlayer.prototype.createLibopenmptNode = async function (
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let framesRendered = 0,
|
let framesRendered = 0;
|
||||||
ended = false,
|
let ended = false;
|
||||||
error = false;
|
let error = false;
|
||||||
|
|
||||||
const currentPattern =
|
const currentPattern =
|
||||||
processNode.player.libopenmpt._openmpt_module_get_current_pattern(
|
processNode.player.libopenmpt._openmpt_module_get_current_pattern(
|
||||||
|
|
|
@ -2,7 +2,8 @@ import { acct } from "firefish-js";
|
||||||
import { host as localHost } from "@/config";
|
import { host as localHost } from "@/config";
|
||||||
|
|
||||||
export async function genSearchQuery(v: any, q: string) {
|
export async function genSearchQuery(v: any, q: string) {
|
||||||
let host: string, userId: string;
|
let host: string;
|
||||||
|
let userId: string;
|
||||||
if (q.split(" ").some((x) => x.startsWith("@"))) {
|
if (q.split(" ").some((x) => x.startsWith("@"))) {
|
||||||
for (const at of q
|
for (const at of q
|
||||||
.split(" ")
|
.split(" ")
|
||||||
|
|
|
@ -61,8 +61,8 @@ function parseSingleKaTeXMacro(src: string): [string, KaTeXMacro] {
|
||||||
currentPos = skipSpaces(currentPos);
|
currentPos = skipSpaces(currentPos);
|
||||||
|
|
||||||
while (currentPos < src.length - 1) {
|
while (currentPos < src.length - 1) {
|
||||||
let numbersignPos = -1,
|
let numbersignPos = -1;
|
||||||
isEscaped = false;
|
let isEscaped = false;
|
||||||
|
|
||||||
for (let i = currentPos; i < src.length - 1; ++i) {
|
for (let i = currentPos; i < src.length - 1; ++i) {
|
||||||
if (src[i] !== "\\" && src[i] !== "#") {
|
if (src[i] !== "\\" && src[i] !== "#") {
|
||||||
|
@ -210,15 +210,15 @@ function expandKaTeXMacroOnce(
|
||||||
--maxNumberOfExpansions;
|
--maxNumberOfExpansions;
|
||||||
|
|
||||||
// search for a custom macro
|
// search for a custom macro
|
||||||
let checkedPos = beginPos - 1,
|
let checkedPos = beginPos - 1;
|
||||||
macroName = "",
|
let macroName = "";
|
||||||
macroBackslashPos = 0,
|
let macroBackslashPos = 0;
|
||||||
// for macros w/o args: unused
|
// for macros w/o args: unused
|
||||||
// w/ args: the first open bracket ("(", "{", or "[") after cmd name
|
// w/ args: the first open bracket ("(", "{", or "[") after cmd name
|
||||||
macroArgBeginPos = 0,
|
let macroArgBeginPos = 0;
|
||||||
// for macros w/o args: the end of cmd name
|
// for macros w/o args: the end of cmd name
|
||||||
// w/ args: the closing bracket of the last arg
|
// w/ args: the closing bracket of the last arg
|
||||||
macroArgEndPos = 0;
|
let macroArgEndPos = 0;
|
||||||
|
|
||||||
while (checkedPos < endPos) {
|
while (checkedPos < endPos) {
|
||||||
checkedPos = src.indexOf("\\", checkedPos + 1);
|
checkedPos = src.indexOf("\\", checkedPos + 1);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { supportedLangs } from "@/scripts/langmap";
|
|
||||||
import { detect } from "tinyld";
|
import { detect } from "tinyld";
|
||||||
import * as mfm from "mfm-js";
|
import * as mfm from "mfm-js";
|
||||||
|
import { supportedLangs } from "@/scripts/langmap";
|
||||||
|
|
||||||
export function detectLanguage(text: string): string {
|
export function detectLanguage(text: string): string {
|
||||||
const nodes = mfm.parse(text);
|
const nodes = mfm.parse(text);
|
||||||
|
|
|
@ -20,7 +20,8 @@ export function calcPopupPosition(
|
||||||
}
|
}
|
||||||
|
|
||||||
const calcPosWhenTop = () => {
|
const calcPosWhenTop = () => {
|
||||||
let left: number, top: number;
|
let left: number;
|
||||||
|
let top: number;
|
||||||
|
|
||||||
if (props.anchorElement) {
|
if (props.anchorElement) {
|
||||||
left =
|
left =
|
||||||
|
@ -41,7 +42,8 @@ export function calcPopupPosition(
|
||||||
};
|
};
|
||||||
|
|
||||||
const calcPosWhenBottom = () => {
|
const calcPosWhenBottom = () => {
|
||||||
let left: number, top: number;
|
let left: number;
|
||||||
|
let top: number;
|
||||||
|
|
||||||
if (props.anchorElement) {
|
if (props.anchorElement) {
|
||||||
left =
|
left =
|
||||||
|
@ -66,7 +68,8 @@ export function calcPopupPosition(
|
||||||
};
|
};
|
||||||
|
|
||||||
const calcPosWhenLeft = () => {
|
const calcPosWhenLeft = () => {
|
||||||
let left: number, top: number;
|
let left: number;
|
||||||
|
let top: number;
|
||||||
|
|
||||||
if (props.anchorElement) {
|
if (props.anchorElement) {
|
||||||
left = rect.left + window.pageXOffset - contentWidth - props.innerMargin;
|
left = rect.left + window.pageXOffset - contentWidth - props.innerMargin;
|
||||||
|
@ -87,7 +90,8 @@ export function calcPopupPosition(
|
||||||
};
|
};
|
||||||
|
|
||||||
const calcPosWhenRight = () => {
|
const calcPosWhenRight = () => {
|
||||||
let left: number, top: number;
|
let left: number;
|
||||||
|
let top: number;
|
||||||
|
|
||||||
if (props.anchorElement) {
|
if (props.anchorElement) {
|
||||||
left =
|
left =
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* 配列をシャッフル (破壊的)
|
* 配列をシャッフル (破壊的)
|
||||||
*/
|
*/
|
||||||
export function shuffle<T extends any[]>(array: T): T {
|
export function shuffle<T extends any[]>(array: T): T {
|
||||||
let currentIndex = array.length,
|
let currentIndex = array.length;
|
||||||
randomIndex;
|
let randomIndex;
|
||||||
|
|
||||||
// While there remain elements to shuffle.
|
// While there remain elements to shuffle.
|
||||||
while (currentIndex !== 0) {
|
while (currentIndex !== 0) {
|
||||||
|
|
|
@ -6,13 +6,13 @@ export function useTooltip(
|
||||||
onShow: (showing: Ref<boolean>) => void,
|
onShow: (showing: Ref<boolean>) => void,
|
||||||
delay = 300,
|
delay = 300,
|
||||||
): void {
|
): void {
|
||||||
let isHovering = false,
|
let isHovering = false;
|
||||||
// iOS(Androidも?)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、それを無視するためのフラグ
|
// iOS(Androidも?)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、それを無視するためのフラグ
|
||||||
// 無視しないと、画面に触れてないのにツールチップが出たりし、ユーザビリティが損なわれる
|
// 無視しないと、画面に触れてないのにツールチップが出たりし、ユーザビリティが損なわれる
|
||||||
// TODO: 一度でもタップすると二度とマウスでツールチップ出せなくなるのをどうにかする 定期的にfalseに戻すとか...?
|
// TODO: 一度でもタップすると二度とマウスでツールチップ出せなくなるのをどうにかする 定期的にfalseに戻すとか...?
|
||||||
shouldIgnoreMouseover = false,
|
let shouldIgnoreMouseover = false;
|
||||||
timeoutId: number,
|
let timeoutId: number;
|
||||||
changeShowingState: (() => void) | null;
|
let changeShowingState: (() => void) | null;
|
||||||
|
|
||||||
const open = () => {
|
const open = () => {
|
||||||
close();
|
close();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { url } from "@/config";
|
|
||||||
import { me } from "@/me";
|
|
||||||
import { Stream } from "firefish-js";
|
import { Stream } from "firefish-js";
|
||||||
import { markRaw } from "vue";
|
import { markRaw } from "vue";
|
||||||
|
import { url } from "@/config";
|
||||||
|
import { me } from "@/me";
|
||||||
|
|
||||||
let stream: Stream | null = null;
|
let stream: Stream | null = null;
|
||||||
let timeoutHeartBeat: number | null = null;
|
let timeoutHeartBeat: number | null = null;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import type { Theme } from "./scripts/theme";
|
||||||
import { isSignedIn, me } from "@/me";
|
import { isSignedIn, me } from "@/me";
|
||||||
import { api } from "@/os";
|
import { api } from "@/os";
|
||||||
import type { Theme } from "./scripts/theme";
|
|
||||||
|
|
||||||
const lsCacheKey = isSignedIn ? `themes:${me.id}` : "";
|
const lsCacheKey = isSignedIn ? `themes:${me.id}` : "";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue