Fixes for FM

This commit is contained in:
Serghey Rodin 2015-10-28 16:39:39 +02:00
commit 5d070fc9a5
13 changed files with 274 additions and 1489 deletions

View file

@ -86,11 +86,11 @@
<li><span class="key">n</span><?=__('New File')?></li>
<li><span class="key">F7</span><?=__('New Folder')?></li>
<li><span class="key">d</span><?=__('Download')?></li>
<li><span class="key">F2 / &lt;Shift&gt;+F6</span><?=__('Rename')?></li>
<li><span class="key">F2 / Shift+F6</span><?=__('Rename')?></li>
<li><span class="key">F5</span><?=__('Copy')?></li>
<li><span class="key">a</span><?=__('Archive')?></li>
<li><span class="key">F8 / Del</span><?=__('Delete')?></li>
<li class="step-top"><span class="key">&lt;Ctrl&gt; + s</span><?=__('Save File (in text editor)')?></li>
<li class="step-top"><span class="key">Ctrl + s</span><?=__('Save File (in text editor)')?></li>
<li class="step-top"><span class="key">h</span><?=__('Display/Close shortcuts')?></li>
<li class="step-top"><span class="key">Esc</span><?=__('Close Popup / Cancel')?></li>
</ul>
@ -99,15 +99,15 @@
<li><span class="key bigger">&darr;</span><?=__('Move Cursor Down')?></li>
<li><span class="key bigger">&larr;</span><?=__('Switch to Left Tab')?></li>
<li><span class="key bigger">&rarr;</span><?=__('Switch to Right Tab')?></li>
<li><span class="key">&lt;Tab&gt;</span><?=__('Switch Tab')?></li>
<li><span class="key">&lt;Home&gt;</span><?=__('Go to the Top of the File List')?></li>
<li><span class="key">&lt;End&gt;</span><?=__('Go to the Last File')?></li>
<li class="step-top"><span class="key">&lt;Enter&gt;</span><?=__('Open File / Enter Directory')?></li>
<li><span class="key">&lt;Backspace&gt;</span><?=__('Go to Parent Directory')?></li>
<li class="step-top"><span class="key">&lt;Insert&gt; / &lt;Space&gt;</span><?=__('Select Current File')?></li>
<li><span class="key">&lt;Shift&gt; + click</span><?=__('Select Bunch of Files')?></li>
<li><span class="key">&lt;Ctrl&gt; + click</span><?=__('Add File to the Current Selection')?></li>
<li><span class="key">&lt;Ctrl&gt; + a</span><?=__('Select All Files')?></li>
<li><span class="key">Tab</span><?=__('Switch Tab')?></li>
<li><span class="key">Home</span><?=__('Go to the Top of the File List')?></li>
<li><span class="key">End</span><?=__('Go to the Last File')?></li>
<li class="step-top"><span class="key">Enter</span><?=__('Open File / Enter Directory')?></li>
<li><span class="key">Backspace</span><?=__('Go to Parent Directory')?></li>
<li class="step-top"><span class="key">Insert / Space</span><?=__('Select Current File')?></li>
<li><span class="key">Shift + click</span><?=__('Select Bunch of Files')?></li>
<li><span class="key">Ctrl + click</span><?=__('Add File to the Current Selection')?></li>
<li><span class="key">Ctrl + a</span><?=__('Select All Files')?></li>
</ul>
<ul class="note"><?=__('shortcuts are inspired by magnificent GNU <a href="https://www.midnight-commander.org/">Midnight Commander</a> file manager')?></ul>
</div>

View file

@ -177,19 +177,26 @@
}
);
shortcut.add("a", function(evt){
if (!evt.ctrlKey && !evt.shiftKey) {
if ($('.l-sort__create-btn')[0]) {
location.href=$('.l-sort__create-btn').attr('href');
$(window).bind('keypress', function(evt) {
if (evt.charCode == 97) {
evt.preventDefault();
if (!evt.ctrlKey && !evt.shiftKey) {
if ($('.l-sort__create-btn')[0]) {
location.href=$('.l-sort__create-btn').attr('href');
}
}
}
}, {
'type': 'keyup',
'propagate': false,
'disable_in_input': true,
'target': document
}
);
else {
if ($('.l-unit .ch-toggle:eq(0)').attr('checked')) {
$('.l-unit').removeClass('selected');
$('.l-unit .ch-toggle').attr('checked', false);
}
else {
$('.l-unit').addClass('selected');
$('.l-unit .ch-toggle').attr('checked', true);
}
}
}
});
shortcut.add("n", function(evt){
if (!evt.ctrlKey && !evt.shiftKey) {
@ -205,29 +212,6 @@
}
);
shortcut.add("Ctrl+m", function(evt){
console.log('ctrl+m');
}, {
'type': 'keyup',
'propagate': false,
'disable_in_input': true,
'target': document
}
);
shortcut.add("m", function(evt){
console.log('m');
}, {
'type': 'keyup',
'propagate': false,
'disable_in_input': true,
'target': document
}
);
shortcut.add("a+1", function(){
location.href='/add/user/';
}, {
@ -238,9 +222,6 @@
}
);
shortcut.add("1", function(){
if(VE.tmp.form_changed){
VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(1) a').attr('href'));
@ -393,17 +374,6 @@
}
);
shortcut.add("Alt", function(){
VE.navigation.switch_menu();
}, {
'type': 'keydown',
'propagate': false,
'disable_in_input': false,
'target': document
}
);
$('.shortcuts .close').click(function(){
$('.shortcuts').hide();
});
@ -412,13 +382,21 @@
$('.shortcuts').toggle();
});
$('.l-profile__notifications').click(function(){
$('.notification-container').toggle();
$('.l-profile__notifications').toggleClass('active');
left = $('.l-profile__notifications').offset().left - $('.notification-container').outerWidth() + 28;
$('.notification-container').css({left: left+'px'});
});
VE.navigation.init();
VE.core.register();
if (location.href.search(/list/) != -1) {
var shift_select_ref = $('body').finderSelect({
children: '.l-unit',
children: '.l-unit',
'onFinish': function(evt) {
var ref = $(evt.target);
$('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
@ -462,7 +440,7 @@
</div>
<ul>
<li><span class="key">n</span><?=__('Add New object')?></li>
<li><span class="key">&lt;Ctrl&gt; + Enter</span><?=__('Save Form')?></li>
<li><span class="key">Ctrl + Enter</span><?=__('Save Form')?></li>
<li><span class="key">Backspace</span><?=__('Cancel saving form')?></li>
<li class="step-top"><span class="key">1</span><?=__('Go to USER list')?></li>
@ -479,8 +457,7 @@
<li class="step-top"><span class="key bigger">&larr;</span><?=__('Move backward through top menu')?></li>
<li><span class="key bigger">&rarr;</span><?=__('Move forward through top menu')?></li>
<li><span class="key">&lt;Alt&gt;</span><?=__('Switch active menu')?></li>
<li><span class="key">&lt;Enter&gt;</span><?=__('Enter focused element')?></li>
<li><span class="key">Enter</span><?=__('Enter focused element')?></li>
</ul>
</div>