@ -100,6 +100,7 @@ Full documentation is available on https://Hieromon.github.io/AutoConnect, some
- Supports ESP8266 Arduino core 2.5.2.
- Menu text/background color can be statically customized. refer to the [Custom colorized](https://hieromon.github.io/AutoConnect/colorized.html) for the detailed specification for the menu colorizing.
- Added ID attribute to HTML tag generated from AutoConnectText.
- Added the enable attribute to the AutoConnectElements.
- Fixed the input box layout collapsed.
- Fixed that the decoration of AutoConnectButton was disabled.
- Fixed that the value remains even after clearing the option with AutoConnectSelect.
!!! note "Need cast to convert to the actual type"
An operator `[]` returns a referene of an AutoConnectElement. It is necessary to convert the type according to the actual element type with [AutoConnectElement::as<T\>](apielements.md#ast62) functon.
An operator `[]` returns a reference of an AutoConnectElement. It is necessary to convert the type according to the actual element type with [AutoConnectElement::as<T\>](apielements.md#ast62) function.
### <iclass="fa fa-edit"></i> Enable AutoConnectElements during the sketch execution
AutoConnectElemets have an enable attribute to activate its own HTML generation. Sketches can change the HTMLization of their elements dynamically by setting or resetting the enable value. An element whose the enable attribute is true will generate itself HTML and place on the custom Web page. And conversely, it will not generate the HTML when the value is false.
For example, to enable the submit button only when the ESP module is connected to the access point in STA mode, you can sketch the following:
!!! hint "Desirable to set or reset the enable attribute in the page handler"
The enable attribute can be set at any time during the sketch execution. The page handler with the [AC_EXIT_AHEAD](apiaux.md#on) option is sure to handle it.
## Loading & saving AutoConnectElements with JSON
AutoConnect supports reading the custom Web page definitions written in JSON and also supports loading and saving of AutoConnectAux or AutoConnectElements. In both cases, the target object is a [JSON document for AutoConnect](acjson.md). However, it can not save all AutoConnectElements contained in the page as a custom Web page. (ie. AutoConnectAux)
A label is an optional string. A label is always arranged on the left side of the file input box. Specification of a label will generate an HTML `#!html <label>` tag with an id attribute. The file input box and the label are connected by the id attribute.
File name to be upload. The value contains the value entered by the client browser to the `#!html <input type="file">` tag and is read-only.
The mime type of the upload file which included as Media type in the http post request. Set by the client (usually the browser) that requested the upload. It is determined by the file type as `application/octet-stream`, `text` etc. which is described in [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml).
A label is an optional string. A label is always arranged on the left side of the file input box. Specification of a label will generate an HTML `#!html <label>` tag with an id attribute. The file input box and the label are connected by the id attribute.
Specifies the save destination of the uploaded file. You can use the built-in uploader to save uploaded file to the flash of the ESP8266/ESP32 module or external SD media without writing a dedicated sketch code. It also supports saving to any destination using a custom uploader that inherits from the AutoConnectUploadHandler class.
@ -227,22 +267,14 @@ Specifies the save destination of the uploaded file. You can use the built-in up
</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i>mimeType
#### <iclass="fa fa-caret-right"></i>value
The mime type of the upload file which included as Media type in the http post request. Set by the client (usually the browser) that requested the upload. It is determined by the file type as `application/octet-stream`, `text` etc. which is described in [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml).
File name to be upload. The value contains the value entered by the client browser to the `#!html <input type="file">` tag and is read-only.
A label is an optional string. A label is always arranged on the left side of the input box. Specification of a label will generate an HTML `#!html <label>` tag with an id attribute. The input box and the label are connected by the id attribute.
Value of the element. It becomes a value attribute of an HTML `#!html <input type="text">` tag. An entered text in the custom Web page will be sent with a query string of the form. The value set before accessing the page is displayed as the initial value.
A label is an optional string. A label is always arranged on the left side of the input box. Specification of a label will generate an HTML `#!html <label>` tag with an id attribute. The input box and the label are connected by the id attribute.
Value of the element. It becomes a value attribute of an HTML `#!html <input type="text">` tag. An entered text in the custom Web page will be sent with a query string of the form. The value set before accessing the page is displayed as the initial value.
An array of String type for the radio button options. It is an initialization list can be used. The `#!html <input type="radio">` tags will be generated from each entry in the values.
Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
Specifies the direction to arrange the radio buttons. A label will place in the left or the top according to the **_order_**. It is a value of **ACArrange_t** type and accepts one of the following:
@ -393,27 +441,16 @@ Specifies the direction to arrange the radio buttons. A label will place in the
</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i>checked
#### <iclass="fa fa-caret-right"></i>values
Specifies the index number (1-based) of the **values** to be checked. If this parameter is not specified neither item is checked.
An array of String type for the radio button options. It is an initialization list can be used. The `#!html <input type="radio">` tags will be generated from each entry in the values.
An array of String type for the selection options. It is an initialization list can be used. The `#!html <option value>` tags will be generated from each entry in the options.
An array of String type for the selection options. It is an initialization list can be used. The `#!html <option value>` tags will be generated from each entry in the options.
- Menu text/background color can be statically customized.
- Added the [enable](achandling.html#enable-autoconnectelements-during-the-sketch-execution) attribute to the AutoConnectElements. This attribute gives dynamically change to the element activation during the sketch executing.
- Added ID attribute to HTML tag generated from AutoConnectText.
- Fixed the input box layout collapsed.
- Fixed that the decoration of AutoConnectButton was disabled.
@ -26,7 +27,7 @@
#### [0.9.7] Jan. 25, 2019
- Fixed crash in some environments. Thank you @ageurtse
- Supports AutoConnect menu extention by user sketch with [**AutoConnectAux**](acintro.md).
- Supports AutoConnect menu extension by user sketch with [**AutoConnectAux**](acintro.md).
- Supports loading and saving of user-defined parameters with JSON format.
- Improved the WiFi connection sequence at the first WiFi.begin. Even if [**AutoConnectConfig::autoReconnect**](apiconfig.md#autoreconnect) is disabled when SSID and PSK are not specified, it will use the information of the last established access point. The autoReconnect option will achieve trying the connect after a previous connection failed.
- Supports the [**AutoConnectConfig::immediateStart**](apiconfig.md#immediatestart) option and immediately starts the portal without first trying WiFi.begin. You can start the captive portal at any time in combination with the [**AutoConnectConfig::autoRise**](apiconfig.md#autorise) option.