Skip to content

Commit

Permalink
Merge pull request #167 from YUUUCC/bootstrap
Browse files Browse the repository at this point in the history
Add custom dataset HX
  • Loading branch information
redleafnew authored Oct 1, 2024
2 parents 486acb5 + 1231700 commit 5d6f022
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 7 deletions.
10 changes: 10 additions & 0 deletions addon/chrome/content/preferences.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,16 @@
/>
</hbox>


<hbox>
<checkbox
style="width:250px"
id="zotero-prefpane-__addonRef__-HX"
data-l10n-id="HX"
preference="extensions.zotero.__addonRef__.HX"
/>
</hbox>

<!-- 菜单隐藏设置 -->
<label>
<html:h2 data-l10n-id="menu-setting"></html:h2>
Expand Down
1 change: 1 addition & 0 deletions addon/locale/en-US/addon.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ nssf = NSSF
swupl = SWUPL
ABDC = ABDC
Scopus = Scopus
HX = HX
summary = Summary
Expand Down
2 changes: 2 additions & 0 deletions addon/locale/en-US/preferences.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ ABDC =
.label = ABDC
Scopus =
.label = Scopus
HX =
.label = HX
## 菜单显示隐藏设置
Expand Down
1 change: 1 addition & 0 deletions addon/locale/zh-CN/addon.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ nssf = 国家社科基金
swupl = 西南政法大学
ABDC = ABDC
Scopus = Scopus
HX = HX
summary = 总结
Expand Down
2 changes: 2 additions & 0 deletions addon/locale/zh-CN/preferences.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ ABDC =
.label = 澳大利亚ABDC期刊
Scopus =
.label = Scopus
HX =
.label = HX
## 菜单显示隐藏设置
menu-setting = 显示工具箱菜单设置
Expand Down
1 change: 1 addition & 0 deletions addon/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pref("extensions.zotero.__addonRef__.cpu", false);
pref("extensions.zotero.__addonRef__.njau.core", true);
pref("extensions.zotero.__addonRef__.njau.high.quality", true);
// 自定义数据集
pref("extensions.zotero.__addonRef__.HX", false);
pref("extensions.zotero.__addonRef__.Scopus", false);
pref("extensions.zotero.__addonRef__.ABDC", false); //澳大利亚ABDC
pref("extensions.zotero.__addonRef__.clsci", false);
Expand Down
31 changes: 24 additions & 7 deletions src/modules/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,18 @@ export class KeyExampleFactory {
const ABDC = getPref(`ABDC`);
const Scopus = getPref(`Scopus`);

const HX = getPref(`HX`);

// 自定义数据集
const clsciJourID = "1642199434173014016"; // CLSCI UUID
const amiJourID = "1648920625629810688"; //AMI UUID
const nssfJourID = "1648936694851489792"; //NSSF UUID
const swuplJourID = "1652662162603773952"; //SWUPL UUID 西南政法大学
const ScopusJourID = "1635615726460694528"; //Scopus UUID
const ABDCJourID = "1613183594358972416"; //ABDC UUID
const CCFJourID = "1614919989423271936"; //CCF UUID
var clsciJourID = '1642199434173014016'; // CLSCI UUID
var amiJourID = '1648920625629810688'; //AMI UUID
var nssfJourID = '1648936694851489792';//NSSF UUID
var swuplJourID = '1652662162603773952';//SWUPL UUID 西南政法大学
var ScopusJourID = '1635615726460694528';//Scopus UUID
var ABDCJourID = '1613183594358972416';//ABDC UUID
var CCFJourID = '1614919989423271936';//CCF UUID
var HXJourID = '1630107627939360768';


// 加: any为了后面不报错
if (clsci) {
Expand Down Expand Up @@ -267,6 +271,12 @@ export class KeyExampleFactory {
ABDCJourID,
);
}
if (HX) {
var HXLevel: any = await KeyExampleFactory.getCustomIFs(
item,
HXJourID,
);
}
if (njauJourShow) {
var njauHighQuality = await njauJournal(item);
}
Expand All @@ -280,13 +290,15 @@ export class KeyExampleFactory {
nssfLevel ||
(Scopus && ScopusLevel) ||
(ABDC && ABDCLevel) ||
(HX && HXLevel) ||
njauCore(item) ||
njauHighQuality
) {
if (emptyExtra) {
item.setField("extra", "");
}
n++;

}

try {
Expand Down Expand Up @@ -660,6 +672,10 @@ export class KeyExampleFactory {
if (Scopus && ScopusLevel != undefined) {
ztoolkit.ExtraField.setExtraField(item, "Scopus", "是");
}
// HX
if (HX && HXLevel != undefined) {
ztoolkit.ExtraField.setExtraField(item, 'HX', HXLevel);
}

Zotero.debug("swupl是" + swupl + "swuplLevel是" + swuplLevel);
// 西南政法大学 SWUPL
Expand Down Expand Up @@ -1967,6 +1983,7 @@ export class UIExampleFactory {
},
Scopus: {},
ABDC: {},
HX: {},
summary: {
field: "总结",
},
Expand Down
10 changes: 10 additions & 0 deletions src/modules/preferenceScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,16 @@ function bindPrefEvents() {
ztoolkit.log(e);
UIExampleFactory.registerExtraColumn();
});

// HX
addon.data
.prefs!.window.document.querySelector(
`#zotero-prefpane-${config.addonRef}-HX`
)
?.addEventListener("command", (e) => {
ztoolkit.log(e);
UIExampleFactory.registerExtraColumn();
});

// 影响因子
addon.data
Expand Down

0 comments on commit 5d6f022

Please sign in to comment.