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:var(--fE-bg);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);transition:transform .3s ease}#fE-s.fE-dark{--fE-bg:#1a1a1a;--fE-bg2:#2a2020;--fE-bg3:#2e2424;--fE-txt:#e8d5b0;--fE-brd:#a05050}#fE-s:not(.fE-dark){--fE-bg:#F5F5DC;--fE-bg2:#F0E0D6;--fE-bg3:#FFE;--fE-txt:#800000;--fE-brd:#800000}#fE-s{color:var(--fE-txt)}#fE-h{padding:6px 10px;border-bottom:1px solid var(--fE-brd);background:var(--fE-bg);position:relative;cursor:move}#fE-btns{display:flex;gap:4px;margin-bottom:4px}#fE-btns button{cursor:pointer;background:var(--fE-bg);border:1px solid var(--fE-brd);color:var(--fE-txt);padding:2px 8px;font-size:12px;flex:1}#fE-btns button.fE-on{background:var(--fE-brd);color:var(--fE-bg)}#fE-cfg{overflow:hidden;transition:max-height .2s ease}#fE-cfg.fE-hide{max-height:0!important}.fE-hl-row{margin-bottom:4px;display:flex;align-items:center;width:100%;border-top:1px solid var(--fE-brd);padding-top:4px}.fE-hl-row label{width:40px;font-size:12px;cursor:default;flex-shrink:0}.fE-r{margin-bottom:4px;display:flex;align-items:center;width:100%}.fE-r label{width:40px;font-size:12px;cursor:default;flex-shrink:0}.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;color:#333}.fE-ib:empty:before{content:attr(data-placeholder);color:#888}#fE-ai{width:38px;border:1px solid var(--fE-brd);padding:2px;font-size:12px;text-align:center;background:var(--fE-bg);color:var(--fE-txt)}#fE-jup,#fE-jdn{cursor:pointer;background:var(--fE-bg);border:1px solid var(--fE-brd);color:var(--fE-txt);padding:2px 4px;font-size:10px;line-height:1}#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:var(--fE-bg2);color:var(--fE-txt);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 var(--fE-brd);padding:5px;cursor:pointer;background:var(--fE-bg2);color:var(--fE-txt);font-size:14px;word-break:break-all;min-height:40px;display:flow-root}.fE-rn{font-weight:bold;font-size:12px;display:flex;align-items:center;gap:4px;border-bottom:1px solid var(--fE-brd);margin-bottom:2px;cursor:pointer;color:var(--fE-txt)}.fE-rn:hover{text-decoration:underline}.fE-rn-ico{font-size:10px;opacity:.7}.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:6px 10px;border-bottom:1px solid #800000;background:#F5F5DC}#fE-vh-r1,#fE-vh-r2{display:flex;align-items:center;gap:4px;margin-bottom:4px}#fE-vh-r2{margin-bottom:0}.fE-vl{font-size:12px;white-space:nowrap;color:#800000}.fE-vi{flex:1;border:1px solid #ccc;padding:2px;font-size:12px;background:#fff;color:#333;min-width:0}.fE-vi:disabled{background:#ddd;color:#999}#fE-s.fE-min{transform:translateX(100%)}#fE-tg{position:absolute;left:-24px;top:50%;transform:translateY(-50%);width:24px;height:40px;background:var(--fE-bg);border:1px solid var(--fE-brd);border-right:none;color:var(--fE-txt);cursor:pointer;z-index:10002;display:flex;align-items:center;justify-content:center;border-radius:4px 0 0 4px;font-size:12px;font-weight:bold}#fE-scrl{position:absolute;top:5px;right:20px;display:flex;flex-direction:column;gap:2px;z-index:10}.fE-sb{background:var(--fE-bg);border:1px solid var(--fE-brd);color:var(--fE-txt);cursor:pointer;padding:2px 5px;font-size:12px;opacity:0.7}.fE-sb:hover{opacity:1}'; d.head.appendChild(st); /* # --- 【ブロック2】 UI構築と初期設定 --- */ 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 tgB=c('button');tgB.id='fE-tg';tgB.innerText='⇔';tgB.title='サイドバー格納/展開';sb.appendChild(tgB); const hd=c('div');hd.id='fE-h';sb.appendChild(hd); /* ボタン行 */ const bRow=c('div');bRow.id='fE-btns';hd.appendChild(bRow); const uB=c('button');uB.id='fE-u';uB.innerText='更新';bRow.appendChild(uB); const aB=c('button');aB.id='fE-a';aB.innerText='自動';bRow.appendChild(aB); const stB=c('button');stB.id='fE-st2';stB.innerText='設定';bRow.appendChild(stB); const vB=c('button');vB.id='fE-v';vB.innerText='閲覧';bRow.appendChild(vB); const cB=c('button');cB.id='fE-c';cB.innerText='終了';bRow.appendChild(cB); /* 設定パネル(デフォルト格納) */ const cfg=c('div');cfg.id='fE-cfg';cfg.className='fE-hide';hd.appendChild(cfg); 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';cfg.appendChild(sR); sR.innerHTML='
'; const dkB=c('button');dkB.id='fE-dk';dkB.innerText='🌙';dkB.style.cssText='cursor:pointer;background:var(--fE-bg);border:1px solid var(--fE-brd);color:var(--fE-txt);padding:2px 5px;font-size:12px;margin-left:3px;flex-shrink:0';sR.appendChild(dkB); /* 除外行:自動更新秒数スロット付き */ const eR=c('div');eR.className='fE-r';cfg.appendChild(eR); eR.innerHTML='
'; const aiLabel=c('span');aiLabel.style.cssText='font-size:11px;margin-left:3px;flex-shrink:0;color:var(--fE-txt)';aiLabel.innerText='秒'; const aiInput=c('input');aiInput.type='number';aiInput.id='fE-ai';aiInput.min='10';aiInput.max='3600';aiInput.value='60';aiInput.title='自動更新間隔(秒)'; try{aiInput.value=localStorage.getItem('fEAI')||'60'}catch(e){} eR.appendChild(aiInput);eR.appendChild(aiLabel); const sI=g('fE-si');sI.innerText=iS; const eI=g('fE-ei');eI.innerText=iE; /* 設定展開/格納 */ const openCfg=()=>{cfg.style.maxHeight=cfg.scrollHeight+50+'px';cfg.classList.remove('fE-hide');stB.classList.add('fE-on')}; const closeCfg=()=>{cfg.style.maxHeight='0';cfg.classList.add('fE-hide');stB.classList.remove('fE-on')}; stB.onclick=()=>{if(cfg.classList.contains('fE-hide'))openCfg();else closeCfg()}; /* ダークモードトグル */ let darkOn=false;try{darkOn=localStorage.getItem('fEDK')==='1'}catch(e){} const applyDark=()=>{if(darkOn){sb.classList.add('fE-dark');dkB.innerText='☀'}else{sb.classList.remove('fE-dark');dkB.innerText='🌙'}}; applyDark(); dkB.onclick=()=>{darkOn=!darkOn;try{localStorage.setItem('fEDK',darkOn?'1':'0')}catch(e){}applyDark()}; /* 強調バー:設定パネル外・常時表示 */ const hRow=c('div');hRow.className='fE-hl-row';hd.appendChild(hRow); hRow.innerHTML='
'; const hI=g('fE-hi'); const jUpB=g('fE-jup'),jDnB=g('fE-jdn'); try{hI.innerText=localStorage.getItem('fEH')||''}catch(e){} /* 強調バー:エンターで▼ボタンと同じ挙動(ジャンプ)を実行 */ hI.onkeydown=e=>{if(e.key==='Enter'){e.preventDefault();jDnB.click()}}; /* レス表示エリアとスクロールジャンプボタンのラッパー */ const lAW=c('div');lAW.style.cssText='position:relative;flex:1;display:flex;flex-direction:column;overflow:hidden'; const lA=c('div');lA.id='fE-l'; const scrl=c('div');scrl.id='fE-scrl'; scrl.innerHTML=''; lAW.appendChild(lA);lAW.appendChild(scrl);sb.appendChild(lAW); /* # --- 【ブロック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=''; let autoTimer=null,autoOn=false; hd.onmousedown=e=>{if(e.target.closest('button,input,.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'); /* 【修正点】格納ボタン・スクロールジャンプボタンのクリック処理追加 */ const tgBtn=g('fE-tg'),sUpBtn=g('fE-sup'),sDnBtn=g('fE-sdn'); if(tgBtn)tgBtn.onclick=()=>sb.classList.toggle('fE-min'); if(sUpBtn)sUpBtn.onclick=()=>lA.scrollTop=0; if(sDnBtn)sDnBtn.onclick=()=>lA.scrollTop=lA.scrollHeight; /* スレッド更新:scrlf リロード + 続きを読むボタン を両方実行 */ const reloadThread=()=>{ const lk=d.querySelector('a[onclick*="scrlf"]');if(lk)lk.click(); const more=d.getElementById('fvw_loading');if(more)more.click(); }; /* 自動更新の開始・停止 */ const startAuto=()=>{ if(autoTimer)clearInterval(autoTimer); autoOn=true;aB.classList.add('fE-on'); const sec=Math.max(10,parseInt(g('fE-ai').value)||60); try{localStorage.setItem('fEAI',sec)}catch(e){} autoTimer=setInterval(()=>{ window.scrollTo({top:d.documentElement.scrollHeight,behavior:'smooth'}); reloadThread(); setTimeout(()=>{rL();lA.scrollTop=lA.scrollHeight},800); },sec*1000); }; const stopAuto=()=>{clearInterval(autoTimer);autoTimer=null;autoOn=false;aB.classList.remove('fE-on')}; /* クリックイベント(モーダル閉じた後の再描画) */ 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){clearTimeout(window._fEdU);window._fEdU=setTimeout(rL,300)}}; d.addEventListener('click',cE,true);window.addEventListener('scroll',sE); /* 更新ボタン:スレッド更新(scrlf+続きを読む)→サイドバー再描画 */ uB.onclick=()=>{reloadThread();setTimeout(rL,800)}; /* 自動ボタン:トグル */ aB.onclick=()=>{autoOn?stopAuto():startAuto()}; /* 終了 */ cB.onclick=()=>{stopAuto();oW.remove();st.remove();aRM.clear();cM.clear();hE=[];d.removeEventListener('click',cE,true);window.removeEventListener('scroll',sE)}; /* ▲▼ ジャンプ */ jUpB.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;hI_idx--;if(hI_idx<0)hI_idx=hE.length-1;hE[hI_idx].scrollIntoView({behavior:'smooth',block:'center'})}; jDnB.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='',iVF='',iVCon=false; try{if(localStorage.getItem('fEVS')!==null)iVS=localStorage.getItem('fEVS');if(localStorage.getItem('fEVE')!==null)iVE=localStorage.getItem('fEVE');if(localStorage.getItem('fEVF')!==null)iVF=localStorage.getItem('fEVF');iVCon=localStorage.getItem('fEVCon')==='1'}catch(e){} const vH=c('div');vH.id='fE-vh';vH.style.cssText='display:flex;flex-direction:column;gap:8px;padding:10px;border-bottom:1px solid #800000;background:#F5F5DC'; const r1=c('div');r1.style.cssText='display:flex;align-items:center;gap:8px'; r1.innerHTML=''; const r2=c('div');r2.style.cssText='display:flex;align-items:center;gap:8px'; r2.innerHTML=''; vH.appendChild(r1);vH.appendChild(r2); const co=c('div');co.id='fE-mco'; const rVL=()=>{ co.innerHTML=''; const vS=g('fE-vs'),vE=g('fE-ve'),vF=g('fE-vf'),cH=g('fE-vac'),vC=g('fE-vc'); try{localStorage.setItem('fEVS',vS.value);localStorage.setItem('fEVE',vE.value);localStorage.setItem('fEVF',vF.value);localStorage.setItem('fEVCon',cH.checked?'1':'0')}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):[]; 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(cD&&hImg(cD.el)){ if(ew.length===0||!ew.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))) tS.add(rN)}}}})} const vwE=vE.value.trim().split(/[\s ]+/).filter(k=>k), vwF=vF.value.trim().split(/[\s ]+/).filter(k=>k); let fSet=new Set(); tS.forEach(cN=>{ const cD=aRM.get(cN); let kp=true; if(vwE.length>0&&vwE.some(e=>cD.cT.includes(e)))kp=false; if(kp&&vwF.length>0&&!vwF.some(f=>cD.cT.includes(f)))kp=false; if(kp)fSet.add(cN)}); tS=fSet} 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'),vFE=g('fE-vf'),cHE=g('fE-vac'); vSE.value=iVS;vEE.value=iVE;vFE.value=iVF;cHE.checked=iVCon; const updG=()=>{ const on=cHE.checked; [vSE,vEE,vFE].forEach(el=>{el.disabled=on;el.style.background=on?'#eee':'#fff'}); }; cHE.onchange=()=>{updG();rVL()}; g('fE-vcb').onclick=()=>{bg.remove();rL()}; bg.onclick=e=>{if(e.target===bg){bg.remove();rL()}}; const pd=e=>{if(e.key==='Enter'){e.preventDefault();e.target.blur()}}; [vSE,vEE,vFE].forEach(el=>{el.onkeydown=pd;el.onblur=()=>rVL()}); updG();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'; /* レス番号:クリックで元レスへジャンプ */ const rnSpan=c('span');rnSpan.className='fE-rn';rnSpan.innerHTML='No.'+rN+' ';rnSpan.onclick=e=>{e.stopPropagation();da.el.scrollIntoView({behavior:'smooth',block:'center'})}; it.appendChild(rnSpan); const bodySpan=c('span');bodySpan.innerHTML=(hImg(da.el)?'⧉ ':'')+dT;it.appendChild(bodySpan); it.onclick=()=>sM(rN);ctE.appendChild(cpB);ctE.appendChild(it);fg.appendChild(ctE)});lA.appendChild(fg);hE=Array.from(lA.querySelectorAll('.fE-hl'))}; /* 全入力バー:Enterで確定 */ cfg.addEventListener('keydown',e=>{if(e.key==='Enter'&&(e.target.classList.contains('fE-ib'))){e.preventDefault();rL()}}); setTimeout(rL,500)})();