PageSourceSearch

https://www.nakijin.jp/theme/base/s-admin/js/top.js

js nakijin.jp collected 2026-10-02 06:57:40 UTC 9,882 bytes, 214 lines download raw bytes

1$(function(){
2
3  //画像リンクタブ
4  // $.fn.imgTab({defaultSelect:0,cookie:'top-tab',tabs:$("#top-tab .list a"),pages:$("#top-tab .box")});
5
6  // テキストタブ
7  $.fn.textTab({defaultSelect:0,cookie:'topTab2',tabs:$("#top-tab .list li"),pages:$("#top-tab .box")});
8
9  // スライダー設定
10  var bxslidTourist, bxslidTouristTopics;
11  setSlider();
12
13  $(window).resize(function() {
14    if(bxslidTourist != null){ bxslidTourist.destroySlider(); }
15    if(bxslidTouristTopics != null){ bxslidTouristTopics.destroySlider(); }
16    setSlider();
17  });
18
19  function setSlider() {
20    if (window.innerWidth > 768) {
21    // PC
22      // 観光情報
23      if ($('.bxslider-tourist > li').length > 0) {
24        bxslidTourist = $('.bxslider-tourist').bxSlider({
25          auto: true
26          ,autoControls: true
27          ,speed:1000
28          ,pause:5000
29          ,maxSlides: 1
30          ,minSlides: 1
31          ,moveSlides: 1
32          ,slideMargin:0
33          ,autoControlsCombine: true
34          ,captions: false
35          ,nextSelector: '.tourist-slide-next'
36          ,prevSelector: '.tourist-slide-back'
37          ,onSliderLoad:function(currentIndex){
38          }
39        });
40      }
41
42      // 観光情報トピックス
43      if ($('.bxslider-tourist-topics > li').length > 0) {
44        bxslidTouristTopics = $('.bxslider-tourist-topics').bxSlider({
45          auto: true
46          ,autoControls: true
47          ,speed:1000
48          ,pause:5000
49          ,slideWidth: 232
50          ,maxSlides: 4
51          ,minSlides: 1
52          ,moveSlides: 1
53          ,slideMargin:24
54          ,autoControlsCombine: true
55          ,captions: false
56          ,nextSelector: '.tourist-topics-slide-next'
57          ,prevSelector: '.tourist-topics-slide-back'
58          ,onSliderLoad:function(currentIndex){
59          }
60        });
61      }
62    } else {
63    // SP
64      // 観光情報
65      if ($('.bxslider-tourist > li').length > 0) {
66        bxslidTourist = $('.bxslider-tourist').bxSlider({
67          auto: true
68          ,autoControls: true
69          ,speed:1000
70          ,pause:5000
71          ,maxSlides: 1
72          ,minSlides: 1
73          ,moveSlides: 1
74          ,slideMargin:0
75          ,autoControlsCombine: true
76          ,captions: false
77          ,nextSelector: '.tourist-slide-next'
78          ,prevSelector: '.tourist-slide-back'
79          ,onSliderLoad:function(currentIndex){
80          }
81        });
82      }
83
84      // 観光情報トピックス
85      if ($('.bxslider-tourist-topics > li').length > 0) {
86        bxslidTouristTopics = $('.bxslider-tourist-topics').bxSlider({
87          auto: true
88          ,autoControls: true
89          ,speed:1000
90          ,pause:5000
91          ,slideWidth: 282
92          ,maxSlides: 4
93          ,minSlides: 1
94          ,moveSlides: 1
95          ,slideMargin:36
96          ,autoControlsCombine: true
97          ,captions: false
98          ,nextSelector: '.tourist-topics-slide-next'
99          ,prevSelector: '.tourist-topics-slide-back'
100          ,onSliderLoad:function(currentIndex){
101          }
102        });
103      }
104    }
105  }
106
107  /*! npm.im/object-fit-images 3.2.3 */
108  var objectFitImages=function(){"use strict";function t(t,e){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='"+t+"' height='"+e+"'%3E%3C/svg%3E"}function e(t){if(t.srcset&&!m&&window.picturefill){var e=window.picturefill._;t[e.ns]&&t[e.ns].evaled||e.fillImg(t,{reselect:!0}),t[e.ns].curSrc||(t[e.ns].supported=!1,e.fillImg(t,{reselect:!0})),t.currentSrc=t[e.ns].curSrc||t.src}}function i(t){for(var e,i=getComputedStyle(t).fontFamily,r={};null!==(e=l.exec(i));)r[e[1]]=e[2];return r}function r(e,i,r){var n=t(i||1,r||0);p.call(e,"src")!==n&&b.call(e,"src",n)}function n(t,e){t.naturalWidth?e(t):setTimeout(n,100,t,e)}function c(t){var c=i(t),o=t[a];if(c["object-fit"]=c["object-fit"]||"fill",!o.img){if("fill"===c["object-fit"])return;if(!o.skipTest&&g&&!c["object-position"])return}if(!o.img){o.img=new Image(t.width,t.height),o.img.srcset=p.call(t,"data-ofi-srcset")||t.srcset,o.img.src=p.call(t,"data-ofi-src")||t.src,b.call(t,"data-ofi-src",t.src),t.srcset&&b.call(t,"data-ofi-srcset",t.srcset),r(t,t.naturalWi
108dth||t.width,t.naturalHeight||t.height),t.srcset&&(t.srcset="");try{s(t)}catch(t){window.console&&console.warn("https://bit.ly/ofi-old-browser")}}e(o.img),t.style.backgroundImage='url("'+(o.img.currentSrc||o.img.src).replace(/"/g,'\\"')+'")',t.style.backgroundPosition=c["object-position"]||"center",t.style.backgroundRepeat="no-repeat",t.style.backgroundOrigin="content-box",/scale-down/.test(c["object-fit"])?n(o.img,function(){o.img.naturalWidth>t.width||o.img.naturalHeight>t.height?t.style.backgroundSize="contain":t.style.backgroundSize="auto"}):t.style.backgroundSize=c["object-fit"].replace("none","auto").replace("fill","100% 100%"),n(o.img,function(e){r(t,e.naturalWidth,e.naturalHeight)})}function s(t){var e={get:function(e){return t[a].img[e||"src"]},set:function(e,i){return t[a].img[i||"src"]=e,b.call(t,"data-ofi-"+i,e),c(t),e}};Object.defineProperty(t,"src",e),Object.defineProperty(t,"currentSrc",{get:function(){return e.get("currentSrc")}}),Object.defineProperty(t,"srcset",{get:function(){return e.get("srcset")},set:function(t){return e.set(t,"srcset")}})}function o(t,e){var i=!h&&!t;if(e=e||{},t=t||"img",f&&!e.skipTest||!d)return!1;"img"===t?t=document.getElementsByTagName("img"):"string"==typeof t?t=document.querySelectorAll(t):"length"in t||(t=[t]);for(var r=0;r<t.length;r++)t[r][a]=t[r][a]||{skipTest:e.skipTest},c(t[r]);i&&(document.body.addEventListener("load",function(t){"IMG"===t.target.tagName&&o(t.target,{skipTest:e.skipTest})},!0),h=!0,t="img"),e.watchMQ&&window.addEventListener("resize",o.bind(null,t,{skipTest:e.skipTest}))}var a="bfred-it:object-fit-images",l=/(object-fit|object-position)\s*:\s*([-\w\s%]+)/g,u="undefined"==typeof Image?{style:{"object-position":1}}:new Image,g="object-fit"in u.style,f="object-position"in u.style,d="background-size"in u.style,m="string"==typeof u.currentSrc,p=u.getAttribute,b=u.setAttribute,h=!1;return o.supportsObjectFit=g,o.supportsObjectPosition=f,function(){function t(t,e){return t[a]&&t[a].img&&("src"===e||"srcset"===e)?t[a].img:t}f||(HTMLImageElement.prototype.getAttribute=function(e){return p.call(t(this,e),e)},HTMLImageElement.prototype.setAttribute=function(e,i){return b.call(t(this,e),e,String(i))})}(),o}();
109  objectFitImages('.top-img img');
110
111  // 文字サイズ変更監視
112  $.fn.fontSizeChange({func:function(){
113    $('.alert-area > .in').css('paddingTop', $('.title-wrap').height() - 8);
114  }});
115
116  //トップスライダーのキャプション 36文字以上は...になる
117
118
119   var renkei_no = 1 //連携設定No
120  var external_rss_path = externalRssPath(renkei_no);
121  $('#smart-alert-area').smartAlertListView({
122    rssPath: external_rss_path,
123    historyPath: site_domain + '/cgi-bin/smart_alert.php/' + renkei_no +'/list',
124    historyClass: '.more',
125    ulClass: '.list',
126    textClass: '.txt',
127    dateClass: '.date',
128    limit: 10, //最大表示数
129    dateformat: 'YYYY年M月D日 hh時mm分', //YYYY年MM月DD日(WW) hh時mm分ss秒
130    noDataView: 0, //アラートが無い場合 0:エリアごと非表示 1:エリアは表示
131    noDataClass: '.no-data', //アラートが無い場合の文言クラス
132  });
133
134
135  function externalRssPath (renkei_no) {
136    if (site_domain.includes('https://www45.dev.smartcms.smart-lgov.jp/')) {
137      return site_domain + '/smartalert.json'; // 確認用
138    } else {
139      var _sd = site_domain.replace(/^https?:/g, document.location.protocol);
140      return _sd + '/cgi-bin/smart_alert.php/' + renkei_no;
141    }
142  }
143  
144  // var $setElm = $('.bx-caption span');
145  // var cutFigure = '36'; // カットする文字数
146  // var afterTxt = ' …'; // 文字カット後に表示するテキスト
147
148  // $setElm.each(function(){
149  //   var textLength = $(this).text().length;
150  //   var textTrim = $(this).text().substr(0,(cutFigure))
151
152  //   if(cutFigure < textLength) {
153  //     $(this).html(textTrim + afterTxt).css({visibility:'visible'});
154  //   } else if(cutFigure >= textLength) {
155  //     $(this).css({visibility:'visible'});
156  //   }
157  // });
158
159  // 分離版
160  //PC・スマホ切り替え
161  // MutualSwitching.config.setPathSettings({
162  //   "/": {
163  //     "pc_width": 1024,
164  //     "sp_width": 720,
165  //     "layout_type": 1
166  //   }
167  // }
167).setViewPcBySp().setExistsSpPage(is_smartphone);
168  // MutualSwitching.run.ready();
169   
170  // //sp.htmlを見ている時に、pcフラグがたっていたら、スマホフラグに変える
171  // if(typeof isPcPage != "undefined"){
172   
173  //   if(isPcPage){
174   
175  //     var linkPath;
176  //     var replacePath;
177   
178  //     var link_top = $("LINK[href$='/top.css']");
179  //     var regex_top = new RegExp('(^.*)\/(top\.css)');
180   
181  //     if (link_top.length) {
182  //       var sp_style = link_top.attr('href');
183  //       replaceClass = sp_style.replace(regex_top,'$1'+'/sp_'+'$2');
184  //       link_top.attr("href", replaceClass);
185  //     }
186  //   }
187  // } 
188
189});
190
191
192// 分離版
193//PC・スマホ切り替え
194// $(window).on('load', function(){
195//   //sp.htmlを見ている時に、pcフラグがたっていたら、スマホフラグに変える
196//   if(typeof isPcPage != "undefined"){
197 
198//     if(isPcPage){
199 
200//       var linkPath;
201//       var replacePath;
202 
203//       var link_top = $("LINK[href$='/top.css']");
204//       var regex_top = new RegExp('(^.*)\/(top\.css)');
205 
206//       if (link_top.length) {
207//         var sp_style = link_top.attr('href');
208//         replaceClass = sp_style.replace(regex_top,'$1'+'/sp_'+'$2');
209//         link_top.attr("href", replaceClass);
210//       }
211//     }
212//   }
213 
214// });

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.