Commit 3bdcfad5 authored by jan.koester's avatar jan.koester
Browse files

tets

parent 773ea8e8
Loading
Loading
Loading
Loading
+26 −1
Changes for src/edit.cpp: 26 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -728,7 +728,32 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml(
                libhtmlpp::Element *child = el->firstChild();
                if (child) childFrames.push_back({child, w});

            } else if (tag == "div" || tag == "article") {
            } else if (tag == "article") {
                tinyxml2::XMLElement *w = doc.NewElement("Article");
                if (cssProps.count("background-color")) w->SetAttribute("background_color", cssProps["background-color"].c_str());
                if (cssProps.count("border-radius")) w->SetAttribute("border_radius", cssProps["border-radius"].c_str());
                if (cssProps.count("border")) w->SetAttribute("border_style", cssProps["border"].c_str());
                if (cssProps.count("opacity")) w->SetAttribute("opacity", cssProps["opacity"].c_str());
                if (cssProps.count("padding")) w->SetAttribute("padding", cssProps["padding"].c_str());
                if (cssProps.count("margin")) w->SetAttribute("margin", cssProps["margin"].c_str());
                if (cssProps.count("max-width")) w->SetAttribute("max_width", cssProps["max-width"].c_str());
                if (cssProps.count("min-height")) w->SetAttribute("min_height", cssProps["min-height"].c_str());
                if (!cssClass.empty()) w->SetAttribute("css_class", cssClass.c_str());
                if (!elemId.empty()) w->SetAttribute("css_id", elemId.c_str());

                std::vector<std::string> knownCss = {"background-color","border-radius","border","opacity",
                    "padding","margin","max-width","min-height","display","flex-direction","justify-content"};
                std::string custom = extractCustomCss(cssProps, knownCss);
                if (!custom.empty()) {
                    tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss");
                    ccEl->SetText(custom.c_str());
                    w->InsertEndChild(ccEl);
                }
                pXml->InsertEndChild(w);
                libhtmlpp::Element *child = el->firstChild();
                if (child) childFrames.push_back({child, w});

            } else if (tag == "div") {
                tinyxml2::XMLElement *w = doc.NewElement("Container");
                if (cssProps.count("background-color")) w->SetAttribute("background_color", cssProps["background-color"].c_str());
                if (cssProps.count("border-radius")) w->SetAttribute("border_radius", cssProps["border-radius"].c_str());
+1 −0
Changes for src/webedit/CMakeLists.txt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -10,3 +10,4 @@ add_subdirectory(section)
add_subdirectory(video)
add_subdirectory(survey)
add_subdirectory(list)
add_subdirectory(article)
+11 −0
Changes for src/webedit/article/CMakeLists.txt: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
add_library(article SHARED article.cpp)

add_dependencies(article blogidev)

if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
    target_link_libraries(article PUBLIC blogidev kernel32.lib uuidp::uuidp htmlpp::htmlpp json-c::json-c tinyxml2::tinyxml2)
else()
    target_link_libraries(article PUBLIC blogidev dl uuidp::uuidp htmlpp::htmlpp json-c::json-c tinyxml2::tinyxml2)
endif()

install(TARGETS article DESTINATION lib/blogi/plugins/webedit)
+613 −0

File added.

Preview size limit exceeded, changes collapsed.