| Server IP : 213.186.33.4 / Your IP : 216.73.216.193 Web Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : awebpaca ( 35430) PHP Version : 8.5.0 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/a/w/e/awebpaca/piwik/plugins/CoreHome/angularjs/popover-handler/ |
Upload File : |
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
/**
* When present in the page it listens to a popover URL parameter.
*
* If present it will try to load the related content in a popover or if the URL is empty it will close an
* opened popover.
*
* Example:
* <div piwik-popover-handler></div>
*/
(function () {
angular.module('piwikApp').directive('piwikPopoverHandler', piwikPopoverHandler);
piwikPopoverHandler.$inject = ['$location', '$rootScope', 'piwik'];
function piwikPopoverHandler($location, $rootScope, piwik){
return {
restrict: 'A',
scope: {},
controller: function () {
function close()
{
Piwik_Popover.close();
}
function open(popoverParam)
{
// in case the $ was encoded (e.g. when using copy&paste on urls in some browsers)
popoverParam = decodeURIComponent(popoverParam);
// revert special encoding from broadcast.propagateNewPopoverParameter()
popoverParam = popoverParam.replace(/\$/g, '%');
popoverParam = decodeURIComponent(popoverParam);
var popoverParamParts = popoverParam.split(':');
var handlerName = popoverParamParts[0];
popoverParamParts.shift();
var param = popoverParamParts.join(':');
if (typeof piwik.broadcast.popoverHandlers[handlerName] != 'undefined'
&& !piwik.broadcast.isLoginPage()) {
piwik.broadcast.popoverHandlers[handlerName](param);
}
}
function openOrClose()
{
close();
// should be rather done by routing
var popoverParam = $location.search().popover;
if (popoverParam) {
open(popoverParam);
} else {
// the URL should only be set to an empty popover if there are no popovers in the stack.
// to avoid avoid any strange inconsistent states, we reset the popover stack here.
broadcast.resetPopoverStack();
}
}
$rootScope.$on('$locationChangeSuccess', function () {
// should be rather done by routing
$(function () {
// make sure all popover handles were registered
openOrClose();
});
});
}
};
}
})();