Loading data/template/default/editor.html +18 −1 Changes for data/template/default/editor.html: 18 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -13,6 +13,12 @@ <li>Webeditor</li> </ul> <ul class="headertools"> <li> <button id="mobile_view" >Mobile</button> </li> <li> <button id="desktop_view" >Desktop</button> </li> <li> <button type="button">Make Public</button> </li> Loading Loading @@ -46,12 +52,23 @@ </td> <td id="preview"> <div> <iframe id="rendering" src="aboutme.html"></iframe> <iframe id="rendering" rel="nofollow" src="${prefix}/render?mobile=true"></iframe> </div> </td> </tr> </table> </main> <footer></footer> <script> document.getElementById('mobile_view').addEventListener("click", (e) => { document.getElementById('rendering').src='${prefix}/render?mobile=true' document.getElementById('rendering').style.width='400px'; }); document.getElementById('desktop_view').addEventListener("click", (e) => { document.getElementById('rendering').src='${prefix}/render' document.getElementById('rendering').style.width='100%'; }); </script> </body> </html> data/template/default/mobile.html +8 −55 Changes for data/template/default/mobile.html: 8 added lines, 55 removed lines. Original line number Diff line number Diff line Loading @@ -15,69 +15,22 @@ <div id="menunav"> <ul> <li> <svg width="48" height="48" viewBox="0 0 12.7 12.7" version="1.1" id="svg5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <svg width="48" height="48" viewBox="0 0 12.7 12.7" version="1.1" id="svg5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <defs id="defs2"> <linearGradient id="linearGradient799"> <stop style="stop-color:#b2b2b2;stop-opacity:1;" offset="0" id="stop797" /> <stop style="stop-color:#b2b2b2;stop-opacity:1;" offset="0" id="stop797"/> </linearGradient> <linearGradient xlink:href="#linearGradient799" id="linearGradient801" x1="14.186104" y1="121.67753" x2="195.50539" y2="121.67753" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.0330639,0,0,0.99987297,-3.4472755,0.01545695)" /> <linearGradient xlink:href="#linearGradient799" id="linearGradient801" x1="14.186104"y1="121.67753" x2="195.50539" y2="121.67753" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.0330639,0,0,0.99987297,-3.4472755,0.01545695)" /> </defs> <g id="layer1" transform="matrix(0.06380028,0,0,0.07361519,-0.35623634,-2.58322)"> <rect style="fill:none;fill-opacity:1;stroke:url(#linearGradient801);stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none" id="rect111" width="187.31439" height="162.62489" x="11.207876" y="40.365086" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962" width="161.06856" height="3.4071507" x="22.840359" y="72.404007" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962-3" width="161.06856" height="3.4071507" x="23.476486" y="117.72447" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962-6" width="161.06856" height="3.4071507" x="23.403488" y="160.75395" /> <g id="layer1" transform="matrix(0.06380028,0,0,0.07361519,-0.35623634,-2.58322)"> <rect style="fill:none;fill-opacity:1;stroke:url(#linearGradient801);stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none" id="rect111" width="187.31439" height="162.62489" x="11.207876" y="40.365086" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962" width="161.06856" height="3.4071507" x="22.840359" y="72.404007" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962-3" width="161.06856" height="3.4071507" x="23.476486" y="117.72447" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962-6" width="161.06856" height="3.4071507" x="23.403488" y="160.75395" /> </g> </svg> </li> <li> </li> </ul> </div> Loading data/template/default/public/editor.css +6 −2 Changes for data/template/default/public/editor.css: 6 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -20,6 +20,10 @@ header { margin:0px; } .headertools li{ float:left; } .headertools button { } Loading Loading @@ -75,7 +79,7 @@ td#preview { } #rendering{ display:inline-block; width:100%; display:block; height:70vh; margin: 0 auto; } src/blogi.cpp +35 −1 Changes for src/blogi.cpp: 35 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -89,7 +89,12 @@ blogi::Blogi::Blogi(netplus::socket &serversocket,bool debug) : HttpEvent(server sess._initSession(initdb.get()); for(int i=0; i<threads; ++i){ try{ PlgArgs->database[i]= new dbpp::Database(Blogi::Cfg->getdbdriver(), Blogi::Cfg->getdbopts()); }catch(const char *e){ std::cerr << e << std::endl; return; } } dbpp::SQL optsql; Loading @@ -109,11 +114,16 @@ blogi::Blogi::Blogi(netplus::socket &serversocket,bool debug) : HttpEvent(server PlgArgs->smtp=new SmtpSettings; try{ getConfig(*PlgArgs->database[0],"SMTPHOST",PlgArgs->smtp->_SHost); getConfig(*PlgArgs->database[0],"SMTPPORT",PlgArgs->smtp->_SPort); getConfig(*PlgArgs->database[0],"SMTPUSER",PlgArgs->smtp->_SUser); getConfig(*PlgArgs->database[0],"SMTPSENDER",PlgArgs->smtp->_Sender); getConfig(*PlgArgs->database[0],"SMTPPASSWORD",PlgArgs->smtp->_SPass); }catch(const char *e){ std::cerr << e << std::endl; return; } PlgArgs->auth=new Auth(PlgArgs->database,PlgArgs->config); Loading Loading @@ -542,7 +552,31 @@ RETRY_REQUEST: webedit::WebEditor(*PlgArgs,curreq,tid,sessid); return; }else if(curreq.getRequestURL().compare(0,strlen(PlgArgs->config->buildurl("render",url,512)),PlgArgs->config->buildurl("render",url,512))==0){ webedit::Renderer(*PlgArgs,curreq,tid,sessid); libhttppp::HttpForm renderopts; renderopts.parse(curreq); bool mobile=false; for(libhttppp::HttpForm::UrlcodedForm::Data *curdat=renderopts.UrlFormData.getFormData(); curdat; curdat=curdat->nextData()){ if(curdat->getKey()=="mobile" && curdat->getValue()=="true"){ mobile=true; } } if(mobile) index=MIndex; else index=Index; for(const blogi::Plugin::PluginData *curplg=BlogiPlg->getFirstPlugin(); curplg; curplg=curplg->getNextPlg()){ if(mobile) curplg->getInstace()->Rendering(tid,curreq,&index,RenderingType::Mobile); else curplg->getInstace()->Rendering(tid,curreq,&index,RenderingType::Desktop); } webedit::Renderer(*PlgArgs,curreq,tid,sessid,index); return; }else if (curreq.getRequestURL().find("robots.txt")!=std::string::npos){ const char *robot = "user-agent: *\r\ndisallow: /blog/settings/"; Loading src/conf.h +4 −1 Changes for src/conf.h: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -101,7 +101,10 @@ namespace blogi { dbpp::SQL sql; dbpp::DBResult res; sql << "SELECT value FROM options WHERE key='" << key.c_str() << "'"; db.exec(sql,res); int rows=db.exec(sql,res); if(rows<1){ throw "configkey not found !"; } value=res[0][0]; } Loading Loading
data/template/default/editor.html +18 −1 Changes for data/template/default/editor.html: 18 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -13,6 +13,12 @@ <li>Webeditor</li> </ul> <ul class="headertools"> <li> <button id="mobile_view" >Mobile</button> </li> <li> <button id="desktop_view" >Desktop</button> </li> <li> <button type="button">Make Public</button> </li> Loading Loading @@ -46,12 +52,23 @@ </td> <td id="preview"> <div> <iframe id="rendering" src="aboutme.html"></iframe> <iframe id="rendering" rel="nofollow" src="${prefix}/render?mobile=true"></iframe> </div> </td> </tr> </table> </main> <footer></footer> <script> document.getElementById('mobile_view').addEventListener("click", (e) => { document.getElementById('rendering').src='${prefix}/render?mobile=true' document.getElementById('rendering').style.width='400px'; }); document.getElementById('desktop_view').addEventListener("click", (e) => { document.getElementById('rendering').src='${prefix}/render' document.getElementById('rendering').style.width='100%'; }); </script> </body> </html>
data/template/default/mobile.html +8 −55 Changes for data/template/default/mobile.html: 8 added lines, 55 removed lines. Original line number Diff line number Diff line Loading @@ -15,69 +15,22 @@ <div id="menunav"> <ul> <li> <svg width="48" height="48" viewBox="0 0 12.7 12.7" version="1.1" id="svg5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <svg width="48" height="48" viewBox="0 0 12.7 12.7" version="1.1" id="svg5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <defs id="defs2"> <linearGradient id="linearGradient799"> <stop style="stop-color:#b2b2b2;stop-opacity:1;" offset="0" id="stop797" /> <stop style="stop-color:#b2b2b2;stop-opacity:1;" offset="0" id="stop797"/> </linearGradient> <linearGradient xlink:href="#linearGradient799" id="linearGradient801" x1="14.186104" y1="121.67753" x2="195.50539" y2="121.67753" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.0330639,0,0,0.99987297,-3.4472755,0.01545695)" /> <linearGradient xlink:href="#linearGradient799" id="linearGradient801" x1="14.186104"y1="121.67753" x2="195.50539" y2="121.67753" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.0330639,0,0,0.99987297,-3.4472755,0.01545695)" /> </defs> <g id="layer1" transform="matrix(0.06380028,0,0,0.07361519,-0.35623634,-2.58322)"> <rect style="fill:none;fill-opacity:1;stroke:url(#linearGradient801);stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none" id="rect111" width="187.31439" height="162.62489" x="11.207876" y="40.365086" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962" width="161.06856" height="3.4071507" x="22.840359" y="72.404007" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962-3" width="161.06856" height="3.4071507" x="23.476486" y="117.72447" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962-6" width="161.06856" height="3.4071507" x="23.403488" y="160.75395" /> <g id="layer1" transform="matrix(0.06380028,0,0,0.07361519,-0.35623634,-2.58322)"> <rect style="fill:none;fill-opacity:1;stroke:url(#linearGradient801);stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none" id="rect111" width="187.31439" height="162.62489" x="11.207876" y="40.365086" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962" width="161.06856" height="3.4071507" x="22.840359" y="72.404007" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962-3" width="161.06856" height="3.4071507" x="23.476486" y="117.72447" /> <rect style="fill:#b2b2b2;fill-opacity:1;stroke:#b1b1b1;stroke-width:3.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" id="rect962-6" width="161.06856" height="3.4071507" x="23.403488" y="160.75395" /> </g> </svg> </li> <li> </li> </ul> </div> Loading
data/template/default/public/editor.css +6 −2 Changes for data/template/default/public/editor.css: 6 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -20,6 +20,10 @@ header { margin:0px; } .headertools li{ float:left; } .headertools button { } Loading Loading @@ -75,7 +79,7 @@ td#preview { } #rendering{ display:inline-block; width:100%; display:block; height:70vh; margin: 0 auto; }
src/blogi.cpp +35 −1 Changes for src/blogi.cpp: 35 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -89,7 +89,12 @@ blogi::Blogi::Blogi(netplus::socket &serversocket,bool debug) : HttpEvent(server sess._initSession(initdb.get()); for(int i=0; i<threads; ++i){ try{ PlgArgs->database[i]= new dbpp::Database(Blogi::Cfg->getdbdriver(), Blogi::Cfg->getdbopts()); }catch(const char *e){ std::cerr << e << std::endl; return; } } dbpp::SQL optsql; Loading @@ -109,11 +114,16 @@ blogi::Blogi::Blogi(netplus::socket &serversocket,bool debug) : HttpEvent(server PlgArgs->smtp=new SmtpSettings; try{ getConfig(*PlgArgs->database[0],"SMTPHOST",PlgArgs->smtp->_SHost); getConfig(*PlgArgs->database[0],"SMTPPORT",PlgArgs->smtp->_SPort); getConfig(*PlgArgs->database[0],"SMTPUSER",PlgArgs->smtp->_SUser); getConfig(*PlgArgs->database[0],"SMTPSENDER",PlgArgs->smtp->_Sender); getConfig(*PlgArgs->database[0],"SMTPPASSWORD",PlgArgs->smtp->_SPass); }catch(const char *e){ std::cerr << e << std::endl; return; } PlgArgs->auth=new Auth(PlgArgs->database,PlgArgs->config); Loading Loading @@ -542,7 +552,31 @@ RETRY_REQUEST: webedit::WebEditor(*PlgArgs,curreq,tid,sessid); return; }else if(curreq.getRequestURL().compare(0,strlen(PlgArgs->config->buildurl("render",url,512)),PlgArgs->config->buildurl("render",url,512))==0){ webedit::Renderer(*PlgArgs,curreq,tid,sessid); libhttppp::HttpForm renderopts; renderopts.parse(curreq); bool mobile=false; for(libhttppp::HttpForm::UrlcodedForm::Data *curdat=renderopts.UrlFormData.getFormData(); curdat; curdat=curdat->nextData()){ if(curdat->getKey()=="mobile" && curdat->getValue()=="true"){ mobile=true; } } if(mobile) index=MIndex; else index=Index; for(const blogi::Plugin::PluginData *curplg=BlogiPlg->getFirstPlugin(); curplg; curplg=curplg->getNextPlg()){ if(mobile) curplg->getInstace()->Rendering(tid,curreq,&index,RenderingType::Mobile); else curplg->getInstace()->Rendering(tid,curreq,&index,RenderingType::Desktop); } webedit::Renderer(*PlgArgs,curreq,tid,sessid,index); return; }else if (curreq.getRequestURL().find("robots.txt")!=std::string::npos){ const char *robot = "user-agent: *\r\ndisallow: /blog/settings/"; Loading
src/conf.h +4 −1 Changes for src/conf.h: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -101,7 +101,10 @@ namespace blogi { dbpp::SQL sql; dbpp::DBResult res; sql << "SELECT value FROM options WHERE key='" << key.c_str() << "'"; db.exec(sql,res); int rows=db.exec(sql,res); if(rows<1){ throw "configkey not found !"; } value=res[0][0]; } Loading