PageSourceSearch

https://machikado-gallery.com/wp-content/themes/machikado-gallery/assets/js/common.js?ver=7.0.6

js machikado-gallery.com collected 2026-09-24 10:15:31 UTC 7,559 bytes, 267 lines download raw bytes

1/*--------------------------------------------------------------------------*
2 *  
3 *  common.js
4 *  
5 *  MIT-style license. 
6 *  
7 *  2017 T.Sugiyama [Fromdime Agency]
8 *  http://fromdime.com
9 *  
10 *--------------------------------------------------------------------------*/
11$(function(){
12
13    /*--------------------------------------------------------------------------------
14
15    init
16
17    --------------------------------------------------------------------------------*/
18    //    $(document).foundation();
19
20
21
22    /*--------------------------------------------------------------------------------
23
24    ページトップへ関数の実行
25
26    --------------------------------------------------------------------------------*/
27    (function pagetop() {
28        var flag = false;
29        var pagetop = $('.pagetop');
30        $(window).scroll(function () {
31            if ($(this).scrollTop() > 500) {
32                if (flag == false) {
33                    flag = true;
34                    pagetop.stop().fadeIn(1000)
35                }
36            } else {
37                if (flag) {
38                    flag = false;
39                    pagetop.stop().fadeOut(1000)
40                }
41            }
42        });
43        pagetop.click(function () {
44            $('body, html').animate({ scrollTop: 0 }, 500);
45            return false;
46        });
47    })();
48
49    (function gohome() {
50        var flag = false;
51        var gohome = $('.gohome');
52        $(window).scroll(function () {
53            if ($(this).scrollTop() > 500) {
54                if (flag == false) {
55                    flag = true;
56                    gohome.stop().fadeIn(1000)
57                }
58            } else {
59                if (flag) {
60                    flag = false;
61                    gohome.stop().fadeOut(1000)
62                }
63            }
64        });
65    })();
66
67    //    $(window).bind("scroll", function() {
68    //        // ドキュメントの高さ
69    //        var scrollHeight = $(document).height();
70    //        // ウィンドウの高さ+スクロールした高さ→ 現在のトップからの位置
71    //        var scrollPosition = $(window).height() + $(window).scrollTop();
72    //        // フッターの高さ
73    //        var footHeight = $("#footer").height();
74    //
75    //        // スクロール位置がフッターまで来たら
76    //        if ( scrollHeight - scrollPosition  <= footHeight ) {
77    //            // ページトップリンクをフッターに固定
78    //            $(".pagetop a").css({"position":"absolute","bottom": "0px"});
79    //        } else {
80    //            // ページトップリンクを右下に固定
81    //            $(".pagetop a").css({"position":"fixed","bottom": "0px"});
82    //        }
83    //    });
84
85
86    // #で始まるアンカーをクリックした場合に処理
87    $('a[href^=#], area[href^=#]').click(function() {
88        var $chk = $(this).parent().attr("class");
89        //        console.log($(this).parent.attr("class"));
90
91        // スクロールの速度
92        var speed = 400; // ミリ秒
93        // アンカーの値取得
94        var href= $(this).attr("href");
95        // 移動先を取得
96        var target = $(href == "#" || href == "" ? 'html' : href);
97
98        var position = 0;
99        if($chk != "pagetop") {
100            // 移動先を数値で取得
101            var position = target.offset().top - 10;
102        }
103
104        // スムーススクロール
105        $('body,html').animate({scrollTop:position}, speed, 'swing');
106
107        return false;
108    });
109
110//    // #で始まるアンカーをクリックした場合に処理
111//    $('a[href^=#]').click(function() {
112//        // スクロールの速度
113//        var speed = 400; // ミリ秒
114//        // アンカーの値取得
115//        var href= $(this).attr("href");
116//        // 移動先を取得
117//        var target = $(href == "#" || href == "" ? 'html' : href);
118//        // 移動先を数値で取得
119//        var position = target.offset().top - 10;
120//        // スムーススクロール
121//        $('body,html').animate({scrollTop:position}, speed, 'swing');
122//        return false;
123//    });
124
125
126
127});
128
129$(window).on('load',function(){
130});
131
132
133
134$(window).on('load resize',function(){
135});
136
137
138
139/*--------------------------------------------------------------------------------
140
141    util
142
143    --------------------------------------------------------------------------------*/
144pathinfo = {
145    // プロトコル
146    protocol : function(path) {
147        var result = path.replace(/\\/g, '/').match(/^([^/]+):/, '');
148        if (result) {
149            result = result[1];
150        } else {
151            result = '';
152        }
153        return result;
154    },
155
156    // ドメイン名
157    domain : function(path) {
158        var result = path.replace(/\\/g, '/').match(/\/\/([^/]*)/);
159        if (result) {
160            result = result[1];
161        } else {
162            result = '';
163        }
164        return result;
165    },
166
167    // トップレベルドメイン名
168    topLevelDomain : function(path) {
169        var result = this.domain(path).match(/\.([^.]+)$/);
170        if (result) {
171            result = result[1];
172        } else {
173            result = '';
174        }
175        return result;
176    },
177
178    // 直前のディレクトリ名まで
179    dirname : function(path) {
180        var result = path.replace(/\\/g, '/').replace(/\/[^/]*$/, '');
181        if (result.match(/^[^/]*\.[^/\.]*$/)) {
182            result = '';
183        }
184        return result;
185    },
186
187    // ルート相対
188    rootRelative : function(path) {
189        var result = path.replace(/\\/g, '/').replace(/^[^/]*\/\/[^/]*/, '');
190        return result;
191    },
192
193    // ファイル名以降すべて
194    fullBasename : function(path) {
195        var result = '';
196        if (path) {
197            var paths = path.split('/');
198
199            result = paths.pop();
200        }
201        return result;
202    },
203
204    // 拡張子を含めたファイル名
205    basename : function(path) {
206        var result = this.fullBasename(path).replace(/[\?#].*$/g, '');
207        return result;
208    },
209
210    // 拡張子を除いたファイル名
211    filename : function(path) {
212        var result = this.basename(path).replace(/\.[^.]+$/, '');
213        return result;
214    },
215
216    // 拡張子
217    extension : function(path) {
218        var result = this.basename(path).match(/\.([^.]+)$/);
219        if (result) {
220            result = result[1];
221        } else {
222            result = '';
223        }
224        return result;
225    },
226
227    // パラメータ(文字列)
228    param : function(path) {
229        var result = path.match(/\?([^?]*)$/);
230        if (result) {
231            result = result[1];
232        } else {
233            result = '';
234        }
235        return result;
236    },
237
238    // パラメータ(配列)
239    params : function(path) {
240        var param  = this.param(path),
241            params = {};
242        if (param !== '') {
243            var tmpParams = param.split('&');
244            var keyValue  = [];
245            for(var i = 0, len = tmpParams.length; i < len; i++) {
246                keyValue = tmpParams[i].split('=');
247                params[keyValue[0]] = keyValue[1];
248            }
249        }
250        return params;
251    },
252
253    // ハッシュ
254    hash : function(path) {
255        var result = '';
256        if (path) {
257            var paths = path.split('/');
258            var matchs = paths.pop().match(/#([^#]+)$/);
259            if (matchs && matchs[1]) {
260                result = matchs[1];
261            }
262        }
263        return result;
264    }
265
266};
267

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.