moved javascript from html file to external script
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<script src="static/js/bootstrap.min.js"></script>
|
||||
<script src="static/js/websocket.js"></script>
|
||||
<script src="static/js/dtc_table.js"></script>
|
||||
<script src="static/js/script.js" type="text/javascript"></script>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/img/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/img/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/img/favicon-16x16.png">
|
||||
@@ -791,49 +792,8 @@
|
||||
|
||||
<!-- Modal Dialog -->
|
||||
|
||||
<script>
|
||||
$('.navbar-nav>li>a').on('click', function () {
|
||||
$('.navbar-collapse').collapse('hide');
|
||||
});
|
||||
|
||||
document.querySelector('.custom-file-input').addEventListener('change', function (e) {
|
||||
var fileName = document.getElementById("fw-update-file").files[0].name;
|
||||
var nextSibling = e.target.nextElementSibling
|
||||
nextSibling.innerText = fileName
|
||||
});
|
||||
|
||||
$('table').on('click', 'tr[data-dtc]', function () {
|
||||
var dtc = $(this).data('dtc');
|
||||
var debugval = $(this).data('debugval');
|
||||
var modal = $('#dtcModal');
|
||||
|
||||
getDescriptionForDTCNumber(dtc, function (error, title, description) {
|
||||
if (error)
|
||||
{
|
||||
console.error("Fehler beim Abrufen der Beschreibung:", error);
|
||||
modal.find('.modal-title').text("Fehler")
|
||||
modal.find('.dtc-desc').text("DTC-Beschreibung konnte nicht geladen werden")
|
||||
}
|
||||
else
|
||||
{
|
||||
modal.find('.modal-title').text(title)
|
||||
modal.find('.dtc-desc').text(description)
|
||||
if (debugval > 0)
|
||||
{
|
||||
modal.find('.dtc-debugval').text("Debugvalue: " + debugval)
|
||||
}
|
||||
else
|
||||
{
|
||||
modal.find('.dtc-debugval').remove()
|
||||
}
|
||||
}
|
||||
});
|
||||
// Modal anzeigen
|
||||
modal.modal('show');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user