From 9e296453bf0b7ee35e2ed3c992198584bf2f2c0a Mon Sep 17 00:00:00 2001
From: Ulrich <undisclosed>
Date: Tue, 28 Feb 2017 16:31:16 +0000
Subject: [PATCH] copy, paste

---
 web/ui/ui.js |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/web/ui/ui.js b/web/ui/ui.js
index 7bebec1..a5e4de9 100644
--- a/web/ui/ui.js
+++ b/web/ui/ui.js
@@ -194,13 +194,16 @@
 /* ------- Dateifunktionen Start ----------- */
 
 function fm_menu_cut() {
-  alert('fm_menu_cut');
+  //alert('fm_menu_cut');
+  fm_cut_files();
 }
 function fm_menu_copy() {
-  alert('fm_menu_copy');
+  //alert('fm_menu_copy');
+  fm_copy_files();
 }
 function fm_menu_paste() {
-  alert('fm_menu_paste');
+  //alert('fm_menu_paste');
+  fm_paste_files();
 }
 function fm_menu_delete() {
   $('#confirmOk').click(function() {
@@ -484,7 +487,7 @@
 function fm_copy_files() {
   cutCopySrcDir = pfad;
   cutCopyFiles = fm_gewaehlte_dateien();
-  cutCopyOperation = 'cut';
+  cutCopyOperation = 'copy';
 }
 
 /*
@@ -494,16 +497,24 @@
  */
 function fm_paste_files() {
   var m;
-  if(cutCopyOperation = 'cut') {
-    m = '?c=de.uhilger.filecms.api.FileMgr&m=moveFiles'; //&p=' + cutCopySrcDir + '&p=' + pfad + '&p=' + encodeURIComponent(liste);
+  if(cutCopyOperation === 'cut') {
+    //m = '?c=de.uhilger.filecms.api.FileMgr&m=moveFiles'; //&p=' + cutCopySrcDir + '&p=' + pfad + '&p=' + encodeURIComponent(liste);
+    m = '?c=de.uhilger.filecms.api.FileMgr&m=moveFiles&p=' + cutCopySrcDir + '&p=' + pfad + '&p=' + encodeURIComponent(cutCopyFiles);
   } else {
-    m = '?c=de.uhilger.filecms.api.FileMgr&m=copyFiles'; //&p=' + cutCopySrcDir + '&p=' + pfad + '&p=' + encodeURIComponent(liste);
+    //m = '?c=de.uhilger.filecms.api.FileMgr&m=copyFiles'; //&p=' + cutCopySrcDir + '&p=' + pfad + '&p=' + encodeURIComponent(liste);
+    m = '?c=de.uhilger.filecms.api.FileMgr&m=copyFiles&p=' + cutCopySrcDir + '&p=' + pfad + '&p=' + encodeURIComponent(cutCopyFiles);
   }
   var u = '../svc' + m;  
-  fm_post(u, {p1: cutCopySrcDir, p2: pfad, p3: encodeURIComponent(cutCopyFiles)}, function(resp) {
+  fm_get(u, "text", function(resp) {
+    // console.log('deleteFiles gab folgendes zurueck: ' + resp);
+    fm_get_list(pfad);
+  });
+  /*
+  fm_post(u, {p1: encodeURIComponent(cutCopySrcDir), p2: encodeURIComponent(pfad), p3: encodeURIComponent(cutCopyFiles)},'text', function(resp) {
     // resp evtl. zeigen..
     fm_get_list(pfad);
   });
+  */
 }
 
 function fm_del_files() {
@@ -733,12 +744,12 @@
   });
 }
 
-function fm_post(u, d, scallback) {
+function fm_post(u, d, dtype, scallback) {
   $.ajax({
     url: u,
     data: d,
     type: "POST",
-    dataType: "json",
+    dataType: dtype,
     success: scallback,
     error: function (xhr, status, errorThrown) {
       $('#fehler').html("Error: " + errorThrown + " Status: " + status);

--
Gitblit v1.9.3