blob: de364d2a3e425ebe1c19e236c1e1f7e053722381 (
plain)
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
|
/*!
* Matomo - free/libre analytics platform
*
* @link http://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
$(function () {
var iconRefresh = $('.top_controls .icon-reload');
function refresh() {
var Matomo = window.CoreHome.Matomo;
var hashParsed = window.CoreHome.MatomoUrl.hashParsed.value;
Matomo.postEvent('loadPage', hashParsed.category, hashParsed.subcategory);
}
function isCoreHomeModuleActive() {
var search = window.CoreHome.MatomoUrl.parse(window.location.search.slice(1));
return search.module === 'CoreHome';
}
if (isCoreHomeModuleActive()) {
iconRefresh.removeClass('hidden');
iconRefresh.on('click', function (e) {
e.preventDefault();
refresh();
});
piwikHelper.registerShortcut('r', _pk_translate('CoreHome_ShortcutRefresh'), function (event) {
if (event.altKey) {
return;
}
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false; // IE
}
refresh();
});
}
});
|