Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/magento/module-catalog/view/adminhtml/web/catalog/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/module-catalog/view/adminhtml/web/catalog/product.js
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

require([
    'jquery'
], function ($) {
    'use strict';

    window.Product = {};

    /**
     * @param {String} id
     * @return {*|jQuery|HTMLElement}
     */
    function byId(id) {
        return $('#' + id);
    }

    /**
     * @param {String} fieldId
     */
    function disableFieldEditMode(fieldId) {
        var field = byId(fieldId);

        field.prop('disabled', true);

        if (field.next().hasClass('addafter')) {
            field.parent().addClass('_update-attributes-disabled');
        }

        if (byId(fieldId + '_hidden').length) {
            byId(fieldId + '_hidden').prop('disabled', true);
        }
    }

    /**
     * @param {String} fieldId
     */
    function enableFieldEditMode(fieldId) {
        var field = byId(fieldId);

        field.prop('disabled', false);

        if (field.parent().hasClass('_update-attributes-disabled')) {
            field.parent().removeClass('_update-attributes-disabled');
        }

        if (byId(fieldId + '_hidden').length) {
            byId(fieldId + '_hidden').prop('disabled', false);
        }
    }

    /**
     * @param {String} toogleIdentifier
     * @param {String} fieldId
     */
    function toogleFieldEditMode(toogleIdentifier, fieldId) {
        if ($(toogleIdentifier).is(':checked')) {
            enableFieldEditMode(fieldId);
        } else {
            disableFieldEditMode(fieldId);
        }
    }

    /**
     * On complete disable.
     */
    function onCompleteDisableInited() {
        var item;

        $.each($('[data-disable]'), function () {
            item = $(this).data('disable');
            disableFieldEditMode(item);
        });
    }

    /**
     * @param {String} urlKey
     */
    function onUrlkeyChanged(urlKey) {
        var hidden, chbx, oldValue;

        urlKey = byId(urlKey);
        hidden = urlKey.siblings('input[type=hidden]');
        chbx = urlKey.siblings('input[type=checkbox]');
        oldValue = chbx.val();

        chbx.prop('disabled', oldValue === urlKey.val());
        hidden.prop('disabled', chbx.prop('disabled'));
    }

    /**
     * @param {HTMLElement} element
     */
    function onCustomUseParentChanged(element) {
        var useParent, parent;

        element = $(element);
        useParent = element.val() == 1; //eslint-disable-line eqeqeq
        parent = element.offsetParent().parent();

        parent.find('input, select, textarea').each(function (i, el) {
            el = $(el);

            if (element.prop('id') !== el.prop('id')) {
                el.prop('disabled', useParent);
            }
        });

        parent.find('img').each(function (i, el) {
            if (useParent) {
                $(el).hide();
            } else {
                $(el).show();
            }
        });
    }

    window.onCustomUseParentChanged = onCustomUseParentChanged;
    window.onUrlkeyChanged = onUrlkeyChanged;
    window.toogleFieldEditMode = toogleFieldEditMode;

    $(onCompleteDisableInited);
});

Spamworldpro Mini