fix: macos ui bug

This commit is contained in:
xiangyu 2022-05-08 21:57:27 +08:00
parent 8c7b7e9706
commit b38c1ceeaa
9 changed files with 179 additions and 146 deletions

View File

@ -8617,7 +8617,7 @@
left: -4px;
}
.dx-treeview-toggle-item-visibility::before {
content: "\f04e";
content: "";
position: absolute;
display: block;
width: 22px;
@ -8631,7 +8631,7 @@
text-align: center;
}
.dx-treeview-toggle-item-visibility.dx-treeview-toggle-item-visibility-opened::before {
content: "\f001";
content: "";
position: absolute;
display: block;
width: 22px;

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -24,12 +24,6 @@
<description style="white-space: pre-wrap; font-size: large; font-weight: bold;">&zotero.__addonRef__.wizard.page3.header;</description>
<description style="white-space: pre-wrap;">&zotero.__addonRef__.wizard.page3.description;</description>
</wizardpage>
<wizardpage label="&zotero.__addonRef__.wizard.link;">
<image src="chrome://__addonRef__/skin/add-link.gif" width="560" height="400" style="padding-top: 50px;"></image>
<description style="white-space: pre-wrap; font-size: large; font-weight: bold;">&zotero.__addonRef__.wizard.page5.header;</description>
<description style="white-space: pre-wrap;">&zotero.__addonRef__.wizard.page5.description1;</description>
<description style="white-space: pre-wrap;">&zotero.__addonRef__.wizard.page5.description2;</description>
</wizardpage>
<wizardpage label="&zotero.__addonRef__.wizard.layout;">
<image src="chrome://__addonRef__/skin/intro-workspace.png" width="560" height="400"></image>
<description style="white-space: pre-wrap; font-size: large; font-weight: bold;">&zotero.__addonRef__.wizard.page4.header;</description>
@ -37,6 +31,12 @@
<description style="white-space: pre-wrap;">&zotero.__addonRef__.wizard.page4.description2;</description>
<description style="white-space: pre-wrap;">&zotero.__addonRef__.wizard.page4.description3;</description>
</wizardpage>
<wizardpage label="&zotero.__addonRef__.wizard.link;">
<image src="chrome://__addonRef__/skin/add-link.gif" width="560" height="400" style="padding-top: 50px;"></image>
<description style="white-space: pre-wrap; font-size: large; font-weight: bold;">&zotero.__addonRef__.wizard.page5.header;</description>
<description style="white-space: pre-wrap;">&zotero.__addonRef__.wizard.page5.description1;</description>
<description style="white-space: pre-wrap;">&zotero.__addonRef__.wizard.page5.description2;</description>
</wizardpage>
<wizardpage label="&zotero.__addonRef__.wizard.setup;">
<description style="white-space: pre-wrap; font-size: large; font-weight: bold;">&zotero.__addonRef__.wizard.page6.header;</description>
<description style="white-space: pre-wrap;">&zotero.__addonRef__.wizard.page6.description1;</description>

View File

@ -31,17 +31,11 @@
<command id="cmd_close" oncommand="window.close();" />
<hbox flex="1">
<vbox id="zotero-knowledge-outline" flex="1" width="300" minwidth="250" style="overflow: hidden;">
<vbox id="zotero-knowledge-outline" flex="1" width="330" minwidth="300" style="overflow: hidden;">
<html:div class="dx-viewport" id="outline-container">
<div class="demo-container">
<div class="form">
<div class="drive-panel">
<div class="drive-header dx-treeview-item">
<div class="dx-treeview-item-content">
<i class="dx-icon dx-icon-hierarchy"></i>
<span>Knowledge Outline</span>
</div>
</div>
<div id="treeview"></div>
</div>
</div>
@ -50,29 +44,54 @@
<html:div id="mindmap-container">
<!-- Inser Here -->
</html:div>
<html:div id="outline-tools" height="50" maxheight="50" minheight="50" style="display: flex; flex-flex-direction: row; justify-content: space-between; margin: 0px 30px 0px 30px;">
<html:div id="outline-tools" height="50" maxheight="50" minheight="50" style="display: flex; flex-flex-direction: row; justify-content: space-between; margin: 0px 20px 0px 20px;">
<div class="tooltip">
<div id="outline-selectknowledge"></div>
<html:button id="outline-selectknowledge" class="tool-button">
<svg t="1652006500128" class="icon tool-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14011" width="18" height="18">
<path d="M928 352v-48c0-35.3-28.7-64-64-64H485.2c-21 0-40.7-10.3-52.6-27.6l-61.5-88.9c-12-17.3-31.6-27.6-52.6-27.6H64c-35.3 0-64 28.7-64 64v656c0 70.7 57.3 128 128 128h638c57.8 0 108.5-38.8 123.6-94.6L928 707.2l74.2-274.5c11-40.7-19.6-80.7-61.8-80.7H928zM80 160h230.1c5.3 0 10.2 2.6 13.2 6.9l50.6 73.1H80c-8.8 0-16-7.2-16-16v-48c0-8.8 7.2-16 16-16z m0 144h768c8.8 0 16 7.2 16 16v32H209c-28.9 0-54.2 19.4-61.8 47.3L79.7 649c-2.4 9-15.7 7.3-15.7-2.1V320c0-8.8 7.2-16 16-16z m784 394.7l-36.2 134c-7.5 27.9-32.9 47.3-61.8 47.3H125.4c-21.1 0-36.4-20-30.9-40.3l111.3-411.8c1.9-7 8.2-11.8 15.4-11.8h698.3c10.5 0 18.2 10 15.4 20.2l-7 25.7L864 698.7z" p-id="14012"></path>
</svg>
</html:button>
<span class="tooltiptext">Select Main Note</span>
</div>
<div class="tooltip">
<div id="outline-switchview"></div>
<html:button id="outline-switchview" class="tool-button">
<svg t="1652006549395" class="icon tool-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14217" width="18" height="18">
<path d="M928 637c-8.8 0-16-7.2-16-16v-77c0-53-43-96-96-96H560c-8.8 0-16-7.2-16-16v-32c0-8.8 7.2-16 16-16h80c53 0 96-43 96-96V144c0-53-43-96-96-96H384c-53 0-96 43-96 96v144c0 53 43 96 96 96h80c8.8 0 16 7.2 16 16v32c0 8.8-7.2 16-16 16H208c-53 0-96 43-96 96v77c0 8.8-7.2 16-16 16-53 0-96 43-96 96v131c0 53 43 96 96 96h96c53 0 96-43 96-96V733c0-53-43-96-96-96-8.8 0-16-7.2-16-16v-77c0-17.7 14.3-32 32-32h256c8.8 0 16 7.2 16 16v94c0 8.3-6.7 15-15 15h-1c-53 0-96 43-96 96v131c0 53 43 96 96 96h96c53 0 96-43 96-96V733c0-53-43-96-96-96h-1c-8.3 0-15-6.7-15-15v-94c0-8.8 7.2-16 16-16h256c17.7 0 32 14.3 32 32v77c0 8.8-7.2 16-16 16-53 0-96 43-96 96v131c0 53 43 96 96 96h96c53 0 96-43 96-96V733c0-53-43-96-96-96z m-736 64c17.6 0 32 14.4 32 32v131c0 17.6-14.4 32-32 32H96c-17.6 0-32-14.4-32-32V733c0-17.6 14.4-32 32-32h96z m368 0c17.6 0 32 14.4 32 32v131c0 17.6-14.4 32-32 32h-96c-17.6 0-32-14.4-32-32V733c0-17.6 14.4-32 32-32h96zM384 320c-17.6 0-32-14.4-32-32V144c0-17.6 14.4-32 32-32h256c17.6 0 32 14.4 32 32v144c0 17.6-14.4 32-32 32H384z m576 544c0 17.6-14.4 32-32 32h-96c-17.6 0-32-14.4-32-32V733c0-17.6 14.4-32 32-32h96c17.6 0 32 14.4 32 32v131z" p-id="14218"></path>
</svg>
</html:button>
<span class="tooltiptext">Switch Outline Mode</span>
</div>
<div class="tooltip">
<div id="outline-addafter"></div>
<html:button id="outline-addafter" class="tool-button">
<svg t="1652006600612" class="icon tool-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14431" width="18" height="18">
<path d="M960.031235 159.921913v703.656418c0 52.974134-42.979014 95.953148-95.953148 95.953148h-703.656418c-52.974134 0-95.953148-42.979014-95.953148-95.953148v-703.656418c0-52.974134 42.979014-95.953148 95.953148-95.953148h703.656418c52.974134 0 95.953148 42.979014 95.953148 95.953148z m-831.593949-159.921913C57.771791 0 0.499756 57.272035 0.499756 127.937531v767.625183c0 70.665495 57.272035 127.937531 127.93753 127.93753h767.625183c70.665495 0 127.937531-57.272035 127.937531-127.93753v-767.625183c0-70.665495-57.272035-127.937531-127.937531-127.937531h-767.625183z" p-id="14432"></path>
<path d="M831.593948 513.149439c-0.499756 17.391508-15.192582 31.084822-32.684041 31.084822H559.726696c-8.795705 0-15.992191 7.196486-15.992191 15.992191v239.183211c0 17.391508-13.693314 32.184285-31.084822 32.684041-18.091166 0.499756-32.883943-13.993167-32.883944-31.984382V560.226452c0-8.795705-7.196486-15.992191-15.992191-15.992191H224.590337c-17.391508 0-32.184285-13.693314-32.684041-31.084822-0.499756-18.091166 13.993167-32.883943 31.984382-32.883944h239.88287c8.795705 0 15.992191-7.196486 15.992191-15.992191V225.090093c0-17.391508 13.693314-32.184285 31.084822-32.684041 18.091166-0.499756 32.883943 13.993167 32.883944 31.984382v239.88287c0 8.795705 7.196486 15.992191 15.992191 15.992191h239.88287c17.991215 0 32.484139 14.792777 31.984382 32.883944z" p-id="14433"></path>
</svg>
</html:button>
<span class="tooltiptext">Add Heading</span>
</div>
<div class="tooltip">
<div id="outline-tab"></div>
<html:button id="outline-indent" class="tool-button">
<svg t="1652006841188" class="icon tool-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5650" width="18" height="18">
<path d="M64 96C64 78.336 78.336 64 96 64l832 0C945.664 64 960 78.336 960 96l0 0C960 113.664 945.664 128 928 128l-832 0C78.336 128 64 113.664 64 96L64 96zM64 864C64 881.664 78.336 896 96 896l832 0c17.664 0 32-14.336 32-32l0 0c0-17.664-14.336-32-32-32l-832 0C78.336 832 64 846.336 64 864L64 864zM320 288C320 305.664 334.336 320 352 320l576 0C945.664 320 960 305.664 960 288l0 0C960 270.336 945.664 256 928 256l-576 0C334.336 256 320 270.336 320 288L320 288zM320 480C320 497.664 334.336 512 352 512l576 0C945.664 512 960 497.664 960 480l0 0C960 462.336 945.664 448 928 448l-576 0C334.336 448 320 462.336 320 480L320 480zM320 672C320 689.664 334.336 704 352 704l576 0c17.664 0 32-14.336 32-32l0 0c0-17.664-14.336-32-32-32l-576 0C334.336 640 320 654.336 320 672L320 672zM100.352 637.312 249.6 488C253.888 483.776 256 478.72 256 473.024S253.888 462.272 249.6 457.984L100.352 308.608C96.064 304.384 91.136 302.4 85.248 302.4c-5.696 0-10.624 1.984-14.976 6.272C66.048 312.896 64 317.888 64 323.648l0 298.752c0 5.76 2.048 10.752 6.272 14.912 4.352 4.288 9.344 6.4 14.976 6.4C91.136 643.712 96.064 641.6 100.352 637.312z" p-id="5651"></path>
</svg>
</html:button>
<span class="tooltiptext">Decrease the selected Heading level</span>
</div>
<div class="tooltip">
<div id="outline-untab"></div>
<html:button id="outline-unindent" class="tool-button">
<svg t="1652006882264" class="icon tool-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5852" width="18" height="18">
<path d="M64 96C64 78.336 78.336 64 96 64l832 0C945.664 64 960 78.336 960 96l0 0C960 113.664 945.664 128 928 128l-832 0C78.336 128 64 113.664 64 96L64 96zM64 864C64 881.664 78.336 896 96 896l832 0c17.664 0 32-14.336 32-32l0 0c0-17.664-14.336-32-32-32l-832 0C78.336 832 64 846.336 64 864L64 864zM320 288C320 305.664 334.336 320 352 320l576 0C945.664 320 960 305.664 960 288l0 0C960 270.336 945.664 256 928 256l-576 0C334.336 256 320 270.336 320 288L320 288zM320 480C320 497.664 334.336 512 352 512l576 0C945.664 512 960 497.664 960 480l0 0C960 462.336 945.664 448 928 448l-576 0C334.336 448 320 462.336 320 480L320 480zM320 672C320 689.664 334.336 704 352 704l576 0c17.664 0 32-14.336 32-32l0 0c0-17.664-14.336-32-32-32l-576 0C334.336 640 320 654.336 320 672L320 672zM219.648 637.312 70.4 488C66.112 483.776 64 478.72 64 473.024s2.112-10.752 6.4-14.976l149.248-149.376c4.288-4.224 9.28-6.272 15.104-6.272 5.696 0 10.624 1.984 14.976 6.272C253.952 312.896 256 317.888 256 323.648l0 298.752c0 5.76-2.048 10.752-6.272 14.912-4.352 4.288-9.344 6.4-14.976 6.4C228.864 643.712 223.936 641.6 219.648 637.312z" p-id="5853"></path>
</svg>
</html:button>
<span class="tooltiptext">Raise the selected Heading level</span>
</div>
<div class="tooltip">
<div id="user-guide"></div>
<html:button id="user-guide" class="tool-button">
<svg t="1652006758604" class="icon tool-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20243" width="18" height="18">
<path d="M430 689h164v-40.834a16 16 0 0 1 10.298-14.95 189.633 189.633 0 0 0 3.863-1.515C703.88 592.731 774 498.971 774 389.5 774 245.078 656.922 128 512.5 128S251 245.078 251 389.5c0 109.285 68.974 202.912 164.356 242.001 1.212 0.497 2.66 1.067 4.348 1.71A16 16 0 0 1 430 648.161V689z m0 64v29a8 8 0 0 0 8 8h148a8 8 0 0 0 8-8v-29H430z m229 71c0 17.673-14.327 32-32 32H399c-17.673 0-32-14.327-32-32V680.75C260.274 627.329 187 516.97 187 389.5 187 209.731 332.731 64 512.5 64S838 209.731 838 389.5c0 127.073-72.817 237.139-179 290.747V824z m-239 72h185c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32H420c-17.673 0-32-14.327-32-32 0-17.673 14.327-32 32-32z" p-id="20244"></path>
</svg>
</html:button>
<span class="tooltiptext">Open User Guide</span>
</div>
</html:div>

View File

@ -37,25 +37,48 @@ li {
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
width: 80px;
background-color: rgb(77, 77, 77);
color: #fff;
text-align: center;
border-radius: 6px;
border-radius: 3px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 100%;
left: 50%;
margin-left: -60px;
margin-left: -40px;
}
.tooltip:hover .tooltiptext {
visibility: visible;
}
.tool-button {
width: 36px;
max-width: 36px;
min-width: 36px;
height: 36px;
max-height: 36px;
min-height: 36px;
border-radius: 3px;
font-family: Arial;
background: #fbfbfb;
border: solid #c9c9c9 1px;
text-decoration: none;
}
.tool-button:hover {
background: #e2e2e2;
text-decoration: none;
}
.tool-button:active {
background: #b3b3b3;
text-decoration: none;
}

View File

@ -31,6 +31,7 @@
},
"devDependencies": {
"@types/jquery": "^3.5.14",
"@types/node": "^17.0.31",
"release-it": "^14.14.0"
}
}

View File

@ -23,7 +23,7 @@ class AddonViews extends AddonBase {
export: `<svg t="1651322116327" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11894" width="24" height="24"><path d="M849.2 599v217H178.5V599c-0.7-23.7-20.1-42.7-44-42.7s-43.3 19-44 42.7v252.5c0 28.9 23.6 52.5 52.5 52.5h741.7c28.9 0 52.5-23.6 52.5-52.5V599c-0.7-23.7-20.1-42.7-44-42.7s-43.3 19-44 42.7z" p-id="11895"></path><path d="M482.7 135.4l-164 164c-17.1 17.1-17.1 45.1 0 62.2s45.1 17.1 62.2 0l85.7-85.7v314.8c0 26 21.3 47.2 47.2 47.2 26 0 47.2-21.3 47.2-47.2V276l85.7 85.7c17.1 17.1 45.1 17.1 62.2 0s17.1-45.1 0-62.2l-164-164c-17.1-17.2-45.1-17.2-62.2-0.1z" p-id="11896"></path></svg>`,
close: `<svg t="1651331457107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12754" width="24" height="24"><path d="M557.311759 513.248864l265.280473-263.904314c12.54369-12.480043 12.607338-32.704421 0.127295-45.248112-12.512727-12.576374-32.704421-12.607338-45.248112-0.127295L512.127295 467.904421 249.088241 204.063755c-12.447359-12.480043-32.704421-12.54369-45.248112-0.063647-12.512727 12.480043-12.54369 32.735385-0.063647 45.280796l262.975407 263.775299-265.151458 263.744335c-12.54369 12.480043-12.607338 32.704421-0.127295 45.248112 6.239161 6.271845 14.463432 9.440452 22.687703 9.440452 8.160624 0 16.319527-3.103239 22.560409-9.311437l265.216826-263.807983 265.440452 266.240344c6.239161 6.271845 14.432469 9.407768 22.65674 9.407768 8.191587 0 16.352211-3.135923 22.591372-9.34412 12.512727-12.480043 12.54369-32.704421 0.063647-45.248112L557.311759 513.248864z" p-id="12755"></path></svg>`,
openWorkspaceCollectionView: `<svg t="1651317033804" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2432" width="100%" height="100%"><path d="M874.9 459.4c-18.8 0-34 15.2-34 34v355.7c0 18.6-15.5 33.7-34.5 33.7H181.5c-19 0-34.5-15.1-34.5-33.7V232.3c0-18.6 15.5-33.7 34.5-33.7H541c18.8 0 34-15.2 34-34s-15.2-34-34-34H181.5C125 130.6 79 176.2 79 232.3v616.8c0 56 46 101.7 102.5 101.7h624.9c56.5 0 102.5-45.6 102.5-101.7V493.4c0-18.8-15.2-34-34-34z" fill="#b6b6b6" p-id="2433"></path><path d="M885.5 82.7H657.1c-18.8 0-34 15.2-34 34s15.2 34 34 34h169.7L358.5 619.1c-13.3 13.3-13.3 34.8 0 48.1 6.6 6.6 15.3 10 24 10s17.4-3.3 24-10l470-470v169.7c0 18.8 15.2 34 34 34s34-15.2 34-34V141.5c0.1-32.4-26.4-58.8-59-58.8z" fill="#b6b6b6" p-id="2434"></path></svg>`,
switchView: `<svg t="1651813727621" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14171" width="18" height="18"><path d="M1024 733v131c0 53-43 96-96 96h-96c-53 0-96-43-96-96V733c0-53 43-96 96-96 8.8 0 16-7.2 16-16v-77c0-17.7-14.3-32-32-32H560c-8.8 0-16 7.2-16 16v94c0 8.3 6.7 15 15 15h1c53 0 96 43 96 96v131c0 53-43 96-96 96h-96c-53 0-96-43-96-96V733c0-53 43-96 96-96h1c8.3 0 15-6.7 15-15v-94c0-8.8-7.2-16-16-16H208c-17.7 0-32 14.3-32 32v77c0 8.8 7.2 16 16 16 53 0 96 43 96 96v131c0 53-43 96-96 96H96c-53 0-96-43-96-96V733c0-53 43-96 96-96 8.8 0 16-7.2 16-16v-77c0-53 43-96 96-96h256c8.8 0 16-7.2 16-16v-48h-96c-53 0-96-43-96-96V144c0-53 43-96 96-96h256c53 0 96 43 96 96v144c0 53-43 96-96 96h-96v48c0 8.8 7.2 16 16 16h256c53 0 96 43 96 96v77c0 8.8 7.2 16 16 16 53 0 96 43 96 96z" p-id="14172"></path></svg>`,
note: `<svg t="1652008007954" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10521" width="18" height="18"><path d="M574.3 896H159.7c-17.6 0-31.9-14.3-31.9-32V160c0-17.7 14.3-32 31.9-32h382.7v160c0 35.3 28.6 64 63.8 64h159.5v192c0 17.7 14.3 32 31.9 32 17.6 0 31.9-14.3 31.9-32V270.2c0-8.5-3.3-16.6-9.3-22.6L647.4 73.4c-6-6-14.1-9.4-22.6-9.4h-497C92.6 64 64 92.7 64 128v768c0 35.3 28.6 64 63.8 64h446.5c17.6 0 31.9-14.3 31.9-32s-14.3-32-31.9-32zM638.1 288c-17.6 0-31.9-14.3-31.9-32V128l159.5 160H638.1z" p-id="10522"></path><path d="M418.8 673H225.5c-17.6 0-31.9 14.3-31.9 32s14.3 32 31.9 32h193.3c17.6 0 31.9-14.3 31.9-32s-14.3-32-31.9-32zM608.2 481H225.5c-17.6 0-31.9 14.3-31.9 32s14.3 32 31.9 32h382.7c17.6 0 31.9-14.3 31.9-32s-14.3-32-31.9-32zM225.5 353h191.4c17.6 0 31.9-14.3 31.9-32s-14.3-32-31.9-32H225.5c-17.6 0-31.9 14.3-31.9 32s14.3 32 31.9 32zM862.7 959.4c-23.6 0-47-8.8-64.8-26.6l-24.4-24.4c-12.5-12.5-12.5-32.8 0-45.3s32.7-12.5 45.1 0l24.4 24.4c11.3 11.4 30.7 10.4 43.2-2.1 12.5-12.5 13.4-31.9 2.1-43.3L749.2 702.6c-11.3-11.4-30.7-10.4-43.2 2.1-6.2 6.3-9.8 14.4-10 22.8-0.2 7.9 2.6 15.1 7.9 20.4 12.5 12.5 12.5 32.8 0 45.3s-32.7 12.5-45.1 0c-36.2-36.3-35.2-96.3 2.1-133.8 37.4-37.5 97.2-38.4 133.4-2.1l139.1 139.5c36.2 36.3 35.2 96.3-2.1 133.8-19 19.2-43.9 28.8-68.6 28.8z" p-id="10523"></path><path d="M696.3 883.1c-23.6 0-47-8.8-64.8-26.6l-139-139.6c-17.7-17.8-27.2-41.7-26.6-67.2 0.6-25 10.8-48.6 28.7-66.6 17.9-17.9 41.5-28.2 66.4-28.8 25.5-0.6 49.3 8.9 67 26.6l24.4 24.4c12.5 12.5 12.5 32.8 0 45.3s-32.7 12.5-45.1 0l-24.4-24.4c-5.3-5.3-12.5-8.1-20.4-7.9-8.4 0.2-16.5 3.8-22.8 10-6.2 6.3-9.8 14.4-10 22.8-0.2 7.9 2.6 15.1 7.9 20.4L676.7 811c11.3 11.4 30.7 10.4 43.2-2.1 12.5-12.5 13.4-31.9 2.1-43.3-12.5-12.5-12.5-32.8 0-45.3s32.7-12.5 45.1 0c36.2 36.3 35.3 96.3-2.1 133.8-19.1 19.3-44 29-68.7 29z" p-id="10524"></path></svg>`,
};
this.currentOutline = OutlineType.treeView;
this._initIframe = Zotero.Promise.defer();
@ -381,6 +381,111 @@ class AddonViews extends AddonBase {
initKnowledgeWindow(_window: Window) {
_window.addEventListener("message", (e) => this.messageHandler(e), false);
this.currentOutline = OutlineType.treeView;
_window.document
.getElementById("outline-selectknowledge")
.addEventListener("click", async (e) => {
this._Addon.events.onEditorEvent(
new EditorMessage("selectMainKnowledge", {})
);
});
_window.document
.getElementById("outline-switchview")
.addEventListener("click", async (e) => {
this.switchView();
});
_window.document
.getElementById("outline-addafter")
.addEventListener("click", async (e) => {
let node = this._Addon.knowledge.getNoteTreeNodeById(
undefined,
this._Addon.knowledge.currentNodeID
);
if (node.model.rank === 7) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
const text = prompt("Enter new heading:");
this._Addon.knowledge.openWorkspaceWindow();
if (text.trim()) {
if (this._Addon.knowledge.currentNodeID < 0) {
// Add a new H1
this._Addon.knowledge.addSubLineToNote(
undefined,
`<h1>${text}</h1>`,
-1
);
return;
}
this._Addon.knowledge.addSubLineToNote(
undefined,
`<h${node.model.rank}>${text}</h${node.model.rank}>`,
node.model.endIndex
);
}
});
_window.document
.getElementById("outline-indent")
.addEventListener("click", async (e) => {
if (this._Addon.knowledge.currentNodeID < 0) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
let node = this._Addon.knowledge.getNoteTreeNodeById(
undefined,
this._Addon.knowledge.currentNodeID
);
if (node.model.rank === 7) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
if (node.model.rank === 6) {
this.showProgressWindow(
"Knowledge",
"Cannot decrease a level 6 Heading."
);
return;
}
this._Addon.knowledge.changeHeadingLineInNote(
undefined,
1,
node.model.lineIndex
);
});
_window.document
.getElementById("outline-unindent")
.addEventListener("click", async (e) => {
if (this._Addon.knowledge.currentNodeID < 0) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
let node = this._Addon.knowledge.getNoteTreeNodeById(
undefined,
this._Addon.knowledge.currentNodeID
);
if (node.model.rank === 7) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
if (node.model.rank === 1) {
this.showProgressWindow(
"Knowledge",
"Cannot raise a level 1 Heading."
);
return;
}
this._Addon.knowledge.changeHeadingLineInNote(
undefined,
-1,
node.model.lineIndex
);
});
_window.document
.getElementById("user-guide")
.addEventListener("click", async (e) => {
this._Addon.events.onEditorEvent(
new EditorMessage("openUserGuide", {})
);
});
}
async messageHandler(e) {
@ -477,7 +582,7 @@ class AddonViews extends AddonBase {
id: String(node.model.id),
name: node.model.name,
rank: node.model.rank,
icon: node.model.rank === 7 ? "textdocument" : undefined,
icon: node.model.rank === 7 ? this.editorIcon["note"] : undefined,
lineIndex: node.model.lineIndex,
endIndex: node.model.endIndex,
isDirectory: node.hasChildren(),
@ -501,7 +606,7 @@ class AddonViews extends AddonBase {
items,
expandNodesRecursive: false,
dataStructure: "plain",
height: this.$("window").height() - 130,
height: this.$("window").height() - 100,
displayExpr: "name",
noDataText: "Create a heading with '+'",
onItemClick: (e) => {
@ -511,121 +616,6 @@ class AddonViews extends AddonBase {
})
);
},
onItemSelectionChanged: (e) => {
console.log(e);
},
});
this.$("#outline-selectknowledge").dxButton({
icon: "folder",
onClick: async (e) => {
this._Addon.events.onEditorEvent(
new EditorMessage("selectMainKnowledge", {})
);
},
});
this.$("#outline-switchview").dxButton({
// icon: this.editorIcon["switchView"],
icon: "chart",
onClick: async (e) => {
this.switchView();
},
});
this.$("#outline-addafter").dxButton({
icon: "plus",
onClick: (e) => {
let node = this._Addon.knowledge.getNoteTreeNodeById(
undefined,
this._Addon.knowledge.currentNodeID
);
if (node.model.rank === 7) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
const text = prompt("Enter new heading:");
this._Addon.knowledge.openWorkspaceWindow();
if (text.trim()) {
if (this._Addon.knowledge.currentNodeID < 0) {
// Add a new H1
this._Addon.knowledge.addSubLineToNote(
undefined,
`<h1>${text}</h1>`,
-1
);
return;
}
this._Addon.knowledge.addSubLineToNote(
undefined,
`<h${node.model.rank}>${text}</h${node.model.rank}>`,
node.model.endIndex
);
}
},
});
this.$("#outline-tab").dxButton({
icon: "increaseindent",
onClick: (e) => {
if (this._Addon.knowledge.currentNodeID < 0) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
let node = this._Addon.knowledge.getNoteTreeNodeById(
undefined,
this._Addon.knowledge.currentNodeID
);
if (node.model.rank === 7) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
if (node.model.rank === 6) {
this.showProgressWindow(
"Knowledge",
"Cannot decrease a level 6 Heading."
);
return;
}
this._Addon.knowledge.changeHeadingLineInNote(
undefined,
1,
node.model.lineIndex
);
},
});
this.$("#outline-untab").dxButton({
icon: "decreaseindent",
onClick: (e) => {
if (this._Addon.knowledge.currentNodeID < 0) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
let node = this._Addon.knowledge.getNoteTreeNodeById(
undefined,
this._Addon.knowledge.currentNodeID
);
if (node.model.rank === 7) {
this.showProgressWindow("Knowledge", "Please select a Heading.");
return;
}
if (node.model.rank === 1) {
this.showProgressWindow(
"Knowledge",
"Cannot raise a level 1 Heading."
);
return;
}
this._Addon.knowledge.changeHeadingLineInNote(
undefined,
-1,
node.model.lineIndex
);
},
});
this.$("#user-guide").dxButton({
icon: "tips",
onClick: (e) => {
this._Addon.events.onEditorEvent(
new EditorMessage("openUserGuide", {})
);
},
});
}
@ -637,7 +627,7 @@ class AddonViews extends AddonBase {
setTreeViewSize() {
this.$("#treeview").css({
height: `${this.$("window").height() - 130}px`,
height: `${this.$("window").height() - 100}px`,
width: `${this.$("#zotero-knowledge-outline").width() - 10}px`,
});
this.$("#mindmapIframe").css({