Loading src/blogi.cpp +13 −2 Changes for src/blogi.cpp: 13 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -1905,13 +1905,22 @@ RETRY_REQUEST: bool mobile=false; std::string rootel; std::string publishTarget; json_object *publishParams = nullptr; for(const auto &curdat : renderopts.urlData()){ if(curdat.key=="mobile" && curdat.value=="true"){ mobile=true; }else if(curdat.key=="rootel"){ rootel=curdat.value; }else if(curdat.key=="target"){ publishTarget=curdat.value; }else if(curdat.key!="authid"){ // Collect remaining params for the publish preview if(!publishParams) publishParams = json_object_new_object(); json_object_object_add(publishParams, curdat.key.c_str(), json_object_new_string(curdat.value.c_str())); } } Loading @@ -1927,7 +1936,9 @@ RETRY_REQUEST: curplg->getInstace()->Rendering(tid,curreq,&index,RenderingType::Desktop); } testedit->Renderer(curreq,tid,sessid,index,rootel); testedit->Renderer(curreq,tid,sessid,index,rootel,BlogiPlg.get(),publishTarget,publishParams); if(publishParams) json_object_put(publishParams); return; } Loading src/edit.cpp +29 −2 Changes for src/edit.cpp: 29 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2887,7 +2887,10 @@ void blogi::webedit::WebEditor::JsonApi(const int tid, json_object *request, jso void blogi::webedit::WebEditor::Renderer( libhttppp::HttpRequest& curreq, const int tid, const std::string &sessionid,const libhtmlpp::HtmlElement &index, const std::string &rootEl const std::string &rootEl, Plugin *plugins, const std::string &publishTarget, json_object *publishParams ){ libhtmlpp::HtmlString out; libhtmlpp::HtmlElement ridx=index; Loading @@ -2908,7 +2911,30 @@ void blogi::webedit::WebEditor::Renderer( root->appendChild(globalStyle); } // Render user-created document elements (if any) if (!publishTarget.empty() && plugins) { // Render widget tree to HTML string, then pass through target plugin's RenderPublished std::string renderedHtml; if (DocRoot) { libhtmlpp::HtmlElement wrapper("div"); const EditPlugin *el = DocRoot; while (el) { el->Render(wrapper); el = el->nextElement(); } libhtmlpp::HtmlString htmlOut; libhtmlpp::print(wrapper, htmlOut); renderedHtml = htmlOut.str(); } for (const Plugin::PluginData *curplg = plugins->getFirstPlugin(); curplg; curplg = curplg->getNextPlg()) { PluginApi *api = curplg->getInstace(); if (api && api->canPublish() && api->getName() == publishTarget) { api->RenderPublished(tid, renderedHtml, publishParams, ridx); break; } } } else { // Default: render widgets directly into root element if (DocRoot) { const EditPlugin *el = DocRoot; while (el) { Loading @@ -2917,6 +2943,7 @@ void blogi::webedit::WebEditor::Renderer( } } } } Args.theme->printSite(tid,out,&ridx,curreq.getRequestURL(),false); Loading Loading
src/blogi.cpp +13 −2 Changes for src/blogi.cpp: 13 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -1905,13 +1905,22 @@ RETRY_REQUEST: bool mobile=false; std::string rootel; std::string publishTarget; json_object *publishParams = nullptr; for(const auto &curdat : renderopts.urlData()){ if(curdat.key=="mobile" && curdat.value=="true"){ mobile=true; }else if(curdat.key=="rootel"){ rootel=curdat.value; }else if(curdat.key=="target"){ publishTarget=curdat.value; }else if(curdat.key!="authid"){ // Collect remaining params for the publish preview if(!publishParams) publishParams = json_object_new_object(); json_object_object_add(publishParams, curdat.key.c_str(), json_object_new_string(curdat.value.c_str())); } } Loading @@ -1927,7 +1936,9 @@ RETRY_REQUEST: curplg->getInstace()->Rendering(tid,curreq,&index,RenderingType::Desktop); } testedit->Renderer(curreq,tid,sessid,index,rootel); testedit->Renderer(curreq,tid,sessid,index,rootel,BlogiPlg.get(),publishTarget,publishParams); if(publishParams) json_object_put(publishParams); return; } Loading
src/edit.cpp +29 −2 Changes for src/edit.cpp: 29 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2887,7 +2887,10 @@ void blogi::webedit::WebEditor::JsonApi(const int tid, json_object *request, jso void blogi::webedit::WebEditor::Renderer( libhttppp::HttpRequest& curreq, const int tid, const std::string &sessionid,const libhtmlpp::HtmlElement &index, const std::string &rootEl const std::string &rootEl, Plugin *plugins, const std::string &publishTarget, json_object *publishParams ){ libhtmlpp::HtmlString out; libhtmlpp::HtmlElement ridx=index; Loading @@ -2908,7 +2911,30 @@ void blogi::webedit::WebEditor::Renderer( root->appendChild(globalStyle); } // Render user-created document elements (if any) if (!publishTarget.empty() && plugins) { // Render widget tree to HTML string, then pass through target plugin's RenderPublished std::string renderedHtml; if (DocRoot) { libhtmlpp::HtmlElement wrapper("div"); const EditPlugin *el = DocRoot; while (el) { el->Render(wrapper); el = el->nextElement(); } libhtmlpp::HtmlString htmlOut; libhtmlpp::print(wrapper, htmlOut); renderedHtml = htmlOut.str(); } for (const Plugin::PluginData *curplg = plugins->getFirstPlugin(); curplg; curplg = curplg->getNextPlg()) { PluginApi *api = curplg->getInstace(); if (api && api->canPublish() && api->getName() == publishTarget) { api->RenderPublished(tid, renderedHtml, publishParams, ridx); break; } } } else { // Default: render widgets directly into root element if (DocRoot) { const EditPlugin *el = DocRoot; while (el) { Loading @@ -2917,6 +2943,7 @@ void blogi::webedit::WebEditor::Renderer( } } } } Args.theme->printSite(tid,out,&ridx,curreq.getRequestURL(),false); Loading