From 6d648578772817e5448d655977c98d5c03dd4237 Mon Sep 17 00:00:00 2001 From: pines Date: Sat, 25 Mar 2006 02:07:52 +0000 Subject: [PATCH] some debugging options when versionless, and an offline/standalone entrypoint git-svn-id: svn://svn.open-ils.org/ILS/trunk@3437 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../staff_client/chrome/content/main/main.js | 30 ++++++++++++++++--- .../staff_client/chrome/content/main/main.xul | 16 +++++++++- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.js b/Open-ILS/xul/staff_client/chrome/content/main/main.js index be10211915..5dff069f8b 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js @@ -52,8 +52,6 @@ function main_init() { JSAN.use('util.window'); G.window = new util.window(); - //G.window.open(urls.XUL_DEBUG_CONSOLE,'testconsole','chrome,resizable'); - JSAN.use('auth.controller'); G.auth = new auth.controller( { 'window' : mw } ); @@ -67,7 +65,7 @@ function main_init() { G.file = new util.file(); try { G.file.get('ws_info'); - G.ws_info = G.file.get_object(); + G.ws_info = G.file.get_object(); G.file.close(); } catch(E) { G.ws_info = {}; } @@ -107,13 +105,37 @@ function main_init() { } } + G.auth.on_standalone = function() { + G.window.open(urls.XUL_STANDALONE,'Offline','chrome,resizable,modal'); + } + + G.auth.on_debug = function(action) { + switch(action) { + case 'js_console' : + G.window.open(urls.XUL_DEBUG_CONSOLE,'testconsole','chrome,resizable'); + break; + case 'clear_cache' : + clear_the_cache(); + alert('cache cleared'); + break; + default: + alert('debug the debug :D'); + break; + } + } + G.auth.init(); // XML_HTTP_SERVER will get reset to G.auth.controller.view.server_prompt.value ///////////////////////////////////////////////////////////////////////////// var x = document.getElementById('version_label'); - x.setAttribute('value','Build ID: ' + '/xul/server/'.split(/\//)[2]); + var version = '/xul/server/'.split(/\//)[2]; + if (version = 'server') { + version = 'versionless debug build'; + document.getElementById('debug_gb').hidden = false; + } + x.setAttribute('value','Build ID: ' + version); } catch(E) { var error = "!! This software has encountered an error. Please tell your friendly " + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.xul b/Open-ILS/xul/staff_client/chrome/content/main/main.xul index e8d47c7db5..1fc10a5d50 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.xul @@ -61,6 +61,9 @@ + + + @@ -84,7 +87,7 @@