mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-06-15 18:54:47 -04:00
Build 29095000
This commit is contained in:
parent
096f7d4abd
commit
4c324d211c
27 changed files with 500 additions and 1350 deletions
|
@ -14,7 +14,7 @@ import {
|
|||
MAX_LEVEL_SIZE,
|
||||
MIN_LEVEL_SIZE,
|
||||
} from "./pure_functions";
|
||||
import {toast} from "./toast";
|
||||
import { toast } from "./toast";
|
||||
|
||||
const palette = _palette as Palette;
|
||||
|
||||
|
@ -234,7 +234,7 @@ export async function editRawLevelList(nth: number, color = "W") {
|
|||
});
|
||||
return;
|
||||
}
|
||||
if (action === "copy" || action ==='show_code') {
|
||||
if (action === "copy" || action === "show_code") {
|
||||
let text =
|
||||
"```\n[" +
|
||||
(level.name || "unnamed level")?.replace(/\[|\]/gi, " ") +
|
||||
|
@ -249,21 +249,23 @@ export async function editRawLevelList(nth: number, color = "W") {
|
|||
"]\n```";
|
||||
|
||||
if (action === "copy") {
|
||||
try{
|
||||
await navigator.clipboard.writeText(text);
|
||||
toast(t('editor.editing.copied'))
|
||||
}catch (e){
|
||||
if('message' in e) {
|
||||
toast(e.message)
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
toast(t("editor.editing.copied"));
|
||||
} catch (e) {
|
||||
if ("message" in e) {
|
||||
toast(e.message);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
await asyncAlert({
|
||||
title:t('editor.editing.show_code'),
|
||||
content:[`
|
||||
} else {
|
||||
await asyncAlert({
|
||||
title: t("editor.editing.show_code"),
|
||||
content: [
|
||||
`
|
||||
<pre>${text}</pre>
|
||||
`]
|
||||
})
|
||||
`,
|
||||
],
|
||||
});
|
||||
}
|
||||
// return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue