-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve query url argument of author, add query option in preference.
- Loading branch information
Showing
14 changed files
with
254 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,5 +87,4 @@ typings/ | |
build/ | ||
builds/ | ||
.DS_Store | ||
package.json | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
var Zotero = Components.classes["@zotero.org/Zotero;1"].getService( | ||
Components.interfaces.nsISupports | ||
).wrappedJSObject; | ||
|
||
function checkScholarUrl() { | ||
var boxUrl = document.getElementById("pref-zscc-scholar-url").value; | ||
if (boxUrl.length == 0) { | ||
Zotero.Prefs.set("extensions.zscc.scholarUrlVerified", false); | ||
Zotero.Prefs.set("extensions.zscc.scholarUrl", ""); | ||
} else { | ||
try { | ||
if (boxUrl.startsWith("https://") && boxUrl.endsWith("/")) { | ||
} else { | ||
throw "Url should start with 'https:// and end with '/'"; | ||
} | ||
|
||
testUrl = boxUrl + "schhp?hl=en"; | ||
|
||
let xhr = new XMLHttpRequest(); | ||
xhr.open("GET", testUrl, false); | ||
xhr.send(); | ||
|
||
if (xhr.status == 200) { | ||
if ( | ||
xhr.responseText.indexOf("Stand on the shoulders of giants") != -1 | ||
) { | ||
// a valid url | ||
alert("This site is valid and have been saved."); | ||
Zotero.Prefs.set("extensions.zscc.scholarUrlVerified", true); | ||
Zotero.Prefs.set("extensions.zscc.scholarUrl", boxUrl); | ||
} else { | ||
throw "This mirror site is not google scholar or not supports english language."; | ||
} | ||
} else { | ||
throw "Cannot open this url, plaease check your url!"; | ||
} | ||
} catch (err) { | ||
// alert user | ||
alert(err); | ||
Zotero.Prefs.set("extensions.zscc.scholarUrlVerified", false); | ||
Zotero.Prefs.set("extensions.zscc.scholarUrl", ""); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0"?> | ||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> | ||
<?xml-stylesheet href="chrome://zotero-platform/content/preferences.css"?> | ||
<?xml-stylesheet href="chrome://zotero-platform-version/content/style.css"?> | ||
|
||
<!DOCTYPE window SYSTEM "chrome://zoteroscholarcitations/locale/options.dtd"> | ||
|
||
<prefwindow id="zscc-perf" title="&zscc-preferences;" | ||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> | ||
|
||
<prefpane label="&zscc-prefpane;" id="zscc-perfpane"> | ||
<preferences> | ||
<preference id="pref-zscc-scholar-url" name="extensions.zscc.scholarUrl" type="string"/> | ||
</preferences> | ||
|
||
<groupbox> | ||
<separator class="thin"/> | ||
<label id="pref-zscc-scholar-url-label" value="&scholar-url-label;"/> | ||
<description>&scholar-url-desc;</description> | ||
<textbox id="pref-zscc-scholar-url" preference="pref-zscc-scholar-url"/> | ||
<button id="pref-zscc-url-verify" label="&scholar-url-verify;" oncommand="checkScholarUrl();"/> | ||
<separator class="thin"/> | ||
</groupbox> | ||
|
||
|
||
</prefpane> | ||
<script src="options.js"/> | ||
<script src="chrome://zotero/content/include.js"/> | ||
</prefwindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!ENTITY zscc-preferences "ZSCC Preferences"> | ||
<!ENTITY zscc-prefpane "ZSCC Preferences"> | ||
<!ENTITY scholar-url-label "Scholar Mirror Site (BETA)"> | ||
<!ENTITY scholar-url-desc "The format should start with 'https://' and end with '/', e.g. https://scholar.google.com/. Leave this blank will use the official site."> | ||
<!ENTITY scholar-url-verify "Verify URL"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<!ENTITY zotero.scholarcitations.update.label "Update citation(s)"> | ||
<!ENTITY zotero.scholarcitations.updateCol.label "Update citations"> | ||
<!ENTITY zotero.scholarcitations.updateAll.label "Update all citations"> | ||
<!ENTITY zotero.scholarcitations.options.label "ZSCC Preferences..."> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,45 @@ | ||
<?xml version="1.0"?> | ||
<RDF:RDF | ||
xmlns:em="http://www.mozilla.org/2004/em-rdf#" | ||
xmlns:NC="http://home.netscape.com/NC-rdf#" | ||
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | ||
<RDF:Description | ||
RDF:about="rdf:#$x61SL3" | ||
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" | ||
em:minVersion="2.0" | ||
em:maxVersion="20.*"/> | ||
<RDF:Description | ||
RDF:about="urn:mozilla:install-manifest" | ||
em:id="zoteroscholarcitations@beloglazov.info" | ||
em:name="Zotero Scholar Citations" | ||
em:version="2.0.6" | ||
em:type="2" | ||
em:creator="Anton Beloglazov, Max Kuehn, Nico" | ||
em:description="Zotero plugin for auto-fetching numbers of citations from Google Scholar" | ||
em:homepageURL="https://github.com/nico-zck/zotero-scholar-citations"> | ||
<em:type>2</em:type> | ||
<em:targetApplication RDF:resource="rdf:#$x61SL3"/> | ||
<em:targetApplication> | ||
<Description> | ||
<em:id>zotero@chnm.gmu.edu</em:id> | ||
<em:minVersion>5.0.66</em:minVersion> | ||
<em:maxVersion>6.*</em:maxVersion> | ||
</Description> | ||
</em:targetApplication> | ||
<em:localized> | ||
<Description> | ||
<em:locale>ru-RU</em:locale> | ||
<em:name>Zotero Scholar Citations</em:name> | ||
<em:description>Плагин для Zotero для автоматической выборки числа цитирований из Google Scholar.</em:description> | ||
</Description> | ||
</em:localized> | ||
<em:localized> | ||
<Description> | ||
<em:locale>it-IT</em:locale> | ||
<em:name>Zotero Scholar Citations</em:name> | ||
<em:description>Plugin di Zotero per il recupero automatico del numero di citazioni in Google Scholar.</em:description> | ||
</Description> | ||
</em:localized> | ||
</RDF:Description> | ||
</RDF:RDF> | ||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
xmlns:em="http://www.mozilla.org/2004/em-rdf#"> | ||
|
||
<Description about="urn:mozilla:install-manifest"> | ||
<em:id>zoteroscholarcitations@nico.info</em:id> | ||
<em:name>Zotero Scholar Citations</em:name> | ||
<em:version>2.1.0</em:version> | ||
<em:type>2</em:type> | ||
<em:multiprocessCompatible>true</em:multiprocessCompatible> | ||
<em:creator>Nico</em:creator> | ||
<em:homepageURL>https://github.com/nico-zck/zotero-scholar-citations</em:homepageURL> | ||
<em:optionsURL>chrome://zoteroscholarcitations/content/options.xul</em:optionsURL> | ||
<em:updateURL>https://github.com/nico-zck/zotero-scholar-citations/master/update.rdf</em:updateURL> | ||
|
||
<em:targetApplication> | ||
<Description> | ||
<em:id>zotero@chnm.gmu.edu</em:id> | ||
<em:minVersion>5.0.0</em:minVersion> | ||
<em:maxVersion>6.0.*</em:maxVersion> | ||
</Description> | ||
</em:targetApplication> | ||
|
||
<em:localized> | ||
<Description> | ||
<em:locale>en-US</em:locale> | ||
<em:name>Zotero Scholar Citations</em:name> | ||
<em:description>Advanced PDF management for Zotero</em:description> | ||
</Description> | ||
</em:localized> | ||
<em:localized> | ||
<Description> | ||
<em:locale>ru-RU</em:locale> | ||
<em:name>Zotero Scholar Citations</em:name> | ||
<em:description>Плагин для Zotero для автоматической выборки числа цитирований из Google Scholar.</em:description> | ||
</Description> | ||
</em:localized> | ||
<em:localized> | ||
<Description> | ||
<em:locale>it-IT</em:locale> | ||
<em:name>Zotero Scholar Citations</em:name> | ||
<em:description>Plugin di Zotero per il recupero automatico del numero di citazioni in Google Scholar.</em:description> | ||
</Description> | ||
</em:localized> | ||
</Description> | ||
</RDF> |
Oops, something went wrong.