From ab8f2e7c5d36f8e815778060050023c36220909e Mon Sep 17 00:00:00 2001 From: phasefx Date: Sun, 12 Mar 2006 07:12:01 +0000 Subject: [PATCH] browser wrapper without xulG git-svn-id: svn://svn.open-ils.org/ILS/trunk@3337 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/chrome/content/util/browser.js | 13 ++++++++++++- .../staff_client/chrome/content/util/browser.xul | 4 ++++ .../staff_client/chrome/content/util/rbrowser.xul | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/browser.js b/Open-ILS/xul/staff_client/chrome/content/util/browser.js index dbea41eb6a..67bd30085a 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/browser.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.js @@ -21,6 +21,7 @@ util.browser.prototype = { obj.session = params['session']; obj.url = params['url']; + obj.push_xulG = params['push_xulG']; JSAN.use('util.controller'); obj.controller = new util.controller(); obj.controller.init( @@ -96,6 +97,8 @@ util.browser.prototype = { 'push_variables' : function() { try { + var obj = this; + if (!obj.push_xulG) return; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var cw = this.get_content(); cw.IAMXUL = true; @@ -124,7 +127,6 @@ util.browser.prototype = { var n = obj.getWebNavigation(); s += ('webNavigation = ' + n + '\n'); s += ('webNavigation.canGoForward = ' + n.canGoForward + '\n'); - s += ('webNavigation.canGoBack = ' + n.canGoBack + '\n'); if (n.canGoForward) { obj.controller.view.cmd_forward.disabled = false; obj.controller.view.cmd_forward.setAttribute('disabled','false'); @@ -132,6 +134,13 @@ util.browser.prototype = { obj.controller.view.cmd_forward.disabled = true; obj.controller.view.cmd_forward.setAttribute('disabled','true'); } + } catch(E) { + s += E + '\n'; + } + try { + var n = obj.getWebNavigation(); + s += ('webNavigation = ' + n + '\n'); + s += ('webNavigation.canGoBack = ' + n.canGoBack + '\n'); if (n.canGoBack) { obj.controller.view.cmd_back.disabled = false; obj.controller.view.cmd_back.setAttribute('disabled','false'); @@ -139,9 +148,11 @@ util.browser.prototype = { obj.controller.view.cmd_back.disabled = true; obj.controller.view.cmd_back.setAttribute('disabled','true'); } + } catch(E) { s += E + '\n'; } + dump(s); }, diff --git a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul index ac4ece45c2..2be1fbbf59 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul @@ -52,10 +52,14 @@ JSAN.use('util.browser'); g.browser = new util.browser(); + var push_xulG = true; + if (g.cgi.param('no_xulG') || xulG.no_xulG) push_xulG = false; + g.browser.init( { 'url' : xulG.url_prefix(url), 'session' : session, + 'push_xulG' : push_xulG, } ); diff --git a/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul b/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul index 85a7f4736b..9ef46ca31a 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul @@ -53,10 +53,14 @@ JSAN.use('util.browser'); g.browser = new util.browser(); + var push_xulG = true; + if (g.cgi.param('no_xulG') || xulG.no_xulG) push_xulG = false; + g.browser.init( { 'url' : url, 'session' : session, + 'push_xulG' : push_xulG, } ); -- 2.43.2