case 'AppShell' : app_shell_init(params); break;
case 'ClamShell' : clam_shell_init(params); break;
case 'Opac' : opac_init(params); break;
+ case 'PatronSearchForm' : patron_search_form_init(params); break;
}
register_document(params.d);
case 'AppShell' : app_shell_exit(params); break;
case 'ClamShell' : clam_shell_exit(params); break;
case 'Opac' : opac_exit(params); break;
+ case 'PatronSearchForm' : patron_search_form_exit(params); break;
}
unregister_document(params.d);
<script src="chrome://evergreen/content/main/app_shell.js" />
<script src="chrome://evergreen/content/main/clam_shell.js" />
<script src="chrome://evergreen/content/opac/opac.js" />
+ <script src="chrome://evergreen/content/patron/patron_search_form.js" />
</apps>
</overlay>
--- /dev/null
+sdump('D_TRACE','Loading patron_search_form.js\n');
+
+function patron_search_form_init(p) {
+ dump("TESTING: patron_search_form.js: " + mw.G['main_test_variable'] + '\n');
+ dump('p.w = ' + p.w + '\n');
+ dump('p.w.document = ' + p.w.document + '\n');
+ dump('p.d = ' + p.d + '\n');
+ p.w.crazy_search_hash = {}; // hash[ field ] = { 'value' : ???, 'group' : ??? }
+
+ var nl = p.d.getElementsByTagName('textbox');
+ for (var i = 0; i < nl.length; i++)
+ nl[i].addEventListener(
+ 'change',
+ function (ev) {
+ return patron_search_form_textbox_handler(
+ p.d,
+ ev.target,
+ p.w.crazy_search_hash); },
+ false);
+
+ var search_command = p.d.getElementById('cmd_search');
+ var clear_command = p.d.getElementById('cmd_clear');
+
+ p.w.register_search_callback = function (f) { search_command.addEventListener( 'command',f,false ); };
+
+ if (clear_command)
+ clear_command.addEventListener(
+ 'command',
+ function (ev) {
+ var nl = p.d.getElementsByTagName('textbox');
+ for (var i = 0; i < nl.length; i++)
+ nl[i].value = '';
+ p.w.crazy_search_hash = {}; },
+ false);
+ else
+ dump("No cmd_clear element.\n");
+}
+
+function patron_search_form_textbox_handler(doc,textbox,search_hash) {
+ sdump('D_PATRON_SEARCH_FORM',arg_dump(arguments));
+ textbox = get_widget(doc,textbox);
+ var field = textbox.getAttribute('field');
+ var group = textbox.getAttribute('group');
+ var value = textbox.value;
+ search_hash[ field ] = { 'value' : value, 'group' : group };
+}
--- /dev/null
+<?xml version="1.0"?>
+<!-- Clamlication: Evergreen Staff Client -->
+
+<!-- Localization -->
+<!DOCTYPE page SYSTEM "chrome://evergreen/locale/patron_search_form.dtd">
+
+<page id="patron_search_form_win"
+ orient="vertical" style="overflow: auto" width="800" height="500"
+ sizemode="maximized" persist="width height"
+ onload="params.w = window; params.d = document; params.app = 'PatronSearchForm'; mw.OpenILS_init(params);"
+ onunload="mw.OpenILS_exit(params);"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <!-- Stylesheets -->
+ <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+ <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
+ <?xml-stylesheet href="chrome://evergreen/skin/patron_search_form.css" type="text/css"?>
+
+ <!-- Overlays for this XUL file -->
+ <?xul-overlay href="chrome://evergreen/content/patron/patron_search_form_overlay.xul"?>
+
+ <!-- XUL'ified abstraction for logic to attach to widgets -->
+ <commandset id="PatronSearchForm_cmds" />
+
+ <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
+ <keyset id="PatronSearchForm_keys" />
+
+ <!-- Layout to be filled in by overlays and javascript -->
+ <box id="PatronSearchForm_main" />
+
+</page>
+
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_search_form.dtd">
+<overlay id="patron_search_form_overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+<commandset id="PatronSearchForm_cmds">
+
+ <command id="cmd_broken" oncommand="
+ alert('Not Yet Implemented'); "/>
+
+ <command id="cmd_search" />
+ <command id="cmd_clear" />
+
+</commandset>
+
+<!-- main widget for patron_search_form -->
+<box id="PatronSearchForm_main" flex="1" orient="horizontal">
+
+ <!-- group 0 = user group 1 = address group 2 = phone, ident -->
+
+ <grid id="psg">
+ <columns id="psc">
+ <column id="psc1"/>
+ <column id="psc2" flex="1"/>
+ </columns>
+ <rows id="psr">
+ <row id="psr1">
+ <label id="psl1" control="pst1" value="&patron_search_form.family_name.label;" accesskey="&patron_search_form.family_name.accesskey;"/>
+ <textbox id="pst1" field="family_name" group="0"/>
+ </row>
+ <row id="psr2">
+ <label id="psl2" control="pst2" value="&patron_search_form.first_given_name.label;" accesskey="&patron_search_form.first_given_name.accesskey;"/>
+ <textbox id="pst2" field="first_given_name" group="0"/>
+ </row>
+ <row id="psr3">
+ <label id="psl3" control="pst3" value="&patron_search_form.second_given_name.label;" accesskey="&patron_search_form.second_given_name.accesskey;"/>
+ <textbox id="pst3" field="second_given_name" group="0"/>
+ </row>
+ <row id="psr4">
+ <label id="psl4" control="pst4" value="&patron_search_form.email.label;" accesskey="&patron_search_form.email.accesskey;"/>
+ <textbox id="pst4" field="email" group="0"/>
+ </row>
+ <row id="psr5">
+ <label id="psl5" control="pst5" value="&patron_search_form.phone.label;" accesskey="&patron_search_form.phone.accesskey;"/>
+ <textbox id="pst5" field="phone" group="2"/>
+ </row>
+ <row id="psr6">
+ <label id="psl6" control="pst6" value="&patron_search_form.ident.label;" accesskey="&patron_search_form.ident.accesskey;"/>
+ <textbox id="pst6" field="ident" group="2"/>
+ </row>
+ <row id="psr6a">
+ <label id="psl6a" value=" "/>
+ </row>
+ <row id="psr7">
+ <label id="psl7" control="pst7" value="&patron_search_form.street1.label;" accesskey="&patron_search_form.street1.accesskey;"/>
+ <textbox id="pst7" field="street1" group="1"/>
+ </row>
+ <row id="psr8">
+ <label id="psl8" control="pst8" value="&patron_search_form.street2.label;" accesskey="&patron_search_form.street2.accesskey;"/>
+ <textbox id="pst8" field="street2" group="1"/>
+ </row>
+ <row id="psr9">
+ <label id="psl9" control="pst9" value="&patron_search_form.city.label;" accesskey="&patron_search_form.city.accesskey;"/>
+ <textbox id="pst9" field="city" group="1"/>
+ </row>
+ <row id="psr10">
+ <label id="psl10" control="pst10" value="&patron_search_form.state.label;" accesskey="&patron_search_form.state.accesskey;"/>
+ <textbox id="pst10" field="state" group="1"/>
+ </row>
+ <row id="psr11">
+ <label id="psl11" control="pst11" value="&patron_search_form.post_code.label;" accesskey="&patron_search_form.post_code.accesskey;"/>
+ <textbox id="pst11" field="post_code" group="1"/>
+ </row>
+ <row id="psr12">
+ <spacer id="pss12"/>
+ <button id="psb12" label="&patron_search_form.search.label;" accesskey="&patron_search_form.search.accesskey;" key="ps_search" command="cmd_search"/>
+ </row>
+ <row id="psr13">
+ <spacer id="pss13"/>
+ <button id="psb13" label="&patron_search_form.clear.label;" accesskey="&patron_search_form.clear.accesskey;" key="ps_clear" command="cmd_clear"/>
+ </row>
+ </rows>
+ </grid>
+
+</box>
+
+<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
+<keyset id="PatronSearchForm_keys">
+ <key id="ps_search" modifiers="" keycode="VK_RETURN" command="cmd_search"/>
+ <key id="ps_clear" modifiers="accel" keycode="VK_DELETE" command="cmd_clear"/>
+</keyset>
+
+</overlay>
--- /dev/null
+<!ENTITY patron_search_form.family_name.label 'Last Name:'>
+ <!ENTITY patron_search_form.family_name.accesskey 'L'>
+<!ENTITY patron_search_form.first_given_name.label 'First Name:'>
+ <!ENTITY patron_search_form.first_given_name.accesskey ''>
+<!ENTITY patron_search_form.second_given_name.label 'Middle Name:'>
+ <!ENTITY patron_search_form.second_given_name.accesskey ''>
+<!ENTITY patron_search_form.email.label 'Email:'>
+ <!ENTITY patron_search_form.email.accesskey ''>
+<!ENTITY patron_search_form.phone.label 'Phone:'>
+ <!ENTITY patron_search_form.phone.accesskey 'P'>
+<!ENTITY patron_search_form.ident.label 'ID:'>
+ <!ENTITY patron_search_form.ident.accesskey ''>
+<!ENTITY patron_search_form.street1.label 'Address 1:'>
+ <!ENTITY patron_search_form.street1.accesskey 'd'>
+<!ENTITY patron_search_form.street2.label 'Address 2:'>
+ <!ENTITY patron_search_form.street2.accesskey ''>
+<!ENTITY patron_search_form.city.label 'City:'>
+ <!ENTITY patron_search_form.city.accesskey ''>
+<!ENTITY patron_search_form.state.label 'State:'>
+ <!ENTITY patron_search_form.state.accesskey ''>
+<!ENTITY patron_search_form.post_code.label 'ZIP:'>
+ <!ENTITY patron_search_form.post_code.accesskey ''>
+
+<!ENTITY patron_search_form.search.label 'Search'>
+ <!ENTITY patron_search_form.search.accesskey ''>
+
+<!ENTITY patron_search_form.clear.label 'Reset'>
+ <!ENTITY patron_search_form.clear.accesskey ''>
+
--- /dev/null
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace html url("http://www.w3.org/TR/REC-html40");
+
+/* * { font-size: x-large; } */
+.test_class { }
+.text_left { text-align: left; }
+.text_right { text-align: right; }
+.text_center { text-align: center; }
+.text_justify { text-align: justify; }
+
+.deleted_address { background-color: red; }
+.patron_name { font-size: large; }
+
+iframe { border: red; }
--- /dev/null
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace html url("http://www.w3.org/TR/REC-html40");
+