1/** 2 * Cocoon WordPress Theme 3 * @author: yhira 4 * @link: https://wp-cocoon.com/ 5 * @license: http://www.gnu.org/licenses/gpl-2.0.html GPL v2 or later 6 */ 7///////////////////////////////// 8// JavaScriptã³ã¼ã 9///////////////////////////////// 10 11(function ($) { 12 ///////////////////////////////// 13 //TOPã¸æ»ããã¿ã³ 14 ///////////////////////////////// 15 var prevScrollTop = -1; 16 var $window = $(window); 17 $window.scroll(function () { 18 //æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢ãåå¾ãã¦ã夿°[scrollTop]ã«æ ¼ç´ 19 var scrollTop = $window.scrollTop(); 20 var threashold = 600; 21 var s1 = (prevScrollTop > threashold); 22 var s2 = (scrollTop > threashold); 23 24 // ã¹ã¬ãã·ã§ã«ããè·¨ãã æã®ã¿å¦çããã 25 if (s1 ^ s2) { 26 if (s2) { 27 // ãããã¸æ»ããã¿ã³ãè¦ãã¦ããæ 28 $('.body').addClass('go-to-top-visible'); 29 30 // //[.go-to-to]ããã£ãããã§ã¼ãã¤ã³ãã 31 // $('.go-to-top').fadeIn('slow'); 32 } else { 33 //ãããã¸æ»ãéã ã追å ããã¯ã©ã¹ãé¤å» 34 $('.go-to-top-common').removeClass('go-to-top-up'); 35 // ãããã¸æ»ããã¿ã³ãè¦ãã¦ããªãæ 36 $('.body').removeClass('go-to-top-visible'); 37 38 // //ãã以å¤ã ã£ãããã§ã¼ãã¢ã¦ããã 39 // $('.go-to-top').fadeOut('slow'); 40 } 41 } 42 43 prevScrollTop = scrollTop; 44 }); 45 46 //ãã¿ã³(.go-to-top-common)ã®ã¯ãªãã¯ã¤ãã³ã 47 $('.go-to-top-common').click(function () { 48 //ãããã¸æ»ãéã ãã¯ã©ã¹ã追å 49 $(this).addClass('go-to-top-up'); 50 //ãã¼ã¸ãããã¸ç§»åãã 51 $('body,html').animate({ 52 scrollTop: 1 53 }, 800); 54 }); 55 //ãã¿ã³(.go-to-toc-common)ã®ã¯ãªãã¯ã¤ãã³ã 56 $('.go-to-toc-common').click(function () { 57 //ç®æ¬¡ã¸ç§»åãã 58 $('body,html').animate({ 59 scrollTop: $('.entry-content .toc').offset().top 60 }, 800); 61 }); 62 63 //æ¤ç´¢ãã¿ã³ã¯ãªãã¯ã§ãã©ã¼ã«ã¹ãå ¥åã¨ãªã¢ã«ç§»ã 64 $('#search-menu-input').change(function (e) { 65 var searchEdit = $('#search-menu-content .search-edit').first(); 66 if (e.target.checked) { 67 searchEdit.focus(); 68 } else { 69 searchEdit.blur(); 70 } 71 }); 72 73 //ä¸ã«ã¹ã¯ãã¼ã«ã§ç®¡çããã«ãé ã 74 //ä¸ã«ã¹ã¯ãã¼ã«ã§ç®¡çããã«ã表示 75 var adminMenu = $("#admin-panel"); 76 var adminHeight = adminMenu.outerHeight(); 77 var adminStartPos = 0; 78 $(window).scroll(function () { 79 var adminCurrentPos = $(this).scrollTop(); 80 if (adminCurrentPos > adminStartPos) { 81 if (adminCurrentPos >= 200) { 82 adminMenu.css("bottom", "-" + adminHeight + "px"); 83 } 84 } else { 85 adminMenu.css("bottom", 0); 86 } 87 adminStartPos = adminCurrentPos; 88 }); 89 90 //ã¢ãã¤ã«ãã¿ã³ãåºå®ãããªãå ´å 91 if (cocoon_localize_script_options.is_fixed_mobile_buttons_enable != 1) { 92 //ãããã¼ã¢ãã¤ã«ã¡ãã¥ã¼ 93 var headerMenu = $('.mobile-header-menu-buttons'); 94 var headerHight = headerMenu.outerHeight(); 95 var headerStartPos = 0; 96 $(window).scroll(function () { 97 var headerCurrentPos = $(this).scrollTop(); 98 if (headerCurrentPos > headerStartPos) { 99 if (headerCurrentPos >= 100) { 100 headerMenu.css('top', '-' + headerHight + 'px'); 101 } 102 } else { 103 headerMenu.css('top', 0); 104 } 105 headerStartPos = headerCurrentPos; 106 }); 107 108 //ããã¿ã¼ã¢ãã¤ã«ã¡ãã¥ã¼ 109 var footerMenu = $(".mobile-footer-menu-buttons"); 110 var footerHeight = footerMenu.outerHeight(); 111 var footerStartPos = 0; 112 $(window).scroll(function () { 113 var footerCurrentPos = $(this).scrollTop(); 114 115 if (footerCurrentPos > footerStartPos) { 116 if (footerCurrentPos >= 100) { 117 footerMenu.css("bottom", "calc( -1 * (env(safe-area-inset-bottom) + " + footerHeight + "px) )"); 118 } 119 } else if (footerCurrentPos - footerStartPos < -8) { 120 footerMenu.css("bottom", 0); 121 } 122 123 footerStartPos = footerCurrentPos; 124 }); 125 126 var headerButtons = $(".mobile-header-menu-buttons"); 127 var footerButtons = $(".mobile-footer-menu-buttons"); 128 headerButtons.click(function () { 129 headerButtons.css("z-index", "3"); 130 footerButtons.css("z-index", "2"); 131 }); 132 133 footerButtons.click(function () { 134 headerButtons.css("z-index", "2"); 135 footerButtons.css("z-index", "3"); 136 }) 137 } 138 139 //ã³ã¡ã³ããã¿ã³ãã¯ãªãã¯ãããã¨ã 140 const clickEventType = ((window.ontouchstart !== null) ? 'click' : 'touchend'); 141 $(document).on(clickEventType,'#comment-reply-btn, .comment-reply-link', function() {
142 $('#comment-reply-btn').slideUp(); 143 const respond = document.getElementById('respond'); 144 const styles = { inset: 'auto', position: 'static', visibility: 'visible' }; 145 Object.entries(styles).forEach(([key, value]) => { 146 respond.style[key] = value; 147 }); 148 $('#respond').slideDown(); 149 }); 150 151 //Googleæ¤ç´¢ãã¿ã³ 152 $('.sbtn').click(function () { 153 var w = $(this).prev('.sform').text(); 154 if (w) window.open('https://www.google.co.jp/search?q=' + encodeURIComponent(w), '_blank'); 155 }); 156 157 //ã¹ã©ã¤ãã¤ã³ãµã¤ããã¼ã®ã¢ã¼ã«ã¤ãã»ã¬ã¯ãããã¯ã¹é¸æå¦ç 158 $('.sidebar-menu-content .widget_archive select').change(function () { 159 document.location.href = this.options[this.selectedIndex].value; 160 }); 161 162 //ã¹ã©ã¤ãã¤ã³ãµã¤ããã¼ã®ã«ãã´ãªã¼ã»ã¬ã¯ãããã¯ã¹é¸æå¦ç 163 $('.sidebar-menu-content .widget_categories select').change(function () { 164 if (this.options[this.selectedIndex].value > 0) { 165 this.parentNode.submit(); 166 } 167 }); 168 169 function drawerCloser(selecter, checkbox) { 170 $(selecter).click(function () { 171 $(checkbox).prop('checked', false); 172 // const href = $(this).attr('href'); 173 // if (href.match(/#/)) { 174 // $(checkbox).prop('checked', false); 175 // } 176 }) 177 } 178 179 //ã¢ãã¤ã«ã¡ãã¥ã¼ãã¯ãªãã¯ãããéãã 180 drawerCloser('.menu-drawer .menu-item a', '#navi-menu-input'); 181 182 //ã¢ãã¤ã«ãµã¤ããã¼ãã¯ãªãã¯ãããéãã 183 drawerCloser('#slide-in-sidebar a', '#sidebar-menu-input'); 184 185 //ã¢ãã¤ã«ãããã¼ã¡ãã¥ã¼ã®ãã´å¦ç 186 $('.mobile-menu-buttons').each(function () { 187 if ($(this).has('.logo-menu-button').length) { 188 $(this).addClass('has-logo-button'); 189 } 190 }); 191 192 $(window).on('load', function () { 193 $('#carousel').addClass('loaded'); 194 }); 195 196 //FAQããã¯ã¹ã®ã¢ã³ã¼ãã£ãªã³åç¨ 197 $('.is-style-accordion > .faq > .faq-answer').hide(); 198 $('.is-style-accordion > .faq > .faq-question').click(function () { 199 $(this).next('.is-style-accordion .faq-answer').slideToggle(); 200 $(this).toggleClass('active'); 201 }); 202 203 //ã¢ãã¤ã«ãµã¤ããã¼è¡¨ç¤ºæã«ãµã¤ããã¼ãç§»åããã»ã¢ãã¤ã«ãµã¤ããã¼ãéããæã«å ã®ä½ç½®ã«æ»ã 204 $(document).on("change", '#sidebar-menu-input', function () { 205 if ($(this).prop('checked')) { 206 $('#sidebar').appendTo('#sidebar-menu-content'); 207 $('#sidebar').attr('id', 'slide-in-sidebar'); 208 $('#sidebar').addClass('slide-in-sidebar'); 209 //ã¢ãã¤ã«ãµã¤ããã¼ã®ãªã³ã¯ãã¯ãªãã¯ãããéãã 210 drawerCloser('#slide-in-sidebar a', '#sidebar-menu-input'); 211 } else { 212 $('#sidebar').removeClass('slide-in-sidebar'); 213 $('#slide-in-sidebar').attr('id', 'sidebar'); 214 $('#sidebar').insertAfter('#main'); 215 } 216 }); 217 218 //ãªãµã¤ãºããæã¯ãµã¤ããã¼ãå ã«æ»ã 219 var vw = window.innerWidth; 220 $(window).resize(function () { 221 if (vw != window.innerWidth) { 222 $('#sidebar-menu-input').prop('checked', false).change(); 223 } 224 vw = window.innerWidth; 225 }); 226})(jQuery); 227 228/* 229* Cocoon WordPress Theme incorporates code from "Youtube SpeedLoad" WordPress Plugin, Copyright 2017 Alexufo[http://habrahabr.ru/users/alexufo/] 230"Youtube SpeedLoad" WordPress Plugin is distributed under the terms of the GNU GPL v2 231*/ 232(function () { 233 var f = document.querySelectorAll(".video-click"); 234 for (var i = 0; i < f.length; ++i) { 235 f[i].onclick = function () { 236 var iframe = this.getAttribute("data-iframe"); 237 this.parentElement.innerHTML = '<div class="video">' + iframe + '</div>'; 238 } 239 } 240})();
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.