Submit
Path:
~
/
/
var
/
softaculous
/
sitepad
/
editor
/
site-data
/
plugins
/
kkart-pro
/
assets
/
js
/
admin
/
File Content:
kkart-enhanced-select.js
/*global kkart_enhanced_select_params */ jQuery( function( $ ) { function getEnhancedSelectFormatString() { return { 'language': { errorLoading: function() { // Workaround for https://github.com/select2/select2/issues/4355 instead of i18n_ajax_error. return kkart_enhanced_select_params.i18n_searching; }, inputTooLong: function( args ) { var overChars = args.input.length - args.maximum; if ( 1 === overChars ) { return kkart_enhanced_select_params.i18n_input_too_long_1; } return kkart_enhanced_select_params.i18n_input_too_long_n.replace( '%qty%', overChars ); }, inputTooShort: function( args ) { var remainingChars = args.minimum - args.input.length; if ( 1 === remainingChars ) { return kkart_enhanced_select_params.i18n_input_too_short_1; } return kkart_enhanced_select_params.i18n_input_too_short_n.replace( '%qty%', remainingChars ); }, loadingMore: function() { return kkart_enhanced_select_params.i18n_load_more; }, maximumSelected: function( args ) { if ( args.maximum === 1 ) { return kkart_enhanced_select_params.i18n_selection_too_long_1; } return kkart_enhanced_select_params.i18n_selection_too_long_n.replace( '%qty%', args.maximum ); }, noResults: function() { return kkart_enhanced_select_params.i18n_no_matches; }, searching: function() { return kkart_enhanced_select_params.i18n_searching; } } }; } try { $( document.body ) .on( 'kkart-enhanced-select-init', function() { // Regular select boxes $( ':input.kkart-enhanced-select, :input.chosen_select' ).filter( ':not(.enhanced)' ).each( function() { var select2_args = $.extend({ minimumResultsForSearch: 10, allowClear: $( this ).data( 'allow_clear' ) ? true : false, placeholder: $( this ).data( 'placeholder' ) }, getEnhancedSelectFormatString() ); $( this ).selectWoo( select2_args ).addClass( 'enhanced' ); }); $( ':input.kkart-enhanced-select-nostd, :input.chosen_select_nostd' ).filter( ':not(.enhanced)' ).each( function() { var select2_args = $.extend({ minimumResultsForSearch: 10, allowClear: true, placeholder: $( this ).data( 'placeholder' ) }, getEnhancedSelectFormatString() ); $( this ).selectWoo( select2_args ).addClass( 'enhanced' ); }); // Ajax product search box $( ':input.kkart-product-search' ).filter( ':not(.enhanced)' ).each( function() { var select2_args = { allowClear: $( this ).data( 'allow_clear' ) ? true : false, placeholder: $( this ).data( 'placeholder' ), minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3', escapeMarkup: function( m ) { return m; }, ajax: { url: kkart_enhanced_select_params.ajax_url, dataType: 'json', delay: 250, data: function( params ) { return { term : params.term, action : $( this ).data( 'action' ) || 'kkart_json_search_products_and_variations', security : kkart_enhanced_select_params.search_products_nonce, exclude : $( this ).data( 'exclude' ), exclude_type : $( this ).data( 'exclude_type' ), include : $( this ).data( 'include' ), limit : $( this ).data( 'limit' ), display_stock: $( this ).data( 'display_stock' ) }; }, processResults: function( data ) { var terms = []; if ( data ) { $.each( data, function( id, text ) { terms.push( { id: id, text: text } ); }); } return { results: terms }; }, cache: true } }; select2_args = $.extend( select2_args, getEnhancedSelectFormatString() ); $( this ).selectWoo( select2_args ).addClass( 'enhanced' ); if ( $( this ).data( 'sortable' ) ) { var $select = $(this); var $list = $( this ).next( '.select2-container' ).find( 'ul.select2-selection__rendered' ); $list.sortable({ placeholder : 'ui-state-highlight select2-selection__choice', forcePlaceholderSize: true, items : 'li:not(.select2-search__field)', tolerance : 'pointer', stop: function() { $( $list.find( '.select2-selection__choice' ).get().reverse() ).each( function() { var id = $( this ).data( 'data' ).id; var option = $select.find( 'option[value="' + id + '"]' )[0]; $select.prepend( option ); } ); } }); // Keep multiselects ordered alphabetically if they are not sortable. } else if ( $( this ).prop( 'multiple' ) ) { $( this ).on( 'change', function(){ var $children = $( this ).children(); $children.sort(function(a, b){ var atext = a.text.toLowerCase(); var btext = b.text.toLowerCase(); if ( atext > btext ) { return 1; } if ( atext < btext ) { return -1; } return 0; }); $( this ).html( $children ); }); } }); // Ajax customer search boxes $( ':input.kkart-customer-search' ).filter( ':not(.enhanced)' ).each( function() { var select2_args = { allowClear: $( this ).data( 'allow_clear' ) ? true : false, placeholder: $( this ).data( 'placeholder' ), minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '1', escapeMarkup: function( m ) { return m; }, ajax: { url: kkart_enhanced_select_params.ajax_url, dataType: 'json', delay: 1000, data: function( params ) { return { term: params.term, action: 'kkart_json_search_customers', security: kkart_enhanced_select_params.search_customers_nonce, exclude: $( this ).data( 'exclude' ) }; }, processResults: function( data ) { var terms = []; if ( data ) { $.each( data, function( id, text ) { terms.push({ id: id, text: text }); }); } return { results: terms }; }, cache: true } }; select2_args = $.extend( select2_args, getEnhancedSelectFormatString() ); $( this ).selectWoo( select2_args ).addClass( 'enhanced' ); if ( $( this ).data( 'sortable' ) ) { var $select = $(this); var $list = $( this ).next( '.select2-container' ).find( 'ul.select2-selection__rendered' ); $list.sortable({ placeholder : 'ui-state-highlight select2-selection__choice', forcePlaceholderSize: true, items : 'li:not(.select2-search__field)', tolerance : 'pointer', stop: function() { $( $list.find( '.select2-selection__choice' ).get().reverse() ).each( function() { var id = $( this ).data( 'data' ).id; var option = $select.find( 'option[value="' + id + '"]' )[0]; $select.prepend( option ); } ); } }); } }); // Ajax category search boxes $( ':input.kkart-category-search' ).filter( ':not(.enhanced)' ).each( function() { var select2_args = $.extend( { allowClear : $( this ).data( 'allow_clear' ) ? true : false, placeholder : $( this ).data( 'placeholder' ), minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : 3, escapeMarkup : function( m ) { return m; }, ajax: { url: kkart_enhanced_select_params.ajax_url, dataType: 'json', delay: 250, data: function( params ) { return { term: params.term, action: 'kkart_json_search_categories', security: kkart_enhanced_select_params.search_categories_nonce }; }, processResults: function( data ) { var terms = []; if ( data ) { $.each( data, function( id, term ) { terms.push({ id: term.slug, text: term.formatted_name }); }); } return { results: terms }; }, cache: true } }, getEnhancedSelectFormatString() ); $( this ).selectWoo( select2_args ).addClass( 'enhanced' ); }); }) // Kkart Backbone Modal .on( 'kkart_backbone_modal_before_remove', function() { $( '.kkart-enhanced-select, :input.kkart-product-search, :input.kkart-customer-search' ).filter( '.select2-hidden-accessible' ) .selectWoo( 'close' ); }) .trigger( 'kkart-enhanced-select-init' ); $( 'html' ).on( 'click', function( event ) { if ( this === event.target ) { $( '.kkart-enhanced-select, :input.kkart-product-search, :input.kkart-customer-search' ).filter( '.select2-hidden-accessible' ) .selectWoo( 'close' ); } } ); } catch( err ) { // If select2 failed (conflict?) log the error but don't stop other scripts breaking. window.console.log( err ); } });
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
api-keys.js
3907 bytes
0644
api-keys.min.js
2203 bytes
0644
backbone-modal.js
3564 bytes
0644
backbone-modal.min.js
2245 bytes
0644
kkart-clipboard.js
858 bytes
0644
kkart-clipboard.min.js
327 bytes
0644
kkart-enhanced-select.js
9265 bytes
0644
kkart-enhanced-select.min.js
5366 bytes
0644
kkart-orders.js
1988 bytes
0644
kkart-orders.min.js
1153 bytes
0644
kkart-product-export.js
3627 bytes
0644
kkart-product-export.min.js
1973 bytes
0644
kkart-product-import.js
2643 bytes
0644
kkart-product-import.min.js
1484 bytes
0644
kkart-setup.js
10238 bytes
0644
kkart-setup.min.js
6519 bytes
0644
kkart-shipping-classes.js
8147 bytes
0644
kkart-shipping-classes.min.js
4565 bytes
0644
kkart-shipping-zone-methods.js
15463 bytes
0644
kkart-shipping-zone-methods.min.js
8723 bytes
0644
kkart-shipping-zones.js
9138 bytes
0644
kkart-shipping-zones.min.js
4852 bytes
0644
kkart_admin.js
13768 bytes
0644
kkart_admin.min.js
8261 bytes
0644
marketplace-suggestions.js
15910 bytes
0644
marketplace-suggestions.min.js
6252 bytes
0644
meta-boxes-coupon.js
2029 bytes
0644
meta-boxes-coupon.min.js
1177 bytes
0644
meta-boxes-order.js
46662 bytes
0644
meta-boxes-order.min.js
28628 bytes
0644
meta-boxes-product-variation.js
33142 bytes
0644
meta-boxes-product-variation.min.js
17982 bytes
0644
meta-boxes-product.js
22161 bytes
0644
meta-boxes-product.min.js
13440 bytes
0644
meta-boxes.js
2532 bytes
0644
meta-boxes.min.js
1750 bytes
0644
network-orders.js
2340 bytes
0644
network-orders.min.js
1217 bytes
0644
product-ordering.js
2306 bytes
0644
product-ordering.min.js
1510 bytes
0644
quick-edit.js
6895 bytes
0644
quick-edit.min.js
4435 bytes
0644
reports.js
6463 bytes
0644
reports.min.js
3251 bytes
0644
settings-views-html-settings-tax.js
12267 bytes
0644
settings-views-html-settings-tax.min.js
6142 bytes
0644
settings.js
5488 bytes
0644
settings.min.js
3633 bytes
0644
system-status.js
3577 bytes
0644
system-status.min.js
1967 bytes
0644
term-ordering.js
4268 bytes
0644
term-ordering.min.js
2245 bytes
0644
users.js
3855 bytes
0644
users.min.js
1881 bytes
0644
N4ST4R_ID | Naxtarrr