From fe40f6f27ebd6a4135fed6c1289b07df39ddcf5e Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 10 Mar 2006 22:12:37 +0000 Subject: [PATCH] added ability to log to mozilla console with debug git-svn-id: svn://svn.open-ils.org/ILS/trunk@3331 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/opac_utils.js | 24 +++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index 44b4ae29a6..a623ca5201 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -119,7 +119,7 @@ function initParams() { } function initCookies() { - FONTSIZE = "medium"; + FONTSIZE = "regular"; var font = cookieManager.read(COOKIE_FONT); scaleFonts(font); if(font) FONTSIZE = font; @@ -179,7 +179,27 @@ function buildExtrasLink(name, ssl) { return findBaseURL(ssl) + "../../../../extras/" + name; } -function _debug(str) { try { dump(str + '\n'); } catch(e) {} } +var consoleService; +function _debug(str) { + try { dump(str + '\n'); } catch(e) {} + + if(!IE) { + if(!consoleService) { + try { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + this.consoleService = Components.classes['@mozilla.org/consoleservice;1'] + .getService(Components.interfaces.nsIConsoleService); + } catch(e) {} + } + + try { + if(consoleService) { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + consoleService.logStringMessage(str + '\n'); + } + } catch(e){} + } +} function buildOPACLink(args, slim, ssl) { -- 2.43.2