fix: dont show cheat sheet when not needed

This commit is contained in:
Kainoa Kanter 2023-05-16 20:31:13 -07:00
parent dcd6e48101
commit 2de535b0b8
15 changed files with 209 additions and 103 deletions

View file

@ -24,12 +24,12 @@ export async function importMastoPost(
reply = await resolveNote(post.object.inReplyTo); reply = await resolveNote(post.object.inReplyTo);
} }
if (post.directMessage) { if (post.directMessage) {
done(); done();
return; return;
} }
if (job.data.signatureCheck) { if (job.data.signatureCheck) {
if (!post.signature) { if (!post.signature) {
done(); done();
return; return;
} }
} }

View file

@ -204,6 +204,7 @@
<i class="ph-plug ph-bold ph-lg"></i> <i class="ph-plug ph-bold ph-lg"></i>
</button> </button>
<button <button
v-if="showMfmCheatsheet"
v-tooltip="i18n.ts._mfm.cheatSheet" v-tooltip="i18n.ts._mfm.cheatSheet"
class="_button right" class="_button right"
@click="openCheatSheet" @click="openCheatSheet"
@ -275,11 +276,13 @@ const props = withDefaults(
instant?: boolean; instant?: boolean;
fixed?: boolean; fixed?: boolean;
autofocus?: boolean; autofocus?: boolean;
showMfmCheatSheet?: boolean;
editId?: misskey.entities.Note["id"]; editId?: misskey.entities.Note["id"];
}>(), }>(),
{ {
initialVisibleUsers: () => [], initialVisibleUsers: () => [],
autofocus: true, autofocus: true,
showMfmCheatSheet: true,
} }
); );

View file

@ -103,7 +103,7 @@
</template> </template>
</I18n> </I18n>
<br /> <br />
<XPostForm class="post-form _block" /> <XPostForm class="post-form _block" :show-mfm-cheat-sheet="false"/>
</section> </section>
<section <section
v-else-if="tutorial === 4" v-else-if="tutorial === 4"

View file

@ -3,7 +3,9 @@
<label> <label>
<div class="label"><slot name="label"></slot></div> <div class="label"><slot name="label"></slot></div>
<div class="input" :class="{ inline, disabled, focused }"> <div class="input" :class="{ inline, disabled, focused }">
<div ref="prefixEl" class="prefix"><slot name="prefix"></slot></div> <div ref="prefixEl" class="prefix">
<slot name="prefix"></slot>
</div>
<input <input
ref="inputEl" ref="inputEl"
v-model="v" v-model="v"
@ -26,7 +28,9 @@
<datalist v-if="datalist" :id="id"> <datalist v-if="datalist" :id="id">
<option v-for="data in datalist" :value="data" /> <option v-for="data in datalist" :value="data" />
</datalist> </datalist>
<div ref="suffixEl" class="suffix"><slot name="suffix"></slot></div> <div ref="suffixEl" class="suffix">
<slot name="suffix"></slot>
</div>
</div> </div>
<div class="caption"><slot name="caption"></slot></div> <div class="caption"><slot name="caption"></slot></div>
</label> </label>

View file

@ -1,9 +1,5 @@
<template> <template>
<label <label v-adaptive-border class="novjtctn" :class="{ disabled, checked }">
v-adaptive-border
class="novjtctn"
:class="{ disabled, checked }"
>
<input <input
type="radio" type="radio"
:disabled="disabled" :disabled="disabled"

View file

@ -17,12 +17,9 @@
@blur="tooltipHide" @blur="tooltipHide"
@mouseenter="tooltipShow" @mouseenter="tooltipShow"
@mouseleave="tooltipHide" @mouseleave="tooltipHide"
@input="(x) => inputVal = x.target.value" @input="(x) => (inputVal = x.target.value)"
/> />
<datalist <datalist v-if="showTicks && steps" :id="id">
v-if="showTicks && steps"
:id="id"
>
<option <option
v-for="i in steps + 1" v-for="i in steps + 1"
:value="i" :value="i"
@ -97,7 +94,6 @@ function tooltipShow() {
function tooltipHide() { function tooltipHide() {
tooltipShowing.value = false; tooltipShowing.value = false;
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -163,19 +159,33 @@ function tooltipHide() {
width: 100%; width: 100%;
background: none; background: none;
&::-webkit-slider-runnable-track { @include track } &::-webkit-slider-runnable-track {
&::-moz-range-track { @include track } @include track;
&::-ms-track { @include track } }
&::-moz-range-track {
@include track;
}
&::-ms-track {
@include track;
}
&::-moz-range-progress { @include fill } &::-moz-range-progress {
&::-ms-fill-lower { @include fill } @include fill;
}
&::-ms-fill-lower {
@include fill;
}
&::-webkit-slider-thumb { &::-webkit-slider-thumb {
margin-top: -6.5px; margin-top: -6.5px;
@include thumb @include thumb;
}
&::-moz-range-thumb {
@include thumb;
}
&::-ms-thumb {
@include thumb;
} }
&::-moz-range-thumb { @include thumb }
&::-ms-thumb { @include thumb }
} }
} }
} }

View file

@ -9,7 +9,9 @@
@click.prevent="onClick" @click.prevent="onClick"
tabindex="-1" tabindex="-1"
> >
<div ref="prefixEl" class="prefix"><slot name="prefix"></slot></div> <div ref="prefixEl" class="prefix">
<slot name="prefix"></slot>
</div>
<select <select
ref="inputEl" ref="inputEl"
v-model="v" v-model="v"

View file

@ -6,9 +6,7 @@
:disabled="disabled" :disabled="disabled"
v-on:change="(x) => toggle(x)" v-on:change="(x) => toggle(x)"
/> />
<div <div class="button">
class="button"
>
<div class="knob"></div> <div class="knob"></div>
</div> </div>
<span class="label"> <span class="label">

View file

@ -214,7 +214,7 @@ export default defineComponent({
display: none; display: none;
} }
} }
> .input { > .input {
position: relative; position: relative;
> textarea { > textarea {
@ -273,7 +273,6 @@ export default defineComponent({
} }
} }
> .save { > .save {
margin: 8px 0 0 0; margin: 8px 0 0 0;
} }

View file

@ -35,7 +35,7 @@ const adjust = (rect: { width: number; height: number }) => {
margin = props.marginMin; margin = props.marginMin;
return; return;
} }
if ( ui === "classic" ) { if (ui === "classic") {
margin = 12; margin = 12;
return; return;
} }

View file

@ -193,7 +193,7 @@ export function claimZIndex(
let uniqueId = 0; let uniqueId = 0;
export function getUniqueId(): string { export function getUniqueId(): string {
return uniqueId++ + ''; return uniqueId++ + "";
} }
export async function popup( export async function popup(
@ -232,7 +232,11 @@ export async function popup(
export function pageWindow(path: string) { export function pageWindow(path: string) {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkPageWindow.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkPageWindow.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
initialPath: path, initialPath: path,
}, },
@ -243,7 +247,11 @@ export function pageWindow(path: string) {
export function modalPageWindow(path: string) { export function modalPageWindow(path: string) {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkModalPageWindow.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkModalPageWindow.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
initialPath: path, initialPath: path,
}, },
@ -313,7 +321,11 @@ export function yesno(props: {
}): Promise<{ canceled: boolean }> { }): Promise<{ canceled: boolean }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
...props, ...props,
showCancelButton: true, showCancelButton: true,
@ -344,7 +356,11 @@ export function inputText(props: {
> { > {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
title: props.title, title: props.title,
text: props.text, text: props.text,
@ -378,7 +394,11 @@ export function inputParagraph(props: {
> { > {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
title: props.title, title: props.title,
text: props.text, text: props.text,
@ -412,7 +432,11 @@ export function inputNumber(props: {
> { > {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
title: props.title, title: props.title,
text: props.text, text: props.text,
@ -446,7 +470,11 @@ export function inputDate(props: {
> { > {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
title: props.title, title: props.title,
text: props.text, text: props.text,
@ -501,7 +529,11 @@ export function select<C = any>(
> { > {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
title: props.title, title: props.title,
text: props.text, text: props.text,
@ -528,7 +560,11 @@ export function success() {
showing.value = false; showing.value = false;
}, 1000); }, 1000);
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkWaitingDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkWaitingDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
success: true, success: true,
showing: showing, showing: showing,
@ -545,7 +581,11 @@ export function waiting() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const showing = ref(true); const showing = ref(true);
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkWaitingDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkWaitingDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
success: false, success: false,
showing: showing, showing: showing,
@ -561,7 +601,11 @@ export function waiting() {
export function form(title, form) { export function form(title, form) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkFormDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkFormDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ title, form }, { title, form },
{ {
done: (result) => { done: (result) => {
@ -576,7 +620,11 @@ export function form(title, form) {
export async function selectUser() { export async function selectUser() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkUserSelectDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkUserSelectDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{}, {},
{ {
ok: (user) => { ok: (user) => {
@ -591,7 +639,11 @@ export async function selectUser() {
export async function selectInstance(): Promise<Misskey.entities.Instance> { export async function selectInstance(): Promise<Misskey.entities.Instance> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkInstanceSelectDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkInstanceSelectDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{}, {},
{ {
ok: (instance) => { ok: (instance) => {
@ -606,7 +658,11 @@ export async function selectInstance(): Promise<Misskey.entities.Instance> {
export async function selectDriveFile(multiple: boolean) { export async function selectDriveFile(multiple: boolean) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkDriveSelectDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkDriveSelectDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
type: "file", type: "file",
multiple, multiple,
@ -626,7 +682,11 @@ export async function selectDriveFile(multiple: boolean) {
export async function selectDriveFolder(multiple: boolean) { export async function selectDriveFolder(multiple: boolean) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkDriveSelectDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkDriveSelectDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
type: "folder", type: "folder",
multiple, multiple,
@ -646,7 +706,11 @@ export async function selectDriveFolder(multiple: boolean) {
export async function pickEmoji(src: HTMLElement | null, opts) { export async function pickEmoji(src: HTMLElement | null, opts) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkEmojiPickerDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkEmojiPickerDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
src, src,
...opts, ...opts,
@ -669,7 +733,11 @@ export async function cropImage(
): Promise<Misskey.entities.DriveFile> { ): Promise<Misskey.entities.DriveFile> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkCropperDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkCropperDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
file: image, file: image,
aspectRatio: options.aspectRatio, aspectRatio: options.aspectRatio,
@ -733,7 +801,11 @@ export async function openEmojiPicker(
}); });
openingEmojiPicker = await popup( openingEmojiPicker = await popup(
defineAsyncComponent({ loader: () => import("@/components/MkEmojiPickerDialog.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkEmojiPickerDialog.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
src, src,
...opts, ...opts,
@ -766,7 +838,11 @@ export function popupMenu(
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let dispose; let dispose;
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkPopupMenu.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkPopupMenu.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
items, items,
src, src,
@ -794,7 +870,11 @@ export function contextMenu(
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let dispose; let dispose;
popup( popup(
defineAsyncComponent({ loader: () => import("@/components/MkContextMenu.vue"), loadingComponent: MkWaitingDialog, delay: 1000 }), defineAsyncComponent({
loader: () => import("@/components/MkContextMenu.vue"),
loadingComponent: MkWaitingDialog,
delay: 1000,
}),
{ {
items, items,
ev, ev,

View file

@ -55,12 +55,12 @@
i18n.ts.disablePagesScript i18n.ts.disablePagesScript
}}</FormSwitch> }}</FormSwitch>
<FormSwitch v-model="profile.showTimelineReplies" class="_formBlock" <FormSwitch v-model="profile.showTimelineReplies" class="_formBlock"
>{{ i18n.ts.flagShowTimelineReplies >{{ i18n.ts.flagShowTimelineReplies
}}<template #caption }}<template #caption
>{{ i18n.ts.flagShowTimelineRepliesDescription }} >{{ i18n.ts.flagShowTimelineRepliesDescription }}
{{ i18n.ts.reflectMayTakeTime }}</template {{ i18n.ts.reflectMayTakeTime }}</template
></FormSwitch ></FormSwitch
> >
<FormSelect v-model="serverDisconnectedBehavior" class="_formBlock"> <FormSelect v-model="serverDisconnectedBehavior" class="_formBlock">
<template #label>{{ i18n.ts.whenServerDisconnected }}</template> <template #label>{{ i18n.ts.whenServerDisconnected }}</template>
@ -168,8 +168,12 @@
<FormSelect v-model="instanceTicker" class="_formBlock"> <FormSelect v-model="instanceTicker" class="_formBlock">
<template #label>{{ i18n.ts.instanceTicker }}</template> <template #label>{{ i18n.ts.instanceTicker }}</template>
<option value="none">{{ i18n.ts._instanceTicker.none }}</option> <option value="none">{{ i18n.ts._instanceTicker.none }}</option>
<option value="remote">{{ i18n.ts._instanceTicker.remote }}</option> <option value="remote">
<option value="always">{{ i18n.ts._instanceTicker.always }}</option> {{ i18n.ts._instanceTicker.remote }}
</option>
<option value="always">
{{ i18n.ts._instanceTicker.always }}
</option>
</FormSelect> </FormSelect>
<FormSelect v-model="nsfw" class="_formBlock"> <FormSelect v-model="nsfw" class="_formBlock">

View file

@ -7,7 +7,9 @@
><i class="ph-airplane-takeoff ph-bold ph-lg"></i ><i class="ph-airplane-takeoff ph-bold ph-lg"></i
></template> ></template>
<template #label>{{ i18n.ts.moveToLabel }}</template> <template #label>{{ i18n.ts.moveToLabel }}</template>
<template #caption>{{ i18n.ts.moveAccountDescription }}</template> <template #caption>{{
i18n.ts.moveAccountDescription
}}</template>
</FormInput> </FormInput>
<FormButton primary danger @click="move(moveToAccount)"> <FormButton primary danger @click="move(moveToAccount)">
{{ i18n.ts.moveAccount }} {{ i18n.ts.moveAccount }}

View file

@ -1,5 +1,8 @@
<template> <template>
<div class="dkgtipfy" :class="{ wallpaper, isMobile, centered: ui === 'classic' }"> <div
class="dkgtipfy"
:class="{ wallpaper, isMobile, centered: ui === 'classic' }"
>
<XSidebar v-if="!isMobile" class="sidebar" /> <XSidebar v-if="!isMobile" class="sidebar" />
<MkStickyContainer class="contents"> <MkStickyContainer class="contents">

View file

@ -1,5 +1,10 @@
<template> <template>
<XPostForm class="_panel mkw-postForm" :fixed="true" :autofocus="false" /> <XPostForm
class="_panel mkw-postForm"
:fixed="true"
:autofocus="false"
:show-mfm-cheat-sheet="true"
/>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>