mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Update showMenu docs to be more explicit, and remove duplicate entries in docs
This commit is contained in:
parent
4ed174d954
commit
15de460b31
@ -2423,7 +2423,7 @@ var mainmenu = {
|
||||
min:0,max:100,step:10,
|
||||
onchange : v => { number=v; }
|
||||
},
|
||||
"Exit" : function() { E.showMenu(); },
|
||||
"Exit" : function() { E.showMenu(); }, // remove the menu
|
||||
};
|
||||
// Submenu
|
||||
var submenu = {
|
||||
@ -2436,6 +2436,9 @@ var submenu = {
|
||||
E.showMenu(mainmenu);
|
||||
```
|
||||
|
||||
The menu will stay onscreen and active until explicitly removed,
|
||||
which you can do by calling `E.showMenu()` without arguments.
|
||||
|
||||
See http://www.espruino.com/graphical_menu for more detailed information.
|
||||
*/
|
||||
|
||||
|
||||
@ -506,7 +506,7 @@ DEPRECATED: Use `E.showMenu`
|
||||
],
|
||||
"return" : ["JsVar", "A menu object with `draw`, `move` and `select` functions" ]
|
||||
}
|
||||
Display a menu on Pixl.js's screen, and set up the buttons to navigate through it.
|
||||
Display a menu on the screen, and set up the buttons to navigate through it.
|
||||
|
||||
Supply an object containing menu items. When an item is selected, the
|
||||
function it references will be executed. For example:
|
||||
@ -530,7 +530,7 @@ var mainmenu = {
|
||||
min:0,max:100,step:10,
|
||||
onchange : v => { number=v; }
|
||||
},
|
||||
"Exit" : function() { E.showMenu(); },
|
||||
"Exit" : function() { E.showMenu(); }, // remove the menu
|
||||
};
|
||||
// Submenu
|
||||
var submenu = {
|
||||
@ -543,6 +543,9 @@ var submenu = {
|
||||
E.showMenu(mainmenu);
|
||||
```
|
||||
|
||||
The menu will stay onscreen and active until explicitly removed,
|
||||
which you can do by calling `E.showMenu()` without arguments.
|
||||
|
||||
See http://www.espruino.com/graphical_menu for more detailed information.
|
||||
*/
|
||||
|
||||
|
||||
@ -190,6 +190,21 @@ def insert_mdn_link(jsondata):
|
||||
if code==200:
|
||||
html("<p><a href=\""+url+"\">View MDN documentation</a></p>")
|
||||
|
||||
|
||||
# Remove duplicates
|
||||
existingSymbols = {}
|
||||
unduplicatedjsondatas = []
|
||||
for jsondata in jsondatas:
|
||||
duplicate = False
|
||||
if "name" in jsondata:
|
||||
n = get_fullname(jsondata)
|
||||
if n in existingSymbols:
|
||||
print("WARNING: Duplicate symbol "+n);
|
||||
duplicate = True
|
||||
existingSymbols[n] = jsondata
|
||||
if not duplicate: unduplicatedjsondatas.append(jsondata)
|
||||
jsondatas = unduplicatedjsondatas
|
||||
|
||||
html("<html>")
|
||||
html(" <head>")
|
||||
html(" <title>Espruino Reference</title>")
|
||||
@ -329,7 +344,7 @@ for jsondata in detail:
|
||||
html(" </ul>")
|
||||
|
||||
# Otherwise just output detail
|
||||
link = get_link(jsondata)
|
||||
link = get_link(jsondata)
|
||||
html(" <h3 class=\"detail\"><a class=\"blush\" name=\""+link+"\" href=\"#t_"+link+"\" onclick=\"place('t_"+link+"','"+linkName+"');\">"+get_fullname(jsondata)+"</a>")
|
||||
#html("<!-- "+json.dumps(jsondata, sort_keys=True, indent=2)+"-->");
|
||||
if "githublink" in jsondata:
|
||||
|
||||
@ -245,15 +245,6 @@ JsVar *jswrap_onewire_read(JsVar *parent, JsVar *count) {
|
||||
}
|
||||
|
||||
|
||||
/*JSON{
|
||||
"type" : "method",
|
||||
"class" : "OneWire",
|
||||
"name" : "search",
|
||||
"generate" : "jswrap_onewire_search",
|
||||
"return" : ["JsVar","An array of devices that were found"]
|
||||
}
|
||||
Search for devices
|
||||
*/
|
||||
/*JSON{
|
||||
"type" : "method",
|
||||
"class" : "OneWire",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user