PageSourceSearch

https://www.ssupl.com/data/skin/front/19-07_C/js/gd_board_common.js

js ssupl.com collected 2026-10-09 23:38:15 UTC 4,334 bytes, 143 lines download raw bytes

1var boardData = {
2    writeUrl: '../board/write.php?' + gd_get_url_vars() + '&bdId={0}',
3    viewUrl: '../board/view.php?' + gd_get_url_vars() + '&bdId={0}&sno={1}',
4    modifyUrl: '../board/write.php?' + gd_get_url_vars() + '&bdId={0}&mode=modify&sno={1}',
5    listUrl: '../board/list.php?' + gd_get_url_vars() + '&bdId={0}',
6    replyUrl: '../board/write.php?' + gd_get_url_vars() + '&mode=reply&bdId={0}&sno={1}',
7}
8
9function gd_get_url_vars(paramKey) {
10    if (typeof paramKey == 'undefined') {
11        paramKey = '';
12    }
13    var vars = [], hash;
14    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
15    if(window.location.href.indexOf('?')<0) {
16        return '';
17    }
18    for (var i = 0; i < hashes.length; i++) {
19        hash = hashes[i].split('=');
20        key = hash[0];
21        val = hash[1];
22        if (paramKey != '') {
23            if (key == paramKey) {
24                return val;
25            }
26        }
27
28        if (key == 'sno' || key == 'mode' || key == 'bdId') {
29            continue;
30        }
31
32        vars.push(hashes[i]);
33    }
34
35    if (paramKey != '') {
36        return '';
37    }
38
39    return vars.join('&');
40}
41
42function gd_btn_write(bdId) {
43    location.href = boardData.writeUrl.format(bdId);
44}
45
46function gd_btn_delete(bdId, sno, auth) {
47    switch (auth) {
48        case 'n' :
49            alert(__('권한이 없습니다.'));
50            return;
51            break;
52        case 'y' :
53            if (confirm(__('정말 삭제하시겠습니까?'))) {
54                gd_delete_ajax_process();
55            }
56            break;
57        case 'c' :
58            passwordLayer.show();
59            passwordLayer.btn.unbind('click').bind('click', function () {
60                gd_delete_ajax_process();
61            });
62            break;
63    }
64
65    function gd_delete_ajax_process() {
66        $.ajax({
67            method: "POST",
68            url: "../board/board_ps.php",
69            data: {mode: 'delete', sno: sno, bdId: bdId, writerPw: passwordLayer.value()},
70            dataType: 'json'
71        }).success(function (data) {
72            if (data['result'] == 'ok') {
73                alert(data['msg']);
74                location.href = boardData.listUrl.format(bdId);
75            }
76            else if (data['result'] == 'confirmPassword') {
77                passwordLayer.show();
78            }
79            else {
80                alert(data['msg']);
81                return;
82            }
83        }).error(function (e) {
84            if(e.responseText)
85                alert(e.responseText);
86        });
87    }
88
89    return;
90}
91
92function gd_btn_view(bdId, sno, auth) {
93
94    switch (auth) {
95        case 'n' :
96        case 'y' :
97            location.href = boardData.viewUrl.format(bdId, sno);
98            break;
99        case 'c' :
100            passwordListLayer.show();
101            passwordListLayer.inputEl.bind('keydown', function () {
102                if (event.keyCode == 13) {
103                    passwordListLayer.btnEl.trigger('click');
104                }
105            });
106            passwordListLayer.btnEl.unbind('click').bind('click', function () {
107                if (passwordListLayer.inputEl.val() == '') {
108                    alert(__('비밀번호를 입력해주세요.'));
109                    return false;
110                }
111
112                var form= passwordListLayer.element.closest('form');
113                form.attr('method', 'post');
114                form.attr('action', boardData.viewUrl.format(bdId, sno));
115                form.submit();
116            });
117            break;
118    }
119}
120
121function gd_btn_reply_write(bdId, sno) {
122    location.href = boardData.replyUrl.format(bdId, sno);
123}
124
125function gd_btn_list(bdId) {
126    location.href = boardData.listUrl.format(bdId);
127}
128
129function gd_recommend(bdId, sno) {
130    $.get('../board/board_ps.php', {
131        'mode': 'recommend',
132        'bdId': bdId,
133        'sno': sno
134    }, function (data, status) {
135        if (status == 'success') {
136            alert(data['message']);
137            $('#recommendCount').find('strong').html(data['recommendCount']);
138        }
139        else {
140            alert('request fail. ajax status (' + status + ')');
141        }
142    }, 'json');
143}

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.