@ -101,11 +101,12 @@ Full documentation is available on https://Hieromon.github.io/AutoConnect, some
## Change log
## Change log
### [1.0.0] Aug. 29, 2019
### [1.0.0] Sept. 5, 2019
- Supports Arduino core for ESP32 1.0.3.
- Supports Arduino core for ESP32 1.0.3.
- Supports AutoConnectUpdate for the OTA update.
- Supports AutoConnectUpdate for the OTA update.
- Supports Preferences for saving credentials with ESP32 core 1.0.3 and later. **In ESP32, the credentials stored past in EEPROM will lose**.
- Supports Preferences for saving credentials with ESP32 core 1.0.3 and later. **In ESP32, the credentials stored past in EEPROM will lose**.
- Supports AutoConnectAux::isValid function.
- Supports AutoConnectAux::isValid function.
- Supports the global attribute with all AutoConnectElements.
### [0.9.12] Aug. 18, 2019
### [0.9.12] Aug. 18, 2019
- Fixed missing captive portal notifications on the newer mobile OS client. As a result of this fix, the SoftAP default IP address and gateway have been changed to **172.217.28.1**. (issue #85)
- Fixed missing captive portal notifications on the newer mobile OS client. As a result of this fix, the SoftAP default IP address and gateway have been changed to **172.217.28.1**. (issue #85)
### <iclass="fa fa-wrench"></i> Transfer of input values across pages
Since v1.0.0, AutoConnect supports a new attribute with each element that allows automatic transfer of input values across pages without sketching. AutoConnect will copy the input value of the elements with the [global](apielements.md#global_2) attribute to the same-named elements on a different custom web pages at the page transition timing.
The **global** attribute will be useful for echoing input values back to another custom Web pages. The copy operation will be performed if the name matches and is global even if the copy source element and the destination have different types. Conversely, the value will not be copied unless the destination element is global.
The following example reflects the input value of PAGE1 to the AutoConnectText field of PAGE2 without sketch code.
```cpp hl_lines="8 10 28 30"
static const char PAGE1[] PROGMEM = R"(
{
"title": "PAGE1",
"uri": "/page1",
"menu": true,
"element": [
{
"name": "input1",
"type": "ACInput",
"global": true
},
{
"name": "send",
"type": "ACSubmit",
"value": "OK",
"uri": "/page2"
}
]
}
)";
static const char PAGE2[] PROGMEM = R"(
{
"title": "PAGE2",
"uri": "/page2",
"menu": false,
"element": [
{
"name": "input1",
"type": "ACText",
"global": true
}
]
}
)";
AutoConnect portal;
AutoConnectAux page1;
AutoConnectAux page2;
void setup() {
page1.load(PAGE1);
page2.load(PAGE2);
portal.join( { page1, page2 });
portal.begin();
}
void loop() {
portal.handleClient();
}
```
<iclass="fa fa-arrow-down"></i><br><iclass="fa fa-eye"></i> It's shown as like:<br>
The value entered in **input1 declared in PAGE1** is reflected in **input1 of PAGE2** as AutoConnectText value even if there is no sketch code to transfer it to PAGE2.
!!! note "Copy only for same-named and the global"
Copied only if the global attribute of the destination element is true. Even if the name of the destination element is the same, the copy is not performed if the global attribute is false.
### <iclass="fa fa-wrench"></i> Retrieve the values with WebServer::on handler
### <iclass="fa fa-wrench"></i> Retrieve the values with WebServer::on handler
ESP8266WebServer class and the WebServer class assume that the implementation of the ReqestHandler class contained in the WebServer library will handle the URL requests. Usually, it is sketch code registered by ESP8266WebServer::on function.
ESP8266WebServer class and the WebServer class assume that the implementation of the ReqestHandler class contained in the WebServer library will handle the URL requests. Usually, it is sketch code registered by ESP8266WebServer::on function.
@ -713,10 +783,8 @@ By giving a [pattern](apielements.md#pattern) to [AutoConnectInput](apielements.
}
}
```
```
<div>
<iclass="fa fa-arrow-down"></i><br><iclass="fa fa-eye"></i> It's shown as like:<br>
If you are not familiar with regular expressions, you may feel that description very strange. Matter of fact, it's a strange description for those who are unfamiliar with the formal languages. If your regular expression can not interpret the intended syntax and semantics, you can use an online tester. The [regex101](https://regex101.com/) is an exceptional online tool for testing and debugging regular expressions.
If you are not familiar with regular expressions, you may feel that description very strange. Matter of fact, it's a strange description for those who are unfamiliar with the formal languages. If your regular expression can not interpret the intended syntax and semantics, you can use an online tester. The [regex101](https://regex101.com/) is an exceptional online tool for testing and debugging regular expressions.
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i> global
The global attribute copies input values between elements of the same name on different custom Web pages.
<dlclass="apidl">
<dt>**Type**</dt>
<dd><spanclass="apidef">bool</span><spanclass="apidesc">An entered value will be copied to elements of the same name in other AutoConnectAuxes during page transition.<br>However, it will be copied only when the destination element has the true for a global attribute.</span></dd>
</dl>
</dl>
#### <iclass="fa fa-caret-right"></i> name
#### <iclass="fa fa-caret-right"></i> name
@ -98,15 +106,23 @@ Returns type of AutoConnectElement.
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.
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.
Enable HTML tag generation for the element. AutoConnect will generate the element into HTML only if the enable attribute is true.
Enable HTML tag generation for the element.
<dlclass="apidl">
<dt>**Type**</dt>
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i> global
The global attribute copies input values between elements of the same name on different custom Web pages.
<dd><spanclass="apidef">bool</span><spanclass="apidesc">An entered value will be copied to elements of the same name in other AutoConnectAuxes during page transition.<br>However, it will be copied only when the destination element has the true for a global attribute.</span></dd>
</dl>
</dl>
#### <iclass="fa fa-caret-right"></i> label
#### <iclass="fa fa-caret-right"></i> label
@ -177,10 +193,18 @@ AutoConnectElement(const char* name = "", const char* value = "", const ACPoster
#### <iclass="fa fa-caret-right"></i> enable
#### <iclass="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.
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i> global
The global attribute copies input values between elements of the same name on different custom Web pages.
<dlclass="apidl">
<dt>**Type**</dt>
<dd><spanclass="apidef">bool</span><spanclass="apidesc">An entered value will be copied to elements of the same name in other AutoConnectAuxes during page transition.<br>However, it will be copied only when the destination element has the true for a global attribute.</span></dd>
</dl>
</dl>
#### <iclass="fa fa-caret-right"></i> name
#### <iclass="fa fa-caret-right"></i> name
@ -258,10 +282,18 @@ AutoConnectFile(const char* name = "", const char* value = "", const char* label
#### <iclass="fa fa-caret-right"></i> enable
#### <iclass="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.
Enable HTML tag generation for the element.
<dlclass="apidl">
<dt>**Type**</dt>
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i> global
The global attribute copies input values between elements of the same name on different custom Web pages.
<dd><spanclass="apidef">bool</span><spanclass="apidesc">An entered value will be copied to elements of the same name in other AutoConnectAuxes during page transition.<br>However, it will be copied only when the destination element has the true for a global attribute.</span></dd>
</dl>
</dl>
#### <iclass="fa fa-caret-right"></i> label
#### <iclass="fa fa-caret-right"></i> label
@ -364,10 +396,18 @@ AutoConnectInput(const char* name = "", const char* value = "", const char* labe
#### <iclass="fa fa-caret-right"></i> enable
#### <iclass="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.
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i> global
The global attribute copies input values between elements of the same name on different custom Web pages.
<dlclass="apidl">
<dt>**Type**</dt>
<dd><spanclass="apidef">bool</span><spanclass="apidesc">An entered value will be copied to elements of the same name in other AutoConnectAuxes during page transition.<br>However, it will be copied only when the destination element has the true for a global attribute.</span></dd>
</dl>
</dl>
#### <iclass="fa fa-caret-right"></i> label
#### <iclass="fa fa-caret-right"></i> label
@ -477,10 +517,18 @@ Specifies the index number (1-based) of the **values** to be checked. If this pa
#### <iclass="fa fa-caret-right"></i> enable
#### <iclass="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.
Enable HTML tag generation for the element.
<dlclass="apidl">
<dt>**Type**</dt>
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i> global
The global attribute copies input values between elements of the same name on different custom Web pages.
<dd><spanclass="apidef">bool</span><spanclass="apidesc">An entered value will be copied to elements of the same name in other AutoConnectAuxes during page transition.<br>However, it will be copied only when the destination element has the true for a global attribute.</span></dd>
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i> global
The global attribute copies input values between elements of the same name on different custom Web pages.
<dlclass="apidl">
<dt>**Type**</dt>
<dd><spanclass="apidef">bool</span><spanclass="apidesc">An entered value will be copied to elements of the same name in other AutoConnectAuxes during page transition.<br>However, it will be copied only when the destination element has the true for a global attribute.</span></dd>
</dl>
</dl>
#### <iclass="fa fa-caret-right"></i> name
#### <iclass="fa fa-caret-right"></i> name
@ -786,10 +842,10 @@ AutoConnectStyle(const char* name = "", const char* value = "")
#### <iclass="fa fa-caret-right"></i> enable
#### <iclass="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.
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
</dl>
</dl>
#### <iclass="fa fa-caret-right"></i> name
#### <iclass="fa fa-caret-right"></i> name
@ -840,10 +896,18 @@ AutoConnectSubmit(const char* name = "", const char* value ="", char* uri = "",
#### <iclass="fa fa-caret-right"></i> enable
#### <iclass="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.
Enable HTML tag generation for the element.
<dlclass="apidl">
<dt>**Type**</dt>
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
</dl>
#### <iclass="fa fa-caret-right"></i> global
The global attribute copies input values between elements of the same name on different custom Web pages.
<dd><spanclass="apidef">bool</span><spanclass="apidesc">An entered value will be copied to elements of the same name in other AutoConnectAuxes during page transition.<br>However, it will be copied only when the destination element has the true for a global attribute.</span></dd>
</dl>
</dl>
#### <iclass="fa fa-caret-right"></i> name
#### <iclass="fa fa-caret-right"></i> name
@ -916,10 +980,10 @@ AutoConnectText(const char* name = "", const char* value = "", const char* style
#### <iclass="fa fa-caret-right"></i> enable
#### <iclass="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.
<dd><spanclass="apidef">bool</span><spanclass="apidesc">AutoConnect will generate the element into HTML only if the enable attribute is true.</span></dd>
- Supports the **global** attribute with all AutoConnectElements.
- Supports the [**global**](achandling.md#transfer-of-input-values-across-pages) attribute with all AutoConnectElements.
#### [0.9.12] Aug. 18, 2019
#### [0.9.12] Aug. 18, 2019
- Fixed missing captive portal notifications on the newer mobile OS client. As a result of this fix, the SoftAP default IP address and gateway have been changed to **172.217.28.1**.
- Fixed missing captive portal notifications on the newer mobile OS client. As a result of this fix, the SoftAP default IP address and gateway have been changed to **172.217.28.1**.