Skip to content

Commit bdb9112

Browse files
committed
fix main page buttons
1 parent c2bc84d commit bdb9112

File tree

7 files changed

+7
-5
lines changed

7 files changed

+7
-5
lines changed

examples/esp8266/WebMenu/WebMenu/WebMenu.ino

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ menuOut& operator<<(menuOut& o,endlObj) {
6060
}
6161

6262
//this version numbers MUST be the same as data/1.2
63-
#define CUR_VERSION "1.2"
63+
#define CUR_VERSION "1.3"
6464
#define APName "WebMenu"
6565
#define ANALOG_PIN 4
6666

@@ -134,7 +134,7 @@ CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
134134
,VALUE("Last",-1,doNothing,noEvent)
135135
);
136136

137-
int dutty=50;//%
137+
int duty=50;//%
138138
int timeOn=50;//ms
139139
void updAnalog() {
140140
// analogWrite(ANALOG_PIN,map(timeOn,0,100,0,255/*PWMRANGE*/));
@@ -181,7 +181,7 @@ MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
181181
,SUBMENU(setLed)
182182
,OP("Action A",action1,enterEvent)
183183
,OP("Action B",action2,enterEvent)
184-
,FIELD(dutty,"Dutty","%",0,100,10,1, updAnalog, anyEvent, noStyle)
184+
,FIELD(duty,"Duty","%",0,100,10,1, updAnalog, anyEvent, noStyle)
185185
,FIELD(timeOn,"On","ms",0,100,10,1, updAnalog, anyEvent, noStyle)
186186
,EDIT("Name",name,alphaNumMask,doNothing,noEvent,noStyle)
187187
,SUBMENU(birthDate)
@@ -332,6 +332,8 @@ auto mainPage= []() {
332332
_trace(Serial<<"serving main page from root!"<<endl);
333333
server.sendHeader("Location", CUR_VERSION "/index.html", true);
334334
server.send ( 302, "text/plain", "");
335+
if (server.hasArg("at"))
336+
nav.async(server.arg("at").c_str());
335337
};
336338

337339
void setup(){

examples/esp8266/WebMenu/WebMenu/data/1.2/bootstrap.xslt renamed to examples/esp8266/WebMenu/WebMenu/data/1.3/bootstrap.xslt

File renamed without changes.
File renamed without changes.

examples/esp8266/WebMenu/WebMenu/data/1.2/index.html renamed to examples/esp8266/WebMenu/WebMenu/data/1.3/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ <h3 class="masthead-brand">ArduinoMenu library</h3>
4646
<div class="inner cover">
4747
<h2><img src="/img/logo.png" height="48px"/>on ESP8266</h1>
4848
<p>Example of async menu call on customized static web page.</p>
49-
<a href="?at=/1" class="btn btn-lg btn-success">Action A</a>
50-
<a href="?at=/2" class="btn btn-lg btn-default">Action B</a>
49+
<a href="/?at=/1" class="btn btn-lg btn-success">Action A</a>
50+
<a href="/?at=/2" class="btn btn-lg btn-default">Action B</a>
5151
<a href="/menu" class="btn btn-lg">Full menu</a>
5252
</div>
5353
<hr/>
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)