rename addon
This commit is contained in:
parent
f0462d5ba4
commit
03157b8d40
|
|
@ -1,6 +1,6 @@
|
|||
# Knowledge for Zotero User Guide: Workflow
|
||||
# Zotero Better Notes User Guide: Workflow
|
||||
|
||||
Welcome to **Knowledge for Zotero** !
|
||||
Welcome to **Zotero Better Notes** !
|
||||
|
||||
This note helps you quickly learn how to use this addon in 3 min!
|
||||
|
||||
|
|
@ -124,4 +124,4 @@ Switch between different main notes with the '📂folder' button on the bottom o
|
|||
|
||||
Congratulations!
|
||||
|
||||
You can select a new main note and start working with **Knowledge for Zotero** now. Have fun!
|
||||
You can select a new main note and start working with **Zotero Better Notes** now. Have fun!
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Knowledge for Zotero 用户指引:工作流
|
||||
# Zotero Better Notes 用户指引:工作流
|
||||
|
||||
欢迎使用 **Knowledge for Zotero** !
|
||||
欢迎使用 **Zotero Better Notes** !
|
||||
|
||||
本笔记帮助您在 3 分钟内快速学习如何使用此插件!
|
||||
|
||||
|
|
@ -124,4 +124,4 @@ Zotero 的 note 很像一个标记/富文本编辑器。您可以使用上方工
|
|||
|
||||
恭喜!
|
||||
|
||||
你现在可以选择或新建一个主笔记,然后开始使用 **Knowledge for Zotero**了。用的开心!
|
||||
你现在可以选择或新建一个主笔记,然后开始使用 **Zotero Better Notes**了。用的开心!
|
||||
|
|
|
|||
|
|
@ -83,12 +83,7 @@
|
|||
height: $("window").height() - 100,
|
||||
displayExpr: "name",
|
||||
noDataText: "Create a heading with '+'",
|
||||
onItemClick: (e) => {
|
||||
window.parent.postMessage(
|
||||
{ type: "jumpNode", lineIndex: e.itemData.lineIndex },
|
||||
"*"
|
||||
);
|
||||
},
|
||||
onItemClick: jumpNode,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -291,21 +286,23 @@
|
|||
});
|
||||
}
|
||||
|
||||
function jumpNode(e, obj) {
|
||||
var adorn = obj.part;
|
||||
var oldnode = adorn.adornedPart;
|
||||
var olddata = oldnode.data;
|
||||
if (olddata.noteLink) {
|
||||
function jumpNode(e) {
|
||||
var itemData = e.itemData;
|
||||
if (itemData.noteLink) {
|
||||
window.parent.postMessage(
|
||||
{ type: "jumpNote", link: olddata.noteLink },
|
||||
{
|
||||
type: "jumpNote",
|
||||
link: itemData.noteLink,
|
||||
id: parseInt(itemData.id),
|
||||
},
|
||||
"*"
|
||||
);
|
||||
} else {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "jumpNode",
|
||||
lineIndex: olddata.lineIndex,
|
||||
id: parseInt(olddata.id),
|
||||
lineIndex: itemData.lineIndex,
|
||||
id: parseInt(itemData.id),
|
||||
},
|
||||
"*"
|
||||
);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
<row>
|
||||
<checkbox id="__addonRef__-setup-collectionenable" checked="true" oncommand="Zotero.Knowledge4Zotero.wizard.updateCollectionSetup()" />
|
||||
<label value="&zotero.__addonRef__.wizard.setup.collectionenable.label;" />
|
||||
<textbox id="__addonRef__-setup-collectionname" value="My Knowledges" oninput="Zotero.Knowledge4Zotero.wizard.updateCollectionSetup()" />
|
||||
<textbox id="__addonRef__-setup-collectionname" value="My Notes" oninput="Zotero.Knowledge4Zotero.wizard.updateCollectionSetup()" />
|
||||
</row>
|
||||
<row>
|
||||
<checkbox id="__addonRef__-setup-noteenable" checked="true" oncommand="Zotero.Knowledge4Zotero.wizard.updateNoteSetup()" />
|
||||
|
|
|
|||
|
|
@ -2,11 +2,19 @@
|
|||
<?xml-stylesheet href="chrome://global/skin/"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/standalone.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero-platform/content/overlay.css"?>
|
||||
<?xml-stylesheet href="chrome://__addonRef__/skin/workspace.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://__addonRef__/content/lib/css/dx.light.css" type="text/css"?>
|
||||
<?xul-overlay href="chrome://zotero/content/standalone/editMenuOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
<!ENTITY % standaloneDTD SYSTEM "chrome://zotero/locale/standalone.dtd">
|
||||
%standaloneDTD;
|
||||
<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://zotero/locale/mozilla/editMenuOverlay.dtd">
|
||||
%editMenuOverlayDTD;
|
||||
<!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
%zoteroDTD;
|
||||
<!ENTITY % knowledgeDTD SYSTEM "chrome://__addonRef__/locale/overlay.dtd">
|
||||
|
|
@ -17,17 +25,66 @@
|
|||
|
||||
<script src="chrome://zotero/content/include.js" />
|
||||
<script src="chrome://zotero/content/note.js" />
|
||||
<script src="chrome://__addonRef__/content/lib/js/jquery.min.js"></script>
|
||||
<script src="chrome://__addonRef__/content/lib/js/dx.all.js"></script>
|
||||
<script src="chrome://__addonRef__/content/lib/js/go.js"></script>
|
||||
<script type="application/javascript">
|
||||
Zotero.Knowledge4Zotero.views.$ = $;
|
||||
</script>
|
||||
|
||||
<keyset>
|
||||
<key id="key_new" key="N" modifiers="accel" command="cmd_new" />
|
||||
<key id="key_open" key="O" modifiers="accel" command="cmd_open" />
|
||||
<key id="key_export" key="E" modifiers="accel" command="cmd_export" />
|
||||
<key id="key_close" key="W" modifiers="accel" command="cmd_close" />
|
||||
<key id="key_indent" keycode="VK_TAB" command="cmd_indent" />
|
||||
<key id="key_unindent" keycode="VK_TAB" modifiers="shift" command="cmd_unindent" />
|
||||
</keyset>
|
||||
<command id="cmd_new" oncommand="Zotero.Knowledge4Zotero.events.onEditorEvent({type: 'createWorkspace'});" />
|
||||
<command id="cmd_open" oncommand="Zotero.Knowledge4Zotero.events.onEditorEvent({type: 'selectMainKnowledge'});" />
|
||||
<command id="cmd_export" oncommand="Zotero.Knowledge4Zotero.events.onEditorEvent({type: 'export', content: {editorInstance: {_item: false}}});" />
|
||||
<command id="cmd_close" oncommand="window.close();" />
|
||||
<command id="cmd_addheading" oncommand="Zotero.Knowledge4Zotero.events.onEditorEvent({type: 'addHeading'});" />
|
||||
<command id="cmd_indent" oncommand="Zotero.Knowledge4Zotero.events.onEditorEvent({type: 'indentHeading'});" />
|
||||
<command id="cmd_unindent" oncommand="Zotero.Knowledge4Zotero.events.onEditorEvent({type: 'unindentHeading'});" />
|
||||
<command id="cmd_treeview" oncommand="Zotero.Knowledge4Zotero.views.switchView(1);" />
|
||||
<command id="cmd_mindmap" oncommand="Zotero.Knowledge4Zotero.views.switchView(2);" />
|
||||
<command id="cmd_bubblemap" oncommand="Zotero.Knowledge4Zotero.views.switchView(3);" />
|
||||
<command id="cmd_guide" oncommand="Zotero.Knowledge4Zotero.events.onEditorEvent({type: 'openUserGuide'});" />
|
||||
|
||||
<toolbox id="navigator-toolbox" class="toolbox-top" mode="icons" defaultmode="icons">
|
||||
<!-- Menu -->
|
||||
<toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true" defaultset="menubar-items" mode="icons" iconsize="small" defaulticonsize="small" context="toolbar-context-menu">
|
||||
<toolbaritem id="menubar-items" align="center">
|
||||
<menubar id="main-menubar" style="border:0px;padding:0px;margin:0px;-moz-appearance:none">
|
||||
<menu id="fileMenu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menuitem id="menu_new" label="&zotero.__addonRef__.workspace.menu.new;" key="key_new" accesskey="N" command="cmd_new" />
|
||||
<menuitem id="menu_open" label="&zotero.__addonRef__.workspace.menu.open;" key="key_open" accesskey="O" command="cmd_open" />
|
||||
<menuitem id="menu_export" label="&zotero.__addonRef__.workspace.menu.export;" key="key_export" accesskey="E" command="cmd_export" />
|
||||
<menuitem id="menu_close" label="&closeCmd.label;" key="key_close" accesskey="&closeCmd.accesskey;" command="cmd_close" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="menu_edit" label="&editMenu.label;" accesskey="&editMenu.accesskey;">
|
||||
<menupopup id="menu_EditPopup">
|
||||
<menuitem id="menu_addheading" label="&zotero.__addonRef__.workspace.menu.addheading;" command="cmd_addheading" />
|
||||
<menuitem id="menu_indent" label="&zotero.__addonRef__.workspace.menu.indent;" command="cmd_indent" key="key_indent" />
|
||||
<menuitem id="menu_unindent" label="&zotero.__addonRef__.workspace.menu.unindent;" command="cmd_unindent" key="key_unindent" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="view-menu" label="&viewMenu.label;" accesskey="&viewMenu.accesskey;" onpopupshowing="Zotero.Knowledge4Zotero.views.updateViewMenu();">
|
||||
<menupopup id="menu_ViewPopup">
|
||||
<menuitem id="menu_treeview" type="checkbox" label="&zotero.__addonRef__.workspace.menu.treeview;" command="cmd_treeview" />
|
||||
<menuitem id="menu_mindmap" type="checkbox" label="&zotero.__addonRef__.workspace.menu.mindmap;" command="cmd_mindmap" />
|
||||
<menuitem id="menu_bubblemap" type="checkbox" label="&zotero.__addonRef__.workspace.menu.bubblemap;" command="cmd_bubblemap" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="helpMenu" label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
|
||||
<menupopup id="menu_HelpPopup">
|
||||
<menuitem id="menu_guide" label="&zotero.__addonRef__.workspace.menu.guide;" command="cmd_guide" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
</toolbaritem>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<hbox flex="1">
|
||||
<vbox id="zotero-knowledge-outline" flex="1" width="330" minwidth="300" style="overflow: hidden;">
|
||||
|
|
@ -35,14 +92,6 @@
|
|||
<!-- 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 20px 0px 20px;">
|
||||
<div class="tooltip">
|
||||
<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">
|
||||
<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">
|
||||
|
|
@ -51,39 +100,6 @@
|
|||
</html:button>
|
||||
<span class="tooltiptext">Switch Outline Mode</span>
|
||||
</div>
|
||||
<div class="tooltip">
|
||||
<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">
|
||||
<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">
|
||||
<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">
|
||||
<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>
|
||||
</vbox>
|
||||
<splitter id="outline-splitter" collapse="before">
|
||||
|
|
|
|||
|
|
@ -1,14 +1,26 @@
|
|||
<!ENTITY zotero.__addonRef__.workspace.title "Knowledge Workspace">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.new "Create New Main Note">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.open "Open Main Note...">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.export "Export Main Note...">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.addheading "Insert Heading...">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.indent "Decrease Heading Level">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.unindent "Increase Heading Level">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.treeview "Outline: Tree View">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.mindmap "Outline: Mind Map">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.bubblemap "Outline: Bubble Map">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.guide "Open User Guide">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.itemmenu.setMainKnowledge.label "Set Main Note">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.export.title "Export Knowledge">
|
||||
<!ENTITY zotero.__addonRef__.export.title "Export">
|
||||
<!ENTITY zotero.__addonRef__.export.file.enable.label "Export to file(MarkDown/HTML/RDF)">
|
||||
<!ENTITY zotero.__addonRef__.export.image.enable.label "Embed Images(MarkDown file only)">
|
||||
<!ENTITY zotero.__addonRef__.export.note.enable.label "Export to new note">
|
||||
<!ENTITY zotero.__addonRef__.export.copy.enable.label "Export to clipboard">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.wizard.title "Welcomed to Knowledge for Zotero">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page1.header "Knowledge for Zotero User Guide">
|
||||
<!ENTITY zotero.__addonRef__.wizard.title "Welcomed to Zotero Better Notes">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page1.header "Zotero Better Notes User Guide">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page1.description "Click Next to Continue.">
|
||||
<!ENTITY zotero.__addonRef__.wizard.open "Knowledge Workspace">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page3.header "Knowledge Workspace">
|
||||
|
|
@ -29,7 +41,7 @@
|
|||
|
||||
<!ENTITY zotero.__addonRef__.wizard.setup.enable.label "Enable Auto Setup">
|
||||
<!ENTITY zotero.__addonRef__.wizard.setup.collectionenable.label "Create a new collection for main notes:">
|
||||
<!ENTITY zotero.__addonRef__.wizard.setup.noteenable.label "Create a 'Knowledge for Zotero User Guide: Workflow' note">
|
||||
<!ENTITY zotero.__addonRef__.wizard.setup.noteenable.label "Create a 'Zotero Better Notes User Guide: Workflow' note">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.help.feedback.caption.label "User Guide and Feedback">
|
||||
<!ENTITY zotero.__addonRef__.help.feedback.label "GitHub">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,16 @@
|
|||
<!ENTITY zotero.__addonRef__.workspace.title "Knowledge工作区">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.new "创建新主笔记">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.open "打开主笔记...">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.export "导出主笔记...">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.addheading "插入标题...">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.indent "降低标题层级">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.unindent "提升标题层级">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.treeview "大纲: 树视图">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.mindmap "大纲: 思维导图">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.bubblemap "大纲: 气泡导图">
|
||||
<!ENTITY zotero.__addonRef__.workspace.menu.guide "打开用户指引">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.itemmenu.setMainKnowledge.label "设置为主笔记">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.export.title "导出笔记">
|
||||
|
|
@ -7,13 +19,13 @@
|
|||
<!ENTITY zotero.__addonRef__.export.note.enable.label "导出到新笔记">
|
||||
<!ENTITY zotero.__addonRef__.export.copy.enable.label "导出到剪贴板">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.wizard.title "欢迎使用 Knowledge for Zotero">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page1.header "Knowledge for Zotero 用户指引">
|
||||
<!ENTITY zotero.__addonRef__.wizard.title "欢迎使用 Zotero Better Notes">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page1.header "Zotero Better Notes 用户指引">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page1.description "单击下一步以继续。">
|
||||
<!ENTITY zotero.__addonRef__.wizard.open "Knowledge工作区">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page3.header "Knowledge工作区">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page3.description "单击“我的文库”上方链接或笔记编辑器中的“主页”按钮,来打开或聚焦工作区。">
|
||||
<!ENTITY zotero.__addonRef__.wizard.layout "Knowledge 工作区布局">
|
||||
<!ENTITY zotero.__addonRef__.wizard.layout "Knowledge工作区布局">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page4.header "大纲/主笔记/链接笔记预览">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page4.description1 "用大纲修改/跳转主笔记的标题;">
|
||||
<!ENTITY zotero.__addonRef__.wizard.page4.description2 "在阅读时可以从其他笔记添加链接到主笔记。支持导出包含链接全文的MarkDown/HTML。">
|
||||
|
|
@ -29,7 +41,7 @@
|
|||
|
||||
<!ENTITY zotero.__addonRef__.wizard.setup.enable.label "启用快速配置">
|
||||
<!ENTITY zotero.__addonRef__.wizard.setup.collectionenable.label "创建新的分类用来存放主笔记:">
|
||||
<!ENTITY zotero.__addonRef__.wizard.setup.noteenable.label "创建 'Knowledge for Zotero 用户指引:工作流' 笔记">
|
||||
<!ENTITY zotero.__addonRef__.wizard.setup.noteenable.label "创建 'Zotero Better Notes 用户指引:工作流' 笔记">
|
||||
|
||||
<!ENTITY zotero.__addonRef__.help.feedback.caption.label "User Guide and Feedback">
|
||||
<!ENTITY zotero.__addonRef__.help.feedback.label "GitHub">
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
em:description="__description__"
|
||||
em:homepageURL="__homepage__"
|
||||
em:iconURL="chrome://__addonRef__/skin/favicon.png"
|
||||
em:updateURL="https://raw.githubusercontent.com/windingwind/Knowledge4Zotero/master/update.rdf">>
|
||||
em:updateURL="https://raw.githubusercontent.com/windingwind/zotero-better-notes/master/update.rdf">>
|
||||
<em:type>2</em:type>
|
||||
<em:targetApplication RDF:resource="rdf:#$x61SL3"/>
|
||||
<em:targetApplication>
|
||||
|
|
|
|||
12
package.json
12
package.json
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "knowledge-for-zotero",
|
||||
"addonName": "Knowledge for Zotero",
|
||||
"name": "zotero-better-notes",
|
||||
"addonName": "Zotero Better Notes",
|
||||
"addonID": "Knowledge4Zotero@windingwind.com",
|
||||
"addonRef": "Knowledge4Zotero",
|
||||
"version": "0.1.3",
|
||||
"description": "Knowledge management for Zotero",
|
||||
"description": "Everything about note management. All in Zotero.",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"build": "node build.js",
|
||||
|
|
@ -13,14 +13,14 @@
|
|||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/windingwind/Knowledge4Zotero.git"
|
||||
"url": "git+https://github.com/windingwind/zotero-better-notes.git"
|
||||
},
|
||||
"author": "windingwind",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"bugs": {
|
||||
"url": "https://github.com/windingwind/Knowledge4Zotero/issues"
|
||||
"url": "https://github.com/windingwind/zotero-better-notes/issues"
|
||||
},
|
||||
"homepage": "https://github.com/windingwind/Knowledge4Zotero#readme",
|
||||
"homepage": "https://github.com/windingwind/zotero-better-notes#readme",
|
||||
"dependencies": {
|
||||
"@syncfusion/ej2-base": "^20.1.50",
|
||||
"@syncfusion/ej2-navigations": "^20.1.51",
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ class AddonEvents extends AddonBase {
|
|||
return;
|
||||
} else if (ids.length > 1) {
|
||||
this._Addon.views.showProgressWindow(
|
||||
"Knowledge",
|
||||
"Better Notes",
|
||||
"Please select a note item."
|
||||
);
|
||||
return;
|
||||
|
|
@ -194,7 +194,7 @@ class AddonEvents extends AddonBase {
|
|||
);
|
||||
} else {
|
||||
this._Addon.views.showProgressWindow(
|
||||
"Knowledge",
|
||||
"Better Notes",
|
||||
"Not a valid note item."
|
||||
);
|
||||
}
|
||||
|
|
@ -212,13 +212,13 @@ class AddonEvents extends AddonBase {
|
|||
const item = Zotero.Items.get(itemID);
|
||||
if (itemID === mainKnowledgeID) {
|
||||
this._Addon.views.showProgressWindow(
|
||||
"Knowledge",
|
||||
"Better Notes",
|
||||
"Already a main Note."
|
||||
);
|
||||
return;
|
||||
} else if (!item.isNote()) {
|
||||
this._Addon.views.showProgressWindow(
|
||||
"Knowledge",
|
||||
"Better Notes",
|
||||
"Not a valid note item."
|
||||
);
|
||||
} else {
|
||||
|
|
@ -236,7 +236,7 @@ class AddonEvents extends AddonBase {
|
|||
await this._Addon.knowledge.openWorkspaceWindow();
|
||||
await this._Addon.knowledge.setWorkspaceNote("main");
|
||||
this._Addon.views.showProgressWindow(
|
||||
"Knowledge",
|
||||
"Better Notes",
|
||||
`Set main Note to: ${item.getNoteTitle()}`
|
||||
);
|
||||
}
|
||||
|
|
@ -407,10 +407,12 @@ class AddonEvents extends AddonBase {
|
|||
params: {id, lineIndex}
|
||||
}
|
||||
*/
|
||||
Zotero.debug(message.content.params);
|
||||
let editorInstance =
|
||||
await this._Addon.knowledge.getWorkspaceEditorInstance();
|
||||
// Set node id
|
||||
this._Addon.knowledge.currentNodeID = parseInt(message.content.params.id);
|
||||
this._Addon.views.updateEditCommand();
|
||||
this._Addon.views.scrollToLine(
|
||||
editorInstance,
|
||||
// Scroll to 1 lines before the inserted line
|
||||
|
|
@ -541,6 +543,90 @@ class AddonEvents extends AddonBase {
|
|||
Zotero.debug(`Knowledge4Zotero: line ${currentLineIndex} selected.`);
|
||||
this._Addon.knowledge.currentLine = currentLineIndex;
|
||||
}
|
||||
} else if (message.type === "addHeading") {
|
||||
/*
|
||||
message.content = {
|
||||
editorInstance
|
||||
}
|
||||
*/
|
||||
const text = prompt(`Enter new heading to Insert:`);
|
||||
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;
|
||||
}
|
||||
let node = this._Addon.knowledge.getNoteTreeNodeById(
|
||||
undefined,
|
||||
this._Addon.knowledge.currentNodeID
|
||||
);
|
||||
this._Addon.knowledge.addSubLineToNote(
|
||||
undefined,
|
||||
`<h${node.model.rank}>${text}</h${node.model.rank}>`,
|
||||
node.model.endIndex
|
||||
);
|
||||
}
|
||||
} else if (message.type === "indentHeading") {
|
||||
/*
|
||||
message.content = {
|
||||
editorInstance
|
||||
}
|
||||
*/
|
||||
if (this._Addon.knowledge.currentNodeID < 0) {
|
||||
return;
|
||||
}
|
||||
let node = this._Addon.knowledge.getNoteTreeNodeById(
|
||||
undefined,
|
||||
this._Addon.knowledge.currentNodeID
|
||||
);
|
||||
if (node.model.rank === 7) {
|
||||
return;
|
||||
}
|
||||
if (node.model.rank === 6) {
|
||||
this._Addon.views.showProgressWindow(
|
||||
"Better Notes",
|
||||
"Cannot decrease a level 6 Heading."
|
||||
);
|
||||
return;
|
||||
}
|
||||
this._Addon.knowledge.changeHeadingLineInNote(
|
||||
undefined,
|
||||
1,
|
||||
node.model.lineIndex
|
||||
);
|
||||
} else if (message.type === "unindentHeading") {
|
||||
/*
|
||||
message.content = {
|
||||
editorInstance
|
||||
}
|
||||
*/
|
||||
if (this._Addon.knowledge.currentNodeID < 0) {
|
||||
return;
|
||||
}
|
||||
let node = this._Addon.knowledge.getNoteTreeNodeById(
|
||||
undefined,
|
||||
this._Addon.knowledge.currentNodeID
|
||||
);
|
||||
if (node.model.rank === 7) {
|
||||
return;
|
||||
}
|
||||
if (node.model.rank === 1) {
|
||||
this._Addon.views.showProgressWindow(
|
||||
"Better Notes",
|
||||
"Cannot raise a level 1 Heading."
|
||||
);
|
||||
return;
|
||||
}
|
||||
this._Addon.knowledge.changeHeadingLineInNote(
|
||||
undefined,
|
||||
-1,
|
||||
node.model.lineIndex
|
||||
);
|
||||
} else if (message.type === "export") {
|
||||
/*
|
||||
message.content = {
|
||||
|
|
@ -603,7 +689,7 @@ class AddonEvents extends AddonBase {
|
|||
}
|
||||
if (successCount === 0) {
|
||||
this._Addon.views.showProgressWindow(
|
||||
"Knowledge",
|
||||
"Better Notes",
|
||||
failCount
|
||||
? "Error occurred on opening attachemnts."
|
||||
: "No attachment found.",
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Knowledge extends AddonBase {
|
|||
this.currentNodeID = -1;
|
||||
}
|
||||
|
||||
getWorkspaceNote() {
|
||||
getWorkspaceNote(): ZoteroItem {
|
||||
return Zotero.Items.get(
|
||||
Zotero.Prefs.get("Knowledge4Zotero.mainKnowledgeID")
|
||||
);
|
||||
|
|
@ -353,7 +353,7 @@ class Knowledge extends AddonBase {
|
|||
true
|
||||
);
|
||||
this._Addon.views.showProgressWindow(
|
||||
"Knowledge",
|
||||
"Better Notes",
|
||||
"Link is added to workspace"
|
||||
);
|
||||
}
|
||||
|
|
@ -596,6 +596,7 @@ class Knowledge extends AddonBase {
|
|||
saveNote: boolean = false,
|
||||
saveCopy: boolean = false
|
||||
) {
|
||||
note = note || this.getWorkspaceNote();
|
||||
if (convertNoteLinks) {
|
||||
const noteID = await ZoteroPane_Local.newNote();
|
||||
const item = Zotero.Items.get(noteID);
|
||||
|
|
@ -619,7 +620,7 @@ class Knowledge extends AddonBase {
|
|||
[item],
|
||||
Zotero.Translators.TRANSLATOR_ID_MARKDOWN_AND_RICH_TEXT
|
||||
);
|
||||
this._Addon.views.showProgressWindow("Knowledge", "Note Copied");
|
||||
this._Addon.views.showProgressWindow("Better Notes", "Note Copied");
|
||||
}
|
||||
if (!saveNote) {
|
||||
if (saveCopy) {
|
||||
|
|
|
|||
138
src/views.ts
138
src/views.ts
|
|
@ -383,111 +383,11 @@ 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", {})
|
||||
);
|
||||
});
|
||||
_window.addEventListener("resize", (e) => this.resizeOutline(_window));
|
||||
}
|
||||
|
||||
|
|
@ -548,6 +448,9 @@ class AddonViews extends AddonBase {
|
|||
mindmap.append(iframe);
|
||||
this.resizeOutline(_window);
|
||||
this.updateOutline();
|
||||
// Clear stored node id
|
||||
this._Addon.knowledge.currentNodeID = -1;
|
||||
this.updateEditCommand();
|
||||
}
|
||||
|
||||
async updateOutline() {
|
||||
|
|
@ -577,6 +480,41 @@ class AddonViews extends AddonBase {
|
|||
}
|
||||
}
|
||||
|
||||
updateEditCommand() {
|
||||
const _window = this._Addon.knowledge.getWorkspaceWindow();
|
||||
Zotero.debug(`updateEditMenu, ${this._Addon.knowledge.currentNodeID}`);
|
||||
if (this._Addon.knowledge.currentNodeID < 0) {
|
||||
_window.document
|
||||
.getElementById("cmd_indent")
|
||||
.setAttribute("disabled", true);
|
||||
_window.document
|
||||
.getElementById("cmd_unindent")
|
||||
.setAttribute("disabled", true);
|
||||
} else {
|
||||
_window.document.getElementById("cmd_indent").removeAttribute("disabled");
|
||||
_window.document
|
||||
.getElementById("cmd_unindent")
|
||||
.removeAttribute("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
updateViewMenu() {
|
||||
const _window = this._Addon.knowledge.getWorkspaceWindow();
|
||||
Zotero.debug(`updateViewMenu, ${this.currentOutline}`);
|
||||
const treeview = _window.document.getElementById("menu_treeview");
|
||||
this.currentOutline === OutlineType.treeView
|
||||
? treeview.setAttribute("checked", true)
|
||||
: treeview.removeAttribute("checked");
|
||||
const mindmap = _window.document.getElementById("menu_mindmap");
|
||||
this.currentOutline === OutlineType.mindMap
|
||||
? mindmap.setAttribute("checked", true)
|
||||
: mindmap.removeAttribute("checked");
|
||||
const bubblemap = _window.document.getElementById("menu_bubblemap");
|
||||
this.currentOutline === OutlineType.bubbleMap
|
||||
? bubblemap.setAttribute("checked", true)
|
||||
: bubblemap.removeAttribute("checked");
|
||||
}
|
||||
|
||||
showProgressWindow(
|
||||
header: string,
|
||||
context: string,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -11,7 +11,7 @@
|
|||
<em:id>zotero@chnm.gmu.edu</em:id>
|
||||
<em:minVersion>5.0</em:minVersion>
|
||||
<em:maxVersion>*</em:maxVersion>
|
||||
<em:updateLink>https://github.com/windingwind/Knowledge4Zotero/releases/latest/download/knowledge-for-zotero.xpi</em:updateLink>
|
||||
<em:updateLink>https://github.com/windingwind/zotero-better-notes/releases/latest/download/zotero-better-notes.xpi</em:updateLink>
|
||||
</rdf:Description>
|
||||
</em:targetApplication>
|
||||
<em:targetApplication>
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
<em:id>juris-m@juris-m.github.io</em:id>
|
||||
<em:minVersion>5.0</em:minVersion>
|
||||
<em:maxVersion>*</em:maxVersion>
|
||||
<em:updateLink>https://github.com/windingwind/Knowledge4Zotero/releases/latest/download/knowledge-for-zotero.xpi</em:updateLink>
|
||||
<em:updateLink>https://github.com/windingwind/zotero-better-notes/releases/latest/download/zotero-better-notes.xpi</em:updateLink>
|
||||
</rdf:Description>
|
||||
</em:targetApplication>
|
||||
</rdf:Description>
|
||||
|
|
|
|||
Loading…
Reference in New Issue