mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-26 16:45:55 +03:00
[PR #1774] WiFiManagerParameter Encapsulated HTML Generation #1829
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1829
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/tzapu/WiFiManager/pull/1774
Author: @dmadison
Created: 10/30/2024
Status: 🔄 Open
Base:
master← Head:params-html-gen📝 Commits (9)
0df7c77Refactor parameter 'length' as 'maxLength'f75dd98Change param value length function namedd38239Change param getID to getNameb002b03Add setValueReceived function to paramsc781390Remove parameter friendship with WiFiManager2703370Add negative check to param max length246d521Make param destructor virtual944589cMove param HTML generation to classc4665fcRemove param token "I" processing📊 Changes
4 files changed (+135 additions, -90 deletions)
View changed files
📝
WiFiManager.cpp(+116 -75)📝
WiFiManager.h(+16 -12)📝
examples/NonBlocking/AutoConnectNonBlockingwParams/AutoConnectNonBlockingwParams.ino(+1 -1)📝
keywords.txt(+2 -2)📄 Description
This PR encapsulates the
WiFiManagerParameterHTML generation as part of the class, rather than as a function withinWiFiManager. This allows derived classes to define their own HTML output and greatly increases encapsulation:This also greatly simplifies the
getParamOut()function ofWiFiManager:This is a non-breaking change and should not modify the output HTML, with the exception of
{I}as noted below.Note that this PR contains a potentially breaking change, by removing token I (
T_I/{I}/ capital 'i') processing for parameters which include that token in their string. This was removed because the parameter HTML is no longer generated in the context of the loop, and I didn't see a compelling reason to pass the iterator to the class function.From what I can see parsing through the history of the
strings_enfile that feature was never used by the library itself, but it could potentially affect a user somewhere with custom string files (HTTP_FORM_LABEL/HTTP_FORM_PARAM). If that's objectionable I'm happy to revert that commit (c4665fc6cc).Please note that this PR incorporates the necessary API changes from #1773.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.