5 [%# Prevent XFS attacks -%]
9 var antiClickjack = document.getElementById("antiClickjack");
10 antiClickjack.parentNode.removeChild(antiClickjack);
12 top.location = self.location;
17 [% Asset.js("lib/jquery/jquery-2.2.3.min.js") | $raw %]
18 [% Asset.js("lib/jquery/jquery-migrate-1.3.0.min.js") | $raw %]
19 [% Asset.js("lib/jquery/jquery-ui-1.11.4.min.js") | $raw %]
20 [% Asset.js("lib/shortcut/shortcut.js") | $raw %]
21 [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
22 [% Asset.js("lib/js-cookie/js.cookie-2.2.1.min.js") | $raw %]
23 [% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %]
24 [% Asset.js("lib/bootstrap/bootstrap.min.js") | $raw %]
25 [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
27 [% Asset.js("js/staff-global.js") | $raw %]
29 [% INCLUDE 'validator-strings.inc' %]
30 [% IF ( IntranetUserJS ) %]
31 <!-- js_includes.inc: IntranetUserJS -->
33 [% IntranetUserJS | $raw %]
35 <!-- / js_includes.inc: IntranetUserJS -->
38 <!-- js_includes.inc -->
39 [% IF ( virtualshelves || intranetbookbag ) %]
41 // virtualshelves || intranetbookbag
42 var MSG_BASKET_EMPTY = _("Your cart is currently empty");
43 var MSG_RECORD_IN_BASKET = _("This item is already in your cart");
44 var MSG_RECORD_ADDED = _("This item has been added to your cart");
45 var MSG_NRECORDS_ADDED = _("%s item(s) added to your cart");
46 var MSG_NRECORDS_IN_BASKET = _("%s already in your cart");
47 var MSG_NO_RECORD_SELECTED = _("No item was selected");
48 var MSG_NO_RECORD_ADDED = _("No item was added to your cart (already in your cart)!");
49 var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?");
50 var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
51 var MSG_IN_YOUR_CART = _("Items in your cart: %s");
52 var MSG_ITEM_NOT_IN_CART = _("Add to cart");
53 var MSG_ITEM_IN_CART = _("In your cart");
54 var MSG_RECORD_REMOVED = _("The item has been removed from your cart");
57 [% Asset.js("js/basket.js") | $raw %]
60 [% IF LocalCoverImages %]
61 [% Asset.js("js/localcovers.js") | $raw %]
64 [% IF Koha.Preference('AudioAlerts') || AudioAlertsPage %]
67 var AUDIO_ALERT_PATH = '[% interface | html %]/[% theme | html %]/sound/';
68 var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" );
70 $( document ).ready(function() {
72 for ( var k in AUDIO_ALERTS ) {
73 var alert = AUDIO_ALERTS[k];
74 if ( $( alert.selector ).length ) {
75 playSound( alert.sound );
84 [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
85 [% IF ( PatronAutoComplete ) %]
87 // PatronAutoComplete && CAN_user_circulate_circulate_remaining_permissions
88 $(document).ready(function(){
89 var obj = $( "#findborrower" ).autocomplete({
90 source: "/cgi-bin/koha/circ/ysearch.pl",
92 select: function( event, ui ) {
93 window.location.href = ui.item.link;
95 }).data( "ui-autocomplete" );
97 obj._renderItem = function( ul, item ) {
98 item.link = "/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + item.borrowernumber;
100 if( item.cardnumber != "" ){
101 // Display card number in parentheses if it exists
102 cardnumber = " (" + item.cardnumber + ") ";
104 var itemString = "<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " + ( item.firstname ? item.firstname.escapeHtml() : "" ) + cardnumber.escapeHtml() + " <small>";
105 if( item.dateofbirth ) {
106 itemString += ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" )
107 + "<span class=\"age_years\"> (" + ( item.age ? item.age.escapeHtml() : "" ) + " " + _("years") + ")</span>, ";
109 itemString += ( item.address ? item.address.escapeHtml() : "" ) + " "
110 + ( item.city ? item.city.escapeHtml() : "" ) + " "
111 + ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " "
112 + ( item.country ? item.country.escapeHtml() : "" )
114 return $( "<li></li>" )
115 .data( "ui-autocomplete-item", item )
116 .append( itemString )
124 [% IF ( PatronAutoComplete ) %]
126 // PatronAutoComplete
127 $(document).ready(function(){
128 var obj = $( "#searchmember" ).autocomplete({
129 source: "/cgi-bin/koha/circ/ysearch.pl",
131 select: function( event, ui ) {
132 window.location.href = ui.item.link;
134 }).data( "ui-autocomplete" );
136 obj._renderItem = function( ul, item ) {
137 item.link = "/cgi-bin/koha/members/moremember.pl?borrowernumber=" + item.borrowernumber;
139 if( item.cardnumber != "" ){
140 // Display card number in parentheses if it exists
141 cardnumber = " (" + item.cardnumber + ") ";
143 return $( "<li></li>" )
144 .data( "ui-autocomplete-item", item )
146 "<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", "
147 + ( item.firstname ? item.firstname.escapeHtml() : "" )
148 + cardnumber.escapeHtml()
150 + ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" ) + " "
151 + ( item.address ? item.address.escapeHtml() : "" ) + " "
152 + ( item.city ? item.city.escapeHtml() : "" ) + " "
153 + ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " "
154 + ( item.country ? item.country.escapeHtml() : "" )
163 <!-- / js_includes.inc -->