Commit 4a27e4b7 authored by jan.koester's avatar jan.koester
Browse files

test

parent 8e3d2577
Loading
Loading
Loading
Loading
+5 −5
Changes for data/template/default/editor.html: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -2863,13 +2863,13 @@
                _loadImageNaturalSize(origUrl);
            }

            // Build src URL with PREFIX
            // Build src URL without PREFIX (stored path must be prefix-independent)
            const srcEl = document.getElementById('prop-src');
            if (srcEl) {
                if (isVideo) {
                    srcEl.value = PREFIX + '/media/getimage/' + mediaId;
                    srcEl.value = '/media/getimage/' + mediaId;
                } else {
                    const origUrl = PREFIX + '/media/getimage/' + mediaId + '.' + ext;
                    const origUrl = '/media/getimage/' + mediaId + '.' + ext;
                    const rw = document.getElementById('prop-real_width');
                    const rh = document.getElementById('prop-real_height');
                    const w = rw ? parseInt(rw.value, 10) || 0 : 0;
@@ -2929,7 +2929,7 @@
                        const ext = extEl.value || 'webp';
                        const w = rwEl ? parseInt(rwEl.value, 10) || 0 : 0;
                        const h = rhEl ? parseInt(rhEl.value, 10) || 0 : 0;
                        let url = PREFIX + '/media/getimage/' + mid + '.' + ext;
                        let url = '/media/getimage/' + mid + '.' + ext;
                        if (w > 0 && h > 0) url += '?w=' + w + '&h=' + h;
                        srcEl.value = url;
                    }
@@ -2940,7 +2940,7 @@
                    const srcEl = document.getElementById('prop-src');
                    if (midEl && midEl.value.trim() && srcEl) {
                        const mid = midEl.value.trim();
                        srcEl.value = PREFIX + '/media/getimage/' + mid;
                        srcEl.value = '/media/getimage/' + mid;
                    }
                }
                return origSave(uuid, widgetName);
+1 −0
Changes for src/edit.cpp: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@
#include "theme.h"

blogi::webedit::WebEditor::WebEditor(PluginArgs &plgargs) : Args (plgargs){
    EditPlugin::setPrefix(Args.config->getprefix());
    std::vector<std::string> edplgdirs;
    for(size_t i=0; i<Args.config->getplgdirs(); ++i){
        edplgdirs.emplace_back(Args.config->getplgdir(i)+"/webedit");
+9 −0
Changes for src/plugin.h: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -232,6 +232,14 @@ namespace blogi {
                Id.generate();
            };

            static void setPrefix(const std::string &prefix) {
                _Prefix = prefix;
            }

            static const std::string& getPrefix() {
                return _Prefix;
            }

            virtual ~EditPlugin()=default;

            virtual const std::string getName() const =0;
@@ -290,6 +298,7 @@ namespace blogi {
            uuid::uuid                              Id;
            EditPlugin* nextel=nullptr;
            EditPlugin* child=nullptr;
            static inline std::string               _Prefix;
            friend class EditPluginLoad;
        };

+5 −0
Changes for src/webedit/image/image.cpp: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -421,6 +421,11 @@ extern "C" {

                // Build actual src: if mediaId is set and src is empty, use stored src
                std::string renderSrc = src;
                // Prepend prefix for media URLs (src starts with /media/)
                const std::string &pfx = getPrefix();
                if (!renderSrc.empty() && renderSrc[0] == '/' && !pfx.empty() && pfx != "/") {
                    renderSrc = pfx + renderSrc;
                }

                libhtmlpp::HtmlElement img("img");
                img.setAttribute("src", renderSrc.c_str());
+5 −0
Changes for src/webedit/video/video.cpp: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -336,6 +336,11 @@ extern "C" {
                std::string responsiveClass = std::string("we-") + getInstanceId().c_str();

                std::string renderSrc = src;
                // Prepend prefix for media URLs (src starts with /media/)
                const std::string &pfx = getPrefix();
                if (!renderSrc.empty() && renderSrc[0] == '/' && !pfx.empty() && pfx != "/") {
                    renderSrc = pfx + renderSrc;
                }

                libhtmlpp::HtmlElement video("video");
                video.setAttribute("src", renderSrc.c_str());