1/* 2* ------------------------------------------------------------------------------------------------ 3* © Copyright 2003-2017 PowerSchool Group LLC, All Rights Reserved. 4* This program is PROPRIETARY and CONFIDENTIAL information of PowerSchool Group LLC, and may not 5* be disclosed or used except as expressly authorized in a license agreement controlling such use 6* and disclosure. Unauthorized use of this program will result in legal proceedings, civil 7* damages, and possible criminal prosecution. 8* ------------------------------------------------------------------------------------------------ 9* System Name: Home Access Center 10* ------------------------------------------------------------------------------------------------ 11* File Name: LogOn.js 12* ---------------------------------------------------------------------------------------------- 13* File Description: script file for client-side processing that is needed for processing 14* interaction on the Log on page 15*/ 16 17if (SunGard === undefined) SunGard = {}; 18SunGard.Hac = (SunGard.Hac || {}); 19 20SunGard.Hac.LogOn = function () { 21 var init = function () { 22 /// <summary> 23 /// initialize the Logon page 24 /// </summary> 25 26 $("form").on("submit", function (e) { 27 if (e.result) { 28 $(".sg-submit-button").prop("disabled", true); 29 return true; 30 } 31 }); 32 33 // After validation, mark invalid fields and focus the first one 34 $("form").on("submit", function () { 35 setTimeout(function () { 36 $(".logon-option").attr("aria-invalid", "false"); 37 var $invalidFields = $(".sg-login-validation").filter(function () { 38 return $.trim($(this).text()).length > 0; 39 }); 40 $invalidFields.each(function () { 41 $(this).closest(".sg-login-input").find(".logon-option").attr("aria-invalid", "true"); 42 }); 43 var $firstInvalid = $(".logon-option[aria-invalid='true']").first(); 44 if ($firstInvalid.length > 0) { 45 $firstInvalid.trigger("focus"); 46 } 47 }, 100); 48 }); 49 50 $("#Database").on("change", checkRegistration); 51 52 clearUnchecked(); 53 54 $('.verification-option').on("change", function () { 55 clearUnchecked(); 56 $('.logon-option', $(this).closest('.verification-option-container')).prop('disabled', false); 57 }); 58 59 $('.student-birth-date').on('blur', function () { 60 var m = new moment($.trim(this.value), ["MM-DD-YY", "MM-DD-YYYY", "MMDDYY", "MMDDYYYY", "YYYY-MM-DD", "MM-DD", "MMDD"], false); 61 this.value = m.isValid() ? m.format("MM/DD/YYYY") : ''; 62 $(this).valid(); 63 }); 64 65 //Hide the link (using css visibility as .Show/.Hide resizes the logon box, css doesn't) 66 $("#RegistrationLinks").hide(); 67 68 69 70 71 var SCKTY00328510CustomEnabled = $("#SCKTY00328510CustomEnabled").val(); 72 73 if (SCKTY00328510CustomEnabled !== null && SCKTY00328510CustomEnabled !== undefined && SCKTY00328510CustomEnabled.toLowerCase() === "true") { 74 $("#ForgotPasswordLink").css("visibility", "hidden"); 75 } 76 77 var SCKTY00436568CustomEnabled = $("#SCKTY00436568CustomEnabled").val(); 78 79 if (SCKTY00436568CustomEnabled !== null && SCKTY00436568CustomEnabled !== undefined && SCKTY00436568CustomEnabled.toLowerCase() === "true") { 80 $("#RegistrationAccessCodeLink").css("visibility", "hidden"); 81 } 82 //Force the Registration Link check for the default database. 83 $(document).ready(checkRegistration); 84 }; 85 86 var clearUnchecked = function () { 87 var $container = $('.verification-option:not(:checked)').closest('.verification-option-container'); 88 $('.logon-option', $container).prop('disabled', true).val(''); 89 $('.sg-login-validation', $container).empty(); 90 }; 91
92 var checkRegistration = function () { 93 /// <summary> 94 /// Checks if we should display the registration link for the current database. 95 /// </summary> 96 if ($("#RegistrationLink").length) { 97 var selectedValue = $("#Database").val(); 98 if ($.trim(selectedValue) === "" || isNaN(selectedValue) || parseInt(selectedValue, 10) === 0) { 99 return; 100 } 101 var url = SunGard.Hac.RootUrl() + "/Account/RegistrationEnabled?databaseId=" + $("#Database").val(); 102 var callbackFunction = function (data, textStatus, jqXHR) { 103 104 //Note: Checking the database ID just in-case the user is clicking around fast, only update visibility if the currently 105 //selected one matches what was checked. 106 if (data.result === true && data.databaseId === parseInt($("#Database").val(), 10)) { 107 $("#RegistrationLinks").show(); 108 } else { 109 $("#RegistrationLinks").hide(); 110 } 111 }; 112 SunGard.Common.AjaxGet(SunGard.Hac.RootUrl() + "/Account/RegistrationEnabled?databaseId=" + $("#Database").val(), null, callbackFunction, null); 113 } 114 }; 115 116 return { 117 Init: init, 118 CheckRegistration: checkRegistration 119 }; 120}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.