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/frontend/web/js/product/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

define([
    'jquery',
    'mage/translate',
    'jquery-ui-modules/widget'
], function ($, $t) {
    'use strict';

    $.widget('mage.remainingCharacters', {
        options: {
            remainingText: $t('remaining'),
            tooManyText: $t('too many'),
            errorClass: 'mage-error',
            noDisplayClass: 'no-display'
        },

        /**
         * Initializes custom option component
         *
         * @private
         */
        _create: function () {
            this.note = $(this.options.noteSelector);
            this.counter = $(this.options.counterSelector);

            this.updateCharacterCount();
            this.element.on('change keyup paste', this.updateCharacterCount.bind(this));
        },

        /**
         * Updates counter message
         */
        updateCharacterCount: function () {
            var length = this.element.val().length,
                diff = this.options.maxLength - length;

            this.counter.text(this._formatMessage(diff));
            this.counter.toggleClass(this.options.noDisplayClass, length === 0);
            this.note.toggleClass(this.options.errorClass, diff < 0);
        },

        /**
         * Format remaining characters message
         *
         * @param {int} diff
         * @returns {String}
         * @private
         */
        _formatMessage: function (diff) {
            var count = Math.abs(diff),
                qualifier = diff < 0 ? this.options.tooManyText : this.options.remainingText;

            return '(' + count + ' ' + qualifier + ')';
        }
    });

    return $.mage.remainingCharacters;
});

Spamworldpro Mini