Skip to content

Commit

Permalink
Update to Zotero 5.0.96.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrom34 committed Aug 22, 2021
1 parent 1ced06b commit 9a5864f
Show file tree
Hide file tree
Showing 257 changed files with 56,602 additions and 5,058 deletions.
2 changes: 1 addition & 1 deletion App/AppInfo/appinfo.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Freeware=true
CommercialUse=true

[Version]
PackageVersion=5.0.96.2
PackageVersion=5.0.96.3
DisplayVersion=5.0

[Control]
Expand Down
4 changes: 2 additions & 2 deletions App/Zotero/application.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[App]
Vendor=Zotero
Name=Zotero
Version=5.0.96.2
BuildID=20210416063839
Version=5.0.96.3
BuildID=20210819214940
Copyright=Copyright (c) 2006-2018 Contributors
ID[email protected]

Expand Down
67 changes: 44 additions & 23 deletions App/Zotero/components/zotero-autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ZoteroAutoComplete.prototype.startSearch = Zotero.Promise.coroutine(function* (s
case 'tag':
var sql = "SELECT DISTINCT name AS val, NULL AS id FROM tags WHERE name LIKE ? ESCAPE '\\'";
var sqlParams = [Zotero.DB.escapeSQLExpression(searchString) + '%'];
if (searchParams.libraryID !== undefined) {
if (searchParams.libraryID) {
sql += " AND tagID IN (SELECT tagID FROM itemTags JOIN items USING (itemID) " +
"WHERE libraryID=?)";
sqlParams.push(searchParams.libraryID);
Expand All @@ -95,15 +95,15 @@ ZoteroAutoComplete.prototype.startSearch = Zotero.Promise.coroutine(function* (s
var sql = "SELECT DISTINCT CASE fieldMode WHEN 1 THEN lastName " +
"WHEN 0 THEN firstName || ' ' || lastName END AS val, NULL AS id " +
"FROM creators ";
if (searchParams.libraryID !== undefined) {
if (searchParams.libraryID) {
sql += "JOIN itemCreators USING (creatorID) JOIN items USING (itemID) ";
}
sql += "WHERE CASE fieldMode " +
"WHEN 1 THEN lastName LIKE ? " +
"WHEN 0 THEN (firstName || ' ' || lastName LIKE ?) OR (lastName LIKE ?) END ";
var sqlParams = [searchString + '%', searchString + '%', searchString + '%'];
if (searchParams.libraryID !== undefined) {
sql += " AND libraryID=?";
"WHEN 1 THEN lastName LIKE ?1 " +
"WHEN 0 THEN (firstName || ' ' || lastName LIKE ?1) OR (lastName LIKE ?1) END ";
var sqlParams = [searchString + '%'];
if (searchParams.libraryID) {
sql += ` AND libraryID=?${sqlParams.length + 1}`;
sqlParams.push(searchParams.libraryID);
}
sql += "ORDER BY val";
Expand Down Expand Up @@ -131,26 +131,26 @@ ZoteroAutoComplete.prototype.startSearch = Zotero.Promise.coroutine(function* (s
}

var fromSQL = " FROM creators ";
if (searchParams.libraryID !== undefined) {
if (searchParams.libraryID) {
fromSQL += "JOIN itemCreators USING (creatorID) JOIN items USING (itemID) ";
}
fromSQL += "WHERE " + subField + " LIKE ? " + "AND fieldMode=?";
fromSQL += "WHERE " + subField + " LIKE ?1 AND fieldMode=?2";
var sqlParams = [
searchString + '%',
searchParams.fieldMode ? searchParams.fieldMode : 0];

if (searchParams.itemID) {
fromSQL += " AND creatorID NOT IN (SELECT creatorID FROM " +
"itemCreators WHERE itemID=?";
`itemCreators WHERE itemID=?${sqlParams.length + 1}`;
sqlParams.push(searchParams.itemID);
if (searchParams.creatorTypeID) {
fromSQL += " AND creatorTypeID=?";
fromSQL += ` AND creatorTypeID=?${sqlParams.length + 1}`;
sqlParams.push(searchParams.creatorTypeID);
}
fromSQL += ")";
}
if (searchParams.libraryID !== undefined) {
fromSQL += " AND libraryID=?";
if (searchParams.libraryID) {
fromSQL += ` AND libraryID=?${sqlParams.length + 1}`;
sqlParams.push(searchParams.libraryID);
}

Expand All @@ -162,7 +162,6 @@ ZoteroAutoComplete.prototype.startSearch = Zotero.Promise.coroutine(function* (s
sql = "SELECT * FROM (" + sql + " UNION SELECT DISTINCT " +
subField + " AS val, creatorID || '-1' AS id" +
fromSQL + ") GROUP BY val";
sqlParams = sqlParams.concat(sqlParams);
}

sql += " ORDER BY val";
Expand All @@ -171,17 +170,32 @@ ZoteroAutoComplete.prototype.startSearch = Zotero.Promise.coroutine(function* (s

case 'dateModified':
case 'dateAdded':
var sql = "SELECT DISTINCT DATE(" + fieldName + ", 'localtime') AS val, NULL AS id FROM items " +
"WHERE " + fieldName + " LIKE ? ORDER BY " + fieldName;
var sql = "SELECT DISTINCT DATE(" + fieldName + ", 'localtime') AS val, NULL AS id " +
"FROM items WHERE " + fieldName + " LIKE ? ";
var sqlParams = [searchString + '%'];
if (searchParams.libraryID) {
sql += "AND libraryID=? ";
sqlParams.push(searchParams.libraryID);
}
sql += "ORDER BY " + fieldName;

break;

case 'accessDate':
var fieldID = Zotero.ItemFields.getID('accessDate');

var sql = "SELECT DISTINCT DATE(value, 'localtime') AS val, NULL AS id FROM itemData " +
"WHERE fieldID=? AND value LIKE ? ORDER BY value";
var sql = "SELECT DISTINCT DATE(value, 'localtime') AS val, NULL AS id FROM itemData ";
if (searchParams.libraryID) {
sql += "JOIN items USING (itemID) ";
}
sql += "WHERE fieldID=? AND value LIKE ? ";
var sqlParams = [fieldID, searchString + '%'];
if (searchParams.libraryID) {
sql += "AND libraryID=? ";
sqlParams.push(searchParams.libraryID);
}
sql += "ORDER BY value";

break;

default:
Expand All @@ -197,17 +211,24 @@ ZoteroAutoComplete.prototype.startSearch = Zotero.Promise.coroutine(function* (s
// use the user part of the multipart field
var valueField = fieldName == 'date' ? 'SUBSTR(value, 12, 100)' : 'value';

var sql = "SELECT DISTINCT " + valueField + " AS val, NULL AS id " +
"FROM itemData NATURAL JOIN itemDataValues " +
"WHERE fieldID=?1 AND " + valueField +
" LIKE ?2 ";

var sql = "SELECT DISTINCT " + valueField + " AS val, NULL AS id FROM itemData ";
if (searchParams.libraryID) {
sql += "JOIN items USING (itemID) ";
}
sql += "JOIN itemDataValues USING (valueID) " +
"WHERE fieldID=?1 AND " + valueField + " LIKE ?2 ";
var sqlParams = [fieldID, searchString + '%'];
// Exclude values from an item
if (searchParams.itemID) {
sql += "AND value NOT IN (SELECT value FROM itemData " +
"NATURAL JOIN itemDataValues WHERE fieldID=?1 AND itemID=?3) ";
sqlParams.push(searchParams.itemID);
}
// Limit to specific library
if (searchParams.libraryID) {
sql += `AND libraryID=?${sqlParams.length + 1} `;
sqlParams.push(searchParams.libraryID);
}
sql += "ORDER BY value";}


Expand Down
2 changes: 1 addition & 1 deletion App/Zotero/defaults/preferences/zotero.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pref("extensions.zotero.automaticScraperUpdates", true);
pref("extensions.zotero.triggerProxyAuthentication", true);
// Proxy auth URLs should respond successfully to HEAD requests over HTTP and HTTPS (in case of forced HTTPS requests)
pref("extensions.zotero.proxyAuthenticationURLs", "https://www.acm.org,https://www.ebscohost.com,https://www.sciencedirect.com,https://ieeexplore.ieee.org,https://www.jstor.org,http://www.ovid.com,https://link.springer.com,https://www.tandfonline.com");
pref("extensions.zotero.openURL.resolver", "http://worldcatlibraries.org/registry/gateway");
pref("extensions.zotero.openURL.resolver", "https://www.worldcat.org/registry/gateway");
pref("extensions.zotero.openURL.version", "1.0");
pref("extensions.zotero.automaticSnapshots", true);
pref("extensions.zotero.downloadAssociatedFiles", true);
Expand Down
2 changes: 1 addition & 1 deletion App/Zotero/extensions/[email protected]/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:name>Zotero LibreOffice Integration</em:name>
<em:version>5.0.25.SA.5.0.96.2</em:version>
<em:version>5.0.25.SA.5.0.96.3</em:version>
<em:creator>Center for History and New Media<br/>George Mason University</em:creator>
<em:developer>Simon Kornblith</em:developer>
<em:homepageURL>https://www.zotero.org</em:homepageURL>
Expand Down
2 changes: 1 addition & 1 deletion App/Zotero/extensions/[email protected]/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:name>Zotero Word for Windows Integration</em:name>
<em:version>5.0.19.SA.5.0.96.2</em:version>
<em:version>5.0.19.SA.5.0.96.3</em:version>
<em:creator>Center for History and New Media</em:creator>
<em:developer>Simon Kornblith</em:developer>
<em:homepageURL>https://www.zotero.org</em:homepageURL>
Expand Down
55 changes: 36 additions & 19 deletions App/Zotero/extensions/[email protected]/resource/installer.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@ var Plugin = new function() {
}
}

var defaultStartupFolder = appData.clone().QueryInterface(Components.interfaces.nsIFile);
defaultStartupFolder.appendRelativePath("Microsoft\\Word\\Startup");

if(startupFolders.length == 0 || addDefaultStartupFolder) {
// if not in the registry, append Microsoft/Word/Startup to %AppData% (default location)
var startupFolder = appData.clone().QueryInterface(Components.interfaces.nsIFile);
startupFolder.appendRelativePath("Microsoft\\Word\\Startup");
startupFolders.push(startupFolder);
startupFolders.push(defaultStartupFolder);
}

// The OEM Word 365 sandboxed location, which we might not have the permissions to write to
Expand All @@ -149,10 +150,17 @@ var Plugin = new function() {
var someBadFolders = false;
var allBadFolders = true;
var installedAt = new Set();
for (var startupFolder of startupFolders) {
for (let startupFolder of startupFolders) {
if (!startupFolder.clone().exists()) {
Zotero.debug(`Potential Word startup location ${startupFolder.path} does not exist. Skipping`);
continue;
// Sometimes even with Word installed and having been launched before the Startup folder does not exist
// so we create it here if we have detected installed Word versions
if (installedVersions.length && startupFolder.path.toLowerCase() == defaultStartupFolder.path.toLowerCase()) {
Zotero.File.createDirectoryIfMissing(startupFolder.path);
}
else {
Zotero.debug(`Potential Word startup location ${startupFolder.path} does not exist. Skipping`);
continue;
}
}

// Multiple versions of Word all with the same setting, so we only install there once
Expand Down Expand Up @@ -213,20 +221,29 @@ var Plugin = new function() {
zpi.error(text, false);
}
text += "\n\n" + Zotero.getString('integration.error.misconfiguredWordStartupFolder.fix');
let ps = Services.prompt;
let buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING
+ ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL;
let index = ps.confirmEx(
null,
title,
text,
buttonFlags,
Zotero.getString('general.moreInformation'),
"", "", "", {}
);
if (index == 0) {
Zotero.launchURL('https://www.zotero.org/support/kb/misconfigured_word_startup_folder');
// Only display prompt if force installing (via button press)
if (zpi.force) {
// Prompts displayed synchronously here fails for some mystical reason
// (probably because this runs in a some event handler event loop)
// See zpi.success()/zpi.error() which also shows its dialogs in the next loop
Zotero.setTimeout(function() {
let ps = Services.prompt;
let buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING
+ ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL;
let index = ps.confirmEx(
null,
title,
text,
buttonFlags,
Zotero.getString('general.moreInformation'),
"", "", "", {}
);
if (index == 0) {
Zotero.launchURL('https://www.zotero.org/support/kb/misconfigured_word_startup_folder');
}
});
}

return;
}

Expand Down
Binary file modified App/Zotero/omni.ja
Binary file not shown.
Binary file modified App/Zotero/pdfinfo.exe
Binary file not shown.
Binary file modified App/Zotero/pdftotext.exe
Binary file not shown.
3 changes: 2 additions & 1 deletion App/Zotero/poppler-data/COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ under the COPYING.adobe license

The cidToUnicode, nameToUnicode and unicodeMap data files
installed by the poppler-data package are Copyright Glyph & Cog, LLC
and are under the COPYING.gpl2 license
and are licensed under the GNU General Public License (GPL), version 2
(COPYING.gpl2) or version 3 (COPYING.gpl3).

The Makefile is licensed under the MIT license:

Expand Down
9 changes: 4 additions & 5 deletions App/Zotero/poppler-data/COPYING.adobe
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 1990-2009 Adobe Systems Incorporated.
Copyright 1990-2019 Adobe.
All rights reserved.

Redistribution and use in source and binary forms, with or
Expand All @@ -14,10 +14,9 @@
disclaimer in the documentation and/or other materials
provided with the distribution.

Neither the name of Adobe Systems Incorporated nor the names
of its contributors may be used to endorse or promote
products derived from this software without specific prior
written permission.
Neither the name of Adobe nor the names of its contributors
may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
Expand Down
14 changes: 6 additions & 8 deletions App/Zotero/poppler-data/cMap/Adobe-CNS1/Adobe-CNS1-0
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (Identity)
%%Title: (Identity Adobe CNS1 0)
%%Version: 10.005
%%Version: 10.006
%%Copyright: -----------------------------------------------------------
%%Copyright: Copyright 1990-2015 Adobe Systems Incorporated.
%%Copyright: All rights reserved.
%%Copyright: Copyright 1990-2019 Adobe. All rights reserved.
%%Copyright:
%%Copyright: Redistribution and use in source and binary forms, with or
%%Copyright: without modification, are permitted provided that the
Expand All @@ -21,10 +20,9 @@
%%Copyright: disclaimer in the documentation and/or other materials
%%Copyright: provided with the distribution.
%%Copyright:
%%Copyright: Neither the name of Adobe Systems Incorporated nor the names
%%Copyright: of its contributors may be used to endorse or promote
%%Copyright: products derived from this software without specific prior
%%Copyright: written permission.
%%Copyright: Neither the name of Adobe nor the names of its contributors
%%Copyright: may be used to endorse or promote products derived from
%%Copyright: this software without specific prior written permission.
%%Copyright:
%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
%%Copyright: CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
Expand Down Expand Up @@ -55,7 +53,7 @@ begincmap
end def

/CMapName /Adobe-CNS1-0 def
/CMapVersion 10.005 def
/CMapVersion 10.006 def
/CMapType 1 def

/UIDOffset 960 def
Expand Down
14 changes: 6 additions & 8 deletions App/Zotero/poppler-data/cMap/Adobe-CNS1/Adobe-CNS1-1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (Identity)
%%Title: (Identity Adobe CNS1 1)
%%Version: 1.004
%%Version: 1.005
%%Copyright: -----------------------------------------------------------
%%Copyright: Copyright 1990-2015 Adobe Systems Incorporated.
%%Copyright: All rights reserved.
%%Copyright: Copyright 1990-2019 Adobe. All rights reserved.
%%Copyright:
%%Copyright: Redistribution and use in source and binary forms, with or
%%Copyright: without modification, are permitted provided that the
Expand All @@ -21,10 +20,9 @@
%%Copyright: disclaimer in the documentation and/or other materials
%%Copyright: provided with the distribution.
%%Copyright:
%%Copyright: Neither the name of Adobe Systems Incorporated nor the names
%%Copyright: of its contributors may be used to endorse or promote
%%Copyright: products derived from this software without specific prior
%%Copyright: written permission.
%%Copyright: Neither the name of Adobe nor the names of its contributors
%%Copyright: may be used to endorse or promote products derived from
%%Copyright: this software without specific prior written permission.
%%Copyright:
%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
%%Copyright: CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
Expand Down Expand Up @@ -55,7 +53,7 @@ begincmap
end def

/CMapName /Adobe-CNS1-1 def
/CMapVersion 1.004 def
/CMapVersion 1.005 def
/CMapType 1 def

/XUID [1 10 25590] def
Expand Down
Loading

0 comments on commit 9a5864f

Please sign in to comment.