summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2022-12-22 16:01:59 +0900
committerGitHub <noreply@github.com>2022-12-22 16:01:59 +0900
commitf1fd1d2585bd5230caea4c7b8814c2cf007e57cc (patch)
tree212dd8f70312b9237484057deba6bc9611ec44d0 /packages/client/src/scripts
parentImprove Dockerfile (#9105) (diff)
downloadsharkey-f1fd1d2585bd5230caea4c7b8814c2cf007e57cc.tar.gz
sharkey-f1fd1d2585bd5230caea4c7b8814c2cf007e57cc.tar.bz2
sharkey-f1fd1d2585bd5230caea4c7b8814c2cf007e57cc.zip
style: add missing trailing commas (#9387)
Diffstat (limited to 'packages/client/src/scripts')
-rw-r--r--packages/client/src/scripts/2fa.ts8
-rw-r--r--packages/client/src/scripts/autocomplete.ts2
-rw-r--r--packages/client/src/scripts/focus.ts4
-rw-r--r--packages/client/src/scripts/format-time-string.ts2
-rw-r--r--packages/client/src/scripts/gen-search-query.ts2
-rw-r--r--packages/client/src/scripts/get-static-image-url.ts2
-rw-r--r--packages/client/src/scripts/hotkey.ts6
-rw-r--r--packages/client/src/scripts/hpml/evaluator.ts6
-rw-r--r--packages/client/src/scripts/hpml/index.ts22
-rw-r--r--packages/client/src/scripts/lookup-user.ts2
-rw-r--r--packages/client/src/scripts/physics.ts20
-rw-r--r--packages/client/src/scripts/please-login.ts2
-rw-r--r--packages/client/src/scripts/reaction-picker.ts4
-rw-r--r--packages/client/src/scripts/show-suspended-dialog.ts2
-rw-r--r--packages/client/src/scripts/theme-editor.ts2
-rw-r--r--packages/client/src/scripts/use-note-capture.ts4
16 files changed, 45 insertions, 45 deletions
diff --git a/packages/client/src/scripts/2fa.ts b/packages/client/src/scripts/2fa.ts
index d1b9581e72..62a38ff02a 100644
--- a/packages/client/src/scripts/2fa.ts
+++ b/packages/client/src/scripts/2fa.ts
@@ -7,15 +7,15 @@ export function byteify(string: string, encoding: 'ascii' | 'base64' | 'hex') {
atob(
string
.replace(/-/g, '+')
- .replace(/_/g, '/')
+ .replace(/_/g, '/'),
),
- c => c.charCodeAt(0)
+ c => c.charCodeAt(0),
);
case 'hex':
return new Uint8Array(
string
.match(/.{1,2}/g)
- .map(byte => parseInt(byte, 16))
+ .map(byte => parseInt(byte, 16)),
);
}
}
@@ -24,7 +24,7 @@ export function hexify(buffer: ArrayBuffer) {
return Array.from(new Uint8Array(buffer))
.reduce(
(str, byte) => str + byte.toString(16).padStart(2, '0'),
- ''
+ '',
);
}
diff --git a/packages/client/src/scripts/autocomplete.ts b/packages/client/src/scripts/autocomplete.ts
index 62de37ed27..1bae3790f5 100644
--- a/packages/client/src/scripts/autocomplete.ts
+++ b/packages/client/src/scripts/autocomplete.ts
@@ -171,7 +171,7 @@ export class Autocomplete {
}, {
done: (res) => {
this.complete(res);
- }
+ },
});
this.suggestion = {
diff --git a/packages/client/src/scripts/focus.ts b/packages/client/src/scripts/focus.ts
index 0894877820..d6802fa322 100644
--- a/packages/client/src/scripts/focus.ts
+++ b/packages/client/src/scripts/focus.ts
@@ -4,7 +4,7 @@ export function focusPrev(el: Element | null, self = false, scroll = true) {
if (el) {
if (el.hasAttribute('tabindex')) {
(el as HTMLElement).focus({
- preventScroll: !scroll
+ preventScroll: !scroll,
});
} else {
focusPrev(el.previousElementSibling, true);
@@ -18,7 +18,7 @@ export function focusNext(el: Element | null, self = false, scroll = true) {
if (el) {
if (el.hasAttribute('tabindex')) {
(el as HTMLElement).focus({
- preventScroll: !scroll
+ preventScroll: !scroll,
});
} else {
focusPrev(el.nextElementSibling, true);
diff --git a/packages/client/src/scripts/format-time-string.ts b/packages/client/src/scripts/format-time-string.ts
index fb4718c007..c20db5e827 100644
--- a/packages/client/src/scripts/format-time-string.ts
+++ b/packages/client/src/scripts/format-time-string.ts
@@ -7,7 +7,7 @@ const defaultLocaleStringFormats: {[index: string]: string} = {
'hour': 'numeric',
'minute': 'numeric',
'second': 'numeric',
- 'timeZoneName': 'short'
+ 'timeZoneName': 'short',
};
function formatLocaleString(date: Date, format: string): string {
diff --git a/packages/client/src/scripts/gen-search-query.ts b/packages/client/src/scripts/gen-search-query.ts
index b413cbbab1..da7d622632 100644
--- a/packages/client/src/scripts/gen-search-query.ts
+++ b/packages/client/src/scripts/gen-search-query.ts
@@ -25,6 +25,6 @@ export async function genSearchQuery(v: any, q: string) {
return {
query: q.split(' ').filter(x => !x.startsWith('/') && !x.startsWith('@')).join(' '),
host: host,
- userId: userId
+ userId: userId,
};
}
diff --git a/packages/client/src/scripts/get-static-image-url.ts b/packages/client/src/scripts/get-static-image-url.ts
index e9a3e87cc8..79dbcf9325 100644
--- a/packages/client/src/scripts/get-static-image-url.ts
+++ b/packages/client/src/scripts/get-static-image-url.ts
@@ -11,6 +11,6 @@ export function getStaticImageUrl(baseUrl: string): string {
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
return `${instanceUrl}/proxy/${dummy}?${url.query({
url: u.href,
- static: '1'
+ static: '1',
})}`;
}
diff --git a/packages/client/src/scripts/hotkey.ts b/packages/client/src/scripts/hotkey.ts
index bd8c3b6cab..4a0ded637d 100644
--- a/packages/client/src/scripts/hotkey.ts
+++ b/packages/client/src/scripts/hotkey.ts
@@ -21,7 +21,7 @@ const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, c
const result = {
patterns: [],
callback,
- allowRepeat: true
+ allowRepeat: true,
} as Action;
if (patterns.match(/^\(.*\)$/) !== null) {
@@ -34,7 +34,7 @@ const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, c
which: [],
ctrl: false,
alt: false,
- shift: false
+ shift: false,
} as Pattern;
const keys = part.trim().split('+').map(x => x.trim().toLowerCase());
@@ -61,7 +61,7 @@ function match(ev: KeyboardEvent, patterns: Action['patterns']): boolean {
pattern.ctrl === ev.ctrlKey &&
pattern.shift === ev.shiftKey &&
pattern.alt === ev.altKey &&
- !ev.metaKey
+ !ev.metaKey,
);
}
diff --git a/packages/client/src/scripts/hpml/evaluator.ts b/packages/client/src/scripts/hpml/evaluator.ts
index 10023edffb..196b3142a1 100644
--- a/packages/client/src/scripts/hpml/evaluator.ts
+++ b/packages/client/src/scripts/hpml/evaluator.ts
@@ -35,7 +35,7 @@ export class Hpml {
if (this.opts.enableAiScript) {
this.aiscript = markRaw(new AiScript({ ...createAiScriptEnv({
- storageKey: 'pages:' + this.page.id
+ storageKey: 'pages:' + this.page.id,
}), ...initAiLib(this) }, {
in: (q) => {
return new Promise(ok => {
@@ -75,7 +75,7 @@ export class Hpml {
SEED: opts.randomSeed ? opts.randomSeed : '',
YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`,
AISCRIPT_DISABLED: !this.opts.enableAiScript,
- NULL: null
+ NULL: null,
};
this.eval();
@@ -198,7 +198,7 @@ export class Hpml {
slots: expr.value.slots.map(x => x.name),
exec: (slotArg: Record<string, any>) => {
return this.evaluate(expr.value.expression, scope.createChildScope(slotArg, expr.id));
- }
+ },
} as Fn;
}
return;
diff --git a/packages/client/src/scripts/hpml/index.ts b/packages/client/src/scripts/hpml/index.ts
index 4e5aadfbd3..9a55a5c286 100644
--- a/packages/client/src/scripts/hpml/index.ts
+++ b/packages/client/src/scripts/hpml/index.ts
@@ -14,22 +14,22 @@ export type Fn = {
export type Type = 'string' | 'number' | 'boolean' | 'stringArray' | null;
export const literalDefs: Record<string, { out: any; category: string; icon: any; }> = {
- text: { out: 'string', category: 'value', icon: 'ti ti-quote', },
- multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left', },
- textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list', },
- number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up', },
- ref: { out: null, category: 'value', icon: 'fas fa-magic', },
- aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic', },
- fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt', },
+ text: { out: 'string', category: 'value', icon: 'ti ti-quote' },
+ multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left' },
+ textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list' },
+ number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up' },
+ ref: { out: null, category: 'value', icon: 'fas fa-magic' },
+ aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic' },
+ fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt' },
};
export const blockDefs = [
...Object.entries(literalDefs).map(([k, v]) => ({
- type: k, out: v.out, category: v.category, icon: v.icon
+ type: k, out: v.out, category: v.category, icon: v.icon,
})),
...Object.entries(funcDefs).map(([k, v]) => ({
- type: k, out: v.out, category: v.category, icon: v.icon
- }))
+ type: k, out: v.out, category: v.category, icon: v.icon,
+ })),
];
export type PageVar = { name: string; value: any; type: Type; };
@@ -82,7 +82,7 @@ export class HpmlScope {
throw new HpmlError(
`No such variable '${name}' in scope '${this.name}'`, {
- scope: this.layerdStates
+ scope: this.layerdStates,
});
}
}
diff --git a/packages/client/src/scripts/lookup-user.ts b/packages/client/src/scripts/lookup-user.ts
index 2d00e51621..3ab9d55300 100644
--- a/packages/client/src/scripts/lookup-user.ts
+++ b/packages/client/src/scripts/lookup-user.ts
@@ -19,7 +19,7 @@ export async function lookupUser() {
if (_notFound) {
os.alert({
type: 'error',
- text: i18n.ts.noSuchUser
+ text: i18n.ts.noSuchUser,
});
} else {
_notFound = true;
diff --git a/packages/client/src/scripts/physics.ts b/packages/client/src/scripts/physics.ts
index f0a5b0fdd6..efda80f074 100644
--- a/packages/client/src/scripts/physics.ts
+++ b/packages/client/src/scripts/physics.ts
@@ -29,7 +29,7 @@ export function physics(container: HTMLElement) {
height: containerHeight,
background: 'transparent', // transparent to hide
wireframeBackground: 'transparent', // transparent to hide
- }
+ },
});
// Disable to hide debug
@@ -43,7 +43,7 @@ export function physics(container: HTMLElement) {
const ground = Matter.Bodies.rectangle(containerCenterX, containerHeight + (groundThickness / 2), containerWidth, groundThickness, {
isStatic: true,
restitution: 0.1,
- friction: 2
+ friction: 2,
});
//const wallRight = Matter.Bodies.rectangle(window.innerWidth+50, window.innerHeight/2, 100, window.innerHeight, wallopts);
@@ -68,8 +68,8 @@ export function physics(container: HTMLElement) {
top + (objEl.offsetHeight / 2),
Math.max(objEl.offsetWidth, objEl.offsetHeight) / 2,
{
- restitution: 0.5
- }
+ restitution: 0.5,
+ },
);
} else {
const style = window.getComputedStyle(objEl);
@@ -80,8 +80,8 @@ export function physics(container: HTMLElement) {
objEl.offsetHeight,
{
chamfer: { radius: parseInt(style.borderRadius || '0', 10) },
- restitution: 0.5
- }
+ restitution: 0.5,
+ },
);
}
objEl.id = obj.id.toString();
@@ -98,9 +98,9 @@ export function physics(container: HTMLElement) {
constraint: {
stiffness: 0.1,
render: {
- visible: false
- }
- }
+ visible: false,
+ },
+ },
});
Matter.World.add(engine.world, mouseConstraint);
@@ -147,6 +147,6 @@ export function physics(container: HTMLElement) {
stop = true;
Matter.Runner.stop(runner);
window.clearInterval(intervalId);
- }
+ },
};
}
diff --git a/packages/client/src/scripts/please-login.ts b/packages/client/src/scripts/please-login.ts
index 3323968f71..b8fb853cc1 100644
--- a/packages/client/src/scripts/please-login.ts
+++ b/packages/client/src/scripts/please-login.ts
@@ -8,7 +8,7 @@ export function pleaseLogin(path?: string) {
popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
autoSet: true,
- message: i18n.ts.signinRequired
+ message: i18n.ts.signinRequired,
}, {
cancelled: () => {
if (path) {
diff --git a/packages/client/src/scripts/reaction-picker.ts b/packages/client/src/scripts/reaction-picker.ts
index a6d0940a40..fe32e719da 100644
--- a/packages/client/src/scripts/reaction-picker.ts
+++ b/packages/client/src/scripts/reaction-picker.ts
@@ -15,7 +15,7 @@ class ReactionPicker {
await popup(defineAsyncComponent(() => import('@/components/MkEmojiPickerDialog.vue')), {
src: this.src,
asReactionPicker: true,
- manualShowing: this.manualShowing
+ manualShowing: this.manualShowing,
}, {
done: reaction => {
this.onChosen!(reaction);
@@ -26,7 +26,7 @@ class ReactionPicker {
closed: () => {
this.src.value = null;
this.onClosed!();
- }
+ },
});
}
diff --git a/packages/client/src/scripts/show-suspended-dialog.ts b/packages/client/src/scripts/show-suspended-dialog.ts
index acfbc60e92..e11569ecd4 100644
--- a/packages/client/src/scripts/show-suspended-dialog.ts
+++ b/packages/client/src/scripts/show-suspended-dialog.ts
@@ -5,6 +5,6 @@ export function showSuspendedDialog() {
return os.alert({
type: 'error',
title: i18n.ts.yourAccountSuspendedTitle,
- text: i18n.ts.yourAccountSuspendedDescription
+ text: i18n.ts.yourAccountSuspendedDescription,
});
}
diff --git a/packages/client/src/scripts/theme-editor.ts b/packages/client/src/scripts/theme-editor.ts
index 6d88d6856c..944875ff15 100644
--- a/packages/client/src/scripts/theme-editor.ts
+++ b/packages/client/src/scripts/theme-editor.ts
@@ -61,7 +61,7 @@ export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: st
return {
id: uuid(),
- name, desc, author, props, base
+ name, desc, author, props, base,
};
};
diff --git a/packages/client/src/scripts/use-note-capture.ts b/packages/client/src/scripts/use-note-capture.ts
index f1f976693e..e6bdb345c4 100644
--- a/packages/client/src/scripts/use-note-capture.ts
+++ b/packages/client/src/scripts/use-note-capture.ts
@@ -60,8 +60,8 @@ export function useNoteCapture(props: {
...choices[choice],
votes: choices[choice].votes + 1,
...($i && (body.userId === $i.id) ? {
- isVoted: true
- } : {})
+ isVoted: true,
+ } : {}),
};
note.value.poll.choices = choices;