Bug 337845: Spell checking options should be at the bottom of the context menu, patch by Simon B�nzli <zeniko@gmail.com>, r=brettw, ben

This commit is contained in:
gavin%gavinsharp.com 2006-07-28 05:53:16 +00:00
Родитель e38fd8b8e4
Коммит f74c0f26fb
3 изменённых файлов: 31 добавлений и 31 удалений

Просмотреть файл

@ -41,28 +41,11 @@
<menuitem id="spell-no-suggestions"
disabled="true"
label="&spellNoSuggestions.label;"/>
<menuseparator id="spell-suggestions-separator"/>
<menuitem id="spell-add-to-dictionary"
label="&spellAddToDictionary.label;"
accesskey="&spellAddToDictionary.accesskey;"
oncommand="InlineSpellCheckerUI.addToDictionary();"/>
<menuitem id="spell-check-enabled"
label="&spellEnable.label;"
type="checkbox"
accesskey="&spellEnable.accesskey;"
oncommand="InlineSpellCheckerUI.toggleEnabled();"/>
<menu id="spell-dictionaries"
label="&spellDictionaries.label;"
accesskey="&spellDictionaries.accesskey;">
<menupopup id="spell-dictionaries-menu">
<menuseparator id="spell-language-separator"/>
<menuitem id="spell-add-dictionaries"
label="&spellAddDictionaries.label;"
accesskey="&spellAddDictionaries.accesskey;"
oncommand="gContextMenu.addDictionaries();"/>
</menupopup>
</menu>
<menuseparator id="spell-separator"/>
<menuseparator id="spell-suggestions-separator"/>
<menuitem id="context-openlink"
label="&openLinkCmd.label;"
accesskey="&openLinkCmd.accesskey;"
@ -252,6 +235,23 @@
label="&metadataCmd.label;"
accesskey="&metadataCmd.accesskey;"
oncommand="gContextMenu.showMetadata();"/>
<menuseparator id="spell-separator"/>
<menuitem id="spell-check-enabled"
label="&spellEnable.label;"
type="checkbox"
accesskey="&spellEnable.accesskey;"
oncommand="InlineSpellCheckerUI.toggleEnabled();"/>
<menu id="spell-dictionaries"
label="&spellDictionaries.label;"
accesskey="&spellDictionaries.accesskey;">
<menupopup id="spell-dictionaries-menu">
<menuseparator id="spell-language-separator"/>
<menuitem id="spell-add-dictionaries"
label="&spellAddDictionaries.label;"
accesskey="&spellAddDictionaries.accesskey;"
oncommand="gContextMenu.addDictionaries();"/>
</menupopup>
</menu>
<menuseparator hidden="true" id="context-sep-bidi"/>
<menuitem hidden="true" id="context-bidi-text-direction-toggle"
label="&bidiSwitchTextDirectionItem.label;"

Просмотреть файл

@ -4457,7 +4457,7 @@ nsContextMenu.prototype = {
this.showItem("spell-suggestions-separator", onMisspelling);
if (onMisspelling) {
var menu = document.getElementById("contentAreaContextMenu");
var suggestionsSeparator = document.getElementById("spell-suggestions-separator");
var suggestionsSeparator = document.getElementById("spell-add-to-dictionary");
var numsug = InlineSpellCheckerUI.addSuggestionsToMenu(menu, suggestionsSeparator, 5);
this.showItem("spell-no-suggestions", numsug == 0);
} else {

Просмотреть файл

@ -278,16 +278,8 @@
onpopuphiding="this.parentNode._doPopupItemDisabling(this);"
oncommand="var cmd = event.originalTarget.getAttribute('cmd'); if(cmd) { this.parentNode.doCommand(cmd); event.stopPropagation(); }">
<xul:menuitem label="&spellNoSuggestions.label;" anonid="spell-no-suggestions" disabled="true"/>
<xul:menuseparator anonid="spell-suggestions-separator"/>
<xul:menuitem label="&spellAddToDictionary.label;" accesskey="&spellAddToDictionary.accesskey;" anonid="spell-add-to-dictionary" oncommand="this.parentNode.parentNode.spellui.addToDictionary();"/>
<xul:menuitem label="&spellEnable.label;" type="checkbox" accesskey="&spellEnable.accesskey;" anonid="spell-check-enabled" oncommand="this.parentNode.parentNode.spellui.toggleEnabled();"/>
<xul:menu label="&spellDictionaries.label;" accesskey="&spellDictionaries.accesskey;" anonid="spell-dictionaries">
<xul:menupopup anonid="spell-dictionaries-menu"
onpopupshowing="event.stopPropagation();"
onpopuphiding="event.stopPropagation();">
</xul:menupopup>
</xul:menu>
<xul:menuseparator anonid="spell-check-separator"/>
<xul:menuseparator anonid="spell-suggestions-separator"/>
<xul:menuitem label="&undoCmd.label;" accesskey="&undoCmd.accesskey;" cmd="cmd_undo"/>
<xul:menuseparator/>
<xul:menuitem label="&cutCmd.label;" accesskey="&cutCmd.accesskey;" cmd="cmd_cut"/>
@ -296,6 +288,14 @@
<xul:menuitem label="&deleteCmd.label;" accesskey="&deleteCmd.accesskey;" cmd="cmd_delete"/>
<xul:menuseparator/>
<xul:menuitem label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;" cmd="cmd_selectAll"/>
<xul:menuseparator anonid="spell-check-separator"/>
<xul:menuitem label="&spellEnable.label;" type="checkbox" accesskey="&spellEnable.accesskey;" anonid="spell-check-enabled" oncommand="this.parentNode.parentNode.spellui.toggleEnabled();"/>
<xul:menu label="&spellDictionaries.label;" accesskey="&spellDictionaries.accesskey;" anonid="spell-dictionaries">
<xul:menupopup anonid="spell-dictionaries-menu"
onpopupshowing="event.stopPropagation();"
onpopuphiding="event.stopPropagation();">
</xul:menupopup>
</xul:menu>
</xul:menupopup>
</content>
@ -350,9 +350,9 @@
this._setMenuItemVisibility("spell-suggestions-separator", overMisspelling);
// suggestion list
var spellSeparator = document.getAnonymousElementByAttribute(this,
"anonid", "spell-suggestions-separator");
var numsug = spellui.addSuggestionsToMenu(popupNode, spellSeparator, 5);
var suggestionsSeparator = document.getAnonymousElementByAttribute(this,
"anonid", "spell-add-to-dictionary");
var numsug = spellui.addSuggestionsToMenu(popupNode, suggestionsSeparator, 5);
this._setMenuItemVisibility("spell-no-suggestions", overMisspelling && numsug == 0);
// dictionary list