PageSourceSearch

https://www.imotonowifi.jp/js/common.js?version20190415

js imotonowifi.jp collected 2026-10-02 07:52:53 UTC 5,774 bytes, 225 lines download raw bytes

1//タブ
2var tabbuilt = false;//起動時処理フラグ
3function tab(tab_group_classname,target_element_name,btn_element){
4	var be = $(btn_element);
5	if($(btn_element)[0].tagName=="SELECT"){
6		if(!be.hasClass('selected') || tabbuilt == false){
7	    $(tab_group_classname).each(function(index, el) {
8	      $(this).removeClass('selected');
9	    });
10	    $(tab_group_classname+target_element_name).each(function(index, el) {
11	      $(this).addClass('selected');
12	    });
13
14	    tabbuilt = true;
15	  }
16	}else{
17		if(!be.hasClass('selected') || tabbuilt == false){
18	    var tmpvisible = be.closest('.tab').find("a.selected");
19	    be.closest('.tab').find("a.selected").removeClass('selected white');
20	    be.addClass('selected white');
21
22	    $(tab_group_classname).each(function(index, el) {
23	      $(this).removeClass('selected');
24	    });
25	    $(tab_group_classname+target_element_name).each(function(index, el) {
26	      $(this).addClass('selected');
27	    });
28
29	    tabbuilt = true;
30	  }
31	  return false;
32	}
33
34}
35
36function tabinit(){
37  $('.tab a.selected').each(function(index, el) {
38    if(!$(this).hasClass('white')){
39      $(this).addClass('white');
40    }
41    $(this).click();
42  });
43	$('select.tab option:selected').each(function(index, el) {
44    $(this).change();
45  });
46}
47
48//モーダル
49function modal(elementname){
50  var e = $(elementname);
51  if(e.is(':visible')){
52    e.fadeOut('fast');
53  }else{
54    e.fadeIn();
55  }
56}
57
58// 高さを揃える
59var mhArray=[];
60
61function IsExists(array, value) {
62  for (var i =0, len = array.length; i < len; i++) {
63    if (value == array[i]) {
64      return true;
65    }
66  }
67  return false;
68}
69
70function PushArray(array, value) {
71  if(!IsExists(array, value)) {
72    array.push(value);
73  }
74  return true;
75}
76
77function matchHeight(classname){
78  PushArray(mhArray, classname);
79  var mheight=0;
80  obj=$(classname);
81  if(obj.width()<window.innerWidth*0.51 && obj.is(':visible')){
82		obj.each(function(){
83      $(this).css('min-height','');
84    });
85    obj.each(function(){
86      if($(this).height() > mheight) { mheight = $(this).height(); }
87    });
88    obj.each(function(){
89      $(this).css('min-height',mheight+'px');
90      $(this).addClass('mheight');
91    });
92  }
93}
94
95//3桁区切り
96function addFigure(str) {
97    var num = new String(str).replace(/,/g, "");
98    while(num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2")));
99    return num;
100}
101
102// 1桁の数字を0埋めで2桁にする
103function toDoubleDigits(num) {
104  num += "";
105  if (num.length === 1) {
106    num = "0" + num;
107  }
108 return num;
109}
110
111// 画面遷移
112function transition(path, params, method = 'post') {
113  const form = document.createElement('form');
114  form.method = method;
115  form.action = path;
116  for (const key in params) {
117      if (params.hasOwnProperty(key)) {
118          const hiddenField = document.createElement('input');
119          hiddenField.type = 'hidden';
120          hiddenField.name = key;
121          hiddenField.value = params[key];
122          form.appendChild(hiddenField);
123      }
124  }
125  document.body.appendChild(form);
126  form.submit();
127}
128
129var Pushnate = Pushnate || [];
130
131$(function() {
132	// スムーススクロール
133  $('a[href^=#]').click(function() {
134		if($(this).attr('href')=='#'||$(this).hasClass('disabled')){
135      return false;
136    }
137    // アンカーの値取得
138    var href= $(this).attr("href");
139    // 移動先を取得
140    var target = $(href == "#" || href == "" ? 'html' : href);
141    sScroll(target);
142    return false;
143  });
144
145  // <a href=""><a href="#"><a class="disbled"> の挙動を無効に
146  $('a, map area').click(function() {
147    if($(this).attr('href')==''||$(this).attr('href')=='#'||$(this).attr('href')==undefined||$(this).hasClass('disabled')){
148      return false;
149    }
150  });
151
152  // アコーディオンリスト
153  $('main article dl.accordion-list dt').click(function(){
154    if($(this).hasClass('open')){
155      $(this).removeClass('open');
156      $(this).next().slideUp('fast');
157    }else{
158      $(this).addClass('open');
159      $(this).next().slideDown('fast');
160    }
161  });
162
163	//モーダル背景
164	$(".modal").click(function() {
165		$(this).find('a.modalclose').click();
166	});
167
168	//たたむ
169	$('.odetail').click(function(){
170		if($(this).children().hasClass('arrow-d')){
171			$(this).next('.tdetail').stop().slideDown('200');
172			var e=$(this).find('.arrow-d');
173			$(e).removeClass('arrow-d');
174			$(e).addClass('arrow-u');
175		}else if($(this).children().hasClass('arrow-u')){
176			$(this).next('.tdetail').stop().slideUp('200');
177			var e=$(this).find('.arrow-u');
178			$(e).addClass('arrow-d');
179			$(e).removeClass('arrow-u');
180		}
181		return false;
182	});
183
184  tabinit();
185
186  $(window).resize(function() {
187    $('.mheight').each(function(){
188      $(this).css('height','');
189    });
190    for(i=0; i<mhArray.length; i++){
191      matchHeight(mhArray[i]);
192    }
193  });
194
195  //PUSH通知
196  $('#pushnate .btn-unregister').hide();
197
198  Pushnate.push(["userStatus", function() { // ユーザのステータスを取得
199    $('#pushnate .btn-register').hide();
200    $('#pushnate .btn-unregister').show();
201  }, function() {
202    $('#pushnate .btn-register').show();
203    $('#pushnate .btn-unregister').hide();
204  }]);
205
206  $('#pushnate .btn-register').on('click', function() { // プッシュ通知を有効化
207    Pushnate.push(["init", { path: "/", site_id: "333c7c2404ae99f8cf1d29e7f2e0d640" }]);
208    $('#pushnate .btn-register').hide();
209    $('#pushnate .btn-unregister').show();
210    alert("プッシュ通知を設定しました");
211    return false;
212  });
213
214  $('#pushnate .btn-unregister').on('click', function() { // プッシュ通知を無効化
215    Pushnate.push(["unregister", function() {
216    }]);
217    $('#pushnate .btn-register').show();
218    $('#pushnate .btn-unregister').hide();
219    alert("プッシュ通知を解除しました");
220    return false;
221  });
222
223});
224
225

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.