PluginProbe
Booking Calendar / 10.10
Booking Calendar v10.10
11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 10.11.3 All 202 releases
booking / includes / __js / utils / wpbc_utils.js

wpbc_utils.js in Booking Calendar 10.10, at includes/__js/utils/wpbc_utils.js

41 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * =====================================================================================================================
3 * JavaScript Util Functions ../includes/__js/utils/wpbc_utils.js
4 * =====================================================================================================================
5 */
6
7 /**
8 * Trim strings and array joined with (,)
9 *
10 * @param string_to_trim string / array
11 * @returns string
12 */
13 function wpbc_trim( string_to_trim ){
14
15 if ( Array.isArray( string_to_trim ) ){
16 string_to_trim = string_to_trim.join( ',' );
17 }
18
19 if ( 'string' == typeof (string_to_trim) ){
20 string_to_trim = string_to_trim.trim();
21 }
22
23 return string_to_trim;
24 }
25
26 /**
27 * Check if element in array
28 *
29 * @param array_here array
30 * @param p_val element to check
31 * @returns {boolean}
32 */
33 function wpbc_in_array( array_here, p_val ){
34 for ( var i = 0, l = array_here.length; i < l; i++ ){
35 if ( array_here[ i ] == p_val ){
36 return true;
37 }
38 }
39 return false;
40 }
41