Dateiverwaltung für die WebBox
ulrich
2017-02-25 723bf71779b1a272e85fc477207ae31648837981
web/ui/ui.js
@@ -1,3 +1,21 @@
/*
    Dateiverwaltung - File management in your browser
    Copyright (C) 2017 Ulrich Hilger, http://uhilger.de
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.
    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
var cm;
var pfad = '';
var modus = 'kacheln';
@@ -113,8 +131,9 @@
  fm_get_list(pfad);
}
function fm_dateiwahl() {
function fm_dateiwahl(ev) {
  var elem = this;
  //console.log('dateiwahl nach click, event shift: ' + ev.shiftKey + ", event ctrl: " + ev.ctrlKey);
  if(modus == 'kacheln') {
    if($(elem).children(0).hasClass('fa-folder')) {
      var ordner = $(elem).text().trim();
@@ -125,14 +144,22 @@
      }
      fm_get_list(pfad);
    } else if($(elem).children(0).hasClass('fa-file')) {
      $('.datei-gewaehlt').removeClass('datei-gewaehlt');
      if(/*ev.shiftKey || */ ev.ctrlKey) {
        // mehrere Dateien sollen gewaehlt werden
      } else {
        $('.datei-gewaehlt').removeClass('datei-gewaehlt');
      }
      $(elem).children(0).addClass('datei-gewaehlt');
    } else {
      //console.log('kein folder oder file...');
    }
  } else {
    if($(elem).find('.datei-elem').children(0).hasClass('fa-file-o')) {
      $('.table-info').removeClass('table-info');
      if(/*ev.shiftKey || */ ev.ctrlKey) {
        // mehrere Dateien sollen gewaehlt werden
      } else {
        $('.table-info').removeClass('table-info');
      }
      $(elem).addClass('table-info');
      $('.datei-gewaehlt').removeClass('datei-gewaehlt');
      $(elem).find('.dateiname').addClass('datei-gewaehlt');