PageSourceSearch

https://www.regal.co.jp/cms/js/site_async.js

js regal.co.jp collected 2026-10-02 02:27:35 UTC 2,962 bytes, 83 lines download raw bytes

1// 認証表示非同期処理
2jQuery(function() {
3
4    // 認証ブロックがあるか
5    if (jQuery('.sitemiraiz_async_auth').length == 0) { return; }
6
7    // プレビュー中は処理しない(両エリア表示)
8    if (jQuery('.smzpreview-is-preview-mode').length > 0) { 
9        UpdateAuthArea("mode00", null);
10        UpdateAuthArea("mode01", "{サンプル}");
11        return; 
12    }
13
14    // エリアを一旦消す
15    jQuery('.sitemiraiz_async_auth_not_login').hide();
16    jQuery('.sitemiraiz_async_auth_login').hide();
17
18    // 名前表示エリアがあるか(ある場合は毎回API呼び出し)
19    var nameArea = jQuery('.sitemiraiz_async_auth_name');
20
21    // 認証状態Cookie確認
22    if (!jQuery.cookie) {
23        console.error("Requires jquery.cookie.js");
24        return;
25    }
26
27    // 認証状態Cookie確認(見た目の制御だけに利用するので、セキュリティには影響ない)
28    var authDisplay = jQuery.cookie('sitemiraiz_async_auth_display');
29
30    // 認証状態が取得できる場合、かつ、名前表示エリアが無い場合は
31    if (authDisplay && (authDisplay == "mode00" || (authDisplay == "mode01" && nameArea.length == 0))){
32        // 画面反映
33        UpdateAuthArea(authDisplay, null);
34    } else {
35        // root 取得
36        var rootUrl = jQuery('.sitemiraiz_async_auth').data("async-root-url");
37        
38        // API実行
39        jQuery.ajax({
40            url: rootUrl + "/authdisplayapi",
41            dataType: "json",
42            cache: false,
43            success: function (data, response) {
44                // プレビュー中
45                if (data.preview){
46                    UpdateAuthArea("mode00", null);
47                    UpdateAuthArea("mode01", "{サンプル}");
48                    return;
49                }
50                // 通常表示
51                if (data.authDisplay){
52                    // 値取得
53                    var authDisplay = data.authDisplay;
54                    var nameValue = data.nameValue;
55
56                    // 認証状態をキャッシュするため保存
57                    jQuery.cookie('sitemiraiz_async_auth_display', authDisplay, { path:"/" });
58
59                    // 画面反映
60                    UpdateAuthArea(authDisplay, nameValue);
61                }
62            }
63        });
64    }
65
66    // 画面反映
67    function UpdateAuthArea(authDisplay, nameValue)
68    {
69        // 画面 未ログイン処理
70        if (authDisplay == "mode00"){
71            jQuery('.sitemiraiz_async_auth_not_login').show();
72        }
73
74        // 画面 ログイン済処理
75        if (authDisplay == "mode01"){
76            var nameArea = jQuery('.sitemiraiz_async_auth_name');
77            if (nameArea && nameValue) { nameArea.text(nameValue); }
78
79            jQuery('.sitemiraiz_async_auth_login').show();
80        }
81    }
82});
83

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.