WebAPI/Softkey through context menu: Difference between revisions

Jump to navigation Jump to search
m
Line 9: Line 9:
== Concept ==
== Concept ==


Gaia utilizes [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu <menu>], [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menuitem <menuitem>] and [https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contextmenu "contextmenu"] to define captions, icons and handlers of the softkeys they want. Please see the sample code in the session below.
Gaia utilizes [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu <menu>], [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menuitem <menuitem>] and [https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contextmenu "contextmenu"] to define labels, icons and handlers of the softkeys they want. Please see the sample code in the session below.


The reason to choose "contextmenu" attribute is because...
The reason to choose "contextmenu" attribute is because...
# The "contextmenu" attribute is used to provide a set of context menu to user agent and the app itself doesn't need to care about how these menus should be rendered.
# The "contextmenu" attribute is used to provide a set of context menu to user agent and the app itself doesn't need to care about how these menus should be rendered.
# Developers can easily customize their own texts, icons and event handlers by using exist attributes of <menuitem>.
# Developers can easily customize their own labels, icons and event handlers by using existing attributes of <menuitem>.
# The "contextmenu" can be overridden by each DOMElement within a page so that we can design different set of menus under different circumstances (e.g. focus on different elements).
# The "contextmenu" can be overridden by each DOMElement within a page so that we can design different set of menus under different circumstances (e.g. focus on different elements).


Confirmed users
133

edits

Navigation menu