Two jquery changes: update to tabs plugin, with related modifications to templates...
[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 > 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")){
10                 $.hotkeys.add('Alt+r',function (){ $("#header_search > ul").tabs("select","#checkin_search"); }); }
11         if($("#header_search #circ_search")){ $.hotkeys.add('Alt+u',function (){ $("#header_search > ul").tabs("select","#circ_search"); }); }
12         if($("#header_search #catalog_search")){ $.hotkeys.add('Alt+q',function (){ $("#header_search > ul").tabs("select","#catalog_search"); }); }
13  });
14  
15              YAHOO.util.Event.onContentReady("header", function () {
16                                 var oMoremenu = new YAHOO.widget.Menu("moremenu", { zindex: 2 });
17
18                                 function positionoMoremenu() {
19                                         oMoremenu.align("tl", "bl");
20                                 }
21
22                 oMoremenu.subscribe("beforeShow", function () {
23                     if (this.getRoot() == this) {
24                                                 positionoMoremenu();
25                     }
26                 });
27
28                                 oMoremenu.render();
29
30                 oMoremenu.cfg.setProperty("context", ["showmore", "tl", "bl"]);
31
32                                 function onShowMoreClick(p_oEvent) {
33                     // Position and display the menu        
34                     positionoMoremenu();
35                     oMoremenu.show();
36                     // Stop propagation and prevent the default "click" behavior
37                     YAHOO.util.Event.stopEvent(p_oEvent);       
38                                 }
39
40                                 YAHOO.util.Event.addListener("showmore", "click", onShowMoreClick);
41
42                 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMoremenu);
43             });
44
45 YAHOO.util.Event.onContentReady("changelanguage", function () {
46                 var oMenu = new YAHOO.widget.Menu("sublangs", { zindex: 2 });
47
48                     function positionoMenu() {
49                     oMenu.align("bl", "tl");
50                 }
51
52                 oMenu.subscribe("beforeShow", function () {
53                     if (this.getRoot() == this) {
54                                                 positionoMenu();
55                     }
56                 });
57
58                 oMenu.render();
59
60                                 oMenu.cfg.setProperty("context", ["showlang", "bl", "tl"]);
61
62                                 function onYahooClick(p_oEvent) {
63                     // Position and display the menu        
64                     positionoMenu();
65                     oMenu.show();
66                     // Stop propagation and prevent the default "click" behavior
67                     YAHOO.util.Event.stopEvent(p_oEvent);
68                 }
69
70                                 YAHOO.util.Event.addListener("showlang", "click", onYahooClick);
71
72                                 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
73             });