Skip to content

Commit

Permalink
西元2025年01月05日 (週日) 18時43分01秒 CST
Browse files Browse the repository at this point in the history
  • Loading branch information
pulipulichen committed Jan 5, 2025
1 parent cd4d292 commit 60781c8
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions GitHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,27 @@ async function detectWeb(doc, url) {
return false;
}

return new Promise(function (resolve) {
ZU.doGet(`https://raw.githubusercontent.com/${path}/HEAD/CITATION.cff`, function (cffText, xhr) {
if (xhr.status !== 200) {
return resolve("computerProgram");
}
try {
let type = searchFieldValue(cffText, "type");
if (type && type === 'dataset') {
return resolve(type);
}
}
catch (e) {
console.error(`CITATION.cff format is invalid:
${cffText}`);
}
return resolve("computerProgram");
}, null, null, { 'X-Requested-With': 'XMLHttpRequest' }, false);
});
return "computerProgram";

// return new Promise(function (resolve) {

Check failure on line 66 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// ZU.doGet(`https://raw.githubusercontent.com/${path}/HEAD/CITATION.cff`, function (cffText, xhr) {

Check failure on line 67 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// if (xhr.status !== 200) {

Check failure on line 68 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// return resolve("computerProgram");

Check failure on line 69 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// }

Check failure on line 70 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// try {

Check failure on line 71 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// let type = searchFieldValue(cffText, "type");

Check failure on line 72 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// if (type && type === 'dataset') {

Check failure on line 73 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// return resolve(type);

Check failure on line 74 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// }

Check failure on line 75 in GitHub.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected indentation of 1 tab but found 0
// }
// catch (e) {
// console.error(`CITATION.cff format is invalid:

// ${cffText}`);
// }
// return resolve("computerProgram");
// }, null, null, { 'X-Requested-With': 'XMLHttpRequest' }, false);
// });
}


Expand Down

0 comments on commit 60781c8

Please sign in to comment.