Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0.3 代码审改 #374

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

v1.0.3 代码审改 #374

wants to merge 5 commits into from

Conversation

jiaojiaodubai
Copy link
Collaborator

Preference

  1. 键名规范化为小驼峰;
  2. 同时迁移 Zotero 7 的设置项;
  3. 移除不再使用的设置项;
  4. 初始化后不再校验设置项的有效性;
  5. 更优雅地初始化默认下载路径。

转换器

  1. 数据文件转移到数据文件夹,避免临时文件夹不可靠或 translators_CN 退出后被删除;
  2. 实现启动主窗口自动检查更新;
  3. 添加 jsDeliver 源;
  4. 重写转换器表格窗口,统一原生风格,实现所有列排刷,优化列宽。
  • 待办:使用 Zotero.File.checkFileAccessError 检查转换器的可访问性,引导用户解除”同步文件夹“导致的文件锁定。

CSL 样式

  1. 在 Preference 窗口的 cite 面板注入了社区样式的链接。
  • 待办:监听安装时”可能不是有效样式“的对话框,引导用户点击”OK“。

l10n

  1. 更改部分键名;
  2. 更正错误翻译;
  3. 添加 zh-TW 本地化文件。

代码风格

  1. 删去插件模板的无用注释;
  2. 重命名了一些函数;
  3. 添加或修改了一些函数的注释;
  4. 回调函数的事件参数统一命名为 event 而非 eevtry 语句的 catch 子句参数统一为 error
  5. 条件判断中尽量使用严格比较(===!==);
  6. 注释说明用句子式大写(Sentence Capitalization),log 语句用全小写;
  7. 所有的类型断言(as xxx)和 @ts-ignore 都应该给出忽略类型检查的理由。

其他

  1. 添加了一些 utils。
  2. 在业务关键分支处添加清晰的,方便追踪问题。

@l0o0
Copy link
Owner

l0o0 commented Feb 23, 2025

1. 转换器表格

我感觉 新 转换器表格非常优雅。

  • 表格这两个链接,不能点开
    图片

  • 搜索框我觉得放在左边会不会好一些,我感觉放左边会好看一些。而且本能会关注点会在左边,可以方便输入。

@jiaojiaodubai
Copy link
Collaborator Author

jiaojiaodubai commented Feb 23, 2025

表格这两个链接,不能点开
Zotero.lauchUrl 是调用默认浏览器打开的,你检查一下是不是没有设默认浏览器。

搜索框我觉得放在左边会不会好一些,我感觉放左边会好看一些。而且本能会关注点会在左边,可以方便输入。

放右边是参考了 Zotero 的设计风格,如果需要放到右边的话,可以

<div style="width: 100%;display: flex;justify-content: start;">
  <!-- something -->
</div>

image

Comment on lines 107 to 108
<label data-l10n-id="how-to-update-translators" class="zotero-text-link"/>
<label data-l10n-id="translators-dashboard" class="zotero-text-link"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<label data-l10n-id="how-to-update-translators" class="zotero-text-link"/>
<label data-l10n-id="translators-dashboard" class="zotero-text-link"/>
<label data-l10n-id="how-to-update-translators" class="zotero-text-link" is="zotero-text-link"/>
<label data-l10n-id="translators-dashboard" class="zotero-text-link" is="zotero-text-link"/>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我注意到这个 is 了,但是我写的时候并没有发现这个 is 对 UI 有什么实质影响,所以本着不增加多余代码的原则去掉了。现在经过搜索,发现一些 scss 在用,我会马上保持这个一致性。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只有带有这个 is 属性的文本链接才能拉起浏览器。

<div id="table-container"></div>
</main>
<footer>
<div id="buttons" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里声明命名空间是刻意的吗?

Copy link
Collaborator Author

@jiaojiaodubai jiaojiaodubai Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

刻意的,button 在两个命名空间里都有,在此明示之。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants