ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Zotero: add a history feature for paper viewing

2020-06-14 12:06:00  阅读:263  来源: 互联网

标签:items javascript add feature viewing paper key history Zotero


During my time with Zotero, I've really enjoyed its various features and the 300MB of file sync space is able to be extended by modifying the path to a synchronized folder under oneDrive or dropBox. reference: Extending Zotero's syncing folder size by DropBox

However, I often get lost when jumping between papers. After jumping from paper A to paper B, I am unable to go back to paper A if I forget its name.

I wish I could write an extension to add a history feature for paper viewing. In the official documentation, I didn't find a way to build extension (how to generate a .zoteroplugin from source code?) for Zotero 5.0. And I failed at compiling and installing the the source code for the hello-world-zotero extension, on Zotero 5.0.

Fortunately, with Zotero 5.0's javascript API, I've managed to implement a way of Manually logs the history of the papers viewed. It's not quite user friendly yet, but it barely works.

If you know how to do this via extension, drop me a comment, thanks!


我在使用Zotero期间,非常喜欢它的各种功能,并且300MB的文件同步空间也可以通过修改路径扩展到oneDrive或dropBox等文件同步服务器上。

但是,我在论文间跳转时,常常会迷失方向。从A论文跳转到B论文后,无法回退至A论文。

我希望可以写一个扩展程序来增加论文查看的历史记录功能。由于我并没有在官方文档中找到Zotero5.0的扩展程序build方法,我失败于将hello-world-zotero扩展的源码进行编译并安装进Zotero5.0.

还好,我通过 Zotero 5.0 的 javascript API, 勉强实现了一个手动的记录所浏览的paper的历史记录。它还不太友好,但勉强能用。

如果你知道如何通过扩展来实现,请给我留言,谢谢!

使用环境:

Zotero v5.0.87
tested on Mac OSX 10.15.4
windows user can try the same way and comment on how it works. thx!

使用方法:

Zotero -> Tools -> Develop -> Run javascript

step1. 先执行第1段代码,进行变量的初始化:Initialize the variable by executing the first patch of code:

//=== initialize the history ====
var items = Zotero.getActiveZoteroPane().getSelectedItems();
var cur_itemKey = items[0].key;
var tmp_key = cur_itemKey;
var key_paper_list = 'List of keys of papers your selected:\n';
cur_itemKey += '\n';

step2. 然后将第1段代码替换成第2段代码: then replace the first patch of code with the below.

//==== run above once, and modify above 5 lines into: ====
items = Zotero.getActiveZoteroPane().getSelectedItems();
cur_itemKey = items[0].key + '\n';
if(items[0].key !=tmp_key){
	tmp_key = items[0].key;
	key_paper_list += cur_itemKey;
}
else{
    key_paper_list += '';
}

step3. 回到Zotero主界面,进行论文浏览,每切换一次论文,就回到Run javascript界面执行一次第2段代码,进行历史记录。Return to the Zotero main screen and browse papers, returning to Run every time you switch papers. The javascript interface executes the 2nd code once to make a history.

step4. 通过搜索,直接输入key即可回溯浏览记录。go back through the browsing history by searching and entering the key directly.

Tips:

on Mac OSX, use Command+` to switch between javascript running interface and Zotero paper viewing interface.

参考:Reference:

Zotero JavaScript API
Zotero Source Code

标签:items,javascript,add,feature,viewing,paper,key,history,Zotero
来源: https://www.cnblogs.com/sonictl/p/13124264.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有