mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
1f9f3f4c99
commit
de360048d1
3 changed files with 12 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ import {openFile} from "../editor/util";
|
||||||
import {getDisplayName, movePathTo} from "../util/pathName";
|
import {getDisplayName, movePathTo} from "../util/pathName";
|
||||||
import {App} from "../index";
|
import {App} from "../index";
|
||||||
import {resize} from "../protyle/util/resize";
|
import {resize} from "../protyle/util/resize";
|
||||||
|
import {setStorageVal} from "../protyle/util/compatibility";
|
||||||
|
|
||||||
export const genCardHTML = (options: {
|
export const genCardHTML = (options: {
|
||||||
id: string,
|
id: string,
|
||||||
|
|
@ -123,6 +124,10 @@ export const bindCardEvent = (options: {
|
||||||
id?: string,
|
id?: string,
|
||||||
dialog?: Dialog,
|
dialog?: Dialog,
|
||||||
}) => {
|
}) => {
|
||||||
|
if (window.siyuan.storage[Constants.LOCAL_FLASHCARD].fullscreen) {
|
||||||
|
fullscreen(options.element.querySelector(".card__main"),
|
||||||
|
options.element.querySelector('[data-type="fullscreen"]'));
|
||||||
|
}
|
||||||
let index = 0;
|
let index = 0;
|
||||||
const editor = new Protyle(options.app, options.element.querySelector("[data-type='render']") as HTMLElement, {
|
const editor = new Protyle(options.app, options.element.querySelector("[data-type='render']") as HTMLElement, {
|
||||||
blockId: "",
|
blockId: "",
|
||||||
|
|
@ -204,6 +209,8 @@ export const bindCardEvent = (options: {
|
||||||
fullscreen(options.element.querySelector(".card__main"),
|
fullscreen(options.element.querySelector(".card__main"),
|
||||||
options.element.querySelector('[data-type="fullscreen"]'));
|
options.element.querySelector('[data-type="fullscreen"]'));
|
||||||
resize(editor.protyle);
|
resize(editor.protyle);
|
||||||
|
window.siyuan.storage[Constants.LOCAL_FLASHCARD].fullscreen = !window.siyuan.storage[Constants.LOCAL_FLASHCARD].fullscreen
|
||||||
|
setStorageVal(Constants.LOCAL_FLASHCARD, window.siyuan.storage[Constants.LOCAL_FLASHCARD]);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ export abstract class Constants {
|
||||||
public static readonly LOCAL_LAYOUTS = "local-layouts";
|
public static readonly LOCAL_LAYOUTS = "local-layouts";
|
||||||
public static readonly LOCAL_AI = "local-ai";
|
public static readonly LOCAL_AI = "local-ai";
|
||||||
public static readonly LOCAL_PLUGINTOPUNPIN = "local-plugintopunpin";
|
public static readonly LOCAL_PLUGINTOPUNPIN = "local-plugintopunpin";
|
||||||
|
public static readonly LOCAL_FLASHCARD = "local-flashcard";
|
||||||
|
|
||||||
// timeout
|
// timeout
|
||||||
public static readonly TIMEOUT_DBLCLICK = 190;
|
public static readonly TIMEOUT_DBLCLICK = 190;
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,9 @@ export const getLocalStorage = (cb: () => void) => {
|
||||||
defaultStorage[Constants.LOCAL_LAYOUTS] = []; // {name: "", layout:{}}
|
defaultStorage[Constants.LOCAL_LAYOUTS] = []; // {name: "", layout:{}}
|
||||||
defaultStorage[Constants.LOCAL_AI] = []; // {name: "", memo: ""}
|
defaultStorage[Constants.LOCAL_AI] = []; // {name: "", memo: ""}
|
||||||
defaultStorage[Constants.LOCAL_PLUGINTOPUNPIN] = [];
|
defaultStorage[Constants.LOCAL_PLUGINTOPUNPIN] = [];
|
||||||
|
defaultStorage[Constants.LOCAL_FLASHCARD] = {
|
||||||
|
fullscreen: false
|
||||||
|
};
|
||||||
defaultStorage[Constants.LOCAL_BAZAAR] = {
|
defaultStorage[Constants.LOCAL_BAZAAR] = {
|
||||||
theme: "0",
|
theme: "0",
|
||||||
template: "0",
|
template: "0",
|
||||||
|
|
@ -235,7 +238,7 @@ export const getLocalStorage = (cb: () => void) => {
|
||||||
[Constants.LOCAL_EXPORTIMG, Constants.LOCAL_SEARCHKEYS, Constants.LOCAL_PDFTHEME, Constants.LOCAL_BAZAAR,
|
[Constants.LOCAL_EXPORTIMG, Constants.LOCAL_SEARCHKEYS, Constants.LOCAL_PDFTHEME, Constants.LOCAL_BAZAAR,
|
||||||
Constants.LOCAL_EXPORTWORD, Constants.LOCAL_EXPORTPDF, Constants.LOCAL_DOCINFO, Constants.LOCAL_FONTSTYLES,
|
Constants.LOCAL_EXPORTWORD, Constants.LOCAL_EXPORTPDF, Constants.LOCAL_DOCINFO, Constants.LOCAL_FONTSTYLES,
|
||||||
Constants.LOCAL_SEARCHDATA, Constants.LOCAL_ZOOM, Constants.LOCAL_LAYOUTS, Constants.LOCAL_AI,
|
Constants.LOCAL_SEARCHDATA, Constants.LOCAL_ZOOM, Constants.LOCAL_LAYOUTS, Constants.LOCAL_AI,
|
||||||
Constants.LOCAL_PLUGINTOPUNPIN, Constants.LOCAL_SEARCHASSET].forEach((key) => {
|
Constants.LOCAL_PLUGINTOPUNPIN, Constants.LOCAL_SEARCHASSET, Constants.LOCAL_FLASHCARD].forEach((key) => {
|
||||||
if (typeof response.data[key] === "string") {
|
if (typeof response.data[key] === "string") {
|
||||||
try {
|
try {
|
||||||
const parseData = JSON.parse(response.data[key]);
|
const parseData = JSON.parse(response.data[key]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue