Skip to content

Commit

Permalink
update: Preference UI
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyu committed Mar 22, 2022
1 parent d166b9c commit 5f750b4
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 58 deletions.
37 changes: 4 additions & 33 deletions chrome/content/preferences.xul
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<tab label="&zotero.zoterotag.help.title.label;" />
</tabs>

<tabpanels id="zotero-prefpane-zoterotag" orient="vertical" minheight="400">
<tabpanels id="zotero-prefpane-zoterotag" orient="vertical" minheight="300">
<tabpanel id="zotero-prefpane-zoterotag-rules" orient="vertical">
<listbox id="zoterotag-rules-listbox" flex="1">
<listhead>
Expand All @@ -27,39 +27,12 @@
</listhead>
<listcols>
<listcol />
<listcol width="250" />
<listcol width="200" />
<listcol />
<listcol />
<listcol />
<listcol />
<!-- <listcol width="80"/> -->
</listcols>
<!-- <listitem id="zoterotag-rules-#" allowevents="true">
<listcell>
<label id="zoterotag-rules-#-id" value="#"/>
</listcell>
<listcell>
<textbox id="zoterotag-rules-#-tags"/>
</listcell>
<listcell>
<menulist id="zoterotag-rules-#-group">
<menupopup>
<menuitem value="1" label="1(&zotero.zoterotag.rules.group.default;)"/>
<menuitem value="2" label="2"/>
<menuitem value="3" label="3"/>
<menuitem value="0" label="&zotero.zoterotag.rules.group.other;"/>
</menupopup>
</menulist>
</listcell>
<listcell>
<checkbox id="zoterotag-rules-#-autoadd"/>
</listcell>
<listcell>
<button label="&zotero.zoterotag.rules.add;" tooltiptext="&zotero.zoterotag.rules.addtext;" oncommand="addRule()"/>
</listcell>
<listcell>
<button label="&zotero.zoterotag.rules.remove;" tooltiptext="&zotero.zoterotag.rules.removetext;" oncommand="" disabled="true"/>
</listcell>
</listitem> -->
</listbox>
<hbox style="display: block">
<button label="&zotero.zoterotag.rules.reset;" tooltiptext="&zotero.zoterotag.rules.resettext;" oncommand="resetPreferences()" />
Expand All @@ -78,9 +51,7 @@
<groupbox>
<caption label="&zotero.zoterotag.help.shortcuts.caption.label;" />
<hbox style="display: block">
<label value="&zotero.zoterotag.help.shortcuts.add.label;" />
<label value="&zotero.zoterotag.help.shortcuts.remove.label;" />
<label value="&zotero.zoterotag.help.shortcuts.auto.label;" />
<label value="&zotero.zoterotag.help.shortcuts.label;" />
</hbox>
</groupbox>
<groupbox>
Expand Down
7 changes: 2 additions & 5 deletions chrome/content/scripts/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ creatRuleListElement = function (rule) {
textbox = document.createElement("textbox");
textbox.setAttribute("id", `${listIDHead}-${rule.id}-tags`);
textbox.setAttribute("value", `${rule.tags}`);
textbox.setAttribute("style", "width: 240px");
textbox.setAttribute("style", "width: 190px");
listcell.appendChild(textbox);
listitem.appendChild(listcell);

Expand All @@ -133,14 +133,11 @@ creatRuleListElement = function (rule) {
menulist.setAttribute("id", `${listIDHead}-${rule.id}-group`);
menupopup = document.createElement("menupopup");
let menuValueList = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
let menuLabelList = ["1(default)*", "2*", "3*", "4", "5", "6", "7", "8", "9"];
let menuLabelList = ["Alt+1", "Alt+2", "Alt+3", "Alt+4", "Alt+5", "Alt+6", "Alt+7", "Alt+8", "Alt+9"];
for (let i = 0; i < menuValueList.length; i++) {
menuitem = document.createElement("menuitem");
menuitem.setAttribute("value", menuValueList[i]);
menuitem.setAttribute("label", menuLabelList[i]);
if (menuLabelList[i][menuLabelList[i].length - 1] === "*") {
menuitem.setAttribute("style", "color: green");
}
menupopup.appendChild(menuitem);
}
menulist.setAttribute("value", `${rule.group}`);
Expand Down
16 changes: 7 additions & 9 deletions chrome/locale/en-US/overlay.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!ENTITY zotero.zoterotag.rules.listheader.tags "Tags">
<!ENTITY zotero.zoterotag.rules.listheader.autoadd "Auto-Tag">
<!ENTITY zotero.zoterotag.rules.listheader.autoremove "Read-Untag">
<!ENTITY zotero.zoterotag.rules.listheader.group "Group">
<!ENTITY zotero.zoterotag.rules.listheader.group "Shortcuts">
<!ENTITY zotero.zoterotag.rules.listheader.operation "Operation">
<!ENTITY zotero.zoterotag.rules.listheader.delete "Delete">
<!ENTITY zotero.zoterotag.rules.group.default "default">
Expand All @@ -24,19 +24,17 @@

<!ENTITY zotero.zoterotag.help.title.label "Help">
<!ENTITY zotero.zoterotag.help.rules.caption.label "Rules">
<!ENTITY zotero.zoterotag.rules.info.1.label "Tag groups can be added/removed using shortcut keys;">
<!ENTITY zotero.zoterotag.rules.info.2.label "Group 1, 2, and 3 can also be controlled through the right-click menu;">
<!ENTITY zotero.zoterotag.rules.info.3.label "You can set Auto-Tag/Read-Untag for different rules;">
<!ENTITY zotero.zoterotag.rules.info.1.label "One add-on to rule Tags all">
<!ENTITY zotero.zoterotag.rules.info.2.label "Auto-Tag tags will be added to new items; Read-Untag tags will be removed after file opened;">
<!ENTITY zotero.zoterotag.rules.info.3.label "Select multiple items/collections and right click to add/remove tags in batch.">
<!ENTITY zotero.zoterotag.rules.info.4.label "Split different tags by ','(comma) and manage them in one rule;">
<!ENTITY zotero.zoterotag.rules.info.5.label "Example: rule 2 contains 'tag1, tag2, tag3', and all three tags can be managed in rule 2.">
<!ENTITY zotero.zoterotag.help.shortcuts.caption.label "Shortcut Keys">
<!ENTITY zotero.zoterotag.help.shortcuts.add.label "Due to the Zotero 6.0+ update, the ctrl+(0~9) are no longer supported.">
<!ENTITY zotero.zoterotag.help.shortcuts.remove.label "The shortcut keys for adding/removing a tag group from selected items: alt+1 (group 1), alt+2 (group 2), and so on.">
<!ENTITY zotero.zoterotag.help.shortcuts.auto.label "alt+0 (add/remove group auto).">
<!ENTITY zotero.zoterotag.help.shortcuts.label "Add/remove in selected items: Alt+(1~9); Auto-Tag tags: Alt+0">
<!ENTITY zotero.zoterotag.help.setcolor.caption.label "Colorize">
<!ENTITY zotero.zoterotag.help.setcolor.label "How to colorize my tags?">
<!ENTITY zotero.zoterotag.help.feedback.caption.label "Feedback">
<!ENTITY zotero.zoterotag.help.feedback.label "github">

<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag VERSION 0.1.4">
<!ENTITY zotero.zoterotag.help.releasetime.label "2022-03-22 00:02:26">
<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag VERSION 0.1.5">
<!ENTITY zotero.zoterotag.help.releasetime.label "2022-03-22 10:34:44">
16 changes: 7 additions & 9 deletions chrome/locale/zh-CN/overlay.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!ENTITY zotero.zoterotag.rules.listheader.tags "标签">
<!ENTITY zotero.zoterotag.rules.listheader.autoadd "自动添加">
<!ENTITY zotero.zoterotag.rules.listheader.autoremove "自动已读">
<!ENTITY zotero.zoterotag.rules.listheader.group "分组">
<!ENTITY zotero.zoterotag.rules.listheader.group "快捷键">
<!ENTITY zotero.zoterotag.rules.listheader.operation "操作">
<!ENTITY zotero.zoterotag.rules.listheader.delete "删除">
<!ENTITY zotero.zoterotag.rules.group.default "默认">
Expand All @@ -24,19 +24,17 @@

<!ENTITY zotero.zoterotag.help.title.label "帮助">
<!ENTITY zotero.zoterotag.help.rules.caption.label "规则">
<!ENTITY zotero.zoterotag.rules.info.1.label "所有规则都可以使用快捷键添加/移除;">
<!ENTITY zotero.zoterotag.rules.info.2.label "分组1,2,3中的规则还可以通过右键菜单控制;">
<!ENTITY zotero.zoterotag.rules.info.3.label "可以为不同规则分别设置自动添加;">
<!ENTITY zotero.zoterotag.rules.info.1.label "One add-on to rule Tags all">
<!ENTITY zotero.zoterotag.rules.info.2.label "带自动添加的分组将自动添加到新条目, 带自动已读的分组将自动在文件打开后移除">
<!ENTITY zotero.zoterotag.rules.info.3.label "选中项目/集合右键可以从弹出窗口输入要批量添加/移除的标签">
<!ENTITY zotero.zoterotag.rules.info.4.label "用半角逗号(,)分隔不同标签,并在一条规则中同时管理它们;">
<!ENTITY zotero.zoterotag.rules.info.5.label "例如:规则2包含'tag1, tag2, tag3',则三个标签都将由规则2管理。">
<!ENTITY zotero.zoterotag.help.shortcuts.caption.label "快捷键">
<!ENTITY zotero.zoterotag.help.shortcuts.add.label "由于Zotero 6.0+更新, ctrl+(0~9) 快捷键将不再受到支持。">
<!ENTITY zotero.zoterotag.help.shortcuts.remove.label "从选中项添加/删除标签组快捷键: alt+1(组 1), alt+2(组 2),以此类推。">
<!ENTITY zotero.zoterotag.help.shortcuts.auto.label "alt+0 (添加/移除“自动添加”标签组)。">
<!ENTITY zotero.zoterotag.help.shortcuts.label "从选中项添加/移除标签快捷键: Alt+(1~9); 添加/移除“自动添加”标签组: Alt+0">
<!ENTITY zotero.zoterotag.help.setcolor.caption.label "为标签添加颜色">
<!ENTITY zotero.zoterotag.help.setcolor.label "如何为标签添加颜色?">
<!ENTITY zotero.zoterotag.help.feedback.caption.label "意见反馈">
<!ENTITY zotero.zoterotag.help.feedback.label "github">

<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag 版本 0.1.4">
<!ENTITY zotero.zoterotag.help.releasetime.label "2022-03-22 00:02:26">
<!ENTITY zotero.zoterotag.help.version.label "ZoteroTag 版本 0.1.5">
<!ENTITY zotero.zoterotag.help.releasetime.label "2022-03-22 10:34:44">
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RDF:about="urn:mozilla:install-manifest"
em:id="zoterotag@euclpts.com"
em:name="Zotero Tag"
em:version="0.1.4"
em:version="0.1.5"
em:type="2"
em:creator="windingwind"
em:description="One add-on to rule Tags all."
Expand Down
2 changes: 1 addition & 1 deletion update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>0.1.4</em:version>
<em:version>0.1.5</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>zotero@chnm.gmu.edu</em:id>
Expand Down

0 comments on commit 5f750b4

Please sign in to comment.