From 4ca69bc21d61f10510ed5ddd1565a42f3e45a3e4 Mon Sep 17 00:00:00 2001 From: M Hightower <27247790+mhightower83@users.noreply.github.com> Date: Sun, 19 Apr 2020 02:14:20 -0700 Subject: [PATCH] For example CaptivePortal, update HTML to pass HTML checker. (#7227) Added meta viewport element for better mobile device viewing. For example CaptivePortalAdvanced, increased size of ssid and password array to hold maximums 32 and 64 charcter strings. Added missing HTML elments to main splash and wifi config. They should now pass an HTML checker. Also added meta viewport element for better mobile device viewing. --- .../DNSServer/examples/CaptivePortal/CaptivePortal.ino | 8 +++++--- .../CaptivePortalAdvanced/CaptivePortalAdvanced.ino | 5 ++--- .../examples/CaptivePortalAdvanced/handleHttp.ino | 9 ++++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino index 53b159502..b59cda2d9 100644 --- a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino +++ b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino @@ -8,9 +8,11 @@ DNSServer dnsServer; ESP8266WebServer webServer(80); String responseHTML = "" - "
This is a captive portal example. All requests will " - "be redirected here.
"; + "" + "" + "This is a captive portal example." + " All requests will be redirected here.
"; void setup() { WiFi.mode(WIFI_AP); diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino index 0f2553fbc..e97dfbc0a 100644 --- a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino +++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino @@ -30,8 +30,8 @@ const char *softAP_password = APPSK; const char *myHostname = "esp8266"; /* Don't set this wifi credentials. They are configurated at runtime and stored on EEPROM */ -char ssid[32] = ""; -char password[32] = ""; +char ssid[33] = ""; +char password[65] = ""; // DNS server const byte DNS_PORT = 53; @@ -140,4 +140,3 @@ void loop() { //HTTP server.handleClient(); } - diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino index 1baac437d..dc286c184 100644 --- a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino +++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino @@ -9,7 +9,9 @@ void handleRoot() { String Page; Page += F( - "" + "" + "" + "You are connected through the soft AP: ")) + softAP_ssid + F("
"); @@ -43,7 +45,9 @@ void handleWifi() { String Page; Page += F( - "" + "" + "" + "You are connected through the soft AP: ")) + softAP_ssid + F("
"); @@ -130,4 +134,3 @@ void handleNotFound() { server.sendHeader("Expires", "-1"); server.send(404, "text/plain", message); } -