]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/js/dojo/openils/XUL.js
initial dojo-ified xul glue
[Evergreen.git] / Open-ILS / web / js / dojo / openils / XUL.js
1 if(!dojo._hasResource["openils.XUL"]) {
2
3     dojo.provide("openils.XUL");
4     dojo.declare('openils.XUL', null, {});
5
6     openils.XUL.isXUL = function() {
7         return window.IAMXUL;
8     }
9     
10     openils.XUL.getStash = function() {
11         if(openils.XUL.isXUL()) {
12             try {
13                             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
14                             var CacheClass = new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
15                             return new CacheClass().wrappedJSObject.OpenILS.prototype.data;
16             } catch(e) {
17                 console.log("Error loading XUL stash: " + e);
18             }
19         }
20
21         return {};
22     };
23 }
24
25