[html5] r4159 - [e] (0) Add examples of <command>.

whatwg at whatwg.org whatwg at whatwg.org
Sun Oct 18 00:25:37 PDT 2009


Author: ianh
Date: 2009-10-18 00:25:36 -0700 (Sun, 18 Oct 2009)
New Revision: 4159

Modified:
   complete.html
   index
   source
Log:
[e] (0) Add examples of <command>.

Modified: complete.html
===================================================================
--- complete.html	2009-10-18 05:53:09 UTC (rev 4158)
+++ complete.html	2009-10-18 07:25:36 UTC (rev 4159)
@@ -42344,7 +42344,7 @@
   <p>The attribute is an <a href=#enumerated-attribute>enumerated attribute</a> with three
   keywords and states. The "<dfn id=attr-command-type-keyword-command title=attr-command-type-keyword-command><code>command</code></dfn>"
   keyword maps to the <a href=#attr-command-type-state-command title=attr-command-type-state-command>Command</a> state, the
-  <dfn id=attr-command-type-keyword-checkbox title=attr-command-type-keyword-checkbox><code>checkbox</code></dfn>"
+  "<dfn id=attr-command-type-keyword-checkbox title=attr-command-type-keyword-checkbox><code>checkbox</code></dfn>"
   keyword maps to the <a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</a> state, and
   the "<dfn id=attr-command-type-keyword-radio title=attr-command-type-keyword-radio><code>radio</code></dfn>"
   keyword maps to the <a href=#attr-command-type-state-radio title=attr-command-type-state-radio>Radio</a> state. The
@@ -42484,10 +42484,30 @@
   <p class=note><code><a href=#the-command>command</a></code> elements are not rendered
   unless they <a href=#menus title=menu>form part of a menu</a>.</p>
 
+  <div class=example>
 
+   <p>Here is an example of a toolbar with three buttons that let the
+   user toggle between left, center, and right alignment. One could
+   imagine such a toolbar as part of a text editor. The toolbar also
+   has a separator followed by another button labeled "Publish",
+   though that button is disabled.</p>
 
+   <pre><menu type="toolbar">
+ <command type="radio" radiogroup="alignment" checked="checked"
+          label="Left" icon="icons/alL.png" onclick="setAlign('left')">
+ <command type="radio" radiogroup="alignment"
+          label="Center" icon="icons/alC.png" onclick="setAlign('center')">
+ <command type="radio" radiogroup="alignment"
+          label="Right" icon="icons/alR.png" onclick="setAlign('right')">
+ <hr>
+ <command type="command" disabled
+          label="Publish" icon="icons/pub.png" onclick="publish()">
+</menu></pre>
 
+  </div>
 
+
+
   <h4 id=menus><span class=secno>4.11.3 </span>The <dfn><code>menu</code></dfn> element</h4>
 
   <dl class=element><dt>Categories</dt>
@@ -42628,6 +42648,7 @@
   children.</p>
 
 
+
   <div class=impl>
 
   <h5 id=building-menus-and-toolbars><span class=secno>4.11.3.2 </span><dfn>Building menus and toolbars</dfn></h5>
@@ -42779,8 +42800,27 @@
 
   </div>
 
+  <div class=example>
 
+   <p>Here is an example of a context menu for an input control:</p>
 
+   <pre><form name="npc">
+ <label>Character name: <input name=char type=text contextmenu=namemenu required></label>
+ <menu type=context id=namemenu>
+  <command label="Pick random name" onclick="document.forms.npc.elements.char.value = getRandomName()">
+  <command label="Prefill other fields based on name" onclick="prefillFields(document.forms.npc.elements.char.value)">
+ </menu>
+</form></pre>
+
+   <p>This adds to items to the control's context menu, one called
+   "Pick random name", and one called "Prefill other fields based on
+   name". They invoke scripts that are not shown in the example
+   above.</p>
+
+  </div>
+
+
+
   <div class=impl>
 
   <h5 id=toolbars><span class=secno>4.11.3.4 </span><dfn>Toolbars</dfn></h5>

Modified: index
===================================================================
--- index	2009-10-18 05:53:09 UTC (rev 4158)
+++ index	2009-10-18 07:25:36 UTC (rev 4159)
@@ -42173,7 +42173,7 @@
   <p>The attribute is an <a href=#enumerated-attribute>enumerated attribute</a> with three
   keywords and states. The "<dfn id=attr-command-type-keyword-command title=attr-command-type-keyword-command><code>command</code></dfn>"
   keyword maps to the <a href=#attr-command-type-state-command title=attr-command-type-state-command>Command</a> state, the
-  <dfn id=attr-command-type-keyword-checkbox title=attr-command-type-keyword-checkbox><code>checkbox</code></dfn>"
+  "<dfn id=attr-command-type-keyword-checkbox title=attr-command-type-keyword-checkbox><code>checkbox</code></dfn>"
   keyword maps to the <a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</a> state, and
   the "<dfn id=attr-command-type-keyword-radio title=attr-command-type-keyword-radio><code>radio</code></dfn>"
   keyword maps to the <a href=#attr-command-type-state-radio title=attr-command-type-state-radio>Radio</a> state. The
@@ -42313,10 +42313,30 @@
   <p class=note><code><a href=#the-command>command</a></code> elements are not rendered
   unless they <a href=#menus title=menu>form part of a menu</a>.</p>
 
+  <div class=example>
 
+   <p>Here is an example of a toolbar with three buttons that let the
+   user toggle between left, center, and right alignment. One could
+   imagine such a toolbar as part of a text editor. The toolbar also
+   has a separator followed by another button labeled "Publish",
+   though that button is disabled.</p>
 
+   <pre><menu type="toolbar">
+ <command type="radio" radiogroup="alignment" checked="checked"
+          label="Left" icon="icons/alL.png" onclick="setAlign('left')">
+ <command type="radio" radiogroup="alignment"
+          label="Center" icon="icons/alC.png" onclick="setAlign('center')">
+ <command type="radio" radiogroup="alignment"
+          label="Right" icon="icons/alR.png" onclick="setAlign('right')">
+ <hr>
+ <command type="command" disabled
+          label="Publish" icon="icons/pub.png" onclick="publish()">
+</menu></pre>
 
+  </div>
 
+
+
   <h4 id=menus><span class=secno>4.11.3 </span>The <dfn><code>menu</code></dfn> element</h4>
 
   <dl class=element><dt>Categories</dt>
@@ -42457,6 +42477,7 @@
   children.</p>
 
 
+
   <div class=impl>
 
   <h5 id=building-menus-and-toolbars><span class=secno>4.11.3.2 </span><dfn>Building menus and toolbars</dfn></h5>
@@ -42608,8 +42629,27 @@
 
   </div>
 
+  <div class=example>
 
+   <p>Here is an example of a context menu for an input control:</p>
 
+   <pre><form name="npc">
+ <label>Character name: <input name=char type=text contextmenu=namemenu required></label>
+ <menu type=context id=namemenu>
+  <command label="Pick random name" onclick="document.forms.npc.elements.char.value = getRandomName()">
+  <command label="Prefill other fields based on name" onclick="prefillFields(document.forms.npc.elements.char.value)">
+ </menu>
+</form></pre>
+
+   <p>This adds to items to the control's context menu, one called
+   "Pick random name", and one called "Prefill other fields based on
+   name". They invoke scripts that are not shown in the example
+   above.</p>
+
+  </div>
+
+
+
   <div class=impl>
 
   <h5 id=toolbars><span class=secno>4.11.3.4 </span><dfn>Toolbars</dfn></h5>

Modified: source
===================================================================
--- source	2009-10-18 05:53:09 UTC (rev 4158)
+++ source	2009-10-18 07:25:36 UTC (rev 4159)
@@ -47011,7 +47011,7 @@
   title="attr-command-type-keyword-command"><code>command</code></dfn>"
   keyword maps to the <span
   title="attr-command-type-state-command">Command</span> state, the
-  <dfn
+  "<dfn
   title="attr-command-type-keyword-checkbox"><code>checkbox</code></dfn>"
   keyword maps to the <span
   title="attr-command-type-state-checkbox">Checkbox</span> state, and
@@ -47187,10 +47187,30 @@
   <p class="note"><code>command</code> elements are not rendered
   unless they <span title="menu">form part of a menu</span>.</p>
 
+  <div class="example">
 
+   <p>Here is an example of a toolbar with three buttons that let the
+   user toggle between left, center, and right alignment. One could
+   imagine such a toolbar as part of a text editor. The toolbar also
+   has a separator followed by another button labeled "Publish",
+   though that button is disabled.</p>
 
+   <pre><menu type="toolbar">
+ <command type="radio" radiogroup="alignment" checked="checked"
+          label="Left" icon="icons/alL.png" onclick="setAlign('left')">
+ <command type="radio" radiogroup="alignment"
+          label="Center" icon="icons/alC.png" onclick="setAlign('center')">
+ <command type="radio" radiogroup="alignment"
+          label="Right" icon="icons/alR.png" onclick="setAlign('right')">
+ <hr>
+ <command type="command" disabled
+          label="Publish" icon="icons/pub.png" onclick="publish()">
+</menu></pre>
 
+  </div>
 
+
+
   <h4 id="menus">The <dfn><code>menu</code></dfn> element</h4>
 
   <dl class="element">
@@ -47346,6 +47366,7 @@
   children.</p>
 
 
+
   <div class="impl">
 
   <h5><dfn>Building menus and toolbars</dfn></h5>
@@ -47519,8 +47540,27 @@
 
   </div>
 
+  <div class="example">
 
+   <p>Here is an example of a context menu for an input control:</p>
 
+   <pre><form name="npc">
+ <label>Character name: <input name=char type=text contextmenu=namemenu required></label>
+ <menu type=context id=namemenu>
+  <command label="Pick random name" onclick="document.forms.npc.elements.char.value = getRandomName()">
+  <command label="Prefill other fields based on name" onclick="prefillFields(document.forms.npc.elements.char.value)">
+ </menu>
+</form></pre>
+
+   <p>This adds to items to the control's context menu, one called
+   "Pick random name", and one called "Prefill other fields based on
+   name". They invoke scripts that are not shown in the example
+   above.</p>
+
+  </div>
+
+
+
   <div class="impl">
 
   <h5><dfn>Toolbars</dfn></h5>




More information about the Commit-Watchers mailing list