MCPcopy Create free account
hub / github.com/davidkingzyb/SCAST / onFlowClick

Function onFlowClick

js/common.js:253–274  ·  view source on GitHub ↗
(n,file,time=5000)

Source from the content-addressed store, hash-verified

251 onFlowClick(id,node._file)
252}
253function onFlowClick(n,file,time=5000){
254 var node=gMermaid.FlowNode[n]
255 if(!node)return
256 var fileid=file.replace('.','_')
257 console.log(`flow click ${n} ${fileid} ${file}(${node.poi.line}:${node.poi.start})`,node)
258 document.getElementById('code_con').open=open;
259 var $detail=document.getElementById('detail_'+fileid)
260 $detail.open=true
261 var $line=document.querySelectorAll(`#detail_${fileid} .hljs-ln-line`)
262 for(let $l of $line){
263 if($l.getAttribute('data-line-number')==node.poi.line){
264 $l.style.backgroundColor = "#ff702e";
265 $l.scrollIntoView({behavior:'smooth',block:'center',inline:'center'})
266 document.getElementById('code_con').scrollBy(0,-100)
267 setTimeout(()=>{
268 $l.style.backgroundColor = "#ffb02e";
269 },3000)
270 break;
271 }
272 }
273 if(node._analysis)wtfmsg(`${gIconmap[node.type]}${node.value||node._value}:${node._analysis}`,time)
274}
275var gIconmap={
276 "NewExpression":'🆕',
277 "CallExpression":'📞',

Callers 2

onFDPClickFunction · 0.85
onOutlineIconClickFunction · 0.85

Calls 1

wtfmsgFunction · 0.85

Tested by

no test coverage detected