Lines 99-132
$.fn.selectTabByID = function (tabID) {
Link Here
|
99 |
$("#catalog-search-dropdown a").toggleClass("catalog-search-dropdown-hover"); |
99 |
$("#catalog-search-dropdown a").toggleClass("catalog-search-dropdown-hover"); |
100 |
}); |
100 |
}); |
101 |
|
101 |
|
102 |
if (typeof $.cookie("lastborrowernumber") !== "undefined" && $("#hiddenborrowernumber").val() != $.cookie("lastborrowernumber")) { |
102 |
if ( localStorage.getItem("lastborrowernumber") ){ |
103 |
$("#lastborrower-window").detach().appendTo("#breadcrumbs"); |
103 |
if( $("#hiddenborrowernumber").val() != localStorage.getItem("lastborrowernumber") ) { |
104 |
$("#lastborrowerlink").show(); |
104 |
$("#lastborrower-window").detach().appendTo("#breadcrumbs"); |
105 |
$("#lastborrowerlink").prop("title", $.cookie("lastborrowername") + " (" + $.cookie("lastborrowercard") + ")"); |
105 |
$("#lastborrowerlink").show(); |
106 |
$("#lastborrowerlink").prop("href", "/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + $.cookie("lastborrowernumber")); |
106 |
$("#lastborrowerlink").prop("title", localStorage.getItem("lastborrowername") + " (" + localStorage.getItem("lastborrowercard") + ")"); |
107 |
$("#lastborrower-window").css("display", "inline-block"); |
107 |
$("#lastborrowerlink").prop("href", "/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + localStorage.getItem("lastborrowernumber")); |
|
|
108 |
$("#lastborrower-window").css("display", "inline-block"); |
109 |
} |
108 |
} |
110 |
} |
109 |
if ($("a#logout").length > 0) { |
111 |
|
110 |
$("a#logout").click(function() { |
112 |
if( !localStorage.getItem("lastborrowernumber") || ( $("#hiddenborrowernumber").val() != localStorage.getItem("lastborrowernumber") && localStorage.getItem("currentborrowernumber") != $("#hiddenborrowernumber").val())) { |
111 |
delCookie("lastborrowernumber"); |
113 |
if( $("#hiddenborrowernumber").val() ){ |
112 |
delCookie("lastborrowername"); |
114 |
localStorage.setItem("lastborrowernumber", $("#hiddenborrowernumber").val() ); |
113 |
delCookie("lastborrowercard"); |
115 |
localStorage.setItem("lastborrowername", $("#hiddenborrowername").val() ); |
114 |
delCookie("currentborrowernumber"); |
116 |
localStorage.setItem("lastborrowercard", $("#hiddenborrowercard").val() ); |
115 |
}); |
117 |
} |
|
|
118 |
} |
119 |
|
120 |
if( $("#hiddenborrowernumber").val() ){ |
121 |
localStorage.setItem("currentborrowernumber", $("#hiddenborrowernumber").val() ); |
116 |
} |
122 |
} |
|
|
123 |
|
117 |
$("#lastborrower-remove").click(function() { |
124 |
$("#lastborrower-remove").click(function() { |
118 |
delCookie("lastborrowernumber"); |
125 |
removeLastBorrower(); |
119 |
delCookie("lastborrowername"); |
|
|
120 |
delCookie("lastborrowercard"); |
121 |
delCookie("currentborrowernumber"); |
122 |
$("#lastborrower-window").hide(); |
126 |
$("#lastborrower-window").hide(); |
123 |
}); |
127 |
}); |
124 |
if (typeof $.cookie("lastborrowernumber") === "undefined" || ($("#hiddenborrowernumber").val() != $.cookie("lastborrowernumber") && $.cookie("currentborrowernumber") != $("#hiddenborrowernumber").val())) { |
|
|
125 |
$.cookie("lastborrowernumber", $("#hiddenborrowernumber").val(), { path: "/" }); |
126 |
$.cookie("lastborrowername", $("#hiddenborrowername").val(), { path: "/" }); |
127 |
$.cookie("lastborrowercard", $("#hiddenborrowercard").val(), { path: "/" }); |
128 |
} |
129 |
$.cookie("currentborrowernumber", $("#hiddenborrowernumber").val(), { path: "/" }); |
130 |
|
128 |
|
131 |
/* Search results browsing */ |
129 |
/* Search results browsing */ |
132 |
/* forms with action leading to search */ |
130 |
/* forms with action leading to search */ |
Lines 144-149
$.fn.selectTabByID = function (tabID) {
Link Here
|
144 |
|
142 |
|
145 |
}); |
143 |
}); |
146 |
|
144 |
|
|
|
145 |
function removeLastBorrower(){ |
146 |
localStorage.removeItem("lastborrowernumber"); |
147 |
localStorage.removeItem("lastborrowername"); |
148 |
localStorage.removeItem("lastborrowercard"); |
149 |
localStorage.removeItem("currentborrowernumber"); |
150 |
} |
151 |
|
147 |
// http://jennifermadden.com/javascript/stringEnterKeyDetector.html |
152 |
// http://jennifermadden.com/javascript/stringEnterKeyDetector.html |
148 |
function checkEnter(e){ //e is event object passed from function invocation |
153 |
function checkEnter(e){ //e is event object passed from function invocation |
149 |
var characterCode; // literal character code will be stored in this variable |
154 |
var characterCode; // literal character code will be stored in this variable |
Lines 171-176
function logOut(){
Link Here
|
171 |
delBasket('main', true); |
176 |
delBasket('main', true); |
172 |
} |
177 |
} |
173 |
clearHoldFor(); |
178 |
clearHoldFor(); |
|
|
179 |
removeLastBorrower(); |
174 |
} |
180 |
} |
175 |
|
181 |
|
176 |
function openHelp(){ |
182 |
function openHelp(){ |
177 |
- |
|
|