Confirmed users
133
edits
Luke-chang (talk | contribs) m (→Idea) |
Luke-chang (talk | contribs) m (→Concept) |
||
| 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 | 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 | # 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). | ||