1// JavaScript Document 2// 管çç»é¢ã§ã¯ã$ã¯jQueryã§ãªãã¨ã¨ã©ã¼ãåºãã 3//jQuery(function() { 4window.addEventListener('DOMContentLoaded', function() { 5 var bln_click_num = 0; //ãã«ã¼ã³ã¯ãªãã¯ãã§ãã¯ç¨ 2015.05.13追å 6 var player; //Youtube Player 2015.5.21追å 7 var ua = navigator.userAgent; 8 9 if ((ua.indexOf('iPhone') > -1 10 || (ua.indexOf('Android') > -1 11 && ua.indexOf('Mobile') > -1)) 12 && window.innerWidth >= 481) { 13 Object.defineProperty(navigator, 'userAgent', { 14 get: function () { return 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'; } 15 }); 16 } 17 18 //ç·¨éã®ç¯å²ã表示ãã 19 jQuery(".edit_link").on('mouseover', function(){ 20 jQuery(this).parent().css({ 21 'cssText': 'border: 2px #F00 dashed !important; box-sizing: border-box;' 22 }); 23 }); 24 25 jQuery(".edit_link").on('mouseout', function(){ 26 jQuery(this).parent().css({ 27 'cssText': 'border: none;' 28 }); 29 }); 30 31 jQuery(".edit_link_h").on('mouseover', function(){ 32 jQuery(this).parent().css({ 33 'cssText': 'border: 2px #F00 dashed !important; box-sizing: border-box;' 34 }); 35 }); 36 37 jQuery(".edit_link_h").on('mouseout', function(){ 38 jQuery(this).parent().css({ 39 'cssText': 'border: none;' 40 }); 41 }); 42 43 jQuery(".edit_link_s").on('mouseover', function(){ 44 jQuery(this).parent().css({ 45 'cssText': 'border: 2px #F00 dashed !important; box-sizing: border-box;' 46 }); 47 }); 48 49 jQuery(".edit_link_s").on('mouseout', function(){ 50 $(this).parent().css({ 51 'cssText': 'border: none;' 52 }); 53 }); 54 55 //説æç¨ãã«ã¼ã³ã®è¡¨ç¤º 2015.05.13追å 56 if(jQuery("input[name='assist']").val()==1) { 57 bln_click_num = 0; 58 59 //A 60 jQuery("#wpadminbar").append("<div id='bln_manual' class='balloon topright_balloon'>æä½ã«é¢ããããã¥ã¢ã«ã¯ãã¡ãã®ç¹è¨ãµã¤ãããæ´»ç¨ãã ããã<img class='ico_close' src='wp-content/themes/theme/img/ico_close.png' /></div><div class='clear_balloon'></div>"); 61 //B 62 jQuery("#gNav.editover").append("<div id='bln_navi' class='balloon topright_balloon'>ä¿®æ£ããããã¼ã¸ã«é£ãã§ããã ããã¿ã¤ãã«ãã«ãã¦ã¹ãã¤ã³ã¿ããã¦ãã¨ãç·¨éããã«ãåºç¾ããä¿®æ£ãã§ãã¾ãã<img class='ico_close' src='wp-content/themes/theme/img/ico_close.png' /></div><div class='clear_balloon'></div>"); 63 //C 64 jQuery("#wpadminbar").append("<div id='bln_icon' class='balloon topleft_balloon'>ãã®ã¢ã¤ã³ã³ãã¯ãªãã¯ããã¨ã管çãã¼ã¸ã«ã¸ã£ã³ããã¾ããã¢ã¯ã»ã¹ã®ååãæ°è¦ã®ãã¼ã¸è¿½å ãªã©ãã§ãã¾ãã<img class='ico_close' src='wp-content/themes/theme/img/ico_close.png' /></div><div class='clear_balloon'></div>"); 65 66 jQuery(".infoSec.editover").append("<div class='balloon blnpos_middle left_balloon'>ãã°ã¤ã³ç¶æ ã§ç·¨éããããã¨ãªã¢ã®ã¿ã¤ãã«ã«ãã¦ã¹ãã¤ã³ã¿ããã¦ãã¨ãç·¨éãã¼ãåºç¾ã追å ã»ä¿®æ£ãã§ãã¾ã<img class='ico_close' src='wp-content/themes/theme/img/ico_close.png' /></div><div class='clear_balloon'></div>"); 67 //説æç¨ãã«ã¼ã³ã®æ¶å» 68 jQuery(".balloon").on('click', function(){ 69 $(this).fadeOut("slow"); 70 checkBalloon(); 71 }); 72 } 73 74 /**** 管çç»é¢è¡¨ç¤ºã³ã³ããã¼ã« ****/ //2015.04.01追å 75 url = location.href; 76 filename = url.match(".+/(.+?)([\?#;].*)?$")[1]; 77 param = GetQueryString(); 78 79 //Contact Par Dayã®ã¿ã¤ãã«å¤æ´ 80 if(jQuery('#cpd-metaboxes h2')) { 81 objImg = jQuery('#cpd-metaboxes h2 img'); 82 83 //2019.12.11 change start 84 //jQuery('#cpd-metaboxes h2').text(''); 85 //jQuery('#cpd-metaboxes h2').append(objImg); 86 //jQuery('#cpd-metaboxes h2').append(' ã¢ã¯ã»ã¹ç¶æ³'); 87 objCpdTitle = jQuery('#cpd-metaboxes h2').first(); 88 objCpdTitle.text(''); 89 objCpdTitle.append(objImg); 90 objCpdTitle.append(' ã¢ã¯ã»ã¹ç¶æ³'); 91 //2019.12.11 change end 92 } 93 94 //診çæéã®è¡¨ãªã¹ãã¡ãã¥ã¼å¤æ´ 2015.4.30追å 95 if(jQuery('.column-table_name .row-actions')) { 96 jQuery('.column-table_name .row-actions .copy').css("display", "none"); 97 jQuery('.column-table_name .row-actions .delete').css("display", "none"); 98 } 99 //診çæéã®è¡¨ã¿ã¤ãã«å¤æ´ 100 if(jQuery('#tablepress-nav')) { 101 // 2019.12.11 change 102 // jQuery('#tablepress-nav').text('診çæéã®è¡¨'); 103 jQuery('#tablepress-nav').html('<h1>診çæéã®è¡¨</h1>'); 104 } 105 //診çæéã®è¡¨ããããï¼ï¼ã¢ãããã¼ãæ å ±ï¼ï¼æ¶ã 106 if(jQuery('#tablepress-page') && jQuery('.updated')) { 107 jQuery('.updated').css('display', 'none'); 108 } 109 //2019.12.11 add start 110 //診çæéã®è¡¨ããããï¼ï¼ã¢ãããã¼ãæ å ±ï¼ï¼æ¶ã 111 if(jQuery('#tablepress-page') && jQuery('.notice')) { 112 jQuery('.notice').css('display', 'none'); 113 } 114 //2019.12.11 add end 115 //診çæéã®è¡¨ãã¼ãã«æ å ±æ¶ã 2015.5.8追å 116 if(jQuery('#tablepress_edit-table-information')) { 117 jQuery('#tablepress_edit-table-information').css('display', 'none'); 118 } 119 //診çæéèª¬æææ¶ã 120 if(jQuery('#postbox-container-2')) { 121 jQuery('#postbox-container-2 p:eq(0)').css("display", "none"); 122 jQuery('#postbox-container-2 p:eq(1)').css("display", "none"); 123 jQuery('#tablepress_edit-table-options').css("display", "none"); 124 jQuery('#tablepress_edit-datatables-features').css("display", "none"); 125 jQuery('#postbox-container-2 p.submit:last').css("display", "none"); // 2015.4.30追å 126 } 127 128 //2018.04.18 add 129 //simple Map , Duplicate Post ã®è¦åã表示ããã¦ãã¾ãããã䏿çã«è¡¨ç¤ºï¼æ«å®å¯¾å¿ï¼ 130 if(jQuery('.is-dismissible')) { 131 jQuery('.is-dismissible').css("display", "none"); 132 } 133 134 //ã¡ãã¥ã¼ç·¨éã®ãä½ç½®ã®ç®¡çãæ¶ã 135 if(filename == 'nav-menus.php') { 136 jQuery('h2.nav-tab-wrapper .nav-tab:eq(1)').css("display", "none"); 137 138 //2018.08.13 add 139 //ããªã³ã¯ãæ°ã¦ã£ã³ãã¦ã¾ãã¯ã¿ãã§éããã®ãã§ãã¯ããã¯ã¹ã表示ããã 140 jQuery('p.field-link-target').removeClass("hidden-field"); 141 142 setManualNavMenu(); //2015.05.13追å 143 } 144 145 //ã¡ãã¥ã¼ç·¨éç»é¢ã«ããã¥ã¢ã«ã®ãªã³ã¯ã追å 2015.05.13追å 146 function setManualNavMenu() { 147 strMetaBox = '<div id="manual_meta_post_page" class="postbox" style="margin-top: 15px;" >\n'; 148 strMetaBox = strMetaBox + '<div class="handlediv" title="ã¯ãªãã¯ã§åæ¿"><br /></div>\n'; 149 strMetaBox = strMetaBox + '<h3 class="hndle"><span>ãã®ç»é¢ã®æä½æ¹æ³</span></h3>\n'; 150 strMetaBox = strMetaBox + '<div class="inside">\n'; 151 strMetaBox = strMetaBox + '<ul>\n'; 152 //ããã¥ã¢ã«ã¯ããã追å âââ 153 strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=152" target="_blank">ã¡ãã¥ã¼ãããã¼ã¸ãåé¤ãã</a></li>\n'; 154 strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=68" target="_blank">æ°ããã¡ãã¥ã¼ãä½ã</a></li>\n'; 155 strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=62" target="_blank">ãµã¤ãã¡ãã¥ã¼ã®ä¸¦ã³é ã夿´ãã</a></li>\n'; 156 strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=60" target="_blank">ã¡ãã¥ã¼ã®é ç®ã®ä¸¦ã³é ã夿´ãã</a></li>\n'; 157 strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=51" target="_blank">ã¡ãã¥ã¼ã«ãã¼ã¸ã追å ãã</a></li>\n'; 158 //ããã¥ã¢ã«ã¯ããã追å âââ 159 strMetaBox = strMetaBox + '</ul>\n'; 160 strMetaBox = strMetaBox + '</div>\n'; 161 strMetaBox = strMetaBox + '</div>\n'; 162 163 jQuery('#menu-settings-column').append(strMetaBox); 164 } 165 166 jQuery("#mf_3").css("display", "none"); 167 jQuery("#list_display_method").insertAfter("#expirationdatediv"); 168 169 // ããããã¼ã¸å 容編éã®Magic Fieldãã¿ã¤ãã«ä¸ã«è¡¨ç¤ºãã 170 if(jQuery( '#mf_4' )) { 171 jQuery( '#mf_4' ).insertBefore( '#edit-slug-box' ); 172 jQuery( '#mf_4 .hndle' ).css( 'height', '0' ); 173 jQuery( '#mf_4 .hndle' ).css( 'display', 'none' ); 174 } 175 176 // ããããã¼ã¸å 容編éã®ã表示ä½ç½®ãã表示æéã®ä¸ã«è¡¨ç¤ºãã 2015.05.11 add 177 if(jQuery( '#mf_5' )) { 178 jQuery( '#mf_5' ).insertBefore( '#expirationdatediv' ); 179 } 180 181 //ãµã¤ãã¡ãã¥ã¼ããã¼ã®MFé ç®æ´å 182 if(jQuery('#mf_1')) { 183 jQuery('#mf_1 .hndle').css('display', 'none'); 184 jQuery('#mf_1 .field-banner_url').css('width', '80%'); 185 jQuery('#mf_1 .field-banner_url .mf-field-title').css('float', 'left'); 186 jQuery('#mf_1 .field-banner_url .mf-field-title').next('.clear').remove(); 187 jQuery('#mf_1 .field-banner_url .text_field_mf').css('float', 'left'); 188 jQuery('#mf_1 .field-banner_url .text_field_mf').css('width', '60%'); 189 jQuery('#mf_1 .field-banner_url .text_field_mf input').css('width', '100%'); 190 jQuery('#mf_1 .field-banner_target').css('position', 'relative'); 191 jQuery('#mf_1 .field-banner_target div:eq(3)').css('position', 'absolute'); 192 jQuery('#mf_1 .field-banner_target div:eq(3)').css('top', '0'); 193 jQuery('#mf_1 .field-banner_target div:eq(3)').css('left', '0'); 194 jQuery('#mf_1 .field-banner_target .mf-field-title').css('padding-left', '30px'); 195 } 196 197 //2018.07.05 add 198 //ãªãã¸ã§ã³(éå»ã®å 容)
199 var revisionText = jQuery(".alignright").children("label").html(); 200 //2019.12.11 change ã¨ã©ã¼åé¿ 201 //if(revisionText){ 202 if(typeof revisionText != "undefined"){ 203 var revisionText = revisionText.replace("ãªãã¸ã§ã³ã³ã³ããã¼ã«:", ""); 204 var revisionText = revisionText.replace(/æå¤§ [0-9]{1,} åã®ãªãã¸ã§ã³ãä¿åãã¾ã/, ""); 205 } 206 jQuery(".alignright").children("label").html(revisionText); 207 208 209 210 if(!param) { return; } 211 212 //管çç»é¢ã§ã®ãã«ã¼ã³æ¶ã 2015.05.13追å 213 if(param['page'] == 'wevery-admin-menu/wv.php') { 214 jQuery('.balloon').css('display', 'none'); 215 } 216 217 //Meta Sliderã®è¡¨ç¤ºå¤æ´ã»ã¢ããã°ã¬ã¼ãã»ã½ã¼ã·ã£ã«ã»ãã¹ã©ã¤ãã¼åé¤ãæ¶ã 218 //2018.07.05 change add 219 //åæç»é¢ãããã¯id=133ã®å ´åã¯ãé表示ã«ãã 220 //if(param['page'] == 'metaslider') { 221 // jQuery('#screen-options-link-wrap').text(""); 222 // jQuery('#screen-options-link-wrap').css("border", "none"); 223 // 224 // jQuery('#screen-options-switch-view-wrap').text(""); 225 // jQuery('#screen-options-switch-view-wrap').css("border", "none"); 226 // 227 // jQuery('#metaslider_social').css("display", "none"); 228 // 229 // jQuery('.delete-slider').css("display", "none"); 230 //} 231 if(param['page'] == 'metaslider') { 232 if(!param['id'] || param['id'] == 133){ 233 jQuery('#screen-options-link-wrap').text(""); 234 jQuery('#screen-options-link-wrap').css("border", "none"); 235 236 jQuery('#screen-options-switch-view-wrap').text(""); 237 jQuery('#screen-options-switch-view-wrap').css("border", "none"); 238 239 jQuery('#metaslider_social').css("display", "none"); 240 } 241 //ä½¿ãæ¹ã®PHPã¿ã°è¨è¿°é¨ååé¤ 242 var sliderText = jQuery('pre#ms-entire-code').html(); 243 // 2019.12.11 change start ã¨ã©ã¼åé¿ 244 // sliderText = sliderText.replace("<?php echo do_shortcode('<br>",""); 245 // sliderText = sliderText.replace("'); ?>",""); 246 if(typeof sliderText != "undefined"){ 247 sliderText = sliderText.replace("<?php echo do_shortcode('<br>",""); 248 sliderText = sliderText.replace("'); ?>",""); 249 } 250 // ã¡ã¿ã¹ã©ã¤ãã¼æ°ãã¼ã¸ã§ã³è¦åãé表示 251 jQuery('div.warning').css('display','none'); 252 // 2019.12.11 change end 253 254 jQuery('pre#ms-entire-code').html(sliderText); 255 } 256 257 //2018.07.05 change end 258 259 //Meta Managerã®ããµã¤ãã¯ã¤ãè¨å®ãã»ãã¿ã¯ã½ããã¼è¨å®ãã»Powered byåé¤ 260 //ã¿ã¤ãã«å¤æ´ 261 if(param['page'] == 'meta-manager.php') { 262 jQuery('#wpbody-content h2').text("metaã¿ã°ã®è¨å®"); 263 264 jQuery('#wpbody-content h3:eq(0)').css("display", "none"); 265 jQuery('#wpbody-content h3:eq(2)').css("display", "none"); 266 267 jQuery('#wpbody-content .form-table:eq(1) tr:eq(0)').css("display", "none"); 268 jQuery('#wpbody-content .form-table:eq(2)').css("display", "none"); 269 270 jQuery('#wpbody-content #developper_information').css("display", "none"); 271 } 272 273 //2018.07.05 add 274 //å ±éã¿ã°ã»ããããã¼ã¸ã³ã³ãã³ãç»é¢ã«ãã¡ãã»ã¼ã¸ã追å ãã 275 //2015.05.20 add 276 //ãµã¤ãã¡ãã¥ã¼ããã¼ç»é¢ã¸ã¡ãã»ã¼ã¸è¿½å 277 //if(param['post_type'] == 'side_banner') { 278 if(param['post_type'] == 'side_banner' || param['post_type'] == 'toppage') { 279 jQuery( '<p id=side_msg>ãã©ãã°&ããããã§é çªã®ä¸¦ã³æ¿ããã§ãã¾ãã</p>' ).insertAfter( '.wp-list-table #title a' ); 280 jQuery('#side_msg').css("color", "red"); 281 jQuery('#side_msg').css("margin-top", "-5px"); 282 jQuery('#side_msg').css("margin-bottom", "3px"); 283 jQuery('#side_msg').css("margin-left", "7px"); 284 } 285 286 287 //Ultimate Google Analyticsã®ãCheck for updatesãã»ãEnable trackerãã»ãAdvanced configurationãåé¤ 288 //ã¿ã¤ãã«å¤æ´ 289 regTxt = /ultimate_ga.+/; 290 if(regTxt.test(param['page'])) { 291 jQuery('#wpbody-content h2').text("Googleã¢ããªãã£ã¯ã¹"); 292 objInput = jQuery('input[name="account_id"]'); 293 294 jQuery('.editform tr:eq(0) td').text(""); 295 jQuery('.editform tr:eq(0) td').append(objInput); 296 jQuery('.editform tr:eq(0) td').append("<br />"); 297 //2018.07.05 change 298 //jQuery('.editform tr:eq(0) td').append("Googleã¢ããªãã£ã¯ã¹æ¸¬å®IDã»ã¢ã«ã¦ã³ãIDãå ¥åãã¦ãã ãããåãè¾¼ã¿ã³ã¼ãã¯å¿ è¦ããã¾ããã"); 299 //2021.01.25 change G-ã«ã対å¿
300 //jQuery('.editform tr:eq(0) td').append("UA-ââââââã®å½¢ã§ãGoogleã¢ããªãã£ã¯ã¹æ¸¬å®IDã»ã¢ã«ã¦ã³ãIDãå ¥åãã¦ãã ãããåãè¾¼ã¿ã³ã¼ãã¯å¿ è¦ããã¾ããã"); 301 jQuery('.editform tr:eq(0) td').append("G-âââââãã¾ãã¯ãUA-âââââã®å½¢ã§ãGoogleã¢ããªãã£ã¯ã¹æ¸¬å®IDã»ã¢ã«ã¦ã³ãIDãå ¥åãã¦ãã ãããåãè¾¼ã¿ã³ã¼ãã¯å¿ è¦ããã¾ããã"); 302 jQuery('.editform tr:eq(0) td').append("<br />"); 303 jQuery('.editform tr:eq(0) td').append("â»è¨ç½®æ¹æ³ã«ã¤ãã¦ã¯<a href=\"https://manual.wevery.jp/?p=728\" target=\"_blank\" rel=\"noopener noreferrer\">ãã¡ãã®æä½ããã¥ã¢ã«</a>ãã覧ãã ããã"); 304 } 305 306 //URLãããã©ã¡ã¼ã¿ãåå¾ 307 function GetQueryString() { 308 if (1 < document.location.search.length) { 309 // æåã®1æå (?è¨å·) ãé¤ããæååãåå¾ãã 310 var query = document.location.search.substring(1); 311 312 // ã¯ã¨ãªã®åºåãè¨å· (&) ã§æååãé åã«åå²ãã 313 var parameters = query.split('&'); 314 315 var result = new Object(); 316 for (var i = 0; i < parameters.length; i++) { 317 // ãã©ã¡ã¼ã¿åã¨ãã©ã¡ã¼ã¿å¤ã«åå²ãã 318 var element = parameters[i].split('='); 319 320 var paramName = decodeURIComponent(element[0]); 321 var paramValue = decodeURIComponent(element[1]); 322 323 // ãã©ã¡ã¼ã¿åããã¼ã¨ãã¦é£æ³é åã«è¿½å ãã 324 result[paramName] = decodeURIComponent(paramValue); 325 } 326 return result; 327 } 328 return null; 329 } 330 331 //ãã«ã¼ã³ã®æ¶ããæ°ããã§ã㯠2015.05.13追å 332 function checkBalloon() { 333 bln_click_num++; 334 335 if(bln_click_num < jQuery(".balloon").length) { 336 return; 337 } 338 339 changeAssist(0); 340 } 341 342 //ã¢ã·ã¹ã表示è¨å®å¤æ´ 2015.05.13追å 343 //assist_val 0:OFF 1:ON 344 function changeAssist(assist_val) { 345 option_data = 'option_val='+assist_val+'&option_name=assist'; 346 347 $.ajax({ 348 type: "POST", 349 url: "wp-content/themes/theme/change_assist.php", 350 data: option_data 351 }); 352 } 353 354 //2018.07.05 add start 355 //GetPremium ãã¿ã³æ¶å» 356 jQuery('.imgevr-get-premium').css('display', 'none'); 357 358 359 //ã¡ã¿æ å ±ã®åé¤ 360 var pageTitle = jQuery('h2').html(); 361 var deleteTitle = ["ã³ã³ãã³ãå 容編é", "å ±éã³ã¼ãã»ã·ã§ã¼ãã³ã¼ããç·¨éãã"]; 362 var deleteParam = ["toppage", "script_writing"]; 363 var isSearchPage = "s" in param; 364 if(pageTitle) { 365 for(var val = 0; val < deleteParam.length; val++){ 366 if(param['post_type'] == deleteParam[val] || pageTitle.indexOf(deleteTitle[val]) != -1){ 367 jQuery("#post_meta_box").remove(); 368 } 369 } 370 } 371 372 //magic fieldã®æè¨å¤æ´ 373 var magicCodeTitle = jQuery("#mf_6").children(".hndle").children("span").text(); 374 if(magicCodeTitle == "Magic Fields") { 375 jQuery("#mf_6").children(".hndle").children("span").text("ã³ã¼ãçãè¨è¼"); 376 } 377 378 //診çæéã®è¡¨ãã¼ã¸ 379 if(param['page'] == "tablepress") { 380 var path = location.pathname; 381 path = path.replace("/wp-admin/admin.php",""); 382 //ãªã³ã¯ã®è¿½å 383 jQuery('#normal-sortables').before('<a href="'+path+'/wp-admin/admin.php?page=wevery-admin-menu/wv.php#basic_info">診çæéã®åèãä¼è¨ºæ¥ã®è¨å®ã¯ãã¡ãã¸</a>'); 384 385 //ãåãåãã表示ã®åé¤ 386 jQuery('#footer-left').remove(); 387 } 388 //診çæéã®è¡¨ãã¼ã¸ããã¯ãªããã¯ã®åºæ¬æ å ±ã«é·ç§»ããå ´åã®ã¿ã診çæéé ç®ã«ã¸ã£ã³ããã 389 if(param['page'] == "wevery-admin-menu/wv.php") { 390 var pageHash = location.hash; 391 if(pageHash){ 392 location.href = "#meditime"; 393 } 394 } 395 396 //2018.07.05 add end 397 398 //2018.11.06 add start 399 //metaæ å ±ã®å ¥åé¨ã«ãµã ãã¤ã«ç»åã®é¸æãã©ã¼ã ã追å 400 if(pageTitle && !isSearchPage) { 401 //2022.04.11 change 402 //postMetaBox = '<dt>ãµã ãã¤ã«ç»å</dt>'; 403 postMetaBox = '<dt>Googleæ¤ç´¢ç¨ãµã ãã¤ã«ç»å</dt>'; 404 postMetaBox = postMetaBox + '<dd>'; 405 postMetaBox = postMetaBox + '<input type="button" name="meta_media" value="鏿">'; 406 postMetaBox = postMetaBox + '<input type="button" name="meta_media_clear" value="ã¯ãªã¢">'; 407 postMetaBox = postMetaBox + '</dd>'; 408 postMetaBox = postMetaBox + '<div id="meta_thumbnail">'; 409 postMetaBox = postMetaBox + '<img id="meta_thumbnail_img" />'; 410 postMetaBox = postMetaBox + '<input type="hidden" id="thumbnail" name="thumbnail"></div>'; 411 412 jQuery(postMetaBox).appendTo('#post_meta_box .inside'); 413 var meta_thumbnail_img = jQuery("#thumbnail_url").val(); 414 jQuery("#post_meta_box #meta_thumbnail_img").attr("src", meta_thumbnail_img); 415 jQuery("#post_meta_box #thumbnail").val(meta_thumbnail_img); 416 } 417 418 var custom_uploader; 419 jQuery("input:button[name=meta_media]").on('click', function(e) { 420 e.preventDefault(); 421 if (custom_uploader) { 422 custom_uploader.open(); 423 return; 424 } 425 426 custom_uploader = wp.media({ 427 title: "ç»åã鏿", 428 //ã©ã¤ãã©ãªã®ä¸è¦§ã¯ç»åã®ã¿ã«ãã 429 library: { 430 type: "image" 431 }, 432 button: { 433 text: "鏿" 434 }, 435 //鏿ã§ããç»å㯠1 ã¤ã ãã«ãã 436 multiple: false 437 }); 438 439 custom_uploader.on("select", function() { 440 var images = custom_uploader.state().get("selection"); 441
442 //file ã®ä¸ã«é¸æãããç»åã®å種æ å ±ãå ¥ã£ã¦ãã 443 images.each(function(file){ 444 445 //hiddenãã©ã¼ã ã¨è¡¨ç¤ºããããµã ãã¤ã«ç»åãããã°ã¯ãªã¢ 446 jQuery("input:hidden[name=thumbnail]").val(""); 447 jQuery("#meta_media").empty(); 448 jQuery("#meta_thumbnail_img").val(""); 449 jQuery("#meta_thumbnail").empty(); 450 451 //hiddenãã©ã¼ã ã«ç»åã® URL ã表示 452 //jQuery("input:hidden[name=thumbnail]").val(file.attributes.sizes.thumbnail.url); 453 var thumbnail_url = file.attributes.sizes.thumbnail.url; 454 jQuery("<input>", {type: "hidden", id: "thumbnail", name: "thumbnail"}).val(thumbnail_url).appendTo("#meta_thumbnail"); 455 456 //鏿ããããµã ãã¤ã«ç»åã表示 457 //var imgUrl = <?php //echo update_post_meta( $post_id, '_post_thumbnail' ); ?> 458 jQuery("<img>").attr("src", thumbnail_url).appendTo("#meta_thumbnail"); 459 460 }); 461 }); 462 custom_uploader.open(); 463 464 }); 465 466 //ã¯ãªã¢ãã¿ã³ãæ¼ããæã®å¦ç 467 jQuery("input:button[name=meta_media_clear]").on('click', function() { 468 //hiddenãã©ã¼ã ã¨è¡¨ç¤ºããããµã ãã¤ã«ç»åãããã°ã¯ãªã¢ 469 jQuery("input:hidden[name=thumbnail]").val(""); 470 jQuery("#meta_thumbnail_img").val(""); 471 jQuery("#meta_media").empty(); 472 jQuery("#meta_thumbnail").empty(); 473 }); 474 //2018.11.06 add end 475 476 477 //////////////////////////////////////// 478 // Youtube表示 2015.5.21追å 479 //////////////////////////////////////// 480 //YouTube iFrame Player API 481 var tag=document.createElement('script'); 482 tag.src="//www.youtube.com/iframe_api"; 483 var firstScriptTag=document.getElementsByTagName('script')[0]; 484 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 485 486 /* ãã¬ã¼ã¤ã¼ã®æºåå®äºæ */ 487 window.onYouTubeIframeAPIReady=function() { 488 if(jQuery('[name="movie_play"]').val()==1 && param['movie_on']) { 489 $('#mov_intro').css('display', 'block'); 490 } else { 491 return; 492 } 493 494 player = new YT.Player( 495 'player',{ 496 width: '768', /* åç»ãã¬ã¼ã¤ã¼ã®å¹ */ 497 height: '468', /* åç»ãã¬ã¼ã¤ã¼ã®é«ã */ 498 videoId: 'Z5CK1GlqaOg', /* YouTubeåç»ID */ 499 playerVars: { 500 autoplay: 1, 501 rel: 0 502 }, 503 events: { /* ã¤ãã³ã */ 504 "onReady": onPlayerReady, /* ãã¬ã¼ã¤ã®æºåå®äºæ */ 505 "onStateChange": onPlayerStateChange /* ãã¬ã¼ã¤ã®ç¶æ ãå¤åããæ */ 506 } 507 } 508 ); 509 } 510 511 function movFadeOut() { 512 $('#mov_intro').fadeOut(1000); 513 514 //åç»è¡¨ç¤ºOFF 515 option_data = 'option_val=0&option_name=movie_play'; 516 517 $.ajax({ 518 type: "POST", 519 url: "wp-content/themes/theme/change_assist.php", 520 data: option_data 521 }); 522 } 523 524 function onPlayerReady(event){ 525 event.target.setVolume(50); /* é³éèª¿æ´ */ 526 } 527 528 function onPlayerStateChange(event){ 529 if(event.data == 0) { 530 setTimeout(movFadeOut, 500); 531 } 532 } 533 534 jQuery('#mov_intro .ico_close').on('click', function(){ 535 player.stopVideo(); 536 movFadeOut(); 537 }); 538 539 540// //-------------------------------------------- 541// //ãã¼ã¸å ã¹ã¯ãã¼ã«ãå ¨ã¦ã¹ã ã¼ãºã« 542// //-------------------------------------------- 543// // ã¹ã¯ãã¼ã«ã®ãªãã»ããå¤ 544// var offsetY = -10; 545// // ã¹ã¯ãã¼ã«ã«ãããæé 546// var time = 500; 547// 548// // ãã¼ã¸å ãªã³ã¯ã®ã¿ãåå¾ 549// jQuery('a[href^=#]').on('click', function() { 550// // ç§»åå ã¨ãªãè¦ç´ ãåå¾ 551// var target = $(this.hash); 552// if (!target.length) return ; 553// 554// //var target = jQuery(this.hash); 555// 556// // ç§»åå ã¨ãªãå¤ 557// var targetY = target.offset().top+offsetY; 558// // ã¹ã¯ãã¼ã«ã¢ãã¡ã¼ã·ã§ã³ 559// jQuery('html,body').animate({scrollTop: targetY}, time, 'swing'); 560// // ããã·ã¥æ¸ãæãã¨ã 561// window.history.pushState(null, null, this.hash); 562// // ããã©ã«ãã®å¦çã¯ãã£ã³ã»ã« 563// return false;
564// }); 565 566}); 567 568//2019.06.10 add start 569//-------------------------------------------- 570// aã¿ã°ã«è¨å®ããã¦ãããªã³ã¯ãå¤é¨ãµã¤ãã®å ´åã 571// ãrel=nofollowããå ããã 572//-------------------------------------------- 573//jQuery(function(){ 574window.addEventListener('DOMContentLoaded', function() { 575 //é²è¦§ä¸ã®ãµã¤ããã¡ã¤ã³åå¾ 576 var domain = window.location.hostname; 577 //æ£è¦è¡¨ç¾å 容ãã»ãã(å¤é¨ãµã¤ãã§ãªããã¨ã確èª) 578 var internalLinkRegex = new RegExp('^((http:\\/\\/|https:\\/\\/)(www\.)?)'); 579 var domaincheckRegex = new RegExp('^(((http:\\/\\/|https:\\/\\/)(www\.)?)?' 580 + domain 581 + ')'); 582 var newRel = ""; 583 //aã¿ã°ãæ£è¦è¡¨ç¾ãã§ã㯠584 jQuery('a').filter(function() { 585 // 2021.04.22 add start æ¡ä»¶ã®è¿½å ï¼target = "_blank"ãä»ä¸ããã¦ãã¦ãrelãnoopener noreferrerã§ãããã¨ï¼ 586 var targetCheck = jQuery(this).prop('target'); 587 var relCheck = jQuery(this).prop('rel'); 588 if ((relCheck == "noopener noreferrer" || relCheck == "") && targetCheck == "_blank"){ 589 newRel = "nofollow " + relCheck; 590 // 2021.04.22 add end 591 var href = jQuery(this).attr('href'); 592 //ãhttp://ããããã¯ãhttps://ãã§å§ã¾ããã¨ãç¢ºèª 593 if(internalLinkRegex.test(href)) { 594 //ãhttp://ããªã©ã§å§ã¾ã£ãå ´åã¯ã次ã«ãã¡ã¤ã³ãå ¥ãã 595 return !domaincheckRegex.test(href); 596 } else { 597 return false; 598 } 599 } //2021.04.22 add æ¡ä»¶ã®è¿½å 600 }) 601 .each(function() { 602 // 2021.04.22 change 603 // jQuery(this).attr('rel', 'nofollow'); 604 jQuery(this).attr('rel', newRel); 605 }); 606}); 607//2019.06.10 add end 608 609// 2019.09.02 add 610// Instagram Feed Pro ãã¼ã¸ã§ã³ã¢ããã«ä¼´ã追å 611// jQueryã®ãã¼ã¸ã§ã³ãå¤ããããaddBackã颿°ãè£ã 612//jQuery.fn.addBack = function (selector) { 613// return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector)); 614//} 615 616//2019.10.01 add start 617//-------------------------------------------- 618//ã¡ãã£ã¢ãã°ãªããã§è¡¨ç¤ºããå ´åã®SVGãã¡ã¤ã«è¡¨ç¤º 619//-------------------------------------------- 620//jQuery(function(){ 621window.addEventListener('DOMContentLoaded', function() { 622 var observer = new MutationObserver(function(mutations){ 623 for (var i=0; i < mutations.length; i++){ 624 for (var j=0; j < mutations[i].addedNodes.length; j++){ 625 //該å½ã®è¦ç´ ãåå¾ 626 element = jQuery(mutations[i].addedNodes[j]); 627 //classãããå ´åã®ã¿å®è¡ 628 if(element.attr('class')){ 629 elementClass = element.attr('class'); 630 //ãattachmentsãclassãæ¢ã 631 if (element.attr('class').indexOf('attachment') != -1){ 632 attachmentPreview = element.children('.attachment-preview'); 633 if(attachmentPreview.length != 0){ 634 //SVGãã¡ã¤ã«ã«ã®ã¿å®è¡ãã 635 if(attachmentPreview.attr('class').indexOf('subtype-svg+xml') != -1){ 636 var handler = function(element){ 637 //WP ajaxãå¼ã³åºãã¦ãwp_ajax_svg_get_attachment_urlã颿°ãå®è¡â該å½ã®SVGãã¡ã¤ã«ã®URLãåå¾ãã 638 jQuery.ajax({ 639 url: ajaxurl, 640 data: { 641 'action' : 'svg_get_attachment_url', 642 'attachmentID' : element.attr('data-id') 643 }, 644 success: function(data){ 645 if(data){ 646 //svgãã¡ã¤ã«ã®URLã«å¤æ 647 element.find('img').attr('src', data); 648 } 649 } 650 }); 651 }(element); 652 } 653 } 654 } 655 } 656 } 657 } 658 }); 659 observer.observe(document.body, { 660 childList: true, 661 subtree: true 662 }); 663 664//-------------------------------------------- 665//ã¡ãã£ã¢ã©ã¤ãã©ãªã®æ·»ä»ãã¡ã¤ã«è©³ç´°ã¢ã¼ãã«ã§ã®SVGãã¡ã¤ã«è¡¨ç¤º 666//-------------------------------------------- 667 var attachmentPreviewObserver = new MutationObserver(function(mutations){ 668 for (var i=0; i < mutations.length; i++){ 669 for (var j=0; j < mutations[i].addedNodes.length; j++){ 670 var element = jQuery(mutations[i].addedNodes[j]); 671 672 //æ·»ä»ãã¡ã¤ã«ã®è©³ç´°ç»é¢ãªã®ã 673 var onAttachmentPage = false;
674 if( (element.hasClass('attachment-details')) || element.find('.attachment-details').length != 0){ 675 onAttachmentPage = true; 676 } 677 678 if(onAttachmentPage == true){ 679 //URLå¤ãè¨å®ãã 680 var urlLabel = element.find('label[data-setting="url"]'); 681 if(urlLabel.length != 0){ 682 var value = urlLabel.find('input').val(); 683 element.find('.details-image').attr('src', value); 684 } 685 } 686 } 687 } 688 }); 689 attachmentPreviewObserver.observe(document.body, { 690 childList: true, 691 subtree: true 692 }); 693}); 694//2019.10.01 add end 695 696//2022.05.26 add start 697//ã«ã¼ã03 698jQuery(function(){ 699 jQuery(document).on("click", '.wev_accordion_one > .wev_accordion_header', function() { 700 jQuery(this).next(".wev_accordion_inner").slideToggle(); 701 jQuery(this).toggleClass("open"); 702 jQuery(".wev_accordion_one > .wev_accordion_header").not(jQuery(this)).next(".wev_accordion_inner").slideUp(); 703 jQuery(".wev_accordion_one > .wev_accordion_header").not(jQuery(this)).removeClass("open"); 704 }); 705}); 706 707//-------------------------------------------- 708// Scrolling code start 709//-------------------------------------------- 710 711// Add debug function 712function isElementVisible($el) { 713 if (!$el.length) return false; 714 const elOffset = $el.offset().top; 715 const elHeight = $el.innerHeight(); 716 const scrollTop = jQuery(window).scrollTop(); 717 const windowHeight = jQuery(window).height(); 718 719 return (elOffset + elHeight > scrollTop && elOffset < scrollTop + windowHeight); 720} 721 722function logAfterScrollInfo() { 723 const scrollTop = jQuery(window).scrollTop(); 724 725 const header = jQuery("#header"); 726 const gnavbar = jQuery("#gNav"); 727 728 const headerHeight = header.length ? header.innerHeight() : 0; 729 const gnavHeight = gnavbar.length ? gnavbar.innerHeight() : 0; 730 731 const isHeaderVisible = isElementVisible(header); 732 const isGNavVisible = isElementVisible(gnavbar); 733 734 console.log("===== Scrollå¾ã®ç¶æ ====="); 735 console.log("ç¾å¨ä½ç½® (scrollTop):", scrollTop); 736 console.log("headeré«ã:", headerHeight, " / 表示ä¸?:", isHeaderVisible); 737 console.log("gNavé«ã:", gnavHeight, " / 表示ä¸?:", isGNavVisible); 738 console.log("========================"); 739} 740 741//2022.05.26 add end 742window.addEventListener("load", function () { 743 const speed = 400; 744 const url = jQuery(location).attr("href"); 745 let retry = 15; 746 let navbarHeight = getNavHeight(); 747 748 if (url.indexOf("#") !== -1) { 749 // urlã#ã§åå²ãã¦é åã«æ ¼ç´ 750 const anchor = url.split("#"); 751 // åå²ããæå¾ã®æååï¼#â¯â¯ã®é¨åï¼ãtargetã«ä»£å ¥ 752 const interval = setInterval(function () { 753 let target = jQuery("#" + anchor[anchor.length - 1]); 754 if (target.length) { 755 clearInterval(interval); 756 let position = Math.floor(target.offset().top); 757 smoothScroll(position, speed, navbarHeight, "#" + anchor[anchor.length - 1]); 758 } 759 retry--; 760 if (retry <= 0) { 761 clearInterval(interval); 762 } 763 }, 500); 764 } 765}); 766 767//ãã¼ã¸å ã¢ã³ã«ã¼ãªã³ã¯ 768var isClicked = false; 769jQuery(document).on("click", 'a[href*="#"]', function (e) { 770 isClicked = true; 771 const url = this.href; 772 const urlObj = new URL(url); 773 774 // Allow #sidr to be added to the URL and another site # link 775 if ((urlObj.hash === "#sidr") || (!url.includes(window.location.host)) || Array.from(urlObj.searchParams).length > 0) { 776 return; 777 } 778 779 if (urlObj.pathname == window.location.pathname) { 780 e.preventDefault(); // Prevent default only for internal page anchors 781 console.log('Click Scroll link'); 782 783 // For same-page anchor links, close the mobile menu just before scrolling. 784 // (#mobile.side-open is only added when the menu is opened on mobile, so this effectively runs on mobile only.) 785 var $mobileMenu = jQuery("#mobile"); 786 if ($mobileMenu.hasClass("side-open")) { 787 $mobileMenu.removeClass("side-open"); 788 jQuery("#header .header_tel").removeClass("side-open"); 789 jQuery("body").css({ overflow: "", height: "" }); 790 } 791 792 let navbarHeight = getNavHeight(); 793 const speed = 400; 794 const target = jQuery(urlObj.hash); 795 796 if (target.length) { 797 let position = Math.floor(target.offset().top); 798 smoothScroll(position, speed, navbarHeight, urlObj.hash); 799 } 800 } 801}); 802 803jQuery(window).on("hashchange", function () { 804 if (isClicked) { 805 isClicked = false;
806 return; 807 } 808 const url = jQuery(location).attr("href"); 809 let navbarHeight = getNavHeight(); 810 const speed = 400; 811 812 if (url.indexOf("#") !== -1) { 813 // urlã#ã§åå²ãã¦é åã«æ ¼ç´ 814 const anchor = url.split("#"); 815 // åå²ããæå¾ã®æååï¼#â¯â¯ã®é¨åï¼ãtargetã«ä»£å ¥ 816 let target = jQuery("#" + anchor[anchor.length - 1]); 817 if (target.length) { 818 let position = Math.floor(target.offset().top); 819 smoothScroll(position, speed, navbarHeight, "#" + anchor[anchor.length - 1]); 820 } 821 } 822}); 823 824function getNavHeight() { 825 const gnavbar = jQuery("#gNav"); 826 const header = jQuery("#header"); 827 let gnavbarHeight = 0; 828 let headerHeight = 0; 829 let navbarHeight = 10; 830 831 if (gnavbar.length) { 832 gnavbarHeight += gnavbar.innerHeight(); 833 } 834 835 if (header.length) { 836 headerHeight += header.innerHeight(); 837 } 838 839 navbarHeight += Math.max(headerHeight, gnavbarHeight); 840 return navbarHeight; 841} 842 843function getMinPadding() { 844 const gnavbar = jQuery("#gNav"); 845 const header = jQuery("#header"); 846 let gnavbarHeight = 0; 847 let headerHeight = 0; 848 let padding = 0; 849 850 if (gnavbar.length) { 851 gnavbarHeight += gnavbar.innerHeight(); 852 } 853 854 if (header.length) { 855 headerHeight += header.innerHeight(); 856 } 857 858 const maxHeight = Math.max(headerHeight, gnavbarHeight); 859 860 if (gnavbar.length && maxHeight === gnavbarHeight) { 861 const style = window.getComputedStyle(gnavbar[0]); 862 padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom); 863 } else if (header.length && maxHeight === headerHeight) { 864 const style = window.getComputedStyle(header[0]); 865 padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom); 866 } 867 return padding; 868} 869 870function smoothScroll(position, speed, navbarHeight, targetSelector) { 871 const body = jQuery("html,body"); 872 const gnavbar = jQuery("#gNav"); 873 const header = jQuery("#header"); 874 const isGNavFixed = gnavbar.length && gnavbar.css("position") === "fixed"; 875 const isHeaderFixed = header.length && header.css("position") === "fixed"; 876 877 let finalScrollPosition = position; 878 let needSecondAdjust = true; 879 880 if (jQuery(window).width() <= 480) { 881 var fixedHeight = 30; 882 var firstH1 = jQuery('h1').first(); 883 if (firstH1.length > 0) { 884 fixedHeight = (firstH1.outerHeight() !== 0 ? firstH1.outerHeight() : fixedHeight); 885 } 886 finalScrollPosition -= fixedHeight; 887 needSecondAdjust = false; 888 } else { 889 const gnavHeight = gnavbar.length ? gnavbar.innerHeight() : 0; 890 const headerHeight = header.length ? header.innerHeight() : 0; 891 892 if (gnavHeight > 450 || headerHeight > 450) { 893 const smallerHeight = Math.min(gnavHeight || Infinity, headerHeight || Infinity); 894 finalScrollPosition -= smallerHeight; 895 } else if (isGNavFixed) { 896 finalScrollPosition -= gnavbar.innerHeight() > 100 ? gnavbar.innerHeight() : 100; 897 needSecondAdjust = false; 898 } else if (isHeaderFixed) { 899 finalScrollPosition -= header.innerHeight() > 100 ? header.innerHeight() : 100; 900 needSecondAdjust = false; 901 } else { 902 finalScrollPosition -= navbarHeight + getMinPadding(); 903 needSecondAdjust = true; 904 } 905 } 906 907 body.stop().animate( 908 { scrollTop: finalScrollPosition }, 909 speed, 910 "swing", 911 function () { 912 const isHeaderVisible = isElementVisible(header); 913 const isGNavVisible = isElementVisible(gnavbar); 914 915 // For debug 916 // console.log("isHeaderVisible?:", isHeaderVisible); 917 // console.log("isGNavVisible?:", isGNavVisible); 918 // console.log("needSecondAdjust?:", needSecondAdjust); 919 // console.log('targetSelector:?', targetSelector); 920 // logAfterScrollInfo(); 921 if (!isHeaderVisible && !isGNavVisible && targetSelector) { 922 needSecondAdjust = false;
923 const target = jQuery(targetSelector); 924 if (target.length) { 925 const targetPos = Math.floor(target.offset().top) - 50; 926 jQuery("html,body").stop().animate( 927 { scrollTop: targetPos }, 928 500, 929 "swing", 930 // For debug 931 // function () { 932 // console.log("Correction: Since there is no header or gNav, reposition the target to top+30px"); 933 // logAfterScrollInfo(); 934 // } 935 ); 936 } 937 return; 938 } 939 940 if (!needSecondAdjust) return; 941 // --- 2nd time: Re-correct height change due to gNav's is-fixed --- 942 setTimeout(function () { 943 const gnavNowFixed = gnavbar.length && gnavbar.css("position") === "fixed"; 944 if (gnavNowFixed && gnavbar.hasClass("is-fixed")) { 945 let adjust = gnavbar.innerHeight(); 946 let currentScroll = jQuery(window).scrollTop(); 947 jQuery("html,body").stop().animate( 948 { scrollTop: currentScroll - adjust}, 949 600, 950 "swing", 951 // For debug 952 // function () { 953 // logAfterScrollInfo(); 954 // } 955 ); 956 } 957 }, 500); 958 } 959 ); 960} 961//-------------------------------------------- 962// Scrolling code end 963//-------------------------------------------- 964 965window.addEventListener("DOMContentLoaded", () => { 966 const iframeHeightObserver = new MutationObserver(mutations => { 967 mutations.forEach(mutation => { 968 if (mutation.attributeName === "height") { 969 const iframeElement = mutation.target; 970 iframeElement.style.height = `${iframeElement.getAttribute("height")}px`; 971 } 972 }); 973 }); 974 975 const iframeElements = Array.from(document.querySelectorAll("iframe.wp-embedded-content")); 976 iframeElements.forEach(iframe => iframeHeightObserver.observe(iframe, { attributes: true })); 977 978}); 979 980window.addEventListener("load", () => { 981 handleNestedAccordion() 982 if (isMobileSafari()) { 983 removeInstagramLightBox(); 984 } 985 986}); 987 988function isMobileSafari() { 989 return ( 990 navigator.userAgent.match(/(iPod|iPhone|iPad)/) && 991 navigator.userAgent.match(/AppleWebKit/) 992 ); 993} 994 995// 2026.08.12 fix ãã®é¢æ°ã¯977è¡ã®window load(管çç»é¢ã§ãå®è¡ããã)ãã 996// iOS Safariæã«å¼ã°ããã管çç»é¢ã§ã¯ $ ãæªå®ç¾©ã®ãã jQuery ã«å¤æ´ã 997function removeInstagramLightBox() { 998 const sbiElements = jQuery(".sbi"); 999 sbiElements.each((index, element) => { 1000 const $self = jQuery(element); 1001 const flags = $self.attr("data-sbi-flags"); 1002 if (flags !== undefined && flags.indexOf("disableOnTouch") === -1) { 1003 if (typeof window.sbi.touchDevice === "undefined") { 1004 window.sbi.touchDevice = true; 1005 jQuery(".sbi_item").each((index, item) => { 1006 const $item = jQuery(item); 1007 if (!$item.find(".sbi_link").hasClass("sbi_disable_lightbox")) { 1008 $item.find(".sbi_photo_wrap").prepend($item.find(".sbi_link_area")); 1009 $item.find(".sbi_link").remove(); 1010 } 1011 }); 1012 } 1013 } 1014 }); 1015} 1016 1017function handleNestedAccordion() { 1018 var $root = jQuery('#sidr ul#menu-main_menu'); 1019 if ($root.length === 0) return; 1020 1021 if (!window.__nestedAccordionInitTry) window.__nestedAccordionInitTry = 0; 1022 window.__nestedAccordionInitTry += 1; 1023 1024 var topAccCountNow = $root.find('> li > a + .accordion-elm').length; 1025 if (topAccCountNow === 0 && window.__nestedAccordionInitTry <= 60) { 1026 setTimeout(handleNestedAccordion, 50); 1027 return; 1028 } 1029 1030 // Add accordion under sub-menu 1031 $root.children('li').each(function () { 1032 var $menuItem = jQuery(this); 1033 var $targets = $menuItem.find('li.menu-item-has-children'); 1034 1035 $targets.each(function () { 1036 var $subMenuItem = jQuery(this); 1037 if ($subMenuItem.children('ul.sub-menu').length === 0) return; 1038 1039 var $linkTag = $subMenuItem.children('a').first(); 1040 if ($linkTag.length === 0) return; 1041 1042 // Duplicate prevention: If there is no accordion-elm immediately after a, add it. 1043 if ($linkTag.next('.accordion-elm').length === 0) { 1044 $linkTag.after('<div class="accordion-elm">â¼</div>'); 1045 } 1046 1047 $subMenuItem.css({ 1048 'text-indent': 'initial', 1049 'margin-left': '0.8em' 1050 }); 1051 }); 1052 }); 1053 1054 $root.find('.accordion-elm').off('click'); 1055 1056 jQuery(document) 1057 .off('click.handleNestedAccordion', '#sidr ul#menu-main_menu .accordion-elm') 1058 .on('click.handleNestedAccordion', '#sidr ul#menu-main_menu .accordion-elm', function (e) { 1059 e.preventDefault(); 1060 e.stopPropagation(); 1061 if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation(); 1062 1063 var $btn = jQuery(this); 1064 var $targetUl = $btn.next('ul.sub-menu'); 1065 1066 if ($targetUl.length === 0) return false;
1067 1068 $btn.toggleClass('active'); 1069 $targetUl.stop(true, true).slideToggle(400); 1070 1071 return false; 1072 }); 1073} 1074 1075document.addEventListener('DOMContentLoaded', function () { 1076 const options = document.querySelectorAll('#mm option'); 1077 options.forEach(option => { 1078 let dataText = option.getAttribute('data-text'); 1079 if (dataText) { 1080 dataText = dataText.replace('æ', ''); 1081 option.setAttribute('data-text', dataText); 1082 } 1083 }); 1084}); 1085 1086// 2024/11/28 add for Wevery custom plugins 1087document.addEventListener('DOMContentLoaded', function() { 1088 function isAdmin() { 1089 return window.location.href.indexOf('/wp-admin/') !== -1; 1090 } 1091 1092 if (!isAdmin()) { 1093 var elements = document.querySelectorAll("div.box_editer_custom"); 1094 elements.forEach(function(element) { 1095 // Get parent element 1096 var parent = element.parentNode; 1097 // Move child element to parent element 1098 while (element.firstChild) { 1099 parent.insertBefore(element.firstChild, element); 1100 } 1101 // Delete the original div 1102 parent.removeChild(element); 1103 }); 1104 } 1105}); 1106// add end 1107 1108// Add for TEL to phone number 1109document.addEventListener("DOMContentLoaded", function() { 1110 let telElem = document.querySelector('.tel'); 1111 if (!telElem) { 1112 return; 1113 } 1114 const origInnerHTML = telElem.innerHTML; 1115 1116 function hasWideTelText() { 1117 const width = telElem.offsetWidth; 1118 return width >= 80; 1119 } 1120 1121 function isPortrait() { 1122 const result = window.matchMedia("(orientation: portrait)").matches; 1123 return result; 1124 } 1125 function isPortraitAndInWidth() { 1126 const result = isPortrait() && window.innerWidth < 1000; 1127 return result; 1128 } 1129 function isLandscapeMode() { 1130 const result = window.innerWidth < 1200 && !isPortrait(); 1131 return result; 1132 } 1133 function isTelNumber(str) { 1134 const result = /^\d{2,4}-\d{2,4}-\d{3,4}$/.test(str.trim()) || /^\d{10,11}$/.test(str.replace(/-/g, '').trim()); 1135 return result; 1136 } 1137 1138 function renderTelContent() { 1139 let isParentATag = telElem.parentElement && telElem.parentElement.tagName.toLowerCase() === 'a'; 1140 let parentATag = isParentATag ? telElem.parentElement : null; 1141 1142 if (isParentATag) { 1143 let aText = parentATag.textContent; 1144 let hasNumber = /\d{2,4}-\d{2,4}-\d{3,4}|\d{10,11}/.test(aText); 1145 1146 if (!hasNumber && hasWideTelText()) { 1147 let telNumber = ''; 1148 let href = parentATag.getAttribute('href'); 1149 if (href && href.indexOf('tel:') === 0) { 1150 telNumber = href.replace('tel:', ''); 1151 } 1152 telElem.innerHTML = `<i class="material-icons">local_phone</i> ${telNumber}`; 1153 return; 1154 } else { 1155 telElem.innerHTML = origInnerHTML; 1156 } 1157 } 1158 1159 let aTag = isParentATag ? parentATag : telElem.querySelector('a'); 1160 if (!aTag) { 1161 return; 1162 } 1163 1164 const href = aTag.getAttribute('href'); 1165 const telNumber = href ? href.replace(/^tel:/, '') : ''; 1166 const gaAttr = aTag.getAttribute('onclick') || ''; 1167 1168 if ((isLandscapeMode() && !hasWideTelText()) || 1169 (isLandscapeMode() && aTag.textContent.trim() === 'TEL') 1170 ) { 1171 const telLinkHTML = `<a href="tel:${telNumber}"${gaAttr ? ` onclick="${gaAttr}"` : ''}><span class="tel-number">${telNumber}</span></a>`; 1172 telElem.innerHTML = `<i class="material-icons">local_phone</i> ${telLinkHTML}`; 1173 return; 1174 } 1175 1176 if (isPortraitAndInWidth()) { 1177 if (isTelNumber(aTag.textContent) && !hasWideTelText()) { 1178 aTag.textContent = 'TEL'; 1179 } 1180 return; 1181 } 1182 1183 telElem.innerHTML = origInnerHTML; 1184 } 1185 1186 renderTelContent(); 1187 1188 window.addEventListener('resize', function() { 1189 renderTelContent(); 1190 }); 1191 window.addEventListener('orientationchange', function() { 1192 renderTelContent(); 1193 }); 1194}); 1195 1196(function () { 1197 if (location.pathname.indexOf('/wp-admin/') !== -1) return; 1198 const TARGET_FORM_ID = 'searchform'; 1199 1200 function isTargetSearchForm(form) { 1201 return !!form && form.tagName && form.tagName.toLowerCase() === 'form' && form.id === TARGET_FORM_ID; 1202 } 1203 1204 function isEmptySearchForm(form) { 1205 if (!isTargetSearchForm(form)) return false;
1206 const s = form.querySelector('input[name="s"]'); 1207 if (!s) return false; 1208 return s.value.trim() === ''; 1209 } 1210 1211 function block(event) { 1212 console.warn('Empty search blocked'); 1213 event.preventDefault(); 1214 event.stopPropagation(); 1215 if (typeof event.stopImmediatePropagation === 'function') event.stopImmediatePropagation(); 1216 return false; 1217 } 1218 1219 document.addEventListener( 1220 'submit', 1221 function (event) { 1222 if (isEmptySearchForm(event.target)) return block(event); 1223 }, 1224 true 1225 ); 1226 1227 document.addEventListener( 1228 'click', 1229 function (event) { 1230 const eventTarget = event.target; 1231 if (!eventTarget) return; 1232 1233 const isSubmitLike = 1234 (eventTarget.tagName === 'INPUT' && (eventTarget.type === 'submit' || eventTarget.type === 'image')) || 1235 (eventTarget.tagName === 'BUTTON' && (eventTarget.type === 'submit' || eventTarget.type === '')); 1236 1237 if (!isSubmitLike) return; 1238 1239 const form = eventTarget.form; 1240 if (!form) return; 1241 1242 if (isEmptySearchForm(form)) return block(event); 1243 }, 1244 true 1245 ); 1246})();
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.