hooking into the opac
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 10 Jan 2006 14:01:46 +0000 (14:01 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 10 Jan 2006 14:01:46 +0000 (14:01 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2668 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/util/browser.js
Open-ILS/xul/staff_client/chrome/content/evergreen/util/browser.xul
Open-ILS/xul/staff_client/server/main/menu.js

index 08dfe93..94f536b 100644 (file)
@@ -88,7 +88,7 @@ util.browser.prototype = {
                        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                        this.controller.view.browser_browser.contentWindow.wrappedJSObject.IAMXUL = true;
                        if (window.xulG) {
-                               this.controller.view.browser_browser.contentWindow.wrappedJSObject.xulG = window.xulG;
+                               this.controller.view.browser_browser.contentWindow.wrappedJSObject.xulG = window.xulG.passthru_content_params;
                                dump('xulG = ' + js2JSON(this.controller.view.browser_browser.contentWindow.wrappedJSObject.xulG) + '\n');
                        }
                } catch(E) {
@@ -152,6 +152,14 @@ util.browser.prototype = {
                                                s += ('\tSTATE_IS_DOCUMENT\n');
                                                if( stateFlags & nsIWebProgressListener.STATE_STOP ) {
                                                        obj.push_variables(); obj.updateNavButtons();
+                                                       if (window.xulG && typeof window.xulG.on_url_load == 'function') {
+                                                               try {
+                                                                       obj.error.sdump('D_TRACE','calling on_url_load');
+                                                                       window.xulG.on_url_load( obj.controller.view.browser_browser );
+                                                               } catch(E) {
+                                                                       obj.error.sdump('D_ERROR','on_url_load: ' + E );
+                                                               }
+                                                       }
                                                }
                                        }
                                        if (stateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
index ce6edc2..e208270 100644 (file)
@@ -40,6 +40,7 @@
                                g.error.sdump('D_TRACE','my_init() for util_browser.xul');
 
                                g.cgi = new CGI();
+                               var name = g.cgi.param('name') || 'Browser';
                                var session = g.cgi.param('session');
                                var url = g.cgi.param('url');
                                if (!url) url = urls.browser;
@@ -54,7 +55,7 @@
                                );
 
                                if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
-                                       try { window.xulG.set_tab_name('Catalog'); } catch(E) { alert(E); }
+                                       try { window.xulG.set_tab_name(name); } catch(E) { alert(E); }
                                }
 
                        } catch(E) {
index 60de039..bcd96d1 100644 (file)
@@ -63,9 +63,20 @@ main.menu.prototype = {
                        'cmd_search_opac' : [
                                ['oncommand'],
                                function() {
-                                       var content_params = { 'authtoken' : session, 'authtime' : authtime };
-                                       //obj.set_tab(url_prefix(urls.XUL_OPAC_WRAPPER),{},content_params);
-                                       obj.set_tab(url_prefix(urls.XUL_BROWSER), {}, content_params);
+                                       try {
+                                               var content_params = { 
+                                                       'passthru_content_params' : { 'authtoken' : session, 'authtime' : authtime },
+                                                       'on_url_load' : function(f) {
+                                                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                                                               f.contentWindow.wrappedJSObject.attachEvt("rdetail", "recordRetrieved",
+                                                                       function(id){alert(id);}
+                                                               );
+                                                       },
+                                               };
+                                               obj.set_tab(url_prefix(urls.XUL_BROWSER) + '?name=Catalog', {}, content_params);
+                                       } catch(E) {
+                                               obj.error.sdump('D_ERROR','cmd_search_opac: ' + E);
+                                       }
                                }
                        ],