Skip to content

Commit ec9172e

Browse files
committed
[Cleanup] Remove no longer used markup functions
1 parent f2d004a commit ec9172e

File tree

3 files changed

+7
-255
lines changed

3 files changed

+7
-255
lines changed

src/src/WebServer/Markup.cpp

Lines changed: 0 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -15,168 +15,6 @@
1515

1616
#include "../../ESPEasy_common.h"
1717

18-
// ********************************************************************************
19-
// Add Selector
20-
// ********************************************************************************
21-
void addSelector(const __FlashStringHelper *id,
22-
int optionCount,
23-
const __FlashStringHelper *options[],
24-
const int indices[],
25-
const String attr[],
26-
int selectedIndex,
27-
bool reloadonchange,
28-
bool enabled)
29-
{
30-
addSelector(String(id), optionCount, options, indices, attr, selectedIndex, reloadonchange, enabled, F("wide"));
31-
}
32-
33-
void addSelector(const String & id,
34-
int optionCount,
35-
const __FlashStringHelper *options[],
36-
const int indices[],
37-
const String attr[],
38-
int selectedIndex,
39-
bool reloadonchange,
40-
bool enabled)
41-
{
42-
addSelector(id, optionCount, options, indices, attr, selectedIndex, reloadonchange, enabled, F("wide"));
43-
}
44-
45-
void addSelector(const String& id,
46-
int optionCount,
47-
const String options[],
48-
const int indices[],
49-
const String attr[],
50-
int selectedIndex,
51-
bool reloadonchange,
52-
bool enabled)
53-
{
54-
addSelector(id, optionCount, options, indices, attr, selectedIndex, reloadonchange, enabled, F("wide"));
55-
}
56-
57-
void addSelector(const String & id,
58-
int optionCount,
59-
const __FlashStringHelper *options[],
60-
const int indices[],
61-
const String attr[],
62-
int selectedIndex,
63-
bool reloadonchange,
64-
bool enabled,
65-
const __FlashStringHelper * classname
66-
#if FEATURE_TOOLTIPS
67-
, const String & tooltip
68-
#endif // if FEATURE_TOOLTIPS
69-
)
70-
{
71-
// FIXME TD-er Change bool to disabled
72-
if (reloadonchange)
73-
{
74-
addSelector_Head_reloadOnChange(id, classname, !enabled
75-
#if FEATURE_TOOLTIPS
76-
, tooltip
77-
#endif // if FEATURE_TOOLTIPS
78-
);
79-
} else {
80-
do_addSelector_Head(id, classname, EMPTY_STRING, !enabled
81-
#if FEATURE_TOOLTIPS
82-
, tooltip
83-
#endif // if FEATURE_TOOLTIPS
84-
);
85-
}
86-
addSelector_options(optionCount, options, indices, attr, selectedIndex);
87-
addSelector_Foot();
88-
}
89-
90-
void addSelector_reloadOnChange(
91-
const String& id,
92-
int optionCount,
93-
const String options[],
94-
const int indices[],
95-
const String attr[],
96-
int selectedIndex,
97-
const String& onChangeCall,
98-
bool enabled,
99-
const __FlashStringHelper * classname
100-
#if FEATURE_TOOLTIPS
101-
,
102-
const String& tooltip
103-
#endif // if FEATURE_TOOLTIPS
104-
)
105-
{
106-
// FIXME TD-er Change bool to disabled
107-
do_addSelector_Head(id, classname, onChangeCall, !enabled
108-
#if FEATURE_TOOLTIPS
109-
, tooltip
110-
#endif // if FEATURE_TOOLTIPS
111-
);
112-
addSelector_options(optionCount, options, indices, attr, selectedIndex);
113-
addSelector_Foot();
114-
}
115-
116-
117-
void addSelector(const String & id,
118-
int optionCount,
119-
const String options[],
120-
const int indices[],
121-
const String attr[],
122-
int selectedIndex,
123-
bool reloadonchange,
124-
bool enabled,
125-
const __FlashStringHelper * classname
126-
#if FEATURE_TOOLTIPS
127-
, const String& tooltip
128-
#endif // if FEATURE_TOOLTIPS
129-
)
130-
{
131-
// FIXME TD-er Change bool to disabled
132-
if (reloadonchange)
133-
{
134-
addSelector_Head_reloadOnChange(id, classname, !enabled
135-
#if FEATURE_TOOLTIPS
136-
, tooltip
137-
#endif // if FEATURE_TOOLTIPS
138-
);
139-
} else {
140-
do_addSelector_Head(id, classname, EMPTY_STRING, !enabled
141-
#if FEATURE_TOOLTIPS
142-
, tooltip
143-
#endif // if FEATURE_TOOLTIPS
144-
);
145-
}
146-
addSelector_options(optionCount, options, indices, attr, selectedIndex);
147-
addSelector_Foot();
148-
}
149-
150-
void addSelector_options(int optionCount, const __FlashStringHelper *options[], const int indices[], const String attr[], int selectedIndex)
151-
{
152-
for (uint8_t x = 0; x < optionCount; ++x)
153-
{
154-
const int index = indices ? indices[x] : x;
155-
addSelector_Item(
156-
options[x],
157-
index,
158-
selectedIndex == index,
159-
false,
160-
attr ? attr[x] : EMPTY_STRING);
161-
if ((x & 0x07) == 0) delay(0);
162-
}
163-
}
164-
165-
void addSelector_options(int optionCount, const String options[], const int indices[], const String attr[], int selectedIndex)
166-
{
167-
for (uint8_t x = 0; x < optionCount; ++x)
168-
{
169-
const int index = indices ? indices[x] : x;
170-
addSelector_Item(
171-
options[x],
172-
index,
173-
selectedIndex == index,
174-
false,
175-
attr ? attr[x] : EMPTY_STRING);
176-
if ((x & 0x07) == 0) delay(0);
177-
}
178-
}
179-
18018
void addSelector_Head(const String& id) {
18119
do_addSelector_Head(id, F("wide"), EMPTY_STRING, false
18220
#if FEATURE_TOOLTIPS

src/src/WebServer/Markup.h

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -11,91 +11,6 @@
1111
// ********************************************************************************
1212
// Add Selector
1313
// ********************************************************************************
14-
void addSelector(const __FlashStringHelper *id,
15-
int optionCount,
16-
const __FlashStringHelper *options[],
17-
const int indices[],
18-
const String attr[],
19-
int selectedIndex,
20-
bool reloadonchange = false,
21-
bool enabled = true);
22-
23-
void addSelector(const String & id,
24-
int optionCount,
25-
const __FlashStringHelper *options[],
26-
const int indices[],
27-
const String attr[],
28-
int selectedIndex,
29-
bool reloadonchange = false,
30-
bool enabled = true);
31-
32-
void addSelector(const String& id,
33-
int optionCount,
34-
const String options[],
35-
const int indices[],
36-
const String attr[],
37-
int selectedIndex,
38-
bool reloadonchange = false,
39-
bool enabled = true);
40-
41-
42-
void addSelector(const String & id,
43-
int optionCount,
44-
const __FlashStringHelper *options[],
45-
const int indices[],
46-
const String attr[],
47-
int selectedIndex,
48-
bool reloadonchange,
49-
bool enabled,
50-
const __FlashStringHelper * classname
51-
#if FEATURE_TOOLTIPS
52-
,
53-
const String & tooltip = EMPTY_STRING
54-
#endif // if FEATURE_TOOLTIPS
55-
);
56-
57-
void addSelector(const String& id,
58-
int optionCount,
59-
const String options[],
60-
const int indices[],
61-
const String attr[],
62-
int selectedIndex,
63-
bool reloadonchange,
64-
bool enabled,
65-
const __FlashStringHelper * classname
66-
#if FEATURE_TOOLTIPS
67-
,
68-
const String& tooltip = EMPTY_STRING
69-
#endif // if FEATURE_TOOLTIPS
70-
);
71-
72-
void addSelector_reloadOnChange(
73-
const String& id,
74-
int optionCount,
75-
const String options[],
76-
const int indices[],
77-
const String attr[],
78-
int selectedIndex,
79-
const String& onChangeCall,
80-
bool enabled,
81-
const __FlashStringHelper * classname
82-
#if FEATURE_TOOLTIPS
83-
,
84-
const String& tooltip = EMPTY_STRING
85-
#endif // if FEATURE_TOOLTIPS
86-
);
87-
88-
89-
void addSelector_options(int optionCount,
90-
const __FlashStringHelper *options[],
91-
const int indices[],
92-
const String attr[],
93-
int selectedIndex);
94-
void addSelector_options(int optionCount,
95-
const String options[],
96-
const int indices[],
97-
const String attr[],
98-
int selectedIndex);
9914

10015
void addSelector_Head(const String& id);
10116

src/src/WebServer/Rules.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,15 @@ void handle_rules() {
8181
optionValues[x] = x + 1;
8282
}
8383

84-
addSelector_reloadOnChange(
85-
F("set"),
84+
FormSelectorOptions selector(
8685
RULESETS_MAX,
8786
options,
88-
optionValues,
89-
nullptr,
90-
choice,
91-
F("return rules_set_onchange(rulesselect)"),
92-
true,
93-
F("wide"));
87+
optionValues);
88+
89+
selector.onChangeCall = F("return rules_set_onchange(rulesselect)");
90+
selector.addSelector(
91+
F("set"),
92+
choice);
9493
addHelpButton(F("Tutorial_Rules"));
9594
addRTDHelpButton(F("Rules/Rules.html"));
9695
}

0 commit comments

Comments
 (0)