Loading src/edit.cpp +20 −8 Original line number Diff line number Diff line Loading @@ -790,11 +790,13 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( 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 (cssProps.count("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["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"}; "padding","margin","max-width","min-height","width","height","display","flex-direction","justify-content"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading @@ -815,11 +817,13 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( 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 (cssProps.count("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["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"}; "padding","margin","max-width","min-height","width","height","display","flex-direction","justify-content"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading @@ -838,6 +842,8 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( 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("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["height"].c_str()); if (!cssClass.empty()) w->SetAttribute("css_class", cssClass.c_str()); if (!elemId.empty()) w->SetAttribute("css_id", elemId.c_str()); Loading @@ -849,7 +855,7 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( if (cssProps.count("grid-template-rows")) w->SetAttribute("rows", cssProps["grid-template-rows"].c_str()); if (cssProps.count("gap")) w->SetAttribute("gap", cssProps["gap"].c_str()); std::vector<std::string> knownCss = {"background-color","border-radius","border","opacity", "padding","margin","display","grid-template-columns","grid-template-rows","gap","align-items"}; "padding","margin","width","height","display","grid-template-columns","grid-template-rows","gap","align-items"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading @@ -858,7 +864,7 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( } } else { std::vector<std::string> knownCss = {"background-color","border-radius","border","opacity", "padding","margin","display","flex-direction","justify-content"}; "padding","margin","width","height","display","flex-direction","justify-content"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading Loading @@ -1003,7 +1009,7 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( row++; } std::vector<std::string> knownCss = {"border","background-color","border-collapse","width"}; std::vector<std::string> knownCss = {"border","background-color","border-collapse","width","height"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading @@ -1022,6 +1028,8 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( if (cssProps.count("list-style-type")) w->SetAttribute("list_style_type", cssProps["list-style-type"].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("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["height"].c_str()); libhtmlpp::Element *liEl = el->firstChild(); while (liEl) { Loading @@ -1041,7 +1049,7 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( } std::vector<std::string> knownCss = {"font-size","color","line-height","list-style-type", "padding","margin","display","flex-direction","gap"}; "padding","margin","width","height","display","flex-direction","gap"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading Loading @@ -1074,9 +1082,11 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( if (cssProps.count("padding")) w->SetAttribute("padding", cssProps["padding"].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("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["height"].c_str()); std::vector<std::string> knownCss = {"background-color","color","font-size","padding", "border-radius","border","display","text-decoration","cursor","text-align"}; "border-radius","border","width","height","display","text-decoration","cursor","text-align"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading Loading @@ -1112,11 +1122,13 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( if (cssProps.count("text-align")) w->SetAttribute("text_align", cssProps["text-align"].c_str()); if (cssProps.count("font-weight")) w->SetAttribute("font_weight", cssProps["font-weight"].c_str()); if (cssProps.count("font-style")) w->SetAttribute("font_style", cssProps["font-style"].c_str()); if (cssProps.count("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["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 = {"font-family","font-size","color","text-align", "font-weight","font-style","padding","margin","line-height"}; "font-weight","font-style","width","height","padding","margin","line-height"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading Loading
src/edit.cpp +20 −8 Original line number Diff line number Diff line Loading @@ -790,11 +790,13 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( 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 (cssProps.count("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["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"}; "padding","margin","max-width","min-height","width","height","display","flex-direction","justify-content"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading @@ -815,11 +817,13 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( 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 (cssProps.count("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["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"}; "padding","margin","max-width","min-height","width","height","display","flex-direction","justify-content"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading @@ -838,6 +842,8 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( 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("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["height"].c_str()); if (!cssClass.empty()) w->SetAttribute("css_class", cssClass.c_str()); if (!elemId.empty()) w->SetAttribute("css_id", elemId.c_str()); Loading @@ -849,7 +855,7 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( if (cssProps.count("grid-template-rows")) w->SetAttribute("rows", cssProps["grid-template-rows"].c_str()); if (cssProps.count("gap")) w->SetAttribute("gap", cssProps["gap"].c_str()); std::vector<std::string> knownCss = {"background-color","border-radius","border","opacity", "padding","margin","display","grid-template-columns","grid-template-rows","gap","align-items"}; "padding","margin","width","height","display","grid-template-columns","grid-template-rows","gap","align-items"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading @@ -858,7 +864,7 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( } } else { std::vector<std::string> knownCss = {"background-color","border-radius","border","opacity", "padding","margin","display","flex-direction","justify-content"}; "padding","margin","width","height","display","flex-direction","justify-content"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading Loading @@ -1003,7 +1009,7 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( row++; } std::vector<std::string> knownCss = {"border","background-color","border-collapse","width"}; std::vector<std::string> knownCss = {"border","background-color","border-collapse","width","height"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading @@ -1022,6 +1028,8 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( if (cssProps.count("list-style-type")) w->SetAttribute("list_style_type", cssProps["list-style-type"].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("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["height"].c_str()); libhtmlpp::Element *liEl = el->firstChild(); while (liEl) { Loading @@ -1041,7 +1049,7 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( } std::vector<std::string> knownCss = {"font-size","color","line-height","list-style-type", "padding","margin","display","flex-direction","gap"}; "padding","margin","width","height","display","flex-direction","gap"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading Loading @@ -1074,9 +1082,11 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( if (cssProps.count("padding")) w->SetAttribute("padding", cssProps["padding"].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("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["height"].c_str()); std::vector<std::string> knownCss = {"background-color","color","font-size","padding", "border-radius","border","display","text-decoration","cursor","text-align"}; "border-radius","border","width","height","display","text-decoration","cursor","text-align"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading Loading @@ -1112,11 +1122,13 @@ void blogi::webedit::WebEditor::htmlElementToWidgetXml( if (cssProps.count("text-align")) w->SetAttribute("text_align", cssProps["text-align"].c_str()); if (cssProps.count("font-weight")) w->SetAttribute("font_weight", cssProps["font-weight"].c_str()); if (cssProps.count("font-style")) w->SetAttribute("font_style", cssProps["font-style"].c_str()); if (cssProps.count("width")) w->SetAttribute("width", cssProps["width"].c_str()); if (cssProps.count("height")) w->SetAttribute("height", cssProps["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 = {"font-family","font-size","color","text-align", "font-weight","font-style","padding","margin","line-height"}; "font-weight","font-style","width","height","padding","margin","line-height"}; std::string custom = extractCustomCss(cssProps, knownCss, mediaRules); if (!custom.empty()) { tinyxml2::XMLElement *ccEl = doc.NewElement("CustomCss"); Loading