1 | <?php |
||
27 | class CoreAssetManager extends AssetManager |
||
28 | { |
||
29 | |||
30 | // WordPress core / Third party JS asset handles |
||
31 | const JS_HANDLE_JQUERY = 'jquery'; |
||
32 | |||
33 | const JS_HANDLE_JQUERY_VALIDATE = 'jquery-validate'; |
||
34 | |||
35 | const JS_HANDLE_JQUERY_VALIDATE_EXTRA = 'jquery-validate-extra-methods'; |
||
36 | |||
37 | const JS_HANDLE_UNDERSCORE = 'underscore'; |
||
38 | |||
39 | const JS_HANDLE_ACCOUNTING_CORE = 'ee-accounting-core'; |
||
40 | |||
41 | // EE JS assets handles |
||
42 | const JS_HANDLE_EE_MANIFEST = 'ee-manifest'; |
||
43 | |||
44 | const JS_HANDLE_EE_JS_CORE = 'eejs-core'; |
||
45 | |||
46 | const JS_HANDLE_EE_VENDOR = 'eventespresso-vendor'; |
||
47 | |||
48 | const JS_HANDLE_EE_CORE = 'espresso_core'; |
||
49 | |||
50 | const JS_HANDLE_EE_I18N = 'eei18n'; |
||
51 | |||
52 | const JS_HANDLE_EE_ACCOUNTING = 'ee-accounting'; |
||
53 | |||
54 | const JS_HANDLE_EE_WP_PLUGINS_PAGE = 'ee-wp-plugins-page'; |
||
55 | |||
56 | // EE CSS assets handles |
||
57 | const CSS_HANDLE_EE_DEFAULT = 'espresso_default'; |
||
58 | |||
59 | const CSS_HANDLE_EE_CUSTOM = 'espresso_custom_css'; |
||
60 | |||
61 | /** |
||
62 | * @var EE_Currency_Config $currency_config |
||
63 | */ |
||
64 | protected $currency_config; |
||
65 | |||
66 | /** |
||
67 | * @var EE_Template_Config $template_config |
||
68 | */ |
||
69 | protected $template_config; |
||
70 | |||
71 | |||
72 | /** |
||
73 | * CoreAssetRegister constructor. |
||
74 | * |
||
75 | * @param AssetCollection $assets |
||
76 | * @param EE_Currency_Config $currency_config |
||
77 | * @param EE_Template_Config $template_config |
||
78 | * @param DomainInterface $domain |
||
79 | * @param Registry $registry |
||
80 | */ |
||
81 | public function __construct( |
||
92 | |||
93 | |||
94 | /** |
||
95 | * @since 4.9.62.p |
||
96 | * @throws DuplicateCollectionIdentifierException |
||
97 | * @throws InvalidArgumentException |
||
98 | * @throws InvalidDataTypeException |
||
99 | * @throws InvalidEntityException |
||
100 | */ |
||
101 | public function addAssets() |
||
106 | |||
107 | |||
108 | /** |
||
109 | * @since 4.9.62.p |
||
110 | * @throws DuplicateCollectionIdentifierException |
||
111 | * @throws InvalidArgumentException |
||
112 | * @throws InvalidDataTypeException |
||
113 | * @throws InvalidEntityException |
||
114 | */ |
||
115 | public function addJavascriptFiles() |
||
126 | |||
127 | |||
128 | /** |
||
129 | * @since 4.9.62.p |
||
130 | * @throws DuplicateCollectionIdentifierException |
||
131 | * @throws InvalidDataTypeException |
||
132 | * @throws InvalidEntityException |
||
133 | */ |
||
134 | public function addStylesheetFiles() |
||
138 | |||
139 | |||
140 | /** |
||
141 | * core default javascript |
||
142 | * |
||
143 | * @since 4.9.62.p |
||
144 | * @throws DuplicateCollectionIdentifierException |
||
145 | * @throws InvalidArgumentException |
||
146 | * @throws InvalidDataTypeException |
||
147 | * @throws InvalidEntityException |
||
148 | */ |
||
149 | private function loadCoreJs() |
||
194 | |||
195 | |||
196 | /** |
||
197 | * @since 4.9.62.p |
||
198 | * @throws DuplicateCollectionIdentifierException |
||
199 | * @throws InvalidDataTypeException |
||
200 | * @throws InvalidEntityException |
||
201 | */ |
||
202 | private function loadCoreCss() |
||
222 | |||
223 | |||
224 | /** |
||
225 | * jQuery Validate for form validation |
||
226 | * |
||
227 | * @since 4.9.62.p |
||
228 | * @throws DuplicateCollectionIdentifierException |
||
229 | * @throws InvalidDataTypeException |
||
230 | * @throws InvalidEntityException |
||
231 | */ |
||
232 | private function loadJqueryValidate() |
||
248 | |||
249 | |||
250 | /** |
||
251 | * accounting.js for performing client-side calculations |
||
252 | * |
||
253 | * @since 4.9.62.p |
||
254 | * @throws DuplicateCollectionIdentifierException |
||
255 | * @throws InvalidDataTypeException |
||
256 | * @throws InvalidEntityException |
||
257 | */ |
||
258 | private function loadAccountingJs() |
||
303 | |||
304 | |||
305 | /** |
||
306 | * registers assets for cleaning your ears |
||
307 | * |
||
308 | * @param JavascriptAsset $script |
||
309 | */ |
||
310 | public function loadQtipJs(JavascriptAsset $script) |
||
321 | |||
322 | |||
323 | /** |
||
324 | * assets that are used in the WordPress admin |
||
325 | * |
||
326 | * @since 4.9.62.p |
||
327 | * @throws DuplicateCollectionIdentifierException |
||
328 | * @throws InvalidDataTypeException |
||
329 | * @throws InvalidEntityException |
||
330 | */ |
||
331 | private function registerAdminAssets() |
||
348 | } |
||
349 |