Commit f5bc1322 authored by jan.koester's avatar jan.koester
Browse files

test

parent e705685e
Loading
Loading
Loading
Loading
+29 −0
Changes for data/template/default/editor.html: 29 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -539,6 +539,7 @@
                <div id="tpl-status" class="prop-status mt-1"></div>
                <div class="flex gap-1 mt-2 pt-2 border-t border-gray-600">
                    <button class="tpl-btn tpl-btn-secondary" onclick="exportXml()" title="${I18N_TITLE_EXPORT_XML}">&#x1F4E4; ${I18N_EXPORT_XML}</button>
                    <button class="tpl-btn tpl-btn-secondary" onclick="exportHtml()" title="${I18N_TITLE_EXPORT_HTML}">&#x1F4E4; ${I18N_EXPORT_HTML}</button>
                    <button class="tpl-btn tpl-btn-secondary" onclick="importXmlClick()" title="${I18N_TITLE_IMPORT_XML}">&#x1F4E5; ${I18N_IMPORT_XML}</button>
                    <input type="file" id="xml-import-input" accept=".xml,text/xml" style="display:none" onchange="importXmlFile(this)">
                    <button class="tpl-btn tpl-btn-secondary" onclick="importHtmlClick()" title="${I18N_TITLE_IMPORT_HTML}">&#x1F310; ${I18N_IMPORT_HTML}</button>
@@ -2183,6 +2184,34 @@
            }
        }

        /**
         * Export the current document tree as an HTML file download.
         */
        async function exportHtml() {
            try {
                setTplStatus(I18N.EXPORTING, false);
                const result = await sendApiRequest([{ command: 'ExportHtml' }]);
                const resp = result[0];
                if (resp.status === 'success' && resp.html) {
                    const blob = new Blob([resp.html], { type: 'text/html' });
                    const url = URL.createObjectURL(blob);
                    const a = document.createElement('a');
                    a.href = url;
                    const name = currentTemplateName || 'template';
                    a.download = name.replace(/[^a-zA-Z0-9_-]/g, '_') + '.html';
                    document.body.appendChild(a);
                    a.click();
                    document.body.removeChild(a);
                    URL.revokeObjectURL(url);
                    setTplStatus(I18N.HTML_EXPORTED || 'HTML exported.', false);
                } else {
                    setTplStatus(resp.message || I18N.EXPORT_FAILED, true);
                }
            } catch (e) {
                setTplStatus('Error: ' + e.message, true);
            }
        }

        /**
         * Trigger the hidden file input for XML import.
         */
+3 −0
Changes for src/theme.cpp: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -186,6 +186,9 @@ inline std::map<std::string, std::string> editorTranslations(const std::string &
        "I18N_CLICK_REFRESH",
        "I18N_TITLE_EXPORT_XML",
        "I18N_EXPORT_XML",
        "I18N_TITLE_EXPORT_HTML",
        "I18N_EXPORT_HTML",
        "I18N_HTML_EXPORTED",
        "I18N_TITLE_IMPORT_XML",
        "I18N_IMPORT_XML",
        "I18N_TITLE_IMPORT_HTML",
+6 −0
Changes for src/translations.h: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -212,6 +212,9 @@ namespace blogi {
            {"I18N_CLICK_REFRESH",       "Klicke Aktualisieren um Vorlagen zu laden."},
            {"I18N_TITLE_EXPORT_XML",    "Aktuelles Dokument als XML exportieren"},
            {"I18N_EXPORT_XML",          "XML exportieren"},
            {"I18N_TITLE_EXPORT_HTML",   "Aktuelles Dokument als HTML exportieren"},
            {"I18N_EXPORT_HTML",         "HTML exportieren"},
            {"I18N_HTML_EXPORTED",       "HTML erfolgreich exportiert."},
            {"I18N_TITLE_IMPORT_XML",    "XML Datei in Editor importieren"},
            {"I18N_IMPORT_XML",          "XML importieren"},
            {"I18N_TITLE_IMPORT_HTML",   "HTML Datei in Editor importieren"},
@@ -558,6 +561,9 @@ namespace blogi {
            {"I18N_CLICK_REFRESH",       "Click refresh to load templates."},
            {"I18N_TITLE_EXPORT_XML",    "Export current document as XML file"},
            {"I18N_EXPORT_XML",          "Export XML"},
            {"I18N_TITLE_EXPORT_HTML",   "Export current document as HTML file"},
            {"I18N_EXPORT_HTML",         "Export HTML"},
            {"I18N_HTML_EXPORTED",       "HTML exported successfully."},
            {"I18N_TITLE_IMPORT_XML",    "Import XML file into editor"},
            {"I18N_IMPORT_XML",          "Import XML"},
            {"I18N_TITLE_IMPORT_HTML",   "Import HTML file into editor"},