This commit is contained in:
Vanessa 2022-07-13 12:00:00 +08:00
parent 1c6ade429b
commit 275852c86c
4 changed files with 26 additions and 0 deletions

View file

@ -1,5 +1,11 @@
document.body.insertAdjacentHTML('afterBegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="iconTransform" viewBox="0 0 32 32">
<path d="M0.333 17.666h2.649c0.183 0 0.333-0.15 0.333-0.333v-10.635h22.019v3.024c0 0.079 0.025 0.154 0.075 0.217 0.064 0.081 0.162 0.133 0.273 0.133 0.081 0 0.156-0.028 0.215-0.075l-0.001 0.001 5.969-4.686c0.179-0.208 0.15-0.429 0-0.55l-5.969-4.682c-0.058-0.047-0.133-0.075-0.214-0.075-0.001 0-0.002 0-0.003 0h0c-0.192 0-0.35 0.158-0.35 0.35v3.024h-22.344c-1.645 0-2.987 1.341-2.987 2.991v10.964c0 0.183 0.15 0.333 0.333 0.333zM31.658 14.334h-2.649c-0.183 0-0.333 0.15-0.333 0.333v10.635h-22.019v-3.024c0-0.079-0.025-0.154-0.075-0.217-0.064-0.081-0.162-0.133-0.273-0.133-0.081 0-0.156 0.028-0.215 0.075l0.001-0.001-5.969 4.686c-0.179 0.208-0.15 0.429 0 0.55l5.969 4.682c0.062 0.050 0.137 0.075 0.217 0.075 0.192 0 0.35-0.158 0.35-0.35v-3.024h22.352c1.645 0 2.987-1.341 2.987-2.991v-10.964c-0.008-0.183-0.158-0.333-0.342-0.333z"></path>
</symbol>
<symbol id="iconFormat" viewBox="0 0 32 32">
<path d="M28.148 3.556h-2.074v-2.667c0-0.493-0.396-0.889-0.889-0.889h-21.926c-0.493 0-0.889 0.396-0.889 0.889v10.074c0 0.493 0.396 0.889 0.889 0.889h21.926c0.493 0 0.889-0.396 0.889-0.889v-5.037h1.185v7.407h-13c-0.819 0-1.481 0.663-1.481 1.481v5.037h-1.63c-0.163 0-0.296 0.133-0.296 0.296v8.444c0 0.022 0.004 0.048 0.007 0.070-0.005 0.068-0.008 0.147-0.008 0.226 0 1.718 1.393 3.111 3.111 3.111 0 0 0.001 0 0.001 0h-0c1.719 0 3.111-1.393 3.111-3.111 0-0.078-0.004-0.152-0.007-0.226 0.004-0.022 0.007-0.044 0.007-0.070v-8.444c0-0.163-0.133-0.296-0.296-0.296h-1.63v-4.148h13c0.819 0 1.481-0.663 1.481-1.481v-9.185c0-0.819-0.663-1.481-1.481-1.481zM23.704 9.482h-18.963v-7.111h18.963v7.111zM14.704 28.889c0 0.407-0.333 0.741-0.741 0.741s-0.741-0.333-0.741-0.741v-6.667h1.481v6.667z"></path>
</symbol>
<symbol id="iconQuit" viewBox="0 0 32 32">
<path d="M16 32c-8.009 0-14.5-6.491-14.5-14.5 0-6.062 3.722-11.253 9-13.419v0.004c0.156-0.056 0.324-0.086 0.501-0.086 0.826 0 1.501 0.671 1.501 1.499 0 0.652-0.417 1.21-1.002 1.415v0.001c-4.113 1.75-7 5.831-7 10.584 0 6.352 5.148 11.5 11.5 11.5s11.501-5.149 11.501-11.5c0-4.753-2.884-8.834-7.001-10.584-0.583-0.205-1-0.762-1-1.415 0-0.828 0.671-1.5 1.5-1.5 0.174 0 0.341 0.030 0.5 0.086v-0.004c5.283 2.166 9 7.357 9 13.419 0.001 8.009-6.491 14.499-14.5 14.499zM16 16.5c-0.827 0-1.499-0.671-1.499-1.501v-13.5c-0.001-0.826 0.672-1.5 1.499-1.5 0.828 0 1.5 0.672 1.5 1.5v13.499c0 0.829-0.671 1.502-1.5 1.502z"></path>
</symbol>

View file

@ -28,6 +28,18 @@
<body>
<h2>SiYuan</h2>
<div class="fn__clear">
<div>
<svg>
<use xlink:href="#iconTransform"></use>
</svg>
iconTransform
</div>
<div>
<svg>
<use xlink:href="#iconFormat"></use>
</svg>
iconFormat
</div>
<div>
<svg>
<use xlink:href="#iconQuit"></use>

View file

@ -1,5 +1,11 @@
document.body.insertAdjacentHTML('afterbegin', `
<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg"><defs>
<symbol id="iconTransform" viewBox="0 0 32 32">
<path d="M30.546 24.727v-2.909h-20.364v-17.455h2.909l-4.364-4.364-4.364 4.364h2.909v2.909h-5.818v2.909h5.818v11.636c0 1.6 1.309 2.909 2.909 2.909h11.636v2.909h-2.909l4.364 4.364 4.364-4.364h-2.909v-2.909h5.818zM13.091 10.182h8.727v8.727h2.909v-8.727c0-1.6-1.309-2.909-2.909-2.909h-8.727v2.909z"></path>
</symbol>
<symbol id="iconFormat" viewBox="0 0 32 32">
<path d="M24.8 3.2v-1.6c0-0.88-0.72-1.6-1.6-1.6h-19.2c-0.88 0-1.6 0.72-1.6 1.6v6.4c0 0.88 0.72 1.6 1.6 1.6h19.2c0.88 0 1.6-0.72 1.6-1.6v-1.6h1.6v6.4h-16v17.6c0 0.88 0.72 1.6 1.6 1.6h3.2c0.88 0 1.6-0.72 1.6-1.6v-14.4h12.8v-12.8h-4.8zM21.6 6.4h-16v-3.2h16v3.2z"></path>
</symbol>
<symbol id="iconQuit" viewBox="0 0 32 32">
<path d="M16 32c-8.009 0-14.5-6.491-14.5-14.5 0-6.062 3.722-11.253 9-13.419v0.004c0.156-0.056 0.324-0.086 0.501-0.086 0.826 0 1.501 0.671 1.501 1.499 0 0.652-0.417 1.21-1.002 1.415v0.001c-4.113 1.75-7 5.831-7 10.584 0 6.352 5.148 11.5 11.5 11.5s11.501-5.149 11.501-11.5c0-4.753-2.884-8.834-7.001-10.584-0.583-0.205-1-0.762-1-1.415 0-0.828 0.671-1.5 1.5-1.5 0.174 0 0.341 0.030 0.5 0.086v-0.004c5.283 2.166 9 7.357 9 13.419 0.001 8.009-6.491 14.499-14.5 14.499zM16 16.5c-0.827 0-1.499-0.671-1.499-1.501v-13.5c-0.001-0.826 0.672-1.5 1.499-1.5 0.828 0 1.5 0.672 1.5 1.5v13.499c0 0.829-0.671 1.502-1.5 1.502z"></path>
</symbol>

View file

@ -216,6 +216,7 @@ export class Breadcrumb {
}).element);
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.netImg2LocalAsset,
icon: "iconTransform",
click: () => {
fetchPost("/api/format/netImg2LocalAssets", {
id: protyle.block.rootID
@ -246,6 +247,7 @@ export class Breadcrumb {
}).element);
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.optimizeTypography,
icon: "iconFormat",
click: () => {
fetchPost("/api/format/autoSpace", {
id: protyle.block.rootID