2 if ( KOHA === undefined ) var KOHA = {};
4 function _(s) { return s } // dummy function for gettext
6 $(document).ready(function() {
7 $('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); });
8 $(".close").click(function(){ window.close(); });
9 if($("#header_search #checkin_search").length > 0){ $(document).bind('keydown','Alt+r',function (){ $("#header_search > ul").tabs("select","#checkin_search"); $("#ret_barcode").focus(); }); } else { $(document).bind('keydown','Alt+r',function (){ location.href="/cgi-bin/koha/circ/returns.pl"; }); }
10 if($("#header_search #circ_search").length > 0){ $(document).bind('keydown','Alt+u',function (){ $("#header_search > ul").tabs("select","#circ_search"); $("#findborrower").focus(); }); } else { $(document).bind('keydown','Alt+u',function(){ location.href="/cgi-bin/koha/circ/circulation.pl"; }); }
11 if($("#header_search #catalog_search").length > 0){ $(document).bind('keydown','Alt+q',function (){ $("#header_search > ul").tabs("select","#catalog_search"); $("#search-form").focus(); }); } else { $(document).bind('keydown','Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); }
15 YAHOO.util.Event.onContentReady("header", function () {
16 var oMoremenu = new YAHOO.widget.Menu("moremenu", { zindex: 2 });
18 function positionoMoremenu() {
19 oMoremenu.align("tl", "bl");
22 oMoremenu.subscribe("beforeShow", function () {
23 if (this.getRoot() == this) {
30 oMoremenu.cfg.setProperty("context", ["showmore", "tl", "bl"]);
32 function onShowMoreClick(p_oEvent) {
33 // Position and display the menu
35 $("#moremenu").show();
37 // Stop propagation and prevent the default "click" behavior
38 YAHOO.util.Event.stopEvent(p_oEvent);
41 YAHOO.util.Event.addListener("showmore", "click", onShowMoreClick);
43 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMoremenu);
46 // build Change Language menus
47 YAHOO.util.Event.onContentReady("changelanguage", function () {
48 $(".sublangs").each(function(){
49 var menuid = $(this).attr("id");
50 var menuid = menuid.replace("show","");
52 var oMenu = new YAHOO.widget.Menu("sub"+menuid, { zindex: 2 });
53 function positionoMenu() {
54 oMenu.align("bl", "tl");
56 oMenu.subscribe("beforeShow", function () {
57 if (this.getRoot() == this) {
62 oMenu.cfg.setProperty("context", ["show"+menuid, "bl", "tl"]);
63 function onYahooClick(p_oEvent) {
64 // Position and display the menu
67 // Stop propagation and prevent the default "click" behavior
68 YAHOO.util.Event.stopEvent(p_oEvent);
70 YAHOO.util.Event.addListener("show"+menuid, "click", onYahooClick);
71 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
75 // http://jennifermadden.com/javascript/stringEnterKeyDetector.html
76 function checkEnter(e){ //e is event object passed from function invocation
77 var characterCode; // literal character code will be stored in this variable
78 if(e && e.which){ //if which property of event object is supported (NN4)
80 characterCode = e.which; //character code is contained in NN4's which property
83 characterCode = e.keyCode; //character code is contained in IE's keyCode property
86 if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
93 function clearHoldFor(){
94 $.cookie("holdfor",null, { path: "/", expires: 0 });
97 jQuery.fn.preventDoubleFormSubmit = function() {
98 jQuery(this).submit(function() {
99 if (this.beenSubmitted)
102 this.beenSubmitted = true;