<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MultiFactorAuthentication.aspx.cs" Inherits="Axium.Web.MultiFactorAuthentication" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <!-- css styles -->
    <link href="Includes/Css/spinner.css" rel="stylesheet" type="text/css" />

    <script src="Includes/JQueryUI/js/jquery-3.5.1.min.js" type="text/javascript"></script>
    <script src="Includes/JQueryUI/js/jquery-migrate-3.3.2.min.js" type="text/javascript"></script>
    <script src="Includes/Scripts/json2.min.js" type="text/javascript"></script>
    <script src="Includes/Scripts/utilities.js" type="text/javascript"></script>
    <script src="Includes/Scripts/jquery.numeric.js" type="text/javascript"></script>
    <script src="Includes/Scripts/jqModal-r14.js" type="text/javascript"></script>
    <script src="Includes/Scripts/ui.datepicker.js" type="text/javascript"></script>
    <script src="Includes/Scripts/dateControl.js" type="text/javascript"></script>
    <script src="Includes/Scripts/jquery.maxlength-1.0.3.min.js" type="text/javascript"></script>    
    <script src="Includes/Scripts/jquery.timer.js" type="text/javascript"></script>    
    <script src="Includes/Scripts/jquery.validate-1.19.2.min.js" type="text/javascript"></script>
    <script src="Includes/Scripts/spin.min.js" type="text/javascript"></script>
    
    <!-- custom -->
    <script src="Includes/Scripts/general.240530.js" type="text/javascript"></script>
    <script src="Includes/Scripts/iframe.231520.js" type="text/javascript"></script>

    <script type="text/javascript">
        function RefreshParentDefault() {
            window.parent.location.href = '/PatientAccess/Default.aspx'; //window.parent.location.href;
        }

        /*jquery validator library*/
        $(document).ready(function () {
            $('#MultiFactAuth').validate({
                errorPlacement: function (error, element) {
                    return true;
                },
                highlight: function (element, errorClass) {
                    var imgId = element.id + 'ImgError';            // Id of Image error 'must' be same as TextBox field + 'ImgError'
                    var imgCtrl = $(element.form).find('img[id=' + imgId + ']');
                    imgCtrl.addClass('imgErrorShow').removeClass('imgErrorHide');
                },
                unhighlight: function (element, errorClass) {
                    var imgId = element.id + 'ImgError';            // Name of Image error 'must' be same as input field + 'ImgError'
                    var imgCtrl = $(element.form).find('img[id=' + imgId + ']');
                    imgCtrl.removeClass('imgErrorShow').addClass('imgErrorHide');
                }
            });
        });
    </script>

</head>
<body id="multifactAuthPage" runat="server">
    <form name="MultiFactAuth" id="MultiFactAuth" runat="server">
        <div id = "PasswordReset">
            <h1 id="PageTitle" runat="server"></h1>
            <asp:Literal ID="Notifications" runat="server" Visible="false" EnableViewState="false" />
            <br />
            <div id="content1" class="MultiFactAuthInstructions" runat="server"></div>
            <br />
            <asp:Panel id="PasscodeDiv" runat="server">
                <div id="PasscodeDivInput" class="inputRow">
                    <asp:Label ID="PasscodeLabel" runat="server" AssociatedControlID="PasscodeTxt" EnableViewState="false" CssClass="title">Passcode</asp:Label>
                    <asp:Image id="PasscodeTxtImgError" runat="server" ImageUrl="Includes/Images/unchecked.png" CssClass="imgErrorHide"/>
                    <br />
                    <asp:TextBox ID="PasscodeTxt" runat="server" CssClass="text" autocomplete="off" />
                </div>
                <div Id="SubmitDiv" runat="server">
                    <div class="submitClass">
                        <table>
                            <tr>
                                <td><asp:Button ID="SubmitBtn" runat="server" EnableViewState="false" CssClass="button" Text="Submit" OnClick="SubmitBtn_Click" /></td>
                                <td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</td>
                                <td><asp:Button ID="GenerateBtn" runat="server" UseSubmitBehavior="false" EnableViewState="false" CssClass="submitBtn" Text="Generate New Passcode" OnClick="GenerateBtn_Click" /></td>
                            </tr>
                        </table>
                    </div>
                </div>
            </asp:Panel>
            <asp:Literal ID="ErrorText" runat="server" Visible="false" EnableViewState="false" />
        
        </div>
    </form>
    
    <script type="text/javascript">
        jQuery(document).ready(function () {
            resizeParentIframe('multifactAuthPage', window);

            $('#PasscodeTxt').on("paste", function (event) {
                var clipboardData, clipboardText;

                event.stopPropagation();
                event.preventDefault();

                clipboardData = event.originalEvent.clipboardData || window.clipboardData;
                clipboardText = clipboardData.getData('text');

                $('#PasscodeTxt').val(clipboardText.trim().substring(0,8));
            });
        });

    </script>
</body>
</html>
