Fix zotero://select search selection
This commit is contained in:
parent
9becefc3fd
commit
d551d1901f
2 changed files with 16 additions and 0 deletions
|
@ -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':
|
||||
|
|
|
@ -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') {
|
||||
|
|
Loading…
Add table
Reference in a new issue