Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
PeerTube
official-plugins
Commits
3fb4c248
Verified
Commit
3fb4c248
authored
Apr 27, 2020
by
Chocobozzz
Browse files
Remove client files from ldap plugin
parent
002b6723
Changes
1
Show whitespace changes
Inline
Side-by-side
peertube-plugin-auth-ldap/client/common-client-plugin.js
deleted
100644 → 0
View file @
002b6723
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
'
]);
}
})
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment