PageSourceSearch

https://www.gnjoy.hk/js/game.js?202609251856

js gnjoy.hk collected 2026-09-25 10:56:09 UTC 7,178 bytes, 185 lines download raw bytes

1
2// 首頁、遊戲中心共用。
3
4let Catalogs_response;
5function printGameCatalogs() {
6    $.ajax({
7        async: false,
8        type: "POST",
9        url: "Game/forAjax_getGameCatalog_ret",
10        data: {},
11        dataType: "json",
12        success: function (response) {
13            Catalogs_response = response.response;
14            $('.game-tag').empty();
15
16            for (var index in response.response) {
17                var item = response.response[index];
18                $('.game-tag').append($('<a>').attr('game_catalog_id', item.id).text(item.catalog).addClass('game_catalog'));
19            }
20            $('.game-tag').append($('<a>').attr('game_catalog_id', '').text('ALL').addClass('game_catalog active'));
21
22            $('.game_catalog').on('click', function () {
23                $('.game_catalog').removeClass('active');
24                $(this).addClass('active');
25                printGames($(this).attr('game_catalog_id'));
26            });
27
28            /*
29            $('.game-tag').find('a').on('click', function () {
30                var $tag = $(this).text();
31                var str = $tag.split(' ');
32                var $tagClass = '.is' + str[0];
33
34                $('.gameItem').fadeOut(0);
35                if ($tag == 'ALL') {
36                    $('.gameItem').fadeIn(100);
37                }
38                else {
39                    $($tagClass).parent().parent('.gameItem').fadeIn(100);
40                }
41                $(this).addClass('active').siblings().removeClass('active');
42            })
43            */
44        }
45    });
46}
47
48function printGames(catalogId) {
49
50    $('.game-list').empty();
51
52    $.ajax({
53        //async: false,
54        type: "POST",
55        url: "Game/forAjax_getGameList_ret",
56        data: {},
57        dataType: "json",
58        success: function (response) {
59            for (var index in response) {
60                var item = response[index];
61
62                if (catalogId != '' && item.game_catalog_id != catalogId) {
63                    continue;
64                }
65
66                let layer1 = $('<div>').addClass('game-list-item gameItem');
67
68                let layer2_photo = $('<div>').addClass('gameItem-photo');
69                let layer2_info = $('<div>').addClass('gameItem-info');
70                let layer2_links = $('<div>').addClass('gameItem-links');
71                let layer2_download = $('<div>').addClass('gameItem-download js-showDownload');
72
73                layer2_photo.append($('<img>').attr('src', item.img));
74                // photo done
75
76                layer2_info.append($('<h4>').text(item.subject));
77                layer2_links.append($('<a>').text('遊戲官網').attr('href', item.website_url));
78                if (item.close_fg == '0') {
79                    switch (item.game_catalog_id) {
80                        case '1':
81                            //layer2_info.append($('<span>').addClass('isMobile'));
82                            layer2_links.append($('<a>').text('下載遊戲').addClass('js-appDownload'));
83                            break;
84                        case '3':
85                            //layer2_info.append($('<span>').addClass('isPC'));
86                            layer2_links.append($('<a>').text('下載遊戲').attr('href', item.game_url));
87                            break;
88                        default:
89                            //layer2_info.append($('<span>').addClass('isWEB'));
90                            layer2_links.append($('<a>').text('啟動遊戲').attr('href', item.game_url));
91                            break;
92                    }
93                }
94                if (item.PreSign_url) {
95                    layer2_links.append($('<a>').text('事前預約').attr('href', item.PreSign_url));
96                }
97
98                layer2_info.append($('<span>').addClass('game_catalog_id_' + item.game_catalog_id));
99
100                if (item.summary) {
101                    layer2_info.append($('<p>').text(item.summary));
102                } else {
103                    layer2_info.append($('<p>').text(item.description));
104                }
105
106                if (item.billing_flag == '1' || item.gametype == 'ROW') {
107                    var _url = 'https://' + window.location.hostname + '/Billing?GameId=' + item.gametype;
108
109                    if ((item.gametype == 'ROO') ||
110                        (item.gametype == 'ROBA') ||
111                        (item.gametype == 'RORB') ||
112                        (item.gametype == 'ROTL')
113                    ) {
114                        _url = _url.replace(".com.tw", ".hk");
115                    }
116
117                    /*
118                    if ((item.gametype == 'ROC')
119                    ) {
120                        _url = 'https://roc.gnjoy.com.tw/Payment/Web';
121                    }
122                    */
123
124                    if ((item.gametype == 'ROW')
125                    ) {
126                        _url = 'https://pay.gnjoy.hk/platform/officialTopupNew.html?gameId=386&srtl=3276.0.0.0&op_scid=JGKYd2plEOPi2pCEpjpZo&customFrom=global-website#/';
127                    }
128
129                    layer2_links.append($('<a>').text('遊戲儲值').attr('href', _url));
130                }
131                // info、links done
132                if (item.close_fg == '0') {
133                    layer2_download.append($('<a>').addClass('dl-apple').attr('href', item.apple_download_url));
134                    layer2_download.append($('<a>').addClass('dl-google').attr('href', item.google_download_url));
135                    layer2_download.append($('<a>').addClass('dl-apk').attr('href', item.apk_download_url));
136                }
137                // download done
138
139                layer1
140                    .append(layer2_photo)
141                    .append(layer2_info)
142                    .append(layer2_links)
143                    .append(layer2_download);
144
145                $('.game-list').append(layer1);
146            }
147
148            //$('.isPC').addClass('gameTag').text('PC Game');
149            //$('.isWEB').addClass('gameTag').text('WEB Game');
150            //$('.isMobile').addClass('gameTag').text('Mobile Game');
151
152            $('.dl-apk').text('APK');
153            $('.dl-apple').text('APP Store');
154            $('.dl-google').text('Google Play');
155
156            $('.game-list a').each(function () {
157                $(this).attr('target', '_blank');
158                $(this).attr('title', $(this).text());
159            });
160
161            $('.game-list a[class*="dl-"]').on('click', function () {
162                if (!$(this).attr('href')) {
163                    alert('敬請期待');
164                    return false;
165                }
166            })
167
168            $('.js-showDownload').hide()
169            $('.js-appDownload').on('click', function () {
170                $(this).parent().next('.js-showDownload').slideToggle('fast')
171            })
172
173            // 各遊戲的類別文字,由類別來印
174            for (var index in Catalogs_response) {
175                var item = Catalogs_response[index];
176                $('.game_catalog_id_' + item.id).addClass('gameTag').text(item.catalog);
177            }
178        }
179    });
180}
181
182$(function () {
183    printGameCatalogs();
184    printGames('');
185})

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.