Skip to content

Commit

Permalink
Merge pull request #15 from oflg/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Gk0Wk authored Oct 13, 2023
2 parents 21f3fd6 + c98c140 commit 449f8ee
Show file tree
Hide file tree
Showing 8 changed files with 12,678 additions and 17 deletions.
12,663 changes: 12,663 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/drawio/icon.tid
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
title: $:/plugins/Gk0Wk/drawio/icon
tags: $:/tags/Image

{{$:/plugins/Gk0Wk/drawio/new-drawio-diagram-icon}}
<svg width="22pt" height="22pt" class="tc-image-button" viewBox="0 0 128 128">
<g id="draw" clip-path="url(#clip_1)">
<path d="M128 0L128 0L128 128L0 128L0 0L128 0Z" id="draw" fill="none" stroke="none" />
<path d="M101.848 114.126L101.848 125.337C101.848 126.984 103.241 128.319 104.958 128.319L110.244 128.319C111.962 128.319 113.354 126.984 113.354 125.337L113.354 114.126L125.046 114.126C126.764 114.126 128.156 112.791 128.156 111.144L128.156 106.373C128.156 104.726 126.764 103.391 125.046 103.391L113.354 103.391L113.354 91.9411C113.354 90.2943 111.962 88.9594 110.244 88.9594L104.958 88.9594C103.241 88.9594 101.848 90.2943 101.848 91.9411L101.848 103.391L89.8451 103.391C88.1277 103.391 86.7354 104.726 86.7354 106.373L86.7354 111.144C86.7354 112.791 88.1277 114.126 89.8451 114.126L101.848 114.126ZM60.474 1.59869L60.474 1.59869C60.474 1.59869 60.474 1.59869 60.474 1.59869C55.7146 -1.03617 49.6287 0.527467 46.8808 5.09117L1.49079 80.476C-1.25707 85.0397 0.37363 90.8753 5.13306 93.5102L58.0708 122.817C62.8302 125.452 68.9161 123.888 71.6639 119.324L117.054 43.9396C117.054 43.9396 117.054 43.9396 117.054 43.9396C119.802 39.3759 118.171 33.5403 113.412 30.9054L60.474 1.59869L60.474 1.59869ZM56.5918 51.9022L56.5918 51.9022C55.3231 50.5536 55.1422 48.3175 56.287 46.4161L62.0179 36.8981C63.394 34.6126 66.1645 33.6761 68.206 34.8062L79.5725 41.0988C81.614 42.229 82.1534 44.9979 80.7772 47.2834L75.0464 56.8014C73.9006 58.7043 71.7881 59.6721 69.9347 59.2904L68.8553 76.1343L75.2842 79.6934C77.3257 80.8236 77.8651 83.5926 76.489 85.878L70.7581 95.396C69.382 97.6815 66.6115 98.6181 64.57 97.4879L53.2035 91.1953C51.162 90.0651 50.6227 87.2962 51.9988 85.0107L57.7296 75.4927C59.1058 73.2072 61.8763 72.2707 63.9177 73.4009L64.925 73.9585C65.1558 69.9973 65.6868 60.8327 65.8722 57.2402L60.4735 54.2514C57.3215 56.2016 49.3099 61.2249 45.8476 63.3971L46.8405 63.9468C48.882 65.0769 49.4214 67.8459 48.0453 70.1314L42.3144 79.6493C40.9383 81.9348 38.1678 82.8714 36.1263 81.7412L24.7598 75.4486C22.7183 74.3185 22.1789 71.5495 23.555 69.264L29.2859 59.7461C30.662 57.4606 33.4325 56.524 35.474 57.6542L41.9174 61.2213L56.5918 51.9022L56.5918 51.9022L56.5918 51.9022Z" id="Shape" fill-rule="evenodd" stroke="none" />
</g>
</svg>
8 changes: 0 additions & 8 deletions src/drawio/new-drawio-diagram-icon.tid

This file was deleted.

4 changes: 2 additions & 2 deletions src/drawio/new-drawio-diagram.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ title: $:/plugins/Gk0Wk/drawio/new-drawio-diagram
tags: $:/tags/PageControls $:/tags/ViewToolbar
hint: <$text text={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[新建一个draw.io图表条目]else[Create a new draw.io diagram tiddler]] }}} />
description: <$text text={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[新建一个draw.io图表条目]else[Create a new draw.io diagram tiddler]] }}} />
caption: {{$:/plugins/Gk0Wk/drawio/new-drawio-diagram-icon}} <$text text={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[新建图表]else[new diagram]] }}} />
caption: {{$:/plugins/Gk0Wk/drawio/icon}} <$text text={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[新建图表]else[new diagram]] }}} />

\whitespace trim

Expand All @@ -16,7 +16,7 @@ caption: {{$:/plugins/Gk0Wk/drawio/new-drawio-diagram-icon}} <$text text={{{ [[$
\whitespace trim
<$button tooltip={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[新建一个draw.io图表条目]else[Create a new draw.io diagram tiddler]] }}} aria-label={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[新建图表]else[new diagram]] }}} class=<<tv-config-toolbar-class>> actions=<<createDiagram>> >
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/plugins/Gk0Wk/drawio/new-drawio-diagram-icon}}
{{$:/plugins/Gk0Wk/drawio/icon}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
Expand Down
2 changes: 1 addition & 1 deletion src/drawio/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"author": "Gk0Wk",
"description": "draw.io powerful diagram editor for TiddlyWiki",
"plugin-type": "plugin",
"version": "0.0.4",
"version": "0.0.5",
"list": "readme config LICENSE"
}
4 changes: 2 additions & 2 deletions src/drawio/readme.tid
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ caption: draw.io

draw.io 是一个强大的在线图表编辑器,可以用来绘制流程图、组织结构图、UML图、网络图、平面图、电路图、数据库图、房屋平面图、地图等等。

现在我将其集成到了 <$text text="TiddlyWiki" /> 中,你可以在这里使用它。点击 {{$:/plugins/Gk0Wk/drawio/new-drawio-diagram-icon}} 按钮,就可以创建一个新的图表条目,该条目在非编辑模式下会显示其绘制的内容,而在编辑模式下则会进入 draw.io 的编辑界面。
现在我将其集成到了 <$text text="TiddlyWiki" /> 中,你可以在这里使用它。点击 {{$:/plugins/Gk0Wk/drawio/icon}} 按钮,就可以创建一个新的图表条目,该条目在非编辑模式下会显示其绘制的内容,而在编辑模式下则会进入 draw.io 的编辑界面。

注意:编辑模式需要联网才能使用,因为 draw.io 是在线编辑器,初次加载需要一定的时间,所以请耐心等待。但是预览图片不需要联网,所以你可以在离线状态下查看图表,此时它和你其他的图片没有区别。

Expand All @@ -29,7 +29,7 @@ draw.io 是一个强大的在线图表编辑器,可以用来绘制流程图、

draw.io is a powerful online diagram editor that can be used to draw flowcharts, organizational charts, UML diagrams, network diagrams, floor plans, circuit diagrams, database diagrams, house floor plans, maps, etc.

Now I have integrated it into <$text text="TiddlyWiki" />, you can use it here. Click the {{$:/plugins/Gk0Wk/drawio/new-drawio-diagram-icon}} button to create a new diagram tiddler, which will display its drawing content in non-editing mode, and will enter the draw.io editing interface in editing mode.
Now I have integrated it into <$text text="TiddlyWiki" />, you can use it here. Click the {{$:/plugins/Gk0Wk/drawio/icon}} button to create a new diagram tiddler, which will display its drawing content in non-editing mode, and will enter the draw.io editing interface in editing mode.

Note: The editing mode requires networking, because draw.io is an online editor, which takes some time to load for the first time, so please be patient. But the preview image does not require networking, so you can view the chart in offline mode, and it is no different from your other images.

Expand Down
4 changes: 2 additions & 2 deletions src/focused-tiddler/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const updateTopOffset = () => {
};
const check = () => {
const tiddlers = document.querySelectorAll(
'.tc-story-river > .tc-tiddler-frame',
'.tc-story-river .tc-tiddler-frame',
);
if (tiddlers.length === 0) {
update(null);
Expand Down Expand Up @@ -71,7 +71,7 @@ export const startup = () => {
return;
}
const tiddlers = document.querySelectorAll(
'.tc-story-river > .tc-tiddler-frame',
'.tc-story-river .tc-tiddler-frame',
);
for (let i = tiddlers.length - 1; i >= 0; i--) {
if (tiddlers[i].contains(target as any)) {
Expand Down
2 changes: 1 addition & 1 deletion src/focused-tiddler/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"author": "Gk0Wk",
"description": "Detecting the tiddler you are viewing",
"plugin-type": "plugin",
"version": "0.0.2",
"version": "0.0.3",
"list": "readme config"
}

0 comments on commit 449f8ee

Please sign in to comment.