HEX
Server: nginx/1.18.0
System: Linux iZj6c1ieg2jrpk1z5tzi19Z 6.3.9-1.el7.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 21 22:18:40 EDT 2023 x86_64
User: www (1001)
PHP: 8.2.4
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.cytocare.cn/wp-content/plugins/wc-china-checkout/assets/js/admin.min.js
/*global woo_ch_enhanced_select_params */
jQuery( function( $ ) {
	//tips
	$(".wc-sinic-tips").tipTip({
		attribute: "title",
		defaultPosition:'top'
	});
	
	//select2
	function getEnhancedSelectFormatString() {
		return {
			'language': {
				errorLoading: function() {
					// Workaround for https://github.com/select2/select2/issues/4355 instead of i18n_ajax_error.
					return woo_ch_enhanced_select.i18n_searching;
				},
				inputTooLong: function( args ) {
					var overChars = args.input.length - args.maximum;

					if ( 1 === overChars ) {
						return woo_ch_enhanced_select.i18n_input_too_long_1;
					}

					return woo_ch_enhanced_select.i18n_input_too_long_n.replace( '%qty%', overChars );
				},
				inputTooShort: function( args ) {
					var remainingChars = args.minimum - args.input.length;

					if ( 1 === remainingChars ) {
						return woo_ch_enhanced_select.i18n_input_too_short_1;
					}

					return woo_ch_enhanced_select.i18n_input_too_short_n.replace( '%qty%', remainingChars );
				},
				loadingMore: function() {
					return woo_ch_enhanced_select.i18n_load_more;
				},
				maximumSelected: function( args ) {
					if ( args.maximum === 1 ) {
						return woo_ch_enhanced_select.i18n_selection_too_long_1;
					}

					return woo_ch_enhanced_select.i18n_selection_too_long_n.replace( '%qty%', args.maximum );
				},
				noResults: function() {
					return woo_ch_enhanced_select.i18n_no_matches;
				},
				searching: function() {
					return woo_ch_enhanced_select.i18n_searching;
				}
			}
		};
	}

	try {
			//var woo_ch_types=[];
			//$(document).trigger('woo_ch_enhanced_select_types',[woo_ch_types]);
			$( document.body ).on( 'wc-sinic-enhanced-select-init', function() {
				
				// Ajax search boxes
				window.wsocial_function_on_obj_search=function(filter){
					$( filter ).filter( ':not(.enhanced)' ).each( function() {
						var obj_type = $( this ).data( 'type' );
						var custom_params = $( this ).data( 'custom_params' );
						if(custom_params&&typeof custom_params=='string'){
							custom_params = jQuery.parseJSON(custom_params);
						}
						
						if(!custom_params||typeof custom_params!='object'){custom_params={};}
						
						var select2_args = {
							multiple: $( this ).data( 'multiple' )=='1'?true:false,
							allowClear:  $( this ).data( 'allow_clear' ) ? true : false,
							placeholder: $( this ).data( 'placeholder' ),
							minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '0',
							escapeMarkup: function( m ) {
								return m;
							},
							ajax: {
								url:         woo_ch_enhanced_select.ajax_url,
								dataType:    'json',
								delay:       250,
								data:        function( params ) {
									custom_params.obj_type=obj_type;
									custom_params.term=params.term;
									
									return custom_params;
								},
								processResults: function( data ) {
									if ( data &&data.items) {
										return {
											results:  data.items
										};
									}
									
									return {
										results: []
									};
								},
								cache: true
							}
						};

						select2_args = $.extend( select2_args, getEnhancedSelectFormatString() );

						$( this ).select2( select2_args ).addClass( 'enhanced' );
					});
				}
				
				window.wsocial_function_on_obj_search(':input.wc-sinic-search');
				$(document).trigger('wc-sinic-on-select2-inited');
			})
			.trigger( 'wc-sinic-enhanced-select-init' );

			//=================================================//
			
			$( 'html' ).on( 'click', function( event ) {
				if ( this === event.target ) {
					$( ':input.wc-sinic-search' ).filter( '.select2-hidden-accessible' ).select2( 'close' );
				}
			});
		
	} catch( err ) {
		// If select2 failed (conflict?) log the error but don't stop other scripts breaking.
		window.console.log( err );
	}
});