Skip to content

Commit

Permalink
Merge pull request Studio-42#804 from nao-pon/lock_marker
Browse files Browse the repository at this point in the history
add lock marker into locked items on tree & cwd
  • Loading branch information
nao-pon committed Mar 11, 2014
2 parents f41d4ca + 0a217c4 commit a0c7c15
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
}

/* dir/file permissions and symlink markers */
.elfinder-lock,
.elfinder-perms,
.elfinder-symlink {
position:absolute;
Expand All @@ -37,6 +38,11 @@
/* write only */
.elfinder-wo .elfinder-perms { background-position:0 -80px;}

/* locked */
.elfinder-lock {
background-position:0 -656px;
}

/* drag helper */
.elfinder-drag-helper {
width:60px;
Expand Down
3 changes: 3 additions & 0 deletions css/cwd.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@

/* permissions/symlink markers */
.elfinder-cwd-view-icons .elfinder-perms { bottom:4px; right:2px; }
.elfinder-cwd-view-icons .elfinder-lock { top:-3px; right:-2px; }
.elfinder-cwd-view-icons .elfinder-symlink { bottom:6px; left:0px; }

/* icon/thumbnail */
Expand Down Expand Up @@ -216,9 +217,11 @@

/* premissions/symlink marker */
.elfinder-cwd-view-list .elfinder-perms,
.elfinder-cwd-view-list .elfinder-lock,
.elfinder-cwd-view-list .elfinder-symlink { top:50%; margin-top:-6px; }
/* markers in ltr/rtl enviroment */
.elfinder-ltr .elfinder-cwd-view-list .elfinder-perms { left:7px; }
.elfinder-ltr .elfinder-cwd-view-list .elfinder-lock { left:9px; top:0px; }
.elfinder-ltr .elfinder-cwd-view-list .elfinder-symlink { left:-7px; }

/* file icon */
Expand Down
5 changes: 5 additions & 0 deletions css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,14 @@
/* permissions marker */
.elfinder-navbar .elfinder-perms { top:50%; margin-top:-8px; }

/* locked marker */
.elfinder-navbar .elfinder-lock { top:-2px; }

/* permissions/symlink markers ltr/rtl enviroment */
.elfinder-ltr .elfinder-navbar .elfinder-perms { left: 18px; }
.elfinder-rtl .elfinder-navbar .elfinder-perms { right: 18px; }
.elfinder-ltr .elfinder-navbar .elfinder-lock { left: 18px; }
.elfinder-rtl .elfinder-navbar .elfinder-lock { right: 18px; }
.elfinder-ltr .elfinder-navbar .elfinder-symlink { left: 8px; }
.elfinder-rtl .elfinder-navbar .elfinder-symlink { right: 8px; }

Expand Down
Binary file modified img/toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions js/elFinder.resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ elFinder.prototype.resources = {
},
tpl : {
perms : '<span class="elfinder-perms"/>',
lock : '<span class="elfinder-lock"/>',
symlink : '<span class="elfinder-symlink"/>',
navicon : '<span class="elfinder-nav-icon"/>',
navspinner : '<span class="elfinder-navbar-spinner"/>',
Expand Down
4 changes: 3 additions & 1 deletion js/ui/cwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ $.fn.elfindercwd = function(fm, options) {

permsTpl = fm.res('tpl', 'perms'),

lockTpl = fm.res('tpl', 'lock'),

symlinkTpl = fm.res('tpl', 'symlink'),

/**
Expand Down Expand Up @@ -163,7 +165,7 @@ $.fn.elfindercwd = function(fm, options) {
return fm.mime2kind(f);
},
marker : function(f) {
return (f.alias || f.mime == 'symlink-broken' ? symlinkTpl : '')+(!f.read || !f.write ? permsTpl : '');
return (f.alias || f.mime == 'symlink-broken' ? symlinkTpl : '')+(!f.read || !f.write ? permsTpl : '')+(f.locked ? lockTpl : '');
},
tooltip : function(f) {
var title = fm.formatDate(f) + (f.size > 0 ? ' ('+fm.formatSize(f.size)+')' : '');
Expand Down
9 changes: 8 additions & 1 deletion js/ui/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ $.fn.elfindertree = function(fm, opts) {
*/
ptpl = fm.res('tpl', 'perms'),

/**
* Lock marker html template
*
* @type String
*/
ltpl = fm.res('tpl', 'lock'),

/**
* Symlink marker html template
*
Expand All @@ -174,7 +181,7 @@ $.fn.elfindertree = function(fm, opts) {
replace = {
id : function(dir) { return fm.navHash2Id(dir.hash) },
cssclass : function(dir) { return (dir.phash ? '' : root)+' '+navdir+' '+fm.perms2class(dir)+' '+(dir.dirs && !dir.link ? collapsed : ''); },
permissions : function(dir) { return !dir.read || !dir.write ? ptpl : ''; },
permissions : function(dir) { return (!dir.read || !dir.write ? ptpl : '')+(dir.phash && dir.locked? ltpl : ''); },
symlink : function(dir) { return dir.alias ? stpl : ''; }
},

Expand Down

0 comments on commit a0c7c15

Please sign in to comment.