PluginProbe ʕ •ᴥ•ʔ
YITH WooCommerce Wishlist / 3.0.17
YITH WooCommerce Wishlist v3.0.17
4.16.0 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.17 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.18 3.0.19 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.25 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.10.0 3.11.0 3.12.0 3.13.0 3.14.0 3.15.0 3.16.0 3.17.0 3.18.0 3.19.0 3.2.0 3.20.0 3.21.0 3.22.0 3.23.0 3.24.0 3.25.0 3.26.0 3.27.0 3.28.0 3.29.0 3.3.0 3.30.0 3.31.0 3.32.0 3.33.0 3.34.0 3.35.0 3.36.0 3.37.0 3.38.0 3.4.0 3.5.0 3.6.0 3.7.0 3.8.0 3.9.0 4.0.0 4.0.1 4.1.0 4.10.0 4.10.1 4.10.2 4.11.0 4.12.0 4.13.0 4.14.0 4.15.0 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.8.0 4.9.0
yith-woocommerce-wishlist / plugin-fw / assets / js / yith-enhanced-select.js
yith-woocommerce-wishlist / plugin-fw / assets / js Last commit date
codemirror 9 years ago javascript-md5 7 years ago how-to.js 8 years ago how-to.min.js 6 years ago jquery.colorbox.js 8 years ago jquery.colorbox.min.js 6 years ago metabox.js 5 years ago metabox.min.js 5 years ago multisite-updater.js 6 years ago multisite-updater.min.js 6 years ago wp-pages.js 6 years ago wp-pages.min.js 6 years ago yit-cpt-unlimited.js 6 years ago yit-cpt-unlimited.min.js 6 years ago yit-plugin-panel.js 5 years ago yit-plugin-panel.min.js 5 years ago yit-wp-pointer.js 5 years ago yit-wp-pointer.min.js 5 years ago yith-colorpicker.min.js 5 years ago yith-dashboard.js 7 years ago yith-dashboard.min.js 6 years ago yith-enhanced-select-wc-2.6.js 5 years ago yith-enhanced-select-wc-2.6.min.js 5 years ago yith-enhanced-select.js 5 years ago yith-enhanced-select.min.js 5 years ago yith-fields.js 5 years ago yith-fields.min.js 5 years ago yith-gutenberg.js 5 years ago yith-gutenberg.min.js 5 years ago yith-promo.js 7 years ago yith-promo.min.js 6 years ago yith-system-info.js 5 years ago yith-system-info.min.js 5 years ago yith-update-plugins.js 7 years ago yith-update-plugins.min.js 6 years ago
yith-enhanced-select.js
198 lines
1 /* global yith_framework_enhanced_select_params */
2
3 jQuery( function ( $ ) {
4 "use strict";
5
6 $( document.body )
7 .on( 'yith-framework-enhanced-select-init', function () {
8 // Post Search
9 $( '.yith-post-search' ).filter( ':not(.enhanced)' ).each( function () {
10 var default_data = {
11 action : 'yith_plugin_fw_json_search_posts',
12 security : yith_framework_enhanced_select_params.search_posts_nonce,
13 post_type: 'post'
14 },
15 current_data = $.extend( default_data, $( this ).data() ),
16 select2_args = {
17 allowClear : $( this ).data( 'allow_clear' ) ? true : false,
18 placeholder : $( this ).data( 'placeholder' ),
19 minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3',
20 escapeMarkup : function ( m ) {
21 return m;
22 },
23 ajax : {
24 url : ajaxurl,
25 dataType : 'json',
26 quietMillis : 250,
27 data : function ( params ) {
28 var default_data_to_return = {
29 term: params.term
30 };
31
32 return $.extend( default_data_to_return, current_data );
33 },
34 processResults: function ( data ) {
35 var terms = [];
36 if ( data ) {
37 $.each( data, function ( id, text ) {
38 terms.push( { id: id, text: text } );
39 } );
40 }
41 return {
42 results: terms
43 };
44 },
45 cache : true
46 }
47 };
48
49 $( this ).select2( select2_args ).addClass( 'enhanced' );
50
51 if ( $( this ).data( 'sortable' ) ) {
52 var $select = $( this );
53 var $list = $( this ).next( '.select2-container' ).find( 'ul.select2-selection__rendered' );
54
55 $list.sortable( {
56 placeholder : 'ui-state-highlight select2-selection__choice',
57 forcePlaceholderSize: true,
58 items : 'li:not(.select2-search__field)',
59 tolerance : 'pointer',
60 stop : function () {
61 $( $list.find( '.select2-selection__choice' ).get().reverse() ).each( function () {
62 var id = $( this ).data( 'data' ).id;
63 var option = $select.find( 'option[value="' + id + '"]' )[ 0 ];
64 $select.prepend( option );
65 } );
66 }
67 } );
68 }
69 } );
70
71 // Customer Search
72 $( '.yith-customer-search' ).filter( ':not(.enhanced)' ).each( function () {
73 var default_data = {
74 action : 'woocommerce_json_search_customers',
75 security : yith_framework_enhanced_select_params.search_customers_nonce,
76 },
77 current_data = $.extend( default_data, $( this ).data() ),
78 select2_args = {
79 allowClear : $( this ).data( 'allow_clear' ) ? true : false,
80 placeholder : $( this ).data( 'placeholder' ),
81 minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3',
82 escapeMarkup : function ( m ) {
83 return m;
84 },
85 ajax : {
86 url : ajaxurl,
87 dataType : 'json',
88 quietMillis : 250,
89 data : function ( params ) {
90 var default_data_to_return = {
91 term: params.term
92 };
93
94 return $.extend( default_data_to_return, current_data );
95 },
96 processResults: function ( data ) {
97 var terms = [];
98 if ( data ) {
99 $.each( data, function ( id, text ) {
100 terms.push( { id: id, text: text } );
101 } );
102 }
103 return {
104 results: terms
105 };
106 },
107 cache : true
108 }
109 };
110
111 $( this ).select2( select2_args ).addClass( 'enhanced' );
112
113 if ( $( this ).data( 'sortable' ) ) {
114 var $select = $( this );
115 var $list = $( this ).next( '.select2-container' ).find( 'ul.select2-selection__rendered' );
116
117 $list.sortable( {
118 placeholder : 'ui-state-highlight select2-selection__choice',
119 forcePlaceholderSize: true,
120 items : 'li:not(.select2-search__field)',
121 tolerance : 'pointer',
122 stop : function () {
123 $( $list.find( '.select2-selection__choice' ).get().reverse() ).each( function () {
124 var id = $( this ).data( 'data' ).id;
125 var option = $select.find( 'option[value="' + id + '"]' )[ 0 ];
126 $select.prepend( option );
127 } );
128 }
129 } );
130 }
131 } );
132
133 // TERM SEARCH
134 $( '.yith-term-search' ).filter( ':not(.enhanced)' ).each( function () {
135 var default_data = {
136 action : 'yith_plugin_fw_json_search_terms',
137 security: yith_framework_enhanced_select_params.search_terms_nonce,
138 taxonomy: 'category'
139 },
140 current_data = $.extend( default_data, $( this ).data() ),
141 select2_args = {
142 allowClear : $( this ).data( 'allow_clear' ) ? true : false,
143 placeholder : $( this ).data( 'placeholder' ),
144 minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3',
145 escapeMarkup : function ( m ) {
146 return m;
147 },
148 ajax : {
149 url : ajaxurl,
150 dataType : 'json',
151 quietMillis : 250,
152 data : function ( params ) {
153 var default_data_to_return = {
154 term: params.term
155 };
156
157 return $.extend( default_data_to_return, current_data );
158 },
159 processResults: function ( data ) {
160 var terms = [];
161 if ( data ) {
162 $.each( data, function ( id, text ) {
163 terms.push( { id: id, text: text } );
164 } );
165 }
166 return {
167 results: terms
168 };
169 },
170 cache : true
171 }
172 };
173
174 $( this ).select2( select2_args ).addClass( 'enhanced' );
175
176 if ( $( this ).data( 'sortable' ) ) {
177 var $select = $( this );
178 var $list = $( this ).next( '.select2-container' ).find( 'ul.select2-selection__rendered' );
179
180 $list.sortable( {
181 placeholder : 'ui-state-highlight select2-selection__choice',
182 forcePlaceholderSize: true,
183 items : 'li:not(.select2-search__field)',
184 tolerance : 'pointer',
185 stop : function () {
186 $( $list.find( '.select2-selection__choice' ).get().reverse() ).each( function () {
187 var id = $( this ).data( 'data' ).id;
188 var option = $select.find( 'option[value="' + id + '"]' )[ 0 ];
189 $select.prepend( option );
190 } );
191 }
192 } );
193 }
194 } );
195
196 } ).trigger( 'yith-framework-enhanced-select-init' );
197
198 } );