4 <script src="[% ctx.media_prefix %]/js/ui/default/opac/simple.js[% ctx.cache_key %]"></script>
5 [% INCLUDE "opac/i18n_strings.tt2" %]
13 $(document).ready(function() {
14 $('a').removeAttr('href');
15 $('a').click(function(event) { event.preventDefault(); });
16 $('button').prop('disabled', true);
17 $('button').click(function(event) { event.preventDefault(); });
18 $('input').prop('disabled', true);
19 $('input').click(function(event) { event.preventDefault(); });
20 $('select').prop('disabled', true);
21 $('select').click(function(event) { event.preventDefault(); });
22 $('textarea').prop('disabled', true);
23 $('textarea').click(function(event) { event.preventDefault(); });
28 <!-- DOB validation for Patron Registration in OPAC -->
30 function dobValidate(input) {
31 var validformat = /^(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])$/
33 if (!validformat.test(input.value))
34 alert("[% l('You have entered an invalid date, or an improperly formatted date. Please enter Date of Birth in YYYY-MM-DD or YYYY/MM/DD format and try again.') %]")
37 if (returnval == false) input.select()
42 [%- IF ctx.use_stripe %]
43 <script >unHideMe($("pay_fines_now"));[%# the DOM is loaded now, right? %]</script>
46 [%- IF ctx.is_staff %]
47 <script src="[% ctx.media_prefix %]/js/ui/default/opac/staff.js[% ctx.cache_key %]"></script>
48 [% IF ctx.page == 'record' %]
49 [% IF ctx.search_result_index >= 0 %]
51 rdetail_next_prev_actions(
52 "[% ctx.search_result_index %]",
53 "[% ctx.hit_count %]",
54 "[% ctx.prev_rec_url || '' %]",
55 "[% ctx.next_rec_url || '' %]",
56 "[% mkurl(ctx.first_search_record, {page => 0}) %]",
57 "[% mkurl(ctx.opac_root _ '/results', {find_last => 1, page => POSIX.floor(ctx.hit_count / ctx.page_size)}) %]",
58 "[% mkurl(ctx.opac_root _ '/results', {}, ['expand','cnoffset']) %]"
62 [% IF ctx.mfhd_summaries.size %]
64 window.mfhdDetails = [
65 [% FOR summary IN ctx.mfhd_summaries %]
66 [% IF summary.sre_id != -1 %]
68 'id' : '[% summary.sre_id %]',
69 'label' : '[% summary.location | replace("'", "\\'") %]',
70 'entryNum' : [% loop.index %],
71 'owning_lib' : '[% summary.owning_lib %]'
81 [%- IF ENV.OILS_NOVELIST_URL AND ctx.page == 'record';
82 url = ENV.OILS_NOVELIST_URL;
83 IF CGI.https; url = url.replace('^http:', 'https:'); END; %]
84 <script id='EIT' src='[% url %]'></script>
86 [%- IF ctx.page == 'record' AND ctx.google_books_preview %]
87 <script src='[% ctx.media_prefix %]/js/ui/default/opac/ac_google_books.js[% ctx.cache_key %]' async defer></script>
91 window.egStrings = [];
92 window.egStrings['CONFIRM_BASKET_EMPTY'] = "[% l('Remove all records from basket?') %]";
94 <script src='[% ctx.media_prefix %]/js/ui/default/opac/record_selectors.js[% ctx.cache_key %]' async defer></script>
96 <!-- Require some inputs and selections for browsers that don't support required form field element -->
97 [% IF ctx.page == 'place_hold' %]
98 <script src="[% ctx.media_prefix %]/js/ui/default/opac/holds-validation.js[% ctx.cache_key %]">
102 [%- IF want_dojo; -%]
105 locale: "[% ctx.locale | lower | replace('_', '-') %]",
110 <script src="[% ctx.media_prefix %]/js/dojo/dojo/dojo.js?[% ctx.eg_cache_hash %]"></script>
111 <script src="[% ctx.media_prefix %]/js/dojo/dojo/openils_dojo.js?[% ctx.eg_cache_hash %]"></script>
113 [%- # So the following works in Mozilla and Chrome, but not in IE8.
114 # Seems like it /should/ work anywhere, though, and obviate the
115 # next three script tags: %]
116 <!-- <script src="[% ctx.media_prefix %]/js/dojo/DojoSRF.js?[% ctx.eg_cache_hash %]"></script> -->
118 <script src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf.js?[% ctx.eg_cache_hash %]"></script>
119 <script src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf_xhr.js?[% ctx.eg_cache_hash %]"></script>
120 <script src="[% ctx.media_prefix %]/js/dojo/opensrf/JSON_v1.js?[% ctx.eg_cache_hash %]"></script>
122 [% IF use_autosuggest.enabled == "t" AND basic_search != "f"; %]
124 dojo.require("openils.widget.AutoSuggest");
126 /* Set focus, and place the cursor at the end of the input string */
127 dojo.addOnLoad(function() {
128 /* Don't error out if the object doesn't exist, like on advanced search pages */
129 if (dojo.byId('search_box')) {
130 dijit.byId('search_box').focus();
131 var sb_value = dijit.byId('search_box').value;
132 /* Dojo won't trigger a change if the value doesn't change */
134 dijit.byId('search_box').setValue(sb_value + ' ');
135 dijit.byId('search_box').setValue(sb_value);
140 [% END; # use_autosuggest %]
142 [% INCLUDE "opac/parts/acjs.tt2" IF ctx.page == 'record' %]
143 [% IF ctx.page == 'advanced' %]
145 src="[% ctx.media_prefix %]/js/ui/default/opac/copyloc.js[% ctx.cache_key %]"></script>
148 [% IF ebook_api.enabled == 'true' %]
149 [% INCLUDE "opac/parts/ebook_api/base_js.tt2" %]
150 [% INCLUDE "opac/parts/ebook_api/login_js.tt2" IF (ctx.page == 'login') %]
153 <!-- provide a JS friendly org unit hash -->
156 [% FOR org_unit IN ctx.aou_list %]
157 [% org_unit.id %] : {
158 id : "[% org_unit.id %]",
159 name : "[% org_unit.name | replace('"', '\"') %]",
160 parent_ou : "[% org_unit.parent_ou %]",
161 depth : "[% org_unit.ou_type.depth %]",
162 can_have_vols : "[% org_unit.ou_type.can_have_vols %]"
163 }[%- ',' UNLESS loop.last -%]
168 <script >if ($('#client_tz_id')) { $('#client_tz_id').value = OpenSRF.tz }</script>
169 [%- END; # want_dojo -%]
171 [%- IF ctx.max_cart_size; %]
172 <script >var max_cart_size = [% ctx.max_cart_size %];</script>
176 <link rel="stylesheet" href="[% ctx.media_prefix %]/js/ui/default/common/build/js/glide/css/glide.core.min.css[% ctx.cache_key %]">
177 <link rel="stylesheet" href="[% ctx.media_prefix %]/js/ui/default/common/build/js/glide/css/glide.theme.min.css[% ctx.cache_key %]">
178 <!-- JS imports, etc. -->
179 <script src="[% ctx.media_prefix %]/js/bootstrap/jquery-3.5.1.min.js"></script>
181 <script src="[% ctx.media_prefix %]/js/bootstrap/popper.min.js"></script>
183 <script src="[% ctx.media_prefix %]/js/bootstrap/bootstrap.min.js"></script>
185 <script src="[% ctx.media_prefix %]/js/datepicker/bootstrap-datepicker.js"></script>
188 $(document).ready(function(){
189 $('[data-toggle="tooltip"]').tooltip();