<?xml version="1.0" encoding="UTF-8"?>
<!--
****************************************************************************

     File Name:   signonLib.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/signon.dtd">

<?import href="box://aimToolkit/content/gadgets.box"?>
<?import href="box://aimToolkit/content/behaviors.box"?>
<?import href="box://aimToolkit/theme/toolkit.box"?>
<?import href="box://imApp/theme/coreGadgetStyles.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">

    <bitmap id="img.passcodelogo" src="box://imApp/resources/passcode.gif"/>
    <bitmap id="img.rsasecurity" src="box://imApp/resources/rsa_security.png"/>
    <bitmap id="img.asq_logo" src="box://imApp/resources/accountsecurityquestion.gif"/>
    
    <style id="signonFrame" stroke="url(#pen.bl.signOn.border)" fill="url(#brush.bl.signOn.background)" minWidth="&signon.frame.minWidth;" orient="vertical" strokeWidth="1" padding="3" margin="10 3 3 3"/>
    <style id="accSignonFrame" accStyleFor="signonFrame" fill="sysColorWindow" stroke="sysColorText" />


    <style id="deckBox" flex="1" hAlign="stretch"/>
    
    <style id="erroMsgStyle" inherits="#aolMultilineStaticStyle"  textColor="#FFFF0000">
        <attribute name="isError" value="0" textColor="#FF000000"/>
    </style>
    <style id="accErroMsgStyle" accStyleFor="erroMsgStyle" inherits="#accAolMultilineStatic" textColor="sysColorWindowText">
        <attribute name="isError" value="0" textColor="sysColorWindowText" />
    </style>

    <gadget id="centeringMsg">
    <attributes s:orient="horizontal" isError="0"/>
    <parts>
        <box:separator s:flex="1"/>
        <box:aolMultilineStatic style="erroMsgStyle" inherits="value=label,isError"/>
        <box:separator s:flex="1"/>
    </parts>
    </gadget>

    <gadget id="signonForm" type="box" language="jscript" code="box://imApp/content/generalGadgetStub.js">
        <script language="jscript" href="box://imApp/content/viewGadgetInterface.js"/>    
        <attributes s:flex="1" s:overflow="scroll" showMessage="false"/>
        <parts>

            <box:binding objectSource="signonObjModel" targetProperty="collapsed" path="collapsed" method="oneWay"/>
            <box:deck s:flex="1" style="signonFrame">
                <box:binding objectSource="signonObjModel" targetProperty="topIndex" path="signonPanelToShow" method="oneWay"/>

                <box:vbox style="deckBox">
                    <box:centeringMsg isError="1">
                        <box:binding objectSource="signonObjModel" targetProperty="label" path="disconnectErrorText" method="oneWay"/>
                        <box:binding objectSource="signonObjModel" targetProperty="collapsed" path="hideDisconnectError" method="oneWay"/>
                    </box:centeringMsg>
                    <box:aolLabel value="&signon.form.screenNameTitle;" s:fontBold="true"/>
                    <box:hbox s:maxWidth="auto">
                        <box:aolEditableComboBox id="screenNameBox" tabIndex="1" accName="&signon.screenName.accName;" s:margin="0 4" listHeight="&signon.list.height;" s:flex="1" s:maxWidth="auto">
                            <box:reaction event="keyPress" keyCode="UP" alt="false" action="gadget:objModel.lookupNextScreenNameChange();"/>
                            <box:reaction event="keyPress" keyCode="DOWN" alt="false" action="gadget:objModel.lookupNextScreenNameChange();"/>
                            <box:binding objectSource="signonObjModel" targetProperty="label" path="screenName" method="twoWay"/>
                            <box:binding collectionSource="signonObjModel" method="oneWay" replication="full">
                                <box:template>
                                    <box:aolMenuItem label="{}" on:command="scene.signonObjModel.lookupForMenu();"/>
                                </box:template>
                            </box:binding>
                        </box:aolEditableComboBox>
                    </box:hbox>
                    <box:hbox>
                        <box:aolTextButton id="getScreenName" label="&signon.form.getScreenName;" tabIndex="4" on:command="gadget:objModel.getAScreenName();" s:fontSize="10*" />
                    </box:hbox>
                    <box:aolCheckButton label="&signon.form.guest;" tabIndex="5" on:toggle="gadget:objModel.removeOrAddSavedScreenName();" s:fontBold="true">
                        <box:binding objectSource="signonObjModel" targetProperty="toggled" path="rememberMe" method="twoWay"/>
                    </box:aolCheckButton>
                    <box:aolLabel value="&signon.form.passwordTitle;" s:fontBold="true"/>
                    <box:hbox s:maxWidth="auto">
                        <box:aolPasswordInput id="passwordBoxSignOn" hintText="&prompt.screenname;" maxlength="64" s:flex="1" tabIndex="2">
                            <box:binding objectSource="signonObjModel" targetProperty="value" path="password" method="twoWay"/>
                        </box:aolPasswordInput>
                        <box:aolLabel ornament="true" disabled="true" value="&signon.form.hashedPassword;" s:layer="above" s:position="fixed" s:zIndex="3" s:left="8" s:right="8" s:top="3">
                            <box:binding objectSource="signonObjModel" targetProperty="collapsed" path="hideHashedPasswordTip" method="oneWay"/>
                            <box:binding elementSource="_prevSibling" targetProperty="hidden" path="focused" method="oneWay"/>
                        </box:aolLabel>
                    </box:hbox>
                    <box:hbox>
                        <box:aolTextButton id="forgotPassword" label="&signon.form.forgotPassword;" tabIndex="6" on:command="gadget:objModel.forgotPassword();" s:fontSize="9*" />
                    </box:hbox>
                    <box:aolCheckButton id="savePassToggle" label="&signon.form.savePassword;" tabIndex="7">
                        <box:binding objectSource="signonObjModel" targetProperty="toggled" path="wantToSavePassword" method="twoWay"/>
                        <box:binding objectSource="signonObjModel" targetProperty="disabled" path="rememberMe" method="oneWay" sourceTransformer="toolkit:not"/>
                    </box:aolCheckButton>
                    <box:aolCheckButton id="autoSignInToggle" label="&signon.form.autoSignin;" tabIndex="8">
                        <box:binding objectSource="signonObjModel" targetProperty="toggled" path="wantToAutoSignon" method="twoWay"/>
                        <box:binding objectSource="signonObjModel" targetProperty="disabled" path="wantToSavePassword" method="oneWay" sourceTransformer="toolkit:not"/>
                    </box:aolCheckButton>
                    <box:separator s:flex="1"/>
                    <box:hbox s:hAlign="center">
                        <box:aolButton id="signOnButton" label="&signon.form.signInButton;" tabIndex="3" on:command="gadget:objModel.signOn();">
                            <box:binding objectSource="signonObjModel" targetProperty="defaultButton" path="signonPanelToShow" method="oneWay" sourceTransformer="gadget:objModel.isShowingDeck(0);"/>
                        </box:aolButton>
                    </box:hbox>
                    <box:separator s:flex="1"/>

                    <box:reaction event="keyPress" keyCode="ENTER" action="gadget:objModel.signOn();"/>
                </box:vbox>
                
                <box:vbox style="deckBox">
 		            <box:centeringMsg id="errorCaption">
                        <box:binding objectSource="signonObjModel" targetProperty="label" path="signonMessageLabel" method="oneWay"/>
                        <box:binding objectSource="signonObjModel" targetProperty="isError" path="isErrorMessage" method="oneWay"/>
 		            </box:centeringMsg>
 		            <box:aolMultilineStatic id="errorLabel" s:minHeight="&signon.message.minHeight;" s:flex="1">
                        <box:binding objectSource="signonObjModel" targetProperty="value" path="signonMessageText" method="oneWay"/>
 		            </box:aolMultilineStatic>
 		            <box:separator s:flex="1"/>
                    <box:hbox s:hAlign="center">
     		            <box:aolButton id="errorContinue" label="&signon.message.cancelButton;" defaultButton="true" on:command="gadget:objModel.rejectInteraction();">
                            <box:binding objectSource="signonObjModel" targetProperty="cancelButton" path="signonPanelToShow" method="oneWay" sourceTransformer="gadget:objModel.isShowingDeck(1);"/>
                            <box:binding objectSource="signonObjModel" targetProperty="disabled" path="disableSignonCancel" method="oneWay"/>
     		            </box:aolButton>
                    </box:hbox>
                </box:vbox>

                <box:vbox  style="deckBox">
                    <box:image src="#img.passcodelogo"/>
                    <box:aolMultilineStatic id="invalidPassCodeLabel" style="erroMsgStyle" isError="1">
                        <box:binding objectSource="signonObjModel" targetProperty="value" path="securIDChalengeText" method="oneWay"/>
                        <box:binding objectSource="signonObjModel" targetProperty="collapsed" path="hideSecurIDChalengeText" method="oneWay"/>
                    </box:aolMultilineStatic>
                    <box:aolMultilineStatic id="passCodeCaption" value="&signon.form.securIDTitle;"/>
                    <box:hbox s:maxWidth="auto">
                        <box:aolInput id="passCodeBox" maxlength="6" s:flex="1">
                            <box:binding objectSource="signonObjModel" targetProperty="value" path="securID" method="twoWay"/>
                        </box:aolInput>
                    </box:hbox>
                    <box:hbox>
                        <box:aolTextButton id="lostBrokenPassCode" label="&signon.lostBrokenPassCode;" on:command="gadget:objModel.lostOrBrokenPasscode();" fontSize="10*" textColor="#FF0860A8"/>
                    </box:hbox>
                    <box:hbox s:hAlign="center">
                        <box:aolButton id="passCodeContinueButton" label="&signon.message.buttonText;" defaultButton="true" on:command="gadget:objModel.acceptSecurIDInteraction();">
                            <box:binding objectSource="signonObjModel" targetProperty="defaultButton" path="signonPanelToShow" method="oneWay"  sourceTransformer="gadget:objModel.isShowingDeck(2);"/>
     		            </box:aolButton>
                        <box:aolButton id="passCodeCancelButton" label="&signon.message.cancelButton;" on:command="gadget:objModel.rejectInteraction();">
                            <box:binding objectSource="signonObjModel" targetProperty="cancelButton" path="signonPanelToShow" method="oneWay"  sourceTransformer="gadget:objModel.isShowingDeck(2);"/>
                        </box:aolButton>
                    </box:hbox>
                    <box:hbox>
                        <box:separator s:flex="1"/>
                        <box:image src="#img.rsasecurity"/>
                    </box:hbox>
                    <box:reaction event="keyPress" keyCode="ENTER" action="gadget:objModel.acceptSecurIDInteraction();"/>
                    <box:reaction event="keyPress" keyCode="ESCAPE" action="gadget:objModel.rejectInteraction();"/>
                </box:vbox>

                <box:vbox  style="deckBox">
                    <box:image id="asqImage"/>
                    <box:centeringMsg id="invalidASQLabel" isError="1" value="&signon.invalidASQLabel;">
                        <box:binding objectSource="signonObjModel" targetProperty="collapsed" path="hideInvalidASQError" method="oneWay"/>
                    </box:centeringMsg>
                    <box:aolMultilineStatic id="ASQQuestionLabel">
                        <box:binding objectSource="signonObjModel" targetProperty="value" path="asqQuestionText" method="oneWay"/>
                    </box:aolMultilineStatic>
                    <box:aolMultilineStatic id="ASQCaption" value="&aam.ASQCaption;"/>
                    <box:aolInput id="ASQBox">
                        <box:binding objectSource="signonObjModel" targetProperty="value" path="asqAnswerText" method="oneWay"/>
                    </box:aolInput>
                    <box:spacer s:height="5"/>
                    <box:hbox s:hAlign="center">
                        <box:aolButton id="ASQContinueButton" label="&signon.message.buttonText;" defaultButton="true" on:command="gadget:objModel.acceptASQInteraction();">
                            <box:binding objectSource="signonObjModel" targetProperty="defaultButton" path="signonPanelToShow" method="oneWay"  sourceTransformer="gadget:objModel.isShowingDeck(3);"/>
                        </box:aolButton>
                        <box:aolButton id="ASQCancelButton" label="&signon.message.cancelButton;" on:command="gadget:objModel.rejectInteraction();">
                            <box:binding objectSource="signonObjModel" targetProperty="cancelButton" path="signonPanelToShow" method="oneWay"  sourceTransformer="gadget:objModel.isShowingDeck(3);"/>
                        </box:aolButton>
                    </box:hbox>
                    <box:reaction event="keyPress" keyCode="ENTER" action="gadget:objModel.acceptASQInteraction();"/>
                    <box:reaction event="keyPress" keyCode="ESCAPE" action="gadget:objModel.rejectInteraction();"/>
                </box:vbox>
            </box:deck>
        </parts>
        <behavior>
            <reaction event="boxCreated"    action="gadget:attachView( 'signOnForm', 'signonObjModel' );"/>        
            <reaction event="boxDestroyed"  action="gadget:detachView();"/>
        </behavior>
    </gadget>
</library>
