Commit 727d7619 authored by jan.koester's avatar jan.koester
Browse files

win compiles

parent 662821d1
Loading
Loading
Loading
Loading
+4 −4
Changes for editor/src/main.cpp: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -87,10 +87,6 @@ int main(int argc, char *argv[]) {
                if (i) joined += ':';
                joined += dirs[i];
            }
            if (!joined.empty()) {
                setenv("BLOGI_WEBEDIT_NODE_WIDGET_DIRS", joined.c_str(), 1);
                std::cout << "Configured Node.js widget directories: " << joined << std::endl;
            }
        }

        // Initialize database (with retry for container network setup)
@@ -111,7 +107,11 @@ int main(int argc, char *argv[]) {
                    return EXIT_FAILURE;
                }
                std::cerr << "  retrying in " << retrySec << "s..." << std::endl;
#ifdef _WIN32
                Sleep(retrySec*1024);
#elif
                sleep(retrySec);
#endif
            }
        }
        webedit::Database &db = *dbPtr;
+2 −2
Changes for editor/widgets/googlemaps/CMakeLists.txt: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -7,9 +7,9 @@ else()
endif()

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

install (TARGETS googlemaps DESTINATION lib/blogi/editor/widgets)
+16 −9
Changes for editor/widgets/googlemaps/googlemaps.cpp: 16 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ namespace blogi {
                tinyxml2::XMLElement* el = doc->NewElement("GoogleMaps");
                if(!_address.empty()) el->SetAttribute("address", _address.c_str());
                if(!_zoom.empty()) el->SetAttribute("zoom", _zoom.c_str());
                el->SetAttribute("id", Id.toString().c_str());
                el->SetAttribute("id", Id.c_str());
                return el;
            }

@@ -103,9 +103,6 @@ namespace blogi {
                }
            }

            bool canHaveChildren() const override { return false; }
            bool haveChilds() override { return false; }

            void Settings(libhttppp::HttpRequest &curreq, libhtmlpp::HtmlElement &settings) override {}

            void Render(libhtmlpp::HtmlElement &el) const override {
@@ -120,11 +117,21 @@ namespace blogi {
                el.appendChild(iframe);
            }

            void setChildElement(const EditPlugin &el) override {}
            void unsetChildElement(const EditPlugin &el) override {}
            void addNextElement(const EditPlugin &el) override {}
            void remNextElement(const EditPlugin &el) override {}
            const EditPlugin *getChildElement() const override { return nullptr; }
            bool canHaveChildren() const override { return false; }
            bool haveChilds() override { return false; }

            void setChildElement(const EditPlugin &) override {
                logError("Video cannot have children.");
            }
            void unsetChildElement(const EditPlugin &) override {
                logError("Video cannot have children.");
            }
            void addNextElement(const EditPlugin &) override {
                logError("Video does not support addNextElement.");
            }
            void remNextElement(const EditPlugin &) override {
                logError("Video does not support remNextElement.");
            }

        private:
            std::string _address = "Wetzlar, Deutschland";
+5 −4
Changes for editor/widgets/googlereviews/googlereviews.cpp: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ namespace blogi {

            tinyxml2::XMLElement* toXmlObject(tinyxml2::XMLDocument* doc) override {
                tinyxml2::XMLElement* el = doc->NewElement("GoogleReviews");
                el->SetAttribute("id", Id.toString().c_str());
                el->SetAttribute("id", Id.c_str());
                return el;
            }

@@ -58,6 +58,7 @@ namespace blogi {
            }

            bool canHaveChildren() const override { return false; }

            bool haveChilds() override { return false; }

            void Settings(libhttppp::HttpRequest &curreq, libhtmlpp::HtmlElement &settings) override {}
@@ -70,7 +71,8 @@ namespace blogi {
                
                // Add script to dynamically load reviews
                libhtmlpp::HtmlElement *script = new libhtmlpp::HtmlElement("script");
                libhtmlpp::ScriptElement js = R"(
                libhtmlpp::ScriptElement js;
                js.setScript(R"(
                    document.addEventListener('DOMContentLoaded', function() {
                        fetch('/google/reviews/list')
                            .then(response => response.json())
@@ -106,7 +108,7 @@ namespace blogi {
                            })
                            .catch(err => console.error('Error fetching reviews:', err));
                    });
                )";
                )");
                
                script->appendChild(js);
                
@@ -121,7 +123,6 @@ namespace blogi {
            void unsetChildElement(const EditPlugin &el) override {}
            void addNextElement(const EditPlugin &el) override {}
            void remNextElement(const EditPlugin &el) override {}
            const EditPlugin *getChildElement() const override { return nullptr; }
        };
    }
}
+2 −2
Changes for plugins/google/CMakeLists.txt: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -3,9 +3,9 @@ add_library(google SHARED google.cpp)
add_dependencies(google blogidev)

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

install (TARGETS google DESTINATION lib/blogi/plugins)
Loading