-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass-vendor-support.php
82 lines (74 loc) · 2.12 KB
/
class-vendor-support.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
if ( ! class_exists( 'WPOnion_Vendor_Support' ) ) {
/**
* Class WPOnion_Vendor_Support
*
* @author Varun Sridharan <varunsridharan23@gmail.com>
* @since 1.0
*/
final class WPOnion_Vendor_Support {
/**
* Stores All Script Informations.
*
* @var array
*/
protected static $scripts = array();
/**
* @var array
*/
protected static $styles = array();
/**
* Stores All Basic Information.
*/
public static function init() {
/**
* Scripts.
*/
self::$scripts['chosen'] = self::url( 'vendors/chosen/chosen.jquery.min.js' );
self::$scripts['wponion-datepicker'] = self::url( 'vendors/flatpickr/script.js' );
self::$scripts['select2'] = self::url( 'vendors/select2/select2.full.min.js' );
self::$scripts['selectize'] = self::url( 'vendors/selectize/selectize.js' );
self::$scripts['wponion-inputmask'] = self::url( 'vendors/inputmask/jquery.inputmask.bundle.min.js' );
self::$scripts['wponion-pickr'] = self::url( 'vendors/pickr/pickr.es5.min.js' );
/**
* Styles.
*/
self::$styles['chosen'] = self::url( 'vendors/chosen/chosen.min.css' );
self::$styles['wponion-datepicker'] = self::url( 'vendors/flatpickr/style.css' );
self::$styles['wponion-pickr'] = self::url( 'vendors/pickr/pickr.css' );
self::$styles['select2'] = self::url( 'vendors/select2/select2.min.css' );
self::$styles['selectize'] = self::url( 'vendors/selectize/selectize.css' );
}
/**
* Adds Extra URL.
*
* @param $extra
*
* @return string
*/
protected static function url( $extra ) {
return plugin_dir_url( __FILE__ ) . $extra;
}
/**
* Returns Script Info
*
* @param $key
*
* @return bool|mixed
*/
public static function script( $key ) {
return ( isset( self::$scripts[ $key ] ) ) ? self::$scripts[ $key ] : false;
}
/**
* Returns Script Info
*
* @param $key
*
* @return bool|mixed
*/
public static function style( $key ) {
return ( isset( self::$styles[ $key ] ) ) ? self::$styles[ $key ] : false;
}
}
}
WPOnion_Vendor_Support::init();