PageSourceSearch

https://omagari-naika.jp/wp-content/themes/theme/js/add51.js?ver=bd993556a675634f3384554469802797

js omagari-naika.jp collected 2026-10-06 08:08:22 UTC 7,427 bytes, 240 lines download raw bytes

1$(function(){
2  //h1文字サイズ調整
3  $(".h1_text").each(function() {
4    var h1_len = $(this).html();
5    if(h1_len.length > 12){
6      $(this).addClass("small");
7    }
8  });
9
10  //ヘッダー地図へのリンク
11  $('.header_address').each(function() {
12    var txt = $(this).html();
13    $(this).html(txt.replace(/\[/g, '').replace(/\]/g, ''));
14  });
15
16  //ヘッダー診療時間のリンク
17  $('.header_week').each(function(){
18    var txt = $(this).html();
19    $(this).html(txt.replace(/診療時間はこちら/g,'診療時間'));
20  });
21
22  //ヘッダーTEL並び替え
23  $(".header_tel").insertAfter(".header_week");
24
25  //サイト内検索
26  $("#searchform").insertAfter("#nav");
27  $('#searchsubmit').attr('src','https://wevery.jp/wp-content/uploads/2019/05/icon_find.png');
28
29  //メインスライド並び替え
30  $('#images').insertBefore('#contents');
31
32  //gNavの固定
33  var _window = $(window),
34    _header = $('#gNav'),
35    headerBottom;
36
37  _window.on('scroll',function(){
38    headerBottom = $('#header').height();
39    if(_window.scrollTop() > headerBottom &&  _header.hasClass('is-fixed') == false){
40      _header.css({"top": '-100px'});
41      _header.addClass('is-fixed');
42      _header.animate({"top": 0},600);
43    }
44    else if(_window.scrollTop() < headerBottom &&  _header.hasClass('is-fixed') == true){
45      _header.removeClass('is-fixed');
46    }
47  });
48
49  _window.trigger('scroll');
50
51  //お知らせの日時変更
52  $('.info_date').each(function(){
53    var txt = $(this).html();
54    $(this).html(txt.replace(/\[/g,'').replace(/]/g,'').replace(/更新/g,'').replace(/ /g,''));
55  });
56
57  $('.info_date').each(function(){
58    var txt = $(this).html();
59    $(this).html(txt.replace(/ /g,''));
60    var change = $(this).html(txt.replace(/ /g,''));
61    var chart = change.html().split(".");
62    change.html(chart[0] + '年' + chart[1] + '月' + chart[2] + '日');
63  });
64
65  //トップに戻るボタン
66  $('.pagetop').each(function(){
67    var txt = $(this).html();
68    $(this).html(txt.replace(/\▲ ページのトップに戻る/g,'<i class="material-icons">expand_less</i>'));
69  });
70
71  var topBtn = $('.pagetop');
72  topBtn.hide();
73
74  //スクロールが100に達したらボタン表示
75  $(window).scroll(function () {
76    if ($(this).scrollTop() > 100) {
77      topBtn.fadeIn();
78    } else {
79      topBtn.fadeOut();
80    }
81  });
82
83  //スクロールしてトップ
84  topBtn.on('click', function () {
85    $('body,html').animate({
86      scrollTop: 0
87    }, 500);
88    return false;
89  });
90
91  //地図ボタンにアイコン搭載
92  $('.mapSec_tomappage').each(function(){
93    var txt = $(this).html();
94    $(this).html(
95      txt.replace(/大きい地図はこちら/g,'<i class="material-icons">location_on</i> 大きい地図はこちら'));
96  });
97
98  //スマホのメニューアイコン
99  $('#mobile a').each(function(){
100    var txt = $(this).html();
101    $(this).html(
102      txt.replace(/<img .*?src="(.*?)".*?>/g,'<i class="material-icons">menu</i>'));
103  });
104
105  //テーブルスクロール
106  $('table').wrap('<div class="scroll-table" />');
107});
108
109//以下まとめてfunction
110$(function(){
111  var headerWeek = $('.header_week p');
112  if (headerWeek.length != 0) {
113    headerWeek.html(headerWeek.html().replace(/\<br\>/gi,''));
114    headerWeek.find('i').appendTo(headerWeek.find('a'));
115  }
116
117  for(var i = 0; i < $('.flexslider .slides .ms-image').length; i++){
118    $('.flexslider .slides .ms-image').append($('.caption-wrap').eq(i).val());
119  }
120
121  $('#menu-main_menu').before('<div class="menu-side_top"></div>');
122
123  $('#footer').append($('#footer .address'));
124
125  // safariだと上手くハンバーガメニューが動作しないため、クリックイベントの指定方法を変更
126  $(document).on('click', '#mobile', function() {
127    if ($(this).hasClass('side-open')) {
128      $(this).delay(300).queue(function() {
129        $(this).removeClass('side-open').dequeue();
130        $('#header .header_tel').removeClass('side-open').dequeue();
131      });
132    } else {
133      $(this).addClass('side-open');
134      $('#header .header_tel').addClass('side-open');
135      $('body').css({'overflow':'hidden','height':'100vh','position':''});
136    }
137  });
138
139  $('#sidr .close').on('click', function() {
140    if ($('#mobile').hasClass('side-open')) {
141      $('#mobile').delay(300).queue(function() {
142        $('#mobile').removeClass('side-open').dequeue();
143        $('#header .header_tel').removeClass('side-open').dequeue();
144        $('body').css({'overflow':'','height':''});
145      });
146    }
147  });
148
149  $('#sidr .menu_box h2').on('click', function() {
150    $(this).toggleClass('active').next().slideToggle(400);
151  });
152
153  $('#sidr ul#menu-main_menu > li').each(function(index, element){
154    if ($(this).find('.sub-menu').length > 0) {
155      $(this).children('a').after('<div class="accordion-elm"><i class="material-icons">add</i></div>');
156    }
157  });
158
159  $('#sidr ul#menu-main_menu > li .accordion-elm').on('click', function() {
160    $(this).toggleClass('active').next().slideToggle(400);
161  });
162});
163//まとめてfunctionここまで
164
165//detailsをIEに対応させる
166window.onload = function(){
167  void (function (root, factory) {
168    if (typeof define === 'function' && define.amd) define(factory)
169    else if (typeof exports === 'object') module.exports = factory()
170    else factory()
171  }(this, function () {
172    var DETAILS = 'details'
173    var SUMMARY = 'summary'
174
175    var supported = checkSupport()
176    if (supported) return
177
178    // Add a classname
179    document.documentElement.className += ' no-details'
180
181    window.addEventListener('click', clickHandler)
182
183    injectStyle('details-polyfill-style',
184      'html.no-details ' + DETAILS + ':not([open]) > :not(' + SUMMARY + ') { display: none; }\n' +
185      'html.no-details ' + DETAILS + ' > ' + SUMMARY + ':before { content: "\u25b6"; display: inline-block; font-size: .8em; width: 1.5em; }\n' +
186      'html.no-details ' + DETAILS + '[open] > ' + SUMMARY + ':before { content: "\u25bc"; }')
187
188    /*
189    * Click handler for `<summary>` tags
190    */
191
192    function clickHandler (e) {
193      if (e.target.nodeName.toLowerCase() === 'summary') {
194        var details = e.target.parentNode
vendor: 1,079 bytes, lines 195-240
195        if (!details) return
196
197        if (details.getAttribute('open')) {
198          details.open = false
199          details.removeAttribute('open')
200        } else {
201          details.open = true
202          details.setAttribute('open', 'open')
203        }
204      }
205    }
206
207    /*
208    * Checks for support for `<details>`
209    */
210
211    function checkSupport () {
212      var el = document.createElement(DETAILS)
213      if (!('open' in el)) return false
214
215      el.innerHTML = '<' + SUMMARY + '>a</' + SUMMARY + '>b'
216      document.body.appendChild(el)
217
218      var diff = el.offsetHeight
219      el.open = true
220      var result = (diff != el.offsetHeight)
221
222      document.body.removeChild(el)
223      return result
224    }
225
226    /*
227    * Injects styles (idempotent)
228    */
229
230    function injectStyle (id, style) {
231      if (document.getElementById(id)) return
232
233      var el = document.createElement('style')
234      el.id = id
235      el.innerHTML = style
236
237      document.getElementsByTagName('head')[0].appendChild(el)
238    }
239  }))
240}; // eslint-disable-line semi

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.