Dateiverwaltung für die WebBox
ulrich
2017-02-27 42fecef285c712f2a8d9b1b6371edc6ea9d9fac6
web/ui/ui.js
@@ -179,6 +179,7 @@
    }  
  };  
  fd.append('dateiauswahlfeld', datei);  
  fd.append('pfad', pfad);
  xhr.send(fd);          
}
@@ -328,11 +329,11 @@
  }
}
function fm_text_edit(content) {
function fm_text_edit(content, mode) {
  fm_filectls_hide();
  $('.codeeditor-space').show();
  $('.code-editor-container').show();
  fm_code_edit(content);
  fm_code_edit(content, mode);
  openEditor = 'text';
}
@@ -394,7 +395,15 @@
  var u = '../svc' + m;
  fm_get(u, "text", function(resp) {
    if(typ == 'text') {
      fm_text_edit(resp);
      var mode = "text/x-java";
      if(fname.endsWith('js')) {
        mode = 'javascript';
      } else if(fname.endsWith('xml')) {
        mode = 'xml';
      } else if(fname.endsWith('properties')) {
        mode = 'xml';
      }
      fm_text_edit(resp, mode);
    } else {
      fm_dok_edit(resp);
    }
@@ -622,10 +631,10 @@
/* ---- codemirror editor handling -------- */
function fm_code_edit(content) {
function fm_code_edit(content, m) {
  cm = CodeMirror.fromTextArea(document.getElementById("editspace"), {
    lineNumbers: true,
    mode: "xml",
    mode: m,
    viewportMargin : Infinity,
    extraKeys: {
        "F9": function(cm) {