/// #if !BROWSER import {shell} from "electron"; /// #endif import {confirmDialog} from "../dialog/confirmDialog"; import {getSearch, isMobile, isValidAttrName} from "../util/functions"; import {isLocalPath, movePathTo, moveToPath, pathPosix} from "../util/pathName"; import {MenuItem} from "./Menu"; import {saveExport} from "../protyle/export"; import {openByMobile, writeText} from "../protyle/util/compatibility"; import {fetchPost, fetchSyncPost} from "../util/fetch"; import {hideMessage, showMessage} from "../dialog/message"; import {Dialog} from "../dialog"; import {focusBlock, focusByRange, getEditorRange} from "../protyle/util/selection"; /// #if !MOBILE import {openAsset, openBy} from "../editor/util"; /// #endif import {rename, replaceFileName} from "../editor/rename"; import * as dayjs from "dayjs"; import {Constants} from "../constants"; import {exportImage} from "../protyle/export/util"; import {App} from "../index"; import {renderAVAttribute} from "../protyle/render/av/blockAttr"; import {openAssetNewWindow} from "../window/openNewWindow"; const bindAttrInput = (inputElement: HTMLInputElement, id: string) => { inputElement.addEventListener("change", () => { fetchPost("/api/attr/setBlockAttrs", { id, attrs: {[inputElement.dataset.name]: inputElement.value} }); }); }; export const openWechatNotify = (nodeElement: Element) => { const id = nodeElement.getAttribute("data-node-id"); const range = getEditorRange(nodeElement); const reminder = nodeElement.getAttribute(Constants.CUSTOM_REMINDER_WECHAT); let reminderFormat = ""; if (reminder) { reminderFormat = dayjs(reminder).format("YYYY-MM-DD HH:mm"); } const dialog = new Dialog({ width: isMobile() ? "92vw" : "50vw", title: window.siyuan.languages.wechatReminder, content: `