diff --git a/CHANGELOG.md b/CHANGELOG.md index 6802aa6..c39e23a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] ### Fixed - Escape document search ([#98](https://github.com/pwyf/iati-decipher/issues/98)) + - Quote search string, so searches with spaces work ([#99](https://github.com/pwyf/iati-decipher/issues/99)) ## [1.3.0] - 2018-11-25 ### Fixed diff --git a/src/js/popup.js b/src/js/popup.js index eaf492c..c46e3a5 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -8,18 +8,18 @@ $(function () { return false }) - var tmpl = 'https://iatiregistry.org/api/3/action/package_search?fq=extras_filetype:organisation&q=title:{}' + - ' OR license_id:{}' + - ' OR maintainer:{}' + - ' OR maintainer_email:{}' + - ' OR author_email:{}' + - ' OR name:{}' + - ' OR organization_name:{}' + - ' OR organization_title:{}' + - ' OR organization_description:{}' + - ' OR extras_country:{}' + - ' OR extras_publisher_country:{}' + - ' OR extras_publisher_iati_id:{}' + var tmpl = 'https://iatiregistry.org/api/3/action/package_search?fq=extras_filetype:organisation&q=title:"{}"' + + ' OR license_id:"{}"' + + ' OR maintainer:"{}"' + + ' OR maintainer_email:"{}"' + + ' OR author_email:"{}"' + + ' OR name:"{}"' + + ' OR organization_name:"{}"' + + ' OR organization_title:"{}"' + + ' OR organization_description:"{}"' + + ' OR extras_country:"{}"' + + ' OR extras_publisher_country:"{}"' + + ' OR extras_publisher_iati_id:"{}"' $('#org-file-name').on('keyup', debounce(function () { var searchStr = $(this).val()