PageSourceSearch

https://www.bzx.tw/jsp/amg-main.js

js bzx.tw collected 2026-10-06 17:04:59 UTC 3,977 bytes, 126 lines download raw bytes

1
2var Amg = (function(amg) {
3
4    var jqMain = window.jQuery;  
5    amg.jQuery = function() {
6        return jqMain;
7    };
8
9    amg.getBaseRoot = function() {
10        return "/";
11    };
12
13    amg.getThemePath = function() {
14        return "/theme-c15";
15    };
16
17    amg.getStoreName = function() {
18        return "寶珍香桂圓蛋糕創始店";
19    };
20
21    amg.setMessengerCheckbox = function(enable) {
22        var block = document.getElementById("messenger-checkbox-block");
23        if(block) block.style.display = enable ? '' : 'none';
24    };
25
26    amg.Utils = (function(utils) {
27
28        
29        utils.showMessageBox = function(html, width, auto) {
30            if($.colorbox) {
31                $.colorbox({ html: html, width: width });
32                $.colorbox.resize();
33                if(auto) {
34                    $(document).unbind('cbox_complete');
35                    $(document).bind('cbox_complete', function () {
36                        setTimeout($.colorbox.close, 3000);
37                    });
38                }
39            }
40        };
41
42        utils.showPrivacyPolicy = function() {
43            if($.colorbox) {
44                $(document).unbind('cbox_complete');
45                $.colorbox({ iframe: true, href: Amg.getBaseRoot()+"privacy", width: "80%", height: "80%" });
46            }
47        };
48
49        
50        
51        
52        utils.confirm = function(message, redirect) {
53            if(confirm(message)) {
54                if(typeof redirect !== "undefined")
55                    location.href = redirect;
56                return true;
57            }
58            return false;
59        };
60
61        utils.submitTaskForm = function(action, params) {
62            var form = document.createElement("form");
63            form.method = "POST";
64            form.action = action;
65            for(var k in utils.mergeCsrfParams(params)) {
66                var el = document.createElement("input");
67                el.type  = "hidden";
68                el.name  = k;
69                el.value = params[k];
70                form.appendChild(el);
71            }
72            document.body.appendChild(form);
73            form.submit();
74        };
75
76        utils.mergeCsrfParams = function(params) {
77            var csrf = getCsrfMetaData();
78            if(csrf.param && csrf.token) {
79                params[csrf.param] = csrf.token;
80            }
81            return params;
82        };
83
84        function getCsrfMetaData() {
85            var meta1 = document.head.querySelector("meta[name='csrf-param']");
86            var meta2 = document.head.querySelector("meta[name='csrf-token']");
87            var param = meta1 ? meta1.content : null;
88            var token = meta2 ? meta2.content : null;
89            return { param: param, token: token };
90        }
91
92        utils.setCookie = function (c_name,value,exdays){
93            var exdate=new Date();
94            exdate.setDate(exdate.getDate() + exdays);
95            var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()) + "; path=/ ";
96            document.cookie=c_name + "=" + c_value;
97        }
98
99        utils.getCookie = function (c_name){
100            var c_value = document.cookie;
101            var c_start = c_value.indexOf(" " + c_name + "=");
102            if (c_start == -1){
103                c_start = c_value.indexOf(c_name + "=");
104            }
105            if (c_start == -1) {
106                c_value = null;
107            }else{
108                c_start = c_value.indexOf("=", c_start) + 1;
109                var c_end = c_value.indexOf(";", c_start);
110                if (c_end == -1){
111                    c_end = c_value.length;
112                }
113                c_value = unescape(c_value.substring(c_start,c_end));
114            }
115            return c_value;
116        }
117
118        
119        return utils;
120
121    }(amg.Utils || {}));
122
123    return amg;
124
125}(Amg || {}));
126

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.