From: dbs Date: Sat, 18 Sep 2010 02:04:39 +0000 (+0000) Subject: Backport r17802 and r17803 to provide a human-visible RSS feed in the dynamic OPAC X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3c90fb4a0cf269df7cdf7e926c563654dbcacf51;p=evergreen%2Fjoelewis.git Backport r17802 and r17803 to provide a human-visible RSS feed in the dynamic OPAC Despite having RSS and Atom feeds at the core since version 1.0, it can be hard for humans to access those feeds. This will dynamically add a feed to the dynamic OPAC so that the RSS feed indicator will light up. Google Reader, look out! git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@17806 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js index 234c4dc268..581d806771 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -93,6 +93,12 @@ function resultCollectSearchIds( type, method, handler ) { _debug('Search args: ' + js2JSON(args)); _debug('Raw query: ' + getTerm()); + var atomfeed = "/opac/extras/opensearch/1.1/" + findOrgUnit(args.org_unit).shortname() + "/atom-full/" + getStype() + '?searchTerms=' + getTerm(); + if (args.facets) { atomfeed += ' ' + args.facets; } + if (sort) { atomfeed += '&searchSort=' + sort; } + if (sortdir) { atomfeed += '&searchSortDir=' + sortdir; } + dojo.create('link', {"rel":"alternate", "href":atomfeed, "type":"application/atom+xml"}, dojo.query('head')[0]); + var req = new Request(method, args, getTerm(), 1); req.callback(handler); req.send();