Experimenting with keyboard shortcuts
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / js / staff-global.js
1 // staff-global.js
2
3 function _(s) { return s } // dummy function for gettext
4
5  $(document).ready(function() {
6         $(".focus").focus();
7         $('#header_search').tabs({
8                 onShow: function() {
9                 $('#header_search').find('div.residentsearch').not('.tabs-hide').find('input').eq(0).focus();
10             }   
11         });
12         $(".close").click(function(){
13                 window.close();
14         });
15         if($("#header_search #checkin_search")){ $.hotkeys.add('Alt+r',function (){$("#header_search").triggerTab(2); }); }
16         if($("#header_search #circ_search")){ $.hotkeys.add('Alt+u',function (){ $("#header_search").triggerTab("#circ_search"); }); }
17         if($("#header_search #catalog_search")){ $.hotkeys.add('Alt+q',function (){ $("#header_search").triggerTab(3); }); }
18  });
19  
20
21             YAHOO.util.Event.onContentReady("header", function () {
22                                 var oMoremenu = new YAHOO.widget.Menu("moremenu", { zindex: 2 });
23
24                                 function positionoMoremenu() {
25                                         oMoremenu.align("tl", "bl");
26                                 }
27
28                 oMoremenu.subscribe("beforeShow", function () {
29                     if (this.getRoot() == this) {
30                                                 positionoMoremenu();
31                     }
32                 });
33
34                                 oMoremenu.render();
35
36                 oMoremenu.cfg.setProperty("context", ["showmore", "tl", "bl"]);
37
38                                 function onShowMoreClick(p_oEvent) {
39                     // Position and display the menu        
40                     positionoMoremenu();
41                     oMoremenu.show();
42                     // Stop propagation and prevent the default "click" behavior
43                     YAHOO.util.Event.stopEvent(p_oEvent);       
44                                 }
45
46                                 YAHOO.util.Event.addListener("showmore", "click", onShowMoreClick);
47
48                 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMoremenu);
49             });
50
51 YAHOO.util.Event.onContentReady("changelanguage", function () {
52                 var oMenu = new YAHOO.widget.Menu("sublangs", { zindex: 2 });
53
54                     function positionoMenu() {
55                     oMenu.align("bl", "tl");
56                 }
57
58                 oMenu.subscribe("beforeShow", function () {
59                     if (this.getRoot() == this) {
60                                                 positionoMenu();
61                     }
62                 });
63
64                 oMenu.render();
65
66                                 oMenu.cfg.setProperty("context", ["showlang", "bl", "tl"]);
67
68                                 function onYahooClick(p_oEvent) {
69                     // Position and display the menu        
70                     positionoMenu();
71                     oMenu.show();
72                     // Stop propagation and prevent the default "click" behavior
73                     YAHOO.util.Event.stopEvent(p_oEvent);
74                 }
75
76                                 YAHOO.util.Event.addListener("showlang", "click", onYahooClick);
77
78                                 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
79             });