commit 04/11/2025

This commit is contained in:
2025-11-04 17:02:53 +07:00
parent fc1291dcd5
commit 72c509feec
16 changed files with 18196 additions and 172 deletions

15860
html/semiauto/assets/css/bootstrap.min.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,516 @@
/* !
* Select2 Bootstrap Theme v0.1.0-beta.10 (https://select2.github.io/select2-bootstrap-theme)
* Copyright 2015-2017 Florian Kissling and contributors (https://github.com/select2/select2-bootstrap-theme/graphs/contributors)
* Licensed under MIT (https://github.com/select2/select2-bootstrap-theme/blob/master/LICENSE) */
.select2-container--bootstrap {
display: block;
}
.select2-container--bootstrap .select2-selection {
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
background-color: #fff;
border: 1px solid #ccc;
border-radius: 4px;
color: #555;
font-size: 14px;
outline: 0;
}
.select2-container--bootstrap .select2-selection.form-control {
border-radius: 4px;
}
.select2-container--bootstrap .select2-search--dropdown .select2-search__field {
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
background-color: #fff;
border: 1px solid #ccc;
border-radius: 4px;
color: #555;
font-size: 14px;
}
.select2-container--bootstrap .select2-search__field {
outline: 0;
}
.select2-container--bootstrap .select2-search__field::-webkit-input-placeholder {
color: #999;
}
.select2-container--bootstrap .select2-search__field:-moz-placeholder {
color: #999;
}
.select2-container--bootstrap .select2-search__field::-moz-placeholder {
color: #999;
opacity: 1;
}
.select2-container--bootstrap .select2-search__field:-ms-input-placeholder {
color: #999;
}
.select2-container--bootstrap .select2-results__option {
padding: 6px 12px;
}
.select2-container--bootstrap .select2-results__option[role=group] {
padding: 0;
}
.select2-container--bootstrap .select2-results__option[aria-disabled=true] {
color: #777;
cursor: not-allowed;
}
.select2-container--bootstrap .select2-results__option[aria-selected=true] {
background-color: #f5f5f5;
color: #262626;
}
.select2-container--bootstrap .select2-results__option--highlighted[aria-selected] {
background-color: #337ab7;
color: #fff;
}
.select2-container--bootstrap .select2-results__option .select2-results__option {
padding: 6px 12px;
}
.select2-container--bootstrap .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0;
}
.select2-container--bootstrap .select2-results__option .select2-results__option .select2-results__option {
margin-left: -12px;
padding-left: 24px;
}
.select2-container--bootstrap .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -24px;
padding-left: 36px;
}
.select2-container--bootstrap .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -36px;
padding-left: 48px;
}
.select2-container--bootstrap .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -48px;
padding-left: 60px;
}
.select2-container--bootstrap .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -60px;
padding-left: 72px;
}
.select2-container--bootstrap .select2-results__group {
color: #777;
display: block;
padding: 6px 12px;
font-size: 12px;
line-height: 1.42857143;
white-space: nowrap;
}
.select2-container--bootstrap.select2-container--focus .select2-selection, .select2-container--bootstrap.select2-container--open .select2-selection {
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
border-color: #66afe9;
}
.select2-container--bootstrap.select2-container--open .select2-selection .select2-selection__arrow b {
border-color: transparent transparent #999;
border-width: 0 4px 4px;
}
.select2-container--bootstrap.select2-container--open.select2-container--below .select2-selection {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-color: transparent;
}
.select2-container--bootstrap.select2-container--open.select2-container--above .select2-selection {
border-top-right-radius: 0;
border-top-left-radius: 0;
border-top-color: transparent;
}
.select2-container--bootstrap .select2-selection__clear {
color: #999;
cursor: pointer;
float: right;
font-weight: 700;
margin-right: 10px;
}
.select2-container--bootstrap .select2-selection__clear:hover {
color: #333;
}
.select2-container--bootstrap.select2-container--disabled .select2-selection {
border-color: #ccc;
-webkit-box-shadow: none;
box-shadow: none;
}
.select2-container--bootstrap.select2-container--disabled .select2-search__field, .select2-container--bootstrap.select2-container--disabled .select2-selection {
cursor: not-allowed;
}
.select2-container--bootstrap.select2-container--disabled .select2-selection, .select2-container--bootstrap.select2-container--disabled .select2-selection--multiple .select2-selection__choice {
background-color: #eee;
}
.select2-container--bootstrap.select2-container--disabled .select2-selection--multiple .select2-selection__choice__remove, .select2-container--bootstrap.select2-container--disabled .select2-selection__clear {
display: none;
}
.select2-container--bootstrap .select2-dropdown {
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175);
border-color: #66afe9;
overflow-x: hidden;
margin-top: -1px;
}
.select2-container--bootstrap .select2-dropdown--above {
-webkit-box-shadow: 0 -6px 12px rgba(0,0,0,.175);
box-shadow: 0 -6px 12px rgba(0,0,0,.175);
margin-top: 1px;
}
.select2-container--bootstrap .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto;
}
.select2-container--bootstrap .select2-selection--single {
height: 34px;
line-height: 1.42857143;
padding: 6px 24px 6px 12px;
}
.select2-container--bootstrap .select2-selection--single .select2-selection__arrow {
position: absolute;
bottom: 0;
right: 12px;
top: 0;
width: 4px;
}
.select2-container--bootstrap .select2-selection--single .select2-selection__arrow b {
border-color: #999 transparent transparent;
border-style: solid;
border-width: 4px 4px 0;
height: 0;
left: 0;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0;
}
.select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
color: #555;
padding: 0;
}
.select2-container--bootstrap .select2-selection--single .select2-selection__placeholder {
color: #999;
}
.select2-container--bootstrap .select2-selection--multiple {
min-height: 34px;
padding: 0;
height: auto;
}
.select2-container--bootstrap .select2-selection--multiple .select2-selection__rendered {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: block;
line-height: 1.42857143;
list-style: none;
margin: 0;
overflow: hidden;
padding: 0;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
}
.select2-container--bootstrap .select2-selection--multiple .select2-selection__placeholder {
color: #999;
float: left;
margin-top: 5px;
}
.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice {
color: #555;
background: #fff;
border: 1px solid #ccc;
border-radius: 4px;
cursor: default;
float: left;
margin: 5px 0 0 6px;
padding: 0 6px;
}
.select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field {
background: 0 0;
padding: 0 12px;
height: 32px;
line-height: 1.42857143;
margin-top: 0;
min-width: 5em;
}
.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove {
color: #999;
cursor: pointer;
display: inline-block;
font-weight: 700;
margin-right: 3px;
}
.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333;
}
.select2-container--bootstrap .select2-selection--multiple .select2-selection__clear {
margin-top: 6px;
}
.form-group-sm .select2-container--bootstrap .select2-selection--single, .input-group-sm .select2-container--bootstrap .select2-selection--single, .select2-container--bootstrap .select2-selection--single.input-sm {
border-radius: 3px;
font-size: 12px;
height: 30px;
line-height: 1.5;
padding: 5px 22px 5px 10px;
}
.form-group-sm .select2-container--bootstrap .select2-selection--single .select2-selection__arrow b, .input-group-sm .select2-container--bootstrap .select2-selection--single .select2-selection__arrow b, .select2-container--bootstrap .select2-selection--single.input-sm .select2-selection__arrow b {
margin-left: -5px;
}
.form-group-sm .select2-container--bootstrap .select2-selection--multiple, .input-group-sm .select2-container--bootstrap .select2-selection--multiple, .select2-container--bootstrap .select2-selection--multiple.input-sm {
min-height: 30px;
border-radius: 3px;
}
.form-group-sm .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice, .input-group-sm .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice, .select2-container--bootstrap .select2-selection--multiple.input-sm .select2-selection__choice {
font-size: 12px;
line-height: 1.5;
margin: 4px 0 0 5px;
padding: 0 5px;
}
.form-group-sm .select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field, .input-group-sm .select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field, .select2-container--bootstrap .select2-selection--multiple.input-sm .select2-search--inline .select2-search__field {
padding: 0 10px;
font-size: 12px;
height: 28px;
line-height: 1.5;
}
.form-group-sm .select2-container--bootstrap .select2-selection--multiple .select2-selection__clear, .input-group-sm .select2-container--bootstrap .select2-selection--multiple .select2-selection__clear, .select2-container--bootstrap .select2-selection--multiple.input-sm .select2-selection__clear {
margin-top: 5px;
}
.form-group-lg .select2-container--bootstrap .select2-selection--single, .input-group-lg .select2-container--bootstrap .select2-selection--single, .select2-container--bootstrap .select2-selection--single.input-lg {
border-radius: 6px;
font-size: 18px;
height: 46px;
line-height: 1.3333333;
padding: 10px 31px 10px 16px;
}
.form-group-lg .select2-container--bootstrap .select2-selection--single .select2-selection__arrow, .input-group-lg .select2-container--bootstrap .select2-selection--single .select2-selection__arrow, .select2-container--bootstrap .select2-selection--single.input-lg .select2-selection__arrow {
width: 5px;
}
.form-group-lg .select2-container--bootstrap .select2-selection--single .select2-selection__arrow b, .input-group-lg .select2-container--bootstrap .select2-selection--single .select2-selection__arrow b, .select2-container--bootstrap .select2-selection--single.input-lg .select2-selection__arrow b {
border-width: 5px 5px 0;
margin-left: -10px;
margin-top: -2.5px;
}
.form-group-lg .select2-container--bootstrap .select2-selection--multiple, .input-group-lg .select2-container--bootstrap .select2-selection--multiple, .select2-container--bootstrap .select2-selection--multiple.input-lg {
min-height: 46px;
border-radius: 6px;
}
.form-group-lg .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice, .input-group-lg .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice, .select2-container--bootstrap .select2-selection--multiple.input-lg .select2-selection__choice {
font-size: 18px;
line-height: 1.3333333;
border-radius: 4px;
margin: 9px 0 0 8px;
padding: 0 10px;
}
.form-group-lg .select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field, .input-group-lg .select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field, .select2-container--bootstrap .select2-selection--multiple.input-lg .select2-search--inline .select2-search__field {
padding: 0 16px;
font-size: 18px;
height: 44px;
line-height: 1.3333333;
}
.form-group-lg .select2-container--bootstrap .select2-selection--multiple .select2-selection__clear, .input-group-lg .select2-container--bootstrap .select2-selection--multiple .select2-selection__clear, .select2-container--bootstrap .select2-selection--multiple.input-lg .select2-selection__clear {
margin-top: 10px;
}
.input-group-lg .select2-container--bootstrap .select2-selection.select2-container--open .select2-selection--single .select2-selection__arrow b, .select2-container--bootstrap .select2-selection.input-lg.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #999;
border-width: 0 5px 5px;
}
.select2-container--bootstrap[dir=rtl] .select2-selection--single {
padding-left: 24px;
padding-right: 12px;
}
.select2-container--bootstrap[dir=rtl] .select2-selection--single .select2-selection__rendered {
padding-right: 0;
padding-left: 0;
text-align: right;
}
.select2-container--bootstrap[dir=rtl] .select2-selection--single .select2-selection__clear {
float: left;
}
.select2-container--bootstrap[dir=rtl] .select2-selection--single .select2-selection__arrow {
left: 12px;
right: auto;
}
.select2-container--bootstrap[dir=rtl] .select2-selection--single .select2-selection__arrow b {
margin-left: 0;
}
.select2-container--bootstrap[dir=rtl] .select2-selection--multiple .select2-search--inline, .select2-container--bootstrap[dir=rtl] .select2-selection--multiple .select2-selection__choice, .select2-container--bootstrap[dir=rtl] .select2-selection--multiple .select2-selection__placeholder {
float: right;
}
.select2-container--bootstrap[dir=rtl] .select2-selection--multiple .select2-selection__choice {
margin-left: 0;
margin-right: 6px;
}
.select2-container--bootstrap[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto;
}
.has-warning .select2-dropdown, .has-warning .select2-selection {
border-color: #8a6d3b;
}
.has-warning .select2-container--focus .select2-selection, .has-warning .select2-container--open .select2-selection {
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;
border-color: #66512c;
}
.has-warning.select2-drop-active {
border-color: #66512c;
}
.has-warning.select2-drop-active.select2-drop.select2-drop-above {
border-top-color: #66512c;
}
.has-error .select2-dropdown, .has-error .select2-selection {
border-color: #a94442;
}
.has-error .select2-container--focus .select2-selection, .has-error .select2-container--open .select2-selection {
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;
border-color: #843534;
}
.has-error.select2-drop-active {
border-color: #843534;
}
.has-error.select2-drop-active.select2-drop.select2-drop-above {
border-top-color: #843534;
}
.has-success .select2-dropdown, .has-success .select2-selection {
border-color: #3c763d;
}
.has-success .select2-container--focus .select2-selection, .has-success .select2-container--open .select2-selection {
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;
border-color: #2b542c;
}
.has-success.select2-drop-active {
border-color: #2b542c;
}
.has-success.select2-drop-active.select2-drop.select2-drop-above {
border-top-color: #2b542c;
}
.input-group > .select2-hidden-accessible:first-child + .select2-container--bootstrap > .selection > .select2-selection, .input-group > .select2-hidden-accessible:first-child + .select2-container--bootstrap > .selection > .select2-selection.form-control {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.input-group > .select2-hidden-accessible:not(:first-child) + .select2-container--bootstrap:not(:last-child) > .selection > .select2-selection, .input-group > .select2-hidden-accessible:not(:first-child) + .select2-container--bootstrap:not(:last-child) > .selection > .select2-selection.form-control {
border-radius: 0;
}
.input-group > .select2-hidden-accessible:not(:first-child):not(:last-child) + .select2-container--bootstrap:last-child > .selection > .select2-selection, .input-group > .select2-hidden-accessible:not(:first-child):not(:last-child) + .select2-container--bootstrap:last-child > .selection > .select2-selection.form-control {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.input-group > .select2-container--bootstrap {
display: table;
table-layout: fixed;
position: relative;
z-index: 2;
width: 100%;
margin-bottom: 0;
}
.input-group > .select2-container--bootstrap > .selection > .select2-selection.form-control {
float: none;
}
.input-group > .select2-container--bootstrap.select2-container--focus, .input-group > .select2-container--bootstrap.select2-container--open {
z-index: 3;
}
.input-group > .select2-container--bootstrap, .input-group > .select2-container--bootstrap .input-group-btn, .input-group > .select2-container--bootstrap .input-group-btn .btn {
vertical-align: top;
}
.form-control.select2-hidden-accessible {
position: absolute!important;
width: 1px!important;
}
@media (min-width:768px) {
.form-inline .select2-container--bootstrap {
display: inline-block;
}
}

629
html/semiauto/assets/css/select2.min.css vendored Normal file
View File

@@ -0,0 +1,629 @@
.select2-container {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle;
}
.select2-container .select2-selection--single {
box-sizing: border-box;
cursor: pointer;
display: block;
height: 28px;
user-select: none;
-webkit-user-select: none;
}
.select2-container .select2-selection--single .select2-selection__rendered {
display: block;
padding-left: 8px;
padding-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.select2-container .select2-selection--single .select2-selection__clear {
position: relative;
}
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px;
}
.select2-container .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 32px;
user-select: none;
-webkit-user-select: none;
}
.select2-container .select2-selection--multiple .select2-selection__rendered {
display: inline-block;
overflow: hidden;
padding-left: 8px;
text-overflow: ellipsis;
white-space: nowrap;
}
.select2-container .select2-search--inline {
float: left;
}
.select2-container .select2-search--inline .select2-search__field {
box-sizing: border-box;
border: none;
font-size: 100%;
margin-top: 5px;
padding: 0;
}
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none;
}
.select2-dropdown {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
box-sizing: border-box;
display: block;
position: absolute;
left: -100000px;
width: 100%;
z-index: 1051;
}
.select2-results {
display: block;
}
.select2-results__options {
list-style: none;
margin: 0;
padding: 0;
}
.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none;
}
.select2-results__option[aria-selected] {
cursor: pointer;
}
.select2-container--open .select2-dropdown {
left: 0;
}
.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.select2-search--dropdown {
display: block;
padding: 4px;
}
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box;
}
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none;
}
.select2-search--dropdown.select2-search--hide {
display: none;
}
.select2-close-mask {
border: 0;
margin: 0;
padding: 0;
display: block;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 99;
background-color: #fff;
filter: alpha(opacity=0);
}
.select2-hidden-accessible {
border: 0 !important;
clip: rect(0 0 0 0) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
white-space: nowrap !important;
}
.select2-container--default .select2-selection--single {
background-color: #fff;
border: 1px solid #aaa;
border-radius: 4px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #999;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0;
}
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left;
}
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto;
}
.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default;
}
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px;
}
.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 5px;
width: 100%;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
margin-right: 10px;
padding: 1px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #999;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333;
}
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right;
}
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto;
}
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid black 1px;
outline: 0;
}
.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default;
}
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none;
}
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
}
.select2-container--default .select2-search--inline .select2-search__field {
background: transparent;
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield;
}
.select2-container--default .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto;
}
.select2-container--default .select2-results__option[role=group] {
padding: 0;
}
.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999;
}
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #ddd;
}
.select2-container--default .select2-results__option .select2-results__option {
padding-left: 1em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #5897fb;
color: white;
}
.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px;
}
.select2-container--classic .select2-selection--single {
background-color: #f7f7f7;
border: 1px solid #aaa;
border-radius: 4px;
outline: 0;
background-image: -webkit-linear-gradient(top, #fff 50%, #eee 100%);
background-image: -o-linear-gradient(top, #fff 50%, #eee 100%);
background-image: linear-gradient(to bottom, #fff 50%, #eee 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0);
}
.select2-container--classic .select2-selection--single:focus {
border: 1px solid #5897fb;
}
.select2-container--classic .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px;
}
.select2-container--classic .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-right: 10px;
}
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
color: #999;
}
.select2-container--classic .select2-selection--single .select2-selection__arrow {
background-color: #ddd;
border: none;
border-left: 1px solid #aaa;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px;
background-image: -webkit-linear-gradient(top, #eee 50%, #ccc 100%);
background-image: -o-linear-gradient(top, #eee 50%, #ccc 100%);
background-image: linear-gradient(to bottom, #eee 50%, #ccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0);
}
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0;
}
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left;
}
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
border: none;
border-right: 1px solid #aaa;
border-radius: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
left: 1px;
right: auto;
}
.select2-container--classic.select2-container--open .select2-selection--single {
border: 1px solid #5897fb;
}
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
background: transparent;
border: none;
}
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px;
}
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
background-image: -webkit-linear-gradient(top, #fff 0%, #eee 50%);
background-image: -o-linear-gradient(top, #fff 0%, #eee 50%);
background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0);
}
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-image: -webkit-linear-gradient(top, #eee 50%, #fff 100%);
background-image: -o-linear-gradient(top, #eee 50%, #fff 100%);
background-image: linear-gradient(to bottom, #eee 50%, #fff 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0);
}
.select2-container--classic .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text;
outline: 0;
}
.select2-container--classic .select2-selection--multiple:focus {
border: 1px solid #5897fb;
}
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
list-style: none;
margin: 0;
padding: 0 5px;
}
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
display: none;
}
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px;
}
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
color: #888;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px;
}
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #555;
}
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right;
margin-left: 5px;
margin-right: auto;
}
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto;
}
.select2-container--classic.select2-container--open .select2-selection--multiple {
border: 1px solid #5897fb;
}
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.select2-container--classic .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
outline: 0;
}
.select2-container--classic .select2-search--inline .select2-search__field {
outline: 0;
box-shadow: none;
}
.select2-container--classic .select2-dropdown {
background-color: #fff;
border: 1px solid transparent;
}
.select2-container--classic .select2-dropdown--above {
border-bottom: none;
}
.select2-container--classic .select2-dropdown--below {
border-top: none;
}
.select2-container--classic .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto;
}
.select2-container--classic .select2-results__option[role=group] {
padding: 0;
}
.select2-container--classic .select2-results__option[aria-disabled=true] {
color: grey;
}
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
background-color: #3875d7;
color: #fff;
}
.select2-container--classic .select2-results__group {
cursor: default;
display: block;
padding: 6px;
}
.select2-container--classic.select2-container--open .select2-dropdown {
border-color: #5897fb;
}

View File

@@ -97,9 +97,11 @@ input {
}
.navbar-bg {
background-color: #1e293b!important;
color: white !important;
/*background-color: #1e293b!important;*/
/*color: white !important;*/
/*background-color: #f0f2ff !important;*/
color: white !important;
background-color: #29587a !important;
}
.navbar-bg2 {
@@ -138,7 +140,7 @@ input {
.div-broadcast {
width: 100%;
max-height: 115px;
max-height: 135px;
overflow-y: auto;
overflow-x: hidden;
padding: 10px;
@@ -315,12 +317,16 @@ th, td {
}
.btn-reload {
background-color: #084ed5;
/*background-color: #084ed5;*/
/*color: #fff;*/
background-color: #3e6fcd;
color: #fff;
}
.btn-reload:hover {
background-color: #053185;
/*background-color: #053185;*/
/*color: #fff;*/
background-color: #5080d9;
color: #fff;
}
@@ -339,7 +345,7 @@ th, td {
}
.btn-logout {
background-color: #366396;
background-color: #4280ab;
color: #fff;
}
@@ -416,12 +422,18 @@ input#dt-search-0 {
}
.btn-broadcast {
background-color: #0d6efd;
/*background-color: #0d6efd;*/
/*color: white;*/
background-color: #437a9e;
/*background-color: #0a3349;*/
color: white;
border: none;
}
.btn-broadcast:hover {
background-color: #3b5bdb;
/*background-color: #3b5bdb;*/
/*color: white;*/
background-color: #5088ab;
color: white;
}
@@ -449,3 +461,7 @@ input#dt-search-0 {
margin-top: 1rem;
}
.pad-left {
margin-bottom: 1rem;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,868 @@
$(document).ready(function() {
$('#logtable').DataTable();
let $preview_indonesia = null;
let $preview_english = null;
let $preview_chinese = null;
let $preview_japanese = null;
let $preview_arabic = null;
let $preview_local = null;
let $enable_indonesia = null;
let $enable_english = null;
let $enable_chinese = null;
let $enable_japanese = null;
let $enable_arabic = null;
let $enable_local = null;
let $tbody_message = null;
let $tbody_broadcastzones = null;
let $select_airline = null;
let $select_city = null;
let $select_places = null;
let $select_shalat = null;
let $select_reason = null;
let $select_conveyorbelt = null;
let $select_procedure = null;
let $select_compensation = null;
let $input_gatenumber = null;
let $input_flightnumber = null;
let $input_licenseplate = null;
let $input_conveyorbelt = null;
let $input_hours = null;
let $input_minutes = null;
let $row_airplane = null;
let $row_city = null;
let $row_gatenumber = null;
let $row_time = null;
let $col_reason = null;
let $col_places = null;
let $col_shalat = null;
let $col_conveyorbelt = null;
let $col_procedure = null;
let $col_licenseplate = null;
/**
* @typedef {Object} message
* @property {number} id - The ID of the message
* @property {string} description - The description of the message
* @property {string} language - The language of the message
* @property {string} message_details - The detailed message content
*/
/**
* @typedef {Object} variabledata
* @property {string} tag - The tag of the variable
* @property {string} value - The value of the variable
*/
/**
* Fetch API helper function
* @param {string} endpoint Endpoint URL
* @param {string} method Method (GET, POST, etc.)
* @param {Object} headers Headers to include in the request
* @param {Object} body Body of the request
* @param {Function} cbOK Callback function for successful response
* @param {Function} cbError Callback function for error response
*/
function fetchAPI(endpoint, method, headers = {}, body = null, cbOK, cbError) {
let url = window.location.origin + "/api/" + endpoint;
let options = {
method: method,
headers: headers
}
if (body !== null) {
options.body = JSON.stringify(body);
if (!options.headers['Content-Type']) {
options.headers['Content-Type'] = 'application/json';
}
}
fetch(url, options)
.then(async (response) => {
if (!response.ok) {
let msg;
try {
let _xxx = await response.json();
msg = _xxx.message || response.statusText;
} catch {
msg = await response.statusText;
}
throw new Error(msg);
}
return response.json();
})
.then(data => {
cbOK(data);
})
.catch(error => {
cbError(error);
});
}
window.semiautodata = {
/** @type {message[]} */
messages: null,
/** @type {variabledata[]} */
airlines: null,
/** @type {variabledata[]} */
cities: null,
/** @type {variabledata[]} */
places: null,
/** @type {variabledata[]} */
shalat: null,
/** @type {variabledata[]} */
sequences: null,
/** @type {variabledata[]} */
reasons: null,
/** @type {variabledata[]} */
procedures: null,
/** @type {variabledata[]} */
gates: null,
/** @type {variabledata[]} */
compensation: null,
/** @type {variabledata[]} */
greetings: null,
/** @type {string[]} */
broadcastzones: null,
Clear: () => {
window.semiautodata.messages = [];
window.semiautodata.airlines = [];
window.semiautodata.cities = [];
window.semiautodata.places = [];
window.semiautodata.shalat = [];
window.semiautodata.sequences = [];
window.semiautodata.reasons = [];
window.semiautodata.procedures = [];
window.semiautodata.gates = [];
window.semiautodata.compensation = [];
window.semiautodata.greetings = [];
window.semiautodata.broadcastzones = [];
},
Add_Message: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_Message: input must be a non-empty string");
return false;
}
const parts = str.split(';');
if (!Array.isArray(parts) || parts.length !== 4) {
console.warn("Add_Message: input must contain exactly 4 semicolon-separated parts");
return false;
}
const [idPart, description, language, message_details] = parts.map(p => p.trim());
const id = Number(idPart);
if (!Number.isInteger(id)) {
console.warn("Add_Message: first part must be an integer id");
return false;
}
const duplicate = window.semiautodata.messages.some(m => {
if (!m) return false;
const mid = Number(m.id);
const mlang = (m.language || "").trim();
return Number.isInteger(mid) && mid === id && mlang === language;
});
if (duplicate) {
console.warn(`Add_Message: message with id ${id} and language "${language}" already exists`);
return false;
}
window.semiautodata.messages.push({
id: id,
description: description,
language: language,
message_details: message_details
});
return true;
},
Add_Airline: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_Airline: input must be a non-empty string");
return false;
}
const parts = str.split(';').map(p => p.trim());
if (!Array.isArray(parts) || parts.length !== 2) {
console.warn("Add_Airline: input must contain exactly 2 semicolon-separated parts");
return false;
}
const [tag, value] = parts;
if (!tag || !value) {
console.warn("Add_Airline: both tag and value must be non-empty");
return false;
}
const duplicate = window.semiautodata.airlines.some(a => (a && (a.tag || "").trim() === tag && (a.value || "").trim() === value));
if (duplicate) {
console.warn(`Add_Airline: airline "${tag}" with value "${value}" already exists`);
return false;
}
window.semiautodata.airlines.push({ tag, value });
return true;
},
Add_City: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_City: input must be a non-empty string");
return false;
}
const parts = str.split(';').map(p => p.trim());
if (!Array.isArray(parts) || parts.length !== 2) {
console.warn("Add_City: input must contain exactly 2 semicolon-separated parts");
return false;
}
const [tag, value] = parts;
if (!tag || !value) {
console.warn("Add_City: both tag and value must be non-empty");
return false;
}
const duplicate = window.semiautodata.cities.some(c => (c && (c.tag || "").trim() === tag && (c.value || "").trim() === value));
if (duplicate) {
console.warn(`Add_City: city "${tag}" with value "${value}" already exists`);
return false;
}
window.semiautodata.cities.push({ tag, value });
return true;
},
Add_Place: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_Place: input must be a non-empty string");
return false;
}
const parts = str.split(';').map(p => p.trim());
if (!Array.isArray(parts) || parts.length !== 2) {
console.warn("Add_Place: input must contain exactly 2 semicolon-separated parts");
return false;
}
const [tag, value] = parts;
if (!tag || !value) {
console.warn("Add_Place: both tag and value must be non-empty");
return false;
}
const duplicate = window.semiautodata.places.some(p => (p && (p.tag || "").trim() === tag && (p.value || "").trim() === value));
if (duplicate) {
console.warn(`Add_Place: place "${tag}" with value "${value}" already exists`);
return false;
}
window.semiautodata.places.push({ tag, value });
return true;
},
Add_Shalat: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_Shalat: input must be a non-empty string");
return false;
}
const parts = str.split(';').map(p => p.trim());
if (!Array.isArray(parts) || parts.length !== 2) {
console.warn("Add_Shalat: input must contain exactly 2 semicolon-separated parts");
return false;
}
const [tag, value] = parts;
if (!tag || !value) {
console.warn("Add_Shalat: both tag and value must be non-empty");
return false;
}
const duplicate = window.semiautodata.shalat.some(s => (s && (s.tag || "").trim() === tag && (s.value || "").trim() === value));
if (duplicate) {
console.warn(`Add_Shalat: shalat "${tag}" with value "${value}" already exists`);
return false;
}
window.semiautodata.shalat.push({ tag, value });
return true;
},
Add_Reason: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_Reason: input must be a non-empty string");
return false;
}
const parts = str.split(';').map(p => p.trim());
if (!Array.isArray(parts) || parts.length !== 2) {
console.warn("Add_Reason: input must contain exactly 2 semicolon-separated parts");
return false;
}
const [tag, value] = parts;
if (!tag || !value) {
console.warn("Add_Reason: both tag and value must be non-empty");
return false;
}
const duplicate = window.semiautodata.reasons.some(r => (r && (r.tag || "").trim() === tag && (r.value || "").trim() === value));
if (duplicate) {
console.warn(`Add_Reason: reason "${tag}" with value "${value}" already exists`);
return false;
}
window.semiautodata.reasons.push({ tag, value });
return true;
},
Add_Procedure: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_Procedure: input must be a non-empty string");
return false;
}
const parts = str.split(';').map(p => p.trim());
if (!Array.isArray(parts) || parts.length !== 2) {
console.warn("Add_Procedure: input must contain exactly 2 semicolon-separated parts");
return false;
}
const [tag, value] = parts;
if (!tag || !value) {
console.warn("Add_Procedure: both tag and value must be non-empty");
return false;
}
const duplicate = window.semiautodata.procedures.some(p => (p && (p.tag || "").trim() === tag && (p.value || "").trim() === value));
if (duplicate) {
console.warn(`Add_Procedure: procedure "${tag}" with value "${value}" already exists`);
return false;
}
window.semiautodata.procedures.push({ tag, value });
return true;
},
Add_Compensation: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_Compensation: input must be a non-empty string");
return false;
}
const parts = str.split(';').map(p => p.trim());
if (!Array.isArray(parts) || parts.length !== 2) {
console.warn("Add_Compensation: input must contain exactly 2 semicolon-separated parts");
return false;
}
const [tag, value] = parts;
if (!tag || !value) {
console.warn("Add_Compensation: both tag and value must be non-empty");
return false;
}
const duplicate = window.semiautodata.compensation.some(c => (c && (c.tag || "").trim() === tag && (c.value || "").trim() === value));
if (duplicate) {
console.warn(`Add_Compensation: compensation "${tag}" with value "${value}" already exists`);
return false;
}
window.semiautodata.compensation.push({ tag, value });
return true;
},
Add_Greeting: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_Greeting: input must be a non-empty string");
return false;
}
const parts = str.split(';').map(p => p.trim());
if (!Array.isArray(parts) || parts.length !== 2) {
console.warn("Add_Greeting: input must contain exactly 2 semicolon-separated parts");
return false;
}
const [tag, value] = parts;
if (!tag || !value) {
console.warn("Add_Greeting: both tag and value must be non-empty");
return false;
}
const duplicate = window.semiautodata.greetings.some(g => (g && (g.tag || "").trim() === tag && (g.value || "").trim() === value));
if (duplicate) {
console.warn(`Add_Greeting: greeting "${tag}" with value "${value}" already exists`);
return false;
}
window.semiautodata.greetings.push({ tag, value });
return true;
},
Add_BroadcastZone: (str) => {
if (str == null || typeof str !== 'string' || str.trim().length === 0) {
console.warn("Add_BroadcastZone: input must be a non-empty string");
return false;
}
const value = str.trim();
if (value.length === 0) {
console.warn("Add_BroadcastZone: value must be non-empty");
return false;
}
const duplicate = window.semiautodata.broadcastzones.some(b => (b || "").trim() === value);
if (duplicate) {
console.warn(`Add_BroadcastZone: broadcast zone "${value}" already exists`);
return false;
}
window.semiautodata.broadcastzones.push(value);
return true;
}
}
/**
* Reload the database by fetching data from the Initialize endpoint
*/
function reload_database() {
fetchAPI("Initialize", "GET", {}, null, (data) => {
//TODO data masih dalam bentuk array of string, mesti diubah ke array of object
window.semiautodata.Clear();
if (data.messages && Array.isArray(data.messages)) {
for (let msg of data.messages) window.semiautodata.Add_Message(msg);
}
if (data.airlines && Array.isArray(data.airlines)) {
for (let airline of data.airlines) window.semiautodata.Add_Airline(airline);
}
if (data.cities && Array.isArray(data.cities)) {
for (let city of data.cities) window.semiautodata.Add_City(city);
}
if (data.places && Array.isArray(data.places)) {
for (let place of data.places) window.semiautodata.Add_Place(place);
}
if (data.shalat && Array.isArray(data.shalat)) {
for (let shalat of data.shalat) window.semiautodata.Add_Shalat(shalat);
}
if (data.reasons && Array.isArray(data.reasons)) {
for (let reason of data.reasons) window.semiautodata.Add_Reason(reason);
}
if (data.procedures && Array.isArray(data.procedures)) {
for (let procedure of data.procedures) window.semiautodata.Add_Procedure(procedure);
}
if (data.compensation && Array.isArray(data.compensation)) {
for (let compensation of data.compensation) window.semiautodata.Add_Compensation(compensation);
}
if (data.greetings && Array.isArray(data.greetings)) {
for (let greeting of data.greetings) window.semiautodata.Add_Greeting(greeting);
}
if (data.broadcastzones && Array.isArray(data.broadcastzones)) {
for (let broadcastzone of data.broadcastzones) window.semiautodata.Add_BroadcastZone(broadcastzone);
}
fill_items();
}, (error) => {
console.error("Error:", error);
});
}
function empty_preview(){
$preview_arabic.empty();
$preview_chinese.empty();
$preview_english.empty();
$preview_indonesia.empty();
$preview_japanese.empty();
$preview_local.empty();
$enable_arabic.prop("checked", false);
$enable_chinese.prop("checked", false);
$enable_english.prop("checked", false);
$enable_indonesia.prop("checked", false);
$enable_japanese.prop("checked", false);
$enable_local.prop("checked", false);
}
function enable_disable_fields(){
$row_airplane.hide();
$row_city.hide();
$row_gatenumber.hide();
$row_time.hide();
$col_reason.hide();
$col_places.hide();
$col_shalat.hide();
$col_conveyorbelt.hide();
$col_procedure.hide();
$col_licenseplate.hide();
// show airplane row if English preview contains the placeholder
const text = $preview_english.text() || "";
if (text.indexOf('[CITY]') !== -1) $row_city.show();
if (text.indexOf('[AIRPLANE_NAME]') !== -1) $row_airplane.show();
if (text.indexOf('[FLIGHT_NUMBER]') !== -1) $row_airplane.show();
if (text.indexOf('[GATENUMBER]') !== -1) $row_gatenumber.show();
if (text.indexOf('[ETAD]') !== -1) $row_time.show();
if (text.indexOf('[REASON]') !== -1) $col_reason.show();
if (text.indexOf('[PLACES]') !== -1) $col_places.show();
if (text.indexOf('[SHALAT]') !== -1) $col_shalat.show();
if (text.indexOf('[BCB]') !== -1) $col_conveyorbelt.show();
if (text.indexOf('[PROCEDURE]') !== -1) $col_procedure.show();
if (text.indexOf('[PLATNOMOR]') !== -1) $col_licenseplate.show();
}
function update_preview(language){
let text = "";
let $preview = null;
if (language === "indonesia") {
$preview = $preview_indonesia;
} else if (language === "english") {
$preview = $preview_english;
} else if (language === "chinese") {
$preview = $preview_chinese;
} else if (language === "japanese") {
$preview = $preview_japanese;
} else if (language === "arabic") {
$preview = $preview_arabic;
} else if (language === "local") {
$preview = $preview_local;
}
if ($preview) {
text = $preview.text();
}
if (text.indexOf('[CITY]') !== -1) {
let cities = $select_city.val();
if (Array.isArray(cities)) {
text = text.replace(/\[CITY\]/g, cities.join(", "));
} else {
text = text.replace(/\[CITY\]/g, cities || "");
}
}
if (text.indexOf('[AIRPLANE_NAME]') !== -1) {
let airlineTag = $select_airline.val() || "";
let airlineObj = window.semiautodata.airlines.find(a => a.tag === airlineTag);
let airlineName = airlineObj ? airlineObj.value : "";
text = text.replace(/\[AIRPLANE_NAME\]/g, airlineName);
}
if (text.indexOf('[FLIGHT_NUMBER]') !== -1) {
let flightNumber = $input_flightnumber.val() || "";
text = text.replace(/\[FLIGHT_NUMBER\]/g, flightNumber);
}
if (text.indexOf('[GATENUMBER]') !== -1) {
let gateNumber = $input_gatenumber.val() || "";
text = text.replace(/\[GATENUMBER\]/g, gateNumber);
}
if (text.indexOf('[ETAD]') !== -1) {
let etad = $input_etad.val() || "";
text = text.replace(/\[ETAD\]/g, etad);
}
if (text.indexOf('[REASON]') !== -1) {
let reason = $select_reason.val() || "";
text = text.replace(/\[REASON\]/g, reason);
}
if (text.indexOf('[PLACES]') !== -1) {
let placeTag = $select_places.val() || "";
text = text.replace(/\[PLACES\]/g, placeTag);
}
if (text.indexOf('[SHALAT]') !== -1) {
let shalatTag = $select_shalat.val() || "";
text = text.replace(/\[SHALAT\]/g, shalatTag);
}
if (text.indexOf('[BCB]') !== -1) {
let bcbTag = $select_bcb.val() || "";
text = text.replace(/\[BCB\]/g, bcbTag);
}
if (text.indexOf('[PROCEDURE]') !== -1) {
let procedureTag = $select_procedure.val() || "";
text = text.replace(/\[PROCEDURE\]/g, procedureTag);
}
if (text.indexOf('[PLATNOMOR]') !== -1) {
let platNomorTag = $select_licenseplate.val() || "";
text = text.replace(/\[PLATNOMOR\]/g, platNomorTag);
}
if ($preview) {
$preview.text(text);
}
}
function update_all_previews(){
update_preview("indonesia");
update_preview("english");
update_preview("chinese");
update_preview("japanese");
update_preview("arabic");
update_preview("local");
}
function fill_items() {
$tbody_message.empty();
$tbody_broadcastzones.empty();
$select_airline.select2();
$select_city.select2();
$select_places.empty();
$select_shalat.empty();
$select_reason.empty();
$select_procedure.empty();
$select_compensation.empty();
$input_gatenumber.empty();
$input_flightnumber.empty();
$input_licenseplate.empty();
$input_conveyorbelt.empty();
$input_hours.empty();
$input_minutes.empty();
empty_preview();
if (window.semiautodata !== null) {
if (window.semiautodata.messages !== null && Array.isArray(window.semiautodata.messages) && window.semiautodata.messages.length > 0) {
for (let msg of window.semiautodata.messages) {
const txt = msg.description + " [" + msg.id + "]";
// check if tbody_message already has a row with the same text
let exists = false;
$("#tbody_message tr td").each(function () {
if ($(this).text() === txt) {
exists = true;
}
});
if (!exists) {
let $tr = $("<tr></tr>");
let $td = $("<td></td>").text(txt);
$tr.append($td);
$tbody_message.append($tr);
$tr.css("cursor", "pointer");
$tr.data("msgid", msg.id);
$tr.on("click", function (e) {
const $row = $(this);
const groupId = $row.data("msgid");
const willSelect = !$row.hasClass("table-active");
// helper to map language string to preview & checkbox
function applyLang(lang, value, checked) {
const l = (lang || "").toString().trim().toLowerCase();
if (l.startsWith("indonesia")) {
if (checked) $preview_indonesia.text(value); else $preview_indonesia.empty();
$enable_indonesia.prop("checked", !!checked);
return true;
}
if (l.startsWith("english") ) {
if (checked) $preview_english.text(value); else $preview_english.empty();
$enable_english.prop("checked", !!checked);
return true;
}
if (l.startsWith("chinese") ) {
if (checked) $preview_chinese.text(value); else $preview_chinese.empty();
$enable_chinese.prop("checked", !!checked);
return true;
}
if (l.startsWith("japanese") ) {
if (checked) $preview_japanese.text(value); else $preview_japanese.empty();
$enable_japanese.prop("checked", !!checked);
return true;
}
if (l.startsWith("arabic")) {
if (checked) $preview_arabic.text(value); else $preview_arabic.empty();
$enable_arabic.prop("checked", !!checked);
return true;
}
if (l.startsWith("local")) {
if (checked) $preview_local.text(value); else $preview_local.empty();
$enable_local.prop("checked", !!checked);
return true;
}
return false;
}
// helper to clear previews for a given group id
function clearGroupPreviews(gid) {
if (!window.semiautodata || !Array.isArray(window.semiautodata.messages)) return;
const sameMsgs = window.semiautodata.messages.filter(m => Number(m.id) === Number(gid));
for (let m of sameMsgs) {
applyLang(m.language, "", false);
}
}
if (willSelect) {
// unselect other selected rows and clear their previews
$tbody_message.find("tr.table-active").each(function () {
if (this === e.currentTarget) return;
const $other = $(this);
const otherId = $other.data("msgid");
$other.removeClass("table-active");
clearGroupPreviews(otherId);
});
// select this row and apply its messages to previews
$row.addClass("table-active");
if (window.semiautodata && Array.isArray(window.semiautodata.messages)) {
const sameMsgs = window.semiautodata.messages.filter(m => Number(m.id) === Number(groupId));
for (let m of sameMsgs) {
applyLang(m.language, m.message_details, true);
}
enable_disable_fields();
}
} else {
// deselect this row and clear its previews
$row.removeClass("table-active");
clearGroupPreviews(groupId);
}
});
}
}
}
if (window.semiautodata.broadcastzones !== null && Array.isArray(window.semiautodata.broadcastzones) && window.semiautodata.broadcastzones.length > 0) {
for (let zone of window.semiautodata.broadcastzones) {
{
const uid = 'bz_' + Math.random().toString(36).slice(2, 9);
let $tr = $("<tr></tr>");
let $checkbox = $("<input>").attr({ type: "checkbox", id: uid, value: zone });
let $label = $("<label></label>").attr("for", uid).text(zone);
let $td = $("<td></td>").append($checkbox).append(" ").append($label);
$tr.append($td);
$tbody_broadcastzones.append($tr);
}
}
}
if (window.semiautodata.airlines !== null && Array.isArray(window.semiautodata.airlines) && window.semiautodata.airlines.length > 0) {
const airlinedata = window.semiautodata.airlines.map(a => ({ id: a.tag, text: a.value + " [" + a.tag + "]" }));
$select_airline.select2({
data: airlinedata,
placeholder: "Select an airline",
width: '100%',
multiple: false
});
$select_airline.val(null).trigger("change");
$select_airline.on('change', function () {
update_all_previews();
});
}
if (window.semiautodata.cities !== null && Array.isArray(window.semiautodata.cities) && window.semiautodata.cities.length > 0) {
const citydata = window.semiautodata.cities.map(c => ({ id: c.tag, text: c.value + " [" + c.tag + "]" }));
$select_city.select2({
data: citydata,
placeholder: "Select a city",
width: '100%',
multiple: true
});
// disable sorting on select2 selection
$select_city.on('select2:select', function (e) {
let element = e.params.data.element;
$(this).append(element); // move selected item to the end
$(this).trigger('change'); // refresh select2 display
});
$select_city.val(null).trigger("change");
$select_city.on('change', function () {
update_all_previews();
});
}
if (window.semiautodata.places !== null && Array.isArray(window.semiautodata.places) && window.semiautodata.places.length > 0) {
$select_places.select2({
placeholder: "Select a place",
width: '100%',
multiple: false,
data: window.semiautodata.places.map(p => ({ id: p.tag, text: p.value }))
});
$select_places.val(null).trigger("change");
$select_places.on('change', function () {
update_all_previews();
});
}
if (window.semiautodata.shalat !== null && Array.isArray(window.semiautodata.shalat) && window.semiautodata.shalat.length > 0) {
$select_shalat.select2({
placeholder: "Select shalat time",
width: '100%',
multiple: false,
data: window.semiautodata.shalat.map(s => ({ id: s.tag, text: s.value }))
});
$select_shalat.val(null).trigger("change");
}
if (window.semiautodata.reasons !== null && Array.isArray(window.semiautodata.reasons) && window.semiautodata.reasons.length > 0) {
$select_reason.select2({
placeholder: "Select a reason",
width: '100%',
multiple: false,
data: window.semiautodata.reasons.map(r => ({ id: r.tag, text: r.value }))
});
$select_reason.val(null).trigger("change");
$select_reason.on('change', function () {
update_all_previews();
});
}
if (window.semiautodata.compensation !== null && Array.isArray(window.semiautodata.compensation) && window.semiautodata.compensation.length > 0) {
$select_compensation.select2({
placeholder: "Select compensation",
width: '100%',
multiple: false,
data: window.semiautodata.compensation.map(c => ({ id: c.tag, text: c.value }))
});
$select_compensation.val(null).trigger("change");
$select_compensation.on('change', function () {
update_all_previews();
});
}
if (window.semiautodata.procedures !== null && Array.isArray(window.semiautodata.procedures) && window.semiautodata.procedures.length > 0) {
$select_procedure.select2({
placeholder: "Select procedure",
width: '100%',
multiple: false,
data: window.semiautodata.procedures.map(p => ({ id: p.tag, text: p.value }))
});
$select_procedure.val(null).trigger("change");
$select_procedure.on('change', function () {
update_all_previews();
});
}
$input_conveyorbelt.on('input', function () {
update_all_previews();
});
$input_gatenumber.on('input', function () {
update_all_previews();
});
$input_flightnumber.on('input', function () {
update_all_previews();
});
$input_licenseplate.on('input', function () {
update_all_previews();
});
}
}
// App start here
$(document).ready(function () {
console.log("javascript loaded");
$preview_indonesia = $("#message_indonesia");
$preview_english = $("#message_english");
$preview_chinese = $("#message_chinese");
$preview_japanese = $("#message_japanese");
$preview_arabic = $("#message_arabic");
$preview_local = $("#message_local");
$enable_indonesia = $("#checkbox_indonesia");
$enable_english = $("#checkbox_english");
$enable_chinese = $("#checkbox_chinese");
$enable_japanese = $("#checkbox_japanese");
$enable_arabic = $("#checkbox_arabic");
$enable_local = $("#checkbox_local");
$tbody_message = $("#tbody_message");
$tbody_broadcastzones = $("#tbody_broadcastzones");
$select_airline = $("#select_airline");
$select_city = $("#select_city");
$select_places = $("#select_places");
$select_shalat = $("#select_shalat");
$select_reason = $("#select_reason");
$select_procedure = $("#select_procedure");
$select_compensation = $("#select_compensation");
$input_gatenumber = $("#input_gatenumber");
$input_flightnumber = $("#input_flightnumber");
$input_licenseplate = $("#input_licenseplate");
$input_conveyorbelt = $("#input_conveyorbelt");
$input_hours = $("#input_hours");
$input_minutes = $("#input_minutes");
$row_airplane = $("#row_airplane");
$row_city = $("#row_city");
$row_gatenumber = $("#row_gatenumber");
$row_time = $("#row_time");
$col_reason = $("#col_reason");
$col_places = $("#col_places");
$col_shalat = $("#col_shalat");
$col_conveyorbelt = $("#col_conveyorbelt");
$col_procedure = $("#col_procedure");
$col_licenseplate = $("#col_licenseplate");
reload_database();
$("#reload_database").off("click").on("click", function () {
reload_database();
});
});

File diff suppressed because one or more lines are too long