import { swalDelete, ajaxDelete } from "../modules/delete-functions.js";

$(document).ready(function () {
    ajaxDelete();
    swalDelete();

    // $("button[type=submit]").click(function (e) {
    //     // Get View Textarea
    //     let viewTextareaVal = $(".view-textarea").val();
    //     viewTextareaVal = viewTextareaVal.replace(/  /g, "[sp][sp]");
    //     viewTextareaVal = viewTextareaVal.replace(/\n/g, "[nl]");
    //     $($(".view-textarea").attr("data-set-value-to")).val(viewTextareaVal);
    // });

    // Set For All Lable [*] IF Have Class [required]
    let labelRequired = $(".required");
    for (let i = 0; i <= labelRequired.length; i++) {
        $(labelRequired[i]).append(
            "<b style='font-size: 20px;display: inline-block;height: 30px;' class='text-danger pr-1 font-weight-bold'> * </b>"
        );
    }

    // For Set / In All Page Links
    let linksItems = $("#links-bar a");
    for (let i = 1; i <= linksItems.length; i++) {
        $(linksItems[i]).before("<span class='links-bar-item-slash'>/</span>");
    }

    // This Div For Set Response Result Here
    $("#header").after(`<div class='result'></div>`);
});
