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_REACT = 'ee-vendor-react'; |
||
47 | |||
48 | const JS_HANDLE_EE_JS_API = 'eejs-api'; |
||
49 | |||
50 | const JS_HANDLE_EE_CORE = 'espresso_core'; |
||
51 | |||
52 | const JS_HANDLE_EE_I18N = 'eei18n'; |
||
53 | |||
54 | const JS_HANDLE_EE_ACCOUNTING = 'ee-accounting'; |
||
55 | |||
56 | const JS_HANDLE_EE_WP_PLUGINS_PAGE = 'ee-wp-plugins-page'; |
||
57 | |||
58 | // EE CSS assets handles |
||
59 | const CSS_HANDLE_EE_DEFAULT = 'espresso_default'; |
||
60 | |||
61 | const CSS_HANDLE_EE_CUSTOM = 'espresso_custom_css'; |
||
62 | |||
63 | /** |
||
64 | * @var EE_Currency_Config $currency_config |
||
65 | */ |
||
66 | protected $currency_config; |
||
67 | |||
68 | /** |
||
69 | * @var EE_Template_Config $template_config |
||
70 | */ |
||
71 | protected $template_config; |
||
72 | |||
73 | |||
74 | /** |
||
75 | * CoreAssetRegister constructor. |
||
76 | * |
||
77 | * @param AssetCollection $assets |
||
78 | * @param EE_Currency_Config $currency_config |
||
79 | * @param EE_Template_Config $template_config |
||
80 | * @param DomainInterface $domain |
||
81 | * @param Registry $registry |
||
82 | */ |
||
83 | public function __construct( |
||
94 | |||
95 | |||
96 | /** |
||
97 | * @since $VID:$ |
||
98 | * @throws DuplicateCollectionIdentifierException |
||
99 | * @throws InvalidArgumentException |
||
100 | * @throws InvalidDataTypeException |
||
101 | * @throws InvalidEntityException |
||
102 | */ |
||
103 | public function addAssets() |
||
108 | |||
109 | |||
110 | /** |
||
111 | * @since $VID:$ |
||
112 | * @throws DuplicateCollectionIdentifierException |
||
113 | * @throws InvalidArgumentException |
||
114 | * @throws InvalidDataTypeException |
||
115 | * @throws InvalidEntityException |
||
116 | */ |
||
117 | public function addJavascriptFiles() |
||
128 | |||
129 | |||
130 | /** |
||
131 | * @since $VID:$ |
||
132 | * @throws DuplicateCollectionIdentifierException |
||
133 | * @throws InvalidDataTypeException |
||
134 | * @throws InvalidEntityException |
||
135 | */ |
||
136 | public function addStylesheetFiles() |
||
140 | |||
141 | |||
142 | /** |
||
143 | * core default javascript |
||
144 | * |
||
145 | * @since $VID:$ |
||
146 | * @throws DuplicateCollectionIdentifierException |
||
147 | * @throws InvalidArgumentException |
||
148 | * @throws InvalidDataTypeException |
||
149 | * @throws InvalidEntityException |
||
150 | */ |
||
151 | private function loadCoreJs() |
||
202 | |||
203 | |||
204 | /** |
||
205 | * @since $VID:$ |
||
206 | * @throws DuplicateCollectionIdentifierException |
||
207 | * @throws InvalidDataTypeException |
||
208 | * @throws InvalidEntityException |
||
209 | */ |
||
210 | private function loadCoreCss() |
||
230 | |||
231 | |||
232 | /** |
||
233 | * jQuery Validate for form validation |
||
234 | * |
||
235 | * @since $VID:$ |
||
236 | * @throws DuplicateCollectionIdentifierException |
||
237 | * @throws InvalidDataTypeException |
||
238 | * @throws InvalidEntityException |
||
239 | */ |
||
240 | private function loadJqueryValidate() |
||
256 | |||
257 | |||
258 | /** |
||
259 | * accounting.js for performing client-side calculations |
||
260 | * |
||
261 | * @since $VID:$ |
||
262 | * @throws DuplicateCollectionIdentifierException |
||
263 | * @throws InvalidDataTypeException |
||
264 | * @throws InvalidEntityException |
||
265 | */ |
||
266 | private function loadAccountingJs() |
||
311 | |||
312 | |||
313 | /** |
||
314 | * registers assets for cleaning your ears |
||
315 | * |
||
316 | * @param JavascriptAsset $script |
||
317 | */ |
||
318 | public function loadQtipJs(JavascriptAsset $script) |
||
329 | |||
330 | |||
331 | /** |
||
332 | * assets that are used in the WordPress admin |
||
333 | * |
||
334 | * @since $VID:$ |
||
335 | * @throws DuplicateCollectionIdentifierException |
||
336 | * @throws InvalidDataTypeException |
||
337 | * @throws InvalidEntityException |
||
338 | */ |
||
339 | private function registerAdminAssets() |
||
356 | } |
||
357 |