src/java/de/uhilger/filecms/api/HtmlExportService.java | ●●●●● patch | view | raw | blame | history | |
web/ui2/data/menu/misc.json | ●●●●● patch | view | raw | blame | history | |
web/ui2/js/app.js | ●●●●● patch | view | raw | blame | history |
src/java/de/uhilger/filecms/api/HtmlExportService.java
@@ -43,6 +43,8 @@ private static final Logger logger = Logger.getLogger(HtmlExportService.class.getName()); public static final String WBX_APPS_DIR = "wbx.apps"; /** * Den Inhalt eines Ordners als HTML exportieren * @@ -121,8 +123,9 @@ } } } File catalinaBase = new File(getCatalinaBase(getServletContext())); File bsDir = new File(catalinaBase, "webapps/jslib/bootstrap/css/"); //File catalinaBase = new File(getCatalinaBase(getServletContext())); File catalinaBase = new File(System.getProperty(WBX_APPS_DIR)); File bsDir = new File(catalinaBase, "jslib/bootstrap/css/"); try { FileUtils.copyFile(new File(bsDir, "bootstrap.min.css"), new File(outDir, "bootstrap.min.css"), true); File stile = new File(dir, "stile.css"); @@ -131,13 +134,13 @@ } buildThumbnailImages(outDir, new Bild()); File lbDir = new File(catalinaBase, "webapps/jslib/lightbox/"); File lbDir = new File(catalinaBase, "jslib/lightbox/"); FileUtils.copyDirectoryToDirectory(lbDir, outDir); File jqDir = new File(catalinaBase, "webapps/jslib/jquery/"); File jqDir = new File(catalinaBase, "jslib/jquery/"); FileUtils.copyDirectoryToDirectory(jqDir, outDir); File lbimgDir = new File(catalinaBase, "webapps/jslib/lightbox/img"); File lbimgDir = new File(catalinaBase, "jslib/lightbox/img"); FileUtils.copyDirectoryToDirectory(lbimgDir, outDir); @@ -262,6 +265,7 @@ private void printHeader(PrintWriter out) throws IOException { out.print("<!DOCTYPE html><html><head>\r\n"); out.print("<meta charset=\"UTF-8\">\r\n"); out.print("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>"); out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"bootstrap.min.css\">\r\n"); out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"lightbox/lightbox.css\">\r\n"); web/ui2/data/menu/misc.json
@@ -10,7 +10,7 @@ { "titel": "Ordner packen", "umenue": false, "funktion": "" "funktion": "app.fm_pack_folder" }, { "titel": "Entpacken", @@ -25,7 +25,7 @@ { "titel": "Export HTML", "umenue": false, "funktion": "" "funktion": "app.fm_menu_html_export" }, { "titel": "", web/ui2/js/app.js
@@ -784,6 +784,13 @@ self.fm_export_html(); }; this.sued_schliessen = function() { var suedDiv = document.querySelector('.sued'); document.querySelector('.close-btn-fuss').removeEventListener('click', this); suedDiv.classList.remove('sued-open'); suedDiv.style.height = '0'; }; /* --------- Dateifunktionen Ende ---------- */ /* API functions */ @@ -943,18 +950,55 @@ //console.log(html); var elem = document.querySelector('.sued'); elem.innerHTML = html; document.querySelector('.close-btn-fuss').addEventListener('click', self.sued_schliessen); /* document.querySelector('.close-btn-fuss').addEventListener('click', function(){ var suedDiv = document.querySelector('.sued'); document.querySelector('.close-btn-fuss').removeEventListener('click', this); suedDiv.classList.remove('sued-open'); suedDiv.style.height = '0'; }); */ self.fm_fusszeile_zeigen(); self.fm_get_list(self.pfad); }); }); }; this.fm_pack_folder = function() { //var liste = fm_gewaehlte_dateien(); var m = '?c=de.uhilger.filecms.api.FileMgr&m=packFolder&p=' + self.pfad; var u = '../svc' + m; self.fm_get(u, "text", function(resp) { // console.log('deleteFiles gab folgendes zurueck: ' + resp); self.fm_get_list(self.pfad); }); }; this.fm_export_html = function() { var m = '?c=de.uhilger.filecms.api.HtmlExportService&m=exportHtml'; m = m + '&p=' + self.pfad; var u = '../svc' + m; self.fm_get(u, "text", function(resp) { var mtx = new Meldung('Rueckmeldung vom HTML-Export: ' + resp); //console.log(mtx); self.html_erzeugen("data/tpl/fuss.tpl", mtx, function(html) { var elem = document.querySelector('.sued'); elem.innerHTML = html; document.querySelector('.close-btn-fuss').addEventListener('click', self.sued_schliessen); self.fm_fusszeile_zeigen(); //self.fm_get_list(self.pfad); /* $('.system-out').empty(); $('.system-out').append('Rueckmeldung vom HTML-Export: ' + resp); fm_fusszeile_zeigen(); */ }); }); }; /* -------- upload ----------- */ this.sendFile = function(datei) {