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 <!-- DOB validation for Patron Registration in OPAC -->
31 function dobValidate(input) {
32 var validformat = /^(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])$/
34 if (!validformat.test(input.value))
35 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.') %]")
38 if (returnval == false) input.select()
43 [%- IF ctx.use_stripe %]
44 <script >unHideMe($("pay_fines_now"));[%# the DOM is loaded now, right? %]</script>
47 [%- IF ctx.is_staff %]
48 <script src="[% ctx.media_prefix %]/js/ui/default/opac/staff.js[% ctx.cache_key %]"></script>
49 [% IF ctx.page == 'record' %]
50 [% IF ctx.search_result_index >= 0 %]
52 rdetail_next_prev_actions(
53 "[% ctx.search_result_index %]",
54 "[% ctx.hit_count %]",
55 "[% ctx.prev_rec_url || '' %]",
56 "[% ctx.next_rec_url || '' %]",
57 "[% mkurl(ctx.first_search_record, {page => 0}) %]",
58 "[% mkurl(ctx.opac_root _ '/results', {find_last => 1, page => POSIX.floor(ctx.hit_count / ctx.page_size)}) %]",
59 "[% mkurl(ctx.opac_root _ '/results', {}, ['expand','cnoffset']) %]"
63 [% IF ctx.mfhd_summaries.size %]
65 window.mfhdDetails = [
66 [% FOR summary IN ctx.mfhd_summaries %]
67 [% IF summary.sre_id != -1 %]
69 'id' : '[% summary.sre_id %]',
70 'label' : '[% summary.location | replace("'", "\\'") %]',
71 'entryNum' : [% loop.index %],
72 'owning_lib' : '[% summary.owning_lib %]'
82 [%- IF ENV.OILS_NOVELIST_URL AND ctx.page == 'record';
83 url = ENV.OILS_NOVELIST_URL;
84 IF CGI.https; url = url.replace('^http:', 'https:'); END; %]
85 <script id='EIT' src='[% url %]'></script>
87 [%- IF ctx.page == 'record' AND ctx.google_books_preview %]
88 <script src='[% ctx.media_prefix %]/js/ui/default/opac/ac_google_books.js[% ctx.cache_key %]' async defer></script>
92 window.egStrings = [];
93 window.egStrings['CONFIRM_BASKET_EMPTY'] = "[% l('Remove all records from basket?') %]";
95 <script src='[% ctx.media_prefix %]/js/ui/default/opac/record_selectors.js[% ctx.cache_key %]' async defer></script>
97 <!-- Require some inputs and selections for browsers that don't support required form field element -->
98 [% IF ctx.page == 'place_hold' %]
99 <script src="[% ctx.media_prefix %]/js/ui/default/opac/holds-validation.js[% ctx.cache_key %]">
103 [%- IF want_dojo; -%]
106 locale: "[% ctx.locale | lower | replace('_', '-') %]",
111 <script src="[% ctx.media_prefix %]/js/dojo/dojo/dojo.js?[% ctx.eg_cache_hash %]"></script>
112 <script src="[% ctx.media_prefix %]/js/dojo/dojo/openils_dojo.js?[% ctx.eg_cache_hash %]"></script>
114 [%- # So the following works in Mozilla and Chrome, but not in IE8.
115 # Seems like it /should/ work anywhere, though, and obviate the
116 # next three script tags: %]
117 <!-- <script src="[% ctx.media_prefix %]/js/dojo/DojoSRF.js?[% ctx.eg_cache_hash %]"></script> -->
119 <script src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf.js?[% ctx.eg_cache_hash %]"></script>
120 <script src="[% ctx.media_prefix %]/js/dojo/opensrf/opensrf_xhr.js?[% ctx.eg_cache_hash %]"></script>
121 <script src="[% ctx.media_prefix %]/js/dojo/opensrf/JSON_v1.js?[% ctx.eg_cache_hash %]"></script>
123 [% IF use_autosuggest.enabled == "t" AND basic_search != "f"; %]
125 dojo.require("openils.widget.AutoSuggest");
127 /* Set focus, and place the cursor at the end of the input string */
128 dojo.addOnLoad(function() {
129 /* Don't error out if the object doesn't exist, like on advanced search pages */
130 if (dojo.byId('search_box')) {
131 dijit.byId('search_box').focus();
132 var sb_value = dijit.byId('search_box').value;
133 /* Dojo won't trigger a change if the value doesn't change */
135 dijit.byId('search_box').setValue(sb_value + ' ');
136 dijit.byId('search_box').setValue(sb_value);
141 [% END; # use_autosuggest %]
143 [% INCLUDE "opac/parts/acjs.tt2" IF ctx.page == 'record' %]
144 [% IF ctx.page == 'advanced' %]
146 src="[% ctx.media_prefix %]/js/ui/default/opac/copyloc.js[% ctx.cache_key %]"></script>
149 [% IF ebook_api.enabled == 'true' %]
150 [% INCLUDE "opac/parts/ebook_api/base_js.tt2" %]
151 [% INCLUDE "opac/parts/ebook_api/login_js.tt2" IF (ctx.page == 'login') %]
154 <!-- provide a JS friendly org unit hash -->
157 [% FOR org_unit IN ctx.aou_list %]
158 [% org_unit.id %] : {
159 id : "[% org_unit.id %]",
160 name : "[% org_unit.name | replace('"', '\"') %]",
161 parent_ou : "[% org_unit.parent_ou %]",
162 depth : "[% org_unit.ou_type.depth %]",
163 can_have_vols : "[% org_unit.ou_type.can_have_vols %]"
164 }[%- ',' UNLESS loop.last -%]
169 <script >if ($('#client_tz_id')) { $('#client_tz_id').value = OpenSRF.tz }</script>
170 [%- END; # want_dojo -%]
172 [%- IF ctx.max_cart_size; %]
173 <script >var max_cart_size = [% ctx.max_cart_size %];</script>
177 <link rel="stylesheet" href="[% ctx.media_prefix %]/js/ui/default/common/build/js/glide/css/glide.core.min.css[% ctx.cache_key %]">
178 <link rel="stylesheet" href="[% ctx.media_prefix %]/js/ui/default/common/build/js/glide/css/glide.theme.min.css[% ctx.cache_key %]">
179 <!-- JS imports, etc. -->
180 <script src="[% ctx.media_prefix %]/opac/deps/node_modules/jquery/dist/jquery.min.js[% ctx.cache_key %]"></script>
181 <script src="[% ctx.media_prefix %]/opac/deps/node_modules/popper.js/dist/umd/popper.min.js[% ctx.cache_key %]"></script>
182 <script src="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap/dist/js/bootstrap.min.js[% ctx.cache_key %]"></script>
183 <script src="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js[% ctx.cache_key %]"></script>
186 $(document).ready(function(){
187 $('[data-toggle="tooltip"]').tooltip();