This fixes Cataloging -> Create New Marc Record in xulrunner 1.9, but illustrates...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 17 Nov 2008 00:10:13 +0000 (00:10 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 17 Nov 2008 00:10:13 +0000 (00:10 +0000)
commitc10f52578072477dad7c5f4dd73882ccf060ed45
treea5b5b5ef2d3945bf2b012395f383dfe650cc1883
parent20a521bd2b44ab44d42d7ac18ea5f2b1f173ffe9
This fixes Cataloging -> Create New Marc Record in xulrunner 1.9, but illustrates a problem that can probably be found elsewhere in the code.  First, a little context.  One of the main mechanisms for inter-window communication within the staff client is the "shoving" of data and functions from one context into a foreign context.  So, for example, you may have code that looks like this:

var test = 'See!';
var w = window.open('some_interface.html');
w.xulG = {
    'foreign_data' : 'hey, some_interface.html can make use of me, because xulG is now defined in its context',
    'foreign_function' : function() {
        alert("hey, some_interface.html can call me, but I'm a closure and stay scoped to my original context. Treat me as a callback.  " + test)
    }
);

If the window is not modal, then this works.  It also works with iframes.

var iframe = document.createElement('iframe');
iframe.setAttribute('src','some_interface.html');
iframe.contentWindow.xulG = { 'foo' : 'bar' };

But what stopped working with xulrunner 1.9 is an example similar to the one above, where the iframe already exists.

var iframe = document.getElementById('some_iframe');
iframe.setAttribute('src','some_interface.html'); // This now loads asynchronously and does not wait for the current javascript thread to complete
iframe.contentWindow.xulG = { 'foo' : 'bar' }; // And so this gets shoved in possibly after the onload event for some_interface.html, or maybe not at all.  I'm not sure yet

One other mechanism for shoving xulG into a foreign context appears to still work, and that's the progress listener that shoves into browser elements, to preserve xulG during different page loads.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@11231 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/xul/staff_client/server/cat/marc_new.xul