dbmsv2/public/js/admin/form.js
2025-08-14 18:36:09 +09:00

34 lines
1.3 KiB
JavaScript

document.addEventListener('DOMContentLoaded', function() {
//class가 calender인 inputbox용,날짜field용
if (document.querySelector(".calender")) {
$(".calender").datepicker({
changeYear: true,
changeMonth: true,
yearRange: "-10:+0",
dateFormat: "yy-mm-dd"
});
}
if (document.querySelector(".tinymce")) {
// HTML 문서가 표준 모드로 렌더링되고 있는지 확인
if (document.compatMode !== "CSS1Compat") {
console.error("문서가 표준 모드가 아닙니다.");
return;
}
tinymce.init({
selector: 'textarea',
license_key: 'gpl',
height: 250,
plugins: 'advlist autolink lists link image charmap preview anchor',
toolbar: 'undo redo blocks fontfamily fontsize forecolor backcolor | bold italic underline strikethrough | align numlist bullist | link image | table media | code fullscreen preview',
menubar: 'file edit view insert format tools table help'
});
}
if (document.querySelector(".select-field")) {
//class가 select-field인 SelectBox용
$(".select-field").select2({
theme: "classic",
width: 'style',
dropdownAutoWidth: true
});
}
});