PageSourceSearch

https://www.ecomfort.jp/client_info/ECOMFORTHOUSE/view/userweb/js/ebisu.js?timestamp=1749041160201

js ecomfort.jp collected 2026-10-04 13:23:14 UTC 10,120 bytes, 269 lines download raw bytes

1
2/* *************** Libraryの処理 ******************* */
3
4var Ebisu = {
5    isLocal: true,
6    rootPath: "/"
7};
8(function(){
9    "use strict";
10
11    // 文字サイズ変更の処理
12    Ebisu.FontChanger = {
13        map: {
14            S: "95%",
15            M: "100%",
16            L: "105%"
17        },
18        currentSize: null,
19        getCurrentSize: function(){
20            if(this.currentSize == null){
21                this.currentSize = eb$.cookie('body.style.fontSize') == null ? "M" : eb$.cookie('body.style.fontSize');
22            }
23            return this.currentSize;
24        },
25        change: function(size){
26            this.currentSize = size;
27            eb$.cookie('body.style.fontSize', size, {expires:'7', path:'/'});
28            this.view();
29        },
30        
31        view: function(){
32            var size = this.getCurrentSize();
33            size = (size == null) ? "M" : size ;
34            eb$(".__FONT_CHANGER_BUTTON_S_ON").hide();
35            eb$(".__FONT_CHANGER_BUTTON_S_OFF").show();
36            eb$(".__FONT_CHANGER_BUTTON_M_ON").hide();
37            eb$(".__FONT_CHANGER_BUTTON_M_OFF").show();
38            eb$(".__FONT_CHANGER_BUTTON_L_ON").hide();
39            eb$(".__FONT_CHANGER_BUTTON_L_OFF").show();
40            eb$(".__FONT_CHANGER_BUTTON_" + size + "_ON").show();
41            eb$(".__FONT_CHANGER_BUTTON_" + size + "_OFF").hide();
42            document.body.style.fontSize = this.map[size];
43        }
44    };
45
46    // えびすカレンダーの処理
47    eb$.fn.ebisu_calendar = function(options){
48        if(options == null){
49            options = {};
50        }
51        if(options.goneMonthCount != null){
52            var today = new Date();
53            var firstMonthFirstDay = new Date(today.getFullYear(), today.getMonth() - options.goneMonthCount, 1);
54            options.minDate = firstMonthFirstDay;
55        }
56        if(options.comingMonthCount != null){
57            var today = new Date();
58            var lastMonthLastDay = new Date(today.getFullYear(), today.getMonth() + options.comingMonthCount + 1, 0);
59            options.maxDate = lastMonthLastDay;
60        }
61        if(options.goneDateCount != null){
62            var today = new Date();
63            var firstMonthFirstDay = new Date(computeDate(today.getFullYear(), today.getMonth() + 1, today.getDate(), -options.goneDateCount));
64            options.minDate = firstMonthFirstDay;
65        }
66        if(options.comingDateCount != null){
67            var today = new Date();
68            var lastMonthLastDay = new Date(computeDate(today.getFullYear(), today.getMonth() + 1, today.getDate(), options.comingDateCount));
69            options.maxDate = lastMonthLastDay;
70        }
71        var target = eb$(this);
72        var doDatePicker = function(dateJson){
73            var oldFunc = options.beforeShowDay;
74            options.beforeShowDay = function(date){
75                var colorNo = dateJson[Ebisu.dateToYYYYMMDD(date)];
76                if(colorNo != null){
77                    return [true, "day_color" + colorNo];
78                }
79                if(oldFunc){
80                    return oldFunc();
81                }
82                return [true];
83            };
84            target.datepicker(options);
85        };
86        if(Ebisu.isLocal){
87            doDatePicker({
88                20120117: 1,
89                20120119: 2,
90                20120120: 3,
91                20120121: 4,
92                20120122: 5,
93                20120123: 6
94            });
95        } else {
96            eb$.getJSON(
97                Ebisu.rootPath + "ajax_calendar_data.jsonp?callback=?",
98                {
99                    "min_date": Ebisu.dateToYYYYMMDD(options.minDate),
100                    "max_date": Ebisu.dateToYYYYMMDD(options.maxDate)
101                },
102                doDatePicker
103            );
104        }
105    };
106    /*
107        年月日と加算日からn日後、n日前を求める関数
108        year å¹´
109        month 月
110        day 日
111        addDays 加算日。マイナス指定でn日前も設定可能
112    */
113    function computeDate(year, month, day, addDays){
114        var dt = new Date(year, month - 1, day);
115        var baseSec = dt.getTime();
116        var addSec = addDays * 86400000;//日数 * 1日のミリ秒数
117        var targetSec = baseSec + addSec;
118        dt.setTime(targetSec);
119        return dt;
120    }
121    Ebisu.dateToYYYYMMDD = function(date){
122        var yyyy = date.getFullYear(), mm = date.getMonth() + 1, dd = date.getDate();
123        if (mm < 10) { mm = "0" + mm; }
124        if (dd < 10) { dd = "0" + dd; }
125        return yyyy.toString() + mm.toString() + dd.toString();
126    };
127})();
128
129/* *************** Libraryの処理 end ******************* */
130
131
132/* *************** ブラウザ判別用クラス追加の処理 ******************* */
133
134/*
135    htmlタグに以下のブラウザ判別用クラスを追加します。
136    例えばIE6なら <html class="ie ie6"> となります。
137    対象:ie, chrome, firefox, oepra, sagari
138    ※一応将来のバージョンにも対応してるのでIE99でも「class="ie ie99"」となります。
139    ※ブラウザ名は全て小文字指定、バージョン指定の部分は、最初のマイナーバージョンまで、小数点の0のみはピリオドごと消える、「.」は「_」になります。
140    ※モバイルOS情報を付加する→ios(iphone, ipad, ipod), android
141    例:「Safari」→「safari」
142    例:「IE11.0」→「ie11」
143    例:「IE5.5」→「ie5_5」
144    例:「Safari5.1.7」→「safari5_1」
145*/
146function addBrowserClass(){
147    var __add = function(name, ver){
148        if(document.documentElement.className){ document.documentElement.className += ' '; }
149        document.documentElement.className += name + (ver!='' ? ' ' + name+(ver*1).toString().replace('.','_') : '');
150    }
151    var userAgent = window.navigator.userAgent.toLowerCase();
152    var appVersion = window.navigator.appVersion.toLowerCase();
153    if( get = userAgent.match( /msie (\d+(\.\d+)?)/i ) )              { __add('ie',      get[1]); }
154    else if( get = userAgent.match( /Trident.+rv\:(\d+(\.\d+)?)/i ) ) { __add('ie',      get[1]); }
155    else if( get = userAgent.match( /chrome\/(\d+(\.\d+)?)/i ) )      { __add('chrome',  get[1]); }
156    else if( get = userAgent.match( /firefox\/(\d+(\.\d+)?)/i ) )     { __add('firefox', get[1]); }
157    else if( get = userAgent.match( /opera\/(\d+(\.\d+)?)/i ) )       { __add('opera',   get[1]); }
158    else if( get = userAgent.match( /safari\/(\d+(\.\d+)?)/i ) )      { __add('safari',  get[1]); }
159    if( get = userAgent.match( /iPhone OS (\d+(\.\d+)?)/i ) )    { __add('ios',     get[1]); }
160    if( get = userAgent.match( /iPhone;/i ) )                    { __add('iphone',  ''); }
161    else if( get = userAgent.match( /iPod;/i ) )                 { __add('ipod',    ''); }
162    else if( get = userAgent.match( /iPad;/i ) )                 { __add('ipad',    ''); }
163    else if( get = userAgent.match( /Android (\d+(\.\d+)?)/i ) ) { __add('android', get[1]); }
164}
165addBrowserClass();
166
167/* *************** ブラウザ判別用クラス追加の処理 end *************** */
168
169
170/* *************** 文字サイズの実行 ******************* */
171
172eb$(function(){
173    eb$('.__FONT_CHANGER_BUTTON_S_OFF').on('click', function(){
174        Ebisu.FontChanger.change('S');
175        return false;
176    });
177    eb$('.__FONT_CHANGER_BUTTON_M_OFF').on('click', function(){
178        Ebisu.FontChanger.change('M');
179        return false;
180    });
181    eb$('.__FONT_CHANGER_BUTTON_L_OFF').on('click', function(){
182        Ebisu.FontChanger.change('L');
183        return false;
184    });
185});
186
187/* *************** 文字サイズの実行 end ******************* */
188
189
190/* *************** このページをトップへをクリックした時の処理 ******************* */
191
192function backToTop(obj){
193    eb$(obj).on('click', function(){
194        eb$('body, html').animate({scrollTop:0}, 500);
195        return false;
196    });
197}
198
199/* *************** このページをトップへをクリックした時の処理 end *************** */
200
201
202/* *************** 商品詳細ページのAJAXの処理 ******************* */
203
204// AJAXの処理後エラーだった場合の挙動
205function ajaxPutToCartErrorAction(msg, obj){
206    var error = JSON.parse(msg.responseText).ERROR;
207    alert(error);
208}
209
210// AJAXの処理後成功だった場合の挙動
211function ajaxPutToCartSuccessAction(msg, obj){
212    showPop(eb$(obj).find('.cartMessage'));
213}
214
215// ポップアップウィンドウを表示
216function showPop(msgBox){
217    var delaytime = 3000;
218    if (msgBox.is(':hidden')){
219      msgBox
220       .css({
221        'opacity' : 0,
222        'margin-top': 30
223       })
224       .show().animate({
225        'opacity' : 1,
226        'margin-top' : 0
227       }, 200)
228       .delay(delaytime)
229       .fadeOut();
230    }
231}
232
233/* *************** 商品詳細ページのAJAXの処理 end *************** */
234
235
236/* *************** 商品詳細ページの数量をテキスト入力にする処理 ******************* */
237
238function putItemPropertyToCart(itemcd, propcd, request, paramUrl, obj){
239    var val = Number(eb$('#CART_AMOUNT').val()) || 1;  // 未設定なら 1
240    eb$('<form/>', {action : paramUrl, method : 'post'})
241    .append(eb$('<input/>', {type : 'hidden',name : 'request',value : request}))
242    .append(eb$('<input/>', {type : 'hidden',name : 'item_cd',value : itemcd}))
243    .append(eb$('<input/>', {type : 'hidden',name : 'ITEMPROPERTY_CD',value : propcd}))
244    .append(eb$('<input/>', {type : 'hidden',name : 'CART_AMOUNT',value : "'" + val + "'"}))
245    .appendTo(document.body).submit();
246}
247
248/* *************** 商品詳細ページの数量をテキスト入力にする処理 end *************** */
249
250
251/* *************** カート精算ページに関する処理 ******************* */
252
253// エラーが走った時に実行(個別エラーオプション時に使用)
254/*
255function scrollError(){
256    window.scroll(0,0);
257    if (eb$("div#error").length > 0) {
258        location.href = "#error";
259    }
260}
261eb$(function(){
262    scrollError();
263});
264*/
265
266/* *************** カート精算ページに関する処理 end *************** */
267
268
269

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.