From 0ad60bd3031fdffb01ece3bf1a0841fca83cbbac Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 8 Dec 2005 17:26:55 +0000 Subject: [PATCH] want to apply external callbacks to self-contained xul. debugging git-svn-id: svn://svn.open-ils.org/ILS/trunk@2290 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/circ/checkout.js | 17 +++++++++++++++-- Open-ILS/xul/staff_client/server/main/menu.js | 1 + .../xul/staff_client/server/patron/display.js | 13 +++++++++---- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index 4274388c4b..66c65254d0 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -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() { diff --git a/Open-ILS/xul/staff_client/server/main/menu.js b/Open-ILS/xul/staff_client/server/main/menu.js index 2abebd14aa..b1990c5b71 100644 --- a/Open-ILS/xul/staff_client/server/main/menu.js +++ b/Open-ILS/xul/staff_client/server/main/menu.js @@ -170,6 +170,7 @@ main.menu.prototype = { frame.contentWindow.IAMXUL = true; frame.contentWindow.xulG = content_params; } + return frame; } } diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index 5ba749fc08..cb05d909a3 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -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'); } -- 2.43.2