added galileo magic link builder - does not work on home page yet
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Aug 2006 20:19:20 +0000 (20:19 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Aug 2006 20:19:20 +0000 (20:19 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5685 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/sidebar.js

index fb7e2c5..3280b50 100644 (file)
@@ -165,3 +165,35 @@ function sidebarTreesFree() {
        seriesSidebarTree = null;
 }
 
+
+
+
+/* --------------------------------------------------------------------------------- */
+/* Code to support GALILEO links for PINES.  Fails gracefully
+/* --------------------------------------------------------------------------------- */
+attachEvt('common', 'init', buildEGGalLink);
+function buildEGGalLink() {
+
+       /* we're in a lib, nothing to do here */
+       if( getOrigLocation() ) return;
+       if(!$('eg_gal_link')) return;
+
+       var link = 'http://demo.galib.uga.edu/express?pinesid=';
+       if(grabUser()) {
+               $('eg_gal_link').setAttribute('href', link + G.user.session);
+               return;
+       }
+
+       $('eg_gal_link').setAttribute('href', 'javascript:void(0);');
+       $('eg_gal_link').setAttribute('target', '');
+       $('eg_gal_link').onclick = function() {
+               /* we're not logged in.  go ahead and login */
+               detachAllEvt('common','locationChanged');
+               detachAllEvt('common','loggedIn');
+               attachEvt('common','loggedIn', function() { goTo(link + G.user.session); })
+               initLogin();
+       };
+}
+/* --------------------------------------------------------------------------------- */
+
+