From 74c8a857e4e7627daf09dd53fd6051c3f1c59f8c Mon Sep 17 00:00:00 2001 From: thepra Date: Thu, 25 May 2017 22:35:59 +0200 Subject: [PATCH] up --- TestWebGen/GeneralBuilder.cpp | 13 +-- TestWebGen/TestWebGen.cpp | 2 +- TestWebGen/ThePraDev.h | 153 +++++++++++++++++----------------- 3 files changed, 83 insertions(+), 85 deletions(-) diff --git a/TestWebGen/GeneralBuilder.cpp b/TestWebGen/GeneralBuilder.cpp index 5d3bfb3..1c36618 100644 --- a/TestWebGen/GeneralBuilder.cpp +++ b/TestWebGen/GeneralBuilder.cpp @@ -93,12 +93,12 @@ void GeneralBuilder::BuildThePraSite(Sites site) } } -void GeneralBuilder::Head(Document &file, - string canonicalURL, - string title, - Levels level, - string description, - list cssStyles) +void GeneralBuilder::Head( Document &file, + string canonicalURL, + string title, + Levels level, + string description, + list cssStyles) { string whichLevel = ChooseLevel(level); // ESSENTIAL @@ -164,6 +164,7 @@ void GeneralBuilder::Body(Document &file, string cPath, Sites site, Col color, P void GeneralBuilder::WriteToFile(Document doc, string p) { + //cout << doc.ToString(Readability::MULTILINE) << endl; path PathToCheck = path(p); if (exists(PathToCheck)) { diff --git a/TestWebGen/TestWebGen.cpp b/TestWebGen/TestWebGen.cpp index 0f8ce5f..4720b41 100644 --- a/TestWebGen/TestWebGen.cpp +++ b/TestWebGen/TestWebGen.cpp @@ -16,7 +16,7 @@ using namespace CTML; int main() { GeneralBuilder dev; - dev.BuildThePraSite(Utilities::ART); + dev.BuildThePraSite(Utilities::DEV); cout << "DONE"; getchar(); return 0; diff --git a/TestWebGen/ThePraDev.h b/TestWebGen/ThePraDev.h index 4d024e5..ace19b5 100644 --- a/TestWebGen/ThePraDev.h +++ b/TestWebGen/ThePraDev.h @@ -26,7 +26,7 @@ public: contentFolder + "about.txt", contentFolder + "contact.txt" }; - string outputPath{current_path().append("output_thepradev\\").string()}; + string outputPath{ current_path().append("output_thepradev\\").string() }; string outputLinks[5]{ outputPath + "index.html", outputPath + "code.html", @@ -34,13 +34,13 @@ public: outputPath + "about.html", outputPath + "contact.html" }; - + static void BuildBody(Document &file, string cPath, Levels level, PageType ptype = NORMAL); private: static list NavigationBar(Levels level, DeskOrMob mtype); - static list SingleMainContent(Levels level, string cPath, DeskOrMob mtype, list content = {""}); + static list SingleMainContent(Levels level, string cPath, DeskOrMob mtype, list content = { "" }); static Node Extra(Levels level); static Node Player(Levels level); }; @@ -82,71 +82,71 @@ inline list ThePraDev::NavigationBar(Levels level, DeskOrMob mtype) string whichLevel = ChooseLevel(level); switch (mtype) { - case D: - { - Node elem0 = Node("div#header"); - Node elem05 = Node("div.navigation_bar"); - Node elem1 = Node("img").SetAttribute(a.src, whichLevel + "icon/up.png").SetAttribute(a.alt, "Upper Decoration").UseClosingTag(false); - Node elem2 = Node("ul.bortrr.borbrr"); - Node elem3 = Node("li.bortrr").AppendChild(Node(a.a, a.Home).SetAttribute(a.href, whichLevel + a.index)); - Node elem4 = Node(a.li).AppendChild(Node(a.a, a.Code).SetAttribute(a.href, whichLevel + a.code)); - Node elem5 = Node(a.li).AppendChild(Node(a.a, a.Blog).SetAttribute(a.href, whichLevel + a.blog)); - Node elem6 = Node(a.li).AppendChild(Node(a.a, a.About).SetAttribute(a.href, whichLevel + a.about)); - Node elem7 = Node(a.li).AppendChild(Node(a.a, a.Contact).SetAttribute(a.href, whichLevel + a.contact)); - Node elem8 = Extra(level); - Node elem9 = Node("img").SetAttribute(a.src, whichLevel + "icon/down.png").SetAttribute(a.alt, "Down Decoration").UseClosingTag(false); + case D: + { + Node elem0 = Node("div#header"); + Node elem05 = Node("div.navigation_bar"); + Node elem1 = Node("img").SetAttribute(a.src, whichLevel + "icon/up.png").SetAttribute(a.alt, "Upper Decoration").UseClosingTag(false); + Node elem2 = Node("ul.bortrr.borbrr"); + Node elem3 = Node("li.bortrr").AppendChild(Node(a.a, a.Home).SetAttribute(a.href, whichLevel + a.index)); + Node elem4 = Node(a.li).AppendChild(Node(a.a, a.Code).SetAttribute(a.href, whichLevel + a.code)); + Node elem5 = Node(a.li).AppendChild(Node(a.a, a.Blog).SetAttribute(a.href, whichLevel + a.blog)); + Node elem6 = Node(a.li).AppendChild(Node(a.a, a.About).SetAttribute(a.href, whichLevel + a.about)); + Node elem7 = Node(a.li).AppendChild(Node(a.a, a.Contact).SetAttribute(a.href, whichLevel + a.contact)); + Node elem8 = Extra(level); + Node elem9 = Node("img").SetAttribute(a.src, whichLevel + "icon/down.png").SetAttribute(a.alt, "Down Decoration").UseClosingTag(false); - elem05.AppendChild(elem1) - .AppendChild(elem2 - .AppendChild(elem3) - .AppendChild(elem4) - .AppendChild(elem5) - .AppendChild(elem6) - .AppendChild(elem7) - .AppendChild(elem8)) - .AppendChild(elem9); - elem0.AppendChild(elem05); - - return{{elem0}}; - } - break; - case M: - { - Node elem0 = Node("div#headerm"); - Node elem05 = Node("div.navigation_barm"); - Node elem1 = Node("img.immagini_laterali").SetAttribute(a.src, whichLevel + "icon/left.png").SetAttribute(a.alt, "Upper Left Decoration").UseClosingTag(false); - Node elem2 = Node("div.navigation_barminner"); + elem05.AppendChild(elem1) + .AppendChild(elem2 + .AppendChild(elem3) + .AppendChild(elem4) + .AppendChild(elem5) + .AppendChild(elem6) + .AppendChild(elem7) + .AppendChild(elem8)) + .AppendChild(elem9); + elem0.AppendChild(elem05); - Node elem3 = Node("nav._nav"); - Node elem4 = Node("label.toggle").SetAttribute("for", "drop").SetContent(a.Menu); - Node elem5 = Node("input#drop").SetAttribute("type", "checkbox").UseClosingTag(false); - Node elem6 = Node("ul.menu"); - Node elem7 = Node(a.li).AppendChild(Node(a.a, a.Home).SetAttribute(a.href, whichLevel + a.index)); - Node elem8 = Node(a.li).AppendChild(Node(a.a, a.Code).SetAttribute(a.href, whichLevel + a.code)); - Node elem9 = Node(a.li).AppendChild(Node(a.a, a.Blog).SetAttribute(a.href, whichLevel + a.blog)); - Node elem10 = Node(a.li).AppendChild(Node(a.a, a.About).SetAttribute(a.href, whichLevel + a.about)); - Node elem11 = Node(a.li).AppendChild(Node(a.a, a.Contact).SetAttribute(a.href, whichLevel + a.contact)); + return{ {elem0} }; + } + break; + case M: + { + Node elem0 = Node("div#headerm"); + Node elem05 = Node("div.navigation_barm"); + Node elem1 = Node("img.immagini_laterali").SetAttribute(a.src, whichLevel + "icon/left.png").SetAttribute(a.alt, "Upper Left Decoration").UseClosingTag(false); + Node elem2 = Node("div.navigation_barminner"); - Node elem12 = Node("img.immagini_laterali").SetAttribute(a.src, whichLevel + "icon/right.png").SetAttribute(a.alt, "Upper Right Decoration").UseClosingTag(false); + Node elem3 = Node("nav._nav"); + Node elem4 = Node("label.toggle").SetAttribute("for", "drop").SetContent(a.Menu); + Node elem5 = Node("input#drop").SetAttribute("type", "checkbox").UseClosingTag(false); + Node elem6 = Node("ul.menu"); + Node elem7 = Node(a.li).AppendChild(Node(a.a, a.Home).SetAttribute(a.href, whichLevel + a.index)); + Node elem8 = Node(a.li).AppendChild(Node(a.a, a.Code).SetAttribute(a.href, whichLevel + a.code)); + Node elem9 = Node(a.li).AppendChild(Node(a.a, a.Blog).SetAttribute(a.href, whichLevel + a.blog)); + Node elem10 = Node(a.li).AppendChild(Node(a.a, a.About).SetAttribute(a.href, whichLevel + a.about)); + Node elem11 = Node(a.li).AppendChild(Node(a.a, a.Contact).SetAttribute(a.href, whichLevel + a.contact)); - elem05.AppendChild(elem2 - .AppendChild(elem3 - .AppendChild(elem4) - .AppendChild(elem5) - .AppendChild(elem6 - .AppendChild(elem7) - .AppendChild(elem8) - .AppendChild(elem9) - .AppendChild(elem10) - .AppendChild(elem11)))); - elem0.AppendChild(elem1).AppendChild(elem05).AppendChild(elem12); - //cout << elem0.ToString(Readability::MULTILINE, 5) << endl; + Node elem12 = Node("img.immagini_laterali").SetAttribute(a.src, whichLevel + "icon/right.png").SetAttribute(a.alt, "Upper Right Decoration").UseClosingTag(false); - return{{elem0}}; - } - break; - default: return{{}}; - break; + elem05.AppendChild(elem2 + .AppendChild(elem3 + .AppendChild(elem4) + .AppendChild(elem5) + .AppendChild(elem6 + .AppendChild(elem7) + .AppendChild(elem8) + .AppendChild(elem9) + .AppendChild(elem10) + .AppendChild(elem11)))); + elem0.AppendChild(elem1).AppendChild(elem05).AppendChild(elem12); + //cout << elem0.ToString(Readability::MULTILINE, 5) << endl; + + return{ {elem0} }; + } + break; + default: return{ {} }; + break; } } @@ -155,7 +155,7 @@ inline list ThePraDev::SingleMainContent(Levels level, string cPath, DeskO { ThePraDev a; string whichLevel = ChooseLevel(level); - Node mainC = Node("div#main"); + Node mainC = Node("div.main"); Node mainMC = mainC; string STRING; string contentDesktop = ""; @@ -170,8 +170,8 @@ inline list ThePraDev::SingleMainContent(Levels level, string cPath, DeskO mainC.SetContent(item+"\n"); }*/ if (mtype == D) - return{mainC}; - else return{mainMC}; + return{ mainC }; + else return{ mainMC }; } inline Node ThePraDev::Extra(Levels level) { @@ -180,10 +180,10 @@ inline Node ThePraDev::Extra(Levels level) Node extra = Node("li.borbrr") .AppendChild(Node(a.a, "+ Extra +")) .AppendChild(Node("ul.borbrr") - .AppendChild(Node("li.colbk") - .AppendChild(Node("img.fiximgmenu").SetAttribute(a.src, whichLevel + "icon/signbot.gif").SetAttribute(a.alt, "MotD").UseClosingTag(false))) - .AppendChild(Node(a.li) - .AppendChild(Player(level)))); + .AppendChild(Node("li.colbk") + .AppendChild(Node("img.fiximgmenu").SetAttribute(a.src, whichLevel + "icon/signbot.gif").SetAttribute(a.alt, "MotD").UseClosingTag(false))) + .AppendChild(Node(a.li) + .AppendChild(Player(level)))); return extra; } @@ -193,13 +193,10 @@ inline Node ThePraDev::Player(Levels level) string whichLevel = ChooseLevel(level); Node player = Node("div.player") .AppendChild(Node("audio") - .SetAttribute("controls", "controls") - .SetAttribute("preload", "auto") - .SetContent("Your browser does not support the audio element.") - .AppendChild(Node("source") - .SetAttribute(a.src, whichLevel + "videoplayback.ogg") - .SetAttribute("type", "audio/ogg") - .UseClosingTag(false))); - return player; + .SetAttribute("controls", "controls") + .SetAttribute("preload", "auto") + .SetAttribute(a.src, whichLevel + "videoplayback.ogg") + .SetContent("Your browser does not support the audio element.")); + return player; }