add highlight link feature
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
<meta charset="utf-8">
|
||||
<title>Script Viewer</title>
|
||||
<link rel="stylesheet" href="{{static_css}}">
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.0/dist/jquery.min.js"></script>
|
||||
<script src="{{static_js}}"></script>
|
||||
</head>
|
||||
|
||||
@ -31,21 +32,21 @@
|
||||
<div>
|
||||
{# blocks content #}
|
||||
{% for i in blocks %}
|
||||
<div class="block-body" style="height: {{ i[12] }}px; width: {{ i[11] }}px; top: {{ i[10] }}px; left: {{ i[9] }}px;">
|
||||
<div class="block-body" style="height: {{ i[12] }}px; width: {{ i[11] }}px; top: {{ i[10] }}px; left: {{ i[9] }}px;" onclick="highlightLink({{ i[1] }});">
|
||||
{% if i[4] != '{}' %}
|
||||
<div class="block-target" title="{{ "Name: %s\nType: %s"|format(*pinDecoder2(i[4])) }}" style="height: 6px; width: 6px; top: 0; left: 0;"></div>
|
||||
<div class="block-target" title="{{ "Name: %s\nType: %s"|format(*pinDecoder2(i[4])) }}" style="height: 6px; width: 6px; top: 0; left: 0;" onclick="highlightLink({{ pinDecoder(i[4]).id }});"></div>
|
||||
{% endif %}
|
||||
{% for pin in pinDecoder(i[5]) %}
|
||||
<div class="block-p" title="{{ "Name: %s\nType: %s"|format(pin.name, pin.type) }}" style="height: 6px; width: 6px; top: 0; left: {{ 20 + loop.index0 * ( 6 + 20) }}px;"></div>
|
||||
<div class="block-p" title="{{ "Name: %s\nType: %s"|format(pin.name, pin.type) }}" style="height: 6px; width: 6px; top: 0; left: {{ 20 + loop.index0 * ( 6 + 20) }}px;" onclick="highlightLink({{ pin.id }});"></div>
|
||||
{% endfor %}
|
||||
{% for pout in pinDecoder(i[6]) %}
|
||||
<div class="block-p" title="{{ "Name: %s\nType: %s"|format(pout.name, pout.type) }}" style="height: 6px; width: 6px; bottom: 0; left: {{ 20 + loop.index0 * ( 6 + 20) }}px;"></div>
|
||||
<div class="block-p" title="{{ "Name: %s\nType: %s"|format(pout.name, pout.type) }}" style="height: 6px; width: 6px; bottom: 0; left: {{ 20 + loop.index0 * ( 6 + 20) }}px;" onclick="highlightLink({{ pout.id }});"></div>
|
||||
{% endfor %}
|
||||
{% for bin in pinDecoder(i[7]) %}
|
||||
<div class="block-b" title="{{ "Name: %s\nType: %s"|format(bin.name, bin.type) }}" style="height: 6px; width: 6px; top: {{ 10 + loop.index0 * ( 6 + 20) }}px; left: 0;"></div>
|
||||
<div class="block-b" title="{{ "Name: %s\nType: %s"|format(bin.name, bin.type) }}" style="height: 6px; width: 6px; top: {{ 10 + loop.index0 * ( 6 + 20) }}px; left: 0;" onclick="highlightLink({{ bin.id }});"></div>
|
||||
{% endfor %}
|
||||
{% for bout in pinDecoder(i[8]) %}
|
||||
<div class="block-b" title="{{ "Name: %s\nType: %s"|format(bout.name, bout.type) }}" style="height: 6px; width: 6px; top: {{ 10 + loop.index0 * ( 6 + 20) }}px; right: 0;"></div>
|
||||
<div class="block-b" title="{{ "Name: %s\nType: %s"|format(bout.name, bout.type) }}" style="height: 6px; width: 6px; top: {{ 10 + loop.index0 * ( 6 + 20) }}px; right: 0;" onclick="highlightLink({{ bout.id }});"></div>
|
||||
{% endfor %}
|
||||
|
||||
{% if i[13] != -1 %}
|
||||
@ -72,8 +73,8 @@
|
||||
{% elif i[1] == -1 %}
|
||||
{# todo: finish plink #}
|
||||
{% else %}
|
||||
<line x1="{{ i[8] }}" y1="{{ i[9] }}" x2="{{ i[10] }}" y2="{{ i[11] }}" stroke="black" stroke-width="1px"></line>
|
||||
<text class="link-delay" x="{{ (i[8] + i[10]) / 2 }}" y="{{ (i[9] + i[11]) / 2 }}" fill="black">{{ i[1] }}</text>
|
||||
<line class="link-blink target{{ i[2] }} target{{ i[3] }} target{{ i[4] }} target{{ i[5] }}" x1="{{ i[10] }}" y1="{{ i[11] }}" x2="{{ i[12] }}" y2="{{ i[13] }}" stroke="black" stroke-width="1px"></line>
|
||||
<text class="link-blinkDelay target{{ i[2] }} target{{ i[3] }} link-delay target{{ i[4] }} target{{ i[5] }}" x="{{ (i[10] + i[12]) / 2 }}" y="{{ (i[11] + i[13]) / 2 }}" fill="black">{{ i[1] }}</text>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<!-- <line x1="320" y1="200" x2="100" y2="100" stroke="blue" stroke-width="1px" stroke-dasharray="10, 5">
|
||||
|
Reference in New Issue
Block a user