Skip to content

Commit

Permalink
fix: #10
Browse files Browse the repository at this point in the history
  • Loading branch information
MuiseDestiny committed Jan 2, 2024
1 parent bd1e797 commit dedb378
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 83 deletions.
105 changes: 24 additions & 81 deletions addon/chrome/content/preferences.xhtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<linkset>
<html:link rel="localization" href="__addonRef__-preferences.ftl" />
</linkset>
<vbox
id="zotero-prefpane-__addonRef__"
onload="Zotero.__addonInstance__.hooks.onPrefsEvent('load', {window})"
>
<vbox id="zotero-prefpane-__addonRef__" onload="Zotero.__addonInstance__.hooks.onPrefsEvent('load', {window})">
<groupbox>
<label>
<html:h2 data-l10n-id="source-title"></html:h2>
Expand All @@ -14,14 +11,8 @@
<separator class="thin" />
<hbox align="center">
<label data-l10n-id="directory"></label>
<html:input
id="source-dir"
type="text"
readonly="true"
flex="1"
preference="extensions.zotero.__addonRef__.sourceDir"
style="background: none; border: none"
>
<html:input id="source-dir" type="text" readonly="true" flex="1"
preference="extensions.zotero.__addonRef__.sourceDir" style="background: none; border: none">
</html:input>
<button id="choose-source-dir" data-l10n-id="choose"></button>
</hbox>
Expand All @@ -36,11 +27,7 @@
<separator class="thin" />
<hbox align="center">
<label data-l10n-id="attach-type-start"></label>
<menulist
native="true"
id="attach-type"
preference="extensions.zotero.__addonRef__.attachType"
>
<menulist native="true" id="attach-type" preference="extensions.zotero.__addonRef__.attachType">
<menupopup>
<menuitem data-l10n-id="importing" value="importing" />
<menuitem data-l10n-id="linking" value="linking" />
Expand All @@ -59,14 +46,8 @@
<separator class="thin" />
<hbox align="center">
<label data-l10n-id="directory"></label>
<html:input
id="dest-dir"
type="text"
readonly="true"
flex="1"
preference="extensions.zotero.__addonRef__.destDir"
style="background: none; border: none"
>
<html:input id="dest-dir" type="text" readonly="true" flex="1"
preference="extensions.zotero.__addonRef__.destDir" style="background: none; border: none">
</html:input>
<button id="choose-dest-dir" data-l10n-id="choose"></button>
</hbox>
Expand All @@ -75,35 +56,25 @@

<hbox align="center">
<label data-l10n-id="subfolder"></label>
<html:input
id="subfolder-format"
type="text"
flex="1"
preference="extensions.zotero.__addonRef__.subfolderFormat"
>
<html:input id="subfolder-format" type="text" flex="1"
preference="extensions.zotero.__addonRef__.subfolderFormat">
</html:input>
</hbox>

<separator class="thin" />

<hbox align="center">
<label data-l10n-id="filename"></label>
<button
id="file-renaming-button"
data-l10n-id="preferences-file-renaming-customize-button"
<button id="file-renaming-button" data-l10n-id="preferences-file-renaming-customize-button"
data-search-strings="preferences-file-renaming-format-title, preferences-file-renaming-format-template"
oncommand="Zotero_Preferences.navigateToPane('zotero-subpane-file-renaming')"
></button>
oncommand="Zotero_Preferences.navigateToPane('zotero-subpane-file-renaming')"></button>
</hbox>

<separator class="thin" />

<label data-l10n-id="preferences-file-renaming-format-instructions-more">
<label
is="zotero-text-link"
href="https://www.zotero.org/support/file_renaming"
data-l10n-name="file-renaming-format-help-link"
></label>
<label is="zotero-text-link" href="https://www.zotero.org/support/file_renaming"
data-l10n-name="file-renaming-format-help-link"></label>
</label>
</vbox>
</groupbox>
Expand All @@ -112,23 +83,11 @@
<html:h2 data-l10n-id="other-title"></html:h2>
</label>
<vbox align="start">
<checkbox
native="true"
data-l10n-id="auto-rename"
preference="extensions.zotero.autoRenameFiles"
/>
<checkbox
native="true"
data-l10n-id="auto-move"
preference="extensions.zotero.__addonRef__.autoMove"
/>
<checkbox native="true" data-l10n-id="auto-rename" preference="extensions.zotero.autoRenameFiles" />
<checkbox native="true" data-l10n-id="auto-move" preference="extensions.zotero.__addonRef__.autoMove" />
<hbox align="center">
<label data-l10n-id="file-types"></label>
<html:input
type="text"
flex="1"
preference="extensions.zotero.__addonRef__.fileTypes"
>
<html:input type="text" flex="1" preference="extensions.zotero.__addonRef__.fileTypes">
</html:input>
</hbox>
</vbox>
Expand All @@ -140,38 +99,22 @@
<vbox align="start">
<label data-l10n-id="about-intro"></label>
<separator class="thin" />
<label
style="margin-inline: 6px 5px; text-decoration: none"
is="zotero-text-link"
href="https://github.com/MuiseDestiny/zotero-attanger"
class="zotero-text-link"
>
<label style="margin-inline: 6px 5px; text-decoration: none" is="zotero-text-link"
href="https://github.com/MuiseDestiny/zotero-attanger" class="zotero-text-link">
⭐ Star it
</label>
<label
style="margin-inline: 6px 5px; text-decoration: none"
is="zotero-text-link"
href="https://github.com/MuiseDestiny"
class="zotero-text-link"
>
<label style="margin-inline: 6px 5px; text-decoration: none" is="zotero-text-link"
href="https://github.com/MuiseDestiny" class="zotero-text-link">
🔍 See author's Github
</label>
<label
style="margin-inline: 6px 5px; text-decoration: none"
is="zotero-text-link"
href="https://space.bilibili.com/13557814"
class="zotero-text-link"
>
<label style="margin-inline: 6px 5px; text-decoration: none" is="zotero-text-link"
href="https://space.bilibili.com/13557814" class="zotero-text-link">
📺 See author's Bilibili
</label>
<label
style="margin-inline: 6px 5px; text-decoration: none"
is="zotero-text-link"
href="https://gitee.com/MuiseDestiny/plugins"
class="zotero-text-link"
>
<label style="margin-inline: 6px 5px; text-decoration: none" is="zotero-text-link"
href="https://gitee.com/MuiseDestiny/plugins" class="zotero-text-link">
🎊 See Pro plugins
</label>
</vbox>
</groupbox>
</vbox>
</vbox>
6 changes: 6 additions & 0 deletions addon/locale/en-US/preferences.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ file-types = Types of Attachments for Renaming/Moving (separated by ',')
about-title = About
about-intro = 🌠 Happy New Year! Attanger is an abbreviation for Attachment Manager, and this project heavily references the ZotFile plugin of Zotero version 6.
preferences-file-renaming-customize-button =
.label = Customize Filename Format…
preferences-file-renaming-format-instructions-more = See the <label data-l10n-name="file-renaming-format-help-link">documentation</label> for more information.
8 changes: 7 additions & 1 deletion addon/locale/zh-CN/preferences.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ auto-move =
file-types = 重命名/移动的附件类型(用','隔开)
about-title = 关于
about-intro = 🌠 新年快乐!Attanger 是 Attachment Manager 的缩写,本项目大量参考了 Zotero 6 版本的 ZotFile 插件。
about-intro = 🌠 新年快乐!Attanger 是 Attachment Manager 的缩写,本项目大量参考了 Zotero 6 版本的 ZotFile 插件。
preferences-file-renaming-customize-button =
.label = 设置重命名规则…
preferences-file-renaming-format-instructions-more = 阅读<label data-l10n-name="file-renaming-format-help-link">文档</label>获取更多帮助。
1 change: 0 additions & 1 deletion src/modules/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ async function attachNewFile(options: {
showAttachmentItem(attItem);
if (!attItem.parentItemID) {
Zotero.RecognizeDocument.autoRecognizeItems([attItem]);
// showAttachmentItem(attItem);
}
removeFile(path);
}
Expand Down

0 comments on commit dedb378

Please sign in to comment.