HEX
Server: Apache
System: Linux srv13.cpanelhost.cl 3.10.0-962.3.2.lve1.5.38.el7.x86_64 #1 SMP Thu Jun 18 05:28:41 EDT 2020 x86_64
User: cca63905 (4205)
PHP: 7.3.20
Disabled: NONE
Upload Files
File: //proc/self/cwd/nueva/modules/btecommercecopilot/views/js/back.js
/**
 * Ecommerce copilot
 *
 * @author    businesstech.fr <modules@businesstech.fr> - https://www.businesstech.fr/
 * @copyright https://www.businesstech.fr/
 * @license   see file: LICENSE.txt
 *
 *           ____    _______
 *          |  _ \  |__   __|
 *          | |_) |    | |
 *          |  _ <     | |
 *          | |_) |    | |
 *          |____/     |_|
 */


document.addEventListener('DOMContentLoaded', function () {

    if ($("#ECOP_CUSTOM_LONG_DESC_PROMPT_off").is(":checked")) {
        $(".custom_product_long_prompt").addClass("hide");
    }

    $(document).on("change", 'input[name="ECOP_CUSTOM_LONG_DESC_PROMPT"]', function () {
        if ($(this).val() == 0) {
            $(".custom_product_long_prompt").addClass("hide");
        } else {
            $(".custom_product_long_prompt").removeClass("hide");
        }
    });

    if ($("#ECOP_CUSTOM_SHORT_DESC_PROMPT_off").is(":checked")) {
        $(".custom_product_short_prompt").addClass("hide");
    }

    $(document).on("change", 'input[name="ECOP_CUSTOM_SHORT_DESC_PROMPT"]', function () {
        if ($(this).val() == 0) {
            $(".custom_product_short_prompt").addClass("hide");
        } else {
            $(".custom_product_short_prompt").removeClass("hide");
        }
    });

    if ($("#ECOP_CUSTOM_META_DESC_PROMPT_off").is(":checked")) {
        $(".custom_product_meta_prompt").addClass("hide");
    }

    $(document).on("change", 'input[name="ECOP_CUSTOM_META_DESC_PROMPT"]', function () {
        if ($(this).val() == 0) {
            $(".custom_product_meta_prompt").addClass("hide");
        } else {
            $(".custom_product_meta_prompt").removeClass("hide");
        }
    });

    if ($("#ECOP_CUSTOM_CAT_LONG_DESC_PROMPT_off").is(":checked")) {
        $(".custom_cat_desc_prompt").addClass("hide");
    }

    $(document).on("change", 'input[name="ECOP_CUSTOM_CAT_LONG_DESC_PROMPT"]', function () {
        if ($(this).val() == 0) {
            $(".custom_cat_desc_prompt").addClass("hide");
        } else {
            $(".custom_cat_desc_prompt").removeClass("hide");
        }
    });

    if ($("#ECOP_CUSTOM_CAT_ADD_DESC_PROMPT_off").is(":checked")) {
        $(".custom_cat_add_desc_prompt").addClass("hide");
    }

    $(document).on("change", 'input[name="ECOP_CUSTOM_CAT_ADD_DESC_PROMPT"]', function () {
        if ($(this).val() == 0) {
            $(".custom_cat_add_desc_prompt").addClass("hide");
        } else {
            $(".custom_cat_add_desc_prompt").removeClass("hide");
        }
    });

    if ($("#ECOP_CUSTOM_CAT_META_DESC_PROMPT_off").is(":checked")) {
        $(".custom_category_meta_prompt").addClass("hide");
    }

    $(document).on("change", 'input[name="ECOP_CUSTOM_CAT_META_DESC_PROMPT"]', function () {
        if ($(this).val() == 0) {
            $(".custom_category_meta_prompt").addClass("hide");
        } else {
            $(".custom_category_meta_prompt").removeClass("hide");
        }
    });

    if ($("#ECOP_CUSTOM_CMS_PROMPT_off").is(":checked")) {
        $(".custom_cms_prompt").addClass("hide");
    }

    $(document).on("change", 'input[name="ECOP_CUSTOM_CMS_PROMPT"]', function () {
        if ($(this).val() == 0) {
            $(".custom_cms_prompt").addClass("hide");
        } else {
            $(".custom_cms_prompt").removeClass("hide");
        }
    });

    document.addEventListener("submit", function (event) {
        if ($("#ECOP_CUSTOM_LONG_DESC_PROMPT_on").is(":checked")) {
            if (document.getElementById("ECOP_LONG_DESC_PROMPT").value.length == 1) {
                document.getElementById("ECOP_LONG_DESC_PROMPT").style.cssText += 'color:red;background-color:#f8d7da';
            }
        }
        if ($("#ECOP_CUSTOM_SHORT_DESC_PROMPT_on").is(":checked")) {
            if (document.getElementById("ECOP_SHORT_DESC_PROMPT").value.length == 1) {
                document.getElementById("ECOP_SHORT_DESC_PROMPT").style.cssText += 'color:red;background-color:#f8d7da';
            }
        }
        if ($("#ECOP_CUSTOM_META_DESC_PROMPT_on").is(":checked")) {
            if (document.getElementById("ECOP_META_DESC_PROMPT").value.length == 1) {
                document.getElementById("ECOP_META_DESC_PROMPT").style.cssText += 'color:red;background-color:#f8d7da';
            }
        }
        if ($("#ECOP_CUSTOM_CAT_LONG_DESC_PROMPT_on").is(":checked")) {
            if (document.getElementById("ECOP_CUSTOM_CAT_LONG_DESC_PROMPT").value.length == 1) {
                document.getElementById("ECOP_CUSTOM_CAT_LONG_DESC_PROMPT").style.cssText += 'color:red;background-color:#f8d7da';
            }
        }
        if ($("#ECOP_CUSTOM_CAT_ADD_DESC_PROMPT_on").is(":checked")) {
            if (document.getElementById("ECOP_CUSTOM_CAT_ADD_DESC_PROMPT").value.length == 1) {
                document.getElementById("ECOP_CUSTOM_CAT_ADD_DESC_PROMPT").style.cssText += 'color:red;background-color:#f8d7da';
            }
        }
        if ($("#COP_CUSTOM_CAT_META_DESC_PROMPT_on").is(":checked")) {
            if (document.getElementById("ECOP_META_CAT_DESC_PROMPT").value.length == 1) {
                document.getElementById("ECOP_META_CAT_DESC_PROMPT").style.cssText += 'color:red;background-color:#f8d7da';
            }
        }
        if ($("#ECOP_CUSTOM_CMS_PROMPT_on").is(":checked")) {
            if (document.getElementById("ECOP_CMS_CONTENT").value.length == 1) {
                document.getElementById("ECOP_CMS_CONTENT").style.cssText += 'color:red;background-color:#f8d7da';
            }
        }
    });

    $(".alert-success").delay(2000).slideUp();
});