diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2023-09-25 13:55:57 -0300 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-09-27 12:44:22 +0200 |
commit | c10e043fdaf6ed01727d99dfa3bcccd49ba9c527 (patch) | |
tree | ed05eda72cb35191dbcb498cabf927d5059a8e07 /help3xsl/tdf_matomo.js | |
parent | 17e9b144759c47e32d6b169d6719f301750f059d (diff) |
tdf#157360 Local help should not phone home
+ Remove call to matomo TDF server instance when help is local
+ Keep when Help is online.
+ refactor javascript
Change-Id: I285b426531c91ff558c01798f803bf3f89720b1f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/157255
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
(cherry picked from commit 0c24f409c31e4ca8a85b6a1486e2c6eaf26942d6)
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/157221
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'help3xsl/tdf_matomo.js')
-rw-r--r-- | help3xsl/tdf_matomo.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/help3xsl/tdf_matomo.js b/help3xsl/tdf_matomo.js new file mode 100644 index 0000000000..fb05d9e188 --- /dev/null +++ b/help3xsl/tdf_matomo.js @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// Test, if we are online +if (document.body.getElementsByTagName('meta')) { + var _paq = _paq || []; + /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ + _paq.push(['disableCookies']); + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="//piwik.documentfoundation.org/"; + _paq.push(['setTrackerUrl', u+'piwik.php']); + _paq.push(['setSiteId', '68']); + 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+'piwik.js'; s.parentNode.insertBefore(g,s); + })(); +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |