want to apply external callbacks to self-contained xul. debugging
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Dec 2005 17:26:55 +0000 (17:26 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Dec 2005 17:26:55 +0000 (17:26 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2290 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/main/menu.js
Open-ILS/xul/staff_client/server/patron/display.js

index 4274388..66c6525 100644 (file)
@@ -196,7 +196,11 @@ circ.checkout.prototype = {
                                        }
                                );
                                if (typeof obj.on_checkout == 'function') {
-                                       obj.on_checkout();
+                                       obj.on_checkout(checkout);
+                               }
+                               if (typeof window.xulG == 'object' && typeof window.xulG.on_checkout == 'function') {
+                                       obj.error.sdump('D_CIRC','circ.checkout: Calling external .on_checkout()\n');
+                                       window.xulG.on_checkout(checkout);
                                }
 
                        } else {
@@ -206,7 +210,11 @@ circ.checkout.prototype = {
                        alert('FIXME: need special alert and error handling\n'
                                + js2JSON(E));
                        if (typeof obj.on_failure == 'function') {
-                               obj.on_failure();
+                               obj.on_failure(E);
+                       }
+                       if (typeof window.xulG == 'object' && typeof window.xulG.on_failure == 'function') {
+                               obj.error.sdump('D_CIRC','circ.checkout: Calling external .on_failure()\n');
+                               window.xulG.on_failure(E);
                        }
                }
 
@@ -215,6 +223,11 @@ circ.checkout.prototype = {
        'on_checkout' : function() {
                this.controller.view.checkout_barcode_entry_textbox.value = '';
                this.controller.view.checkout_barcode_entry_textbox.focus();
+               dump('******************************************************************************\n');
+               dump('window = ' + window + '\n');
+               dump('window.IAMXUL = ' + window.xulG + '\n');
+               dump('window.xulG = ' + window.xulG + '\n');
+               dump('window.xulG.on_checkout = ' + window.xulG.on_checkout + '\n');
        },
 
        'on_failure' : function() {
index 2abebd1..b1990c5 100644 (file)
@@ -170,6 +170,7 @@ main.menu.prototype = {
                        frame.contentWindow.IAMXUL = true;
                        frame.contentWindow.xulG = content_params;
                }
+               return frame;
        }
 
 }
index 5ba749f..cb05d90 100644 (file)
@@ -45,10 +45,15 @@ patron.display.prototype = {
                                                function(ev) {
                                                        obj.deck.set_iframe(
                                                                urls.remote_checkout
-                                                               + '?session='
-                                                               + window.escape( obj.session )
-                                                               + '&patron_id='
-                                                               + window.escape( obj.patron.id() )
+                                                               + '?session=' + window.escape( obj.session )
+                                                               + '&patron_id=' + window.escape( obj.patron.id() ),
+                                                               {},
+                                                               { 
+                                                                       'on_checkout' : function() {
+                                                                               alert('got here');
+                                                                               obj.controller.render('patron_checkouts');
+                                                                       }
+                                                               }
                                                        );
                                                        dump('obj.deck.node.childNodes.length = ' + obj.deck.node.childNodes.length + '\n');
                                                }