Dateiverwaltung für die WebBox
ulrich
2021-01-09 41ab37e425058eab58e640c94b79b3a9e26fb169
web/ui/index.html
@@ -8,40 +8,139 @@
    <link rel="stylesheet" href="/jslib/codemirror/addon/display/fullscreen.css">        
    <link rel="stylesheet" type="text/css" href="/jslib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/jslib/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/jslib/fancybox/jquery.fancybox.min.css">
    <link rel="stylesheet" type="text/css" href="/jslib/lightbox/lightbox.css">
    <link rel="stylesheet" type="text/css" href="stile.css">
  </head>
    <script id="tpl-ci" type="x-tmpl-mustache">
      {{#issues}}
        <p class="compiler-issue">
          {{sourceName}}, line {{lineNumber}}<br>
          {{kind}}: {{message}}
        </p>
      {{/issues}}
    </script>
    <script id="tpl-kacheln" type="x-tmpl-mustache">
      {{#files}}
        <figure class="figure datei-figure text-center text-warning align-top datei-elem">
          {{#mini}}
            {{#dia}}
              <a href="{{bildurl}}" data-fancybox="group" data-caption="">
                <img class="datei" src="{{miniurl}}" />
              </a>
            {{/dia}}
            {{^dia}}
              <img class="datei" src="{{miniurl}}" />
            {{/dia}}
          {{/mini}}
          {{^mini}}
            <i class="fa {{ typeClass }} fa-3x"></i>
          {{/mini}}
          <figcaption class="figure-caption dateiname">{{ fileName }}</figcaption>
        </figure>
      {{/files}}
    </script>
    <script id="tpl-liste" type="x-tmpl-mustache">
      <table class="table table-hover table-sm table-responsive tableBodyScroll">
        <thead>
          <tr>
            <th colspan="2">Name</th>
            <th>Gr&ouml;&szlig;e</th>
            <th>Art</th>
            <th>ge&auml;ndert</th>
          </tr>
        </thead>
        <tbody>
        {{#files}}
          <tr class="datei-zeile">
            <td class="datei-elem"><i class="fa {{ typeClass }}"></i></td>
            <td class="dateiname">{{ fileName }}</td>
            <td>{{ fileSize }}</td>
            <td>{{ fr.mimetype }}</td>
            <td>{{ fileDate }}</td>
          </tr>
        {{/files}}
        </tbody>
      </table>
    </script>
    <script id="tpl-bcr" type="x-tmpl-mustache">
      {{#files}}
          <a class="breadcrumb-item" rpath="{{ relPath }}" href="#">{{ fName }}</a>
      {{/files}}
    </script>
    <script id="tpl-bcr2" type="x-tmpl-mustache">
      <span class="breadcrumb-item active">{{ fName }}</span>
    </script>
    <script id="tpl-bcr3" type="x-tmpl-mustache">
      <div id="ansicht" class="pull-right align-middle">
        <i class="fa fa-th-list"></i>
      </div>
    </script>  </head>
  <body>
    <!-- Kopfzeile -->
    <div class="nord">
      
      <div id="menue"> <!-- Menue -->
        <ul class="nav">
        <ul class="nav pl-3">
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Datei</a>
            <div class="dropdown-menu">
              <a id="newTextFile" class="dropdown-item" href="#">Neue Text-Datei..</a>
              <a class="dropdown-item" href="#">Neues Dokument..</a>
              <a id="newTab" class="dropdown-item" href="#">Neuer Reiter</a>
              <div class="dropdown-divider"></div>
              <a class="dropdown-item" href="#">Ansehen als Code</a>
              <a class="dropdown-item" href="#">Ansehen als Dokument</a>
              <a id="newTextFile" class="dropdown-item" href="#">Neuer Text..</a>
              <a id="newDoc" class="dropdown-item" href="#">Neues Dokument..</a>
              <a id="newFolder" class="dropdown-item" href="#">Neuer Ordner..</a>
              <div class="dropdown-divider"></div>
              <a class="dropdown-item" href="#">Bearbeiten als Code</a>
              <a class="dropdown-item" href="#">Bearbeiten als Dokument</a>
              <a id="editTextFile" class="dropdown-item" href="#">&Ouml;ffnen als Text</a>
              <a id="editDocFile" class="dropdown-item" href="#">&Ouml;ffnen als Dokument</a>
              <div class="dropdown-divider"></div>
              <a id="viewFile" class="dropdown-item" href="#">Ansehen</a>
              <a id="viewSlideshow" class="dropdown-item" href="#">Diashow</a>
              <!--<a class="dropdown-item" href="#">Ansehen als Dokument</a>-->
              <div class="dropdown-divider"></div>
              <a id="saveFile" class="dropdown-item" href="#">Speichern</a>
              <a id="saveFileAs" class="dropdown-item" href="#">Speichern unter..</a>
              <div class="dropdown-divider"></div>
              <a id="renameFile" class="dropdown-item" href="#">Umbenennen..</a>
              <a id="m-zip" class="dropdown-item" href="#">Ordner packen</a>
              <a id="m-unzip" class="dropdown-item" href="#">Entpacken</a>
              <a id="m-html-export" class="dropdown-item" href="#">Export HTML</a>
              <div class="dropdown-divider"></div>
              <a id="closeFile" class="dropdown-item" href="#">Schliessen</a>
            </div>
          </li>
          <li class="nav-item dropdown">
            <a id="editMenu" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Bearbeiten</a>
            <div class="dropdown-menu">
              <a id="m-cut" class="dropdown-item" href="#">Ausschneiden</a>
              <a id="m-copy" class="dropdown-item" href="#">Kopieren</a>
              <a id="m-paste" class="dropdown-item" href="#">Einf&uuml;gen</a>
              <div class="dropdown-divider"></div>
              <a id="m-shrink" class="dropdown-item" href="#">Verkleinern</a>
              <a id="m-rotate" class="dropdown-item" href="#">Rotieren</a>
              <div class="dropdown-divider"></div>
              <a id="m-del" class="dropdown-item" href="#">L&ouml;schen</a>
            </div>
          </li>
          <li class="nav-item dropdown">
            <a id="userMenu" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Nutzer-ID</a>
            <div class="dropdown-menu">
              <a class="dropdown-item" href="/data/dok/wbx-doku.html#wbx-bedienung">Hilfe</a>
              <a class="dropdown-item" href="/">Zur Hauptseite der WebBox wechseln</a>
              <div class="dropdown-divider"></div>
              <a class="dropdown-item" href="/wbx/mng">Apps verwalten</a>
              <a class="dropdown-item" href="/um/ui">Benutzer verwalten</a>
              <a class="dropdown-item disabled" href="/file-cms/ui">Dateien verwalten</a>
              <a class="dropdown-item" href="/wbx-dbcon/ui">Datenbanken verwalten</a>
              <div class="dropdown-divider"></div>
              <a id="m-toggle-slideshow" class="dropdown-item" href="#">Diashow einschalten</a>
              <a id="m-test" class="dropdown-item" href="#">Test</a>
              <a id="m-test-2" class="dropdown-item" href="#">Compile</a>
              <a id="m-test-3" class="dropdown-item" href="#">Compile all</a>
              <a id="m-compile-results" class="dropdown-item" href="#">Compile results</a>
              <a id="m-build-app" class="dropdown-item" href="#">Build app</a>
              <a id="m-ant-build" class="dropdown-item" href="#">Ant build</a>
              <div class="dropdown-divider"></div>
              <a id="profil" class="dropdown-item" href="/um/profil">Profil</a>
              <a id="logout" class="dropdown-item" href="#">Abmelden</a>
            </div>
          </li>
@@ -53,135 +152,117 @@
      <!-- westliche Seitenleiste -->
      <div class="west hidden-xs-down">
          <!-- linke Seitenleiste mit Links -->
          <!--
          <nav class="nav flex-column">
            <a class="nav-link active" href="#">Active</a>
            <a class="nav-link" href="#">Link</a>
            <a class="nav-link" href="#">Link</a>
            <a class="nav-link disabled" href="#">Disabled</a>
          </nav>
          </nav>
          -->
      </div>
      <!-- zentraler Inhaltsbereich -->
      <div class="zentrum">
        
        <div class="code-editor-container pr-3 pb-3">
        <!-- Codemirror Start -->
        <div class="code-editor-container pl-3 pr-3 pb-3">
        <div class="codeeditor-space pr-3">
          <textarea class="codeeditor" id="editspace"></textarea>       
        </div>
        </div>
        <!-- <div id="code-editor-container" class="pr-2"> -->
          <!--
          <div id="edit-tabs">
            <ul class="nav nav-tabs">
              <li class="nav-item">
                <a class="nav-link active" href="#">Active</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="#">Link</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="#">Link</a>
              </li>
              <li class="nav-item">
                <a class="nav-link disabled" href="#">Disabled</a>
              </li>
            </ul>
          </div>
          -->
        <!-- </div> -->
        <div id="dateiansicht">
          <!-- Breadcrumb Start -->
          <div class="zentrum-bc">
            <nav class="breadcrumb">
              <a class="breadcrumb-item" href="#">Home</a>
              <a class="breadcrumb-item" href="#">Library</a>
              <a class="breadcrumb-item" href="#">Data</a>
              <span class="breadcrumb-item active">Bootstrap</span>
              <div class="pull-right align-middle">
                <i class="fa fa-th-large"></i>
              </div>
            </nav>
          </div>
          <!-- Breadcrumb Ende -->
          <!-- Dateikacheln Start -->
          <div class="zentrum-liste">
            <figure class="figure datei-figure text-center text-warning align-top">
              <i class="fa fa-folder fa-3x"></i>
              <figcaption class="figure-caption">Kurzer Text</figcaption>
            </figure>
            <figure class="figure datei-figure text-center text-warning align-top">
              <i class="fa fa-folder fa-3x"></i>
              <figcaption class="figure-caption">A caption for the above image.</figcaption>
            </figure>
            <figure class="figure datei-figure text-center text-warning align-top">
              <i class="fa fa-folder fa-3x"></i>
              <figcaption class="figure-caption">Ein ganz langer Text, der dieses Element benennt.</figcaption>
            </figure>
            <figure class="figure datei-figure text-center text-warning align-top">
              <i class="fa fa-folder fa-3x"></i>
              <figcaption class="figure-caption">Wort</figcaption>
            </figure>
            <figure class="figure datei-figure text-center text-warning align-top">
              <i class="fa fa-folder fa-3x"></i>
              <figcaption class="figure-caption">Wort2</figcaption>
            </figure>
            <figure class="figure datei-figure text-center text-warning align-top">
              <i class="fa fa-folder fa-3x"></i>
              <figcaption class="figure-caption">Wort3</figcaption>
            </figure>
          </div>
          <!-- Dateikacheln Ende -->
        <!-- Codemirror Ende -->
        <!-- TinyMCE Start -->
        <div id="mce-editor" class="pl-3 pr-3">
          <textarea class="text-editor" id="text-editspace"></textarea>
        </div>
        <!-- TinyMCE Ende -->
        <!-- Breadcrumb Start -->
        <div id="zentrum_bc" class="zentrum-bc pl-3 pr-3">
          <nav class="breadcrumb" id="bcnav"></nav>
        </div>
        <!-- Breadcrumb Ende -->
        <!-- Dateikacheln/-liste Start -->
        <div class="zentrum-liste pl-3 pr-3" id="dateien"></div>
        <!-- Dateikacheln Ende -->
        
        <!-- Modal -->
        <div class="modal fade" id="saveModal">
          <div class="modal-dialog" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title">Datei speichern</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div class="modal-body">
                <p>Dateiname?</p>
                <input class="form-control eingabe" type="text" size="20" maxlength="250" placeholder="Dateiname" name="dateiname" id="dateiname">
              </div>
              <div class="modal-footer">
                <button id="modal_ok" type="button" class="btn btn-primary" data-dismiss="modal">Speichern</button>
                <button id="modal_cancel" type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
              </div>
            </div>
          </div>
        </div> <!-- Modal Ende -->
      </div>
      <!-- oestliche Seitenleiste -->
      <!--
      <div class="ost">
        &ouml;stliche Seitenleiste
      <div class="ost"></div>
      <!-- Modal -->
      <div class="modal fade" id="saveModal">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 id="saveModalTitle" class="modal-title">Datei speichern</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div id="saveModalBody" class="modal-body">
              <p id="dialogfrage">Dateiname?</p>
              <input class="form-control eingabe" type="text" size="20" maxlength="250" placeholder="Dateiname" name="dateiname" id="dateiname">
            </div>
            <div class="modal-footer">
              <button id="modal_ok" type="button" class="btn btn-primary" data-dismiss="modal">Speichern</button>
              <button id="modal_cancel" type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
            </div>
          </div>
        </div>
      </div> <!-- Modal Ende -->
      <!-- Modal ok / cancel Start -->
      <div class="modal fade" id="confirmModal">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 id="confirmModalTitle" class="modal-title">L&ouml;schen</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div id="confirmModalBody" class="modal-body">
              <p>Wirklich ...?</p>
            </div>
            <div class="modal-footer">
              <button id="confirmOk" type="button" class="btn btn-danger" data-dismiss="modal">L&ouml;schen</button>
              <button id="confirmClose" type="button" class="btn btn-secondary" data-dismiss="modal">Schliessen</button>
              <button id="confirmCancel" type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
            </div>
          </div>
        </div>
      </div>
      -->
      <!-- Modal ok / cancel Ende -->
    </div>
    <!-- Fusszeile -->
    <!--
    <div class="sued">
      Fu&szlig;zeile
      <button id="fusszeile-schliessen" type="button" class="close" aria-label="Close">
        <span aria-hidden="true">&times;</span>
      </button>
      <div class="system-out">
      </div>
    </div>
    -->
    <!-- Skripte -->
    <script src="/jslib/jquery/jquery.min.js"></script>
    <!--<script src="/jslib/jquery-3.2.1/jquery.min.js"></script>-->
    <script src="/jslib/codemirror/lib/codemirror.js"></script>
    <script src="/jslib/codemirror/mode/javascript/javascript.js"></script>
    <script src="/jslib/codemirror/mode/xml/xml.js"></script>
    <script src="/jslib/codemirror/mode/htmlmixed/htmlmixed.js"></script>
    <script src="/jslib/codemirror/mode/clike/clike.js"></script>
    
    <script src="/jslib/codemirror/addon/display/fullscreen.js"></script>
    <script src="/jslib/tinymce/tinymce.min.js"></script>
    <script src="/jslib/tether/tether.min.js"></script>
    <script src="/jslib/bootstrap/js/bootstrap.min.js"></script>
    <script src="/jslib/mustache/mustache.min.js"></script>
    <script src="/jslib/fancybox/jquery.fancybox.min.js"></script>
    <script src="/jslib/lightbox/lightbox.min.js"></script>
    <script src="/jslib/moment/moment-with-locales.min.js"></script>
    <script src="/jslib/numeral/numeral.min.js"></script>
    <script src="data.js"></script>
    <script src="api.js"></script>
    <script src="ui.js"></script>
    <script type="text/javascript" charset="utf-8">
      //var ui;