1import { config } from './pageConfig.js'; 2 3const newTabSetting = {urls: [], girls: []}; 4if (!window.isLoadLinkSetting) { 5 // åã£ã¦ããã¾ã§ç´è¿ã®ãã£ãã·ã¥ãå©ç¨ãã 6 try { 7 Object.assign(newTabSetting, JSON.parse(localStorage.newTabSetting)); 8 // ãã¼ã¿ç¡ããç ´æã®å ´åãæ½°ãã¦OK 9 } catch(ex) { } 10 11 // ç¾å¨è¨å®ããªãã¯ãã§åã£ã¦ãã 12 fetch(config.api.url.target_blank_all, { method: 'GET'}) 13 .then(response => response.json()) 14 .then(json => { 15 Object.assign(newTabSetting, json); 16 // 次åããAPIæªåå¾ã§ãããã«ä½¿ãããã£ãã·ã¥ãä½ã£ã¦ãã 17 localStorage.newTabSetting = JSON.stringify(newTabSetting); 18 }) 19 .catch(console.error); 20} 21 22window.isLoadLinkSetting = true; 23 24export const aClickTargetBlank = function(){ 25 $(document).on('click', 'a', function(e) { 26 var a_tag = $(this); 27 28 // é¤å¤å¯¾è±¡ 29 var child_check_classes = ['.textbutton','.basicimg','.arrows','.sborder','.vborder']; 30 var parent_check_classes = ['.html','.richtext','.slidebanner','.image-upload','#fb_area','.sa-slider','.image-slider','.bx-controls','.paging'];
31 var return_check = 0; 32 child_check_classes.forEach(function(child_check_class){ 33 if(a_tag.find(child_check_class).length){ 34 return return_check = 1; 35 } 36 }); 37 parent_check_classes.forEach(function(parent_check_class){ 38 if(a_tag.closest(parent_check_class).length){ 39 return return_check = 1; 40 } 41 }); 42 if(return_check == 1){ return; } 43 44 const aTag = a_tag[0]; 45 // hrefã®çå¤ã¨çµ¶å¯¾URLãåã ã«åå¾ 46 const href = aTag.getAttribute('href'); 47 // href ãã»ããããã¦ããªãå ´åããã¼ã¸ã³ã°ç¨ã®å ´åã常ã«å¯¾è±¡å¤ãªã®ã§çµãã 48 // ä¸è¨é¤å¤ã§ã¯ç´è¿ããè¦ãªãã®ã§ãæãããã®ããããã 49 if (!href || href.startsWith('?page=')) { return; } 50 const url = new URL(aTag.href); 51 const path = url.pathname.replace(/^\//, ''); 52 53 if (path == 'girls_detail') { 54 // 女ã®å詳細ã®å ´åã®ã¿ç¹æ®å¦ç 55 const params = url.searchParams; 56 const girlsId = parseInt(params.get('id')); 57 if ( 58 // å ±éã§å¥ã¿ãéãè¨å®ããã§ã㯠59 newTabSetting.urls.includes('girls_detail') 60 // åå¥ã§å¥ã¿ãéãè¨å®ããã§ã㯠61 || newTabSetting.girls.includes(girlsId) 62 ) { 63 e.preventDefault(); 64 window.open(href, '_blank'); 65 } 66 } else if (newTabSetting.urls.includes(path) || newTabSetting.urls.includes(href)) { 67 // ç¸å¯¾ãã¹ï¼å é¨ç¨ï¼ãã¾ãã¯çµ¶å¯¾URLãå¥ã¿ãè¨å®ããã§ã㯠68 e.preventDefault(); 69 window.open(href, '_blank'); 70 } 71 // å¥ã¿ãã§ç¡ããã°ãã¹ã«ã¼ãããã¨ã§ãæ¢åã¿ãã§éã 72 }); 73}
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.