mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
This commit is contained in:
parent
35081c1e9b
commit
e2a18447bd
11 changed files with 88 additions and 24 deletions
|
|
@ -1,5 +1,14 @@
|
|||
document.body.insertAdjacentHTML('afterBegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<symbol id="iconDatabase" viewBox="0 0 32 32">
|
||||
<path d="M16 14.278q-6.932 0-11.216-2.11t-4.284-4.779q0-2.712 4.284-4.801t11.216-2.088 11.216 2.088 4.284 4.801q0 2.669-4.284 4.779t-11.216 2.11zM16 22.889q-6.286 0-10.893-1.894t-4.607-4.564v-4.306q0 1.679 1.615 2.906t4.004 2.024 5.081 1.163 4.801 0.366q2.153 0 4.822-0.366t5.059-1.141 4.004-2.002 1.615-2.949v4.306q0 2.669-4.607 4.564t-10.893 1.894zM16 31.5q-6.286 0-10.893-1.894t-4.607-4.564v-4.306q0 1.679 1.615 2.906t4.004 2.024 5.081 1.163 4.801 0.366q2.153 0 4.822-0.366t5.059-1.141 4.004-2.002 1.615-2.949v4.306q0 2.669-4.607 4.564t-10.893 1.894z"></path>
|
||||
</symbol>
|
||||
<symbol id="iconKeyboardHide" viewBox="0 0 32 32">
|
||||
<path d="M16 31.5l-5.696-5.735h11.431l-5.735 5.735zM2.825 22.2q-0.93 0-1.627-0.698t-0.698-1.628v-17.050q0-0.93 0.698-1.627t1.627-0.698h26.35q0.93 0 1.628 0.698t0.698 1.627v17.050q0 0.93-0.698 1.628t-1.628 0.698h-26.35zM2.825 19.875h26.35v-17.050h-26.35v17.050zM9.955 17.356h12.129v-2.325h-12.129v2.325zM5.034 12.512h2.325v-2.325h-2.325v2.325zM9.955 12.512h2.325v-2.325h-2.325v2.325zM14.838 12.512h2.325v-2.325h-2.325v2.325zM19.759 12.512h2.325v-2.325h-2.325v2.325zM24.641 12.512h2.325v-2.325h-2.325v2.325zM5.034 7.669h2.325v-2.325h-2.325v2.325zM9.955 7.669h2.325v-2.325h-2.325v2.325zM14.838 7.669h2.325v-2.325h-2.325v2.325zM19.759 7.669h2.325v-2.325h-2.325v2.325zM24.641 7.669h2.325v-2.325h-2.325v2.325zM2.825 19.875v0z"></path>
|
||||
</symbol>
|
||||
<symbol id="iconBIU" viewBox="0 0 32 32">
|
||||
<path d="M1.2 22.167v-12.333h5.021c0.969 0 1.81 0.308 2.522 0.925s1.068 1.395 1.068 2.335c0 0.558-0.154 1.072-0.463 1.542s-0.719 0.83-1.233 1.079v0.132c0.631 0.206 1.142 0.573 1.531 1.101s0.584 1.123 0.584 1.784c0 0.998-0.385 1.821-1.156 2.467s-1.67 0.969-2.698 0.969zM3.094 20.493h3.171c0.558 0 1.042-0.184 1.454-0.551s0.617-0.83 0.617-1.387c0-0.543-0.206-0.998-0.617-1.366s-0.896-0.551-1.454-0.551h-3.171zM3.094 15.053h2.995c0.514 0 0.958-0.169 1.332-0.507s0.562-0.764 0.562-1.277c0-0.514-0.187-0.943-0.562-1.288s-0.819-0.518-1.332-0.518h-2.995zM10.23 22.167v-1.734h2.905l3.013-8.865h-3.446v-1.734h8.237v1.734h-2.904l-3.013 8.865h3.446v1.734zM20.933 22.167v-1.057h9.867v1.057zM25.867 19.7c-1.175 0-2.094-0.344-2.757-1.031s-0.995-1.618-0.995-2.793v-6.043h1.462v6.043c0 0.74 0.2 1.333 0.599 1.779s0.963 0.669 1.691 0.669c0.728 0 1.292-0.223 1.691-0.669s0.599-1.040 0.599-1.78v-6.043h1.462v6.043c0 1.175-0.332 2.106-0.995 2.793s-1.583 1.031-2.757 1.031z"></path>
|
||||
</symbol>
|
||||
<symbol id="iconCloud" viewBox="0 0 32 32">
|
||||
<path d="M25.8 13.387c-0.907-4.6-4.947-8.053-9.8-8.053-3.853 0-7.187 2.187-8.853 5.387-4.013 0.427-7.147 3.813-7.147 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613zM25.333 24h-17.333c-2.947 0-5.333-2.387-5.333-5.333s2.387-5.333 5.333-5.333 5.333 2.387 5.333 5.333h2.667c0-3.68-2.48-6.773-5.867-7.707 1.347-1.787 3.467-2.96 5.867-2.96 4.040 0 7.333 3.293 7.333 7.333v0.667h2c2.2 0 4 1.8 4 4s-1.8 4-4 4z"></path>
|
||||
</symbol>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,24 @@
|
|||
<body>
|
||||
<h2>SiYuan</h2>
|
||||
<div class="fn__clear">
|
||||
<div>
|
||||
<svg>
|
||||
<use xlink:href="#iconDatabase"></use>
|
||||
</svg>
|
||||
iconDatabase
|
||||
</div>
|
||||
<div>
|
||||
<svg>
|
||||
<use xlink:href="#iconBIU"></use>
|
||||
</svg>
|
||||
iconBIU
|
||||
</div>
|
||||
<div>
|
||||
<svg>
|
||||
<use xlink:href="#iconKeyboardHide"></use>
|
||||
</svg>
|
||||
iconKeyboardHide
|
||||
</div>
|
||||
<div>
|
||||
<svg>
|
||||
<use xlink:href="#iconWorkspace"></use>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
document.body.insertAdjacentHTML('afterbegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<symbol id="iconDatabase" viewBox="0 0 32 32">
|
||||
<path d="M16 14.278q-6.932 0-11.216-2.11t-4.284-4.779q0-2.712 4.284-4.801t11.216-2.088 11.216 2.088 4.284 4.801q0 2.669-4.284 4.779t-11.216 2.11zM16 22.889q-6.286 0-10.893-1.894t-4.607-4.564v-4.306q0 1.679 1.615 2.906t4.004 2.024 5.081 1.163 4.801 0.366q2.153 0 4.822-0.366t5.059-1.141 4.004-2.002 1.615-2.949v4.306q0 2.669-4.607 4.564t-10.893 1.894zM16 31.5q-6.286 0-10.893-1.894t-4.607-4.564v-4.306q0 1.679 1.615 2.906t4.004 2.024 5.081 1.163 4.801 0.366q2.153 0 4.822-0.366t5.059-1.141 4.004-2.002 1.615-2.949v4.306q0 2.669-4.607 4.564t-10.893 1.894z"></path>
|
||||
</symbol>
|
||||
<symbol id="iconKeyboardHide" viewBox="0 0 32 32">
|
||||
<path d="M16 31.5l-5.696-5.735h11.431l-5.735 5.735zM2.825 22.2q-0.93 0-1.627-0.698t-0.698-1.628v-17.050q0-0.93 0.698-1.627t1.627-0.698h26.35q0.93 0 1.628 0.698t0.698 1.627v17.050q0 0.93-0.698 1.628t-1.628 0.698h-26.35zM2.825 19.875h26.35v-17.050h-26.35v17.050zM9.955 17.356h12.129v-2.325h-12.129v2.325zM5.034 12.512h2.325v-2.325h-2.325v2.325zM9.955 12.512h2.325v-2.325h-2.325v2.325zM14.838 12.512h2.325v-2.325h-2.325v2.325zM19.759 12.512h2.325v-2.325h-2.325v2.325zM24.641 12.512h2.325v-2.325h-2.325v2.325zM5.034 7.669h2.325v-2.325h-2.325v2.325zM9.955 7.669h2.325v-2.325h-2.325v2.325zM14.838 7.669h2.325v-2.325h-2.325v2.325zM19.759 7.669h2.325v-2.325h-2.325v2.325zM24.641 7.669h2.325v-2.325h-2.325v2.325zM2.825 19.875v0z"></path>
|
||||
</symbol>
|
||||
<symbol id="iconBIU" viewBox="0 0 32 32">
|
||||
<path d="M1.2 22.167v-12.333h5.021c0.969 0 1.81 0.308 2.522 0.925s1.068 1.395 1.068 2.335c0 0.558-0.154 1.072-0.463 1.542s-0.719 0.83-1.233 1.079v0.132c0.631 0.206 1.142 0.573 1.531 1.101s0.584 1.123 0.584 1.784c0 0.998-0.385 1.821-1.156 2.467s-1.67 0.969-2.698 0.969zM3.094 20.493h3.171c0.558 0 1.042-0.184 1.454-0.551s0.617-0.83 0.617-1.387c0-0.543-0.206-0.998-0.617-1.366s-0.896-0.551-1.454-0.551h-3.171zM3.094 15.053h2.995c0.514 0 0.958-0.169 1.332-0.507s0.562-0.764 0.562-1.277c0-0.514-0.187-0.943-0.562-1.288s-0.819-0.518-1.332-0.518h-2.995zM10.23 22.167v-1.734h2.905l3.013-8.865h-3.446v-1.734h8.237v1.734h-2.904l-3.013 8.865h3.446v1.734zM20.933 22.167v-1.057h9.867v1.057zM25.867 19.7c-1.175 0-2.094-0.344-2.757-1.031s-0.995-1.618-0.995-2.793v-6.043h1.462v6.043c0 0.74 0.2 1.333 0.599 1.779s0.963 0.669 1.691 0.669c0.728 0 1.292-0.223 1.691-0.669s0.599-1.040 0.599-1.78v-6.043h1.462v6.043c0 1.175-0.332 2.106-0.995 2.793s-1.583 1.031-2.757 1.031z"></path>
|
||||
</symbol>
|
||||
<symbol id="iconCloud" viewBox="0 0 32 32">
|
||||
<path d="M25.8 13.387c-0.907-4.6-4.947-8.053-9.8-8.053-3.853 0-7.187 2.187-8.853 5.387-4.013 0.427-7.147 3.813-7.147 7.947 0 4.413 3.587 8 8 8h17.333c3.68 0 6.667-2.987 6.667-6.667 0-3.52-2.733-6.373-6.2-6.613zM25.333 24h-17.333c-2.947 0-5.333-2.387-5.333-5.333s2.387-5.333 5.333-5.333 5.333 2.387 5.333 5.333h2.667c0-3.68-2.48-6.773-5.867-7.707 1.347-1.787 3.467-2.96 5.867-2.96 4.040 0 7.333 3.293 7.333 7.333v0.667h2c2.2 0 4 1.8 4 4s-1.8 4-4 4z"></path>
|
||||
</symbol>
|
||||
|
|
|
|||
|
|
@ -245,9 +245,10 @@
|
|||
|
||||
&__split {
|
||||
width: 1px;
|
||||
height: 70%;
|
||||
height: 28px;
|
||||
background: var(--b3-border-color);
|
||||
align-self: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
|
|
@ -258,8 +259,15 @@
|
|||
svg {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
float: left;
|
||||
padding: 12px;
|
||||
color: var(--b3-theme-on-surface);
|
||||
|
||||
&.keyboard__svg--big {
|
||||
width: 30px;
|
||||
padding: 4px;
|
||||
height: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {promiseTransactions} from "../protyle/wysiwyg/transaction";
|
|||
import {bootSync} from "../dialog/processSystem";
|
||||
import {initMessage} from "../dialog/message";
|
||||
import {goBack} from "./util/MobileBackFoward";
|
||||
import {hideKeyboardToolbar, showKeyboardToolbar} from "./util/showKeyboardToolbar";
|
||||
import {hideKeyboardToolbar, showKeyboardToolbar} from "./util/keyboardToolbar";
|
||||
import {getLocalStorage} from "../protyle/util/compatibility";
|
||||
import {openMobileFileById} from "./editor";
|
||||
import {getSearch} from "../util/functions";
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import {hasTopClosestByTag} from "../../protyle/util/hasClosest";
|
|||
import {MobileBacklinks} from "./MobileBacklinks";
|
||||
import {MobileBookmarks} from "./MobileBookmarks";
|
||||
import {MobileTags} from "./MobileTags";
|
||||
import {hideKeyboard, hideKeyboardToolbar, initKeyboardToolbar} from "./showKeyboardToolbar";
|
||||
import {hideKeyboard, hideKeyboardToolbar, initKeyboardToolbar} from "./keyboardToolbar";
|
||||
import {getSearch} from "../../util/functions";
|
||||
import {syncGuide} from "../../sync/syncGuide";
|
||||
|
||||
|
|
|
|||
|
|
@ -37,24 +37,45 @@ export const showKeyboardToolbar = (bottom = 0) => {
|
|||
|
||||
export const renderKeyboardToolbar = (protyle: IProtyle, range: Range) => {
|
||||
const toolbarElement = document.getElementById("keyboardToolbar");
|
||||
toolbarElement.innerHTML = `<div class="keyboard__dynamic">
|
||||
<button data-type="indent"><svg><use xlink:href="#iconIndent"></use></svg></button>
|
||||
<button data-type="outdent"><svg><use xlink:href="#iconOutdent"></use></svg></button>
|
||||
|
||||
<button data-type="up"><svg><use xlink:href="#iconUp"></use></svg></button>
|
||||
<button data-type="down"><svg><use xlink:href="#iconDown"></use></svg></button>
|
||||
|
||||
<button data-type="before"><svg><use xlink:href="#iconBefore"></use></svg></button>
|
||||
<button data-type="after"><svg><use xlink:href="#iconAfter"></use></svg></button>
|
||||
|
||||
const inlineHTML = `<button data-type="indent"><svg><use xlink:href="#iconBack"></use></svg></button>
|
||||
<button data-type="indent"><svg><use xlink:href="#iconRef"></use></svg></button>
|
||||
<button data-type="block-ref"<use xlink:href="#iconRef"></use></svg></button>
|
||||
<button data-type="a"><svg><use xlink:href="#iconLink"></use></svg></button>
|
||||
<button data-type="text"><svg><use xlink:href="#iconFont"></use></svg></button>
|
||||
<button data-type="strong"><svg><use xlink:href="#iconBold"></use></svg></button>
|
||||
<button data-type="em"><svg><use xlink:href="#iconItalic"></use></svg></button>
|
||||
<button data-type="u"><svg><use xlink:href="#iconUnderline"></use></svg></button>
|
||||
<button data-type="s"><svg><use xlink:href="#iconStrike"></use></svg></button>
|
||||
<button data-type="mark"><svg><use xlink:href="#iconMark"></use></svg></button>
|
||||
<button data-type="sup"><svg><use xlink:href="#iconSup"></use></svg></button>
|
||||
<button data-type="sub"><svg><use xlink:href="#iconSub"></use></svg></button>
|
||||
<button data-type="clear"><svg><use xlink:href="#iconClear"></use></svg></button>
|
||||
|
||||
<button data-type="code"><svg><use xlink:href="#iconInlineCode"></use></svg></button>
|
||||
<button data-type="kbd"<use xlink:href="#iconKeymap"></use></svg></button>
|
||||
<button data-type="tag"><svg><use xlink:href="#iconTags"></use></svg></button>
|
||||
<button data-type="inline-math"><svg><use xlink:href="#iconMath"></use></svg></button>
|
||||
<button data-type="inline-memo"><svg><use xlink:href="#iconM"></use></svg></button>
|
||||
<button data-type="indent"><svg><use xlink:href="#iconClose"></use></svg></button>`
|
||||
const html = `<button data-type="add"><svg><use xlink:href="#iconAdd"></use></svg></button>
|
||||
<button data-type="indent"><svg class="keyboard__svg--big"><use xlink:href="#iconBIU"></use></svg></button>
|
||||
<button data-type="indent"><svg><use xlink:href="#iconTrashcan"></use></svg></button>
|
||||
<span class="keyboard__split"></span>
|
||||
<button data-type="undo"><svg><use xlink:href="#iconUndo"></use></svg></button>
|
||||
<button data-type="redo"><svg><use xlink:href="#iconRedo"></use></svg></button>
|
||||
</div>
|
||||
<span class="fn__flex-1"></span>
|
||||
<button data-type="redo"><svg><use xlink:href="#iconFont"></use></svg></button>
|
||||
<button data-type="redo"><svg><use xlink:href="#iconMore"></use></svg></button>
|
||||
<span class="keyboard__split"></span>
|
||||
<button data-type="done"><svg style="width: 36px"><use xlink:href="#iconRedo"></use></svg></button>`
|
||||
<button data-type="undo"><svg><use xlink:href="#iconIndent"></use></svg></button>
|
||||
<button data-type="redo"><svg><use xlink:href="#iconOutdent"></use></svg></button>
|
||||
<button data-type="redo"><svg><use xlink:href="#iconUp"></use></svg></button>
|
||||
<button data-type="redo"><svg><use xlink:href="#iconDown"></use></svg></button>
|
||||
`
|
||||
toolbarElement.innerHTML = `<div class="fn__flex-1">
|
||||
<div class="keyboard__dynamic">${html}</div>
|
||||
<div class="fn__none keyboard__dynamic">${inlineHTML}</div>
|
||||
</div>
|
||||
<span class="keyboard__split"></span>
|
||||
<button data-type="done"><svg style="width: 36px"><use xlink:href="#iconKeyboardHide"></use></svg></button>`
|
||||
}
|
||||
|
||||
export const hideKeyboardToolbar = () => {
|
||||
|
|
@ -16,7 +16,7 @@ import {Dialog} from "../../dialog";
|
|||
import {syncGuide} from "../../sync/syncGuide";
|
||||
import {openCard} from "../../card/openCard";
|
||||
import {pathPosix} from "../../util/pathName";
|
||||
import {hideKeyboard, hideKeyboardToolbar} from "./showKeyboardToolbar";
|
||||
import {hideKeyboard, hideKeyboardToolbar} from "./keyboardToolbar";
|
||||
|
||||
const showAccountInfo = (modelElement: HTMLElement, modelMainElement: Element) => {
|
||||
closePanel();
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
|
|||
}, {
|
||||
filter: ["属性试图", "shuxingshitu", "sxst", "attribute view"],
|
||||
value: '<div data-type="NodeAttributeView" data-av-type="table"></div>',
|
||||
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"></svg><span class="b3-list-item__text">TODO</span></div>`,
|
||||
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconDatabase"></use></svg><span class="b3-list-item__text">TODO</span></div>`,
|
||||
}, {
|
||||
filter: ["文档", "子文档", "wendang", "wd", "ziwendang", "zwd", "xjwd"],
|
||||
value: Constants.ZWSP + 4,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import {Background} from "./header/Background";
|
|||
import {disabledProtyle, enableProtyle, onGet} from "./util/onGet";
|
||||
import {reloadProtyle} from "./util/reload";
|
||||
import {renderBacklink} from "./wysiwyg/renderBacklink";
|
||||
import {showKeyboardToolbar} from "../mobile/util/showKeyboardToolbar";
|
||||
|
||||
export class Protyle {
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import {pushBack} from "../../util/backForward";
|
|||
import {openAsset, openBy, openFileById} from "../../editor/util";
|
||||
import {openGlobalSearch} from "../../search/util";
|
||||
/// #else
|
||||
import {renderKeyboardToolbar} from "../../mobile/util/showKeyboardToolbar";
|
||||
import {renderKeyboardToolbar} from "../../mobile/util/keyboardToolbar";
|
||||
/// #endif
|
||||
import {BlockPanel} from "../../block/Panel";
|
||||
import {isCtrl, openByMobile} from "../util/compatibility";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue