Skip to content

Commit

Permalink
Merge pull request #49 from vict0rsch/scirate
Browse files Browse the repository at this point in the history
  • Loading branch information
vict0rsch authored Jan 3, 2022
2 parents c198a95 + ea389b9 commit 751b189
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 12 deletions.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ This browser extension allows you to do automatically store research papers you
* Proceedings of Machine Learning Research (PMLR) (AISTATS, ICML, CoRL, CoLT, ALT, UAI etc.)
* Association for Computational Linguistics (ACL) (EMNLP, ACL, CoNLL, NAACL etc.)
* Proceedings of the National Academy of Sciences (PNAS)
* SciRate
* [Add more](https://github.com/vict0rsch/PaperMemory/issues/13)

[About finding published papers from preprints](#preprints)
Expand Down
5 changes: 3 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Paper Memory",
"version": "0.4.2.3",
"version": "0.4.3",
"manifest_version": 2,
"description": "Automatically record papers you read from Arxiv, OpenReview & more! Organize your library with tags, links to code and quick notes.",
"homepage_url": "https://github.com/vict0rsch/PaperMemory",
Expand Down Expand Up @@ -61,7 +61,8 @@
"*://*.pnas.org/content/*",
"*://openaccess.thecvf.com/*",
"*://openreview.net/*",
"*://aclanthology.org/*"
"*://aclanthology.org/*",
"*://scirate.com/arxiv/*"
],
"run_at": "document_start",
"js": [
Expand Down
6 changes: 6 additions & 0 deletions src/popup/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ const popupMain = async (url, isKnownPage, manualTrigger = false) => {
// ------------------------
// ----- SVG clicks -----
// ------------------------
addListener(`popup-memory-item-scirate--${id}`, "click", () => {
const arxivId = paper.id.split("-").reverse()[0];
const scirateURL = `https://scirate.com/arxiv/${arxivId}`;
chrome.tabs.update({ url: scirateURL });
window.close();
});
addListener(`popup-memory-item-link--${id}`, "click", () => {
const pdfURL = paperToPDF(paper);
const absURL = paperToAbs(paper);
Expand Down
16 changes: 15 additions & 1 deletion src/popup/js/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,21 @@ const getPopupPaperIconsHTML = (paper, currentUrl) => {
const id = paper.id;
const name = paperToAbs(paper) === currentUrl ? "HTML" : "PDF";

return /*html*/ ` <div
let scirate = "";
if (global.state.menu.checkScirate && paper.source === "arxiv") {
scirate = /*html*/ `
<div
tabindex="0"
class="memory-item-svg-div"
id="popup-memory-item-scirate--${id}"
title="Open on SciRate"
>
${tablerSvg("messages", "", ["popup-click-svg"])}
</div>`;
}

return /*html*/ `${scirate}
<div
tabindex="0"
class="memory-item-svg-div"
id="popup-memory-item-link--${id}"
Expand Down
2 changes: 1 addition & 1 deletion src/popup/min/popup.min.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/popup/min/popup.min.js

Large diffs are not rendered by default.

20 changes: 17 additions & 3 deletions src/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ <h1>Paper Memory</h1>
<p>Keep track of your readings with <strong>PaperMemory!</strong> It automatically and locally stores
papers you open in your browser</p>
<p>When opening a paper (its web page or pdf), a reference to that paper will be stored in your
Memory. Supports Arxiv, Open Review, NeurIPS, CVPR, I/ECCV, PMLR (ICML, AISTATS, CoRL, CoLT etc.)! Ask
for more on Github
Memory. Supports Arxiv, Open Review, NeurIPS, CVPR, I/ECCV, PMLR, PNAS, ACL,
SciRate and more! Ask
for new venues on Github.
</p>

<p>Click on the Memory button below <svg xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -147,6 +148,9 @@ <h3 class="mt-4">⋗ Configuration</h3>
<input class="switch" type="checkbox" id="checkDirectOpen" name="checkDirectOpen" value="checkDirectOpen">
<label for="checkDirectOpen">Directly open the Memory when not on a Paper's page</label><br><br>

<input class="switch" type="checkbox" id="checkScirate" name="checkScirate" value="checkScirate">
<label for="checkScirate">Add a link to SciRate in the popup</label><br><br>

<input class="switch" type="checkbox" id="checkStore" name="checkStore" value="checkStore">
<label for="checkStore">Download pdfs to PaperMemory's folder in your Downloads to be able to open them
instead of re-downloading. More about this in the options page (see below)</label><br><br>
Expand Down Expand Up @@ -329,7 +333,17 @@ <h3>Search</h3>
<h3 style="margin-bottom: 0px;">What's new</h3>
<ul>
<li><strong>Current: </strong><a
href="https://github.com/vict0rsch/PaperMemory/releases/tag/0.4.2.3">0.4.2.3</a>
href="https://github.com/vict0rsch/PaperMemory/releases/tag/0.4.3">0.4.3</a>
<em>(2022-01-03)</em>
<ul>
<li>[dev] Hotfix: Improve long codelinks display</li>
<li>[feature] Add a direct link to SciRate in the popup</li>
<li>[new source] Parse papers from scirate.com/arxiv/ as Arxiv papers into your Memory</li>
<li>[feature][beta] Download pdfs in a dedicated folder to open those local files instead of
re-downloading pdfs all the time</li>
</ul>
</li>
<li><a href="https://github.com/vict0rsch/PaperMemory/releases/tag/0.4.2.3">0.4.2.3</a>
<em>(2021-12-13)</em>
<ul>
<li>[dev] Hotfix: match ACL pdf webpages</li>
Expand Down
10 changes: 8 additions & 2 deletions src/shared/js/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,17 @@ global.menuCheckNames = [
"checkDarkMode",
"checkDirectOpen",
"checkStore",
"checkScirate",
];
/**
* Menu check names which should not default to true but to false
*/
global.menuCheckDefaultFalse = ["checkDarkMode", "checkDirectOpen", "checkStore"];
global.menuCheckDefaultFalse = [
"checkDarkMode",
"checkDirectOpen",
"checkStore",
"checkScirate",
];
/**
* All keys to retrieve from the menu, the checkboxes + the custom pdf function
*/
Expand All @@ -66,7 +72,7 @@ global.menuStorageKeys = [...global.menuCheckNames, "pdfTitleFn"];
* IMPORTANT: paper page before pdf (see background script)
*/
global.knownPaperPages = {
arxiv: ["arxiv.org/abs/", "arxiv.org/pdf/"],
arxiv: ["arxiv.org/abs/", "arxiv.org/pdf/", "scirate.com/arxiv/"],
neurips: ["neurips.cc/paper/", "nips.cc/paper/"],
cvf: ["openaccess.thecvf.com/content"],
openreview: ["openreview.net/forum", "openreview.net/pdf"],
Expand Down
9 changes: 9 additions & 0 deletions src/shared/js/utils/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,10 @@ const initState = async (papers, isContentScript) => {
global.state.sortKey = "lastOpenDate";
global.state.papersReady = true;
global.state.menu = menu;

sortMemory();
makeTags();

console.log("State initialization duration (s): " + (Date.now() - s) / 1000);
};

Expand Down Expand Up @@ -1232,6 +1234,13 @@ const tablerSvg = (pathName, id, classNames) => {
<circle cx="12" cy="12" r="3" />
</svg>`;

case "messages":
return `<svg viewBox="0 0 24 24" ${id} ${classNames}>
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M21 14l-3 -3h-7a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1h9a1 1 0 0 1 1 1v10" />
<path d="M14 15v2a1 1 0 0 1 -1 1h-7l-3 3v-10a1 1 0 0 1 1 -1h2" />
</svg>`;

case "external-link":
return ``;

Expand Down
4 changes: 2 additions & 2 deletions src/shared/min/utils.min.js

Large diffs are not rendered by default.

0 comments on commit 751b189

Please sign in to comment.