mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug #227209 --> Add priority menulist to the compose toolbar as an optional toolbar button
This commit is contained in:
parent
cbcce6aa7e
commit
5de61ee1a6
@ -1317,6 +1317,9 @@ function ComposeStartup(recycled, aParams)
|
||||
onFontColorChange();
|
||||
onBackgroundColorChange();
|
||||
}
|
||||
|
||||
// reset the priorty field for recycled windows
|
||||
updatePriorityToolbarButton('normal');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1843,20 +1846,38 @@ function MessageFcc(menuItem)
|
||||
}
|
||||
}
|
||||
|
||||
function updatePriorityMenu()
|
||||
{
|
||||
if (gMsgCompose)
|
||||
{
|
||||
var msgCompFields = gMsgCompose.compFields;
|
||||
if (msgCompFields && msgCompFields.priority)
|
||||
{
|
||||
var priorityMenu = document.getElementById('priorityMenu' );
|
||||
priorityMenu.getElementsByAttribute( "checked", 'true' )[0].removeAttribute('checked');
|
||||
priorityMenu.getElementsByAttribute( "value", msgCompFields.priority )[0].setAttribute('checked', 'true');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function updatePriorityToolbarButton(newPriorityValue)
|
||||
{
|
||||
var prioritymenu = document.getElementById('priorityMenu-button');
|
||||
if (prioritymenu)
|
||||
prioritymenu.value = newPriorityValue;
|
||||
}
|
||||
|
||||
function PriorityMenuSelect(target)
|
||||
{
|
||||
if (gMsgCompose)
|
||||
{
|
||||
var msgCompFields = gMsgCompose.compFields;
|
||||
if (msgCompFields)
|
||||
switch (target.getAttribute('id'))
|
||||
{
|
||||
case "priority_lowest": msgCompFields.priority = "lowest"; break;
|
||||
case "priority_low": msgCompFields.priority = "low"; break;
|
||||
case "priority_normal": msgCompFields.priority = "normal"; break;
|
||||
case "priority_high": msgCompFields.priority = "high"; break;
|
||||
case "priotity_highest": msgCompFields.priority = "highest"; break;
|
||||
}
|
||||
msgCompFields.priority = target.getAttribute('value');
|
||||
|
||||
// keep priority toolbar button in synch with possible changes via the menu item
|
||||
updatePriorityToolbarButton(target.getAttribute('value'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -380,13 +380,13 @@
|
||||
<menuitem type="radio" name="output_format" label="&bothFormatCmd.label;" accesskey="&bothFormatCmd.accesskey;" id="format_both"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="priorityMenu" label="&priorityMenu.label;" accesskey="&priorityMenu.accesskey;" oncommand="PriorityMenuSelect(event.target);">
|
||||
<menu id="priorityMenu" label="&priorityMenu.label;" accesskey="&priorityMenu.accesskey;" onpopupshowing="updatePriorityMenu();" oncommand="PriorityMenuSelect(event.target);">
|
||||
<menupopup>
|
||||
<menuitem type="radio" name="priority" label="&lowestPriorityCmd.label;" accesskey="&lowestPriorityCmd.accesskey;" id="priority_lowest"/>
|
||||
<menuitem type="radio" name="priority" label="&lowPriorityCmd.label;" accesskey="&lowPriorityCmd.accesskey;" id="priority_low"/>
|
||||
<menuitem type="radio" name="priority" label="&normalPriorityCmd.label;" accesskey="&normalPriorityCmd.accesskey;" id="priority_normal" checked="true"/>
|
||||
<menuitem type="radio" name="priority" label="&highPriorityCmd.label;" accesskey="&highPriorityCmd.accesskey;" id="priority_high"/>
|
||||
<menuitem type="radio" name="priority" label="&highestPriorityCmd.label;" accesskey="&highestPriorityCmd.accesskey;" id="priotity_highest"/>
|
||||
<menuitem type="radio" name="priority" label="&lowestPriorityCmd.label;" accesskey="&lowestPriorityCmd.accesskey;" value="lowest" id="priority_lowest"/>
|
||||
<menuitem type="radio" name="priority" label="&lowPriorityCmd.label;" accesskey="&lowPriorityCmd.accesskey;" value="low" id="priority_low"/>
|
||||
<menuitem type="radio" name="priority" label="&normalPriorityCmd.label;" accesskey="&normalPriorityCmd.accesskey;" value="normal" id="priority_normal" checked="true"/>
|
||||
<menuitem type="radio" name="priority" label="&highPriorityCmd.label;" accesskey="&highPriorityCmd.accesskey;" value="high" id="priority_high"/>
|
||||
<menuitem type="radio" name="priority" label="&highestPriorityCmd.label;" accesskey="&highestPriorityCmd.accesskey;" value="highest" id="priority_highest"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="fccMenu" label="&fileCarbonCopyCmd.label;"
|
||||
@ -549,6 +549,7 @@
|
||||
id="quoteButton" label=""eButton.label;"
|
||||
tooltiptext=""eButton.tooltip;"
|
||||
command="cmd_quoteMessage"/>
|
||||
|
||||
<toolbarbutton id="cut-button" class="toolbarbutton-1"
|
||||
label="&cutCmd.label;"
|
||||
command="cmd_cut"
|
||||
@ -562,11 +563,25 @@
|
||||
command="cmd_paste"
|
||||
tooltiptext="&pasteButton.tooltip;"/>
|
||||
|
||||
<toolbaritem id="priority-button" align="center" pack="center">
|
||||
<label value="&priorityButton.label;"/>
|
||||
<menulist id="priorityMenu-button" value="normal" oncommand="PriorityMenuSelect(event.target);">
|
||||
<menupopup>
|
||||
<menuitem name="priority" label="&lowestPriorityCmd.label;" value="lowest" id="list_priority_lowest"/>
|
||||
<menuitem name="priority" label="&lowPriorityCmd.label;" value="low" id="list_priority_low"/>
|
||||
<menuitem name="priority" label="&normalPriorityCmd.label;" value="normal" id="list_priority_normal"/>
|
||||
<menuitem name="priority" label="&highPriorityCmd.label;" value="high" id="list_priority_high"/>
|
||||
<menuitem name="priority" label="&highestPriorityCmd.label;" value="highest" id="list_priotity_highest"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</toolbaritem>
|
||||
|
||||
<toolbaritem id="throbber-box" align="center" pack="center">
|
||||
<button id="navigator-throbber" oncommand="loadThrobberUrl('compose.throbber.url')" tooltiptext="&throbber.tooltip;">
|
||||
<observes element="broadcaster_throbber" attribute="busy"/>
|
||||
</button>
|
||||
</toolbaritem>
|
||||
|
||||
</toolbarpalette>
|
||||
|
||||
<toolbar id="composeToolbar" class="toolbar-primary chromeclass-toolbar"
|
||||
|
@ -138,6 +138,7 @@
|
||||
<!ENTITY bothFormatCmd.accesskey "l">
|
||||
<!ENTITY priorityMenu.label "Priority">
|
||||
<!ENTITY priorityMenu.accesskey "p">
|
||||
<!ENTITY priorityButton.label "Priority:">
|
||||
<!ENTITY lowestPriorityCmd.label "Lowest">
|
||||
<!ENTITY lowestPriorityCmd.accesskey "l">
|
||||
<!ENTITY lowPriorityCmd.label "Low">
|
||||
|
Loading…
Reference in New Issue
Block a user