From 11536c42a172f2f63b6c7f2ee2b83667f2fbb5ee Mon Sep 17 00:00:00 2001
From: ulrich <not disclosed>
Date: Sun, 19 Mar 2017 09:04:55 +0000
Subject: [PATCH] Pfadeinstellungen fuer TinyMCE berichtigt

---
 web/ui/ui.js |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/web/ui/ui.js b/web/ui/ui.js
index 0fd2167..345603d 100644
--- a/web/ui/ui.js
+++ b/web/ui/ui.js
@@ -31,6 +31,9 @@
 var loc;
 var PERS_DIR = "Persoenlich";
 var PUB_DIR = "Oeffentlich";
+var BASE_DIR = "$basis";
+var DATA_DIR = "$daten";
+var WWW_DIR = "www";
 var compilerIssues;
 
 function fm_init() {
@@ -94,12 +97,19 @@
     restdir = pfad.substr(PUB_DIR.length);
   } else if(pfad.indexOf(PERS_DIR) > -1) {
     restdir = pfad.substr(PERS_DIR.length);
+  } else if(pfad.indexOf(BASE_DIR) > -1) {
+    restdir = pfad.substr(BASE_DIR.length);
+  } else if(pfad.indexOf(DATA_DIR) > -1) {
+    restdir = pfad.substr(DATA_DIR.length);
   }
   if(restdir !== undefined && restdir.startsWith('/')) {
     restdir = restdir.substr(1);
+    if(restdir.indexOf(WWW_DIR) > -1) {
+      restdir = restdir.replace(WWW_DIR, 'data');
+    }
   }
   var pdir = fm_get_base(uid);
-  //console.log('path: ' + pdir + "/" + restdir);
+  // console.log('fm_get_path path: ' + pdir + "/" + restdir);
   if(restdir.length > 1) {
     return pdir + "/" + restdir;
   } else {
@@ -111,18 +121,22 @@
   //console.log('pfad: ' + pfad);
   var pdir;
   if(pfad.indexOf(PUB_DIR) > -1) {
-    pdir = '/data/';
+    pdir = '/data/' + uid;
   } else if(pfad.indexOf(PERS_DIR) > -1) {
-    pdir = '/home/';
+    pdir = '/home/' + uid;
+  } else if(pfad.indexOf(BASE_DIR) > -1) {
+    pdir = '';
+  } else if(pfad.indexOf(DATA_DIR) > -1) {
+    pdir = '';
   }
-  //console.log('base: ' + pdir + uid);
-  return pdir + uid;
+  //console.log('fm_get_base base: ' + pdir + uid);
+  return pdir;
 }
 
 function fm_dok_editor_init(uid) {
   var base = fm_get_path(uid);
   edCount = 0;
-  //console.log("calling tinymce.init with base: " + base + "/");
+  //console.log("fm_dok_editor_init calling tinymce.init with base: " + base + "/");
   
   /*
    * vgl.
@@ -158,6 +172,8 @@
     importcss_append: true,
     width: "100%",
     height: '100%',
+    relative_urls : true, 
+    convert_urls : false, 
     document_base_url : base + "/",
     setup: function (editor) {
       ed = editor;

--
Gitblit v1.9.3