Fix zotero://select search selection

This commit is contained in:
Dan Stillman 2019-08-01 22:11:03 -04:00
parent 9becefc3fd
commit d551d1901f
2 changed files with 16 additions and 0 deletions

View file

@ -51,6 +51,12 @@ Zotero.API = {
results = [col];
}
}
else if (params.objectType == 'search') {
let s = Zotero.Searches.getByLibraryAndKey(params.libraryID, params.objectKey);
if (s) {
results = [s];
}
}
else if (params.objectType == 'item') {
switch (params.scopeObject) {
case 'collections':

View file

@ -843,8 +843,15 @@ function ZoteroProtocolHandler() {
});
router.add('groups/:groupID/collections/:objectKey', function () {
params.objectType = 'collection'
});
// Search
router.add('library/searches/:objectKey', function () {
params.objectType = 'search'
params.libraryID = userLibraryID;
});
router.add('groups/:groupID/searches/:objectKey', function () {
params.objectType = 'search'
});
router.run(path);
@ -873,6 +880,9 @@ function ZoteroProtocolHandler() {
if (params.objectType == 'collection') {
return zp.collectionsView.selectCollection(results[0].id);
}
else if (params.objectType == 'search') {
return zp.collectionsView.selectSearch(results[0].id);
}
else {
// Select collection first if specified
if (params.scopeObject == 'collections') {