2 if ( KOHA === undefined ) var KOHA = {};
4 function _(s) { return s } // dummy function for gettext
6 $(document).ready(function() {
7 $('#header_search').tabs().bind('tabsshow', 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").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").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").tabs("select","#catalog_search"); $("#search-form").focus(); }); } else { $(document).bind('keydown','Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); }
16 YAHOO.util.Event.onContentReady("header", function () {
17 var oMoremenu = new YAHOO.widget.Menu("moremenu", { zindex: 2 });
19 function positionoMoremenu() {
20 oMoremenu.align("tl", "bl");
23 oMoremenu.subscribe("beforeShow", function () {
24 if (this.getRoot() == this) {
31 oMoremenu.cfg.setProperty("context", ["showmore", "tl", "bl"]);
33 function onShowMoreClick(p_oEvent) {
34 // Position and display the menu
36 $("#moremenu").show();
38 // Stop propagation and prevent the default "click" behavior
39 YAHOO.util.Event.stopEvent(p_oEvent);
42 YAHOO.util.Event.addListener("showmore", "click", onShowMoreClick);
44 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMoremenu);
47 // build Change Language menus
48 YAHOO.util.Event.onContentReady("changelanguage", function () {
49 $(".sublangs").each(function(){
50 var menuid = $(this).attr("id");
51 var menuid = menuid.replace("show","");
53 var oMenu = new YAHOO.widget.Menu("sub"+menuid, { zindex: 2 });
54 function positionoMenu() {
55 oMenu.align("bl", "tl");
57 oMenu.subscribe("beforeShow", function () {
58 if (this.getRoot() == this) {
63 oMenu.cfg.setProperty("context", ["show"+menuid, "bl", "tl"]);
64 function onYahooClick(p_oEvent) {
65 // Position and display the menu
68 // Stop propagation and prevent the default "click" behavior
69 YAHOO.util.Event.stopEvent(p_oEvent);
71 YAHOO.util.Event.addListener("show"+menuid, "click", onYahooClick);
72 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
76 // http://jennifermadden.com/javascript/stringEnterKeyDetector.html
77 function checkEnter(e){ //e is event object passed from function invocation
78 var characterCode; // literal character code will be stored in this variable
79 if(e && e.which){ //if which property of event object is supported (NN4)
81 characterCode = e.which; //character code is contained in NN4's which property
84 characterCode = e.keyCode; //character code is contained in IE's keyCode property
87 if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
94 function clearHoldFor(){
95 $.cookie("holdfor",null, { path: "/", expires: 0 });
98 jQuery.fn.preventDoubleFormSubmit = function() {
99 jQuery(this).submit(function() {
100 if (this.beenSubmitted)
103 this.beenSubmitted = true;
107 function openWindow(link,name,width,height) {
108 name = (typeof name == "undefined")?'popup':name;
109 width = (typeof width == "undefined")?'600':width;
110 height = (typeof height == "undefined")?'400':height;
111 var newin=window.open(link,name,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top');