diff --git a/docs/images/PageBuilder.png b/docs/images/PageBuilder.png index 6db7125..0ac01ef 100644 Binary files a/docs/images/PageBuilder.png and b/docs/images/PageBuilder.png differ diff --git a/examples/Credential/Credential.ino b/examples/Credential/Credential.ino index 4d4db07..89c4bdf 100644 --- a/examples/Credential/Credential.ino +++ b/examples/Credential/Credential.ino @@ -41,47 +41,48 @@ String delCredential(PageArgument&); * The number of the entry to be deleted is passed to the function in the * POST method. */ -static const char html[] PROGMEM = { -"" -"" -"" - "" - "" -"" -"" -"
" - "
    " - "{{SSID}}" - "
" - "

Enter deleting entry:

" - "" - "" -"
" -"

Menu

" -"" -"" -}; +static const char PROGMEM html[] = R"*lit( + + + + + + + + +
+
    + {{SSID}} +
+

Enter deleting entry:

+ + +
+ + +)*lit"; + +static const char PROGMEM autoconnectMenu[] = { AUTOCONNECT_LINK(BAR_24) }; // URL path as '/' -PageElement elmList(html, {{ "SSID", viewCredential }}); +PageElement elmList(html, + {{ "SSID", viewCredential }, + { "AUTOCONNECT_MENU", [](PageArgument& args) { + return String(FPSTR(autoconnectMenu));} } + }); PageBuilder rootPage("/", { elmList }); // URL path as '/del' diff --git a/examples/HandleClient/HandleClient.ino b/examples/HandleClient/HandleClient.ino index fd2764b..1d5d1cb 100644 --- a/examples/HandleClient/HandleClient.ino +++ b/examples/HandleClient/HandleClient.ino @@ -26,8 +26,12 @@ void handleRoot() { "font-family:'Arial',sans-serif;" "text-align:center;" "}" - ".menu {" - "text-align:right;" + ".menu > a:link {" + "position: absolute;" + "display: inline-block;" + "right: 12px;" + "padding: 0 6px;" + "text-decoration: none;" "}" ".button {" "display:inline-block;" @@ -41,7 +45,7 @@ void handleRoot() { "" "" "" - "

" AUTOCONNECT_LINK(BAR_32) "

" + "
" AUTOCONNECT_LINK(BAR_24) "
" "BUILT-IN LED
" "GPIO("); page += String(BUILTIN_LED); diff --git a/examples/HandlePortal/HandlePortal.ino b/examples/HandlePortal/HandlePortal.ino index 1e06e8b..105f28d 100644 --- a/examples/HandlePortal/HandlePortal.ino +++ b/examples/HandlePortal/HandlePortal.ino @@ -32,8 +32,12 @@ void handleRoot() { "font-family:'Arial',sans-serif;" "text-align:center;" "}" - ".menu {" - "text-align:right;" + ".menu > a:link {" + "position: absolute;" + "display: inline-block;" + "right: 12px;" + "padding: 0 6px;" + "text-decoration: none;" "}" ".button {" "display:inline-block;" @@ -47,7 +51,7 @@ void handleRoot() { "" "" "" - "

" AUTOCONNECT_LINK(BAR_32) "

" + "
" AUTOCONNECT_LINK(BAR_32) "
" "BUILT-IN LED
" "GPIO("); page += String(BUILTIN_LED); diff --git a/examples/HandlePortalEX/HandlePortalEX.ino b/examples/HandlePortalEX/HandlePortalEX.ino index 7fb224b..660bc20 100644 --- a/examples/HandlePortalEX/HandlePortalEX.ino +++ b/examples/HandlePortalEX/HandlePortalEX.ino @@ -23,39 +23,45 @@ ESP8266WebServer server; AutoConnect portal(server); -static const char mold_page[] PROGMEM = { -"" -"" - "" - "" -"" -"" - "

" AUTOCONNECT_LINK(BAR_32) "

" - "BUILT-IN LED
" - "GPIO({{LED}}) : {{GPIO}}" - "

lowhigh

" - "" -"" -}; +static const char PROGMEM mold_page[] = R"*lit( + + + + + + + + BUILT-IN LED
+ GPIO({{LED}}) : {{GPIO}} +

lowhigh

+ + +)*lit"; + +static const char PROGMEM autoconnectMenu[] = { AUTOCONNECT_LINK(BAR_24) }; String getLEDPort(PageArgument& args) { return String(BUILTIN_LED); @@ -72,7 +78,9 @@ String readLEDPort(PageArgument& args) { PageElement elm_gpio(mold_page, { {"LED", getLEDPort}, {"COLOR", setColor}, - {"GPIO", readLEDPort} + {"GPIO", readLEDPort}, + {"AUTOCONNECT_MENU", [](PageArgument& args) { + return String(FPSTR(autoconnectMenu));}} }); PageBuilder root("/", { elm_gpio }); diff --git a/library.json b/library.json index db534b8..b4c2d6e 100644 --- a/library.json +++ b/library.json @@ -17,6 +17,6 @@ ], "frameworks": "arduino", "platforms": "espressif8266", - "version": "0.9.1", + "version": "0.9.2", "license": "MIT" } diff --git a/library.properties b/library.properties index a1c1b6b..3c0d1e3 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=AutoConnect -version=0.9.1 +version=0.9.2 author=Hieromon Ikasamo maintainer=Hieromon Ikasamo sentence=ESP8266 WLAN configuration at runtime with web interface. diff --git a/mkdocs/images/PageBuilder.png b/mkdocs/images/PageBuilder.png index 6db7125..0ac01ef 100644 Binary files a/mkdocs/images/PageBuilder.png and b/mkdocs/images/PageBuilder.png differ