~openerp-india/openerp-india/7.0

« back to all changes in this revision

Viewing changes to web_keyboard_shortcuts/static/src/js/web_keyboard_shortcuts.js

  • Committer: Parth Gajjar (Open ERP)
  • Date: 2013-06-14 13:47:59 UTC
  • mto: (1.10.29 trunk-nco)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: pga@tinyerp.com-20130614134759-r272xs9j4d85zoyy
[ADD]added 5 modules. attachment_size_limit, web_gui, web_keyboard_shortcuts, web_mail_img, web_pdf_viewer

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
openerp.web_keyboard_shortcuts = function (openerp) {
 
3
                var QWeb = openerp.web.qweb,
 
4
                _t = openerp.web._t;
 
5
                openerp.web_shortcuts.Shortcuts.include({
 
6
                         init: function() {
 
7
                            this._super.apply(this, arguments);
 
8
                            var old=this;
 
9
                            var match=0;
 
10
                                var str ="";
 
11
                                var select=0;
 
12
                                var menu_id=0;
 
13
                                $(document).keyup(function(event){
 
14
                                                if(fullscreen_toggle.menu_dict)
 
15
                                                        {
 
16
                                                        var d = event.keyCode;
 
17
                                                        var pa=$(".oe_searchview_input").html();
 
18
                                                        for (key in Object.keys(fullscreen_toggle.menu_dict))
 
19
                                                                {if (pa)
 
20
                                                                        {
 
21
                                                                        if(pa=='<br>')
 
22
                                                                                {
 
23
                                                                                $("div.oe_searchview_clear").click();
 
24
                                                                                break;
 
25
                                                                                }
 
26
                                                                        if (pa.length>0 )
 
27
                                                                        {               pa=pa.replace(/\\/g, "\\\\");
 
28
                                                                                        pa=pa.replace(/\(/g, "\\(");
 
29
                                                                                        pa=pa.replace(/\)/g, "\\)");
 
30
                                                                                        var patt1=new RegExp("^"+pa);
 
31
                                                                                        if(patt1.test(Object.keys(fullscreen_toggle.menu_dict)[key]))
 
32
                                                                                                {
 
33
                                                                                                str = Object.keys(fullscreen_toggle.menu_dict)[key]
 
34
                                                                                                var sub = str.substring(pa.length);
 
35
                                                                                                $("#search_hint").remove();
 
36
                                                                                                $(".oe_searchview_input").append('<div id="search_hint" style="color:#898585">'+sub+"</div>");
 
37
                                                                                                match=1;
 
38
                                                                                                }
 
39
                                                                                }
 
40
                                                                        }
 
41
                                                                
 
42
                                                                }
 
43
                                              }
 
44
                                  if(d==39 && match==1)
 
45
                                  {
 
46
                                          $(".oe_searchview_input").trigger("paste");
 
47
                                          match=0;
 
48
                                          select=1;
 
49
                                          menu_id=fullscreen_toggle.menu_dict[str];
 
50
                                  }
 
51
                                  if(d==37 || d==8)
 
52
                                  {   
 
53
                                          event.preventDefault();
 
54
                                          match=0;
 
55
                                          select=0;
 
56
                                  }
 
57
                                  if (fullscreen_toggle.menu_dict){
 
58
                                  if(d==13 && select==1 && menu_id)
 
59
                                          {
 
60
                                      var self = old,
 
61
                                      id = menu_id;
 
62
                                      menu_id=0;
 
63
                                          self.session.active_id = id;
 
64
                                          // TODO: Use do_action({menu_id: id, type: 'ir.actions.menu'})
 
65
                                          select=0;
 
66
                                          match=0;
 
67
                                          self.rpc('/web/menu/action', {'menu_id': id}).done(function(ir_menu_data) {
 
68
                                              if (ir_menu_data.action.length){
 
69
                                                  openerp.webclient.on_menu_action({action_id: ir_menu_data.action[0][2].id});
 
70
                                              }
 
71
                                          });
 
72
                                          }
 
73
                                  }
 
74
                                  
 
75
                                  
 
76
                                });
 
77
                         },
 
78
                         
 
79
                });
 
80
 
 
81
};
 
82
 
 
83
 
 
84
 
 
85
 
 
86
 
 
87
$(document).ready(function(event) {
 
88
         $(document).keyup(function(event) {
 
89
                 $("button u span").unwrap();
 
90
         });
 
91
    $(document).keydown(function(event) {
 
92
                jQuery(".oe_menu").sortable({axis: "x",
 
93
                        cursor: "move",
 
94
                });
 
95
        
 
96
        $("#search_hint").remove();
 
97
        var n = String.fromCharCode(event.charCode);
 
98
        var d = event.keyCode;
 
99
        var alt_dict={}
 
100
        if (event.altKey) {
 
101
                $("header button:visible").attr("accesskey",function(index,currentvalue){ 
 
102
                                                                                                                                        if(currentvalue){
 
103
                                                                                                                                                
 
104
                                                                                                                                                var button_text = $(this).text();
 
105
                                                                                                                                                 $(this).html(button_text.replace(currentvalue,'<u class="alt_base"><span class="under_line">'+currentvalue+'</sapn></u>'));
 
106
                                                                                                                                                 alt_dict[currentvalue]=$(this);
 
107
                                                                                                                                                 $('.alt_base').addClass("alt_after");
 
108
                                                                                                                                                        }
 
109
                                                                                                                                   });
 
110
//              $("button").attr("accesskey",function(index,currentvalue){ 
 
111
//                              if(currentvalue){
 
112
//                                      
 
113
//                                      var button_text = $(this).text();
 
114
//                                       $(this).html(button_text.replace(currentvalue,'<u><span class="under_line">'+currentvalue+'</sapn></u>'));
 
115
//                                       alt_dict[currentvalue]=$(this);
 
116
//                                       $(this).removeAttr("accesskey");
 
117
//                                       $(this).attr("acckey",currentvalue);
 
118
//                                      }
 
119
//                         });
 
120
                
 
121
        }
 
122
        
 
123
        if (event.keyCode && event.keyCode != 18 && event.altKey) {
 
124
                event.preventDefault();
 
125
                var pressed = String.fromCharCode(event.keyCode);
 
126
                if (alt_dict.hasOwnProperty(pressed)!=false)
 
127
                {
 
128
//              if(alt_dict[pressed].is(":visible"))
 
129
//              {
 
130
//      
 
131
//                      alt_dict[pressed].click();
 
132
//              }
 
133
 
 
134
                }
 
135
        }
 
136
        if (event.keyCode && event.keyCode != 17 && event.ctrlKey) {
 
137
            if (d == 83) {
 
138
                event.preventDefault();
 
139
                var x = document.getElementsByTagName('button');
 
140
                for (i = 0; i < x.length; i++) {
 
141
                    y = x[i];
 
142
                    if (y.className == "oe_button oe_form_button_save oe_highlight" && $(y).is(':visible')) {
 
143
                        y.click();
 
144
                    }
 
145
                }
 
146
            }
 
147
 
 
148
            if (d == 75) {
 
149
 
 
150
                event.preventDefault();
 
151
                var x = document.getElementsByTagName('a');
 
152
                for (i = 0; i < x.length; i++) {
 
153
                    y = x[i];
 
154
                    if (y.className == "oe_vm_switch_kanban") {
 
155
                        y.click();
 
156
                    }
 
157
                }
 
158
 
 
159
            }
 
160
 
 
161
            if (d == 222) {
 
162
 
 
163
                event.preventDefault();
 
164
                var x = document.getElementsByTagName('a');
 
165
                for (i = 0; i < x.length; i++) {
 
166
                    y = x[i];
 
167
                    if (y.className == "oe_vm_switch_graph") {
 
168
                        y.click();
 
169
                    }
 
170
                }
 
171
 
 
172
            }
 
173
 
 
174
            if (d == 70) {
 
175
 
 
176
                event.preventDefault();
 
177
                var x = document.getElementsByTagName('div');
 
178
                for (i = 0; i < x.length; i++) {
 
179
                    y = x[i];
 
180
                    if (y.className == "oe_searchview_facets") {
 
181
                        y.click();
 
182
                        if(fullscreen_toggle.fullscreen_toggle)
 
183
                                {
 
184
                                $('div.oe_searchview').animate({
 
185
                                "top": "0px"
 
186
                            },"fast");
 
187
                                fullscreen_toggle.search=1;
 
188
                                }
 
189
                                else{
 
190
                                $('div.oe_searchview').animate({
 
191
                                    "top": "32px"
 
192
                                },"fast");
 
193
                                fullscreen_toggle.search=1;
 
194
                                }
 
195
                        $("div.oe_searchview").animate({
 
196
                            opacity: '1',
 
197
                            }, "fast");
 
198
                       
 
199
                    }
 
200
                }
 
201
            }
 
202
            if (d == 68) {
 
203
                event.preventDefault();
 
204
                
 
205
                if(fullscreen_toggle.fullscreen_toggle)
 
206
                {
 
207
                $('div.oe_searchview').animate({
 
208
                    "top": "-32px"
 
209
                },"fast");
 
210
                fullscreen_toggle.search=0;
 
211
                }
 
212
                else{
 
213
                        $('div.oe_searchview').animate({
 
214
                        "top": "0px"
 
215
                    },"fast");
 
216
                        fullscreen_toggle.search=0;     
 
217
                }
 
218
            }
 
219
            
 
220
            if (d == 76) {
 
221
 
 
222
                event.preventDefault();
 
223
                var x = document.getElementsByTagName('a');
 
224
                for (i = 0; i < x.length; i++) {
 
225
                    y = x[i];
 
226
                    if (y.className == "oe_vm_switch_list") {
 
227
                        y.click();
 
228
                    }
 
229
                }
 
230
            }
 
231
 
 
232
            if (d == 27) {
 
233
 
 
234
                event.preventDefault();
 
235
                var x = document.getElementsByTagName('a');
 
236
                for (i = 0; i < x.length; i++) {
 
237
                    y = x[i];
 
238
                    if (y.className == "oe_bold oe_form_button_cancel" && $(y).is(':visible')) {
 
239
                        y.click();
 
240
                    }
 
241
                }
 
242
 
 
243
            }
 
244
 
 
245
            if (d == 186 | d == 59) {
 
246
 
 
247
                event.preventDefault();
 
248
                var x = document.getElementsByTagName('a');
 
249
                for (i = 0; i < x.length; i++) {
 
250
                    y = x[i];
 
251
                    if (y.className == "oe_vm_switch_form") {
 
252
                        y.click();
 
253
                    }
 
254
                }
 
255
 
 
256
            }
 
257
 
 
258
            if (d == 32) {
 
259
 
 
260
                event.preventDefault();
 
261
                var x = document.getElementsByTagName('button');
 
262
                for (i = 0; i < x.length; i++) {
 
263
                    y = x[i];
 
264
                    if ((y.className == "oe_button oe_list_add oe_highlight" | y.className == "oe_kanban_button_new oe_highlight" | y.className == "oe_button oe_form_button_create") && $(y).is(':visible')) {
 
265
                        y.click();
 
266
                    }
 
267
 
 
268
                }
 
269
 
 
270
            }
 
271
           
 
272
            if (d == 187) {
 
273
 
 
274
                event.preventDefault();
 
275
                var x = document.getElementsByTagName('button');
 
276
                for (i = 0; i < x.length; i++) {
 
277
                    y = x[i];
 
278
                    alert(d);
 
279
                    if (y.className == "oe_button oe_form_button_edit") {
 
280
                        //y.click();
 
281
                    }
 
282
                }
 
283
            }
 
284
            if (d == 69) {
 
285
 
 
286
                event.preventDefault();
 
287
                var x = document.getElementsByTagName('button');
 
288
                for (i = 0; i < x.length; i++) {
 
289
                    y = x[i];
 
290
                    if (y.className == "oe_button oe_form_button_edit") {
 
291
                        y.click();
 
292
                    }
 
293
                }
 
294
            }
 
295
 
 
296
            if (d == 40) {
 
297
 
 
298
                event.preventDefault();
 
299
                var x = document.getElementsByTagName('span');
 
300
                for (i = 0; i < x.length; i++) {
 
301
                    y = x[i];
 
302
                    if (y.className == "ui-icon ui-icon-triangle-1-e") {
 
303
                        y.click();
 
304
                    }
 
305
                }
 
306
            }
 
307
 
 
308
            if (d == 38) {
 
309
 
 
310
                event.preventDefault();
 
311
                var x = document.getElementsByTagName('span');
 
312
                for (i = 0; i < x.length; i++) {
 
313
                    y = x[i];
 
314
                    if (y.className == "ui-icon ui-icon-triangle-1-s") {
 
315
                        y.click();
 
316
                    }
 
317
                }
 
318
            }
 
319
 
 
320
//            if (d == 80) {
 
321
                
 
322
//              $('.oe_leftbar').remove();
 
323
//              $('colgroup').remove();
 
324
//              $('.oe_topbar').remove();
 
325
//              $('.oe_loading').remove();
 
326
//              $('tfoot').remove();
 
327
//              $('ul').remove();
 
328
//              $('.oe_notification.ui-notify').remove();
 
329
//              $('.oe_view_manager_view_kanban').remove();
 
330
//              $('tr.oe_header_row:eq(1)').remove();
 
331
//              $('.oe_view_manager_view_search').remove();
 
332
//              var _elementClone = $(".oe_view_manager.oe_view_manager_current").clone(); 
 
333
//              $(".oe_view_manager.oe_view_manager_current").remove();
 
334
//              $("body").prepend(_elementClone);
 
335
//              $("table.oe_webclient").removeClass();
 
336
//              $("td.oe_application").removeClass();
 
337
//            }
 
338
            
 
339
            if (d == 80) {
 
340
 
 
341
 
 
342
                event.preventDefault();
 
343
                var x = document.getElementsByTagName('div');
 
344
                var list = 0;
 
345
                var form = 0;
 
346
                var check = 0;
 
347
                $('.oe_form_sheet').each(function() {
 
348
                    if ($(this).parents('div:hidden').length == 0) {
 
349
                        form=1;
 
350
                    }
 
351
                    else {
 
352
                        form=0;
 
353
                        check = 0       
 
354
                        }
 
355
                });
 
356
                $('.oe_view_manager_view_graph').each(function() {
 
357
                    if ($(this).parents('div:hidden').length == 0) {
 
358
                        form=1;
 
359
                    }
 
360
                    else {
 
361
                        form=0;
 
362
                        check = 0       
 
363
                        }
 
364
                });
 
365
                $('.oe_list_content').each(function() {
 
366
                    if ($(this).parents('div:hidden').length == 0) {
 
367
                        list=1;
 
368
                    }
 
369
                });
 
370
                for (i = 0; i < x.length; i++) {
 
371
                    y = x[i];
 
372
                    if ((y.className == "oe_form_sheet oe_form_sheet_width" | y.className == "oe_semantic_html_override editor-render oe_view") & form==1) {
 
373
                        if ($(y).parents('div:hidden').length == 0) {
 
374
                                check=1;
 
375
                                }
 
376
                        else continue;
 
377
                        
 
378
                        var logo_url =  $('a.oe_logo').children("img").attr("src");
 
379
                        var add_img = '<img src="'+logo_url+'" class="sheet_logo"/>'
 
380
                        var graph_img = '<img src="'+logo_url+'" style="padding:10px;padding-bottom:0px" class="sheet_logo"/>'
 
381
                        var hr='<hr class="sheet_logo" style="border: 2;width: 100%;margin-bottom:25px"/>'
 
382
                        $('.oe_form_sheet').prepend(hr);
 
383
                        $('.oe_form_sheet').prepend(add_img);
 
384
                        $('.oe_semantic_html_override.editor-render.oe_view').prepend(hr);
 
385
                        $('.oe_semantic_html_override.editor-render.oe_view').prepend(graph_img);
 
386
                        html2canvas(y, {
 
387
                            onrendered: function(canvas) {
 
388
                                myWindow = window.open('', '', 'width='+window.innerWidth+',height='+window.innerHeight);
 
389
                                var strDataURI = canvas.toDataURL();
 
390
                                var link = document.createElement("img");
 
391
                                link.setAttribute("src", strDataURI);
 
392
                                link.setAttribute("id", "embedImage");
 
393
                                var linkText = document.createTextNode("Click me");
 
394
                                link.appendChild(linkText);
 
395
 
 
396
                                var openerp_img = document.createElement("img");
 
397
                                openerp_img.setAttribute("class", "open");
 
398
                                openerp_img.setAttribute("src", logo_url);
 
399
                                var openerp_imgText = document.createTextNode("Click me");
 
400
                                openerp_img.appendChild(openerp_imgText);
 
401
 
 
402
                                var css = document.createElement("style");
 
403
                                var cssText = document.createTextNode(".css3button {margin-left:37%;margin-top:2%;font-family: Arial, Helvetica, sans-serif;font-weight:700;font-size: 14px;color: #c2c0c2;padding: 10px 20px;background: -moz-linear-gradient(top,#302e30 0%,#000000);background: -webkit-gradient(linear, left top, left bottom, from(#302e30),to(#000000));-moz-border-radius: 1px;-webkit-border-radius: 1px;border-radius: 1px;border: 1px solid #000000;-moz-box-shadow:0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);-webkit-box-shadow:0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);box-shadow:0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);text-shadow:0px -1px 0px rgba(000,000,000,1),0px 1px 0px rgba(184,180,184,0.2);}body{background-color:#252525;}img{margin-left:10%;margin-top:2%;}.open{margin-left:35%;margin-top:1%;}");
 
404
                                css.appendChild(cssText);
 
405
 
 
406
                                var input = document.createElement("input");
 
407
                                var inputText = document.createTextNode("a");
 
408
                                input.appendChild(inputText);
 
409
                                input.setAttribute("id", "saveImage");
 
410
                                input.setAttribute("onclick", "download()");
 
411
                                input.setAttribute("type", "button");
 
412
                                input.setAttribute("class", "css3button");
 
413
                                input.setAttribute("value", "Download Png");
 
414
 
 
415
                                var jscript = document.createElement("script");
 
416
                                jscript.setAttribute("type", "text/javascript");
 
417
                                var jscriptText = document.createTextNode("function download(){var img = document.getElementById('embedImage');var button = document.getElementById('saveImage');window.location.href = img.src.replace('image/png', 'image/octet-stream');}");
 
418
                                jscript.appendChild(jscriptText);
 
419
 
 
420
                                myWindow.document.head.appendChild(css);
 
421
                                myWindow.document.head.appendChild(jscript);
 
422
                                //myWindow.document.body.appendChild(canvas);
 
423
                                myWindow.document.body.appendChild(openerp_img);
 
424
                                myWindow.document.body.appendChild(link);
 
425
                                myWindow.document.body.appendChild(input);
 
426
                                myWindow.focus();
 
427
                                $(".sheet_logo").remove();
 
428
                            }
 
429
                        });
 
430
 
 
431
                    }
 
432
                }
 
433
 
 
434
                if (list == 1 & check==0) {
 
435
                    var x = document.getElementsByTagName('table');
 
436
                    for (i = 0; i < x.length; i++) {
 
437
                        y = x[i];
 
438
                        if (y.className == "oe_list_content") {
 
439
                        if ($(y).parents('div:hidden').length == 0) {
 
440
                                
 
441
                                }
 
442
                        else continue;
 
443
                        var logo_url =  $('a.oe_logo').children("img").attr("src");
 
444
                            html2canvas(y, {
 
445
                                onrendered: function(canvas) {
 
446
                                    myWindow = window.open('', '', 'width=950,height=680');
 
447
                                    var strDataURI = canvas.toDataURL();
 
448
 
 
449
                                    var link = document.createElement("img");
 
450
                                    link.setAttribute("src", strDataURI);
 
451
                                    link.setAttribute("id", "embedImage");
 
452
                                    var linkText = document.createTextNode("Click me");
 
453
                                    link.appendChild(linkText);
 
454
 
 
455
                                    var openerp_img = document.createElement("img");
 
456
                                    openerp_img.setAttribute("class", "open");
 
457
                                    openerp_img.setAttribute("src", logo_url);
 
458
                                    var openerp_imgText = document.createTextNode("Click me");
 
459
                                    openerp_img.appendChild(openerp_imgText);
 
460
 
 
461
                                    var css = document.createElement("style");
 
462
                                    var cssText = document.createTextNode(".css3button {margin-left:37%;margin-top:2%;font-family: Arial, Helvetica, sans-serif;font-weight:700;font-size: 14px;color: #c2c0c2;padding: 10px 20px;background: -moz-linear-gradient(top,#302e30 0%,#000000);background: -webkit-gradient(linear, left top, left bottom, from(#302e30),to(#000000));-moz-border-radius: 1px;-webkit-border-radius: 1px;border-radius: 1px;border: 1px solid #000000;-moz-box-shadow:0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);-webkit-box-shadow:0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);box-shadow:0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);text-shadow:0px -1px 0px rgba(000,000,000,1),0px 1px 0px rgba(184,180,184,0.2);}body{background-color:#252525;}img{margin-left:10%;margin-top:2%;}.open{margin-left:35%;margin-top:1%;}");
 
463
                                    css.appendChild(cssText);
 
464
 
 
465
                                    var input = document.createElement("input");
 
466
                                    var inputText = document.createTextNode("a");
 
467
                                    input.appendChild(inputText);
 
468
                                    input.setAttribute("id", "saveImage");
 
469
                                    input.setAttribute("onclick", "download()");
 
470
                                    input.setAttribute("type", "button");
 
471
                                    input.setAttribute("class", "css3button");
 
472
                                    input.setAttribute("value", "Download Png");
 
473
 
 
474
                                    var jscript = document.createElement("script");
 
475
                                    jscript.setAttribute("type", "text/javascript");
 
476
                                    var jscriptText = document.createTextNode("function download(){var img = document.getElementById('embedImage');var button = document.getElementById('saveImage');window.location.href = img.src.replace('image/png', 'image/octet-stream');}");
 
477
                                    jscript.appendChild(jscriptText);
 
478
 
 
479
                                    myWindow.document.head.appendChild(css);
 
480
                                    myWindow.document.head.appendChild(jscript);
 
481
                                    //myWindow.document.body.appendChild(canvas);
 
482
                                    myWindow.document.body.appendChild(openerp_img);
 
483
                                    myWindow.document.body.appendChild(link);
 
484
                                    myWindow.document.body.appendChild(input);
 
485
                                    myWindow.focus();
 
486
 
 
487
                                }
 
488
                            });
 
489
                        }
 
490
                    }
 
491
                }
 
492
 
 
493
            }
 
494
 
 
495
            if (d == 8) {
 
496
 
 
497
                event.preventDefault();
 
498
                var x = document.getElementsByTagName('a');
 
499
                f_list = []
 
500
                    for (i = 0; i < x.length; i++) {
 
501
                    y = x[i];
 
502
                    if (y.className == "oe_breadcrumb_item") {
 
503
                        f_list.push(y);
 
504
                    }
 
505
 
 
506
                }
 
507
                x = f_list.pop();
 
508
                if (x) {
 
509
                    x.click();
 
510
                }
 
511
            }
 
512
            if (d == 122) {
 
513
 
 
514
                event.preventDefault();
 
515
                var x = document.getElementsByTagName('div');
 
516
                f_list = []
 
517
                    for (i = 0; i < x.length; i++) {
 
518
                    y = x[i];
 
519
                    if (y.className == "fullscreen") {
 
520
                        y.click();
 
521
                        if(fullscreen_toggle.search==0)
 
522
                                {
 
523
                                $('div.oe_searchview').delay(500).animate({
 
524
                                "top": "-32px"
 
525
                            },"fast");
 
526
                                
 
527
                                }
 
528
                    }
 
529
 
 
530
                }
 
531
 
 
532
            }
 
533
 
 
534
            if (!fullscreen_toggle.fullscreen_toggle) {
 
535
                if (d == 49 | d == 50 | d == 51 | d == 52 | d == 53 | d == 54 | d == 55 | d == 56 | d == 57) {
 
536
 
 
537
                    event.preventDefault();
 
538
                    n = d - 48;
 
539
                    var x = document.getElementsByTagName('a');
 
540
                    for (i = 0; i < x.length; i++) {
 
541
                        y = x[i];
 
542
                        if (y.className == "oe_menu_toggler") {
 
543
                            if (n == i + 1) {
 
544
                                y.click();
 
545
                            }
 
546
                        }
 
547
 
 
548
                    }
 
549
                }
 
550
            }
 
551
 
 
552
            if (d == 188) {
 
553
                event.preventDefault();
 
554
                $('.oe_i[data-pager-action="previous"]').each(function() {
 
555
                    if ($(this).parents('div:hidden').length == 0) {
 
556
                        $(this).trigger('click');
 
557
                    }
 
558
                });
 
559
            }
 
560
            if (d == 190) {
 
561
                event.preventDefault();
 
562
                $('.oe_i[data-pager-action="next"]').each(function() {
 
563
                    if ($(this).parents('div:hidden').length == 0) {
 
564
                        $(this).trigger('click');
 
565
                    }
 
566
                });
 
567
            }
 
568
 
 
569
        }
 
570
 
 
571
        if (d == 192) {
 
572
            if (event.ctrlKey == 1) {
 
573
                event.preventDefault();
 
574
                $("div ul li a.oe_menu_leaf:visible:first").focus();
 
575
            }
 
576
 
 
577
        }
 
578
 
 
579
        if (d == 40) {
 
580
            for (i = 0; i < $("div ul li a.oe_menu_leaf:visible").length; i++) {
 
581
                if ($("div ul li a.oe_menu_leaf:visible:eq(" + i + ")").is(":focus")) {
 
582
                    event.preventDefault();
 
583
                    var flg = i + 1;
 
584
                    $("div ul li a.oe_menu_leaf:visible:eq(" + flg + ")").focus();
 
585
                    break;
 
586
                }
 
587
 
 
588
            }
 
589
        }
 
590
        if (d == 38) {
 
591
            var flg = 0;
 
592
            for (i = 0; i < $("div ul li a.oe_menu_leaf:visible").length; i++) {
 
593
                if ($("div ul li a.oe_menu_leaf:visible:eq(" + i + ")").is(":focus")) {
 
594
                    event.preventDefault();
 
595
                    var flg = i - 1;
 
596
                    $("div ul li a.oe_menu_leaf:visible:eq(" + flg + ")").focus();
 
597
                    break;
 
598
                }
 
599
 
 
600
            }
 
601
        }
 
602
 
 
603
        if (event.ctrlKey != 1) {
 
604
            if (d == 27) {
 
605
                event.preventDefault();
 
606
                var x = document.getElementsByTagName('div');
 
607
                f_list = []
 
608
                    for (i = 0; i < x.length; i++) {
 
609
                    y = x[i];
 
610
                    if (y.className == "fullscreentrue") {
 
611
                        y.click();
 
612
                        if(fullscreen_toggle.search==0)
 
613
                        {
 
614
                                $('div.oe_searchview').delay(500).animate({
 
615
                                "top": "0px"
 
616
                            },"fast");
 
617
                        
 
618
                        }
 
619
                    }
 
620
 
 
621
                }
 
622
 
 
623
            }
 
624
        }
 
625
 
 
626
    });
 
627
});