From 53119fbeeaf9dbbf6c3a2ae492b9940cb5550054 Mon Sep 17 00:00:00 2001
From: ulrich <ulrich@ulrich-vaio>
Date: Wed, 06 Jan 2021 22:52:16 +0000
Subject: [PATCH] Funktion Neuer Reiter eingebaut

---
 web/ui/ui.js |   40 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/web/ui/ui.js b/web/ui/ui.js
index 2ffaef4..c7936e8 100644
--- a/web/ui/ui.js
+++ b/web/ui/ui.js
@@ -44,6 +44,7 @@
   $('.code-editor-container').hide();
   $('.sued').hide();
   //$('.ost').attr('flex-basis', 0);
+  $('#newTab').on('click', fm_newTab);
   $('#newTextFile').on('click', fm_menu_neue_textdatei);
   $('#newDoc').on('click', fm_menu_neues_dokument);
   $('#newFolder').on('click', fm_get_new_folder);
@@ -59,6 +60,7 @@
   $('#saveFileAs').on('click', fm_menu_datei_speichern_unter);
   $('#closeFile').on('click', fm_menu_datei_schliessen);
   $('#renameFile').on('click', fm_menu_datei_umbenennen);
+  $('#m-zip').on('click', fm_menu_ordner_packen);
   $('#m-unzip').on('click', fm_menu_datei_entpacken);
   $('#m-html-export').on('click', fm_menu_html_export);
   $('#m-del').on('click', fm_menu_delete);
@@ -73,14 +75,28 @@
   $('#m-test-3').on('click', fm_menu_compile_all);
   $('#m-compile-results').on('click', fm_fusszeile_zeigen);
   $('#m-build-app').on('click', fm_menu_build_app);
+  $('#m-ant-build').on('click', fm_menu_ant_build);
   $('#saveModal').on('hidden.bs.modal', function (e) {
     $('#modal_ok').attr('onclick','').unbind('click');
   });
   $('#logout').click(fm_logout);  
   $('#fusszeile-schliessen').on('click', fm_fusszeile_schliessen);
   fm_get_login();
-  fm_get_list('');
-  fm_init_uploader();
+  
+  //console.log(window.location);
+  //console.log(window.location.search);
+  var parsedUrl = new URL(window.location.href);
+  //console.log(parsedUrl.searchParams.get("pfad"));
+  var wunschPfad = parsedUrl.searchParams.get("pfad");
+  
+  if(wunschPfad.length > 0) {
+    pfad = wunschPfad;
+    fm_get_list(wunschPfad);
+    fm_init_uploader();
+  } else {
+    fm_get_list('');
+    fm_init_uploader();
+  }
   /*
   console.log('href: ' + window.location.href);
   console.log('host: ' + window.location.host);
@@ -89,6 +105,10 @@
   console.log('protocol: ' + window.location.protocol);
   */
   loc = window.location.protocol + '//' + window.location.host;
+}
+
+function fm_newTab() {
+  window.open('/file-cms/ui/?pfad=' + pfad, '_blank');
 }
 
 function fm_toggle_show_slideshow() {
@@ -342,6 +362,10 @@
 
 function fm_menu_build_app() {
   fm_build_app();
+}
+
+function fm_menu_ant_build() {
+  fm_ant_build();
 }
 
 function fm_mark_compile_results_in_editor(resp) {
@@ -623,6 +647,17 @@
   fm_unzip_file(fname);
 }
 
+/**
+ * Anname: Man ist in dem Ordner, der gepackt werden soll.
+ * Dann ist das Archiv anschliessend im Eltern-Ordner.
+ */
+function fm_menu_ordner_packen() {
+  //var gewaehlte = $('.datei-gewaehlt');
+  //var fname = $(gewaehlte[0]).text();
+  //console.log("Pfad: " + pfad + ", Datei: " + fname);
+  fm_pack_folder();
+}
+
 /*
  * Hier merkt sich die Dateiverwalting die markierten Dateien fuer 
  * eine Dateioperation. Bei cut wird in der 'paste' Operation auf dem Server 
@@ -738,6 +773,7 @@
 function fm_code_edit(content, m) {
   cm = CodeMirror.fromTextArea(document.getElementById("editspace"), {
     lineNumbers: true,
+    lineWrapping: true,
     gutters: ["CodeMirror-linenumbers", "breakpoints"],
     mode: m,
     viewportMargin : Infinity,

--
Gitblit v1.9.3