new: Add unflag all, cleanup.

pull/81/head
Raphaël Vinot 2020-07-28 18:26:07 +02:00
parent 9ce11c1718
commit fcec79519f
6 changed files with 25 additions and 24 deletions

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -95,19 +95,23 @@ function LocateNode(urlnode_uuid) {
.style('font-size', '16px');
};
function UnflagAllNodes() {
d3.selectAll('.node_data').select('rect').style('fill', 'white');
d3.selectAll('.node_data').select('text').style('fill', 'black');
d3.selectAll('.node_data').select("#flag")
.text("🏁")
.on('click', function(d) {
PermanentNodeHighlight(d.data.uuid);
});
};
function UnflagHostNode(hostnode_uuid) {
var to_fill = d3.select("#node_" + hostnode_uuid).select('rect');
to_fill
.style('fill', 'white');
var to_fill = d3.select("#node_" + hostnode_uuid).select('text');
to_fill
.style('fill', 'black');
d3.select("#node_" + hostnode_uuid).select('rect').style('fill', 'white');
d3.select("#node_" + hostnode_uuid).select('text').style('fill', 'black');
d3.select("#node_" + hostnode_uuid).select("#flag")
.text("🏁")
.on('click', function(d) {
PermanentNodeHighlight(hostnode_uuid);
PermanentNodeHighlight(d.data.uuid);
});
};
@ -115,18 +119,12 @@ function PermanentNodeHighlight(hostnode_uuid) {
var element = document.getElementById("node_" + hostnode_uuid);
element.scrollIntoView({behavior: "smooth", block: "center", inline: "nearest"});
var to_fill = d3.select("#node_" + hostnode_uuid).select('rect');
to_fill
.style('fill', 'black');
var to_fill = d3.select("#node_" + hostnode_uuid).select('text');
to_fill
.style('fill', 'white');
d3.select("#node_" + hostnode_uuid).select('rect').style('fill', 'black');
d3.select("#node_" + hostnode_uuid).select('text').style('fill', 'white');
d3.select("#node_" + hostnode_uuid).select("#flag")
.text('❌')
.on('click', function(d) {
UnflagHostNode(hostnode_uuid);
UnflagHostNode(d.data.uuid);
});
};

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -66,7 +66,7 @@
</div>
<div style="display: inline;">
<button type="button" class="btn btn-link" data-toggle="collapse" data-target="#menu">
<img src="{{ url_for('static', filename='minimize2.jpg') }}" alt="Minimize menu" height="25" width="25">
<img src="{{ url_for('static', filename='up.jpg') }}" alt="Minimize menu" height="25" width="25">
</button>
</div>
</center>
@ -79,6 +79,9 @@
<a href="#statsModal" data-remote="{{ url_for('stats', tree_uuid=tree_uuid) }}"
data-toggle="modal" data-target="#statsModal" role="button">Show Statistics</a>
</li>
<li>
<a href="#unflag" role="button" onclick="UnflagAllNodes();">Unflag all nodes</a>
</li>
{% if enable_mail_notification %}
<li>
<a href="#emailModal" data-toggle="modal" data-target="#emailModal" role="button">Notify by mail</a>
@ -89,7 +92,7 @@
<div style="width: 100px">
<div style="display: inline;">
<button type="button" class="btn btn-link" data-toggle="collapse" data-target="#menu">
<img src="{{ url_for('static', filename='maximize2.jpg') }}" alt="Maximize" height="40" width="40">
<img src="{{ url_for('static', filename='down.jpg') }}" alt="Maximize" height="40" width="40">
</button>
</div>
<div style="display: inline">
@ -106,7 +109,7 @@
</div>
<div style="display: inline;">
<button type="button" class="btn btn-link" data-toggle="collapse" data-target="#legend">
<img src="{{ url_for('static', filename='minimize2.jpg') }}" alt="Minimize legend" height="25" width="25">
<img src="{{ url_for('static', filename='down.jpg') }}" alt="Minimize legend" height="25" width="25">
</button>
</div>
</center>
@ -153,7 +156,7 @@
<div style="width: 100px">
<div style="display: inline;">
<button type="button" class="btn btn-link" data-toggle="collapse" data-target="#legend">
<img src="{{ url_for('static', filename='maximize2.jpg') }}" alt="Maximize legend" height="40" width="40">
<img src="{{ url_for('static', filename='up.jpg') }}" alt="Maximize legend" height="40" width="40">
</button>
</div>
<div style="display: inline">
@ -171,7 +174,7 @@
</div>
<div style="display: inline;">
<button type="button" class="btn btn-link" data-toggle="collapse" data-target="#tree-details">
<img src="{{ url_for('static', filename='minimize1.jpg') }}"
<img src="{{ url_for('static', filename='down.jpg') }}"
alt="Minimize tree details" height="25" width="25">
</button>
</div>
@ -194,7 +197,7 @@
<div style="width: 100px;float: right;">
<div style="display: inline;">
<button type="button" class="btn btn-link" data-toggle="collapse" data-target="#tree-details">
<img src="{{ url_for('static', filename='maximize1.jpg') }}" alt="Minimize tree details" height="40" width="40">
<img src="{{ url_for('static', filename='up.jpg') }}" alt="Minimize tree details" height="40" width="40">
</button>
</div>
<div style="display: inline">