Commit 0a11361b authored by Jan Köster's avatar Jan Köster
Browse files

test

parent 5c83ca46
Loading
Loading
Loading
Loading
+24 −1
Changes for editor/html/js/properties.js: 24 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -1254,9 +1254,32 @@ var PropertiesPanel = (function() {
                                });
                            });

                            var emojiColorInput = document.createElement('input');
                            emojiColorInput.type = 'color';
                            emojiColorInput.title = I18n.t('I18N_ICON_COLOR', 'Icon-Farbe (dieser Link)');
                            emojiColorInput.value = item.icon_color || '#000000';
                            emojiColorInput.style.cssText = 'width:24px;height:24px;padding:0;border:none;flex:none;';
                            emojiColorInput.addEventListener('input', function() {
                                trlList[idx].icon_color = emojiColorInput.value;
                                trlSyncHidden();
                            });

                            var emojiColorResetBtn = document.createElement('button');
                            emojiColorResetBtn.type = 'button';
                            emojiColorResetBtn.textContent = '⟲';
                            emojiColorResetBtn.title = I18n.t('I18N_ICON_COLOR_RESET', 'Icon-Farbe zurücksetzen (Standard verwenden)');
                            emojiColorResetBtn.style.flex = 'none';
                            emojiColorResetBtn.addEventListener('click', function() {
                                trlList[idx].icon_color = '';
                                emojiColorInput.value = '#000000';
                                trlSyncHidden();
                            });

                            emojiRow.appendChild(emojiIconPreview);
                            emojiRow.appendChild(emojiInput);
                            emojiRow.appendChild(emojiIconBtn);
                            emojiRow.appendChild(emojiColorInput);
                            emojiRow.appendChild(emojiColorResetBtn);

                            var labelInput = document.createElement('input');
                            labelInput.type = 'text';
@@ -1307,7 +1330,7 @@ var PropertiesPanel = (function() {
                    trlAddBtn.className = 'faq-item-add';
                    trlAddBtn.textContent = '+ Link hinzufügen';
                    trlAddBtn.addEventListener('click', function() {
                        trlList.push({ icon_source: 'emoji', emoji: '', custom_icon_id: '', custom_icon_svg: '', label: '', url: '', new_tab: true });
                        trlList.push({ icon_source: 'emoji', emoji: '', custom_icon_id: '', custom_icon_svg: '', icon_color: '', label: '', url: '', new_tab: true });
                        trlSyncHidden();
                        trlRenderList();
                    });
+1 −1
Changes for editor/widgets/trustlinks/translations.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ namespace blogi { namespace webedit { namespace trustlinks_i18n {
            {"Icon Type", "Icon-Typ"},
            {"Icon (Emoji)", "Icon (Emoji)"},
            {"Custom Icon (from Library)", "Eigenes Icon (aus Bibliothek)"},
            {"Icon Color", "Icon-Farbe"},
            {"Icon Color (Default)", "Icon-Farbe (Standard)"},
            {"Title", "Titel"},
            {"Title Font Size", "Titel Schriftgröße"},
            {"Title Color (Dark)", "Titelfarbe (Dunkel)"},
+15 −5
Changes for editor/widgets/trustlinks/trustlinks.cpp: 15 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ extern "C" {
                std::string emoji;
                std::string customIconId;
                std::string customIconSvg; // resolved SVG (denormalized copy), used when iconSource == "custom"
                std::string iconColor; // per-item fill override; falls back to the widget-level iconColor, then currentColor
                std::string label;
                std::string url;
                bool newTab = true;
@@ -227,7 +228,7 @@ extern "C" {
                    json_object_object_add(f, "svgTargetKey", json_object_new_string("custom_icon_svg"));
                }
                addField("custom_icon_svg", "", "hidden");
                addField("icon_color", "Icon Color", "color_var", nullptr, "all", nullptr, "simple",
                addField("icon_color", "Icon Color (Default)", "color_var", nullptr, "all", nullptr, "simple",
                          mkVisible("icon_source", "custom"));
                addField("title", "Title", "text", "e.g. Sanierungslösungen", "all", nullptr, "simple");
                addField("title_font_size", "Title Font Size", "text", "24px", "desktop");
@@ -354,6 +355,7 @@ extern "C" {
                    itemEl->SetAttribute("icon_source", item.iconSource.c_str());
                    itemEl->SetAttribute("emoji", item.emoji.c_str());
                    itemEl->SetAttribute("custom_icon_id", item.customIconId.c_str());
                    itemEl->SetAttribute("icon_color", item.iconColor.c_str());
                    itemEl->SetAttribute("label", item.label.c_str());
                    itemEl->SetAttribute("url",   item.url.c_str());
                    itemEl->SetAttribute("new_tab", item.newTab ? "true" : "false");
@@ -432,6 +434,7 @@ extern "C" {
                    val = itemEl->Attribute("icon_source"); if (val) it.iconSource = val;
                    val = itemEl->Attribute("emoji"); if (val) it.emoji = val;
                    val = itemEl->Attribute("custom_icon_id"); if (val) it.customIconId = val;
                    val = itemEl->Attribute("icon_color"); if (val) it.iconColor = val;
                    val = itemEl->Attribute("label"); if (val) it.label = val;
                    val = itemEl->Attribute("url");   if (val) it.url   = val;
                    val = itemEl->Attribute("new_tab");
@@ -500,6 +503,7 @@ extern "C" {
                    json_object_object_add(ji, "emoji", json_object_new_string(it.emoji.c_str()));
                    json_object_object_add(ji, "custom_icon_id", json_object_new_string(it.customIconId.c_str()));
                    json_object_object_add(ji, "custom_icon_svg", json_object_new_string(it.customIconSvg.c_str()));
                    json_object_object_add(ji, "icon_color", json_object_new_string(it.iconColor.c_str()));
                    json_object_object_add(ji, "label", json_object_new_string(it.label.c_str()));
                    json_object_object_add(ji, "url",   json_object_new_string(it.url.c_str()));
                    json_object_object_add(ji, "new_tab", json_object_new_boolean(it.newTab));
@@ -608,6 +612,10 @@ extern "C" {
                            const char *str = json_object_get_string(jf);
                            it.customIconSvg = str ? str : "";
                        }
                        if (json_object_object_get_ex(ji, "icon_color", &jf) && jf) {
                            const char *str = json_object_get_string(jf);
                            it.iconColor = str ? str : "";
                        }
                        if (json_object_object_get_ex(ji, "label", &jf) && jf) {
                            const char *str = json_object_get_string(jf);
                            it.label = str ? str : "";
@@ -730,10 +738,12 @@ extern "C" {
                        std::string viewBox, inner;
                        svgmarkup::parse(item.customIconSvg, viewBox, inner);
                        std::string vb = viewBox.empty() ? "0 0 24 24" : viewBox;
                        // Explicit Icon Color wins (independent of linkTextColor);
                        // otherwise fall back to currentColor, which inherits the
                        // link's own text color (set on the <a> below via CSS `color`).
                        std::string iconFill = validCss(iconColor) ? iconColor : "currentColor";
                        // Per-item Icon Color wins; then the widget-level Icon
                        // Color; otherwise fall back to currentColor, which
                        // inherits the link's own text color (set on the <a>
                        // below via CSS `color`).
                        std::string iconFill = validCss(item.iconColor) ? item.iconColor :
                                                (validCss(iconColor) ? iconColor : "currentColor");
                        std::string iconSvgHtml =
                            "<span style=\"display:inline-flex;width:1.1em;height:1.1em;vertical-align:middle;margin-right:6px;\">"
                            "<svg width=\"100%\" height=\"100%\" viewBox=\"" + vb +