FM

/home/u523506497/domains/mymelon.in/public_html/info/wp-admin/js UP

/**
 * @output wp-admin/js/password-strength-meter.js
 */

/* global zxcvbn */
window.wp = window.wp || {};

(function($){
	var __ = wp.i18n.__,
		sprintf = wp.i18n.sprintf;

	/**
	 * Contains functions to determine the password strength.
	 *
	 * @since 3.7.0
	 *
	 * @namespace
	 */
	wp.passwordStrength = {
		/**
		 * Determines the strength of a given password.
		 *
		 * Compares first password to the password confirmation.
		 *
		 * @since 3.7.0
		 *
		 * @param {string} password1       The subject password.
		 * @param {Array}  disallowedList An array of words that will lower the entropy of
		 *                                 the password.
		 * @param {string} password2       The password confirmation.
		 *
		 * @return {number} The password strength score.
		 */
		meter : function( password1, disallowedList, password2 ) {
			if ( ! Array.isArray( disallowedList ) )
				disallowedList = [ disallowedList.toString() ];

			if (password1 != password2 && password2 && password2.length > 0)
				return 5;

			if ( 'undefined' === typeof window.zxcvbn ) {
				// Password strength unknown.
				return -1;
			}

			var result = zxcvbn( password1, disallowedList );
			return result.score;
		},

		/**
		 * Builds an array of words that should be penalized.
		 *
		 * Certain words need to be penalized because it would lower the entropy of a
		 * password if they were used. The disallowedList is based on user input fields such
		 * as username, first name, email etc.
		 *
		 * @since 3.7.0
		 * @deprecated 5.5.0 Use {@see 'userInputDisallowedList()'} instead.
		 *
		 * @return {string[]} The array of words to be disallowed.
		 */
		userInputBlacklist : function() {
			window.console.log(
				sprintf(
					/* translators: 1: Deprecated function name, 2: Version number, 3: Alternative function name. */
					__( '%1$s is deprecated since version %2$s! Use %3$s instead. Please consider writing more inclusive code.' ),
					'wp.passwordStrength.userInputBlacklist()',
					'5.5.0',
					'wp.passwordStrength.userInputDisallowedList()'
				)
			);

			return wp.passwordStrength.userInputDisallowedList();
		},

		/**
		 * Builds an array of words that should be penalized.
		 *
		 * Certain words need to be penalized because it would lower the entropy of a
		 * password if they were used. The disallowed list is based on user input fields such
		 * as username, first name, email etc.
		 *
		 * @since 5.5.0
		 *
		 * @return {string[]} The array of words to be disallowed.
		 */
		userInputDisallowedList : function() {
			var i, userInputFieldsLength, rawValuesLength, currentField,
				rawValues       = [],
				disallowedList  = [],
				userInputFields = [ 'user_login', 'first_name', 'last_name', 'nickname', 'display_name', 'email', 'url', 'description', 'weblog_title', 'admin_email' ];

			// Collect all the strings we want to disallow.
			rawValues.push( document.title );
			rawValues.push( document.URL );

			userInputFieldsLength = userInputFields.length;
			for ( i = 0; i < userInputFieldsLength; i++ ) {
				currentField = $( '#' + userInputFields[ i ] );

				if ( 0 === currentField.length ) {
					continue;
				}

				rawValues.push( currentField[0].defaultValue );
				rawValues.push( currentField.val() );
			}

			/*
			 * Strip out non-alphanumeric characters and convert each word to an
			 * individual entry.
			 */
			rawValuesLength = rawValues.length;
			for ( i = 0; i < rawValuesLength; i++ ) {
				if ( rawValues[ i ] ) {
					disallowedList = disallowedList.concat( rawValues[ i ].replace( /\W/g, ' ' ).split( ' ' ) );
				}
			}

			/*
			 * Remove empty values, short words and duplicates. Short words are likely to
			 * cause many false positives.
			 */
			disallowedList = $.grep( disallowedList, function( value, key ) {
				if ( '' === value || 4 > value.length ) {
					return false;
				}

				return $.inArray( value, disallowedList ) === key;
			});

			return disallowedList;
		}
	};

	// Backward compatibility.

	/**
	 * Password strength meter function.
	 *
	 * @since 2.5.0
	 * @deprecated 3.7.0 Use wp.passwordStrength.meter instead.
	 *
	 * @global
	 *
	 * @type {wp.passwordStrength.meter}
	 */
	window.passwordStrength = wp.passwordStrength.meter;
})(jQuery);
accordion.js2933V
accordion.min.js758V
application-passwords.js6394V
application-passwords.min.js3024V
auth-app.js5796V
auth-app.min.js2084V
code-editor.js17963V
code-editor.min.js3543V
color-picker.js9768V
color-picker.min.js3486V
comment.js5205V
comment.min.js2081V
common.js70421V
common.min.js26210V
custom-background.js3435V
custom-background.min.js1206V
custom-header.js2023V
customize-controls.js295905V
customize-controls.min.js112538V
customize-nav-menus.js114134V
customize-nav-menus.min.js48272V
customize-widgets.js71727V
customize-widgets.min.js28065V
dashboard.js27562V
dashboard.min.js8711V
edit-comments.js38139V
edit-comments.min.js15515V
editor-expand.js42606V
editor-expand.min.js13451V
editor.js45055V
editor.min.js13085V
farbtastic.js7849V
gallery.js5543V
gallery.min.js3741V
image-edit.js40936V
image-edit.min.js15515V
inline-edit-post.js20676V
inline-edit-post.min.js9586V
inline-edit-tax.js7797V
inline-edit-tax.min.js2997V
iris.min.js23643V
language-chooser.js890V
language-chooser.min.js423V
link.js4873V
link.min.js2319V
media-gallery.js1303V
media-gallery.min.js611V
media-upload.js3465V
media-upload.min.js1152V
media.js6765V
media.min.js2439V
nav-menu.js62617V
nav-menu.min.js30785V
password-strength-meter.js4236V
password-strength-meter.min.js1123V
password-toggle.js1339V
password-toggle.min.js847V
plugin-install.js7086V
plugin-install.min.js2403V
post.js40494V
post.min.js19415V
postbox.js18937V
postbox.min.js6761V
privacy-tools.js11146V
privacy-tools.min.js5189V
revisions.js34729V
revisions.min.js18401V
set-post-thumbnail.js876V
set-post-thumbnail.min.js620V
site-health.js13880V
site-health.min.js6474V
site-icon.js6853V
site-icon.min.js2532V
svg-painter.js3280V
svg-painter.min.js1567V
tags-box.js11140V
tags-box.min.js3077V
tags-suggest.js5771V
tags-suggest.min.js2269V
tags.js7839V
tags.min.js3111V
theme-plugin-editor.js26176V
theme-plugin-editor.min.js12104V
theme.js57419V
theme.min.js27554V
updates.js111999V
updates.min.js48443V
user-profile.js18161V
user-profile.min.js7914V
user-suggest.js2301V
user-suggest.min.js676V
widgets-
widgets.js23098V
widgets.min.js12609V
word-count.js7696V
word-count.min.js1530V
xfn.js740V
xfn.min.js458V
Blog - Page 289 of 508 - My Melon - Digital Marketing & Creative Agency
Skip to content Skip to footer