From 4ca42d35f332b3c0b2167c14947b995cb4b7b2dc Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 12 Apr 2010 21:40:54 +0000 Subject: [PATCH] XBL for a widget. It will try to load help content from various static and dynamic URL's, stopping at the first one that it finds. If for example, I were to add this to /xul/server/patron/display.xul: We would get a "Help" button that if clicked would then it would test these locations: foo.html (if @foo not set, then custom_help.html) /xul/server/patron/display.xul.help.html /xul/server/patron/help.html /xul/server/help.html /xul/help.html /help.html and since @id is defined, it would also tack on ?id=bar (for log tracking and/or dynamic use by the content). It will open the location in a non-modal pop-up window. Navigation buttons not included. MAYBE TODO: Add an @anchor for dynamically appending a hash component to each URL tested. Implement a browser with Back/Forward/Search/Index functionality. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16220 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../staff_client/chrome/content/main/bindings.xml | 107 +++++++++++++++++++++ Open-ILS/xul/staff_client/chrome/skin/global.css | 1 + Open-ILS/xul/staff_client/server/skin/global.css | 1 + 3 files changed, 109 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml b/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml index 1bf2c1015..6e702be5e 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml +++ b/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml @@ -5,6 +5,113 @@ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xbl="http://www.mozilla.org/xbl"> + + + + + + + + + + + + + + + + + + + + + + + + + + 0 && x.status != 200; i--) { + url = ''; + for ( j = 1; j <= i; j++ ) { url += '/' + pathparts[j]; }; + url = url + '/help.html'; + x.open("HEAD",url,false); + x.send(null); + } + if (x.status == 200) { + window.open(url+'?id='+this.id,this.getAttribute('label'),'resizable,scrollbars'); + } else { + x.open("HEAD","/help.html",false); + x.send(null); + if (x.status == 200) { + window.open('/help.html?id='+this.id,this.getAttribute('label'),'resizable,scrollbars'); + } else { + /* FIXME - I18N */ + alert('No Help Found'); + } + } + } + } + } catch(E) { + alert('Error opening window in help widget in bindings.xml: ' + E); + throw(E); + } + ]]> + + + + + + + diff --git a/Open-ILS/xul/staff_client/chrome/skin/global.css b/Open-ILS/xul/staff_client/chrome/skin/global.css index cde1de266..91a56ad8f 100644 --- a/Open-ILS/xul/staff_client/chrome/skin/global.css +++ b/Open-ILS/xul/staff_client/chrome/skin/global.css @@ -17,6 +17,7 @@ iframe { background: #CDCED3 url("chrome://browser/skin/icons/box-background.png .shrinkable_groupbox { font-weight: bold; -moz-binding: url('chrome://open_ils_staff_client/content/main/bindings.xml#caption'); } messagecatalog { -moz-binding: url('chrome://open_ils_staff_client/content/main/bindings.xml#messagecatalog'); } +help { -moz-binding: url('chrome://open_ils_staff_client/content/main/bindings.xml#help'); } .my_overflow { overflow: auto; } diff --git a/Open-ILS/xul/staff_client/server/skin/global.css b/Open-ILS/xul/staff_client/server/skin/global.css index cdc252d44..519cc60c5 100644 --- a/Open-ILS/xul/staff_client/server/skin/global.css +++ b/Open-ILS/xul/staff_client/server/skin/global.css @@ -3,6 +3,7 @@ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @namespace html url("http://www.w3.org/TR/REC-html40"); +help { -moz-binding: url('/xul/server/main/bindings.xml#help'); } messagecatalog { -moz-binding: url('/xul/server/main/bindings.xml#messagecatalog'); } .shrinkable_groupbox { font-weight: bold; -moz-binding: url('/xul/server/main/bindings.xml#caption'); } -- 2.11.0