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];
|
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') {
|
else if (params.objectType == 'item') {
|
||||||
switch (params.scopeObject) {
|
switch (params.scopeObject) {
|
||||||
case 'collections':
|
case 'collections':
|
||||||
|
|
|
@ -843,8 +843,15 @@ function ZoteroProtocolHandler() {
|
||||||
});
|
});
|
||||||
router.add('groups/:groupID/collections/:objectKey', function () {
|
router.add('groups/:groupID/collections/:objectKey', function () {
|
||||||
params.objectType = 'collection'
|
params.objectType = 'collection'
|
||||||
|
});
|
||||||
|
// Search
|
||||||
|
router.add('library/searches/:objectKey', function () {
|
||||||
|
params.objectType = 'search'
|
||||||
params.libraryID = userLibraryID;
|
params.libraryID = userLibraryID;
|
||||||
});
|
});
|
||||||
|
router.add('groups/:groupID/searches/:objectKey', function () {
|
||||||
|
params.objectType = 'search'
|
||||||
|
});
|
||||||
|
|
||||||
router.run(path);
|
router.run(path);
|
||||||
|
|
||||||
|
@ -873,6 +880,9 @@ function ZoteroProtocolHandler() {
|
||||||
if (params.objectType == 'collection') {
|
if (params.objectType == 'collection') {
|
||||||
return zp.collectionsView.selectCollection(results[0].id);
|
return zp.collectionsView.selectCollection(results[0].id);
|
||||||
}
|
}
|
||||||
|
else if (params.objectType == 'search') {
|
||||||
|
return zp.collectionsView.selectSearch(results[0].id);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// Select collection first if specified
|
// Select collection first if specified
|
||||||
if (params.scopeObject == 'collections') {
|
if (params.scopeObject == 'collections') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue