
@@ -222,7 +222,7 @@
{% endif %}
{# if this dir is the toplevel of the cwd, show the folder icon #}
{% if dirname| TopLevelFolderOf(cwd) %}
-
+
{{obj.name}}
@@ -404,19 +404,25 @@ function DoSel(e, el)
}
if( e.shiftKey )
{
- st=Number($('.highlight').first().attr('img'))
- end=Number($('.highlight').last().attr('img'))
- clicked=Number($(el).attr('img'))
+ st=Number($('.highlight').first().attr('ecnt'))
+ end=Number($('.highlight').last().attr('ecnt'))
+ clicked=Number($(el).attr('ecnt'))
+ if( ! folders )
+ {
+ st -= 1
+ end -= 1
+ clicked -= 1
+ }
// if we shift-click first element, then st/end are NaN, so just highlightthe one clicked
if( isNaN(st) )
{
- $('.figure').slice( clicked, clicked+1 ).addClass('highlight')
+ $('.entry').slice( clicked, clicked+1 ).addClass('highlight')
return
}
if( clicked > end )
- $('.figure').slice( end, clicked+1 ).addClass('highlight')
+ $('.entry').slice( end, clicked+1 ).addClass('highlight')
else
- $('.figure').slice( clicked, st ).addClass('highlight')
+ $('.entry').slice( clicked, st ).addClass('highlight')
return
}
$('.highlight').removeClass('highlight')
@@ -435,6 +441,24 @@ function SetButtonState() {
}
}
+function FiguresOrDirsOrBoth() {
+ var figure=false
+ var dir=false
+ $('.highlight').each(function( index ) {
+ if( $(this).hasClass('figure') ) {
+ figure=true
+ }
+ if( $(this).hasClass('dir') ) {
+ dir=true
+ }
+ } )
+ if( figure & ! dir )
+ return "figure"
+ if( ! figure & dir )
+ return "dir"
+ return "both"
+}
+
function SelContainsBinAndNotBin() {
var bin=false
var not_bin=false
@@ -465,45 +489,25 @@ $('.figure').click( function(e) { DoSel(e, this ); SetButtonState(); return fals
$(document).on('click', function(e) { $('.highlight').removeClass('highlight') ; SetButtonState() });
-// different context menu on directory
-$.contextMenu({
- selector: '.dir',
- build: function($triggerElement, e){
- if( NoSel() )
- DoSel(e, e.currentTarget )
- item_list = {
- ai: {
- name: "Scan file for faces",
- items: {
- {% for p in people %}
- "ai-{{p.tag}}": {"name": "{{p.tag}}"},
- {% endfor %}
- "ai-all": {"name": "all"},
- }
- }
- }
- return {
- callback: function( key, options) {
- if( key.startsWith("ai")) { RunAIOnSeln(key) }
- },
- items: item_list
- };
- }
-});
-
// different context menu on files
$.contextMenu({
- selector: '.figure',
+ selector: '.entry',
build: function($triggerElement, e){
- if( NoSel() )
+ // when right-clicking & no selection add one OR deal with ctrl/shift right-lick as it always changes seln
+ if( NoSel() || e.ctrlKey || e.shiftKey )
DoSel(e, e.currentTarget )
- item_list = {
- details: { name: "Details..." },
- view: { name: "View File" },
- sep: "---",
- move: { name: "Move selected file(s) to new storage folder" },
- sep2: "---",
- ai: {
+
+ if( FiguresOrDirsOrBoth() == "figure" )
+ item_list = {
+ details: { name: "Details..." },
+ view: { name: "View File" },
+ sep: "---",
+ move: { name: "Move selected file(s) to new storage folder" },
+ sep2: "---" }
+ else
+ item_list = {}
+
+ item_list['ai'] = {
name: "Scan file for faces",
items: {
{% for p in people %}
@@ -512,7 +516,7 @@ $.contextMenu({
"ai-all": {"name": "all"},
}
}
- }
+
if( SelContainsBinAndNotBin() ) {
item_list['both']= { name: 'Cannot delete and restore at same time', disabled: true }
} else {