javascript:(function(){ /* # --- 【ブロック1】 初期化とCSS設定 --- */ const d=document,g=i=>d.getElementById(i),c=t=>d.createElement(t);const eW=g('fE-w');if(eW)eW.remove();const oS=g('fE-st');if(oS)oS.remove();const st=c('style');st.id='fE-st';st.innerHTML='#fE-s{position:fixed;top:32px;right:0;width:30%;height:calc(100% - 32px);background:#F5F5DC;border-left:2px solid #800000;z-index:9999;display:flex;flex-direction:column;color:#800000;box-shadow:-2px 0 5px rgba(0,0,0,.2)}#fE-h{padding:10px;border-bottom:1px solid #800000;background:#F5F5DC;position:relative;cursor:move}#fE-c,#fE-u,#fE-v{cursor:pointer;background:#fff;border:1px solid #800000;padding:2px 5px;font-size:12px;margin-left:5px}.fE-r{margin-bottom:5px;display:flex;align-items:center;width:100%}.fE-r label{width:40px;font-size:12px;cursor:default}.fE-ib{flex:1;border:1px solid #ccc;padding:2px;box-sizing:border-box;background:#fff;min-height:20px;white-space:nowrap;overflow:hidden;font-size:13px;cursor:text}.fE-ib:empty:before{content:attr(data-placeholder);color:#888}#fE-j{cursor:pointer;background:#fff;border:1px solid #800000;padding:2px 5px;margin-left:5px;font-size:10px}#fE-l{flex:1;overflow-y:auto;padding:10px;padding-left:45px}.fE-ic{position:relative;margin-bottom:10px}.fE-cb{position:absolute;left:-35px;top:0;width:30px;height:100%;text-align:center;cursor:pointer;border:none;background:#fff;color:#800000;font-size:16px;display:flex;align-items:center;justify-content:center;padding:0;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);transition:all .3s ease}.fE-cb:hover{box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}.fE-i{border:1px solid #800000;padding:5px;cursor:pointer;background:#F0E0D6;color:#800000;font-size:14px;word-break:break-all;min-height:40px;display:flow-root}.fE-hl{background-color:#ff0;color:#000;font-weight:bold}.fE-cc{float:right;color:green;font-weight:bold;font-size:12px;margin-left:5px;white-space:nowrap}#fE-mb{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.7);z-index:10000;display:flex;align-items:center;justify-content:center}#fE-m{background:#FFE;border:3px solid #800000;width:60%;max-height:90%;display:flex;flex-direction:column;position:relative}#fE-mc{position:absolute;top:5px;right:10px;cursor:pointer;font-weight:bold;z-index:10001}#fE-mj{position:absolute;top:5px;left:10px;cursor:pointer;background:#fff;border:1px solid #800000;padding:2px 5px;font-size:12px;font-weight:bold;z-index:10001}#fE-mco{padding:20px;overflow-y:auto;flex:1}.fE-ob{display:flow-root;min-height:100px;padding-top:20px}.fE-mbr{display:flex;gap:10px;padding:15px 0;border-top:1px solid #800000;border-bottom:1px dashed #800000;margin:15px 0}.fE-mbn{cursor:pointer;border:none;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);background:#fff;color:#800000;padding:5px 10px;font-size:12px;transition:all .3s ease}#fE-vh{padding:10px;border-bottom:1px solid #800000;display:flex;align-items:center;background:#F5F5DC}';d.head.appendChild(st);const sb=c('div');sb.id='fE-s';let oW=c('div');oW.id='fE-w';oW.appendChild(sb);d.body.appendChild(oW);try{const w=localStorage.getItem('fEW');if(w)sb.style.width=w+'px'}catch(e){}const hd=c('div');hd.id='fE-h';sb.appendChild(hd);const cB=c('button');cB.id='fE-c';cB.innerText='終了';const uB=c('button');uB.id='fE-u';uB.innerText='更新';const vB=c('button');vB.id='fE-v';vB.innerText='閲覧';let iS='お願いします',iE='',iH='';try{iS=localStorage.getItem('fES')||iS;iE=localStorage.getItem('fEE')||'';iH=localStorage.getItem('fEH')||''}catch(e){}const sR=c('div');sR.className='fE-r';sR.innerHTML='
';sR.appendChild(cB);hd.appendChild(sR);const sI=g('fE-si');sI.innerText=iS;const eR=c('div');eR.className='fE-r';eR.innerHTML='
';eR.appendChild(uB);hd.appendChild(eR);const eI=g('fE-ei');eI.innerText=iE;const hR=c('div');hR.className='fE-r';hR.innerHTML='
';hR.appendChild(vB);hd.appendChild(hR);const hI=g('fE-hi'),jB=g('fE-j'),lA=c('div');lA.id='fE-l';sb.appendChild(lA); /* # --- 【ブロック3】 イベントリスナーとリサイズ・移動処理 --- */ let aRM=new Map(),cM=new Map(),hE=[],hI_idx=0,dF=0,x=0,y=0,a=0,b=0,c_kS='',c_eS='',c_hS='';hd.onmousedown=e=>{if(e.target.closest('button,.fE-ib,.fE-rs'))return;dF=1;x=e.clientX;y=e.clientY;const r=sb.getBoundingClientRect();a=r.left;b=r.top;sb.style.left=a+'px';sb.style.top=b+'px';sb.style.right='auto';d.onmousemove=ev=>{if(!dF)return;sb.style.left=Math.max(0,Math.min(innerWidth-sb.offsetWidth,a+ev.clientX-x))+'px';sb.style.top=Math.max(0,Math.min(innerHeight-sb.offsetHeight,b+ev.clientY-y))+'px'};d.onmouseup=()=>{dF=0;d.onmousemove=d.onmouseup=null};e.preventDefault()};const mk=(id,sd)=>{let G=c('div');G.id=id;G.className='fE-rs';sb.appendChild(G);G.style.cssText='position:absolute;'+sd+':-5px;top:0;width:10px;height:100%;cursor:ew-resize;z-index:10001';G.onmousedown=e=>{e.stopPropagation();e.preventDefault();const r=sb.getBoundingClientRect(),L=r.left,R=r.right,W=r.width,X=e.clientX;d.onmousemove=ev=>{let nw,nl=L;if(sd==='left'){nw=Math.max(260,Math.min(innerWidth,W-(ev.clientX-X)));nl=R-nw;if(nl<0){nw=R;nl=0}}else{nw=Math.max(260,Math.min(innerWidth-L,W+(ev.clientX-X)))}sb.style.width=nw+'px';sb.style.left=nl+'px';sb.style.right='auto'};d.onmouseup=()=>{try{localStorage.setItem('fEW',parseInt(sb.offsetWidth))}catch(e){}d.onmousemove=d.onmouseup=null}}};mk('fE-rs-l','left');mk('fE-rs-r','right');let tD;const dU=()=>{clearTimeout(tD);tD=setTimeout(rL,300)};const cE=e=>{if(e.target.closest('#fE-mc')||e.target.id==='fE-mb'||e.target.id==='fE-mj'||e.target.id==='fE-vcb')setTimeout(rL,80);const cT=e.target.closest('a');if(cT&&((cT.getAttribute('onclick')||'').includes('scrlf')||cT.innerText.includes('リロード')))setTimeout(rL,500)};const sE=()=>{if((window.innerHeight+window.scrollY)>=d.documentElement.scrollHeight-50)dU()};d.addEventListener('click',cE,true);window.addEventListener('scroll',sE);cB.onclick=()=>{oW.remove();st.remove();aRM.clear();cM.clear();hE=[];d.removeEventListener('click',cE,true);window.removeEventListener('scroll',sE)};uB.onclick=()=>rL();jB.onclick=()=>{const k=sI.innerText.replace(/\r?\n/g,' ').trim(),E=eI.innerText.replace(/\r?\n/g,' ').trim(),h=hI.innerText.replace(/\r?\n/g,' ').trim();if(k!==c_kS||E!==c_eS||h!==c_hS)rL();if(hE.length===0)return;if(hI_idx>=hE.length)hI_idx=0;hE[hI_idx].scrollIntoView({behavior:'smooth',block:'center'});hI_idx++};const hImg=rE=>{const ln=rE.querySelectorAll('a');for(let o of ln){const hr=o.href.toLowerCase();if(hr.endsWith('.jpg')||hr.endsWith('.png')||hr.endsWith('.gif')||hr.endsWith('.webp'))return true}return!!rE.querySelector('img')};const cTC=(t,bn,oT)=>{navigator.clipboard.writeText(t).then(()=>{bn.innerText='OK';setTimeout(()=>bn.innerText=oT,1000)})}; /* # --- 【ブロック4】 データ抽出とコンテキストマッチング処理 --- */ const sMR=()=>{aRM.clear();cM.clear();d.querySelectorAll('.rtd,.c9-10').forEach(rp=>{if(!rp.querySelector('.rsc,.c9-11'))return;const bq=rp.querySelector('blockquote');if(!bq)return;const rnE=rp.querySelector('.no_quote,.cno,.n');const rN=rnE?rnE.innerText.replace('No.','').trim():null;if(!rN)return;const oL=bq.innerHTML.split(//i);const pL=[];oL.forEach(l=>{if(!l.includes('1000なら')){const t=c('div');t.innerHTML=l;pL.push(t.innerText.trim())}});const cL=pL.filter(l=>!/^>/.test(l));aRM.set(rN,{el:rp,cT:cL.join('\n'),cL:cL,aL:pL})});aRM.forEach((bD,bN)=>{if(!hImg(bD.el))return;let cNs=new Set(),qB=[];bD.aL.forEach(tx=>{const nM=tx.match(/(?:>>?>?|No\.)(\d+)/i);if(nM){cNs.add(nM[1]);pQB();return}if(/^>(?!>)/.test(tx)){const cQ=tx.replace(/^>\s*/,'').trim();if(cQ.length>=5)qB.push(cQ)}else{pQB()}});pQB();function pQB(){if(qB.length>0){aRM.forEach((aD,aN)=>{if(aN!==bN){let mT=false;for(let j=0;j<=aD.cL.length-qB.length;j++){let sM=true;for(let k=0;k{if(!cM.has(aN))cM.set(aN,new Set());cM.get(aN).add(bN)})})}; /* # --- 【ブロック5】 モーダル表示機能(詳細閲覧・閲覧モード) --- */ const sM=rN=>{const da=aRM.get(rN);if(!da)return;const bg=c('div');bg.id='fE-mb';const md=c('div');md.id='fE-m';const cl=c('span');cl.id='fE-mc';cl.innerText='× 閉じる';cl.onclick=()=>{bg.remove();rL()};const jR=c('button');jR.id='fE-mj';jR.innerText='元レスへ';jR.onclick=()=>{bg.remove();da.el.scrollIntoView({behavior:'smooth',block:'center'})};const co=c('div');co.id='fE-mco';const oB=c('div');oB.className='fE-ob';oB.innerHTML=da.el.innerHTML;co.appendChild(oB);const bR=c('div');bR.className='fE-mbr';const qCT=da.cT.split('\n').map(l=>'>'+l).join('\n');[{l:'レス番号',t:'>No.'+rN},{l:'全文',t:da.aL.map(l=>'>'+l).join('\n')},{l:'本文(引用レス除外)',t:qCT}].forEach(cf=>{const b=c('button');b.className='fE-mbn';b.innerText=cf.l;b.onclick=e=>{e.stopPropagation();cTC(cf.t,b,cf.l)};bR.appendChild(b)});co.appendChild(bR);const ct=cM.has(rN)?Array.from(cM.get(rN)):[];if(ct.length>0){const cA=c('div');cA.innerHTML='引用レス一覧:';ct.forEach(cN=>{const cD=aRM.get(cN);if(cD){const cB=c('div');cB.style.cssText='background:#F0E0D6;border:1px solid #800000;padding:10px;margin-top:10px;display:flow-root;font-size:14px;color:#800000;min-height:100px';const im=cD.el.querySelector('img');if(im){const iC=im.closest('a')?im.closest('a').cloneNode(true):im.cloneNode(true);iC.style.float='left';iC.style.margin='0 10px 10px 0';cB.appendChild(iC)}const fL=cD.aL.map(l=>{if(/^>/.test(l))return''+l+'';return l}).join('
');const tD=c('div');tD.innerHTML='No.'+cN+'
'+fL;cB.appendChild(tD);cA.appendChild(cB)}});co.appendChild(cA)}md.appendChild(jR);md.appendChild(cl);md.appendChild(co);bg.appendChild(md);oW.appendChild(bg);bg.onclick=e=>{if(e.target===bg){bg.remove();rL()}}};const sV=()=>{sMR();const bg=c('div');bg.id='fE-mb';const md=c('div');md.id='fE-m';let iVS='>1000なら',iVE='';try{if(localStorage.getItem('fEVS')!==null)iVS=localStorage.getItem('fEVS');if(localStorage.getItem('fEVE')!==null)iVE=localStorage.getItem('fEVE')}catch(e){}const vH=c('div');vH.id='fE-vh';vH.innerHTML='';const co=c('div');co.id='fE-mco';const rVL=()=>{co.innerHTML='';const vS=g('fE-vs'),vE=g('fE-ve'),cH=g('fE-vac'),vC=g('fE-vc');try{localStorage.setItem('fEVS',vS.value);localStorage.setItem('fEVE',vE.value)}catch(e){}let tS=new Set();const kS=sI.innerText.replace(/\r?\n/g,' ').trim(),kw=kS.split(/[\s ]+/).filter(k=>k),eS=eI.innerText.replace(/\r?\n/g,' ').trim(),ew=eS?eS.split(/[\s ]+/).filter(k=>k):[],vwE=vE.value.trim().split(/[\s ]+/).filter(k=>k);let bC=new Set();if(kw.length>0){aRM.forEach((da,rN)=>{if(kw.some(k=>da.cT.includes(k))){if(ew.length===0||!ew.some(e=>da.cT.includes(e))){if(cM.has(rN))cM.get(rN).forEach(C=>bC.add(C))}}})}bC.forEach(cN=>{const cD=aRM.get(cN);if(hImg(cD.el)){if(ew.length===0||!ew.some(e=>cD.cT.includes(e))){if(vwE.length===0||!vwE.some(e=>cD.cT.includes(e)))tS.add(cN)}}});if(cH&&cH.checked){const xK=vS.value.trim().split(/[\s ]+/).filter(k=>k);if(xK.length>0){aRM.forEach((da,rN)=>{if(hImg(da.el)){const bq=da.el.querySelector('blockquote');if(bq){const T=c('div');T.innerHTML=bq.innerHTML.replace(//gi,'\n');if(xK.some(k=>T.innerText.includes(k))){if(ew.length===0||!ew.some(e=>da.cT.includes(e))){if(vwE.length===0||!vwE.some(e=>da.cT.includes(e)))tS.add(rN)}}}}})}}vC.innerText='表示: '+tS.size+'件';Array.from(tS).sort((A,B)=>parseInt(A)-parseInt(B)).forEach(cN=>{const cD=aRM.get(cN);if(cD){const cB=c('div');cB.style.cssText='background:#F0E0D6;border:1px solid #800000;padding:10px;margin-bottom:10px;display:flow-root;font-size:14px;color:#800000;min-height:100px;position:relative';const jB=c('button');jB.innerText='元レスへ';jB.style.cssText='position:absolute;top:5px;right:5px;cursor:pointer;background:#fff;border:1px solid #800000;padding:2px 5px;font-size:10px;z-index:1';jB.onclick=()=>{bg.remove();cD.el.scrollIntoView({behavior:'smooth',block:'center'})};cB.appendChild(jB);const im=cD.el.querySelector('img');if(im){const iC=im.closest('a')?im.closest('a').cloneNode(true):im.cloneNode(true);iC.style.float='left';iC.style.margin='0 10px 10px 0';cB.appendChild(iC)}let fL='';if(cH&&cH.checked){const bq=cD.el.querySelector('blockquote');if(bq){const T=c('div');T.innerHTML=bq.innerHTML.replace(//gi,'\n');fL=T.innerText.split('\n').map(l=>{let s=l.trim();if(/^>/.test(s))return''+s+'';return s}).join('
')}}else{fL=cD.aL.map(l=>{if(/^>/.test(l))return''+l+'';return l}).join('
')}const tD=c('div');tD.innerHTML='No.'+cN+'
'+fL;cB.appendChild(tD);co.appendChild(cB)}})};md.appendChild(vH);md.appendChild(co);bg.appendChild(md);oW.appendChild(bg);const vSE=g('fE-vs'),vEE=g('fE-ve'),cHE=g('fE-vac');vSE.value=iVS;vEE.value=iVE;cHE.onchange=()=>{if(cHE.checked){vSE.disabled=true;vSE.style.background='#eee'}else{vSE.disabled=false;vSE.style.background='#fff'}rVL()};g('fE-vcb').onclick=()=>{bg.remove();rL()};bg.onclick=e=>{if(e.target===bg){bg.remove();rL()}};vSE.onkeydown=e=>{if(e.key==='Enter')rVL()};vEE.onkeydown=e=>{if(e.key==='Enter')rVL()};rVL()};vB.onclick=sV; /* # --- 【ブロック6】 メイン更新処理と起動 --- */ const rL=()=>{lA.innerHTML='';hE=[];hI_idx=0;const kS=sI.innerText.replace(/\r?\n/g,' ').trim(),eS=eI.innerText.replace(/\r?\n/g,' ').trim(),hS=hI.innerText.replace(/\r?\n/g,' ').trim();c_kS=kS;c_eS=eS;c_hS=hS;try{localStorage.setItem('fES',kS);localStorage.setItem('fEE',eS);localStorage.setItem('fEH',hS)}catch(e){}if(!kS)return;const kw=kS.split(/[\s ]+/).filter(k=>k),ew=eS?eS.split(/[\s ]+/).filter(k=>k):[],hw=hS?hS.split(/[\s ]+/).filter(k=>k):[];sMR();const fg=d.createDocumentFragment();aRM.forEach((da,rN)=>{if(!kw.some(k=>da.cT.includes(k)))return;if(ew.length>0&&ew.some(e=>da.cT.includes(e)))return;let dT=da.cT;if(hw.length>0){const eW=hw.map(w=>w.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')),rg=new RegExp('('+eW.join('|')+')','gi');dT=dT.replace(rg,'$1')}const ct=cM.has(rN)?Array.from(cM.get(rN)):[];if(ct.length>0)dT+='引用('+ct.length+')';const ctE=c('div');ctE.className='fE-ic';const cpB=c('button');cpB.className='fE-cb';cpB.innerText='❏';cpB.onclick=e=>{e.stopPropagation();const qCT=da.cT.split('\n').map(l=>'>'+l).join('\n');cTC(qCT,cpB,'❏')};const it=c('div');it.className='fE-i';it.innerHTML=(hImg(da.el)?'⧉ ':'')+dT;it.onclick=()=>sM(rN);ctE.appendChild(cpB);ctE.appendChild(it);fg.appendChild(ctE)});lA.appendChild(fg);hE=Array.from(lA.querySelectorAll('.fE-hl'))};hd.addEventListener('keydown',e=>{if(e.key==='Enter'&&e.target.classList.contains('fE-ib')){e.preventDefault();rL()}});setTimeout(rL,500)})();