diff --git a/mkdocs/faq.md b/mkdocs/faq.md
index 4e8d264..c1e044d 100644
--- a/mkdocs/faq.md
+++ b/mkdocs/faq.md
@@ -27,7 +27,7 @@ ESP32 hardware equips only one RF circuitry for WiFi signal. At the AP_STA mode,
## Does not appear esp8266ap in smartphone.
-Maybe it is successfully connected at the **first WiFi.begin**. ESP8266 remembers the last SSID successfully connected and will use at the next. It means SoftAP will only start up when the first *WiFi.begin()* fails.
+Maybe it is successfully connected at the [**first WiFi.begin**](lsbegin.md#autoconnectbegin-logic-sequence). ESP8266 remembers the last SSID successfully connected and will use at the next. It means SoftAP will only start up when the first *WiFi.begin()* fails.
The saved SSID would be cleared by *WiFi.disconnect()* with WIFI_STA mode. If you do not want automatic reconnection, you can erase the memorized SSID with the following simple sketch.
diff --git a/src/AutoConnectElementBasis.h b/src/AutoConnectElementBasis.h
index 6022534..a7f92e5 100644
--- a/src/AutoConnectElementBasis.h
+++ b/src/AutoConnectElementBasis.h
@@ -46,11 +46,11 @@ typedef enum {
*/
class AutoConnectElementBasis {
public:
- explicit AutoConnectElementBasis(const char* name = "", const char* value = "") : name(String(name)), value(String(value)) {
+ explicit AutoConnectElementBasis(const char* name = "", const char* value = "") : name(String(name)), value(String(value)), enable(true) {
_type = AC_Element;
}
virtual ~AutoConnectElementBasis() {}
- virtual const String toHTML(void) const { return value; }
+ virtual const String toHTML(void) const { return enable ? value : String(""); }
ACElement_t typeOf(void) const { return _type; }
#ifndef AUTOCONNECT_USE_JSON
template
@@ -59,6 +59,7 @@ class AutoConnectElementBasis {
String name; /**< Element name */
String value; /**< Element value */
+ bool enable; /**< Enabling the element */
protected:
ACElement_t _type; /**< Element type identifier */
diff --git a/src/AutoConnectElementBasisImpl.h b/src/AutoConnectElementBasisImpl.h
index 2f5e22a..4caf555 100644
--- a/src/AutoConnectElementBasisImpl.h
+++ b/src/AutoConnectElementBasisImpl.h
@@ -25,7 +25,7 @@
* @return An HTML string.
*/
const String AutoConnectButtonBasis::toHTML(void) const {
- return String(F(""));
+ return enable ? String(F("")) : String("");
}
/**
@@ -37,14 +37,16 @@ const String AutoConnectButtonBasis::toHTML(void) const {
* @return An HTML string.
*/
const String AutoConnectCheckboxBasis::toHTML(void) const {
- String html;
+ String html = String("");
- html = String(F(" "));
+ if (enable) {
+ html = String(F(" "));
+ }
return html;
}
@@ -58,9 +60,11 @@ const String AutoConnectCheckboxBasis::toHTML(void) const {
const String AutoConnectFileBasis::toHTML(void) const {
String html = String("");
- if (label.length())
- html = String(F(""));
- html += String(F(" "));
+ if (enable) {
+ if (label.length())
+ html = String(F(""));
+ html += String(F(" "));
+ }
return html;
}
@@ -101,17 +105,18 @@ bool AutoConnectFileBasis::attach(const ACFile_t store) {
const String AutoConnectInputBasis::toHTML(void) const {
String html = String("");
- if (label.length())
- html = String(F(""));
- html += String(F(" "));
-
+ if (enable) {
+ if (label.length())
+ html = String(F(""));
+ html += String(F(" "));
+ }
return html;
}
@@ -269,7 +274,7 @@ const String& AutoConnectSelectBasis::value(void) const {
* @return String an HTML string.
*/
const String AutoConnectSubmitBasis::toHTML(void) const {
- return String(F("");
+ return enable ? String(F("") : String("");
}
/**
@@ -278,22 +283,26 @@ const String AutoConnectSubmitBasis::toHTML(void) const {
* @return String an HTML string.
*/
const String AutoConnectTextBasis::toHTML(void) const {
- String html = String("
");
- if (format.length()) {
- int buflen = (value.length() + format.length() + 16 + 1) & (~0xf);
- char* buffer;
- if ((buffer = (char*)malloc(buflen))) {
- snprintf(buffer, buflen, format.c_str(), value.c_str());
- value_f = String(buffer);
- free(buffer);
+ if (style.length())
+ html += String(F(" style=\"")) + style + String("\"");
+ html += String(">");
+ if (format.length()) {
+ int buflen = (value.length() + format.length() + 16 + 1) & (~0xf);
+ char* buffer;
+ if ((buffer = (char*)malloc(buflen))) {
+ snprintf(buffer, buflen, format.c_str(), value.c_str());
+ value_f = String(buffer);
+ free(buffer);
+ }
}
+ html += value_f + String(F("