]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/chrome/content/evergreen/main/window.js
some thinkos, offline fixes, remote xul testing
[working/Evergreen.git] / Open-ILS / xul / staff_client / chrome / content / evergreen / main / window.js
1 dump('entering main/window.js\n');
2
3 if (typeof main == 'undefined') main = {};
4 main.window = function (mw,G) {
5         this.main_window = mw; this.mw = mw; this.G = G;
6         return this;
7 };
8
9 main.window.prototype = {
10         
11         // pointer to the auth window
12         'main_window' : null,   
13
14         // list of open window references, used for debugging in shell
15         'win_list' : [],        
16
17         // list of Top Level menu interface window references
18         'appshell_list' : [],   
19
20         // list of documents for debugging.  BROKEN
21         'doc_list' : [],        
22
23         // Windows need unique names.  This number helps.
24         'window_name_increment' : 0, 
25
26         // This number gets put into the title bar for Top Level menu interface windows
27         'appshell_name_increment' : 0,
28
29         // From: Bryan White on netscape.public.mozilla.xpfe, Oct 13, 2004
30         // Message-ID: <ckjh7a$18q1@ripley.netscape.com>
31         // Modified by Jason for Evergreen
32         'SafeWindowOpen' : function (url,title,features) {
33                 var w;
34
35                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
36                 const CI = Components.interfaces;
37                 const PB = Components.classes["@mozilla.org/preferences-service;1"].getService(CI.nsIPrefBranch);
38
39                 var blocked = false;
40                 try {
41                         // pref 'dom.disable_open_during_load' is the main popup blocker preference
42                         blocked = PB.getBoolPref("dom.disable_open_during_load");
43                         if(blocked) PB.setBoolPref("dom.disable_open_during_load",false);
44
45                         w = window.open(url,title,features);
46                 } catch(E) {
47                         this.G.error.sdump('D_ERROR','window.SafeWindowOpen: ' + E + '\n');
48                         throw(E);
49                 }
50                 if(blocked) PB.setBoolPref("dom.disable_open_during_load",true);
51
52                 return w;
53         },
54
55         'open' : function(url,title,features) {
56                 this.G.error.sdump('D_WIN',
57                         'opening ' + url + ', ' + title + ', ' + features + ' from ' + window + '\n');
58                 var w = this.SafeWindowOpen(url,title,features);
59                 w.mw = this.mw; w.G = this.G;
60                 /*
61                 setTimeout( 
62                         function() { 
63                                 try { w.title = title; } catch(E) { dump('**'+E+'\n'); }
64                                 try { w.document.title = title; } catch(E) { dump('**'+E+'\n'); }
65                         }, 0 
66                 );
67                 */
68                 return w;
69         }
70 }
71
72 dump('exiting main/window.js\n');