got rid of stray JavaScript in results-page, still need to remove commented out test scripts
This commit is contained in:
parent
4613bb6d83
commit
b7276c1b5e
@ -10,3 +10,15 @@ $(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$.each($('td'), function () {
|
||||
if ($(this).html().startsWith("Score: 0")) {
|
||||
$(this).css({"background-color": "green", "color": "white"});
|
||||
}
|
||||
else if ($(this).html().startsWith("Score: ")) {
|
||||
$(this).css({"background-color": "red", "color": "white"});
|
||||
}
|
||||
});
|
||||
|
||||
console.log("CAN I SEE THIS?");
|
||||
|
@ -32,10 +32,13 @@
|
||||
<script src="https://cdn.datatables.net/v/dt/dt-1.10.16/r-2.2.1/datatables.min.js"></script>
|
||||
<script type="text/javascript" charset="utf8"
|
||||
src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap5.js"></script>
|
||||
<script type="text/javascript" href="/static/javascript.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<!--<script type="text/javascript" src="static/javascript.js"></script> -->
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js' )}}"></script>
|
||||
|
||||
|
||||
{% block scripts %}{% endblock %}
|
||||
|
||||
{% block scripts %} {% endblock %}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<!--
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="static/javascript.js"></script>
|
||||
-->
|
||||
|
||||
<div class="errors-container">
|
||||
{% if error in errors %}
|
||||
@ -70,29 +72,81 @@
|
||||
{% block scripts %}
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#data').DataTable({
|
||||
paging: true,
|
||||
searching: true,
|
||||
info: true,
|
||||
columnDefs: [{
|
||||
targets: '_all',
|
||||
createdCell: function (td, cellData, rowData, row, col) {
|
||||
if (cellData == 'outlook.com' && col == 0) {
|
||||
$(td).css({'background-color': 'red', 'color': 'white'});
|
||||
console.log(cellData);
|
||||
}
|
||||
if (cellData.startsWith('Score: 0') && col == 1) {
|
||||
console.log("TEST", cellData);
|
||||
$(td).css({'background-color': 'green', 'color': 'white'});
|
||||
}
|
||||
else if (!cellData.startsWith('Score: 0') && col == 1) {
|
||||
$(td).css({'background-color': 'red', 'color': 'white'});
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
});
|
||||
// var data = $('#data').DataTable().rows().data();
|
||||
// console.log("USING .data()", data)
|
||||
// data.each(function (value, index) {
|
||||
// console.log('data in index: ' + index + 'is: ' + value);
|
||||
// });
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// $(document).ready(function () {
|
||||
// $('#data').DataTable({
|
||||
// paging: true,
|
||||
// searching: true,
|
||||
// info: true,
|
||||
// columnDefs: [{
|
||||
// targets: '_all',
|
||||
// createdCell: function (td, cellData, rowData, row, col) {
|
||||
// if (cellData == 'outlook.com' && col == 0) {
|
||||
// $(td).css({'background-color': 'red', 'color': 'white'});
|
||||
// }
|
||||
//
|
||||
// if (cellData.startsWith('Score: 0') && col == 1) {
|
||||
// console.log("TEST", td, cellData);
|
||||
// $(td).css({'background-color': 'green', 'color': 'white'});
|
||||
// }
|
||||
// else if (!cellData.startsWith('Score: 0') && col == 1) {
|
||||
// $(td).css({'background-color': 'red', 'color': 'white'});
|
||||
// console.log()
|
||||
// }
|
||||
// }
|
||||
// }]
|
||||
// });
|
||||
// });
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// if ($("td".startsWith("Score: 0"))) {
|
||||
// ($("td").css("color", "red"));
|
||||
// console.log("TESTING 2: ", ($("td")));
|
||||
// }
|
||||
</script>
|
||||
<script>
|
||||
// $("td").each(function () {
|
||||
// $cell = $(this);
|
||||
// if ($cell.text().startsWith("Score: 0")) {
|
||||
// $cell.css({"background-color": "green", "color": "white"});
|
||||
// }
|
||||
// else if ($cell.text().startswith("Score: ")) {
|
||||
// $cell.css({
|
||||
// "background-color": "red", "color": "white"
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// })
|
||||
</script>
|
||||
<script>
|
||||
// $("td").each(function () {
|
||||
// cell = $(this);
|
||||
// // console.log($cell[0].firstChild.textContent);
|
||||
// if (cell[0].firstChild.textContent.startsWith("Score: 0")) {
|
||||
// cell.css({"background-color": "green", "color": "white"});
|
||||
// }
|
||||
// else if (cell[0].firstChild.textContent.startsWith("Score: ")) {
|
||||
// cell.css({"background-color": "red", "color": "white"});
|
||||
// }
|
||||
// })
|
||||
</script>
|
||||
<script>
|
||||
// $.each($('td'), function () {
|
||||
// if ($(this).html().startsWith("Score: 0")) {
|
||||
// $(this).css({"background-color": "green", "color": "white"});
|
||||
// }
|
||||
// else if ($(this).html().startsWith("Score: ")) {
|
||||
// $(this).css({"background-color": "red", "color": "white"});
|
||||
// }
|
||||
// })
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user