PageSourceSearch

https://chari-chari.com/detail/template/common/js/module.js

js chari-chari.com collected 2026-10-08 21:09:53 UTC 11,978 bytes, 356 lines download raw bytes

1
2function toggleLikeCount(actionType, targetId, iconId, callbackId){
3    $.ajax({
4        type: 'POST',
5        url: '/like/ajax/act.cfm',
6        data:  {
7              action_type: actionType
8             ,target_id: targetId
9             ,icon_id: iconId
10        },
11        cache: false
12    })
13    .done(function(data){
14        if(callbackId != undefined){
15            var rtnType = data.substr(0,6);
16            data = data.replace(/^delete/, "");
17            data = data.replace(/^insert/, "");
18            $(callbackId).html(data);
19            if(rtnType === "insert"){
20                showLikeModal(actionType);
21            }
22        }
23    })
24    .fail(function(result){
25        alert("読み込みに失敗しました。");
26    });
27}
28
29function showLikeModal(actionType){
30    if(actionType == "review"){
31        return;
32    }
33    if(actionType == "news"){
34        return;
35    }
36    var val = getJsCookie("like_modal_flag");
37    if(val != "1"){
38        var msg = getLikeMessage(actionType);
39        $('.like-modal .body-text').html(msg);
40        $('#showLikeModalTrigger').trigger('click');
41    }
42}
43function getLikeMessage(actionType){
44    switch(actionType){
45        case "shop":
46            return "ページをお気に入りに追加しました";
47        case "store":
48            return "商品をお気に入りに追加しました";
49        case "coupon":
50            return "クーポンをキープしました";
51        case "job":
52            return "求人をキープしました";
53        case "flyer":
54            return "ネットチラシをお気に入りに追加しました";
55        default:
56            return "いいね!しました";
57    }
58}
59function getJsCookie(c_name){
60    var st="";
61    var ed="";
62    if(document.cookie.length>0){
63        st=document.cookie.indexOf(c_name + "=");
64        if(st!=-1){
65            st=st+c_name.length+1;
66            ed=document.cookie.indexOf(";",st);
67            if(ed==-1) ed=document.cookie.length;
68            return unescape(document.cookie.substring(st,ed));
69        }
70    }
71    return "";
72}
73function setJsCookie(c_name,value,expiredays){
74    var path = location.pathname;
75    var paths = new Array();
76    paths = path.split("/");
77    if(paths[paths.length-1] != ""){
78        paths[paths.length-1] = "";
79        path = paths.join("/");
80    }
81    var extime = new Date().getTime();
82    var cltime = new Date(extime + (60*60*24*1000*expiredays));
83    var exdate = cltime.toUTCString();
84    var s="";
85    s += c_name +"="+ escape(value);
86    s += "; path="+ "/";
87    if(expiredays){
88        s += "; expires=" +exdate+"; ";
89    }else{
90        s += "; ";
91    }
92    // クッキーに保存
93    document.cookie=s;
94}
95(function(){
96    $(function(){
97        createLikeModal();
98        $(".like-modal.modal").on("shown.bs.modal", alignLikeModal);
99        initLikeAlignModal();
100
101        $(window).on("resize", function(){
102            $(".like-modal.modal:visible").each(alignLikeModal);
103            $(".like-modal.modal:hidden").each(initLikeAlignModal);
104        });
105
106        $('#like_modal_check').change(function(){
107            if($(this).prop('checked')){
108                setJsCookie("like_modal_flag", "1", 365);
109            }else{
110                setJsCookie("like_modal_flag", "0", 365);
111            }
112        });
113    });
114    function alignLikeModal(){
115        var modalDialog = $(this).find(".modal-dialog");
116        modalDialog.css("margin-top", Math.max(0, ($(window).height() - modalDialog.height()) / 2));
117    }
118    function initLikeAlignModal(){
119        $('.like-modal.modal').show();
120        var modalDialog = $('.like-modal.modal').find(".modal-dialog");
121        modalDialog.css("margin-top", Math.max(0, ($(window).height() - modalDialog.height()) / 2));
122        $('.like-modal.modal').hide();
123    }
124    function createLikeModal(){
125        var modal = (function() {/*
126            <a href="javascript:void(0);" style="display:none;" id="showLikeModalTrigger"  data-toggle="modal" data-target="#likeModal"></a>
127            <div class="like-modal modal fade" id="likeModal" tabindex="-1" aria-hidden="true">
128              <div class="modal-dialog" role="document">
129                <div class="modal-content">
130                  <div class="modal-body">
131                    <div class="mb-10 body-text">
132                    </div>
133                    <div>
134                        <div class="privacy">
135                            <input name="" value="1" id="like_modal_check" type="checkbox">
136                            <label for="like_modal_check" class="checkbox">今後表示しない</label>
137                        </div>
138                    </div>
139                  </div>
140                  <div class="modal-footer">
141                    <a class="btn-main btn-modal-close close" href="javascript:void(0)" data-dismiss="modal">
142                        閉じる
143                    </a>
144                    <a class="btn-main btn-modal-close mypage" href="/mypage/">
145                        マイページを見る
146                    </a>
147                    <div style="clear:both;"></div>
148                  </div>
149                </div>
150              </div>
151            </div>
152        */}).toString().match(/\/\*([^]*)\*\//)[1];
153
154        $('body').append(modal);
155
156    }
157})();
158(function(){
159    $(function(){
160        createJobTelModal();
161        $(".job-tel.modal").on("shown.bs.modal", alignJobTelModal);
162        initJobTelAlignModal();
163
164        $(window).on("resize", function(){
165            $(".job-tel.modal:visible").each(alignJobTelModal);
166            $(".job-tel.modal:hidden").each(initJobTelAlignModal);
167        });
168
169        $('.job-tel-btn').click(function(){
170            var txt = $("<div>").html($(this).data('tel-text')).addClass('txt');
171            var number = $("<div>").text("電話番号:").append($(this).data('tel')).addClass('number');
172            //$('.job-tel.modal .body-text').html(txt).append(number);
173            $('.job-tel.modal .body-text').html(number).append(txt);
174            $('#showJobTelModalTrigger').trigger('click');
175        });
176    });
177    function alignJobTelModal(){
178        var modalDialog = $(this).find(".modal-dialog");
179        modalDialog.css("margin-top", Math.max(0, ($(window).height() - modalDialog.height()) / 2));
180    }
181    function initJobTelAlignModal(){
182        $('.job-tel.modal').show();
183        var modalDialog = $('.job-tel.modal').find(".modal-dialog");
184        modalDialog.css("margin-top", Math.max(0, ($(window).height() - modalDialog.height()) / 2));
185        $('.job-tel.modal').hide();
186    }
187    function createJobTelModal(){
188        var modal = (function() {/*
189            <a href="javascript:void(0);" style="display:none;" id="showJobTelModalTrigger"  data-toggle="modal" data-target="#jobTelModal"></a>
190            <div class="job-tel modal fade" id="jobTelModal" tabindex="-1" aria-hidden="true">
191              <div class="modal-dialog" role="document">
192                <div class="modal-content">
193                  <div class="modal-header primary-color">
194                    <div class="modal-title">
195                        電話で応募
196                    </div>
197                  </div>
198                  <div class="modal-body">
199                    <div class="body-text">
200                    </div>
201                  </div>
202                  <div class="modal-footer">
203                    <a class="btn-main btn-modal-close close" href="javascript:void(0)" data-dismiss="modal">
204                        閉じる
205                    </a>
206                    <div style="clear:both;"></div>
207                  </div>
208                </div>
209              </div>
210            </div>
211        */}).toString().match(/\/\*([^]*)\*\//)[1];
212
213        $('body').append(modal);
214
215    }
216})();
217
218$(function(){
219    // google map
220    $("#google_map").each(function(){
221        var googleScale = $(this).data("scale");
222        var googleLat   = $(this).data("lat");
223        var googleLng   = $(this).data("lng");
224        var googleLatLng  = null;
225        var googleAddress = $(this).data("address");
226        var clName = $(this).data("name");
227
228        if(googleScale == "") {
229            googleScale = 16;
230        }
231
232        if (false);
233        else if (googleLat != "" && googleLng != "") {
234            googleLatLng = new google.maps.LatLng(googleLat, googleLng);
235            loadGMap();
236        }
237        else if (googleAddress != "") {
238            var geocoder = new google.maps.Geocoder();
239            geocoder.geocode(
240                {address: googleAddress},
241                function(result, status){
242                    if (status == google.maps.GeocoderStatus.OK) {
243                        googleLatLng = result[0].geometry.location;
244                        loadGMap();
245                    }
246                }
247            );
248        }
249
250        function loadGMap() {
251            if (googleLatLng != null) {
252                var options = {
253                    zoom: googleScale,
254                    center: googleLatLng,
255                    mapTypeId: google.maps.MapTypeId.ROADMAP,
256                    scrollwheel: false
257                };
258                var map = new google.maps.Map(document.getElementById("google_map"), options);
259                var marker = new google.maps.Marker({
260                    position: map.getCenter(),
261                    map: map
262                });
263                var infoWindow = new google.maps.InfoWindow({
264                    content: "<strong>" + clName + "</strong>"
265                });
266                google.maps.event.addListener(marker, "click", function(){
267                        infoWindow.open(map, marker);
268                });
269
270                //document.getElementById("lnk-map").style.display = "";
271            }
272        }
273
274    });
275});
276
277// 営業カレンダー
278function change_reserve_calendar(cl_id, target_ym) {
279
280    // ローディング表示
281    var loading = '<div class="calendarLoadBox"><img src="/img/calendar/loading.gif"></div>';
282    $("#reserve_calendar_area").html(loading);
283
284    $.post(
285        "/detail/ajax/inc_reserve_calendar.cfm",
286        {
287            cl_id: cl_id
288            , target_ym: target_ym
289        },
290        function (data) {
291            $("#reserve_calendar_area").html(data);
292        }
293    );
294}
295
296// 営業カレンダー(スケジュール機能あり)
297function change_schedule_calendar(cl_id, target_ym, is_list_display = false) {
298
299    // ローディング表示
300    var loading = '<div class="calendarLoadBox"><img src="/img/calendar/loading.gif"></div>';
301    $("#schedule_calendar_area").html(loading);
302
303    $.post(
304        "/detail/template/past/calendar/ajax/inc_schedule_calendar.cfm",
305        {
306            cl_id: cl_id,
307            target_ym: target_ym,
308            is_list_display: is_list_display
309        },
310        function (data) {
311            $("#schedule_calendar_area").html(data);
312        }
313    );
314}
315function showDrawerMenu(target, tab){
316    $('.drawer-nav').show();
317    $('.drawer-nav.main > div > div').hide();
318    $('.drawer-nav.main > div > .' + target).show();
319    if(target != "header-menu"){
320        $('.drawer').drawer('open');
321        if(tab != undefined){
322            $('.' + tab).trigger('click');
323        }
324    }
325    $('.active.site-search__navigation-tab--itme a').trigger('click');
326    if(target == "mypage-menu"){
327        $.ajax({
328            type: 'POST',
329            url: "/member/ajax/read_news.cfm",
330            cache: false,
331            data: {
332            },
333        })
334        .done(function(result){
335        })
336        .fail(function(result){
337        });
338    }
339}
340function changeDrawerMenu(target){
341    $('.drawer-nav.main > div > div').hide();
342    $('.drawer-nav.main > div > .' + target).show();
343    if(target == "mypage-menu"){
344        $.ajax({
345            type: 'POST',
346            url: "/member/ajax/read_news.cfm",
347            cache: false,
348            data: {
349            },
350        })
351        .done(function(result){
352        })
353        .fail(function(result){
354        });
355    }
356}

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.