1/** 2 * ã¢ããªèªå°é¢é£ 3 */ 4 5$( function() { 6 var ua = navigator.userAgent; 7 var app_link_ios = 'https://apps.apple.com/jp/app/%E6%9C%9D%E6%99%82%E9%96%93-jp-%E6%9C%9D%E3%81%94%E3%81%AF%E3%82%93%E3%83%AC%E3%82%B7%E3%83%94%E3%82%84%E6%9C%9D%E3%81%AE%E3%83%8B%E3%83%A5%E3%83%BC%E3%82%B9%E3%82%92%E6%AF%8E%E6%97%A5%E3%81%8A%E5%B1%8A%E3%81%91/id400435286'; 8 var app_link_android = 'https://play.google.com/store/apps/details?id=jp.asajikan&hl=ja'; 9 var is_sp = false; 10 var is_ios = false; 11 var is_android = false; 12 13 // iOS 14 if ( ua.indexOf('iPhone') > 0 || ua.indexOf('iPad') > 0 || ua.indexOf('iPod') > 0) { 15 $( '#ualink' ).attr( 'href', app_link_ios ); 16 $( '#link_app' ).attr( 'href', app_link_ios ); 17 $( '#header_link_app' ).attr( 'href', app_link_ios ); 18 is_sp = true; 19 is_ios = true; 20 21 //iosã®æã«ã¢ããªèªå°ããã¼ã表示ãã 22 $( '.bnrAppGuidance' ).find('img').css('visibility', 'visible'); //対象ãã¡ã¤ã«ï¼top_loop.php 23 $( '.apri_a_box' ).css('visibility', 'visible'); //対象ãã¡ã¤ã«ï¼front-page.php 24 $( '.apri_b_sp' ).css('visibility', 'visible');//対象ãã¡ã¤ã«ï¼sidebar.php 25 $( '.appGuidanceArea' ).css('visibility', 'visible');//対象ãã¡ã¤ã«ï¼content-single.php 26 $( '.appdl1' ).css('display', 'block');//対象ãã¡ã¤ã«ï¼footer.php 27 // Android 28 } else if ( ua.indexOf('Android') > 0 ) { 29 $( '#ualink' ).attr( 'href', app_link_android ); 30 $( '#link_app' ).attr( 'href', app_link_android ); 31 $( '#header_link_app' ).attr( 'href', app_link_android ); 32 is_sp = true; 33 is_android = true; 34 35 // androidã®æã«ã¢ããªèªå°ããã¼ãé表示ã«ãã 36 $( '.bnrAppGuidance' ).addClass( 'is-hidden' ); //対象ãã¡ã¤ã«ï¼top_loop.php 37 $( '.apri_a' ).addClass( 'is-hidden' ); //対象ãã¡ã¤ã«ï¼front-page.php 38 $( '.apri_b_sp' ).addClass( 'is-hidden' ); //対象ãã¡ã¤ã«ï¼sidebar.php 39 $( '.appGuidanceArea' ).addClass( 'is-hidden' ); //対象ãã¡ã¤ã«ï¼content-single.php 40 // $( '.appdl1' ).addClass( 'is-hidden' ); //対象ãã¡ã¤ã«ï¼footer.php 41 // ããã²ã¼ã·ã§ã³ã®ä½ç½®ãèª¿æ´ 42 $( '.main-navigation2' ).removeAttr( 'id' ); 43 // etc 44 } else { 45 is_sp = false; 46 is_ios = false; 47 is_android = false; 48 } 49 50 // // ãã¼ã¸èªã¿è¾¼ã¿ã®ã¿ã¤ãã³ã°ã§headerä¸é¨ã®ããã¼è¡¨ç¤ºã»éè¡¨ç¤ºç¢ºèª 51 // $( document ).ready( function(){ 52 // if ( document.cookie.indexOf( 'header-guidance-close' ) !== -1 ) { 53 // $( '.header-app-guidance' ).css( 'display', 'none' ); 54 // if ( is_sp ) { 55 // $( '.main-navigation2' ).removeAttr( 'id' ); 56 // } 57 // } 58 // }); 59 60 // // headerä¸é¨ããã¼é表示å¶å¾¡ 61 // $( '.header-guidance-close' ).on( 'click', function(){ 62 // // æå¹æéã30æ¥ 63 // document.cookie = 'header-guidance-close=true; max-age=2592000000'; 64 65 // // é表示 66 // $( '.header-app-guidance' ).css( 'display', 'none' ); 67 68 // // cssèª¿æ´ 69 // if ( is_sp ) { 70 // $( '.main-navigation2' ).removeAttr( 'id' ); 71 // } 72 // }); 73 74 // analytics click eventï¼ã¢ããªåç¥èªå°ç³» 75 $( 'a.ga-click' ).on( 'click', function(){ 76 var ga_category = $( this ).data( 'ga_category' ); 77 var ga_label = $( this ).data( 'ga_label' ); 78 var ga_after_text_check = ""; 79 if ( $( this ).data( 'after_text_check' ) !== undefined ) { 80 ga_after_text_check = $( this ).data( 'after_text_check' ); 81 } 82 83 // console.log( 'ga_category:' + ga_category ); 84 // console.log( 'ga_label:' + ga_label ); 85 // console.log( 'ga_after_text_check:' + ga_after_text_check ); 86 87 // console.log( 'is_sp:' + is_sp ); 88 // console.log( 'is_ios:' + is_ios ); 89 // console.log( 'is_android:' + is_android ); 90 91 // ãga_categoryãã¨ãga_labelããåå¾ã§ãã¦ãããã¨ãåæ 92 if ( ga_category && ga_label ) { 93 // ä¸é¨ã«ãã´ãªã¯iOSã¨Androidãå¤å® 94 if ( 95 ga_category == "header" 96 || ga_category == "header_single" 97 || ga_after_text_check == "1" 98 ) { 99 if ( is_ios ) { 100 ga_label = ga_label + "ios"; 101 } else if ( is_android ) { 102 ga_label = ga_label + "android"; 103 } else { 104 // åå¾ã§ããªãå ´åã¯å¦ç䏿¢ 105 return; 106 } 107 } else if ( ga_category == "about" ) { 108 if ( is_ios || is_android ) { 109 ga_label = "sp" + ga_label; 110 } else { 111 ga_label = "pc" + ga_label; 112 } 113 } 114 115 // console.log( 'immediately before ga_category: ' + ga_category ); 116 // console.log( 'immediately before ga_label: ' + ga_label ); 117 118 ga('send', 'event', ga_category, 'click', ga_label); 119 } 120 }); 121 122});
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.