1
0
mirror of https://github.com/serghey-rodin/vesta.git synced 2025-03-12 04:36:25 -07:00

FileManager. Updated rights with numeric field

This commit is contained in:
Dmitry Naumov-Socolov 2016-10-17 10:45:45 -04:00
parent 20acf12a54
commit 45d5e885a4
3 changed files with 58 additions and 39 deletions

@ -270,8 +270,11 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
.confirm-box .controls .keep-original:hover { color: #FFCC00; }
.confirm-box .controls .keep-original:active { color: #6DB8D3; }
.confirm-box .chmod-mask,
.confirm-box .new-title { background-color: #292929; border: 1px solid #111; color: #eee; font-family: Arial; font-size: 16px; margin-bottom: 73px; margin-left: 27px; padding: 10px 14px; width: 396px; }
.confirm-box .chmod-mask:focus,
.confirm-box .new-title:focus { border: 1px solid #FFCC00; box-shadow: 0 0 5px 0 rgba(255, 204, 0 , 0.3); }
.confirm-box .chmod-mask { width: 28px; margin: -12px 0 42px 57px; }
.confirm-box.rename .message { margin-bottom: 36px; }
.confirm-box.rename .controls.replace { display: none; }

@ -1525,25 +1525,8 @@ FM.confirmChmod = function() {
var src = selected.find('.source').val();
src = $.parseJSON(src);
var ro = $('input[name="read-by-owner"]').is(':checked') ? 4 : 0;
var wo = $('input[name="write-by-owner"]').is(':checked') ? 2 : 0;
var eo = $('input[name="execute-by-owner"]').is(':checked') ? 1 : 0;
var rg = $('input[name="read-by-group"]').is(':checked') ? 4 : 0;
var wg = $('input[name="write-by-group"]').is(':checked') ? 2 : 0;
var eg = $('input[name="execute-by-group"]').is(':checked') ? 1 : 0;
var re = $('input[name="read-by-others"]').is(':checked') ? 4 : 0;
var we = $('input[name="write-by-others"]').is(':checked') ? 2 : 0;
var ee = $('input[name="execute-by-others"]').is(':checked') ? 1 : 0;
var o = ro+wo+eo;
var g = rg+wg+eg;
var e = re+we+ee;
var permissions = o + "" + g + "" + e + "";
var action = FM.isItemFile(src) ? 'chmod_item' : 'chmod_item';
var permissions = $('.chmod input.chmod-mask').val();
var action = 'chmod_item';
var params = {
dir: FM['TAB_' + tab + '_CURRENT_PATH'] + '/',
@ -1583,24 +1566,7 @@ FM.confirmBulkChmod = function() {
}
});
var ro = $('input[name="read-by-owner"]').is(':checked') ? 4 : 0;
var wo = $('input[name="write-by-owner"]').is(':checked') ? 2 : 0;
var eo = $('input[name="execute-by-owner"]').is(':checked') ? 1 : 0;
var rg = $('input[name="read-by-group"]').is(':checked') ? 4 : 0;
var wg = $('input[name="write-by-group"]').is(':checked') ? 2 : 0;
var eg = $('input[name="execute-by-group"]').is(':checked') ? 1 : 0;
var re = $('input[name="read-by-others"]').is(':checked') ? 4 : 0;
var we = $('input[name="write-by-others"]').is(':checked') ? 2 : 0;
var ee = $('input[name="execute-by-others"]').is(':checked') ? 1 : 0;
var o = ro+wo+eo;
var g = rg+wg+eg;
var e = re+we+ee;
var permissions = o + "" + g + "" + e + "";
var permissions = $('.chmod input.chmod-mask').val();
var action = 'chmod_item';
var tab = FM.getTabLetter(FM.CURRENT_TAB);
@ -1693,6 +1659,29 @@ FM.chmodItems = function() {
tpl.set(':EXECUTE_BY_OTHERS', mode[2] & 1 ? "checked" : "");
FM.popupOpen(tpl.finalize());
$('.chmod input.chmod-mask').val(mode);
$('.chmod input[type=checkbox]').click(function(){
var ro = $('input[name="read-by-owner"]').is(':checked') ? 4 : 0;
var wo = $('input[name="write-by-owner"]').is(':checked') ? 2 : 0;
var eo = $('input[name="execute-by-owner"]').is(':checked') ? 1 : 0;
var rg = $('input[name="read-by-group"]').is(':checked') ? 4 : 0;
var wg = $('input[name="write-by-group"]').is(':checked') ? 2 : 0;
var eg = $('input[name="execute-by-group"]').is(':checked') ? 1 : 0;
var re = $('input[name="read-by-others"]').is(':checked') ? 4 : 0;
var we = $('input[name="write-by-others"]').is(':checked') ? 2 : 0;
var ee = $('input[name="execute-by-others"]').is(':checked') ? 1 : 0;
var o = ro+wo+eo;
var g = rg+wg+eg;
var e = re+we+ee;
var permissions = o + "" + g + "" + e + "";
$('.chmod input.chmod-mask').val(permissions);
});
}
FM.bulkChmod = function() {
@ -1728,6 +1717,28 @@ FM.bulkChmod = function() {
//popup_bulk_copy
FM.popupOpen(tpl.finalize());
$('.chmod input[type=checkbox]').click(function(){
var ro = $('input[name="read-by-owner"]').is(':checked') ? 4 : 0;
var wo = $('input[name="write-by-owner"]').is(':checked') ? 2 : 0;
var eo = $('input[name="execute-by-owner"]').is(':checked') ? 1 : 0;
var rg = $('input[name="read-by-group"]').is(':checked') ? 4 : 0;
var wg = $('input[name="write-by-group"]').is(':checked') ? 2 : 0;
var eg = $('input[name="execute-by-group"]').is(':checked') ? 1 : 0;
var re = $('input[name="read-by-others"]').is(':checked') ? 4 : 0;
var we = $('input[name="write-by-others"]').is(':checked') ? 2 : 0;
var ee = $('input[name="execute-by-others"]').is(':checked') ? 1 : 0;
var o = ro+wo+eo;
var g = rg+wg+eg;
var e = re+we+ee;
var permissions = o + "" + g + "" + e + "";
$('.chmod input.chmod-mask').val(permissions);
});
}
}
@ -2448,10 +2459,10 @@ $(document).ready(function() {
}
var tab = FM.getTabLetter(FM.CURRENT_TAB);
var elm = $(FM.CURRENT_TAB).find('.dir:eq('+FM['CURRENT_'+tab+'_LINE']+')');
if (elm.length == 1) {
var src = $.parseJSON($(elm).find('.source').val());
if (src.type == 'd') {
FM.open(src.full_path, FM.CURRENT_TAB);
}
@ -2647,6 +2658,9 @@ $(document).ready(function() {
$('.shortcuts').hide();
});
});
/*$(document).bind('keydown.tab', function() {

@ -143,6 +143,7 @@ App.Templates.html = {
<li><label><input type="checkbox" name="write-by-others" value="1" ~!:WRITE_BY_OTHERS~! /> '+App.Constants.FM_WRITE_BY_OTHERS+'</label></li>\
<li><label><input type="checkbox" name="execute-by-others" value="1" ~!:EXECUTE_BY_OTHERS~! /> '+App.Constants.FM_EXECUTE_BY_OTHERS+'</label></li>\
</ul>\
<input type="text" name="mask" class="chmod-mask" maxlength="3" />\
</div>\
<div class="controls">\
<p class="cancel" onClick="FM.popupClose();">'+App.Constants.FM_CANCEL+'</p>\
@ -166,6 +167,7 @@ App.Templates.html = {
<li><label><input type="checkbox" name="write-by-others" value="1" checked /> '+App.Constants.FM_WRITE_BY_OTHERS+'</label></li>\
<li><label><input type="checkbox" name="execute-by-others" value="1" checked /> '+App.Constants.FM_EXECUTE_BY_OTHERS+'</label></li>\
</ul>\
<input type="text" name="mask" class="chmod-mask" maxlength="3" value="777" />\
</div>\
<div class="controls">\
<p class="cancel" onClick="FM.popupClose();">'+App.Constants.FM_CANCEL+'</p>\