PageSourceSearch

https://www.kewpie.co.jp/recipes/cat_assets/js/list-recipes.js

js kewpie.co.jp collected 2026-09-24 08:58:28 UTC 3,835 bytes, 109 lines download raw bytes

1// レシピのホバー
2(function($){
3
4    $(function(){
5        $('.c-card-list-media .r-itm .r-recipe-link').hover(
6            function() {
7                var parent = $(this).parents('.r-detail-wrapper').find('.r-img img');
8                $(parent).css('-webkit-transform','scale(1.05)');
9                $(parent).css('transform','scale(1.05)');
10            },function(){
11                $('.c-card-list-media .r-itm .r-img img').css('-webkit-transform','');
12                $('.c-card-list-media .r-itm .r-img img').css('transform','');
13            });
14
15    });
16  
17
18})(jQuery);
19
20$(document).ready(function () {
21    if (document.domain.indexOf('lp.kewpie.co.jp') >= 0) {
22        $('.c-detail-visual-main__fav').remove();
23        $('.p-recipe-favorite').remove();
24        $('.p-recipe-recent').remove();
25    }
26});
27
28$(window).on('load resize', function(){
29      if (window.matchMedia( "(max-width: 768px)" ).matches) {
30          if ($(".c-tag-list").height() > $(".r-tag-scroll--sp").height() ) {
31              $(".r-tag-scroll--sp").css("overflow-y", "scroll");
32          }
33      }
34});
35
36$(document).on("click", ".r-favorite-delete-btn", function () {
37    $.ajax('/api/cookie/r_history',
38    {
39        type: 'delete',
40        data: {
41            recipe_no:  $(this).data("no")
42        },
43        dataType: 'json',
44        context: this
45    }
46    )
47    .done(function(data) {
48        if (data.result === 'OK') {
49            let pageNo = $('.c-pager li[aria-current="true"] a').text();
50            if ($('.r-favorite-delete-btn').length <= 1 && pageNo > 1) {
51                location.href = '/recipes/favorite/?p=' + (pageNo-1);
52            } else {
53                location.reload();
54            }
55        } else {
56            alert("お気に入りの削除に失敗しました。しばらく時間をあけてから再度おためしください。");
57        }
58    })
59    .fail(function() {
60        alert("お気に入りの削除に失敗しました。インターネット回線に接続されていることを確認してから再度おためしください。");
61    });
62});
63
64$(document).on("click", ".c-detail-visual-main__fav-btn, .c-detail-visual-main__list-fav-btn", function () {
65    if (!$(this).hasClass("is-active")) {
66        $.ajax('/api/cookie/r_history',
67        {
68            type: 'post',
69            data: {
70                recipe_no: $(this).data("no")
71            },
72            dataType: 'json',
73            context: this
74        }
75        )
76        .done(function(data) {
77            if (data.result === 'OK') {
78                $(this).addClass("is-active");
79            } else {
80                alert("お気に入りが最大件数に達した為、登録できませんでした。他のお気に入りを削除してから再度おためしください。");
81            }
82        })
83        .fail(function() {
84            alert("お気に入りの登録に失敗しました。インターネット回線に接続されていることを確認してから再度おためしください。");
85        });
86    } else {
87        $.ajax('/api/cookie/r_history',
88        {
89            type: 'delete',
90            data: {
91                recipe_no:  $(this).data("no")
92            },
93            dataType: 'json',
94            context: this
95        }
96        )
97        .done(function(data) {
98            if (data.result === 'OK') {
99                $(this).removeClass("is-active");
100            } else {
101                alert("お気に入りの削除に失敗しました。しばらく時間をあけてから再度おためしください。");
102            }
103        })
104        .fail(function() {
105            alert("お気に入りの削除に失敗しました。インターネット回線に接続されていることを確認してから再度おためしください。");
106        });
107    }
108});
109

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.