From: erickson Date: Wed, 18 Feb 2009 04:52:25 +0000 (+0000) Subject: initial dojo-ified xul glue X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bcbd23cc027aa319ed7756eb50cb118ae37630cf;p=Evergreen.git initial dojo-ified xul glue git-svn-id: svn://svn.open-ils.org/ILS/trunk@12215 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/XUL.js b/Open-ILS/web/js/dojo/openils/XUL.js new file mode 100644 index 0000000000..80f4c09989 --- /dev/null +++ b/Open-ILS/web/js/dojo/openils/XUL.js @@ -0,0 +1,25 @@ +if(!dojo._hasResource["openils.XUL"]) { + + dojo.provide("openils.XUL"); + dojo.declare('openils.XUL', null, {}); + + openils.XUL.isXUL = function() { + return window.IAMXUL; + } + + openils.XUL.getStash = function() { + if(openils.XUL.isXUL()) { + try { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + var CacheClass = new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS"); + return new CacheClass().wrappedJSObject.OpenILS.prototype.data; + } catch(e) { + console.log("Error loading XUL stash: " + e); + } + } + + return {}; + }; +} + +