From 3fb4c2483de2ef00d46f15afc87bb81f134065c1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 27 Apr 2020 10:17:02 +0200 Subject: [PATCH] Remove client files from ldap plugin --- .../client/common-client-plugin.js | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 peertube-plugin-auth-ldap/client/common-client-plugin.js diff --git a/peertube-plugin-auth-ldap/client/common-client-plugin.js b/peertube-plugin-auth-ldap/client/common-client-plugin.js deleted file mode 100644 index c126219..0000000 --- a/peertube-plugin-auth-ldap/client/common-client-plugin.js +++ /dev/null @@ -1,46 +0,0 @@ -function register ({ registerHook, peertubeHelpers }) { - initMatomo(registerHook, peertubeHelpers) - .catch(err => console.error('Cannot initialize Matomo', err)) -} - -export { - register -} - -function initMatomo (registerHook, peertubeHelpers) { - return peertubeHelpers.getSettings() - .then(s => { - if (!s || !s['site-id'] || !s['url']) { - console.error('Matomo settings are not set.') - return - } - - const matomoUrl = s['url'] - const siteId = s['site-id'] - - window._paq = window._paq || []; - window._paq.push(['trackPageView']); - window._paq.push(['enableLinkTracking']); - (function() { - var u = matomoUrl + '/'; - window._paq.push(['setTrackerUrl', u+'matomo.php']); - window._paq.push(['setSiteId', siteId]); - var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; - g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); - })(); - - window._paq.push(['setDocumentTitle', window.document.title]); - window._paq.push(['setCustomUrl', '/' + window.location.hash.substr(1)]); - window._paq.push(['trackPageView']); - - registerHook({ - target: 'action:router.navigation-end', - handler: function (params) { - window._paq.push(['setDocumentTitle', window.document.title]); - window._paq.push(['setCustomUrl', params.path]); - window._paq.push(['trackPageView']); - } - }) - }) - -}