Skip to content

Commit 828d0ed

Browse files
committed
new header and footer
1 parent b55b174 commit 828d0ed

File tree

2 files changed

+18
-132
lines changed

2 files changed

+18
-132
lines changed

web/templates/footer.html

Lines changed: 17 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@
141141

142142
// Shortcuts
143143

144-
shortcut.add("Ctrl+Enter", function(){
144+
shortcut.add("Ctrl+Enter", function(){
145+
145146
$('form#vstobjects').submit();
146147
}, {
147148
'type': 'keydown',
@@ -151,10 +152,10 @@
151152
}
152153
);
153154

154-
// shortcut.add("Ctrl+Backspace", function(){
155155
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]){
158159
location.href=$('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'","");
159160
}
160161
}, {
@@ -338,120 +339,6 @@
338339
}
339340
);
340341

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-
455342
shortcut.add("h", function(){
456343
$('.shortcuts').toggle();
457344
}, {
@@ -493,7 +380,11 @@
493380
);
494381

495382
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+
}
497388
}, {
498389
'type': 'keydown',
499390
'propagate': false,
@@ -502,12 +393,12 @@
502393
}
503394
);
504395

505-
shortcut.add("Tab", function(){
396+
shortcut.add("Alt", function(){
506397
VE.navigation.switch_menu();
507398
}, {
508399
'type': 'keydown',
509400
'propagate': false,
510-
'disable_in_input': true,
401+
'disable_in_input': false,
511402
'target': document
512403
}
513404
);
@@ -572,7 +463,7 @@
572463
<ul>
573464
<li><span class="key">n</span><?=__('Add New object')?></li>
574465
<li><span class="key">&lt;Ctrl&gt; + Enter</span><?=__('Save Form')?></li>
575-
<li><span class="key">&lt;Ctrl&gt; + Backspace</span><?=__('Cancel saving form')?></li>
466+
<li><span class="key">Backspace</span><?=__('Cancel saving form')?></li>
576467

577468
<li class="step-top"><span class="key">1</span><?=__('Go to USER list')?></li>
578469
<li><span class="key">2</span><?=__('Go to WEB list')?></li>
@@ -586,15 +477,10 @@
586477
<li><span class="key">f</span><?=__('Focus on search')?></li>
587478
<li class="step-top"><span class="key">h</span><?=__('Display/Close shortcuts')?></li>
588479

589-
<li class="step-top"><span class="key">&lt;Ctrl&gt; + 1</span><?=__('Go to Packages')?></li>
590-
<li><span class="key">&lt;Ctrl&gt; + 2</span><?=__('Go to IP')?></li>
591-
<li><span class="key">&lt;Ctrl&gt; + 3</span><?=__('Go to Graphs')?></li>
592-
<li><span class="key">&lt;Ctrl&gt; + 4</span><?=__('Go to Statistics')?></li>
593-
<li><span class="key">&lt;Ctrl&gt; + 5</span><?=__('Go to Log')?></li>
594-
<li><span class="key">&lt;Ctrl&gt; + 6</span><?=__('Go to Updates')?></li>
595-
<li><span class="key">&lt;Ctrl&gt; + 7</span><?=__('Go to Firewall')?></li>
596-
<li><span class="key">&lt;Ctrl&gt; + 8</span><?=__('Go to File Manager')?></li>
597-
<li><span class="key">&lt;Ctrl&gt; + 9</span><?=__('Go to Server')?></li>
480+
<li class="step-top"><span class="key bigger">&larr;</span><?=__('Move backward through top menu')?></li>
481+
<li><span class="key bigger">&rarr;</span><?=__('Move forward through top menu')?></li>
482+
<li><span class="key">&lt;Alt&gt;</span><?=__('Switch active menu')?></li>
483+
<li><span class="key">&lt;Enter&gt;</span><?=__('Enter focused element')?></li>
598484
</ul>
599485

600486
</div>

web/templates/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@
5959
</script>
6060
<script type="text/javascript" src="/js/app.js"></script>
6161
<script type="text/javascript" src="/js/templates.js"></script>
62-
<script type="text/javascript" src="/js/i18n.js.php"></script>
62+
<!-- script type="text/javascript" src="/js/i18n.js.php"></script -->
6363
</head>
6464
<body class="body-<?=strtolower($TAB)?> lang-<?=$_SESSION['language']?>">

0 commit comments

Comments
 (0)