$50 GRAYBYTE WORDPRESS FILE MANAGER $65

SERVER : premium134.web-hosting.com #1 SMP Thu Mar 13 14:29:12 UTC 2025
SERVER IP : 162.0.232.104 | ADMIN IP 216.73.216.80
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/raydofqv/ctdatabase.work/wp-content/plugins/woocommerce/assets/js/admin/

HOME
Current File : /home/raydofqv/ctdatabase.work/wp-content/plugins/woocommerce/assets/js/admin//settings.js
/* global woocommerce_settings_params, wp */
( function ( $, params, wp ) {
	$( function () {
		// Sell Countries
		$( 'select#woocommerce_allowed_countries' )
			.on( 'change', function () {
				if ( 'specific' === $( this ).val() ) {
					$( this ).closest( 'tr' ).next( 'tr' ).hide();
					$( this ).closest( 'tr' ).next().next( 'tr' ).show();
				} else if ( 'all_except' === $( this ).val() ) {
					$( this ).closest( 'tr' ).next( 'tr' ).show();
					$( this ).closest( 'tr' ).next().next( 'tr' ).hide();
				} else {
					$( this ).closest( 'tr' ).next( 'tr' ).hide();
					$( this ).closest( 'tr' ).next().next( 'tr' ).hide();
				}
			} )
			.trigger( 'change' );

		// Ship Countries
		$( 'select#woocommerce_ship_to_countries' )
			.on( 'change', function () {
				if ( 'specific' === $( this ).val() ) {
					$( this ).closest( 'tr' ).next( 'tr' ).show();
				} else {
					$( this ).closest( 'tr' ).next( 'tr' ).hide();
				}
			} )
			.trigger( 'change' );

		// Stock management
		$( 'input#woocommerce_manage_stock' )
			.on( 'change', function () {
				if ( $( this ).is( ':checked' ) ) {
					$( this )
						.closest( 'tbody' )
						.find( '.manage_stock_field' )
						.closest( 'tr' )
						.show();
				} else {
					$( this )
						.closest( 'tbody' )
						.find( '.manage_stock_field' )
						.closest( 'tr' )
						.hide();
				}
			} )
			.trigger( 'change' );

		// Color picker
		$( '.colorpick' )
			.iris( {
				change: function ( event, ui ) {
					const $this = $( this );
					$this
						.parent()
						.find( '.colorpickpreview' )
						.css( { backgroundColor: ui.color.toString() } );
					setTimeout( function () {
						$this.trigger( 'change' );
					} );
				},
				hide: true,
				border: true,
			} )

			.on( 'click focus', function ( event ) {
				event.stopPropagation();
				$( '.iris-picker' ).hide();
				$( this ).closest( 'td' ).find( '.iris-picker' ).show();
				$( this ).data( 'originalValue', $( this ).val() );
			} )

			.on( 'change', function () {
				if ( $( this ).is( '.iris-error' ) ) {
					var original_value = $( this ).data( 'originalValue' );

					if (
						original_value.match(
							/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
						)
					) {
						$( this )
							.val( $( this ).data( 'originalValue' ) )
							.trigger( 'change' );
					} else {
						$( this ).val( '' ).trigger( 'change' );
					}
				}
			} );

		$( '.iris-square-value' ).on( 'click', function ( event ) {
			event.preventDefault();
		} );

		$( '.colorpickpreview' ).on( 'click', function ( event ) {
			event.stopPropagation();
			$( this ).next( '.colorpick' ).click();
		} );

		$( 'body' ).on( 'click', function () {
			$( '.iris-picker' ).hide();
		} );

		// Edit prompt
		function editPrompt () {
			var changed = false;
			let $prevent_change_elements = $( '.wp-list-table .check-column, .wc-settings-prevent-change-event' );

			$( 'input, textarea, select, checkbox' ).on( 'change input', function (
				event
			) {
				// Prevent change event on specific elements, that don't change the form. E.g.:
				// - WP List Table checkboxes that only (un)select rows
				// - Changing email type in email preview
				if (
					$prevent_change_elements.length &&
					$prevent_change_elements.has( event.target ).length
				) {
					return;
				}

				if ( ! changed ) {
					window.onbeforeunload = function () {
						return params.i18n_nav_warning;
					};
					changed = true;
					$( '.woocommerce-save-button' ).removeAttr( 'disabled' );
				}
			} );

			$( '.iris-picker' ).on( 'click', function () {
				if ( ! changed ) {
					changed = true;
					$( '.woocommerce-save-button' ).removeAttr( 'disabled' );
				}
			} );

			$( '.submit :input, input#search-submit' ).on(
				'click',
				function () {
					window.onbeforeunload = '';
				}
			);
		}

		$( editPrompt );

		const nodeListContainsFormElements = ( nodes ) => {
			if ( ! nodes.length	) {
				return false;
			}
			return Array.from( nodes ).some( ( element ) => {
				return $( element ).find( 'input, textarea, select, checkbox' ).length;
			} );
		}

		const form = document.querySelector( '#mainform' );
		const observer = new MutationObserver( ( mutationsList ) => {
			for ( const mutation of mutationsList ) {
				if ( mutation.type === 'childList' ) {
					if ( nodeListContainsFormElements( mutation.addedNodes ) ) {
						editPrompt();
						$( '.woocommerce-save-button' ).removeAttr( 'disabled' );
					} else if ( nodeListContainsFormElements( mutation.removedNodes ) ) {
						$( '.woocommerce-save-button' ).removeAttr( 'disabled' );
					}
				}
			}
		} );

		observer.observe( form, { childList: true, subtree: true } );

		// Sorting
		$( 'table.wc_gateways tbody, table.wc_shipping tbody' ).sortable( {
			items: 'tr',
			cursor: 'move',
			axis: 'y',
			handle: 'td.sort',
			scrollSensitivity: 40,
			helper: function ( event, ui ) {
				ui.children().each( function () {
					$( this ).width( $( this ).width() );
				} );
				ui.css( 'left', '0' );
				return ui;
			},
			start: function ( event, ui ) {
				ui.item.css( 'background-color', '#f6f6f6' );
			},
			stop: function ( event, ui ) {
				ui.item.removeAttr( 'style' );
				ui.item.trigger( 'updateMoveButtons', { isInitialLoad: false } );
			},
		} );

		// Select all/none
		$( '.woocommerce' ).on( 'click', '.select_all', function () {
			$( this )
				.closest( 'td' )
				.find( 'select option' )
				.prop( 'selected', true );
			$( this ).closest( 'td' ).find( 'select' ).trigger( 'change' );
			return false;
		} );

		$( '.woocommerce' ).on( 'click', '.select_none', function () {
			$( this )
				.closest( 'td' )
				.find( 'select option' )
				.prop( 'selected', false );
			$( this ).closest( 'td' ).find( 'select' ).trigger( 'change' );
			return false;
		} );

		// Re-order buttons.
		$( '.wc-item-reorder-nav' )
			.find( '.wc-move-up, .wc-move-down' )
			.on( 'click', function () {
				var moveBtn = $( this ),
					$row = moveBtn.closest( 'tr' );

				moveBtn.trigger( 'focus' );

				var isMoveUp = moveBtn.is( '.wc-move-up' ),
					isMoveDown = moveBtn.is( '.wc-move-down' );

				if ( isMoveUp ) {
					var $previewRow = $row.prev( 'tr' );

					if ( $previewRow && $previewRow.length ) {
						$previewRow.before( $row );
						wp.a11y.speak( params.i18n_moved_up );
					}
				} else if ( isMoveDown ) {
					var $nextRow = $row.next( 'tr' );

					if ( $nextRow && $nextRow.length ) {
						$nextRow.after( $row );
						wp.a11y.speak( params.i18n_moved_down );
					}
				}

				moveBtn.trigger( 'focus' ); // Re-focus after the container was moved.
				moveBtn.closest( 'table' ).trigger( 'updateMoveButtons', { isInitialLoad: false } );
			} );

		$( '.wc-item-reorder-nav' )
			.closest( 'table' )
			.on( 'updateMoveButtons', function ( event, data ) {
				var table = $( this ),
					lastRow = $( this ).find( 'tbody tr:last' ),
					firstRow = $( this ).find( 'tbody tr:first' );

				table
					.find( '.wc-item-reorder-nav .wc-move-disabled' )
					.removeClass( 'wc-move-disabled' )
					.attr( { tabindex: '0', 'aria-hidden': 'false' } );
				firstRow
					.find( '.wc-item-reorder-nav .wc-move-up' )
					.addClass( 'wc-move-disabled' )
					.attr( { tabindex: '-1', 'aria-hidden': 'true' } );
				lastRow
					.find( '.wc-item-reorder-nav .wc-move-down' )
					.addClass( 'wc-move-disabled' )
					.attr( { tabindex: '-1', 'aria-hidden': 'true' } );
				if ( ! data.isInitialLoad ) {
					$( '.woocommerce-save-button' ).removeAttr( 'disabled' );
				}
			} );

		$( '.wc-item-reorder-nav' )
			.closest( 'table' )
			.trigger( 'updateMoveButtons', { isInitialLoad: true } );

		$( '.submit button' ).on( 'click', function () {
			if (
				$( 'select#woocommerce_allowed_countries' ).val() ===
					'specific' &&
				! $( '[name="woocommerce_specific_allowed_countries[]"]' ).val()
			) {
				if (
					window.confirm(
						woocommerce_settings_params.i18n_no_specific_countries_selected
					)
				) {
					return true;
				}
				return false;
			}
		} );

		$( '#settings-other-payment-methods' ).on( 'click', function ( e ) {
			if (
				typeof window.wcTracks.recordEvent === 'undefined' &&
				typeof window.wc.tracks.recordEvent === 'undefined'
			) {
				return;
			}

			var recordEvent =
				window.wc.tracks.recordEvent || window.wcTracks.recordEvent;

			var payment_methods = $.map(
				$(
					'td.wc_payment_gateways_wrapper tbody tr[data-gateway_id] '
				),
				function ( tr ) {
					return $( tr ).attr( 'data-gateway_id' );
				}
			);

			recordEvent( 'settings_payments_recommendations_other_options', {
				available_payment_methods: payment_methods,
			} );
		} );

		$( '.woocommerce-save-button.components-button' ).on( 'click', function ( e ) {
			if ( ! $( this ).attr( 'disabled' ) ) {
				$( this ).addClass( 'is-busy' );
			}
		} );

		/**
		 * Support conditionally displaying a settings field description when another element
		 * is set to a specific value.
		 *
		 * This logic is subject to change, and is not intended for use by other plugins.
		 * Note that we can't avoid jQuery here, because of our current dependence on Select2
		 * for various controls.
		 */
		document.querySelectorAll( 'body.woocommerce_page_wc-settings #mainform .conditional.description' ).forEach( description => {
			const $underObservation = $( description.dataset.dependsOn );
			const showIfEquals      = description.dataset.showIfEquals;

			if ( undefined === showIfEquals || $underObservation.length === 0 ) {
				return;
			}

			/**
			 * Set visibility of the description element according to whether its value
			 * matches that of showIfEquals.
			 */
			const changeAgent = () => {
				description.style.visibility = $underObservation.val() === showIfEquals ? 'visible' : 'hidden';
			};

			// Monitor future changes, and take action based on the current state.
			$underObservation.on( 'change', changeAgent );
			changeAgent();
		} );

		// Ensures the active tab is visible and centered on small screens if it's out of view in a scrollable tab list.
		function settings_scroll_to_active_tab() {
			const body = document.body;
			if (
				! body.classList.contains('mobile') ||
				! body.classList.contains('woocommerce_page_wc-settings')
			) {
				return;
			}
			// Select the currently active tab
			const activeTab = document.querySelector( '.nav-tab-active' );

			// Exit if there's no active tab or screen is wider than 500px (desktop)
			if ( ! activeTab || window.innerWidth >= 500 ) {
				return;
			}

			// Get the parent element, assumed to be the scrollable container
			const parent = activeTab.parentElement;

			// Exit if no parent or if scrolling isn't needed (content fits)
			if ( ! parent || parent.scrollWidth <= parent.clientWidth ) {
				return;
			}

			// Get the position of the active tab relative to its parent
			const tabLeft = activeTab.offsetLeft;
			const tabRight = tabLeft + activeTab.offsetWidth;
			const scrollLeft = parent.scrollLeft;
			const visibleLeft = scrollLeft;
			const visibleRight = scrollLeft + parent.clientWidth;
			const isOutOfView = tabLeft < visibleLeft || tabRight > visibleRight;

			// If it’s out of view, scroll the parent so the tab is centered
			if ( isOutOfView ) {
				const offset = tabLeft - parent.clientWidth / 2 + activeTab.offsetWidth / 2;
					parent.scrollTo( {
					left: offset,
					behavior: 'auto' // Instant scroll (no animation)
				} );
			}
		}

		// Some legacy setting pages have tables that span beyond the set width of its parents
		// causing layout issues.
		// Fixe the width of the nav tab wrapper to match the window width on mobile.
		function settings_fix_nav_width() {
			const body = document.body;
			if (
				! body.classList.contains('mobile') ||
				! body.classList.contains('woocommerce_page_wc-settings')
			) {
				return;
			}
			const navWrapper = document.getElementsByClassName('nav-tab-wrapper');
			if ( ! navWrapper.length ) {
				return;
			}

			const navWrapperWidth = navWrapper[0].offsetWidth;
			if ( navWrapperWidth !== window.innerWidth) {
				navWrapper[0].style.width = window.innerWidth + 'px';
			}
		}

		settings_scroll_to_active_tab();
		settings_fix_nav_width();

	} );
} )( jQuery, woocommerce_settings_params, wp );

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
29 Apr 2026 5.43 AM
raydofqv / raydofqv
0755
.htaccess
1.994 KB
29 Apr 2026 5.43 AM
raydofqv / raydofqv
0444
api-keys.js
3.893 KB
18 May 2021 9.00 PM
raydofqv / raydofqv
0644
api-keys.min.js
2.227 KB
18 Jul 2023 11.53 PM
raydofqv / raydofqv
0644
backbone-modal.js
4.354 KB
27 Dec 2023 12.45 AM
raydofqv / raydofqv
0644
backbone-modal.min.js
2.771 KB
27 Dec 2023 12.45 AM
raydofqv / raydofqv
0644
marketplace-suggestions.js
16.839 KB
1 Sep 2025 11.44 PM
raydofqv / raydofqv
0644
marketplace-suggestions.min.js
6.659 KB
1 Sep 2025 11.44 PM
raydofqv / raydofqv
0644
meta-boxes-coupon.js
2.985 KB
1 Apr 2025 3.51 PM
raydofqv / raydofqv
0644
meta-boxes-coupon.min.js
1.611 KB
1 Apr 2025 3.51 PM
raydofqv / raydofqv
0644
meta-boxes-order.js
54.511 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644
meta-boxes-order.min.js
33.121 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644
meta-boxes-product-variation.js
42.265 KB
12 May 2025 9.07 PM
raydofqv / raydofqv
0644
meta-boxes-product-variation.min.js
22.549 KB
12 May 2025 9.07 PM
raydofqv / raydofqv
0644
meta-boxes-product.js
34.687 KB
19 Jan 2026 2.46 PM
raydofqv / raydofqv
0644
meta-boxes-product.min.js
18.241 KB
19 Jan 2026 2.46 PM
raydofqv / raydofqv
0644
meta-boxes.js
4.95 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644
meta-boxes.min.js
3.02 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644
network-orders.js
2.338 KB
23 May 2018 7.30 PM
raydofqv / raydofqv
0644
network-orders.min.js
1.251 KB
18 Jul 2023 11.53 PM
raydofqv / raydofqv
0644
order-attribution-admin.js
1.157 KB
27 Dec 2023 12.45 AM
raydofqv / raydofqv
0644
order-attribution-admin.min.js
0.713 KB
27 Dec 2023 12.45 AM
raydofqv / raydofqv
0644
product-editor.js
0.68 KB
29 Jul 2025 12.34 PM
raydofqv / raydofqv
0644
product-editor.min.js
0.291 KB
29 Jul 2025 12.34 PM
raydofqv / raydofqv
0644
product-ordering.js
2.604 KB
30 Mar 2026 5.12 PM
raydofqv / raydofqv
0644
product-ordering.min.js
1.664 KB
30 Mar 2026 5.12 PM
raydofqv / raydofqv
0644
quick-edit.js
7.062 KB
3 Mar 2025 10.28 PM
raydofqv / raydofqv
0644
quick-edit.min.js
4.581 KB
3 Mar 2025 10.28 PM
raydofqv / raydofqv
0644
reports.js
5.389 KB
14 Nov 2024 1.17 AM
raydofqv / raydofqv
0644
reports.min.js
2.7 KB
14 Nov 2024 1.17 AM
raydofqv / raydofqv
0644
settings-views-html-settings-tax.js
12.035 KB
3 Mar 2025 10.28 PM
raydofqv / raydofqv
0644
settings-views-html-settings-tax.min.js
6.085 KB
3 Mar 2025 10.28 PM
raydofqv / raydofqv
0644
settings.js
11.946 KB
12 May 2025 9.07 PM
raydofqv / raydofqv
0644
settings.min.js
6.252 KB
12 May 2025 9.07 PM
raydofqv / raydofqv
0644
system-status.js
5.382 KB
30 Mar 2026 5.12 PM
raydofqv / raydofqv
0644
system-status.min.js
3.077 KB
30 Mar 2026 5.12 PM
raydofqv / raydofqv
0644
term-ordering.js
4.619 KB
30 Mar 2026 5.12 PM
raydofqv / raydofqv
0644
term-ordering.min.js
2.52 KB
30 Mar 2026 5.12 PM
raydofqv / raydofqv
0644
users.js
3.784 KB
18 May 2021 9.00 PM
raydofqv / raydofqv
0644
users.min.js
1.87 KB
18 Jul 2023 11.53 PM
raydofqv / raydofqv
0644
wc-brands-enhanced-select.js
4.063 KB
23 Sep 2024 8.44 PM
raydofqv / raydofqv
0644
wc-brands-enhanced-select.min.js
1.592 KB
23 Sep 2024 8.44 PM
raydofqv / raydofqv
0644
wc-clipboard.js
0.849 KB
18 May 2021 9.00 PM
raydofqv / raydofqv
0644
wc-clipboard.min.js
0.328 KB
18 May 2021 9.00 PM
raydofqv / raydofqv
0644
wc-customer-stock-notifications.js
1.612 KB
1 Sep 2025 11.44 PM
raydofqv / raydofqv
0644
wc-customer-stock-notifications.min.js
1.127 KB
1 Sep 2025 11.44 PM
raydofqv / raydofqv
0644
wc-enhanced-select.js
13.58 KB
16 Aug 2023 12.05 AM
raydofqv / raydofqv
0644
wc-enhanced-select.min.js
7.707 KB
16 Aug 2023 12.05 AM
raydofqv / raydofqv
0644
wc-orders.js
1.977 KB
19 Oct 2022 12.34 AM
raydofqv / raydofqv
0644
wc-orders.min.js
1.167 KB
18 Jul 2023 11.53 PM
raydofqv / raydofqv
0644
wc-product-export.js
3.789 KB
12 May 2025 9.07 PM
raydofqv / raydofqv
0644
wc-product-export.min.js
2.091 KB
12 May 2025 9.07 PM
raydofqv / raydofqv
0644
wc-product-import.js
2.925 KB
24 May 2023 3.17 AM
raydofqv / raydofqv
0644
wc-product-import.min.js
1.701 KB
18 Jul 2023 11.53 PM
raydofqv / raydofqv
0644
wc-recent-reviews-widget-async.js
1.435 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644
wc-recent-reviews-widget-async.min.js
0.623 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644
wc-setup.js
10.049 KB
18 May 2021 9.00 PM
raydofqv / raydofqv
0644
wc-setup.min.js
6.35 KB
18 Jul 2023 11.53 PM
raydofqv / raydofqv
0644
wc-shipping-classes.js
6.567 KB
3 Mar 2025 10.28 PM
raydofqv / raydofqv
0644
wc-shipping-classes.min.js
3.565 KB
3 Mar 2025 10.28 PM
raydofqv / raydofqv
0644
wc-shipping-providers.js
7.042 KB
30 Mar 2026 5.12 PM
raydofqv / raydofqv
0644
wc-shipping-providers.min.js
3.902 KB
30 Mar 2026 5.12 PM
raydofqv / raydofqv
0644
wc-shipping-zone-methods.js
35.427 KB
19 Jan 2026 2.46 PM
raydofqv / raydofqv
0644
wc-shipping-zone-methods.min.js
17.098 KB
19 Jan 2026 2.46 PM
raydofqv / raydofqv
0644
wc-shipping-zones.js
9.23 KB
3 Mar 2025 10.28 PM
raydofqv / raydofqv
0644
wc-shipping-zones.min.js
4.854 KB
3 Mar 2025 10.28 PM
raydofqv / raydofqv
0644
wc-status-widget-async.js
1.332 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644
wc-status-widget-async.min.js
0.561 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644
wc-status-widget.js
1.781 KB
14 Nov 2024 1.17 AM
raydofqv / raydofqv
0644
wc-status-widget.min.js
1.049 KB
14 Nov 2024 1.17 AM
raydofqv / raydofqv
0644
woocommerce_admin.js
22.321 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644
woocommerce_admin.min.js
11.928 KB
23 Feb 2026 5.58 PM
raydofqv / raydofqv
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF