no luck with xpcom and modal window printing
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 16 Jul 2006 07:53:18 +0000 (07:53 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 16 Jul 2006 07:53:18 +0000 (07:53 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5025 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/print.js

index 32fccc7..e2d4b88 100644 (file)
@@ -53,7 +53,7 @@ util.print.prototype = {
                        var w;
                        switch(content_type) {
                                case 'text/html' :
-                                       var jsrc = 'data:text/javascript,' + window.escape('var params = { "data" : ' + js2JSON(params.data) + ', "list" : ' + js2JSON(params.list) + '}; function my_init() { return; /* FIXME */ if (' + (typeof params.modal != 'undefined' ? 'true' : 'false') + ') setTimeout(function(){ try { /* JSAN.use("util.print"); var p = new util.print(); p.NSPrint(window,false,{}); */ alert("test"); window.print(); alert("test2"); window.close(); } catch(E) { alert(E); } },0); }');
+                                       var jsrc = 'data:text/javascript,' + window.escape('var params = { "data" : ' + js2JSON(params.data) + ', "list" : ' + js2JSON(params.list) + '}; function my_init() { return; /* FIXME - mozilla bug#301560 - xpcom kills it too */ if (' + (typeof params.modal != 'undefined' ? 'true' : 'false') + ') setTimeout(function(){ try { window.print(); window.close(); } catch(E) { alert(E); } },0); }');
                                        w = obj.win.open('data:text/html,<html><head><script src="/xul/server/main/JSAN.js"></script><script src="' + window.escape(jsrc) + '"></script></head><body onload="try{my_init();}catch(E){alert(E);}">' + window.escape(msg) + '</body></html>','receipt_temp','chrome,resizable');
                                break;
                                default: