PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / trunk
Matomo Analytics – Powerful, Privacy-First Insights for WordPress vtrunk
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / core / AssetManager / UIAssetFetcher / JScriptUIAssetFetcher.php
matomo / app / core / AssetManager / UIAssetFetcher Last commit date
Chunk.php 3 months ago JScriptUIAssetFetcher.php 2 years ago PluginUmdAssetFetcher.php 2 months ago StaticUIAssetFetcher.php 2 years ago StylesheetUIAssetFetcher.php 2 years ago
JScriptUIAssetFetcher.php
90 lines
1 <?php
2
3 /**
4 * Matomo - free/libre analytics platform
5 *
6 * @link https://matomo.org
7 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8 */
9 namespace Piwik\AssetManager\UIAssetFetcher;
10
11 use Piwik\AssetManager\UIAssetFetcher;
12 use Piwik\Piwik;
13 class JScriptUIAssetFetcher extends UIAssetFetcher
14 {
15 protected function retrieveFileLocations()
16 {
17 if (!empty($this->plugins)) {
18 /**
19 * Triggered when gathering the list of all JavaScript files needed by Piwik
20 * and its plugins.
21 *
22 * Plugins that have their own JavaScript should use this event to make those
23 * files load in the browser.
24 *
25 * JavaScript files should be placed within a **javascripts** subdirectory in your
26 * plugin's root directory.
27 *
28 * _Note: While you are developing your plugin you should enable the config setting
29 * `[Development] disable_merged_assets` so JavaScript files will be reloaded immediately
30 * after every change._
31 *
32 * **Example**
33 *
34 * public function getJsFiles(&$jsFiles)
35 * {
36 * $jsFiles[] = "plugins/MyPlugin/javascripts/myfile.js";
37 * $jsFiles[] = "plugins/MyPlugin/javascripts/anotherone.js";
38 * }
39 *
40 * @param string[] $jsFiles The JavaScript files to load.
41 */
42 Piwik::postEvent('AssetManager.getJavaScriptFiles', array(&$this->fileLocations), null, $this->plugins);
43 }
44 $this->addThemeFiles();
45 $this->mapBowerComponentFilesForBC($this->fileLocations);
46 }
47 protected function addThemeFiles()
48 {
49 $theme = $this->getTheme();
50 if (!$theme) {
51 return;
52 }
53 if (in_array($theme->getThemeName(), $this->plugins)) {
54 $jsInThemes = $this->getTheme()->getJavaScriptFiles();
55 if (!empty($jsInThemes)) {
56 foreach ($jsInThemes as $jsFile) {
57 $this->fileLocations[] = $jsFile;
58 }
59 }
60 }
61 }
62 protected function getPriorityOrder()
63 {
64 return array(
65 'node_modules/jquery/dist/jquery.min.js',
66 'node_modules/jquery/dist/jquery.js',
67 'node_modules/@materializecss/materialize/dist/js/materialize.min.js',
68 // so jquery ui datepicker overrides materializecss
69 'node_modules/jquery-ui-dist/jquery-ui.min.js',
70 'node_modules/jquery-ui-dist/jquery-ui.js',
71 "plugins/CoreHome/javascripts/materialize-bc.js",
72 'node_modules/',
73 'libs/',
74 'js/',
75 'plugins/CoreVue/polyfills/dist/MatomoPolyfills',
76 'piwik.js',
77 'matomo.js',
78 'plugins/CoreHome/javascripts/require.js',
79 'plugins/Morpheus/javascripts/piwikHelper.js',
80 'plugins/Morpheus/javascripts/',
81 'plugins/CoreHome/javascripts/uiControl.js',
82 'plugins/CoreHome/javascripts/broadcast.js',
83 'plugins/CoreHome/javascripts/',
84 // load CoreHome JS before other plugins
85 'plugins/',
86 'tests/',
87 );
88 }
89 }
90