From: phasefx Date: Mon, 19 Apr 2010 16:48:44 +0000 (+0000) Subject: Look for and evaluate /xul/server/skin/custom.js if it exists. Mainly for overriding... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e8fcb5b4739f9f058b8d81d7a3f2ff17da9b3de1;p=evergreen%2Fbjwebb.git Look for and evaluate /xul/server/skin/custom.js if it exists. Mainly for overriding parts of constants.js with local customizations We'll do this with all remote interfaces (via util_overlay.xul) and with the main chrome menu/window and the chrome opac browser git-svn-id: svn://svn.open-ils.org/ILS/trunk@16275 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js index 5007119c1..865b0db6e 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -19,6 +19,15 @@ function my_init() { JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'}); XML_HTTP_SERVER = g.data.server_unadorned; + // Pull in local customizations + var r = new XMLHttpRequest(); + r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false); + r.send(null); + if (r.status == 200) { + dump('Evaluating /xul/server/skin/custom.js\n'); + eval( r.responseText ); + } + JSAN.use('util.network'); g.network = new util.network(); g.cgi = new CGI(); diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index aea955ee0..e629ae747 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -50,6 +50,15 @@ main.menu.prototype = { urls.remote = params['server']; + // Pull in local customizations + var r = new XMLHttpRequest(); + r.open("GET", url_prefix('/xul/server/skin/custom.js'), false); + r.send(null); + if (r.status == 200) { + dump('Evaluating /xul/server/skin/custom.js\n'); + eval( r.responseText ); + } + var obj = this; JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'}); diff --git a/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul b/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul index 2048b90ad..eb38d43e7 100644 --- a/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul +++ b/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul @@ -13,6 +13,7 @@