Dateiverwaltung für die WebBox
ulrich
2017-02-20 2315a035f7273a7d11fa4b7c6ce470f084544efb
Breadcrumb berichtigt
2 files modified
39 ■■■■ changed files
web/ui/index.html 2 ●●● patch | view | raw | blame | history
web/ui/ui.js 37 ●●●● patch | view | raw | blame | history
web/ui/index.html
@@ -24,7 +24,7 @@
      {{/files}}
    </script>
    <script id="tpl-bcr2" type="x-tmpl-mustache">
      <span class="breadcrumb-item active">Bootstrap</span>
      <span class="breadcrumb-item active">{{ fName }}</span>
    </script>
    <script id="tpl-bcr3" type="x-tmpl-mustache">
      <div class="pull-right align-middle">
web/ui/ui.js
@@ -106,25 +106,48 @@
      $('#dateien').empty();
    }
    
    var template;
    $('#bcnav').empty();
    var dirList = new Array();
    var rp = '';
    console.log("'" + relPath + "'");
    var dirs = relPath.split('/');
    console.log(dirs.length);
    dirList.push(new BcrFile(rp, 'Home'));
    if(dirs.length > 0) {
      for(var i = 0; i < dirs.length; i++) {
    if(relPath.length > 0) {
      for(var i = 0; i < dirs.length - 1; i++) {
        if(rp.length > 0 ) {
          dirList.push(new BcrFile(rp + '/' + dirs[i], dirs[i]));
          rp = rp + '/' + dirs[i];
        } else {
          dirList.push(new BcrFile(dirs[i], dirs[i]));
          rp = dirs[i];
        }
      }
      var bl = new BcrFiles(dirList);
      var template = $('#tpl-bcr').html();
      Mustache.parse(template);   // optional, speeds up future uses
      $('#bcnav').empty();
      $('#bcnav').html(Mustache.render(template, bl));
      $('#bcnav').append($('#tpl-bcr2').html());
      if(dirList.length > 0) {
        template = $('#tpl-bcr').html();
        Mustache.parse(template);   // optional, speeds up future uses
        $('#bcnav').html(Mustache.render(template, bl));
      }
      if(dirs.length > 0) {
        dirList.push(new BcrFile(rp + '/' + dirs[dirs.length-1], dirs[dirs.length-1]));
        template = $('#tpl-bcr2').html();
        Mustache.parse(template);   // optional, speeds up future uses
        $('#bcnav').append(Mustache.render(template, dirList[dirList.length-1]));
      } else {
        template = $('#tpl-bcr2').html();
        Mustache.parse(template);   // optional, speeds up future uses
        $('#bcnav').append(Mustache.render(template, dirList[0]));
      }
      $('#bcnav').append($('#tpl-bcr3').html());
    } else {
      template = $('#tpl-bcr2').html();
      Mustache.parse(template);   // optional, speeds up future uses
      $('#bcnav').append(Mustache.render(template, dirList[0]));
    }
  });  
}