a little polish
[Evergreen.git] / Open-ILS / xul / staff_client / chrome / content / auth / controller.js
index 1179485..e9f1856 100644 (file)
@@ -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') {