Server IP : 66.29.132.124 / Your IP : 3.139.235.100 Web Server : LiteSpeed System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : wavevlvu ( 1524) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/wavevlvu/blog.diixadigital.com/wp-content/plugins/meta-box/js/ |
Upload File : |
( function ( $, rwmb, i18n ) { 'use strict'; /** * Transform an input into an autocomplete. */ function transform( e ) { var $this = $( this ), $search = $this.siblings( '.rwmb-autocomplete-search' ), $result = $this.siblings( '.rwmb-autocomplete-results' ), name = $this.attr( 'name' ); // If the function is called on cloning, then change the field name and clear all results if ( e.hasOwnProperty( 'type' ) && 'clone' == e.type ) { $result.html( '' ); } $search.removeClass( 'ui-autocomplete-input' ).autocomplete( { minLength: 0, source: $this.data( 'options' ), select: function ( event, ui ) { $result.append( '<div class="rwmb-autocomplete-result">' + '<div class="label">' + ( typeof ui.item.excerpt !== 'undefined' ? ui.item.excerpt : ui.item.label ) + '</div>' + '<div class="actions">' + i18n.delete + '</div>' + '<input type="hidden" class="rwmb-autocomplete-value" name="' + name + '" value="' + ui.item.value + '">' + '</div>' ); // Reinitialize value. $search.val( '' ).trigger( 'change' ); return false; } } ); } function deleteSelection( e ) { e.preventDefault(); var $item = $( this ).parent(), $search = $item.parent().siblings( '.rwmb-autocomplete-search' ); $item.remove(); $search.trigger( 'change' ); } function init( e ) { $( e.target ).find( '.rwmb-autocomplete-wrapper input[type="hidden"]' ).each( transform ); } rwmb.$document .on( 'mb_ready', init ) .on( 'clone', '.rwmb-autocomplete', transform ) .on( 'click', '.rwmb-autocomplete-result .actions', deleteSelection ); } )( jQuery, rwmb, RWMB_Autocomplete );