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').removeAttr('data-toggle');
16 $('a').click(function(event) { event.preventDefault(); });
17 $('button').prop('disabled', true);
18 $('button').click(function(event) { event.preventDefault(); });
19 $('input').prop('disabled', true);
20 $('input').click(function(event) { event.preventDefault(); });
21 $('select').prop('disabled', true);
22 $('select').click(function(event) { event.preventDefault(); });
23 $('textarea').prop('disabled', true);
24 $('textarea').click(function(event) { event.preventDefault(); });
29 [% IF ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_jquery') %]
30 [% custom_jquery = ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_jquery') %]
31 [% '<script>'; custom_jquery ; '</script>' %]
34 <!-- DOB validation for Patron Registration in OPAC -->
36 function dobValidate(input) {
37 var validformat = /^(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])$/
39 if (!validformat.test(input.value))
40 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.') %]")
43 if (returnval == false) input.select()
48 [%- IF ctx.use_stripe %]
49 <script >unHideMe($("pay_fines_now"));[%# the DOM is loaded now, right? %]</script>
52 [%- IF ctx.is_staff %]
53 <script src="[% ctx.media_prefix %]/js/ui/default/opac/staff.js[% ctx.cache_key %]"></script>
54 [% IF ctx.page == 'record' %]
55 [% IF ctx.search_result_index >= 0 %]
57 rdetail_next_prev_actions(
58 "[% ctx.search_result_index %]",
59 "[% ctx.hit_count %]",
60 "[% ctx.prev_rec_url || '' %]",
61 "[% ctx.next_rec_url || '' %]",
62 "[% mkurl(ctx.first_search_record, {page => 0}) %]",
63 "[% mkurl(ctx.opac_root _ '/results', {find_last => 1, page => POSIX.floor(ctx.hit_count / ctx.page_size)}) %]",
64 "[% mkurl(ctx.opac_root _ '/results', {}, ['expand','cnoffset']) %]"
68 [% IF ctx.mfhd_summaries.size %]
70 window.mfhdDetails = [
71 [% FOR summary IN ctx.mfhd_summaries %]
72 [% IF summary.sre_id != -1 %]
74 'id' : '[% summary.sre_id %]',
75 'label' : '[% summary.location | replace("'", "\\'") %]',
76 'entryNum' : [% loop.index %],
77 'owning_lib' : '[% summary.owning_lib %]'
87 [%- IF ENV.OILS_NOVELIST_URL AND ctx.page == 'record';
88 url = ENV.OILS_NOVELIST_URL;
89 IF CGI.https; url = url.replace('^http:', 'https:'); END; %]
90 <script id='EIT' src='[% url %]'></script>
92 [%- IF ctx.page == 'record' AND ctx.google_books_preview %]
93 <script src='[% ctx.media_prefix %]/js/ui/default/opac/ac_google_books.js[% ctx.cache_key %]' async defer></script>
97 window.egStrings = [];
98 window.egStrings['CONFIRM_BASKET_EMPTY'] = "[% l('Remove all records from basket?') %]";
100 <script src='[% ctx.media_prefix %]/js/ui/default/opac/record_selectors.js[% ctx.cache_key %]' async defer></script>
102 <!-- Require some inputs and selections for browsers that don't support required form field element -->
103 [% IF ctx.page == 'place_hold' %]
104 <script src="[% ctx.media_prefix %]/js/ui/default/opac/holds-validation.js[% ctx.cache_key %]">
108 [%- IF want_dojo; -%]
111 locale: "[% ctx.locale | lower | replace('_', '-') %]",
116 <script src="[% ctx.media_prefix %]/js/dojo/dojo/dojo.js?[% ctx.eg_cache_hash %]"></script>
118 [%- # So the following works in Mozilla and Chrome, but not in IE8.
119 # Seems like it /should/ work anywhere, though, and obviate the
120 # next three script tags: %]
121 <!-- <script src="[% ctx.media_prefix %]/js/dojo/DojoSRF.js?[% ctx.eg_cache_hash %]"></script> -->
123 <script src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf.js?[% ctx.eg_cache_hash %]"></script>
124 <script src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf_xhr.js?[% ctx.eg_cache_hash %]"></script>
125 <script src="[% ctx.media_prefix %]/js/dojo/opensrf/JSON_v1.js?[% ctx.eg_cache_hash %]"></script>
127 [% IF use_autosuggest.enabled == "t" AND basic_search != "f"; %]
129 dojo.require("openils.widget.AutoSuggest");
131 /* Set focus, and place the cursor at the end of the input string */
132 dojo.addOnLoad(function() {
133 /* Don't error out if the object doesn't exist, like on advanced search pages */
134 if (dojo.byId('search_box')) {
135 dijit.byId('search_box').focus();
136 var sb_value = dijit.byId('search_box').value;
137 /* Dojo won't trigger a change if the value doesn't change */
139 dijit.byId('search_box').setValue(sb_value + ' ');
140 dijit.byId('search_box').setValue(sb_value);
145 [% END; # use_autosuggest %]
147 [% INCLUDE "opac/parts/acjs.tt2" IF ctx.page == 'record' %]
148 [% IF ctx.page == 'advanced' %]
150 src="[% ctx.media_prefix %]/js/ui/default/opac/copyloc.js[% ctx.cache_key %]"></script>
153 [% IF ebook_api.enabled == 'true' %]
154 [% INCLUDE "opac/parts/ebook_api/base_js.tt2" %]
155 [% INCLUDE "opac/parts/ebook_api/login_js.tt2" IF (ctx.page == 'login') %]
158 <!-- provide a JS friendly org unit hash -->
161 [% FOR org_unit IN ctx.aou_list %]
162 [% org_unit.id %] : {
163 id : "[% org_unit.id %]",
164 name : "[% org_unit.name | replace('"', '\"') %]",
165 parent_ou : "[% org_unit.parent_ou %]",
166 depth : "[% org_unit.ou_type.depth %]",
167 can_have_vols : "[% org_unit.ou_type.can_have_vols %]"
168 }[%- ',' UNLESS loop.last -%]
173 <script >if ($('#client_tz_id')) { $('#client_tz_id').value = OpenSRF.tz }</script>
174 [%- END; # want_dojo -%]
176 [%- IF ctx.max_cart_size; %]
177 <script >var max_cart_size = [% ctx.max_cart_size %];</script>
181 <link rel="stylesheet" href="[% ctx.media_prefix %]/js/ui/default/common/build/js/glide/css/glide.core.min.css[% ctx.cache_key %]">
182 <link rel="stylesheet" href="[% ctx.media_prefix %]/js/ui/default/common/build/js/glide/css/glide.theme.min.css[% ctx.cache_key %]">
183 <!-- JS imports, etc. -->
184 <script src="[% ctx.media_prefix %]/opac/deps/node_modules/jquery/dist/jquery.min.js[% ctx.cache_key %]"></script>
185 <script src="[% ctx.media_prefix %]/opac/deps/node_modules/popper.js/dist/umd/popper.min.js[% ctx.cache_key %]"></script>
186 <script src="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap/dist/js/bootstrap.min.js[% ctx.cache_key %]"></script>
187 <script src="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js[% ctx.cache_key %]"></script>
190 $(document).ready(function(){
191 $('[data-toggle="tooltip"]').tooltip();