PageSourceSearch

https://www.fx110.com.tw/Scripts/SharedViewmin/head/top.min.js?v=af3b27

js fx110.com.tw collected 2026-10-08 09:23:11 UTC 9,907 bytes, 298 lines download raw bytes

1var pattern = new RegExp("[`~!%@#$^&*=|{}':;',\\[\\].<>/?~!@#¥……&*——|{}【】‘;:”“'。,、?+]");
2
3
4
5var object = {
6    //输入法开始输入
7    type: 0,
8    keyword: '',
9    sumChange: '',
10    bol: false,
11    topSize: 4,
12    SearchKeyword: function (keyword, topSize) {
13        //titsearch.searchList = [];
14        $.ajax({
15            type: 'post',
16            url: '/Pub/Search/GetSearchKeywordsEs',
17            data: { keyword: keyword, topSize: topSize },
18            success: function (data) {
19                switch (data.code) {
20                    case '-1':
21
22                        if (keyword != '') {
23                            var datas = JSON.parse(data.bodyMessage);
24                        } else {
25                            $('.search_blurry').hide();
26                        }
27
28
29                        break;
30                    case '0':
31                        var data = JSON.parse(data.bodyMessage);
32                        dataappend(data);
33                        break;
34                    default:
35                        console.log(data.code);
36                        break;
37                }
38
39            }
40        })
41    }
42}
43
44function dataappend(data) {
45    var li = "";
46    if (data.length <= 0) { $('.search_blurry').hide(); return false; }
47    var len = data.length <= 4 ? data.length : 4;
48    for (var i = 0; i < len; i++) {
49        li += (' <li onclick="Alone(this)">' + data[i] + '</li>');
50    }
51    $('.yesdata').html(li);
52    if ($("#search_style").is(":focus")) {
53        $('.search_blurry').show();
54    }
55    else {
56        $('.search_blurry').hide();
57    }
58
59}
60
61$(".search_type p").click(function () {
62    $(".search_list").toggle();
63})
64$(document).click(function (e) {
65    var target = $(e.target);
66    if (!target.is('.search_type p')) {
67        $(".search_list").hide();
68    }
69})
70$('.search_list li').click(function () {
71    var $this = $(this);
72    var $text = $this.text();
73    $(this).parent().siblings('p').text($text);
74})
75//查询列表隐藏和显示
76$(document).on('click', function (e) {
77    var e = e || event;
78    object.bol = true;
79    var target = e.target;
80    if ($(target).hasClass('search_style')) {
81        object.keyword = $.trim($('.search_style').val());
82        if (object.keyword) {
83            object.SearchKeyword(object.keyword, object.topSize);
84        }
85    }
86    $(target).hasClass('search_blurry') ? $('.search_blurry').show() : $('.search_blurry').hide();
87})
88/*弹出登录*/
89$('body').on('click', '#login', function () {
90
91    window.location.href = SingleLoginUrl + '/login?url=' + location.href.replace("www.", "") + "&qrtype=2";
92})
93/*初始化检测用户是否登录*/
94checkUserCookie();
95
96function renderLogin(userobj) {
97    if (userobj && decodeURI(userobj.NickName) != undefined && userobj.UserHeadImage != undefined) {
98        $('.dealer_nav_li').html('<span class="top_user_img"><a href="/user/center/index"><img title=" ' + decodeURI(userobj.NickName) + '" src="' + userobj.UserHeadImage + '" /></a></span>' +
99            '<i class="line_y">|</i>' +
100            '<a class="sign_out" id=\"login_out\">登出</a>');
101    } else {
102        $('.dealer_nav_li').html("<i class=\"iconfont\ col-i\" >&#xe6b0;</i><a id=\"login\">登入</a><a id=\"regist\" href='https://twdl.axelarigatoshop.com'>註冊</a>");
103    }
104}
105
106function setLoginCookie(uk, userInfo, expires) {
107    var domain = document.domain;
108    expires = new Date(Date.now() + expires * 24 * 3600 * 1000);
109
110    if (!uk)
111        uk = '';
112
113    if (userInfo !== null && (typeof userInfo === "object"))
114        userInfo = JSON.stringify(userInfo);
115    else
116        userInfo = '';
117
118    document.cookie = "userKey=" + uk + ";path=/;domain=" + domain + ";expires=" + expires;
119    document.cookie = "USER_LOGIN=" + userInfo + ";path=/;domain=" + domain + ";expires=" + expires;
120}
121
122/*检测用户是否登录*/
123function checkUserCookie() {
124    var userobj = JSON.parse(getCookieUser());
125    var htmls = '';
126
127    if (!userobj) {
128        try {
129            if (typeof autoLogin === "function") {
130                autoLogin(function (uk, ui) {
131                    //console.log(uk);
132                    //console.log(JSON.stringify(ui));
133                    setLoginCookie(uk, ui, 1);
134                    renderLogin(ui);
135                });
136            }
137        }
138        catch (e) {
139        }
140    }
141    renderLogin(userobj);
142
143}
144$("body").on("click", ".login_out,.sign_out", function () {
145    deleteCookie('USER_LOGIN');
146    deleteCookie('userKey');
147    if (typeof signOut === "function") {
148        signOut()
149    }
150   
151    $('.dealer_nav_li').html("<i class=\"iconfont\ col-i\" >&#xe6b0;</i><a id=\"login\">登入</a><a id=\"regist\" href='https://twdl.axelarigatoshop.com'>註冊</a>");
152})
153function deleteCookie(name) {
154    var exp = new Date();
155    exp.setTime(exp.getTime() - 1);
156    var cval = getCookie(name);
157    if (cval != null) {
158        document.cookie = name + "=;domain=" + getBaseDomain() + ";expires=" + exp.toGMTString() + ";path=/"
159    }
160}
161function getCookie(e) {
162    try {
163        var n, t = new RegExp("(^| )" + e + "=([^;]*)(;|$)");
164        return (n = document.cookie.match(t)) ? decodeURIComponent(n[2]) : null
165    } catch (e) {
166        return null
167    }
168}
169function getBaseDomain() {
170    return document.domain;
171}
172
173
174//键盘监听事件
175function keydownFn(_this, e) {
176    var e = e || window.event;
177    var url = '';
178    var index = $('.search_blurry li.cur').length > 0 ? $('.search_blurry li.cur').index() : -1;
179    var keyword = $(_this).val().replace(/(^\s*)|(\s*$)/g, "");
180    if (!keyword) {
181        if (searchTimer) {
182            clearTimeout(searchTimer);
183        }
184        $('.yesdata').html('');
185        $('.search_blurry').hide();
186        return false;
187    }
188    e.keyCode == 13 && IsSpecialCharacters(keyword) ? url = location.href = '/search/?keyword=' + encodeURI(encodeURI(keyword)) : '';
189    //光标向上
190    if (e.keyCode == 38) {
191        if (index > 0) {
192            $('.search_blurry li').eq(index - 1).addClass('cur').siblings('li').removeClass('cur');
193        } else if (index == -1) {
194            $('.search_blurry li').eq($('.search_blurry li').length - 1).addClass('cur');
195        } else {
196            $('.search_blurry li').eq($('.search_blurry li').length - 1).addClass('cur').siblings('li').removeClass('cur');
197        }
198        var inputValue = $('.search_blurry li.cur').text();
199        $(_this).val(inputValue);
200    }
201    //光标向下
202    else if (e.keyCode == 40) {
203        if (index == -1) {
204            $('.search_blurry li').eq(0).addClass('cur');
205        } else if (index < $('.search_blurry li').length - 1) {
206            $('.search_blurry li').eq(index + 1).addClass('cur').siblings('li').removeClass('cur');
207        } else {
208            $('.search_blurry li').eq(0).addClass('cur').siblings('li').removeClass('cur');
209        }
210        var inputValue = $('.search_blurry li.cur').text();
211        $(_this).val(inputValue);
212    }
213    else {
214        searchDebounce(object.SearchKeyword)(keyword, object.topSize)
215        //object.SearchKeyword(keyword, 0);
216    }
217}
218var searchTimer;
219function searchDebounce(fn) {
220    return function (keyword, topSize) {
221        if (searchTimer) {
222            clearTimeout(searchTimer);
223        }
224        searchTimer = setTimeout(function () {
225            fn(keyword, topSize)
226        }, 200)
227    }
228}
229function searchListFn() {
230    var val = $.trim($('#search_style').val()), value = "";
231    if (val == "") {
232        value = $.trim($('#search_style').attr('placeholder'));
233        $('#search_style').val(value);
234    } else {
235        value = val;
236    }
237    if (value.length > 0 && value != "输入搜尋关键字,如:FX110") {
238        window.open('/search/?keyword=' + encodeURI(encodeURI(value)));
239    } else {
240        $('#search_style').focus();
241        return false;
242    }
243}
244
245function Alone(_this) {
246    var keyword = $(_this).text();
247    var url = '';
248    url = '/search/?keyword=' + encodeURI(encodeURI(keyword));
249    $('.search_blurry').hide()
250    window.open(url);
251}
252$(function () {
253    try {
254        var earth = "earth";
255        if (!getCookie(earth)) {
256            var earth_Prompt = document.getElementById('earth_Prompt');
257            earth_Prompt.style.display = "block";
258            setTimeout(function () {
259                earth_Prompt.style.display = "none";
260                setCookie(earth, true, "d10");
261            }, 10000)
262        }
263        $(document).on("click", ".popCode .dealer_right", function () {
264            $("#earth_Prompt").hide();
265        })
266    }
267    catch (e) {
268
269    }
270
271
272})
273$("body").on("click", "#login_out", function () {
274    deleteCookie('USER_LOGIN');
275    deleteCookie('userKey');
276    if (typeof signOut === "function") {
277        signOut()
278    } else {
279        
280    }
281    $('.avatar_img').html(" <img src='https://imgs.dgrhw.net/UploadImg/UserHeadImg/default/default_0.jpg' title='未登入' />");
282    $('.dealer_nav_li').html('<a href="' + SingleLoginUrl + '/login?url=' + location.href.replace("www.", "") + '&qrtype=2" id="login">登入</a><a href="https://twdl.axelarigatoshop.com" id="registered" target="_blank">註冊</a>');
283})
284
285$(function () {
286    $('.cn-lang').hover(function () {
287        $('.lg-select').css({ "display": "block" });
288        $('.select-img').attr('src', "https://img.dgrhw.net/upload/images/master/2019/12/14/102028496.png");
289    }, function () {
290        $('.lg-select').css({ "display": "none" });
291        $('.select-img').attr('src', "https://img.dgrhw.net/upload/images/master/2019/12/14/102031559.png");
292    })
293})
294
295var LoginComplete = function () {
296    checkUserCookie();
297    layer.closeAll();
298}

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.