added ability to log to mozilla console with debug
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Mar 2006 22:12:37 +0000 (22:12 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Mar 2006 22:12:37 +0000 (22:12 +0000)
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

index 44b4ae2..a623ca5 100644 (file)
@@ -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) {