309 lines
8.7 KiB
HTML
Executable File
309 lines
8.7 KiB
HTML
Executable File
<a id="adis-open-button" href="#">
|
|
<span class="glyphicon glyphicon-fire"></span>
|
|
</a>
|
|
<div id="adis-dashboard">
|
|
<header>
|
|
Autom. Disposition (ADis)
|
|
<a id="adis-dashboard-close-button">
|
|
<i class="fas fa-times"></i>
|
|
</a>
|
|
</header>
|
|
<section id="adis-dashboard-settings">
|
|
<div title="Arbeitet die ausgewählten Einsätze automatisch ab">
|
|
<a id="adis-setting-krankentransport-automatic" class="adis-setting-switch"></a>
|
|
Krankentransporte-Automatik
|
|
</div>
|
|
<div title="Arbeitet alle Einsätze automatisch ab">
|
|
<a id="adis-setting-full-automatic" class="adis-setting-switch"></a>
|
|
Eigene Einsätze-Automatik
|
|
</div>
|
|
<div title="Arbeitet die Sprechwünsche automatisch ab">
|
|
<a id="adis-setting-sprechwunsch-automatic" class="adis-setting-switch"></a>
|
|
Sprechwunsch-Automatik
|
|
</div>
|
|
<div title="Sendet automatisch Fahrzeuge zu Verbandseinsätzen, welche gerade abgearbeitet werden">
|
|
<a id="adis-setting-alliance-automatic" class="adis-setting-switch"></a>
|
|
Verbands-Automatik
|
|
</div>
|
|
<div title="Sendet automatisch Fahrzeuge zu Verband-Event Einsätzen, welche gerade abgearbeitet werden">
|
|
<a id="adis-setting-allianceevents-automatic" class="adis-setting-switch"></a>
|
|
VerbandsEvents-Automatik
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<style>
|
|
#adis-nav-item {
|
|
position: relative;
|
|
}
|
|
|
|
#adis-dashboard {
|
|
width: 364px;
|
|
overflow: hidden;
|
|
|
|
position: absolute;
|
|
top: calc(100% + 16px);
|
|
left: 50%;
|
|
z-index: 1000;
|
|
transform: translateX(-50%);
|
|
|
|
display: flex;
|
|
flex-flow: column nowrap;
|
|
justify-content: center;
|
|
align-items: center;
|
|
|
|
font-family: "Open Sans";
|
|
font-size: 14px;
|
|
font-weight: 400;
|
|
|
|
background: rgba(250, 250, 250, 1);
|
|
border-radius: 4px;
|
|
box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.48);
|
|
}
|
|
|
|
#adis-dashboard>header {
|
|
width: 100%;
|
|
height: 48px;
|
|
padding: 8px 24px;
|
|
margin: 0px;
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
|
|
line-height: 1;
|
|
font-size: 18px;
|
|
font-weight: 400;
|
|
}
|
|
|
|
#adis-dashboard-close-button {
|
|
width: 48px;
|
|
height: 48px;
|
|
|
|
position: absolute;
|
|
top: 0px;
|
|
right: 0px;
|
|
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
|
|
cursor: pointer;
|
|
}
|
|
|
|
#adis-dashboard-close-button img {
|
|
width: 12px;
|
|
height: 12px;
|
|
}
|
|
|
|
#adis-dashboard>section {
|
|
width: 100%;
|
|
padding: 16px 24px;
|
|
margin: 0px;
|
|
|
|
display: flex;
|
|
flex-flow: column nowrap;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
#adis-dashboard-switch-mode-button,
|
|
#adis-dashboard-open-dispatcher-button {
|
|
width: 80%;
|
|
height: 40px;
|
|
margin: 4px 0px;
|
|
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
|
|
text-decoration: none;
|
|
color: #fafafa;
|
|
cursor: pointer;
|
|
|
|
background: #43a047;
|
|
border-radius: 4px;
|
|
border-bottom: 3px solid rgba(0, 0, 0, 0.32);
|
|
}
|
|
|
|
#adis-dashboard-settings {
|
|
background: #e0e0e0;
|
|
border-top: 1px solid #757575;
|
|
}
|
|
|
|
#adis-dashboard-settings>div {
|
|
width: 100%;
|
|
height: 32px;
|
|
|
|
display: flex;
|
|
flex-flow: row nowrap;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
}
|
|
|
|
.adis-setting-switch {
|
|
width: 40px;
|
|
height: 16px;
|
|
margin-right: 16px;
|
|
|
|
background: #9e9e9e;
|
|
border-radius: 12px;
|
|
box-shadow: inset 0px 0px 3px 0px rgba(0, 0, 0, 0.20);
|
|
}
|
|
|
|
.adis-setting-switch.active {
|
|
background: #8bc34a;
|
|
}
|
|
|
|
.adis-setting-switch::after {
|
|
width: 22px;
|
|
height: 22px;
|
|
margin-top: -3px;
|
|
margin-left: -3px;
|
|
content: "";
|
|
display: block;
|
|
|
|
background: #fafafa;
|
|
border-radius: 12px;
|
|
box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.24);
|
|
transition: all 200ms;
|
|
}
|
|
|
|
.adis-setting-switch.active::after {
|
|
margin-left: calc(100% - 22px + 3px);
|
|
|
|
background: #5a9216;
|
|
box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.32);
|
|
transition: all 200ms;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
//
|
|
// Setting-Events
|
|
//
|
|
|
|
$(document).ready(function () {
|
|
|
|
//
|
|
// Click Events
|
|
//
|
|
|
|
$("#adis-setting-krankentransport-automatic").click(function () {
|
|
var tf = $(this).hasClass("active");
|
|
console.log(tf);
|
|
ADisDB.ADisSettings.put({
|
|
name: "Krankentransport-Automatic",
|
|
value: !tf ? 'true' : 'false'
|
|
}).then((res) => {
|
|
console.log(res);
|
|
ADis_UpdateSettings();
|
|
});
|
|
});
|
|
|
|
$("#adis-setting-full-automatic").click(function () {
|
|
var tf = $(this).hasClass("active");
|
|
console.log(tf);
|
|
ADisDB.ADisSettings.put({
|
|
name: "MissionsOwn-Automatic",
|
|
value: !tf ? 'true' : 'false'
|
|
}).then(() => {
|
|
ADis_UpdateSettings();
|
|
});
|
|
});
|
|
|
|
$("#adis-setting-sprechwunsch-automatic").click(function () {
|
|
var tf = $(this).hasClass("active");
|
|
console.log(tf);
|
|
ADisDB.ADisSettings.put({
|
|
name: "Sprechwunsch-Automatic",
|
|
value: !tf ? 'true' : 'false'
|
|
}).then(() => {
|
|
ADis_UpdateSettings();
|
|
});
|
|
});
|
|
|
|
$("#adis-setting-alliance-automatic").click(function () {
|
|
var tf = $(this).hasClass("active");
|
|
ADisDB.ADisSettings.put({
|
|
name: "Alliance-Automatic",
|
|
value: !tf ? 'true' : 'false'
|
|
}).then(() => {
|
|
ADis_UpdateSettings();
|
|
});
|
|
});
|
|
|
|
$("#adis-setting-alliance-automatic").click(function () {
|
|
var tf = $(this).hasClass("active");
|
|
ADisDB.ADisSettings.put({
|
|
name: "AllianceEvent-Automatic",
|
|
value: !tf ? 'true' : 'false'
|
|
}).then(() => {
|
|
ADis_UpdateSettings();
|
|
});
|
|
});
|
|
|
|
//
|
|
// Dashboard Functions
|
|
//
|
|
|
|
$("#adis-open-button").click(function () {
|
|
$("#adis-dashboard").css("display", "flex");
|
|
$("#adis-dashboard").animate({
|
|
opacity: 1
|
|
}, 200);
|
|
});
|
|
$("#adis-dashboard-close-button").click(function () {
|
|
$("#adis-dashboard").animate({
|
|
opacity: 0
|
|
}, 200, function () {
|
|
$(this).css("display", "none");
|
|
});
|
|
});
|
|
|
|
// initial call to load the current setting state
|
|
ADis_UpdateSettings();
|
|
});
|
|
|
|
//
|
|
// Display Settings
|
|
//
|
|
|
|
function ADis_UpdateSettings() {
|
|
ADisDB.ADisSettings.each((setting) => {
|
|
if (setting.name == "Krankentransport-Automatic") {
|
|
if (setting.value == "true") {
|
|
$("#adis-setting-krankentransport-automatic").addClass("active");
|
|
} else {
|
|
$("#adis-setting-krankentransport-automatic").removeClass("active");
|
|
}
|
|
} else if (setting.name == "Sprechwunsch-Automatic") {
|
|
if (setting.value == "true") {
|
|
$("#adis-setting-sprechwunsch-automatic").addClass("active");
|
|
} else {
|
|
$("#adis-setting-sprechwunsch-automatic").removeClass("active");
|
|
}
|
|
} else if (setting.name == "MissionsOwn-Automatic") {
|
|
if (setting.value == "true") {
|
|
$("#adis-setting-full-automatic").addClass("active");
|
|
} else {
|
|
$("#adis-setting-full-automatic").removeClass("active");
|
|
}
|
|
} else if (setting.name == "Alliance-Automatic") {
|
|
if (setting.value == "true") {
|
|
$("#adis-setting-alliance-automatic").addClass("active");
|
|
} else {
|
|
$("#adis-setting-alliance-automatic").removeClass("active");
|
|
}
|
|
} else if (setting.name == "AllianceEvents-Automatic") {
|
|
if (setting.value == "true") {
|
|
$("#adis-setting-allianceevents-automatic").addClass("active");
|
|
} else {
|
|
$("#adis-setting-allianceevents-automatic").removeClass("active");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
</script> |