[whatwg] Web Applications 1.0 and Menu Labels

On Fri, 10 Aug 2007, Matthew Paul Thomas wrote:
> > On Mon, 22 Nov 2004, Matthew Thomas wrote:
> 
> I'm suggesting that since it is common for entire menus -- or toolbars 
> -- to be temporarily irrelevant, such as when focus is in a field or 
> pane where they do not apply, there should be a disabled= attribute for 
> disabling an entire <menu>. When this attribute is present, all the 
> <menu>'s items should be disabled, regardless of their individual 
> disabled= attributes; when the <menu>'s disabled= attribute is removed, 
> the disabled= attributes of the individual items should retake effect. 
> This would save authors a lot of work that they might otherwise not 
> bother with, thereby making their interfaces more responsive.
>
> I do not think "but the menu items might be duplicated in a toolbar" is 
> a strong counterargument. If the temporarily-irrelevant items are a 
> subset of the items a toolbar, then yes, they will need disabling 
> individually. But often it will be the entire toolbar that needs 
> disabling, or the menu will not have equivalent items in a toolbar, or 
> -- even more common in Web apps -- the toolbar will not have equivalent 
> items in a menu.

My concern is that once we extend this mechanism so that you describe 
commands separate from the menus and toolbars that they are found in, and 
maybe when we add a way to map keyboard shortcuts to commands, disabling 
a toolbar or menu simply won't work, and it'll confuse authors.

i.e. I'm hoping we eventually get to a system like:

   <head>
    ...
    <command id="copy" label="Copy" onclick="copy()">
    <command id="cut" label="Cut" onclick="cut()">
    <command id="paste" label="Paste" onclick="paste()">
   </head>
   ...
   <menu type="toolbar">
    <command command="copy">
    <command command="cut">
    <command command="paste">
    ...
   </menu>
   <menu type="context">
    <command command="copy">
    <command command="cut">
    <command command="paste">
    ...
   </menu>
   <accesskey command="copy" key="meta c">
   <accesskey command="cut" key="meta x">
   <accesskey command="paste" key="meta v">
   ...
   <menu type="toolbar">
    <command command="paste">
    ...
   </menu>
   ...

...and so on. But now what do you do if copy/cut/paste aren't relevant? If 
you disable the menus you'll miss the access keys, and you might disable 
items you don't want to disable. What you really want to do is disable the 
actual commands, and have that automatically disable everything else.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Monday, 28 July 2008 19:21:17 UTC