Adds the enable attribute

pull/83/head
Hieromon Ikasamo 6 years ago
parent 375c6dcc0c
commit 3aca029867
  1. 1
      README.md
  2. 60
      mkdocs/achandling.md
  3. 262
      mkdocs/apielements.md
  4. 5
      mkdocs/changelog.md

@ -100,6 +100,7 @@ Full documentation is available on https://Hieromon.github.io/AutoConnect, some
- Supports ESP8266 Arduino core 2.5.2. - 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. - 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 ID attribute to HTML tag generated from AutoConnectText.
- Added the enable attribute to the AutoConnectElements.
- Fixed the input box layout collapsed. - Fixed the input box layout collapsed.
- Fixed that the decoration of AutoConnectButton was disabled. - Fixed that the decoration of AutoConnectButton was disabled.
- Fixed that the value remains even after clearing the option with AutoConnectSelect. - Fixed that the value remains even after clearing the option with AutoConnectSelect.

@ -126,7 +126,7 @@ AutoConnectText& text2 = aux["caption"].as<AutoConnectText>();
``` ```
!!! note "Need cast to convert to the actual type" !!! 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.
```cpp ```cpp
AutoConnectButton& AutoConnectElement::as<AutoConnectButton>() AutoConnectButton& AutoConnectElement::as<AutoConnectButton>()
AutoConnectCheckbox& AutoConnectElement::as<AutoConnectCheckbox>() AutoConnectCheckbox& AutoConnectElement::as<AutoConnectCheckbox>()
@ -145,6 +145,64 @@ To get all the AutoConnectElements in an AutoConnectAux object use the [**getEle
AutoConnectElementVT& AutoConnectAux::getElements(void) AutoConnectElementVT& AutoConnectAux::getElements(void)
``` ```
### <i class="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:
```cpp hl_lines="30 31 32 33"
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <AutoConnect.h>
static const char AUX[] PROGMEM = R("
{
"name" : "aux",
"uri" : "/aux",
"menu" : true,
"element" : [
{
"name": "input",
"type": "ACInput",
"label": "Input"
},
{
"name": "send",
"type": "ACSubmit",
"uri": "/send"
}
]
}
");
AutoConnect portal;
AutoConnectAux page;
String onPage(AutoConectAux& aux, PageArgument& args) {
AutoConnectSubmit& send = aux["send"].as<AutoConnectSubmit>();
if (WiFi.isConnected())
send.enable = (WiFi.getMode() == WIFI_STA);
else
send.enable = false;
return String();
}
void setup() {
page.load(AUX);
page.on(onPage);
portal.join(page);
portal.begin();
}
void loop() {
portal.handleClient();
}
```
!!! 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 &amp; saving AutoConnectElements with JSON ## Loading &amp; 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) 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)

@ -14,31 +14,39 @@ AutoConnectButton(const char* name = "", const char* value = "", const String& a
### <i class="fa fa-code"></i> Public member variables ### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> name #### <i class="fa fa-caret-right"></i> action
The element name. HTML native code of the action script to be executed when the button is clicked. It is mostly used with a JavaScript to activate a script.[^1]
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> value [^1]:JavaScript can be inserted into a custom Web page using AutoConnectElement.
Value of the element. #### <i class="fa fa-caret-right"></i> enable
Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> action #### <i class="fa fa-caret-right"></i> name
HTML native code of the action script to be executed when the button is clicked. It is mostly used with a JavaScript to activate a script.[^1] The element name.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
[^1]:JavaScript can be inserted into a custom Web page using AutoConnectElement. #### <i class="fa fa-caret-right"></i> value
Value of the element.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
### <i class="fa fa-code"></i> Public member functions ### <i class="fa fa-code"></i> Public member functions
@ -70,20 +78,20 @@ Returns type of AutoConnectElement.
### <i class="fa fa-code"></i> Public member variables ### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> name #### <i class="fa fa-caret-right"></i> checked
The element name. It indicates the checked status of the checkbox. The value of the checked checkbox element is packed in the query string and sent by submit.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">Boolean</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> value #### <i class="fa fa-caret-right"></i> enable
Value of the element. It becomes a value attribute of an HTML `#!html <input type="checkbox">` tag. Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> label #### <i class="fa fa-caret-right"></i> label
@ -94,12 +102,20 @@ A label is an optional string. A label is always arranged on the right side of t
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> checked #### <i class="fa fa-caret-right"></i> name
It indicates the checked status of the checkbox. The value of the checked checkbox element is packed in the query string and sent by submit. The element name.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">Boolean</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> value
Value of the element. It becomes a value attribute of an HTML `#!html <input type="checkbox">` tag.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
### <i class="fa fa-code"></i> Public member functions ### <i class="fa fa-code"></i> Public member functions
@ -130,6 +146,14 @@ AutoConnectElement(const char* name = "", const char* value = "")
### <i class="fa fa-code"></i> Public member variables ### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> enable
Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> name #### <i class="fa fa-caret-right"></i> name
The element name. The element name.
@ -190,30 +214,46 @@ AutoConnectFile(const char* name = "", const char* value = "", const char* label
### <i class="fa fa-code"></i> Public member variables ### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> name #### <i class="fa fa-caret-right"></i> enable
The element name. Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> label
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.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> value #### <i class="fa fa-caret-right"></i> mimeType
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).
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> label #### <i class="fa fa-caret-right"></i> name
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. The element name.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> size
Size of the uploading file.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">size_t</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> store #### <i class="fa fa-caret-right"></i> store
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. 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> </span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> mimeType #### <i class="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.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> size
Size of the uploading file.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">size_t</span><span class="apidesc"></span></dd>
</dl>
### <i class="fa fa-code"></i> Public member functions ### <i class="fa fa-code"></i> Public member functions
#### <i class="fa fa-caret-right"></i> typeOf #### <i class="fa fa-caret-right"></i> typeOf
@ -274,25 +306,33 @@ AutoConnectInput(const char* name = "", const char* value = "", const char* labe
### <i class="fa fa-code"></i> Public member variables ### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> name #### <i class="fa fa-caret-right"></i> enable
The element name. Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> label
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.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> value #### <i class="fa fa-caret-right"></i> name
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. The element name.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> label #### <i class="fa fa-caret-right"></i> 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.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
@ -316,27 +356,27 @@ A placeholder is an option string. Specification of a placeholder will generate
### <i class="fa fa-code"></i> Public member functions ### <i class="fa fa-code"></i> Public member functions
#### <i class="fa fa-caret-right"></i> typeOf #### <i class="fa fa-caret-right"></i> isValid
```cpp ```cpp
ACElement_t typeOf(void) bool isValid(void)
``` ```
Returns type of AutoConnectElement. Evaluate the pattern as a regexp and return whether value matches. Always return true if the pattern is undefined.
<dl class="apidl"> <dl class="apidl">
<dt>**Return value**</dt> <dt>**Return value**</dt>
<dd>AC_Input</dd> <dd><span class="apidef">true</span><span class="apidesc">The value matches a pattern.</span></dd>
<dd><span class="apidef">false</span><span class="apidesc">The value does not match a pattern.</span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> isValid #### <i class="fa fa-caret-right"></i> typeOf
```cpp ```cpp
bool isValid(void) ACElement_t typeOf(void)
``` ```
Evaluate the pattern as a regexp and return whether value matches. Always return true if the pattern is undefined. Returns type of AutoConnectElement.
<dl class="apidl"> <dl class="apidl">
<dt>**Return value**</dt> <dt>**Return value**</dt>
<dd><span class="apidef">true</span><span class="apidesc">The value matches a pattern.</span></dd> <dd>AC_Input</dd>
<dd><span class="apidef">false</span><span class="apidesc">The value does not match a pattern.</span></dd>
</dl> </dl>
## AutoConnectRadio ## AutoConnectRadio
@ -357,20 +397,20 @@ AutoConnectRadio(const char* name = "", std::vector<String> const& values = {},
### <i class="fa fa-code"></i> Public member variables ### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> name #### <i class="fa fa-caret-right"></i> checked
The element name. Specifies the index number (1-based) of the **values** to be checked. If this parameter is not specified neither item is checked.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">uint8_t</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> values #### <i class="fa fa-caret-right"></i> enable
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.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">std::vector&lt;String&gt;</span><span class="apidesc"></span></dd> <dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> label #### <i class="fa fa-caret-right"></i> label
@ -381,6 +421,14 @@ A label is an optional string. A label will be arranged in the left or top of th
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> name
The element name.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> order #### <i class="fa fa-caret-right"></i> order
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: 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> </span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> checked #### <i class="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.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">uint8_t</span><span class="apidesc"></span></dd> <dd><span class="apidef">std::vector&lt;String&gt;</span><span class="apidesc"></span></dd>
</dl> </dl>
### <i class="fa fa-code"></i> Public member functions ### <i class="fa fa-code"></i> Public member functions
#### <i class="fa fa-caret-right"></i> typeOf
```cpp
ACElement_t typeOf(void)
```
Returns type of AutoConnectElement.
<dl class="apidl">
<dt>**Return value**</dt>
<dd>AC_Radio</dd>
</dl>
#### <i class="fa fa-caret-right"></i> add #### <i class="fa fa-caret-right"></i> add
```cpp ```cpp
@ -473,6 +510,17 @@ Returns number of options which contained.
<dd>Number of options which contained.</dd> <dd>Number of options which contained.</dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> typeOf
```cpp
ACElement_t typeOf(void)
```
Returns type of AutoConnectElement.
<dl class="apidl">
<dt>**Return value**</dt>
<dd>AC_Radio</dd>
</dl>
#### <i class="fa fa-caret-right"></i> value #### <i class="fa fa-caret-right"></i> value
```cpp ```cpp
@ -501,20 +549,20 @@ AutoConnectSelect(const char* name = "", std::vector<String> const& options = {}
### <i class="fa fa-code"></i> Public member variables ### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> name #### <i class="fa fa-caret-right"></i> enable
The element name. Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> options #### <i class="fa fa-caret-right"></i> name
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. The element name.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">std::vector&lt;String&gt;</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> label #### <i class="fa fa-caret-right"></i> label
@ -525,6 +573,14 @@ A label is an optional string. A label will be arranged in the top of the select
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> 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.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">std::vector&lt;String&gt;</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> selected #### <i class="fa fa-caret-right"></i> selected
A `selected` is an optional value. Specifies 1-based index value of an options array that an option should be pre-selected when the page loads. A `selected` is an optional value. Specifies 1-based index value of an options array that an option should be pre-selected when the page loads.
@ -535,17 +591,6 @@ A `selected` is an optional value. Specifies 1-based index value of an options a
### <i class="fa fa-code"></i> Public member functions ### <i class="fa fa-code"></i> Public member functions
#### <i class="fa fa-caret-right"></i> typeOf
```cpp
ACElement_t typeOf(void)
```
Returns type of AutoConnectElement.
<dl class="apidl">
<dt>**Return value**</dt>
<dd>AC_Select</dd>
</dl>
#### <i class="fa fa-caret-right"></i> add #### <i class="fa fa-caret-right"></i> add
```cpp ```cpp
@ -605,6 +650,17 @@ Returns number of options which contained.
<dd>Number of options which contained.</dd> <dd>Number of options which contained.</dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> typeOf
```cpp
ACElement_t typeOf(void)
```
Returns type of AutoConnectElement.
<dl class="apidl">
<dt>**Return value**</dt>
<dd>AC_Select</dd>
</dl>
#### <i class="fa fa-caret-right"></i> value #### <i class="fa fa-caret-right"></i> value
```cpp ```cpp
@ -632,6 +688,14 @@ AutoConnectSubmit(const char* name = "", const char* value ="", char* uri = "")
### <i class="fa fa-code"></i> Public member variables ### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> enable
Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> name #### <i class="fa fa-caret-right"></i> name
The element name. The element name.
@ -640,17 +704,17 @@ The element name.
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> value #### <i class="fa fa-caret-right"></i> uri
The name of the submit button. It will also be the label of the button. Destination URI.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> uri #### <i class="fa fa-caret-right"></i> value
Destination URI. The name of the submit button. It will also be the label of the button.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
@ -686,17 +750,25 @@ AutoConnectText(const char* name = "", const char* value = "", const char* style
### <i class="fa fa-code"></i> Public member variables ### <i class="fa fa-code"></i> Public member variables
#### <i class="fa fa-caret-right"></i> name #### <i class="fa fa-caret-right"></i> enable
The element name. Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
<dl class="apidl">
<dt>**Type**</dt>
<dd><span class="apidef">boolean</span><span class="apidesc"></span></dd>
</dl>
#### <i class="fa fa-caret-right"></i> format
The conversion format when outputting values. The format string conforms to C-style printf library functions.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> value #### <i class="fa fa-caret-right"></i> name
A content string of the text element. The element name.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
@ -710,9 +782,9 @@ A style code with CSS format that qualifiers the text.
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>
</dl> </dl>
#### <i class="fa fa-caret-right"></i> format #### <i class="fa fa-caret-right"></i> value
The conversion format when outputting values. The format string conforms to C-style printf library functions. A content string of the text element.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd><span class="apidef">String</span><span class="apidesc"></span></dd> <dd><span class="apidef">String</span><span class="apidesc"></span></dd>

@ -1,6 +1,7 @@
### [0.9.9] May 25, 2019 #### [0.9.9] May 25, 2019
- Supports ESP8266 Arduino core 2.5.2. - Supports ESP8266 Arduino core 2.5.2.
- Menu text/background color can be statically customized. - 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. - Added ID attribute to HTML tag generated from AutoConnectText.
- Fixed the input box layout collapsed. - Fixed the input box layout collapsed.
- Fixed that the decoration of AutoConnectButton was disabled. - Fixed that the decoration of AutoConnectButton was disabled.
@ -26,7 +27,7 @@
#### [0.9.7] Jan. 25, 2019 #### [0.9.7] Jan. 25, 2019
- Fixed crash in some environments. Thank you @ageurtse - 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. - 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. - 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. - 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.

Loading…
Cancel
Save