PageSourceSearch

https://myportal.joes.or.jp/js/login-bbb284520742d893c45e08fad240b36b.js

js joes.or.jp collected 2026-10-01 11:51:59 UTC 4,043 bytes, 113 lines download raw bytes

1var validator = null;
2$(function() {
3    $(".btn-login").on("click", userLogin);
4    loginFormValidate();
5
6	if (!window.navigator.cookieEnabled) {
7		$(".main-mesage").removeClass("d-none");
8	} else {
9		$(".main-mesage").addClass("d-none");
10	}
11
12})
13
14$("body").keydown(function(event) {
15	if (event.keyCode === 13) {
16		var userId = $("#userId").val();
17		var subId = $("#subId").val();
18		var password = $("#password").val();
19
20		if ((userId != null && userId != '') || (subId != null && subId != '') || (password != null && password != '')) {
21			$(".btn-login").click();
22		}
23	}
24})
25
26function userLogin() {
27    if (!validator.form()) {
28        validator.focusInvalid();
29        return;
30    }
31    $.ajax({
32        type: "POST",
33        url: basePath() + "user/login",
34        data: {
35            username: $("#userId").val() + '$' + $("#subId").val(),
36            password: $("#password").val(),
37            rememberMe: $("#rememberMe")[0].checked,
38        },
39        success: function(data) {
40            if (data.code == "401") {
41                $(".loginFail-invalid-feedback").text(MPMessages["error"]["login"]["401"]);
42                if (!$("#userId").hasClass("is-invalid")) {
43                    $("#userId").addClass("is-invalid");
44                }
45                if (!$("#subId").hasClass("is-invalid")) {
46                    $("#subId").addClass("is-invalid");
47                }
48                if (!$("#password").hasClass("is-invalid")) {
49                    $("#password").addClass("is-invalid");
50                }
51                return;
52            } else if (data.code == "500") {
53                console.log("Database Connection Error!")
54                console.log("window.document.location.href");
55                window.location.href = window.document.location.href + "error";
56            } else {
57            	// ログイン成功時にCookieへ保存(JOESファミリーメンバーポップアップ表示用)
58            	document.cookie = 'loginFlg=1; path=/; max-age=180'
59                window.location.href = basePath() + "index/";
60            }
61        },
62        error: function(jqXHR, textStatus, errorThrown) {
63            console.log(errorThrown);
64            window.location.href = window.document.location.href + "error";
65        }
66    });
67}
68
69function loginFormValidate() {
70    validator = $("#loginForm").validate({
71        onfocusout: false,
72        focusInvalid: true,
73        errorPlacement: function(error, element) {
74            if (element.attr("name") == "userId") {
75                error.appendTo(".userId-invalid-feedback");
76                $(".userId-invalid-feedback").attr("style", "display:block");
77            }
78            if (element.attr("name") == "subId") {
79                error.appendTo(".subId-invalid-feedback");
80                $(".subId-invalid-feedback").attr("style", "display:block");
81            }
82            if (element.attr("name") == "password") {
83                error.appendTo(".loginFail-invalid-feedback");
84                $(".loginFail-invalid-feedback").attr("style", "display:block");
85            }
86        },
87        highlight: function(element) {
88            if (!$(element).hasClass("is-invalid")) {
89                $(element).addClass("is-invalid");
90            }
91        },
92        unhighlight: function(element) {
93            if ($(element).hasClass("is-invalid")) {
94                $(element).removeClass("is-invalid");
95            }
96        },
97        rules: {
98            userId: {
99                required: true,
100                email: true,
101                maxlength: 255
102            },
103            subId: { checkSubId: true },
104            password: {
105                required: true
106            }
107        }
108    });
109    $.validator.addMethod("checkSubId", function(value, element, params) {
110        var checkSubId = /^[A-Za-z0-9]{3}$/;
111        return this.optional(element) || (checkSubId.test(value));
112    }, "半角英数字3桁固定です。");
113}

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.