1 | <?php |
||
28 | class CoreAssetManager extends AssetManager |
||
29 | { |
||
30 | |||
31 | // WordPress core / Third party JS asset handles |
||
32 | const JS_HANDLE_JQUERY = 'jquery'; |
||
33 | |||
34 | const JS_HANDLE_JQUERY_VALIDATE = 'jquery-validate'; |
||
35 | |||
36 | const JS_HANDLE_JQUERY_VALIDATE_EXTRA = 'jquery-validate-extra-methods'; |
||
37 | |||
38 | const JS_HANDLE_UNDERSCORE = 'underscore'; |
||
39 | |||
40 | const JS_HANDLE_ACCOUNTING_CORE = 'ee-accounting-core'; |
||
41 | |||
42 | // EE JS assets handles |
||
43 | const JS_HANDLE_EE_MANIFEST = 'ee-manifest'; |
||
44 | |||
45 | const JS_HANDLE_EE_JS_CORE = 'eejs-core'; |
||
46 | |||
47 | const JS_HANDLE_EE_VENDOR_REACT = 'ee-vendor-react'; |
||
48 | |||
49 | const JS_HANDLE_EE_JS_API = 'eejs-api'; |
||
50 | |||
51 | const JS_HANDLE_EE_CORE = 'espresso_core'; |
||
52 | |||
53 | const JS_HANDLE_EE_I18N = 'eei18n'; |
||
54 | |||
55 | const JS_HANDLE_EE_ACCOUNTING = 'ee-accounting'; |
||
56 | |||
57 | const JS_HANDLE_EE_WP_PLUGINS_PAGE = 'ee-wp-plugins-page'; |
||
58 | |||
59 | // EE CSS assets handles |
||
60 | const CSS_HANDLE_EE_DEFAULT = 'espresso_default'; |
||
61 | |||
62 | const CSS_HANDLE_EE_CUSTOM = 'espresso_custom_css'; |
||
63 | |||
64 | /** |
||
65 | * @var EE_Currency_Config $currency_config |
||
66 | */ |
||
67 | protected $currency_config; |
||
68 | |||
69 | /** |
||
70 | * @var EE_Template_Config $template_config |
||
71 | */ |
||
72 | protected $template_config; |
||
73 | |||
74 | |||
75 | /** |
||
76 | * CoreAssetRegister constructor. |
||
77 | * |
||
78 | * @param AssetCollection $assets |
||
79 | * @param EE_Currency_Config $currency_config |
||
80 | * @param EE_Template_Config $template_config |
||
81 | * @param DomainInterface $domain |
||
82 | * @param Registry $registry |
||
83 | */ |
||
84 | public function __construct( |
||
95 | |||
96 | |||
97 | /** |
||
98 | * @since $VID:$ |
||
99 | * @throws DuplicateCollectionIdentifierException |
||
100 | * @throws InvalidArgumentException |
||
101 | * @throws InvalidDataTypeException |
||
102 | * @throws InvalidEntityException |
||
103 | */ |
||
104 | public function addAssets() |
||
109 | |||
110 | |||
111 | /** |
||
112 | * @since $VID:$ |
||
113 | * @throws DuplicateCollectionIdentifierException |
||
114 | * @throws InvalidArgumentException |
||
115 | * @throws InvalidDataTypeException |
||
116 | * @throws InvalidEntityException |
||
117 | */ |
||
118 | public function addJavascriptFiles() |
||
129 | |||
130 | |||
131 | /** |
||
132 | * @since $VID:$ |
||
133 | * @throws DuplicateCollectionIdentifierException |
||
134 | * @throws InvalidDataTypeException |
||
135 | * @throws InvalidEntityException |
||
136 | */ |
||
137 | public function addStylesheetFiles() |
||
141 | |||
142 | |||
143 | /** |
||
144 | * core default javascript |
||
145 | * |
||
146 | * @since $VID:$ |
||
147 | * @throws DuplicateCollectionIdentifierException |
||
148 | * @throws InvalidArgumentException |
||
149 | * @throws InvalidDataTypeException |
||
150 | * @throws InvalidEntityException |
||
151 | */ |
||
152 | private function loadCoreJs() |
||
209 | |||
210 | |||
211 | /** |
||
212 | * @since $VID:$ |
||
213 | * @throws DuplicateCollectionIdentifierException |
||
214 | * @throws InvalidDataTypeException |
||
215 | * @throws InvalidEntityException |
||
216 | */ |
||
217 | private function loadCoreCss() |
||
237 | |||
238 | |||
239 | /** |
||
240 | * jQuery Validate for form validation |
||
241 | * |
||
242 | * @since $VID:$ |
||
243 | * @throws DuplicateCollectionIdentifierException |
||
244 | * @throws InvalidDataTypeException |
||
245 | * @throws InvalidEntityException |
||
246 | */ |
||
247 | private function loadJqueryValidate() |
||
263 | |||
264 | |||
265 | /** |
||
266 | * accounting.js for performing client-side calculations |
||
267 | * |
||
268 | * @since $VID:$ |
||
269 | * @throws DuplicateCollectionIdentifierException |
||
270 | * @throws InvalidDataTypeException |
||
271 | * @throws InvalidEntityException |
||
272 | */ |
||
273 | private function loadAccountingJs() |
||
318 | |||
319 | |||
320 | /** |
||
321 | * registers assets for cleaning your ears |
||
322 | * |
||
323 | * @param JavascriptAsset $script |
||
324 | */ |
||
325 | public function loadQtipJs(JavascriptAsset $script) |
||
336 | |||
337 | |||
338 | /** |
||
339 | * assets that are used in the WordPress admin |
||
340 | * |
||
341 | * @since $VID:$ |
||
342 | * @throws DuplicateCollectionIdentifierException |
||
343 | * @throws InvalidDataTypeException |
||
344 | * @throws InvalidEntityException |
||
345 | */ |
||
346 | private function registerAdminAssets() |
||
363 | } |
||
364 |