PageSourceSearch

https://web-breeze.net/wp-content/themes/cocoon-master/javascript.js?ver=6.9.9&fver=20221101051558

js web-breeze.net collected 2026-10-05 11:26:02 UTC 6,926 bytes, 211 lines download raw bytes

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        //[.go-to-to]をゆっくりフェードインする
28        $('.go-to-top').fadeIn('slow');
29      } else {
30        //それ以外だったらフェードアウトする
31        $('.go-to-top').fadeOut('slow');
32      }
33    }
34
35    prevScrollTop = scrollTop;
36  });
37
38  //ボタン(.go-to-top-common)のクリックイベント
39  $('.go-to-top-common').click(function(){
40  //ページトップへ移動する
41    $('body,html').animate({
42            scrollTop: 1
43        }, 800);
44  });
45  //ボタン(.go-to-toc-common)のクリックイベント
46  $('.go-to-toc-common').click(function(){
47  //目次へ移動する
48    $('body,html').animate({
49            scrollTop: $('.entry-content .toc').offset().top
50        }, 800);
51  });
52
53  //検索ボタンクリックでフォーカスを入力エリアに移す
54  $('#search-menu-input').change(function(e){
55    var searchEdit = $('#search-menu-content .search-edit').first();
56    if( e.target.checked ) {
57      searchEdit.focus();
58    } else {
59      searchEdit.blur();
60    }
61  });
62
63  //下にスクロールで管理パネルを隠す
64  //上にスクロールで管理パネルを表示
65  var adminMenu = $("#admin-panel");
66  var adminHeight = adminMenu.outerHeight();
67  var adminStartPos = 0;
68  $(window).scroll(function(){
69    var adminCurrentPos = $(this).scrollTop();
70    if (adminCurrentPos > adminStartPos) {
71      if(adminCurrentPos >= 200) {
72        adminMenu.css("bottom", "-" + adminHeight + "px");
73      }
74    } else {
75      adminMenu.css("bottom", 0);
76    }
77    adminStartPos = adminCurrentPos;
78  });
79
80  //モバイルボタンが固定じゃない場合
81  if (cocoon_localize_script_options.is_fixed_mobile_buttons_enable != 1) {
82    //ヘッダーモバイルメニュー
83    var headerMenu = $('.mobile-header-menu-buttons');
84    var headerHight = headerMenu.outerHeight();
85    var headerStartPos = 0;
86    $(window).scroll(function() {
87      var headerCurrentPos = $(this).scrollTop();
88      if ( headerCurrentPos > headerStartPos ) {
89        if(headerCurrentPos >= 100) {
90          headerMenu.css('top', '-' + headerHight + 'px');
91        }
92      } else {
93        headerMenu.css('top', 0);
94      }
95      headerStartPos = headerCurrentPos;
96    });
97
98    //フッターモバイルメニュー
99    var footerMenu = $(".mobile-footer-menu-buttons");
100    var footerHeight = footerMenu.outerHeight();
101    var footerStartPos = 0;
102    $(window).scroll(function(){
103      var footerCurrentPos = $(this).scrollTop();
104
105      // if (footerCurrentPos - footerStartPos > 20) {
106      //   if(footerCurrentPos >= 100) {
107      //     footerMenu.css("bottom","calc( -1 * (env(safe-area-inset-bottom) + " + footerHeight + "px) )");
108      //   }
109      // } else if (footerCurrentPos - footerStartPos < -8) {
110      //   footerMenu.css("bottom", 0);
111      // }
112
113      if (footerCurrentPos > footerStartPos) {
114        if(footerCurrentPos >= 100) {
115          footerMenu.css("bottom","calc( -1 * (env(safe-area-inset-bottom) + " + footerHeight + "px) )");
116        }
117      } else if (footerCurrentPos - footerStartPos < -8) {
118        footerMenu.css("bottom", 0);
119      }
120
121      footerStartPos = footerCurrentPos;
122    });
123
124    var headerButtons = $(".mobile-header-menu-buttons");
125    var footerButtons = $(".mobile-footer-menu-buttons");
126    headerButtons.click(function() {
127      headerButtons.css("z-index", "3");
128      footerButtons.css("z-index", "2");
129    });
130
131    footerButtons.click(function() {
132      headerButtons.css("z-index", "2");
133      footerButtons.css("z-index", "3");
134    })
135  }
136
137  //コメントボタンがクリックされたとき
138  $('#comment-reply-btn, .comment-reply-link').click(function() {
139    $('#comment-reply-btn').slideUp();
140    $('#respond').slideDown();
141  });
142
143  //Google検索ボタン
144  $('.sbtn').click(function(){
145		var w = $(this).prev('.sform').text();
146		if(w) window.open('https://www.google.co.jp/search?q='+encodeURIComponent(w),'_blank');
147  });
148
149  //スライドインサイドバーのアーカイブセレクトボックス選択処理
150  $('.sidebar-menu-content .widget_archive select').change(function(){
151		document.location.href = this.options[this.selectedIndex].value;
152  });
153
154  //スライドインサイドバーのカテゴリーセレクトボックス選択処理
155  $('.sidebar-menu-content .widget_categories select').change(function(){
156    if ( this.options[ this.selectedIndex ].value > 0 ) {
157      this.parentNode.submit();
158    }
159  });
160
161  function drawerCloser(selecter, checkbox){
162    $(selecter).click(function() {
163      href = $(this).attr('href');
164      url = location.href;
165      url = url.replace(/#.*$/, '');
166      if ((href.indexOf(url) != -1) && href.match(/#/)) {
167        $(checkbox).prop('checked', false);
168      }
169    })
170  }
171
172  //モバイルメニューをクリックしたら閉じる
173  drawerCloser('.menu-drawer .menu-item a', '#navi-menu-input');
174
175  //モバイルサイドバーをクリックしたら閉じる
176  drawerCloser('#slide-in-sidebar a', '#sidebar-menu-input');
177
178  //モバイルヘッダーメニューのロゴ処理
179  //console.log($('.mobile-menu-buttons'));
180  $('.mobile-menu-buttons').each(function(){
181    if ($(this).has('.logo-menu-button').length) {
182      $(this).addClass('has-logo-button');
183    }
184  });
185
186  $(window).on('load', function(){
187    $('#carousel').addClass('loaded');
188  });
189
190  //FAQボックスのアコーディオン化用
191  $('.is-style-accordion .faq-answer').hide();
192  $('.is-style-accordion .faq-question').click(function(){
193    $(this).next('.is-style-accordion .faq-answer').slideToggle();
194    $(this).toggleClass('active');
195  });
196})(jQuery);
197
198/*
199* Cocoon WordPress Theme incorporates code from "Youtube SpeedLoad" WordPress Plugin, Copyright 2017 Alexufo[http://habrahabr.ru/users/alexufo/]
200"Youtube SpeedLoad" WordPress Plugin is distributed under the terms of the GNU GPL v2
201*/
202(function(){
203    var f = document.querySelectorAll(".video-click");
204    for (var i = 0; i < f.length; ++i) {
205      f[i].onclick = function () {
206        var iframe = this.getAttribute("data-iframe");
207        this.parentElement.innerHTML = '<div class="video">' + iframe + '</div>';
208      }
209    }
210})();
211

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.