[open-ils-commits] r17806 - branches/rel_2_0/Open-ILS/web/opac/skin/default/js (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 17 22:04:41 EDT 2010


Author: dbs
Date: 2010-09-17 22:04:39 -0400 (Fri, 17 Sep 2010)
New Revision: 17806

Modified:
   branches/rel_2_0/Open-ILS/web/opac/skin/default/js/result_common.js
Log:
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!


Modified: branches/rel_2_0/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/skin/default/js/result_common.js	2010-09-18 02:03:46 UTC (rev 17805)
+++ branches/rel_2_0/Open-ILS/web/opac/skin/default/js/result_common.js	2010-09-18 02:04:39 UTC (rev 17806)
@@ -93,6 +93,12 @@
 	_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();



More information about the open-ils-commits mailing list