1$(function() { 2 function isSmartPhone() { 3 return /iPhone|Android.*Mobile/.test(navigator.userAgent); 4 } 5 6 var snsUrls = { 7 twitter: "http://twitter.com/intent/tweet?", 8 facebook: "http://www.facebook.com/share.php?", 9 google: "https://plus.google.com/share?", 10 line: { 11 sm: "line://msg/text/", 12 pc: "http://line.me/R/msg/text/?" 13 } 14 }; 15 16 function getTwitterUrl() { 17 return snsUrls.twitter + 'text=' + encodeURIComponent(document.title) + '&url=' + encodeURIComponent(location.href); 18 } 19 20 function getFacebookUrl() { 21 return snsUrls.facebook + 'u=' + encodeURIComponent(location.href); 22 } 23 24 function getGoogleUrl() { 25 return snsUrls.google + 'url=' + encodeURIComponent(location.href); 26 } 27 28 function getLineUrl() { 29 if(isSmartPhone()) { 30 return snsUrls.line.sm + encodeURIComponent(document.title + ' ' + location.href); 31 } else { 32 return snsUrls.line.pc + encodeURIComponent(document.title + ' ' + location.href); 33 } 34 } 35 36 // ---------------------------- 37 // é常ã®ã·ã§ã¢å¦ç 38 // ---------------------------- 39 function setupSnsHandlers() { 40 // SNSãã¿ã³ 41 $('.snstable a').off("click.sns").on("click.sns", function(e) { 42 var sns = $(this).data('sns'); 43 var url = ''; 44 var href = $(this).attr('href'); 45 46 if(href == '#'){ 47 switch(sns) { 48 case 'twitter': url = getTwitterUrl(); break; 49 case 'facebook': url = getFacebookUrl(); break; 50 case 'google': url = getGoogleUrl(); break; 51 case 'line': url = getLineUrl(); break; 52 } 53 54 if(url.match('^https?://')) { 55 window.open(url); 56 } else { 57 location.href = url; 58 } 59 60 e.preventDefault(); 61 } 62 }); 63 64 // Googleããããªã³ã¯ã¯é常ã®ã¾ã¾ 65 $('a[href*="www.google.com/maps/search"]').off("click.gmap"); 66 67 // bottomBannerãªã³ã¯ã¯é常ã®ã¾ã¾ 68 $('.bottomBanner a').off("click.banner"); 69 } 70 71 // ---------------------------- 72 // ãã¬ãã¥ã¼ç¨ï¼ãªã³ã¯ç¡å¹å 73 // ---------------------------- 74 function disablePreviewHandlers() { 75 // SNSãã¿ã³ãç¡å¹å 76 $('.snstable a').off("click.sns").on("click.sns", function(e) { 77 e.preventDefault(); 78 e.stopPropagation(); 79 console.log("ãã¬ãã¥ã¼ä¸ã®ããSNSãªã³ã¯ã¯ç¡å¹åããã¦ãã¾ã"); 80 return false; 81 }); 82 83 // Googleãããæ¡å¤§ãªã³ã¯ãç¡å¹å 84 $('a[href*="www.google.com/maps/search"]').off("click.gmap").on("click.gmap", function(e) { 85 e.preventDefault(); 86 e.stopPropagation(); 87 console.log("ãã¬ãã¥ã¼ä¸ã®ããGoogleãããæ¡å¤§ã¯ç¡å¹åããã¦ãã¾ã"); 88 return false; 89 }); 90 91 // bottomBannerå ãªã³ã¯ãç¡å¹å 92 $('.bottomBanner a').off("click.banner").on("click.banner", function(e) { 93 e.preventDefault(); 94 e.stopPropagation(); 95 console.log("ãã¬ãã¥ã¼ä¸ã®ããåºåãªã³ã¯ã¯ç¡å¹åããã¦ãã¾ã"); 96 return false; 97 }); 98 } 99 100 // åæç¶æ ã¯é常 101 setupSnsHandlers(); 102 103 // 親ããã® postMessage ãå¾ ã¡åã 104 window.addEventListener("message", function(event) { 105 if (event.data.action === "disablePreviewLinks") { 106 disablePreviewHandlers(); 107 } else if (event.data.action === "enablePreviewLinks") { 108 setupSnsHandlers(); 109 } 110 }); 111});
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.