From e06708da8cc6e82a8f083803c1c0907d59d269ef Mon Sep 17 00:00:00 2001 From: pines Date: Fri, 10 Mar 2006 14:59:26 +0000 Subject: [PATCH 1/1] a little polish git-svn-id: svn://svn.open-ils.org/ILS/trunk@3318 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/auth/controller.js | 26 +++++++++++++++++++ .../staff_client/chrome/content/main/main.js | 4 +-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js index 11794859a1..e9f1856a89 100644 --- a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js +++ b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js @@ -15,6 +15,9 @@ auth.controller.prototype = { var obj = this; // so the 'this' in event handlers don't confuse us var w = obj.w; + JSAN.use('OpenILS.data'); + obj.data = new OpenILS.data(); obj.data.init({'via':'stash'}); + // MVC JSAN.use('util.controller'); obj.controller = new util.controller(); obj.controller.init( @@ -73,6 +76,21 @@ auth.controller.prototype = { 'ws_deck' : [ ['render'], function(e) { return function() { + try { + JSAN.use('util.widgets'); util.widgets.remove_children(e); + if (obj.data.ws_info && obj.data.ws_info[ obj.controller.view.server_prompt.value ]) { + var ws = obj.data.ws_info[ obj.controller.view.server_prompt.value ]; + var x = document.createElement('description'); + e.appendChild(x); + x.appendChild( + document.createTextNode( + ws.name + ' @ ' + ws.lib_shortname + ) + ); + } + } catch(E) { + alert(E); + } } } ], 'menu_spot' : [ @@ -111,6 +129,12 @@ auth.controller.prototype = { } } + obj.controller.view.server_prompt.addEventListener( + 'change', + function () { obj.controller.render('ws_deck'); }, + false + ); + // This talks to our ILS JSAN.use('auth.session'); obj.session = new auth.session(obj.controller.view); @@ -189,6 +213,8 @@ auth.controller.prototype = { if (w != window) w.close(); } + this.controller.render('ws_deck'); + this.session.close(); if (typeof this.on_logoff == 'function') { 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 10691eb555..3d2a054ab3 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js @@ -53,11 +53,8 @@ function main_init() { try { G.file.get('ws_info'); G.ws_info = G.file.get_object(); - // { server_name : { 'id' : ..., 'name' : ..., 'owning_lib' : ... }, ... : ... } - // alert('retrieved ws_info from filesystem: ' + js2JSON(G.ws_info) ); } catch(E) { G.ws_info = {}; - //alert('could not retrieve ws_info from filesystem'); } G.data.ws_info = G.ws_info; G.data.stash('ws_info'); @@ -84,6 +81,7 @@ function main_init() { } else { xulG.file = G.file; var deck = G.auth.controller.view.ws_deck; + JSAN.use('util.widgets'); util.widgets.remove_children('ws_deck'); var iframe = document.createElement('iframe'); deck.appendChild(iframe); iframe.setAttribute( 'src', url + '/xul/server/main/ws_info.xul' ); iframe.contentWindow.xulG = xulG; -- 2.43.2