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.