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: /home4/cca63905/public_html/nueva/modules/pmproductvideoreviews/views/js/back.js
/**
 * rec.reviews
 *
 * @author    Presta-Module.com <support@presta-module.com> - https://www.presta-module.com
 * @copyright Presta-Module - https://www.presta-module.com
 * @license   see file: LICENSE.txt
 *
 *           ____     __  __
 *          |  _ \   |  \/  |
 *          | |_) |  | |\/| |
 *          |  __/   | |  | |
 *          |_|      |_|  |_|
 */

$(document).ready(function() {
    $("#submitDisconnect, #submitRbmDisconnect").click(function(e) {
        if (!confirm(pmproductvideoreviews.unlink_message)) {
            e.preventDefault();
        }
    });

    /**
     *
     * Incentive options
     *
     **/

    if ($("#PVR_ENABLE_VOUCHER_off").is(":checked")) {
        $(".pvr-incentive-block").addClass("hide");
        $(".pvr-incentive-amount-block").addClass("hide");
        $(".pvr-incentive-percent-block").addClass("hide");
    }

    if ($("#PVR_ENABLE_VOUCHER_on").is(":checked")) {
        if ($("#PVR_VOUCHER_TYPE").val() == "percent") {
            $(".pvr-incentive-amount-block").addClass("hide");
            $(".pvr-incentive-percent-block").removeClass("hide");
        } else {
            $(".pvr-incentive-amount-block").removeClass("hide");
            $(".pvr-incentive-percent-block").addClass("hide");
        }
    }

    $(document).on("change", 'input[name="PVR_ENABLE_VOUCHER"]', function() {
        if ($(this).val() == 1) {
            $(".pvr-incentive-block").removeClass("hide");

            if ($("#PVR_VOUCHER_TYPE").val() == "percent") {
                $(".pvr-incentive-amount-block").addClass("hide");
                $(".pvr-incentive-percent-block").removeClass("hide");
            } else {
                $(".pvr-incentive-amount-block").removeClass("hide");
                $(".pvr-incentive-percent-block").addClass("hide");
            }
        } else {
            $(".pvr-incentive-block").addClass("hide");
            $(".pvr-incentive-amount-block").addClass("hide");
            $(".pvr-incentive-percent-block").addClass("hide");
        }
    });

    $(document).on("change", 'input[name="PVR_VOUCHER_TYPE"]', function() {
        if ($(this).val() == "amount") {
            $(".pvr-incentive-amount-block").removeClass("hide");
            $(".pvr-incentive-percent-block").addClass("hide");
        } else {
            $(".pvr-incentive-amount-block").addClass("hide");
            $(".pvr-incentive-percent-block").removeClass("hide");
        }
    });

    $("form input[required],form select[required]").each(function() {
        $(this).bind("change", function(event) {
            if (this.value != "") {
                $(this).css("border-color", "#bbcdd2");
                $("#module_form_submit_btn").removeClass("disabled");
            } else {
                $(this).css("border-color", "red");
                $("#module_form_submit_btn").addClass("disabled");
            }
        });
    });

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

    // Use case check requiered field and message
    $("form").submit(function(event) {
        if ($("#PVR_ENABLE_VOUCHER_on").is(":checked")) {
            $("form input[required],form select[required]").each(function() {
                if (this.value == "") {
                    $(this).css("border-color", "red");
                    var targetOffset = $(this).offset().top - 250;
                    $("html, body").animate({ scrollTop: targetOffset }, 500);
                    event.preventDefault();
                }
            });
        }
    });

    $(".owl-carousel").owlCarousel({
        responsiveClass: true,
        responsive: {
            0: {
                items: 1,
                nav: false,
            },
            360: {
                items: 1,
                nav: false,
            },
            600: {
                items: 1,
                nav: false,
            },
            767: {
                items: 1,
                nav: false,
            },
            768: {
                items: 1,
                nav: false,
            },
            992: {
                items: 1,
                nav: false,
            },
            1200: {
                items: 2,
                nav: false,
            },
            1440: {
                items: 2,
                nav: true,
            },
            1600: {
                items: 2,
                nav: true,
                loop: false,
            },
            1900: {
                items: 3,
                nav: true,
                loop: false,
            },
        },
        dots: true,
        nav: true,
        navText: ["<div class='nav-btn prev-slide'><i class=\"material-icons\">&#xe5cb;</i></div>", "<div class='nav-btn next-slide'><i class=\"material-icons\">&#xe5cc;</i></div>"],
    });

    // Handle hide save button on the subscription tab
    $(".nav-tabs a").on("shown.bs.tab", function(e) {
        tab = $(e.target).prop("href");

        if (tab == "#subscription") {
            $(".btn_gis_submit").css("display", "none");
        } else {
            $(".btn_gis_submit").css("display", "block");
        }
    });

    $('*[data-copy]').click(function() {
        $toCopy = $(this).data('copy');
        navigator.clipboard.writeText($toCopy);

        $(this).css('color', '#13bb13');
    });
});