PageSourceSearch

https://xn--pckua2a7gp15o89zb.com/js/bundle/common/kbuser/register_social.js?202609241619

js xn--pckua2a7gp15o89zb.com collected 2026-09-24 08:56:54 UTC 4,647 bytes, 92 lines download raw bytes

1jQuery(function($) {
2
3    window.socialRegister = function (formId, flow = null){
4
5        var form = $('#' + formId);
6        var params = new URLSearchParams(window.location.search);
7
8        // お気に入りされた求人の直近履歴を取得
9        if (common.getItemIfAvailable('favorite') !== null) {
10            var favorite = localStorage.getItem('favorite');
11            var favArr = JSON.parse(favorite).histories;
12            if (favArr !== null && favArr !== undefined && favArr.length > 0) {
13                favArr.sort((a, b) => b.addTime - a.addTime);
14                for (var i = 0; i < favArr.length; i++) {
15                    form.append('<input type="hidden" name="histories[favorite][' + i + '][uid]" value="' + favArr[i].uid + '">');
16                    form.append('<input type="hidden" name="histories[favorite][' + i + '][addTime]" value="' + favArr[i].addTime + '">');
17                }
18            }
19        }
20
21        // 閲覧履歴の求人の直近履歴を取得
22        if(common.getItemIfAvailable('detailHistory') !== null) {
23            var detailHistory = localStorage.getItem('detailHistory');
24            var dhArr = JSON.parse(detailHistory).histories;
25            if (dhArr !== null && dhArr !== undefined && dhArr.length > 0) {
26                dhArr.sort((a, b) => b.addTime - a.addTime);
27                for (var i = 0; i < dhArr.length; i++) {
28                    form.append('<input type="hidden" name="histories[detailHistory][' + i + '][uid]" value="' + dhArr[i].uid + '">');
29                    form.append('<input type="hidden" name="histories[detailHistory][' + i + '][addTime]" value="' + dhArr[i].addTime + '">');
30                }
31            }
32        }
33        // 直前の検索条件の1件を取得
34        if(common.getItemIfAvailable('searchHistory') !== null) {
35            var searchHistory = localStorage.getItem('searchHistory');
36            var shArr = JSON.parse(searchHistory);
37            if (shArr !== null && shArr !== undefined && shArr.length > 0) {
38                shArr.sort((a, b) => b.addTime - a.addTime);
39                let shKeys = Object.keys(shArr[0]);
40                for (var i = 0; i < shKeys.length; i++) {
41                    form.append('<input type="hidden" name="histories[searchHistory][' + shKeys[i] + ']" value="' + shArr[0][shKeys[i]] + '">');
42                }
43            }
44        }
45
46        // エージェント新規登録導線経由の登録
47        const agentCheckbox = document.getElementById('agentActivate');
48        const isAgentActive = agentCheckbox ? agentCheckbox.checked : params.get('agent') === '1';
49        // POSTボディに加えて、フォームの action URL のクエリにも付与する。
50        // iOS では /auth/* への POST がキャンセルされ URL のみ GET で再読込されるため(KbWebViewPresenter::preAuth)、
51        // クエリに載せないと agentActivate が失われる(from/uid/flow は既にクエリにあるため生存している)。
52        try {
53            const actionUrl = new URL(form.attr('action'), window.location.origin);
54            actionUrl.searchParams.set('agentActivate', isAgentActive ? '1' : '0');
55            form.attr('action', actionUrl.pathname + actionUrl.search);
56        } catch (e) {
57            // URL 解析に失敗しても POSTボディ側で担保する
58        }
59        if (isAgentActive) {
60            form.append('<input type="hidden" name="agentActivate" value="1">');
61        } else {
62            form.append('<input type="hidden" name="agentActivate" value="0">');
63        }
64
65        // 簡易チュートリアル経由の登録
66        if (flow === 'tutorial') {
67            tutorialFlowRegister(form);
68            form.submit();
69            $('input[name="tutorial[area]"]').val('');
70            $('input[name="tutorial[employType]"]').prop('checked', false);
71            $('input[name="tutorial[feature]"]').prop('checked', false);
72        } else {
73            form.submit();
74        }
75
76        return false;
77    }
78
79    function tutorialFlowRegister(form) {
80        // 希望条件を取得
81        $.each($('input[name^="tutorial["]').serializeArray(), function(_, field) {
82            var fieldName = field.name.replace('tutorial', "histories[preferredCondition]");
83            if ($('input[name="' + field.name + '"]').attr('type') === 'checkbox') {
84                form.append('<input type="hidden" name="' + fieldName + '[]" value="' + field.value + '">');
85            } else {
86                form.append('<input type="hidden" name="' + fieldName + '" value="' + field.value + '">');
87            }
88        });
89    }
90
91
92});

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.