PageSourceSearch

https://www.dadway-onlineshop.com/js/sys/goods_list_ajax_bookmark.js

js dadway-onlineshop.com collected 2026-10-03 19:19:39 UTC 4,749 bytes, 126 lines download raw bytes

1var ecblib = ecblib || {};
2
3jQuery(document).ready(function() {
4    jQuery(".js-animation-list-bookmark").off("click");
5    jQuery(document).on("click", ".js-animation-list-bookmark", function() {
6        var isRegisted = jQuery(this).attr("class").indexOf("registed") != -1 ? true : false;
7        var goodsCode = "";
8        var crsirefoCode = "";
9        var removeFlg = false;
10
11        var loadStart = function(elem) {
12            goodsCode = jQuery(elem).attr("data-goods");
13            crsirefoCode = jQuery(elem).attr("data-crsirefo");
14            if (jQuery(elem).attr("class").indexOf("registed") != -1) {
15                removeFlg = true;
16            }
17            jQuery(elem).attr("data-bookmark-click","true");
18            jQuery(elem).html('<i class="js-animation-bookmark-in-progress"></i>');
19            return elem;
20        };
21
22        var loadEnd = function(elem, iserror, msg) {
23            setTimeout(function() {
24                if (!iserror) {
25                    if (!jQuery(elem).hasClass("invalid-guest-bookmark")) {
26                        if (!removeFlg) {
27                            jQuery(elem).addClass("block-goods-list--favorite-registed--btn");
28                            jQuery(elem).removeClass("block-goods-list--favorite--btn");
29                        } else {
30                            jQuery(elem).addClass("block-goods-list--favorite--btn");
31                            jQuery(elem).removeClass("block-goods-list--favorite-registed--btn");
32                        }
33                    }
34                }
35            }, 500);
36            jQuery(elem).removeAttr("data-bookmark-click");
37        };
38
39        var addBookmark = function(bookmarkElement) {
40            // お気に入りボタンのAjax処理が完了していなければ処理を終了する
41            if (jQuery(bookmarkElement).attr("data-bookmark-click") == "true") {
42                return false;
43            }
44            
45            var element = loadStart(bookmarkElement);
46            jQuery.ajax({
47                async: true,
48                type: "POST",
49                url: ecblib.sys.wwwroot + "/shop/customer/bookmarkajax.aspx",
50                data: {
51                    "goods": goodsCode,
52                    "crsirefo_hidden": crsirefoCode,
53                    "list_flg":"True"
54                },
55                cache: false,
56                ifModified: false,
57                dataType: "json"
58            }).then(
59                function (data) {
60                    setTimeout(function() {
61                        if (data.list_flg) {
62                            loadEnd(element, false, data.msg);
63                        }
64                        else {
65                            loadEnd(element, true);
66                        }
67                    }, 400);
68                },
69                function() {
70                    loadEnd(element, true);
71                    return false;
72                }
73            );
74            return true;
75        };
76        var removeBookmark = function(bookmarkElement) {
77            // お気に入りボタンのAjax処理が完了していなければ処理を終了する
78            if (jQuery(bookmarkElement).attr("data-bookmark-click") == "true") {
79                return false;
80            }
81            
82            var element = loadStart(bookmarkElement);
83            jQuery.ajax({
84                async: true,
85                type: "POST",
86                url: ecblib.sys.wwwroot + "/shop/customer/bookmarkajax.aspx",
87                data: {
88                    "goods": goodsCode,
89                    "crsirefo_hidden": crsirefoCode,
90                    "remove_flg": "True",
91                    "list_flg":"True"
92                },
93                cache: false,
94                ifModified: false,
95                dataType: "json"
96            }).then(
97                function(data) {
98                    setTimeout(function() {
99                        if (data.list_flg) {
100                            loadEnd(element, false, data.msg);
101                        }
102                        else {
103                            loadEnd(element, true);
104                        }
105                    }, 400);
106                },
107                function() {
108                    loadEnd(element, true);
109                    return false;
110                }
111            );
112            return true;
113        };
114
115        if (!jQuery(this).length) {
116            return false;
117        }
118    	
119        if (!isRegisted) {
120            addBookmark(this);
121        } else {
122            removeBookmark(this);
123        }
124        return false;
125    });
vendor: 3 bytes, line 126
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.