Loading client/qml/DocumentTree.qml +1 −0 Changes for client/qml/DocumentTree.qml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ ColumnLayout { visible: nodeHover.hovered Repeater { model: [ { icon: "⚙", tip: "Settings", action: function() { treeRoot.selectedUuid = node.uuid; propPanel.loadProperties(node.uuid) } }, { icon: "↑", tip: "Move up", action: function() { localApi.moveUp(node.uuid) } }, { icon: "↓", tip: "Move down", action: function() { localApi.moveDown(node.uuid) } }, { icon: "→", tip: "Indent", action: function() { localApi.indent(node.uuid) } }, Loading client/qml/PreviewPane.qml +2 −1 Changes for client/qml/PreviewPane.qml: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -19,11 +19,12 @@ Item { webView.loadHtml(serverHtml, surl.length > 0 ? surl : "about:blank") } else { var html = localApi.renderPreview() var baseUrl = localApi.serverUrl() || "about:blank" webView.loadHtml( "<!DOCTYPE html><html><head><meta charset='utf-8'>" + "<style>html,body{margin:0;padding:8px;background:#fff;color:#000;font-family:sans-serif;}</style>" + "</head><body>" + html + "</body></html>", "about:blank" baseUrl ) } } Loading client/qml/PropertyPanel.qml +37 −1 Changes for client/qml/PropertyPanel.qml: 37 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ ColumnLayout { root.setStatus("Saved") } function saveProperties(propsObj) { if (!currentUuid) return localApi.setElementProperties(currentUuid, JSON.stringify({ properties: propsObj })) root.setStatus("Saved") } function debounceSave(key, value) { if (_debounceTimer) _debounceTimer.destroy() var timer = Qt.createQmlObject('import QtQuick; Timer { interval: 400; repeat: false; running: true }', propPanel) Loading Loading @@ -291,7 +297,37 @@ ColumnLayout { sourceComponent: MediaBrowser { onMediaSelected: function(url) { propPanel.saveProperty(mediaBrowserLoader.fieldKey, url) var fieldKey = mediaBrowserLoader.fieldKey if (fieldKey === "media_id") { /* Extract media ID, extension, and relative path from the full URL. Server returns URLs like: https://host/prefix/media/getimage/UUID.ext */ var mediaPath = url try { var u = new URL(url) mediaPath = u.pathname // e.g. /blog/media/getimage/UUID.ext } catch(e) {} /* Extract UUID and extension from the filename */ var parts = mediaPath.split("/") var filename = parts[parts.length - 1] // UUID.ext var dotIdx = filename.lastIndexOf(".") var mediaId = dotIdx > 0 ? filename.substring(0, dotIdx) : filename var mediaExt = dotIdx > 0 ? filename.substring(dotIdx + 1) : "webp" /* Build relative src: /media/getimage/UUID.ext (without server prefix) */ var relIdx = mediaPath.indexOf("/media/getimage/") var relSrc = relIdx >= 0 ? mediaPath.substring(relIdx) : mediaPath propPanel.saveProperties({ "media_id": mediaId, "media_ext": mediaExt, "src": relSrc }) } else { propPanel.saveProperty(fieldKey, url) } if (mediaBrowserLoader.targetField) mediaBrowserLoader.targetField.text = url propPanel.loadProperties(propPanel.currentUuid) Loading Loading
client/qml/DocumentTree.qml +1 −0 Changes for client/qml/DocumentTree.qml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ ColumnLayout { visible: nodeHover.hovered Repeater { model: [ { icon: "⚙", tip: "Settings", action: function() { treeRoot.selectedUuid = node.uuid; propPanel.loadProperties(node.uuid) } }, { icon: "↑", tip: "Move up", action: function() { localApi.moveUp(node.uuid) } }, { icon: "↓", tip: "Move down", action: function() { localApi.moveDown(node.uuid) } }, { icon: "→", tip: "Indent", action: function() { localApi.indent(node.uuid) } }, Loading
client/qml/PreviewPane.qml +2 −1 Changes for client/qml/PreviewPane.qml: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -19,11 +19,12 @@ Item { webView.loadHtml(serverHtml, surl.length > 0 ? surl : "about:blank") } else { var html = localApi.renderPreview() var baseUrl = localApi.serverUrl() || "about:blank" webView.loadHtml( "<!DOCTYPE html><html><head><meta charset='utf-8'>" + "<style>html,body{margin:0;padding:8px;background:#fff;color:#000;font-family:sans-serif;}</style>" + "</head><body>" + html + "</body></html>", "about:blank" baseUrl ) } } Loading
client/qml/PropertyPanel.qml +37 −1 Changes for client/qml/PropertyPanel.qml: 37 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ ColumnLayout { root.setStatus("Saved") } function saveProperties(propsObj) { if (!currentUuid) return localApi.setElementProperties(currentUuid, JSON.stringify({ properties: propsObj })) root.setStatus("Saved") } function debounceSave(key, value) { if (_debounceTimer) _debounceTimer.destroy() var timer = Qt.createQmlObject('import QtQuick; Timer { interval: 400; repeat: false; running: true }', propPanel) Loading Loading @@ -291,7 +297,37 @@ ColumnLayout { sourceComponent: MediaBrowser { onMediaSelected: function(url) { propPanel.saveProperty(mediaBrowserLoader.fieldKey, url) var fieldKey = mediaBrowserLoader.fieldKey if (fieldKey === "media_id") { /* Extract media ID, extension, and relative path from the full URL. Server returns URLs like: https://host/prefix/media/getimage/UUID.ext */ var mediaPath = url try { var u = new URL(url) mediaPath = u.pathname // e.g. /blog/media/getimage/UUID.ext } catch(e) {} /* Extract UUID and extension from the filename */ var parts = mediaPath.split("/") var filename = parts[parts.length - 1] // UUID.ext var dotIdx = filename.lastIndexOf(".") var mediaId = dotIdx > 0 ? filename.substring(0, dotIdx) : filename var mediaExt = dotIdx > 0 ? filename.substring(dotIdx + 1) : "webp" /* Build relative src: /media/getimage/UUID.ext (without server prefix) */ var relIdx = mediaPath.indexOf("/media/getimage/") var relSrc = relIdx >= 0 ? mediaPath.substring(relIdx) : mediaPath propPanel.saveProperties({ "media_id": mediaId, "media_ext": mediaExt, "src": relSrc }) } else { propPanel.saveProperty(fieldKey, url) } if (mediaBrowserLoader.targetField) mediaBrowserLoader.targetField.text = url propPanel.loadProperties(propPanel.currentUuid) Loading