<?xml version="1.0" encoding="utf-8" ?> 
<!--
****************************************************************************

     File Name:   awayMenu.box

****************************************************************************
   C O P Y R I G H T   A N D   C O N F I D E N T I A L I T Y   N O T I C E
****************************************************************************

//      Copyright (c) 2006 AOL LLC.  All rights reserved.
//      This software contains valuable confidential and proprietary
//      information of AOL LLC. and is subject to applicable
//      licensing agreements.  Unauthorized reproduction, transmission or
//      distribution of this file and its contents is a violation of
//      applicable laws.
//
//            A O L   C O N F I D E N T I A L

****************************************************************************
-->

<!DOCTYPE window SYSTEM "box://imApp/resources/imCatcher.dtd">


<?import href="box://aimToolkit/content/gadgets.box"?>

<library xmlns="http://www.aol.com/boxely/resource.xsd"
         xmlns:box="http://www.aol.com/boxely/box.xsd"
         xmlns:s="http://www.aol.com/boxely/style.xsd"
         xmlns:on="http://www.aol.com/boxely/reaction.xsd"
         persists="true">

    <bitmap id="bmp.away.background" src="box://imApp/theme/images/message_corner.png"/>
    <bitmap id="bmp.whitedropmark" src="box://aimToolkit/theme/images/whitedropmark.png"/>

    <gadget id="awayMenuBox" type="box" language="jscript" script="box://imApp/content/awayMenuBox.js">
        <script language="jscript" href="box://imApp/content/dateFormat.js"/>
        <script language="jscript" href="box://imApp/content/htmlSupport.js"/>
        <attributes applyStatusToAll="true" awayStatus="0" hidePrefix="false" prefix="&imCatcher.awayMessage.control.prefix;" 
            axis="y" awayMessageText="" selectableMode="item" engaged="true" blockEvents="false" focusMode="defer"/>
        <parts>
            <box:vbox s:flex="1" >
                <box:vbox s:flex="1" s:overflow="hidden" s:maxWidth="auto" >
                    <box:hbox s:vAlign="end" s:overflow="hidden" s:maxWidth="auto">
                        <box:aolImageButton id="eyeButton" style="aimEyeButtonStyle" accName="&imCatcher.awayMessage.tooltip.visible;" tooltip="&imCatcher.awayMessage.tooltip.visible;" on:command="gadget:toggleInvisibility();">
                            <box:binding elementSource="_gadget" targetProperty="tooltip" path="eyeTooltip" method="oneWay"/>
                            <box:binding elementSource="_gadget" targetProperty="accName" path="eyeTooltip" method="oneWay"/>
                            <box:binding elementSource="_gadget" targetProperty="invisible" path="invisible" method="oneWay"/>
                        </box:aolImageButton>
                        <box:aolLabel id="screenName" s:marginLeft="1" inherits="value=accountName" />
                    </box:hbox>
                    <box:hbox>
                        <box:aolButton id="awayButton" away="false" awayLabel="&imCatcher.awayMessage.button.awayLabel;" availLabel="&imCatcher.awayMessage.button.availLabel;" showBevel="true" on:command="gadget:toggleAwayStatus();">
                            <box:binding elementSource="gadget:awayMessageBox" path="collapsed" targetProperty="away" method="twoWay" sourceTransformer="toolkit:not" />
                            <box:reaction event="attributeSet" attributeName="away" action="gadget:updateAwayButtonText();" />
                        </box:aolButton>
                        <box:aolMenuButton id="awayDropdown" accName="&imCatcher.awayMessage.menuButton.accName;" noLabel="true">
                            <box:binding elementSource="gadget:awayButton" path="defaultButton" targetProperty="defaultButton" method="oneWay" />
                            <box:menuPopup id="menpopup" s:minWidth="&imCatcher.awayMessage.menuWidth;" s:maxWidth="auto" popupAlign="after_end" on:popping="gadget:loadStatusMenuButton(true);" style="popupWithoutTransition"> 
                                <box:aolMenuItem label="&imCatcher.awayMessage.newMessage;" accesskey="&imCatcher.awayMessage.newMessage_accessKey;" on:command="gadget:callQuickAway(true);"/>
                                <box:aolMenuSeparator/>
                                <box:aolCheckMenuItem id="awayStatus0" label="&imCatcher.awayMessage.available;" accesskey="&imCatcher.awayMessage.available_accesskey;" awayStatus="0" useDefault="false" doCommand="away" />
                                <box:aolCheckMenuItem id="awayStatus3" label="&imCatcher.awayMessage.away;" accesskey="&imCatcher.awayMessage.away_accesskey;" awayStatus="3" useDefault="true" doCommand="away"/>
                                <box:aolCheckMenuItem id="awayStatus1" label="&imCatcher.awayMessage.mobile;" accesskey="&imCatcher.awayMessage.mobile_accesskey;" awayStatus="1" useDefault="false" doCommand="away">
                                    <box:binding objectSource="bl" targetProperty="collapsed" path="showForwardToMobile" method="oneWay" sourceTransformer="toolkit:not"/>
                                </box:aolCheckMenuItem>
                                <box:aolMenuSeparator/>
                                <box:aolMenu label="&imCatcher.awayMessage.moreAwayMessages;" accesskey="&imCatcher.awayMessage.moreAwayMessages_accesskey;" topLevelMenu="false">
                                    <box:menuPopup id="customMessages" style="popupWithoutTransition"> 
                                        <box:aolMenuItem id="customMenuItemTemplate" plaintext="true" collapsed="true" awayStatus="3" doCommand="away"/>
                                    </box:menuPopup>
                                    <box:binding elementSource="_gadget" targetProperty="disabled" path="hasCustomMessages" method="oneWay" sourceTransformer="toolkit:not" />
                                </box:aolMenu>
                                <box:aolMenuSeparator/>
                                <box:aolCheckMenuItem id="applyToAll" label="&imCatcher.awayMessage.applyStatusToAllLinkedAccounts;" accesskey="&imCatcher.awayMessage.applyStatusToAllLinkedAccounts_accesskey;" toggled="true" doCommand="flipToggled">
                                    <box:binding elementSource="_gadget" targetProperty="toggled" path="applyStatusToAll" method="twoWay"/>
                                </box:aolCheckMenuItem>
                                <box:aolMenuSeparator>
                                    <box:binding elementSource="_prevSibling" targetProperty="collapsed" path="collapsed" method="oneWay"/>
                                </box:aolMenuSeparator>                            
                                <box:aolMenuItem label="&imCatcher.awayMessage.quickAway;" accesskey="&imCatcher.awayMessage.quickAway_accesskey;" on:command="gadget:callQuickAway();"/>
                            </box:menuPopup>                    
                        </box:aolMenuButton>
                    </box:hbox>
                </box:vbox>
                <box:vbox id="awayMessageBox" inherits="axis" collapsed="true">
                    <box:hbox id="displayMode" inherits="axis" s:flex="1" on:click="gadget:callQuickAway();" on:doubleClick="gadget:onStopPropagation();">
                        <box:vbox s:flex="1">
                            <box:hbox s:width="auto" s:maxWidth="auto">
                                <box:aolLabel id="awayLabel" baseHeight="25" plaintext="true">
                                    <box:binding elementSource="_gadget" targetProperty="value" path="awayMessageText" method="oneWay"/>
                                </box:aolLabel>
                            </box:hbox>
                            <box:vbox id="awayStatusWrapper" collapsed="true" s:maxWidth="auto" s:flex="1">
                                <box:hbox id="awayInfoTime" s:vAlign="start">
                                    <box:aolLabel id="lblTitleAwayTime" value="&imCatcher.awayMessage.time.prefix;"/>
                                    <box:aolLabel id="lblAwayTime" />
                                </box:hbox>
                                <box:hbox id="awayInfoCount" s:vAlign="start">
                                    <box:aolLabel id="lblIMCountTitle" value="&imCatcher.awayMessage.IMCount;"/>
                                    <box:aolLabel id="lblIMCount" />
                                </box:hbox>
                            </box:vbox>
                        </box:vbox>
                    </box:hbox>
                </box:vbox>
            </box:vbox>
        </parts>
        <behavior>
            <reaction event="click"         action="gadget:onStopPropagation();"/>
            <reaction event="command"       action="gadget:onMenuCommand();"/>
            <reaction event="presented"     action="gadget:onShowAwayMessage();"/>
            <reaction event="keyPress" keyCode="SPACE" ctrl="false" shift="false" alt="false" action="gadget:onStopPropagation();"/>
            <reaction event="keyPress" keyCode="ENTER" ctrl="false" shift="false" alt="false" action="gadget:onStopPropagation();"/>
        </behavior>
    </gadget>

    <gadget id="masterAwayMenuBox" type="box" language="jscript" script="box://imApp/content/awayMenuBox.js">
        <script language="jscript" href="box://imApp/content/dateFormat.js"/>
        <script language="jscript" href="box://imApp/content/htmlSupport.js"/>
        <attributes applyStatusToAll="true" awayStatus="0" hidePrefix="false" prefix="&imCatcher.awayMessage.control.prefix;" 
            axis="y" leftTitleMargin="0" master="true" awayMessageText=""
            selectableMode="item" engaged="true" blockEvents="false" focusMode="defer"/>
        <parts>
            <box:vbox s:flex="1" >
                <box:vbox s:flex="1">
                    <box:hbox s:maxWidth="auto" s:vAlign="end" >
                        <box:aolImageButton style="aimEyeButtonStyle" accName="&imCatcher.awayMessage.tooltip.visible;" tooltip="&imCatcher.awayMessage.tooltip.visible;" on:command="gadget:toggleInvisibility();" s:padding="2">
                            <box:binding elementSource="_gadget" targetProperty="tooltip" path="eyeTooltip" method="oneWay"/>
                            <box:binding elementSource="_gadget" targetProperty="accName" path="eyeTooltip" method="oneWay"/>
                            <box:binding elementSource="_gadget" targetProperty="invisible" path="invisible" method="oneWay"/>
                        </box:aolImageButton>
                        <box:aolLabel id="screenName" s:flex="1" s:marginLeft="1">
                            <box:binding objectSource="imapp" targetProperty="value" path="primaryScreenName" method="oneWay" />
                        </box:aolLabel>
                    </box:hbox>
                    <box:hbox>
                        <box:aolButton id="awayButton" away="false" awayLabel="&imCatcher.awayMessage.button.awayLabel;" availLabel="&imCatcher.awayMessage.button.availLabel;" showBevel="true" on:command="gadget:toggleAwayStatus();">
                            <box:binding elementSource="gadget:awayMessageBox" path="collapsed" targetProperty="away" method="twoWay" sourceTransformer="toolkit:not" />
                            <box:reaction event="attributeSet" attributeName="away" action="gadget:updateAwayButtonText();" />
                            <box:binding elementSource="blTopCap" path="away" targetProperty="defaultButton" method="twoWay" />
                        </box:aolButton>
                        <box:aolMenuButton id="awayDropdown" accName="&imCatcher.awayMessage.menuButton.accName;" noLabel="true">
                            <box:binding elementSource="gadget:awayButton" path="defaultButton" targetProperty="defaultButton" method="oneWay" />
                            <box:menuPopup id="menpopup" s:minWidth="&imCatcher.awayMessage.menuWidth;" s:maxWidth="auto" popupAlign="after_end" on:popping="gadget:loadStatusMenuButton(true);" style="popupWithoutTransition"> 
                                <box:aolMenuItem label="&imCatcher.awayMessage.newMessage;" accesskey="&imCatcher.awayMessage.newMessage_accessKey;" on:command="gadget:callQuickAway(true);"/>
                                <box:aolMenuSeparator/>
                                <box:aolCheckMenuItem id="awayStatus0" label="&imCatcher.awayMessage.available;" accesskey="&imCatcher.awayMessage.available_accesskey;" awayStatus="0" useDefault="false" doCommand="away" />
                                <box:aolCheckMenuItem id="awayStatus3" label="&imCatcher.awayMessage.away;" accesskey="&imCatcher.awayMessage.away_accesskey;" awayStatus="3" useDefault="true" doCommand="away"/>
                                <box:aolCheckMenuItem id="awayStatus1" label="&imCatcher.awayMessage.mobile;" accesskey="&imCatcher.awayMessage.mobile_accesskey;" awayStatus="1" useDefault="false" doCommand="away">
                                    <box:binding objectSource="bl" targetProperty="collapsed" path="showForwardToMobile" method="oneWay" sourceTransformer="toolkit:not"/>
                                </box:aolCheckMenuItem>
                                <box:aolMenuSeparator/>
                                <box:aolMenu label="&imCatcher.awayMessage.moreAwayMessages;" accesskey="&imCatcher.awayMessage.moreAwayMessages_accesskey;" topLevelMenu="false">
                                    <box:menuPopup id="customMessages" style="popupWithoutTransition"> 
                                        <box:aolMenuItem id="customMenuItemTemplate" plaintext="true" collapsed="true" awayStatus="3" doCommand="away"/>
                                    </box:menuPopup>
                                    <box:binding elementSource="_gadget" targetProperty="disabled" path="hasCustomMessages" method="oneWay" sourceTransformer="toolkit:not" />
                                </box:aolMenu>
                                <box:aolMenuSeparator/>
                                <box:aolCheckMenuItem id="applyToAll" label="&imCatcher.awayMessage.applyStatusToAllLinkedAccounts;" accesskey="&imCatcher.awayMessage.applyStatusToAllLinkedAccounts_accesskey;" toggled="true" doCommand="flipToggled">
                                    <box:binding elementSource="_gadget" targetProperty="toggled" path="applyStatusToAll" method="twoWay"/>
                                </box:aolCheckMenuItem>
                                <box:aolMenuSeparator>
                                    <box:binding elementSource="_prevSibling" targetProperty="collapsed" path="collapsed" method="oneWay"/>
                                </box:aolMenuSeparator>                            
                                <box:aolMenuItem label="&imCatcher.awayMessage.quickAway;" accesskey="&imCatcher.awayMessage.quickAway_accesskey;" on:command="gadget:callQuickAway();"/>
                            </box:menuPopup>                    
                        </box:aolMenuButton>
                    </box:hbox>
                </box:vbox>
                <box:vbox id="awayMessageBox" inherits="axis" collapsed="true">
                    <box:hbox id="displayMode" inherits="axis" s:flex="1" on:click="gadget:callQuickAway();" on:doubleClick="gadget:onStopPropagation();">
                        <box:vbox s:flex="1">
                            <box:hbox s:width="auto" s:maxWidth="auto">
                                <box:aolLabel id="awayLabel" baseHeight="25" plaintext="true">
                                    <box:binding elementSource="_gadget" targetProperty="value" path="awayMessageText" method="oneWay"/>
                                </box:aolLabel>
                            </box:hbox>
                            <box:vbox id="awayStatusWrapper" collapsed="true" s:maxWidth="auto" s:flex="1">
                                <box:hbox id="awayInfoTime" s:vAlign="start">
                                    <box:aolLabel id="lblTitleAwayTime" value="&imCatcher.awayMessage.time.prefix;"/>
                                    <box:aolLabel id="lblAwayTime" />
                                </box:hbox>
                                <box:hbox id="awayInfoCount" s:vAlign="start">
                                    <box:aolLabel id="lblIMCountTitle" value="&imCatcher.awayMessage.IMCount;"/>
                                    <box:aolLabel id="lblIMCount" />
                                </box:hbox>
                            </box:vbox>
                        </box:vbox>
                    </box:hbox>
                </box:vbox>
            </box:vbox>
        </parts>
        <behavior>
            <reaction event="click"         action="gadget:onStopPropagation();"/>
            <reaction event="command"       action="gadget:onMenuCommand();"/>
            <reaction event="presented"     action="gadget:onShowAwayMessage();"/>
            <reaction event="keyPress" keyCode="SPACE" ctrl="false" shift="false" alt="false" action="gadget:onStopPropagation();"/>
            <reaction event="keyPress" keyCode="ENTER" ctrl="false" shift="false" alt="false" action="gadget:onStopPropagation();"/>
        </behavior>
    </gadget>

</library>
