|
141 | 141 |
|
142 | 142 | // Shortcuts |
143 | 143 |
|
144 | | - shortcut.add("Ctrl+Enter", function(){ |
| 144 | + shortcut.add("Ctrl+Enter", function(){ |
| 145 | + |
145 | 146 | $('form#vstobjects').submit(); |
146 | 147 | }, { |
147 | 148 | 'type': 'keydown', |
|
151 | 152 | } |
152 | 153 | ); |
153 | 154 |
|
154 | | -// shortcut.add("Ctrl+Backspace", function(){ |
155 | 155 | shortcut.add("Backspace", function(){ |
156 | | - console.log("read"); |
157 | | - if($('form#vstobjects .button.cancel')[0]){ |
| 156 | + if(VE.tmp.form_changed && $('form#vstobjects .button.cancel')[0]){ |
| 157 | + VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'","")); |
| 158 | + } else if($('form#vstobjects .button.cancel')[0]){ |
158 | 159 | location.href=$('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'",""); |
159 | 160 | } |
160 | 161 | }, { |
|
338 | 339 | } |
339 | 340 | ); |
340 | 341 |
|
341 | | - |
342 | | - shortcut.add("Ctrl+1", function(){ |
343 | | - if(VE.tmp.form_changed){ |
344 | | - VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(1) a').attr('href')); |
345 | | - } else { |
346 | | - location.href=$('.l-menu .l-menu__item:nth-of-type(1) a').attr('href'); |
347 | | - } |
348 | | - }, { |
349 | | - 'type': 'keydown', |
350 | | - 'propagate': false, |
351 | | - 'disable_in_input': true, |
352 | | - 'target': document |
353 | | - } |
354 | | - ); |
355 | | - |
356 | | - shortcut.add("Ctrl+2", function(){ |
357 | | - if(VE.tmp.form_changed){ |
358 | | - VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(2) a').attr('href')); |
359 | | - } else { |
360 | | - location.href=$('.l-menu .l-menu__item:nth-of-type(2) a').attr('href'); |
361 | | - } |
362 | | - }, { |
363 | | - 'type': 'keydown', |
364 | | - 'propagate': false, |
365 | | - 'disable_in_input': true, |
366 | | - 'target': document |
367 | | - } |
368 | | - ); |
369 | | - |
370 | | - shortcut.add("Ctrl+3", function(){ |
371 | | - if(VE.tmp.form_changed){ |
372 | | - VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(3) a').attr('href')); |
373 | | - } else { |
374 | | - location.href=$('.l-menu .l-menu__item:nth-of-type(3) a').attr('href'); |
375 | | - } |
376 | | - }, { |
377 | | - 'type': 'keydown', |
378 | | - 'propagate': false, |
379 | | - 'disable_in_input': true, |
380 | | - 'target': document |
381 | | - } |
382 | | - ); |
383 | | - |
384 | | - shortcut.add("Ctrl+4", function(){ |
385 | | - if(VE.tmp.form_changed){ |
386 | | - VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(4) a').attr('href')); |
387 | | - } else { |
388 | | - location.href=$('.l-menu .l-menu__item:nth-of-type(4) a').attr('href'); |
389 | | - } |
390 | | - }, { |
391 | | - 'type': 'keydown', |
392 | | - 'propagate': false, |
393 | | - 'disable_in_input': true, |
394 | | - 'target': document |
395 | | - } |
396 | | - ); |
397 | | - |
398 | | - shortcut.add("Ctrl+5", function(){ |
399 | | - if(VE.tmp.form_changed){ |
400 | | - VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(5) a').attr('href')); |
401 | | - } else { |
402 | | - location.href=$('.l-menu .l-menu__item:nth-of-type(5) a').attr('href'); |
403 | | - } |
404 | | - }, { |
405 | | - 'type': 'keydown', |
406 | | - 'propagate': false, |
407 | | - 'disable_in_input': true, |
408 | | - 'target': document |
409 | | - } |
410 | | - ); |
411 | | - |
412 | | - shortcut.add("Ctrl+6", function(){ |
413 | | - if(VE.tmp.form_changed){ |
414 | | - VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(6) a').attr('href')); |
415 | | - } else { |
416 | | - location.href=$('.l-menu .l-menu__item:nth-of-type(6) a').attr('href'); |
417 | | - } |
418 | | - }, { |
419 | | - 'type': 'keydown', |
420 | | - 'propagate': false, |
421 | | - 'disable_in_input': true, |
422 | | - 'target': document |
423 | | - } |
424 | | - ); |
425 | | - |
426 | | - shortcut.add("Ctrl+7", function(){ |
427 | | - if(VE.tmp.form_changed){ |
428 | | - VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(7) a').attr('href')); |
429 | | - } else { |
430 | | - location.href=$('.l-menu .l-menu__item:nth-of-type(7) a').attr('href'); |
431 | | - } |
432 | | - }, { |
433 | | - 'type': 'keydown', |
434 | | - 'propagate': false, |
435 | | - 'disable_in_input': true, |
436 | | - 'target': document |
437 | | - } |
438 | | - ); |
439 | | - |
440 | | - shortcut.add("Ctrl+8", function(){ |
441 | | - if(VE.tmp.form_changed){ |
442 | | - VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(8) a').attr('href')); |
443 | | - } else { |
444 | | - location.href=$('.l-menu .l-menu__item:nth-of-type(8) a').attr('href'); |
445 | | - } |
446 | | - }, { |
447 | | - 'type': 'keydown', |
448 | | - 'propagate': false, |
449 | | - 'disable_in_input': true, |
450 | | - 'target': document |
451 | | - } |
452 | | - ); |
453 | | - |
454 | | - |
455 | 342 | shortcut.add("h", function(){ |
456 | 343 | $('.shortcuts').toggle(); |
457 | 344 | }, { |
|
493 | 380 | ); |
494 | 381 |
|
495 | 382 | shortcut.add("Enter", function(){ |
496 | | - VE.navigation.enter_focused(); |
| 383 | + if(VE.tmp.form_changed){ |
| 384 | + VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $(VE.navigation.state.menu_selector + '.focus a').attr('href')); |
| 385 | + } else { |
| 386 | + VE.navigation.enter_focused(); |
| 387 | + } |
497 | 388 | }, { |
498 | 389 | 'type': 'keydown', |
499 | 390 | 'propagate': false, |
|
502 | 393 | } |
503 | 394 | ); |
504 | 395 |
|
505 | | - shortcut.add("Tab", function(){ |
| 396 | + shortcut.add("Alt", function(){ |
506 | 397 | VE.navigation.switch_menu(); |
507 | 398 | }, { |
508 | 399 | 'type': 'keydown', |
509 | 400 | 'propagate': false, |
510 | | - 'disable_in_input': true, |
| 401 | + 'disable_in_input': false, |
511 | 402 | 'target': document |
512 | 403 | } |
513 | 404 | ); |
|
572 | 463 | <ul> |
573 | 464 | <li><span class="key">n</span><?=__('Add New object')?></li> |
574 | 465 | <li><span class="key"><Ctrl> + Enter</span><?=__('Save Form')?></li> |
575 | | - <li><span class="key"><Ctrl> + Backspace</span><?=__('Cancel saving form')?></li> |
| 466 | + <li><span class="key">Backspace</span><?=__('Cancel saving form')?></li> |
576 | 467 |
|
577 | 468 | <li class="step-top"><span class="key">1</span><?=__('Go to USER list')?></li> |
578 | 469 | <li><span class="key">2</span><?=__('Go to WEB list')?></li> |
|
586 | 477 | <li><span class="key">f</span><?=__('Focus on search')?></li> |
587 | 478 | <li class="step-top"><span class="key">h</span><?=__('Display/Close shortcuts')?></li> |
588 | 479 |
|
589 | | - <li class="step-top"><span class="key"><Ctrl> + 1</span><?=__('Go to Packages')?></li> |
590 | | - <li><span class="key"><Ctrl> + 2</span><?=__('Go to IP')?></li> |
591 | | - <li><span class="key"><Ctrl> + 3</span><?=__('Go to Graphs')?></li> |
592 | | - <li><span class="key"><Ctrl> + 4</span><?=__('Go to Statistics')?></li> |
593 | | - <li><span class="key"><Ctrl> + 5</span><?=__('Go to Log')?></li> |
594 | | - <li><span class="key"><Ctrl> + 6</span><?=__('Go to Updates')?></li> |
595 | | - <li><span class="key"><Ctrl> + 7</span><?=__('Go to Firewall')?></li> |
596 | | - <li><span class="key"><Ctrl> + 8</span><?=__('Go to File Manager')?></li> |
597 | | - <li><span class="key"><Ctrl> + 9</span><?=__('Go to Server')?></li> |
| 480 | + <li class="step-top"><span class="key bigger">←</span><?=__('Move backward through top menu')?></li> |
| 481 | + <li><span class="key bigger">→</span><?=__('Move forward through top menu')?></li> |
| 482 | + <li><span class="key"><Alt></span><?=__('Switch active menu')?></li> |
| 483 | + <li><span class="key"><Enter></span><?=__('Enter focused element')?></li> |
598 | 484 | </ul> |
599 | 485 |
|
600 | 486 | </div> |
|
0 commit comments