diff --git a/plugins/Tour/tests/UI/expected-screenshots/.gitkeep b/plugins/Tour/tests/UI/expected-screenshots/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_ConsentManager_widget_initial.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_ConsentManager_widget_initial.png deleted file mode 100644 index efff4eabaecdbf2b4b6493a78dae6f811c9187a9..0000000000000000000000000000000000000000 Binary files a/plugins/Tour/tests/UI/expected-screenshots/Tour_ConsentManager_widget_initial.png and /dev/null differ diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_all_completed.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_all_completed.png deleted file mode 100644 index 39bc8ec250c17d946e9f65d03750b2bd5c8d80d6..0000000000000000000000000000000000000000 Binary files a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_all_completed.png and /dev/null differ diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges.png deleted file mode 100644 index 2cd6299a4a575e8f508b45351685366e271ee0b5..0000000000000000000000000000000000000000 Binary files a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges.png and /dev/null differ diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_2.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_2.png deleted file mode 100644 index 82fc4fe19e26b9901d7e7ceaf1cf0ca3b6bc85e2..0000000000000000000000000000000000000000 Binary files a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_2.png and /dev/null differ diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_3.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_3.png deleted file mode 100644 index 3be5ec6cb58fc7eaf5f153b8018dd13041e819d9..0000000000000000000000000000000000000000 Binary files a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_3.png and /dev/null differ diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_completed.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_completed.png deleted file mode 100644 index d09353dc4a88c6b99165bc7b6800d3cfdbacf1b7..0000000000000000000000000000000000000000 Binary files a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_completed.png and /dev/null differ diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_initial.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_initial.png deleted file mode 100644 index 0d2f6a1211250203a1a6af0519cdd04b23314167..0000000000000000000000000000000000000000 Binary files a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_initial.png and /dev/null differ diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_none_completed.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_none_completed.png deleted file mode 100644 index cbec316f80e0f37f9cbc578a2a4ca5ae1e28d536..0000000000000000000000000000000000000000 Binary files a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_none_completed.png and /dev/null differ diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_skipped_goal.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_skipped_goal.png deleted file mode 100644 index 37f4b38cdbb2369f0455f550c99d073d8fea67e6..0000000000000000000000000000000000000000 Binary files a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_skipped_goal.png and /dev/null differ diff --git a/plugins/Tour/vue/dist/Tour.umd.js b/plugins/Tour/vue/dist/Tour.umd.js deleted file mode 100644 index 3208cea50dab87f986f310bc2b40b568758bc12f..0000000000000000000000000000000000000000 --- a/plugins/Tour/vue/dist/Tour.umd.js +++ /dev/null @@ -1,382 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("CoreHome"), require("vue")); - else if(typeof define === 'function' && define.amd) - define(["CoreHome", ], factory); - else if(typeof exports === 'object') - exports["Tour"] = factory(require("CoreHome"), require("vue")); - else - root["Tour"] = factory(root["CoreHome"], root["Vue"]); -})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "plugins/Tour/vue/dist/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "fae3"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "19dc": -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__; - -/***/ }), - -/***/ "8bbf": -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__; - -/***/ }), - -/***/ "fae3": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "BecomeMatomoExpert", function() { return /* reexport */ BecomeMatomoExpert; }); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js -// This file is imported into lib/wc client bundles. - -if (typeof window !== 'undefined') { - var currentScript = window.document.currentScript - if (false) { var getCurrentScript; } - - var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/) - if (src) { - __webpack_require__.p = src[1] // eslint-disable-line - } -} - -// Indicate to webpack that this file can be concatenated -/* harmony default export */ var setPublicPath = (null); - -// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} -var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Tour/vue/src/BecomeMatomoExpert/BecomeMatomoExpert.vue?vue&type=template&id=78131424 - -const _hoisted_1 = { - class: "widgetBody tourEngagement" -}; -const _hoisted_2 = { - "aria-hidden": "true" -}; -const _hoisted_3 = { - key: 0 -}; -const _hoisted_4 = { - class: "completed" -}; -const _hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const _hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const _hoisted_7 = ["innerHTML"]; -const _hoisted_8 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const _hoisted_9 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const _hoisted_10 = ["innerHTML"]; -const _hoisted_11 = { - key: 1 -}; -const _hoisted_12 = { - key: 0 -}; -const _hoisted_13 = ["innerHTML"]; -const _hoisted_14 = ["title"]; -const _hoisted_15 = ["title"]; -const _hoisted_16 = ["title", "onClick"]; -const _hoisted_17 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: "icon-hide" -}, null, -1); -const _hoisted_18 = [_hoisted_17]; -const _hoisted_19 = ["href"]; -const _hoisted_20 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("hr", null, null, -1); -const _hoisted_21 = { - style: { - "text-align": "center", - "padding-bottom": "0" - } -}; -const _hoisted_22 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("hr", null, null, -1); -const _hoisted_23 = ["innerHTML"]; -function render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [_ctx.loading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ActivityIndicator, { - key: 0, - loading: true - })) : _ctx.level ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], { - key: 1 - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_2, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.level.numLevelsTotal, i => { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], { - key: i - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["icon-star", _ctx.level.currentLevel >= i ? 'successStar' : 'upgradeStar']) - }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(' '))], 64); - }), 128))]), _ctx.isCompleted ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", _hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Tour_CompletionTitle')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Tour_CompletionMessage')) + " ", 1), _hoisted_5, _hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - innerHTML: _ctx.$sanitize(_ctx.youCanCallYourselfHtml) - }, null, 8, _hoisted_7), _hoisted_8, _hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - innerHTML: _ctx.$sanitize(_ctx.shareHtml) - }, null, 8, _hoisted_10)])])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_11, [_ctx.level.description ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", _hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.level.description), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { - innerHTML: _ctx.$sanitize(_ctx.statusLevelHtml) - }, null, 8, _hoisted_13), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.pagedChallenges, challenge => { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { - key: challenge.id, - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["tourChallenge", challenge.id]), - title: challenge.description - }, [challenge.isCompleted || challenge.isSkipped ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { - key: 0, - class: "icon-ok", - title: _ctx.translate('Tour_ChallengeCompleted') - }, null, 8, _hoisted_15)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { - key: 1, - href: "javascript:void 0;", - class: "skip-challenge", - title: _ctx.translate('Tour_SkipThisChallenge'), - onClick: $event => _ctx.skipChallenge(challenge.id) - }, _hoisted_18, 8, _hoisted_16)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(' ') + " "), _ctx.$sanitizeUrl(challenge.url) ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { - key: 2, - href: _ctx.$sanitizeUrl(challenge.url), - target: "_blank", - rel: "noreferrer noopener" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(challenge.name), 9, _hoisted_19)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], { - key: 3 - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(challenge.name), 1)], 64))], 10, _hoisted_14); - }), 128))]), _hoisted_20, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_21, [_ctx.hasPrevPage ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { - key: 0, - class: "previousChallenges", - onClick: _cache[0] || (_cache[0] = $event => _ctx.currentPage -= 1) - }, " ‹ " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.hasNextPage ? _ctx.translate('General_Previous') : _ctx.translate('Tour_PreviousChallenges')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.hasPrevPage && _ctx.hasNextPage ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], { - key: 1 - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" | ")], 64)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.hasNextPage ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { - key: 2, - class: "nextChallenges", - onClick: _cache[1] || (_cache[1] = $event => _ctx.currentPage += 1) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.hasPrevPage ? _ctx.translate('General_Next') : _ctx.translate('Tour_NextChallenges')) + " › ", 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), _hoisted_22, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { - class: "tourSuperUserNote", - innerHTML: _ctx.$sanitize(_ctx.superUserNoteHtml) - }, null, 8, _hoisted_23)]))], 64)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]); -} -// CONCATENATED MODULE: ./plugins/Tour/vue/src/BecomeMatomoExpert/BecomeMatomoExpert.vue?vue&type=template&id=78131424 - -// EXTERNAL MODULE: external "CoreHome" -var external_CoreHome_ = __webpack_require__("19dc"); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Tour/vue/src/BecomeMatomoExpert/BecomeMatomoExpert.vue?vue&type=script&lang=ts - - -const PER_PAGE = 5; -/* harmony default export */ var BecomeMatomoExpertvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - components: { - ActivityIndicator: external_CoreHome_["ActivityIndicator"] - }, - data() { - return { - loading: true, - challenges: [], - level: null, - currentPage: 0 - }; - }, - computed: { - isCompleted() { - return this.challenges.every(c => c.isCompleted || c.isSkipped); - }, - pagedChallenges() { - const start = this.currentPage * PER_PAGE; - return this.challenges.slice(start, start + PER_PAGE); - }, - totalPages() { - return Math.ceil(this.challenges.length / PER_PAGE); - }, - hasPrevPage() { - return this.currentPage > 0; - }, - hasNextPage() { - return this.currentPage < this.totalPages - 1; - }, - statusLevelHtml() { - if (!this.level) { - return ''; - } - return Object(external_CoreHome_["translate"])('Tour_StatusLevel', `${this.level.currentLevelName}`, String(this.level.challengesNeededForNextLevel), `${this.level.nextLevelName}`); - }, - youCanCallYourselfHtml() { - return Object(external_CoreHome_["translate"])('Tour_YouCanCallYourselfExpert', '', ''); - }, - shareHtml() { - if (!this.level) { - return ''; - } - const shareText = encodeURIComponent(Object(external_CoreHome_["translate"])('Tour_ShareAllChallengesCompleted', this.level.currentLevelName)); - const url = encodeURIComponent('https://matomo.org'); - const shareUrl = `http://twitter.com/share?text=${shareText}&url=${url}`; - return Object(external_CoreHome_["translate"])('Tour_ShareYourAchievementOn', `Twitter`); - }, - superUserNoteHtml() { - const faqUrl = 'https://matomo.org/faq/' + 'general/faq_35/'; - return Object(external_CoreHome_["translate"])('Tour_OnlyVisibleToSuperUser', Object(external_CoreHome_["externalLink"])(faqUrl), ''); - } - }, - mounted() { - this.fetchData(); - window.addEventListener('focus', this.onFocus); - }, - beforeUnmount() { - window.removeEventListener('focus', this.onFocus); - }, - methods: { - translate: external_CoreHome_["translate"], - onFocus() { - this.fetchData(); - }, - async fetchData() { - try { - const [challenges, level] = await Promise.all([external_CoreHome_["AjaxHelper"].fetch({ - method: 'Tour.getChallenges' - }), external_CoreHome_["AjaxHelper"].fetch({ - method: 'Tour.getLevel' - })]); - this.challenges = challenges; - this.level = level; - if (!this.loading) { - return; - } - // set initial page to first uncompleted - const firstIncomplete = challenges.findIndex(c => !c.isCompleted && !c.isSkipped); - const done = firstIncomplete === -1 ? challenges.length : firstIncomplete; - this.currentPage = Math.floor(done / PER_PAGE); - } catch (_unused) { - // silently keep current state on error - } finally { - this.loading = false; - } - }, - async skipChallenge(id) { - const challenge = this.challenges.find(c => c.id === id); - if (challenge) { - challenge.isSkipped = true; - } - try { - await external_CoreHome_["AjaxHelper"].post({ - method: 'Tour.skipChallenge', - id - }); - } catch (_unused2) { - if (challenge) { - challenge.isSkipped = false; - } - } - } - } -})); -// CONCATENATED MODULE: ./plugins/Tour/vue/src/BecomeMatomoExpert/BecomeMatomoExpert.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/Tour/vue/src/BecomeMatomoExpert/BecomeMatomoExpert.vue - - - -BecomeMatomoExpertvue_type_script_lang_ts.render = render - -/* harmony default export */ var BecomeMatomoExpert = (BecomeMatomoExpertvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/Tour/vue/src/index.ts -/** - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js - - - - -/***/ }) - -/******/ }); -}); -//# sourceMappingURL=Tour.umd.js.map \ No newline at end of file diff --git a/plugins/Tour/vue/dist/Tour.umd.min.js b/plugins/Tour/vue/dist/Tour.umd.min.js deleted file mode 100644 index a1191436ac5d00f9c77d42322f6cd48f92c3c098..0000000000000000000000000000000000000000 --- a/plugins/Tour/vue/dist/Tour.umd.min.js +++ /dev/null @@ -1,8 +0,0 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["Tour"]=t(require("CoreHome"),require("vue")):e["Tour"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(l){if(t[l])return t[l].exports;var r=t[l]={i:l,l:!1,exports:{}};return e[l].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(l,r,function(t){return e[t]}.bind(null,r));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/Tour/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"BecomeMatomoExpert",(function(){return L})),"undefined"!==typeof window){var l=window.document.currentScript,r=l&&l.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var o=n("8bbf");const c={class:"widgetBody tourEngagement"},a={"aria-hidden":"true"},s={key:0},i={class:"completed"},u=Object(o["createElementVNode"])("br",null,null,-1),d=Object(o["createElementVNode"])("br",null,null,-1),p=["innerHTML"],m=Object(o["createElementVNode"])("br",null,null,-1),b=Object(o["createElementVNode"])("br",null,null,-1),j=["innerHTML"],g={key:1},O={key:0},h=["innerHTML"],f=["title"],k=["title"],v=["title","onClick"],y=Object(o["createElementVNode"])("span",{class:"icon-hide"},null,-1),C=[y],N=["href"],E=Object(o["createElementVNode"])("hr",null,null,-1),T={style:{"text-align":"center","padding-bottom":"0"}},B=Object(o["createElementVNode"])("hr",null,null,-1),x=["innerHTML"];function S(e,t,n,l,r,y){const S=Object(o["resolveComponent"])("ActivityIndicator");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",c,[e.loading?(Object(o["openBlock"])(),Object(o["createBlock"])(S,{key:0,loading:!0})):e.level?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:1},[Object(o["createElementVNode"])("p",a,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.level.numLevelsTotal,t=>(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:t},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["icon-star",e.level.currentLevel>=t?"successStar":"upgradeStar"])},null,2),Object(o["createTextVNode"])(Object(o["toDisplayString"])(" "))],64))),128))]),e.isCompleted?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",s,[Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",i,Object(o["toDisplayString"])(e.translate("Tour_CompletionTitle")),1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("Tour_CompletionMessage"))+" ",1),u,d,Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.youCanCallYourselfHtml)},null,8,p),m,b,Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.shareHtml)},null,8,j)])])):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",g,[e.level.description?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",O,Object(o["toDisplayString"])(e.level.description),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("p",{innerHTML:e.$sanitize(e.statusLevelHtml)},null,8,h),Object(o["createElementVNode"])("ul",null,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.pagedChallenges,t=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:t.id,class:Object(o["normalizeClass"])(["tourChallenge",t.id]),title:t.description},[t.isCompleted||t.isSkipped?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:"icon-ok",title:e.translate("Tour_ChallengeCompleted")},null,8,k)):(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,href:"javascript:void 0;",class:"skip-challenge",title:e.translate("Tour_SkipThisChallenge"),onClick:n=>e.skipChallenge(t.id)},C,8,v)),Object(o["createTextVNode"])(Object(o["toDisplayString"])(" ")+" "),e.$sanitizeUrl(t.url)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:2,href:e.$sanitizeUrl(t.url),target:"_blank",rel:"noreferrer noopener"},Object(o["toDisplayString"])(t.name),9,N)):(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:3},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(t.name),1)],64))],10,f))),128))]),E,Object(o["createElementVNode"])("p",T,[e.hasPrevPage?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,class:"previousChallenges",onClick:t[0]||(t[0]=t=>e.currentPage-=1)}," ‹ "+Object(o["toDisplayString"])(e.hasNextPage?e.translate("General_Previous"):e.translate("Tour_PreviousChallenges")),1)):Object(o["createCommentVNode"])("",!0),e.hasPrevPage&&e.hasNextPage?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:1},[Object(o["createTextVNode"])(" | ")],64)):Object(o["createCommentVNode"])("",!0),e.hasNextPage?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:2,class:"nextChallenges",onClick:t[1]||(t[1]=t=>e.currentPage+=1)},Object(o["toDisplayString"])(e.hasPrevPage?e.translate("General_Next"):e.translate("Tour_NextChallenges"))+" › ",1)):Object(o["createCommentVNode"])("",!0)]),B,Object(o["createElementVNode"])("p",{class:"tourSuperUserNote",innerHTML:e.$sanitize(e.superUserNoteHtml)},null,8,x)]))],64)):Object(o["createCommentVNode"])("",!0)])}var P=n("19dc");const V=5;var H=Object(o["defineComponent"])({components:{ActivityIndicator:P["ActivityIndicator"]},data(){return{loading:!0,challenges:[],level:null,currentPage:0}},computed:{isCompleted(){return this.challenges.every(e=>e.isCompleted||e.isSkipped)},pagedChallenges(){const e=this.currentPage*V;return this.challenges.slice(e,e+V)},totalPages(){return Math.ceil(this.challenges.length/V)},hasPrevPage(){return this.currentPage>0},hasNextPage(){return this.currentPage${this.level.currentLevelName}`,String(this.level.challengesNeededForNextLevel),`${this.level.nextLevelName}`):""},youCanCallYourselfHtml(){return Object(P["translate"])("Tour_YouCanCallYourselfExpert",'',"")},shareHtml(){if(!this.level)return"";const e=encodeURIComponent(Object(P["translate"])("Tour_ShareAllChallengesCompleted",this.level.currentLevelName)),t=encodeURIComponent("https://matomo.org"),n=`http://twitter.com/share?text=${e}&url=${t}`;return Object(P["translate"])("Tour_ShareYourAchievementOn",`Twitter`)},superUserNoteHtml(){const e="https://matomo.org/faq/general/faq_35/";return Object(P["translate"])("Tour_OnlyVisibleToSuperUser",Object(P["externalLink"])(e),"")}},mounted(){this.fetchData(),window.addEventListener("focus",this.onFocus)},beforeUnmount(){window.removeEventListener("focus",this.onFocus)},methods:{translate:P["translate"],onFocus(){this.fetchData()},async fetchData(){try{const[e,t]=await Promise.all([P["AjaxHelper"].fetch({method:"Tour.getChallenges"}),P["AjaxHelper"].fetch({method:"Tour.getLevel"})]);if(this.challenges=e,this.level=t,!this.loading)return;const n=e.findIndex(e=>!e.isCompleted&&!e.isSkipped),l=-1===n?e.length:n;this.currentPage=Math.floor(l/V)}catch(e){}finally{this.loading=!1}},async skipChallenge(e){const t=this.challenges.find(t=>t.id===e);t&&(t.isSkipped=!0);try{await P["AjaxHelper"].post({method:"Tour.skipChallenge",id:e})}catch(n){t&&(t.isSkipped=!1)}}}});H.render=S;var L=H; -/** - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */}})})); -//# sourceMappingURL=Tour.umd.min.js.map \ No newline at end of file diff --git a/plugins/Tour/vue/dist/umd.metadata.json b/plugins/Tour/vue/dist/umd.metadata.json deleted file mode 100644 index 9ecfcc0456204cf8e8e80416ebc95ef42d4fbd28..0000000000000000000000000000000000000000 --- a/plugins/Tour/vue/dist/umd.metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependsOn": [ - "CoreHome" - ] -} \ No newline at end of file diff --git a/plugins/Tour/vue/src/BecomeMatomoExpert/BecomeMatomoExpert.vue b/plugins/Tour/vue/src/BecomeMatomoExpert/BecomeMatomoExpert.vue deleted file mode 100644 index a31481555c00dbb25be18110a8f6d21dd7526172..0000000000000000000000000000000000000000 --- a/plugins/Tour/vue/src/BecomeMatomoExpert/BecomeMatomoExpert.vue +++ /dev/null @@ -1,303 +0,0 @@ - - - - - diff --git a/plugins/Tour/vue/src/index.ts b/plugins/Tour/vue/src/index.ts deleted file mode 100644 index 07b76f0325bf8e68d74c1280c5c138870150c466..0000000000000000000000000000000000000000 --- a/plugins/Tour/vue/src/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -export { default as BecomeMatomoExpert } from './BecomeMatomoExpert/BecomeMatomoExpert.vue'; diff --git a/plugins/TrackingSpamPrevention/.gitattributes b/plugins/TrackingSpamPrevention/.gitattributes deleted file mode 100644 index c4079385a8748df76fa3c4f3d0e0e177964a8148..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/.gitattributes +++ /dev/null @@ -1,9 +0,0 @@ -tests/UI/expected-screenshots/*.png filter=lfs diff=lfs merge=lfs - -# Files excluded from git packages -tests/ export-ignore -.github/ export-ignore -.gitignore export-ignore -.gitattributes export-ignore -.travis.yml export-ignore - diff --git a/plugins/TrackingSpamPrevention/.github/workflows/matomo-ai-checklist.yml b/plugins/TrackingSpamPrevention/.github/workflows/matomo-ai-checklist.yml deleted file mode 100644 index cc2c022da6f944b9683668c262330ca060d15f8b..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/.github/workflows/matomo-ai-checklist.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Action for running tests - -name: AI Checklist - -on: - pull_request: - types: [opened, synchronize, reopened, edited] - -permissions: - actions: read - checks: none - contents: none - deployments: none - issues: none - packages: none - pull-requests: read - repository-projects: none - security-events: none - statuses: none - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - AiChecklist: - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - steps: - - name: Run tests - uses: matomo-org/github-action-checklist-gate@main diff --git a/plugins/TrackingSpamPrevention/.github/workflows/matomo-tests.yml b/plugins/TrackingSpamPrevention/.github/workflows/matomo-tests.yml deleted file mode 100644 index a70f308e5785b51fa0d9a5c88742b4461db4d36c..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/.github/workflows/matomo-tests.yml +++ /dev/null @@ -1,74 +0,0 @@ -# Action for running tests -# This file has been automatically created. -# To recreate it you can run this command -# ./console generate:test-action --plugin="TrackingSpamPrevention" --php-versions="matomo5_min_php,matomo5_max_php" --schedule-cron="40 2 * * 6" - -name: Plugin TrackingSpamPrevention Tests - -on: - pull_request: - types: [opened, synchronize] - push: - branches: - - '**.x-dev' - workflow_dispatch: - schedule: - - cron: "40 2 * * 6" - -permissions: - actions: read - checks: none - contents: read - deployments: none - issues: read - packages: none - pull-requests: read - repository-projects: none - security-events: none - statuses: none - -concurrency: - group: php-${{ github.ref }} - cancel-in-progress: true - -jobs: - PluginTests: - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - php: [ 'matomo5_min_php', 'matomo5_max_php' ] - target: ['minimum_required_matomo', 'maximum_supported_matomo'] - steps: - - uses: actions/checkout@v3 - with: - lfs: true - persist-credentials: false - - name: Install package ripgrep - run: sudo apt-get install ripgrep - - name: Run tests - uses: matomo-org/github-action-tests@main - with: - plugin-name: 'TrackingSpamPrevention' - php-version: ${{ matrix.php }} - test-type: 'PluginTests' - matomo-test-branch: ${{ matrix.target }} - artifacts-pass: ${{ secrets.ARTIFACTS_PASS }} - upload-artifacts: ${{ matrix.php == 'matomo5_min_php' && matrix.target == 'maximum_supported_matomo' }} - UI: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v3 - with: - lfs: true - persist-credentials: false - - name: running tests - uses: matomo-org/github-action-tests@main - with: - plugin-name: 'TrackingSpamPrevention' - matomo-test-branch: 'maximum_supported_matomo' - test-type: 'UI' - php-version: 'matomo5_min_php' - node-version: '16' - artifacts-pass: ${{ secrets.ARTIFACTS_PASS }} - upload-artifacts: true diff --git a/plugins/TrackingSpamPrevention/.github/workflows/phpcs.yml b/plugins/TrackingSpamPrevention/.github/workflows/phpcs.yml deleted file mode 100644 index c0f924563e50d3529a79083f7deccd2ce9169a90..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/.github/workflows/phpcs.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: PHPCS check - -on: pull_request - -permissions: - actions: read - checks: read - contents: read - deployments: none - issues: read - packages: none - pull-requests: read - repository-projects: none - security-events: none - statuses: read - -jobs: - phpcs: - name: PHPCS - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - lfs: false - persist-credentials: false - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - tools: cs2pr - - name: Install dependencies - run: - composer init --name=matomo/trackingspamprevention --quiet; - composer --no-plugins config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true -n; - composer config repositories.matomo-coding-standards vcs https://github.com/matomo-org/matomo-coding-standards -n; - composer require matomo-org/matomo-coding-standards:dev-master; - composer install --dev --prefer-dist --no-progress --no-suggest - - name: Check PHP code styles - id: phpcs - run: ./vendor/bin/phpcs --report-full --standard=phpcs.xml --report-checkstyle=./phpcs-report.xml - - name: Show PHPCS results in PR - if: ${{ always() && steps.phpcs.outcome == 'failure' }} - run: cs2pr ./phpcs-report.xml --prepend-filename diff --git a/plugins/TrackingSpamPrevention/AllowListIpRange.php b/plugins/TrackingSpamPrevention/AllowListIpRange.php deleted file mode 100644 index 0ffedd35dcfcea8f633457dfe831483feacfd20f..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/AllowListIpRange.php +++ /dev/null @@ -1,37 +0,0 @@ -configuration = $configuration; - } - - public function isAllowed($ip) - { - $rangesAllowed = $this->configuration->getIpRangesAlwaysAllowed(); - - if (!empty($rangesAllowed)) { - $ip = IP::fromStringIP($ip); - return $ip->isInRanges($rangesAllowed); - } - - return false; - } -} diff --git a/plugins/TrackingSpamPrevention/BanIpNotificationEmail.php b/plugins/TrackingSpamPrevention/BanIpNotificationEmail.php deleted file mode 100644 index a2fee8f5f694dd3ec132f127446d92410057b485..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/BanIpNotificationEmail.php +++ /dev/null @@ -1,99 +0,0 @@ -addTo($email); - $mail->setSubject('An IP was banned as too many actions were tracked.'); - $mail->setDefaultFromPiwik(); - if ( - empty($mail->getFromName()) || in_array($mail->getFromName(), [ - 'CoreHome_WebAnalyticsReports', - 'TagManager_MatomoTagName' - ]) - ) { - $mail->setFrom($mail->getFrom(), 'Web Analytics Reports'); - } - - - $mailBody = 'This is for your information. The following IP was banned because visit tried to track more than ' . Common::sanitizeInputValue($maxActionsAllowed) . ' actions:'; - $mailBody .= PHP_EOL . PHP_EOL . '"' . Common::sanitizeInputValue($ipRange) . '"' . PHP_EOL; - $instanceId = SettingsPiwik::getPiwikInstanceId(); - $matomoUrl = SettingsPiwik::getPiwikUrl(); - if (!empty($matomoUrl)) { - $url = parse_url($matomoUrl); - $matomoHost = $url['host']; - } - - if (!empty($_GET)) { - $get = $_GET; - if (isset($get['token_auth'])) { - $get['token_auth'] = 'XYZANONYMIZED'; - } - } else { - $get = []; - } - - if (!empty($_POST)) { - $post = $_POST; - if (isset($post['token_auth'])) { - $post['token_auth'] = 'XYZANONYMIZED'; - } - } else { - $post = []; - } - - if (!empty($instanceId)) { - $mailBody .= PHP_EOL . 'Instance ID: ' . Common::sanitizeInputValue($instanceId); - } - if (!empty($matomoHost)) { - $mailBody .= PHP_EOL . 'URL: ' . Common::sanitizeInputValue($matomoHost); - } - $mailBody .= PHP_EOL . 'Current date (UTC): ' . Common::sanitizeInputValue($nowDateTime) . ' -IP as detected in header: ' . Common::sanitizeInputValue($ip) . ' -GET request info: ' . json_encode($get) . ' -POST request info: ' . json_encode($post) . PHP_EOL; - - if (!empty($locationData)) { - $mailBody .= 'Geo IP info: ' . json_encode($locationData) . PHP_EOL; - } - - if (!empty($_SERVER['HTTP_USER_AGENT'])) { - $mailBody .= 'User Agent: ' . Common::sanitizeInputValue($_SERVER['HTTP_USER_AGENT']) . PHP_EOL; - } - - $mail->setBodyText($mailBody); - - $testMode = (defined('PIWIK_TEST_MODE') && PIWIK_TEST_MODE); - if ($testMode) { - Log::info($mail->getSubject() . ':' . $mail->getBodyText()); - } else { - $mail->send(); - } - - $a = $mail->getBodyText(); - - return $mail->getBodyText(); - } -} diff --git a/plugins/TrackingSpamPrevention/BlockedGeoIp.php b/plugins/TrackingSpamPrevention/BlockedGeoIp.php deleted file mode 100644 index 0cfd59ecac262d5dbc7692b3fc9eab87b0291252..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/BlockedGeoIp.php +++ /dev/null @@ -1,79 +0,0 @@ -blockedProviders = $blockedProviders; - } - - public function detectLocation($ip, $language) - { - // we need to use both IP and language so it will use the same cache key as in core! - $visitorLocator = new VisitorGeolocator(); - $info = array('lang' => $language, 'ip' => $ip); - return $visitorLocator->getLocation($info, $useClassCache = true); - } - - public function isExcludedCountry($ip, $language, $excludedCountries, $includedCountries) - { - if (empty($excludedCountries) && empty($includedCountries)) { - return false; - } - - $result = $this->detectLocation($ip, $language); - if (empty($result[LocationProvider::COUNTRY_CODE_KEY])) { - return false; - } - - $countryCode = strtolower($result[LocationProvider::COUNTRY_CODE_KEY]); - - if (!empty($includedCountries) && in_array($countryCode, $includedCountries, true)) { - return false; - } elseif (!empty($includedCountries)) { - return true; - } - - if (!empty($excludedCountries) && in_array($countryCode, $excludedCountries, true)) { - return true; - } - - return false; - } - - public function isExcludedProvider($ip, $language) - { - if (empty($this->blockedProviders) || !(\Piwik\Plugin\Manager::getInstance()->isPluginActivated('UserCountry'))) { - return false; - } - $result = $this->detectLocation($ip, $language); - - if (!empty($result[LocationProvider::ORG_KEY])) { - $org = $result[LocationProvider::ORG_KEY]; - foreach ($this->blockedProviders as $blockedProvider) { - if (!empty($blockedProvider) && stripos($org, $blockedProvider) !== false) { - return true; - } - } - } - - return false; - } -} diff --git a/plugins/TrackingSpamPrevention/BlockedIpRanges.php b/plugins/TrackingSpamPrevention/BlockedIpRanges.php deleted file mode 100644 index 21e8e64f6fd1b9dcd99999c53a9a6a72901aadeb..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/BlockedIpRanges.php +++ /dev/null @@ -1,195 +0,0 @@ -providers = $providers; - $this->configuration = $configuration; - } - - /** - * will return the array indexed by ip start - * @return array - */ - public function getBlockedRanges() - { - $ranges = Option::get(self::OPTION_KEY); - if (empty($ranges)) { - return []; - } - $ranges = json_decode($ranges, true); - if (empty($ranges)) { - return []; - } - return $ranges; - } - - /** - * An array of blocked ranges - * @param array[] $ranges - */ - public function setBlockedRanges($ranges) - { - // we index them by first character for performance reasons see the excluded method - Option::set(self::OPTION_KEY, json_encode($ranges)); - } - - private function getIndexForIpOrRange($ipOrRange) - { - if (empty($ipOrRange)) { - return; - } - // when IP is 10.11.12.13 then we return "10." - // when IP is f::0 then we return "f:" - foreach (['.', ':'] as $searchChar) { - $posSearchChar = strpos($ipOrRange, $searchChar); - if ($posSearchChar !== false) { - return Common::mb_substr($ipOrRange, 0, $posSearchChar) . $searchChar; - } - } - - // fallback, should not happen - return Common::mb_substr($ipOrRange, 0, 1); - } - - public function isExcluded($ip) - { - if (empty($ip)) { - return false; - } - - if (!filter_var($ip, FILTER_VALIDATE_IP)) { - return false; - } - - // for performance reasons we index ranges by first character of ip. assuming this works in most cases. - // so we compare less ranges as it is slow to compare many ranges - $indexed = $this->getIndexForIpOrRange($ip); - - if (empty($indexed)) { - return false; - } - - $trackerCache = Cache::getCacheGeneral(); - if (empty($trackerCache[self::OPTION_KEY][$indexed])) { - return; - } - - $ip = IP::fromStringIP($ip); - $key = 'TrackingSpamPreventionIsIpInRange' . $ip->toString(); - - $cache = PiwikCache::getTransientCache(); - if ($cache->contains($key)) { - $isInRanges = $cache->fetch($key); - } else { - $isInRanges = $ip->isInRanges($trackerCache[self::OPTION_KEY][$indexed]); - - $cache->save($key, $isInRanges); - } - - return $isInRanges; - } - - public function banIp($ip) - { - $ranges = $this->getBlockedRanges(); - $index = $this->getIndexForIpOrRange($ip); - if (empty($ranges[$index])) { - $ranges[$index] = []; - } - - if (strpos($ip, '.') !== false) { - $ipRange = $ip . '/32'; - } else { - $ipRange = $ip . '/128'; - } - - if (!in_array($ipRange, $ranges[$index], true)) { - $ranges[$index][] = $ipRange; - $this->setBlockedRanges($ranges); - - /** - * This event is posted when an IP is being banned from tracking. You can use it for example to notify someone - * that this IP was banned. - * - * @param string $ipRange The IP range that will be blocked - * @param string $ip The IP that caused this range to be blocked - */ - Piwik::postEvent('TrackingSpamPrevention.banIp', [$ipRange, $ip]); - } - - return $ranges; - } - - public function unsetAllIpRanges() - { - $this->setBlockedRanges([]); - } - - public function updateBlockedIpRanges() - { - if (!SettingsPiwik::isInternetEnabled()) { - $this->unsetAllIpRanges(); - return; - } - - $ranges = []; - - foreach ($this->providers as $provider) { - try { - $ranges = array_merge($ranges, $provider->getRanges()); - } catch (\Exception $e) { - if ($this->configuration->shouldThrowExceptionOnIpRangeSync()) { - throw $e; - } - } - } - - $indexedRange = []; - if (!empty($ranges)) { - foreach ($ranges as $range) { - $indexed = $this->getIndexForIpOrRange($range); - if (empty($indexedRange[$indexed])) { - $indexedRange[$indexed] = []; - } - $indexedRange[$indexed][] = $range; - } - } - $this->setBlockedRanges($indexedRange); - } -} diff --git a/plugins/TrackingSpamPrevention/BlockedIpRanges/Aws.php b/plugins/TrackingSpamPrevention/BlockedIpRanges/Aws.php deleted file mode 100644 index 1298d2263c9a1d2881b2f45ea2beaa443a6cb6bb..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/BlockedIpRanges/Aws.php +++ /dev/null @@ -1,68 +0,0 @@ -getDownloadUrl(); - - $azure = Http::sendHttpRequest($downloadUrl, 120); - - if (empty($azure)) { - throw new \Exception('Failed to retrieve azure IP ranges'); - } - $azure = json_decode($azure, true); - if (empty($azure)) { - throw new \Exception('Failed to retrieve azure IP ranges: ' . json_last_error_msg()); - } - if (empty($azure['values'])) { - throw new \Exception('Failed to retrieve azure IP range values'); - } - - $azureValues = $azure['values']; - foreach ($azureValues as $azureValue) { - if (!isset($azureValue['properties']['addressPrefixes'])) { - throw new \Exception('Failed to get azure address prefixes'); - } - foreach ($azureValue['properties']['addressPrefixes'] as $ip) { - $ranges[] = $ip; - } - } - - return $ranges; - } - - public function getDownloadUrl() - { - // get info somehow for up to date from url https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519 - - // see also https://docs.microsoft.com/en-us/azure/virtual-network/service-tags-overview . - // The api itself we don't really want to use. We'd need a subscriptionId. Unless we fetch it on a matomo server and make it available through a JSON there but then not sure if we are allowed to do that - // or can we get it differently? Like do they have a fixed URL or so? - // seems we could maybe assume the URL always stays the same except for the date part but then we'd need to check which date works (I've seen older URLs with same strucutre only date different) - // might be easiest to fetch "details" page and then extract the URL from there? - // should look like 'https://download.microsoft.com/download/7/1/D/71D86715-5596-4529-9B13-DA13A5DE5B63/ServiceTags_Public_20201207.json' - - $contentDownloadPage = Http::sendHttpRequest('https://www.microsoft.com/en-us/download/details.aspx?id=56519', 120); - $prefixUrl = 'url":"'; - $prefixStrLen = mb_strlen($prefixUrl, 'UTF-8'); - $posStart = mb_strpos($contentDownloadPage, $prefixUrl . 'https://download.microsoft.com/download/', 0, 'UTF-8'); - $posEnd = mb_strpos($contentDownloadPage, '.json"', $posStart + $prefixStrLen, 'UTF-8'); // we don't want to match the " in url":" - $contentDownloadPage = mb_substr( - $contentDownloadPage, - $posStart + $prefixStrLen, - $posEnd - $posStart - $prefixStrLen, - 'UTF-8' - ); - $downloadUrl = trim($contentDownloadPage, '="' . "'") . '.json'; - $downloadUrl = trim($downloadUrl); - - if (strpos($downloadUrl, 'http') !== 0) { - throw new \Exception('Expected download URL for Azure IP ranges to start with HTTP but it does not. It is: ' . $downloadUrl); - } - - if (!Common::stringEndsWith($downloadUrl, '.json')) { - throw new \Exception('Expected download URL for Azure IP ranges to end with ".json" but it does not. It is: ' . $downloadUrl); - } - - return $downloadUrl; - } -} diff --git a/plugins/TrackingSpamPrevention/BlockedIpRanges/DigitalOcean.php b/plugins/TrackingSpamPrevention/BlockedIpRanges/DigitalOcean.php deleted file mode 100644 index b86d727fc53e7918878f03ec7e765360ad6e60a2..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/BlockedIpRanges/DigitalOcean.php +++ /dev/null @@ -1,46 +0,0 @@ -ranges = $ranges; - } - - public function getRanges(): array - { - return $this->ranges; - } -} diff --git a/plugins/TrackingSpamPrevention/BrowserDetection.php b/plugins/TrackingSpamPrevention/BrowserDetection.php deleted file mode 100644 index 481b8710c90f5e57c9f7a69a13b827170b9c63a2..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/BrowserDetection.php +++ /dev/null @@ -1,51 +0,0 @@ -makeInstance($userAgent); - - return $staticContainer->isLibrary(); - } -} diff --git a/plugins/TrackingSpamPrevention/CHANGELOG.md b/plugins/TrackingSpamPrevention/CHANGELOG.md deleted file mode 100644 index 03a5ac1fbb5b703d6c59d640aa799ccae189d11d..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/CHANGELOG.md +++ /dev/null @@ -1,69 +0,0 @@ -## Changelog - -# 5.0.11 - 2026-07-06 -- Enabled block headless browser by default - -# 5.0.10 - 2026-06-22 -- Removed Verein zur Foerderung eines Deutschen Forschungsnetzes (DFN) from the default block list - -# 5.0.9 - 2026-05-11 -- Added code to block more providers by default - -# 5.0.8 - 2025-05-26 -- Fixed broken Azure link for looking up IP ranges - -# 5.0.7 - 2025-01-06 -- Added Matomo URL to email report - -# 5.0.6 - 2024-12-09 -- Fixed broken Azure link for looking up IP ranges - -# 5.0.5 - 2024-10-24 -- Look for headless browser in clientHints to detect spam - -# 5.0.4 - 2024-10-21 -- Compatability with PHP 8.4 - -# 5.0.3 -- Textual changes - -# 5.0.2 -- Added plugin category for Marketplace - -# 5.0.1 -- Fix issue where max action limit was blocking IP addresses from the allow list - -# 5.0.0 -- Compatibility with Matomo 5.0 - -# 4.1.7 -- Fixed Azure IP ranges download URL parsing code better accounting for character encoding - -# 4.1.6 -- Started including userAgent in the banned IP email - -# 4.1.5 -- Azure IP ranges download code updated and added tests to alert if download fails - -# 4.1.4 -- Add new command to block new organisations `./console trackingspamprevention:block-geo-ip-organisation --organisation-name="Example"` - -# 4.1.3 -- Translation changes -- Added code to not throw exception if digitalOcean file is empty - -# 4.1.2 -- Fix location data in email to show IP instead of IP range -- Started blocking digital ocean through providers. -- Stopped checking GeoIp DB if UserCountry plugin is disabled -- Azure IP ranges download code updated - -# 4.1.1 -- Fixed IP ban notification email leading to internal sever error - -# 4.1.0 -- Exclude user agents from load testing services -- Exclude user agents from server side tracking SDK by enabling an option - -# 4.0.0 -* Initial version diff --git a/plugins/TrackingSpamPrevention/Commands/BlockGeoIpOrganisation.php b/plugins/TrackingSpamPrevention/Commands/BlockGeoIpOrganisation.php deleted file mode 100644 index 302fa1c9557750a9d6b5d115d1e38a55f45490b6..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/Commands/BlockGeoIpOrganisation.php +++ /dev/null @@ -1,51 +0,0 @@ -setName('trackingspamprevention:block-geo-ip-organisation'); - $this->setDescription('Blocks a new GeoIP organisation. It will save the organisation in the config file.'); - $this->addRequiredValueOption('organisation-name', null, 'Name of the organisation to block:'); - } - - /** - * @return int - */ - protected function doExecute(): int - { - $input = $this->getInput(); - $output = $this->getOutput(); - $this->checkAllRequiredOptionsAreNotEmpty(); - - $config = Config::getInstance(); - $pluginConfig = $config->TrackingSpamPrevention; - - if (empty($pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS])) { - $pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS] = []; - } - - $name = $input->getOption('organisation-name'); - $pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS][] = mb_strtolower(trim($name)); - - $pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS] = array_values(array_unique($pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS])); - - $config->TrackingSpamPrevention = $pluginConfig; - $config->forceSave(); - - return self::SUCCESS; - } -} diff --git a/plugins/TrackingSpamPrevention/Configuration.php b/plugins/TrackingSpamPrevention/Configuration.php deleted file mode 100644 index af3a6735a1917b1915a5d5c00ee366a986122e5a..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/Configuration.php +++ /dev/null @@ -1,181 +0,0 @@ -getConfig(); - - $default = $config->TrackingSpamPrevention; - if (empty($default)) { - $default = array(); - } - - if (empty($default[self::KEY_RANGE_THROW_EXCEPTION])) { - $default[self::KEY_RANGE_THROW_EXCEPTION] = self::DEFAULT_RANGE_THROW_EXCEPTION; - } - if (empty($default[self::KEY_RANGE_ALLOW_LIST])) { - $default[self::KEY_RANGE_ALLOW_LIST] = self::DEFAULT_RANGE_ALLOW_LIST; - } - if (empty($default[self::KEY_GEOIP_MATCH_PROVIDERS])) { - $default[self::KEY_GEOIP_MATCH_PROVIDERS] = self::DEFAULT_GEOIP_MATCH_PROVIDERS; - } - - $config->TrackingSpamPrevention = $default; - - $config->forceSave(); - } - - public function uninstall() - { - $config = $this->getConfig(); - $config->TrackingSpamPrevention = array(); - $config->forceSave(); - } - - /** - * @return bool - */ - public function shouldThrowExceptionOnIpRangeSync() - { - $value = $this->getConfigValue(self::KEY_RANGE_THROW_EXCEPTION, self::DEFAULT_RANGE_THROW_EXCEPTION); - - if ($value === false || $value === '' || $value === null) { - $value = self::KEY_RANGE_THROW_EXCEPTION; - } - - return (bool) $value; - } - - /** - * @return array - */ - public function getIpRangesAlwaysAllowed() - { - $value = $this->getConfigValue(self::KEY_RANGE_ALLOW_LIST, self::DEFAULT_RANGE_ALLOW_LIST); - - if (empty($value) || !is_array($value)) { - $value = self::DEFAULT_RANGE_ALLOW_LIST; - } - - $value = array_values(array_filter($value)); - $value = array_map(function ($range) { - if (strpos($range, '/') === false) { - // we assume user did not enter a range so we make it one that matches that one ip - if (strpos($range, '.') !== false) { - $range .= '/32'; - } elseif (strpos($range, ':') !== false) { - $range .= '/128'; - } - } - return $range; - }, $value); - - return $value; - } - - private function getConfig() - { - return Config::getInstance(); - } - - private function getConfigValue($name, $default) - { - $config = $this->getConfig(); - $attribution = $config->TrackingSpamPrevention; - if (isset($attribution[$name])) { - return $attribution[$name]; - } - return $default; - } -} diff --git a/plugins/TrackingSpamPrevention/LICENSE b/plugins/TrackingSpamPrevention/LICENSE deleted file mode 100644 index f288702d2fa16d3cdf0035b15a9fcbc552cd88e7..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/plugins/TrackingSpamPrevention/README.md b/plugins/TrackingSpamPrevention/README.md deleted file mode 100644 index 7fe409773e6031677f995658356090f7c47e2a98..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# Matomo Tracking Spam Prevention Plugin - -[![Build Status](https://github.com/matomo-org/plugin-TrackingSpamPrevention/actions/workflows/matomo-tests.yml/badge.svg?branch=4.x-dev)](https://github.com/matomo-org/plugin-TrackingSpamPrevention/actions/workflows/matomo-tests.yml) - -## Description - -Ever noticed tracking requests that look unnatural or originated from locations you wouldn't expect to get visits from? - -These tracking requests may be caused by spammers or bots and make your data less accurate. The only thing that is worse than having no data is inaccurate data. - -This plugin offers various options to fight spam and bots, so you can rely on your data: - -### 1. Block requests from cloud providers - -When enabled, this plugin will automatically detect IP addresses used by popular cloud providers like AWS, Azure, Digital Ocean, Google Cloud and Oracle Cloud. - -When a tracking request matches such an IP address, then the tracking request will be blocked. Additionally, some Cloud providers like Alibaba Cloud may be detected using the geolocation database (requires eg DB-IP City DB). - -If you are only tracking using the JavaScript tracker then this should be a safe feature to enable as tracking requests from humans would not originate from these clouds. - -If you are sending tracking requests from a cloud server, then you can also configure IP addresses that are always allowed, so you can still use this feature. - -### 2. Block requests from headless browsers - -When enabled, this plugin detects the most popular headless browsers and block tracking requests that originate from a headless browser. - -Headless browsers are browsers without a user interface and are mostly used for automation. Regular visitors would not use such a browser. It can block additional bots and spam requests that otherwise would not be detected. - -It cannot detect a headless browser when the user agent is customised. Often, we can detect them though. - -### 3. Restrict number of actions per visit - -When enabled, you can configure how many actions a visit should max have. - -Most sites never have more than around 100 to 300 actions within one visit under normal circumstances. In many cases it might therefore be safe to assume that if someone has caused more actions than the configured amount of actions, it might be actually tracking spam or a bot or something else like non-human activity is causing these actions. - -Matomo will in this case stop recording further actions for that visit to have less inaccurate data and to reduce server load. The IP address of this visit will then be blocked for up to 24 hours. - -You can also be notified by email when an IP address is banned because a visit had too many actions. - -### 4. Exclude countries - -This feature lets you configure to only accept tracking requests for visitors from specific countries. For example, if you have a German website, then it might be unexpected to have any legit visitors from a country outside of Europe meaning a visitor is likely a spammer or a bot in this case. By only tracking visitors from certain countries you can easily avoid a lot of potential spam and bots plus you might also avoid needing to be compliant with certain privacy laws. - -### 5. Referrer spam - -This feature is not part of this plugin but part of Matomo core. -Matomo maintains a [list of spam referrers](https://matomo.org/blog/2015/05/stopping-referrer-spam/) and Matomo will block tracking requests when such a referrer is detected. - -### Recommended other features - -You might also want to [configure to track only URLs that belong to your website](https://matomo.org/faq/how-to/faq_21077/). This way any URL that does not belong to your website will not be tracked. This feature is part of Matomo core. - -### Privacy - -The plugin does not send any information of your visitors to another server. If you enable the "block requests from cloud providers" feature, then your server will download up to date IP ranges from cloud providers directly and store the information in your database. diff --git a/plugins/TrackingSpamPrevention/Settings/BlockCloudsSetting.php b/plugins/TrackingSpamPrevention/Settings/BlockCloudsSetting.php deleted file mode 100644 index ff7ecb68b36fd90ada0c67f764cd2a956c552a57..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/Settings/BlockCloudsSetting.php +++ /dev/null @@ -1,30 +0,0 @@ -oldValue; - } - - public function setValue($value) - { - $this->oldValue = $this->getValue(); - - parent::setValue($value); - } -} diff --git a/plugins/TrackingSpamPrevention/SystemSettings.php b/plugins/TrackingSpamPrevention/SystemSettings.php deleted file mode 100644 index 13e99a96d2c84bea112aa57a2ecac6301a0ec793..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/SystemSettings.php +++ /dev/null @@ -1,243 +0,0 @@ -block_clouds = $this->createBlockCloudsSetting(); - $this->blockHeadless = $this->createBlockHeadlessSettings(); - $this->blockServerSideLibraries = $this->createBlockServerSideLibrariesSetting(); - $this->max_actions = $this->createMaxActionsSetting(); - $this->notification_email = $this->createNotificationEmail(); - - $this->excludedCountries = $this->createExcludedCountriesSetting(); - $this->includedCountries = $this->createIncludedCountriesSetting(); - } - - private function createBlockCloudsSetting() - { - $setting = new BlockCloudsSetting('block_clouds', false, FieldConfig::TYPE_BOOL, $this->pluginName); - $setting->setConfigureCallback(function (FieldConfig $field) { - $field->title = Piwik::translate('TrackingSpamPrevention_SettingBlockCloudTitle'); - $field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; - $field->description = Piwik::translate('TrackingSpamPrevention_SettingBlockCloudDescription'); - if (!SettingsPiwik::isInternetEnabled()) { - $field->description = Piwik::translate('TrackingSpamPrevention_BlockCloudNoteInternetDisabled') . $field->description; - } - }); - $this->addSetting($setting); - return $setting; - } - - - private function createBlockHeadlessSettings() - { - return $this->makeSetting('block_headless', $default = true, FieldConfig::TYPE_BOOL, function (FieldConfig $field) { - $field->title = Piwik::translate('TrackingSpamPrevention_SettingBlockHeadlessTitle'); - $field->description = Piwik::translate('TrackingSpamPrevention_SettingBlockHeadlessDescription'); - $field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; - }); - } - - private function createMaxActionsSetting() - { - return $this->makeSetting('max_actions_allowed', $default = 0, FieldConfig::TYPE_INT, function (FieldConfig $field) { - $field->title = Piwik::translate('TrackingSpamPrevention_SettingMaxActionsTitle'); - $field->description = Piwik::translate('TrackingSpamPrevention_SettingMaxActionsDescription'); - $field->uiControl = FieldConfig::UI_CONTROL_TEXT; - }); - } - - private function createNotificationEmail() - { - return $this->makeSetting('notification_email', $default = '', FieldConfig::TYPE_STRING, function (FieldConfig $field) { - $field->title = Piwik::translate('TrackingSpamPrevention_SettingNotificationEmailTitle'); - $field->description = Piwik::translate('TrackingSpamPrevention_SettingNotificationEmailDescription'); - $field->uiControl = FieldConfig::UI_CONTROL_TEXT; - $field->condition = 'max_actions_allowed>0'; - $field->validators[] = new Email(); - }); - } - - public function save() - { - parent::save(); - - $ranges = StaticContainer::get(BlockedIpRanges::class); - - if ((bool) $this->block_clouds->getValue() !== (bool) $this->block_clouds->getOldValue()) { - if ($this->block_clouds->getValue()) { - // is now enabled, lets sync ip ranges - $ranges->updateBlockedIpRanges(); - } else { - // we also unset any IP that was banned recently - $ranges->unsetAllIpRanges(); - } - Cache::clearCacheGeneral(); - } - } - - private function createExcludedCountriesSetting() - { - return $this->makeSetting('excluded_countries', [], FieldConfig::TYPE_ARRAY, function (FieldConfig $field) { - $field->title = Piwik::translate('TrackingSpamPrevention_SettingExcludedCountriesTitle'); - $field->description = Piwik::translate('TrackingSpamPrevention_SettingExcludedCountriesDescription'); - $field->uiControl = FieldConfig::UI_CONTROL_MULTI_TUPLE; - $field1 = new FieldConfig\MultiPair("Country", 'country', FieldConfig::UI_CONTROL_SINGLE_SELECT); - $field1->availableValues = $this->listCountries(); - $field->uiControlAttributes['field1'] = $field1->toArray(); - - $self = $this; - $field->transform = function ($value) use ($self) { - return $self->transformCountryList($value); - }; - - $field->validate = function ($value) use ($field1) { - foreach ($value as $country) { - if (empty($country['country'])) { - continue; - } - if ($country['country'] === 'xx') { - continue; // valid, country not detected - } - if (!isset($field1->availableValues[$country['country']])) { - throw new \Exception('Invalid country code'); - } - } - }; - }); - } - - public function transformCountryList($value) - { - if (!empty($value) && is_array($value)) { - $newVal = []; - foreach ($value as $index => $val) { - if (empty($val['country'])) { - continue; - } - $newVal[] = ['country' => $val['country']]; - } - return $newVal; - } - return $value; - } - - private function createIncludedCountriesSetting() - { - return $this->makeSetting('included_countries', [], FieldConfig::TYPE_ARRAY, function (FieldConfig $field) { - $field->title = Piwik::translate('TrackingSpamPrevention_SettingIncludedCountriesTitle'); - $field->description = Piwik::translate('TrackingSpamPrevention_SettingIncludedCountriesDescription'); - $field->uiControl = FieldConfig::UI_CONTROL_MULTI_TUPLE; - $field1 = new FieldConfig\MultiPair("Country", 'country', FieldConfig::UI_CONTROL_SINGLE_SELECT); - $field1->availableValues = $this->listCountries(); - $field->uiControlAttributes['field1'] = $field1->toArray(); - - $self = $this; - $field->transform = function ($value) use ($self) { - return $self->transformCountryList($value); - }; - $field->validate = function ($value) use ($field1) { - foreach ($value as $country) { - if (empty($country['country'])) { - continue; - } - if ($country['country'] === 'xx') { - continue; // valid, country not detected - } - if (!isset($field1->availableValues[$country['country']])) { - throw new \Exception('Invalid country code'); - } - } - }; - }); - } - - private function createBlockServerSideLibrariesSetting() - { - return $this->makeSetting('blockServerSideLibraries', false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) { - $field->title = Piwik::translate('TrackingSpamPrevention_SettingBlockServerSideLibrariesTitle'); - $field->inlineHelp = Piwik::translate('TrackingSpamPrevention_SettingBlockServerSideLibrariesDescription', array('','','
')); - $field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; - }); - } - - - private function listCountries() - { - $regionDataProvider = StaticContainer::get(RegionDataProvider::class); - $countryList = $regionDataProvider->getCountryList(); - array_walk($countryList, function (&$item, $key) { - $item = Piwik::translate('Intl_Country_' . strtoupper($key)); - }); - asort($countryList); //order by localized name - return $countryList; - } - - public function getExcludedCountryCodes() - { - return $this->settingToCountryCodes($this->excludedCountries); - } - - public function getIncludedCountryCodes() - { - return $this->settingToCountryCodes($this->includedCountries); - } - - private function settingToCountryCodes(Setting $setting) - { - $val = $setting->getValue(); - - if (empty($val) || !is_array($val)) { - return []; - } - - $codes = []; - foreach ($val as $value) { - if (!empty($value['country'])) { - $codes[] = $value['country']; - } - } - return $codes; - } -} diff --git a/plugins/TrackingSpamPrevention/Tasks.php b/plugins/TrackingSpamPrevention/Tasks.php deleted file mode 100644 index e52f4d8cc07cbdfe673c23a13ff65b0db4c6cbe4..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/Tasks.php +++ /dev/null @@ -1,49 +0,0 @@ -systemSettings = $systemSettings; - $this->blockedIpRanges = $blockedIpRanges; - } - - public function schedule() - { - $this->daily('updateBlockedIpRanges'); - } - - /** - * To test execute the following command: - * `./console core:run-scheduled-tasks --force "Piwik\Plugins\TrackingSpamPrevention\Tasks.updateBlockedIpRanges"` - * - */ - public function updateBlockedIpRanges() - { - if ($this->systemSettings->block_clouds->getValue()) { - $this->blockedIpRanges->updateBlockedIpRanges(); - } else { - // we also unset any banned IP every 24 hours - $this->blockedIpRanges->unsetAllIpRanges(); - } - } -} diff --git a/plugins/TrackingSpamPrevention/Tracker/RequestProcessor.php b/plugins/TrackingSpamPrevention/Tracker/RequestProcessor.php deleted file mode 100644 index 66ba90f4ef1e9f453693833e2ea70c6e9d383ae2..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/Tracker/RequestProcessor.php +++ /dev/null @@ -1,59 +0,0 @@ -systemSettings = $systemSettings; - $this->blockedIpRanges = $blockedIpRanges; - } - - public function afterRequestProcessed(VisitProperties $visitProperties, Request $request) - { - $actions = $visitProperties->getProperty('visit_total_actions'); - $maxActions = $this->systemSettings->max_actions->getValue(); - - if (empty($maxActions) || !is_numeric($maxActions) || $maxActions <= 0) { - return; // unlimited - } - if ((int)$actions >= $maxActions) { - $ipString = $request->getIpString(); - if (StaticContainer::get(AllowListIpRange::class)->isAllowed($ipString)) { - Common::printDebug("Ignoring max visits as the visit matches an IP range that is always allowed"); - return; - } - - $this->blockedIpRanges->banIp($ipString); - - Common::printDebug("Stop tracking as max number of actions reached"); - return true; // abort - } - } -} diff --git a/plugins/TrackingSpamPrevention/TrackingSpamPrevention.php b/plugins/TrackingSpamPrevention/TrackingSpamPrevention.php deleted file mode 100644 index 045a2bcb27ffbc816c8da911a8e3ffbe2a68dcbb..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/TrackingSpamPrevention.php +++ /dev/null @@ -1,172 +0,0 @@ - 'isExcludedVisit', - 'Tracker.setTrackerCacheGeneral' => 'setTrackerCacheGeneral', - 'TrackingSpamPrevention.banIp' => 'onBanIp', - ]; - } - - public function install() - { - $this->isInstalledInThisRequest = true; - $config = new Configuration(); - $config->install(); - } - - public function activate() - { - $this->isInstalledInThisRequest = true; - } - - public function uninstall() - { - $config = new Configuration(); - $config->uninstall(); - } - - public function onBanIp($ipRange, $ip) - { - $settings = $this->getSystemSettings(); - $email = $settings->notification_email->getValue(); - $maxActions = $settings->max_actions->getValue(); - $locationData = $this->getBlockGeoIp()->detectLocation($ip, Common::getBrowserLanguage()); - $now = Date::now()->getDatetime(); - - $banIpMail = new BanIpNotificationEmail(); - $banIpMail->send($ipRange, $ip, $email, $maxActions, $locationData, $now); - } - - public function setTrackerCacheGeneral(&$cache) - { - $isTestMode = defined('PIWIK_TEST_MODE') && PIWIK_TEST_MODE; - if ($this->isInstalledInThisRequest && !$isTestMode) { - // dont do anything when plugin gets loaded as DI config would not be loaded yet and it would - // cause an issue with activity log since it does a geolocation which uses the tracker cache - return; - } - $ranges = $this->getBlockedIpRanges(); - $cache[BlockedIpRanges::OPTION_KEY] = $ranges->getBlockedRanges(); - } - - public function isExcludedVisit(&$excluded, Request $request) - { - if ($excluded) { - return; // already excluded, not needed to check - } - - $visitExcluded = new VisitExcluded($request); - $ipString = $request->getIpString(); - - $ip = IP::fromStringIP($ipString); - if (is_callable(array($visitExcluded, 'isChromeDataSaverUsed')) && $visitExcluded->isChromeDataSaverUsed($ip)) { - Common::printDebug("Not excluding visit as chrome data saver is used"); - return; - } - - if (StaticContainer::get(AllowListIpRange::class)->isAllowed($ipString)) { - Common::printDebug("Not excluding visit as it matches an IP range that is always allowed"); - return; - } - - $settings = $this->getSystemSettings(); - $blockGeoIp = $this->getBlockGeoIp(); - $browserLang = $request->getBrowserLanguage(); - - $browserDetection = new BrowserDetection(); - $clientHints = json_encode($request->getClientHints()); - if ( - $settings->blockHeadless->getValue() && - ( - $browserDetection->isHeadlessBrowser($request->getUserAgent()) || - $browserDetection->isHeadlessBrowser($clientHints) - ) - ) { - // note above user agent could have been overwritten with UA parameter but that's fine since it's easy to change useragent anyway - Common::printDebug("Excluding visit as headless browser detected"); - $excluded = 'excluded: headless browser'; - return; - } - - if ( - $settings->block_clouds->getValue() - && $blockGeoIp->isExcludedProvider($ipString, $browserLang) - ) { - // only needs to be done when cloud providers are blocked specifically - Common::printDebug("Excluding visit as geoip detects a cloud provider"); - $excluded = 'excluded: geoip cloud provider'; - return; - } - - if ($this->getBlockedIpRanges()->isExcluded($ipString)) { - // we also execute this when block clouds disabled because it might contain banned ips - Common::printDebug("Excluding visit as IP originates from a cloud provider"); - $excluded = 'excluded: ip cloud provider'; - return; - } - - if ( - $blockGeoIp->isExcludedCountry( - $ipString, - $browserLang, - $settings->getExcludedCountryCodes(), - $settings->getIncludedCountryCodes() - ) - ) { - Common::printDebug("Excluding visit as geoip detects an excluded (or not included) country"); - $excluded = 'excluded: country'; - return; - } - - if ( - $settings->blockServerSideLibraries->getValue() && - $browserDetection->isLibrary($request->getUserAgent()) - ) { - Common::printDebug("Excluding visit as Server Side Library detected"); - $excluded = 'excluded: ServerSideLibraries-'; - return; - } - } - - private function getSystemSettings() - { - return StaticContainer::get(SystemSettings::class); - } - - private function getBlockedIpRanges() - { - return StaticContainer::get(BlockedIpRanges::class); - } - - private function getBlockGeoIp() - { - return StaticContainer::get(BlockedGeoIp::class); - } - - public function isTrackerPlugin() - { - return true; - } -} diff --git a/plugins/TrackingSpamPrevention/Updates/5.0.10.php b/plugins/TrackingSpamPrevention/Updates/5.0.10.php deleted file mode 100644 index a419f4851718828f241e10eae3089e38c263bf64..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/Updates/5.0.10.php +++ /dev/null @@ -1,34 +0,0 @@ -TrackingSpamPrevention; - $providers = $pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS] ?? []; - - $key = array_search('verein zur foerderung eines deutschen forschungsnetzes', $providers, true); - - if ($key !== false) { - unset($providers[$key]); - $pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS] = array_values($providers); - $config->TrackingSpamPrevention = $pluginConfig; - $config->forceSave(); - } - } -} diff --git a/plugins/TrackingSpamPrevention/Updates/5.0.11.php b/plugins/TrackingSpamPrevention/Updates/5.0.11.php deleted file mode 100644 index be0303992b7c8069e23ac275e3f6f6fd3398f5e8..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/Updates/5.0.11.php +++ /dev/null @@ -1,36 +0,0 @@ -TrackingSpamPrevention; - - if (is_array($pluginConfig) && array_key_exists('block_headless', $pluginConfig)) { - return; - } - - $backend = (new Factory())->getPluginStorage('TrackingSpamPrevention', '')->getBackend(); - $currentValue = $backend->loadValue('block_headless', null); - - if ($currentValue !== null) { - return; - } - - $backend->saveValue('block_headless', false); - } -} diff --git a/plugins/TrackingSpamPrevention/Updates/5.0.9.php b/plugins/TrackingSpamPrevention/Updates/5.0.9.php deleted file mode 100644 index c94130d88a70bc11294fef959cbc205303100e9a..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/Updates/5.0.9.php +++ /dev/null @@ -1,49 +0,0 @@ -TrackingSpamPrevention; - $existingProviders = []; - - if (!empty($pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS]) && is_array($pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS])) { - $existingProviders = $pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS]; - } - - $normalizedProviders = []; - foreach ($existingProviders as $provider) { - $provider = mb_strtolower(trim((string) $provider)); - if ($provider !== '') { - $normalizedProviders[] = $provider; - } - } - - $mergedProviders = array_values(array_unique(array_merge( - $normalizedProviders, - Configuration::DEFAULT_GEOIP_MATCH_PROVIDERS - ))); - - if ($existingProviders === $mergedProviders) { - return; - } - - $pluginConfig[Configuration::KEY_GEOIP_MATCH_PROVIDERS] = $mergedProviders; - $config->TrackingSpamPrevention = $pluginConfig; - $config->forceSave(); - } -} diff --git a/plugins/TrackingSpamPrevention/config/config.php b/plugins/TrackingSpamPrevention/config/config.php deleted file mode 100644 index 1795534b1becf5959d55439f8e154a78dd078a5d..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/config/config.php +++ /dev/null @@ -1,39 +0,0 @@ - Piwik\DI::add(array( - Piwik\DI::get('Piwik\Plugins\TrackingSpamPrevention\BlockedIpRanges\Aws'), - Piwik\DI::get('Piwik\Plugins\TrackingSpamPrevention\BlockedIpRanges\Azure'), - Piwik\DI::get('Piwik\Plugins\TrackingSpamPrevention\BlockedIpRanges\DigitalOcean'), - Piwik\DI::get('Piwik\Plugins\TrackingSpamPrevention\BlockedIpRanges\Gcloud'), - Piwik\DI::get('Piwik\Plugins\TrackingSpamPrevention\BlockedIpRanges\Oracle'), - )), - - 'Piwik\Plugins\TrackingSpamPrevention\BlockedIpRanges' => Piwik\DI::autowire() - ->constructorParameter('providers', Piwik\DI::get('trackingspam.iprangeproviders')), - - 'Piwik\Plugins\TrackingSpamPrevention\BlockedGeoIp' => Piwik\DI::autowire() - ->constructor(Piwik\DI::get('trackingspam.block_geoip_organisations')), - - 'trackingspam.block_geoip_organisations' => function (\Piwik\Container\Container $c) { - if ($c->has('ini.TrackingSpamPrevention.block_geoip_organisations')) { - return $c->get('ini.TrackingSpamPrevention.block_geoip_organisations'); - } - return []; - }, - - \Piwik\Config::class => Piwik\DI::decorate(function ($previous) { - $tsp = $previous->TrackingSpamPrevention; - if (empty($tsp)) { - $tsp = array(); - } - if (empty($tsp['block_geoip_organisations'])) { - // prevent possible tracking error if this config is removed otherwise - $tsp['block_geoip_organisations'] = []; - } - $previous->TrackingSpamPrevention = $tsp; - - return $previous; - }), -); diff --git a/plugins/TrackingSpamPrevention/config/test.php b/plugins/TrackingSpamPrevention/config/test.php deleted file mode 100644 index 25a78f9677dce32192c610356d143f9b57f90665..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/config/test.php +++ /dev/null @@ -1,19 +0,0 @@ - array( - new \Piwik\Plugins\TrackingSpamPrevention\BlockedIpRanges\VariableRange(['10.10.0.0/21', '200.200.0.0/21']) - ), - - \Piwik\Config::class => Piwik\DI::decorate(function ($previous) { - $tsp = $previous->TrackingSpamPrevention; - if (empty($tsp['block_geoip_organisations'])) { - // prevent possible tracking error if this config is removed otherwise - $tsp['block_geoip_organisations'] = []; - } - $previous->TrackingSpamPrevention = $tsp; - - return $previous; - }) -); diff --git a/plugins/TrackingSpamPrevention/config/tracker.php b/plugins/TrackingSpamPrevention/config/tracker.php deleted file mode 100644 index 9a2590724204fa139b520cf3db57b1dab98efcab..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/config/tracker.php +++ /dev/null @@ -1,4 +0,0 @@ - - - - Matomo Coding Standard for TrackingSpamPrevention plugin - - - - . - - tests/javascript/* - */vendor/* - - - - - - - - tests/* - - - - - Updates/* - - - - - tests/* - - - - - tests/* - - \ No newline at end of file diff --git a/plugins/TrackingSpamPrevention/plugin.json b/plugins/TrackingSpamPrevention/plugin.json deleted file mode 100644 index dc6b1d9d1feb8e2bdb0b72bf0f8baca4f231376f..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/plugin.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "TrackingSpamPrevention", - "description": "This plugin offers various options to prevent spammers and bots from making your data inaccurate so you can rely on your data again.", - "version": "5.0.11", - "theme": false, - "require": { - "matomo": ">=5.0.0-b1,<6.0.0-b1" - }, - "authors": [ - { - "name": "Matomo", - "email": "", - "homepage": "https://matomo.org" - } - ], - "support": { - "issues": "https://github.com/matomo-org/plugin-TrackingSpamPrevention/issues", - "forum": "https://forum.matomo.org/" - }, - "homepage": "https://matomo.org", - "license": "GPL v3+", - "keywords": ["spam", "prevent", "cloud", "requests", "ddos"], - "category": "security" -} diff --git a/plugins/TrackingSpamPrevention/pull_request_template.md b/plugins/TrackingSpamPrevention/pull_request_template.md deleted file mode 100644 index 211089bb4ec77dcc05db341c8d1be45bae811eea..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/pull_request_template.md +++ /dev/null @@ -1,29 +0,0 @@ -## Description - - -## Issue No - - -## Steps to Replicate the Issue -1. -2. -3. - - - -## Checklist -- [✔/✖] Tested locally or on demo2/demo3? -- [✔/✖/NA] New test case added/updated? -- [✔/✖/NA] Are all newly added texts included via translation? -- [✔/✖/NA] Are text sanitized properly? (Eg use of v-text v/s v-html for vue) -- [✔/✖/NA] Version bumped? -- [✔/✖/NA] I have understood, reviewed, and tested all AI outputs before use -- [✔/✖/NA] All AI instructions respect security, IP, and privacy rules -- [✔/✖/NA] Documentation updated? diff --git a/plugins/TrackingSpamPrevention/screenshots/1_Settings.png b/plugins/TrackingSpamPrevention/screenshots/1_Settings.png deleted file mode 100644 index 98cb7209abd75ab2332190fccefb3c338324bbba..0000000000000000000000000000000000000000 Binary files a/plugins/TrackingSpamPrevention/screenshots/1_Settings.png and /dev/null differ diff --git a/plugins/TrackingSpamPrevention/screenshots/2_Settings_Country.png b/plugins/TrackingSpamPrevention/screenshots/2_Settings_Country.png deleted file mode 100644 index 1e59af8f3037ac1e7e34cc2bc22e74096d2112a9..0000000000000000000000000000000000000000 Binary files a/plugins/TrackingSpamPrevention/screenshots/2_Settings_Country.png and /dev/null differ diff --git a/plugins/TrackingSpamPrevention/tests/Fixtures/TrackingFixture.php b/plugins/TrackingSpamPrevention/tests/Fixtures/TrackingFixture.php deleted file mode 100644 index 32edca4614642a0b07f7abdaedac60fab6449c11..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Fixtures/TrackingFixture.php +++ /dev/null @@ -1,20 +0,0 @@ -allowList = new AllowListIpRange(new Configuration()); - } - - public function test_isAllowed() - { - Config::getInstance()->TrackingSpamPrevention[Configuration::KEY_RANGE_ALLOW_LIST] = ['10.10.0.0/21', '15.15.0.0/21', '2001:db8::/64']; - - $this->assertTrue($this->allowList->isAllowed('10.10.0.0')); - $this->assertTrue($this->allowList->isAllowed('10.10.0.1')); - $this->assertTrue($this->allowList->isAllowed('10.10.0.255')); - $this->assertTrue($this->allowList->isAllowed('15.15.0.255')); - - $this->assertFalse($this->allowList->isAllowed('11.11.0.0')); - - $this->assertTrue($this->allowList->isAllowed('2001:db8::')); - $this->assertTrue($this->allowList->isAllowed('2001:db8:0000:0000:ffff:ffff:ffff:fffe')); - - $this->assertFalse($this->allowList->isAllowed('2001:db8:0000:0001:ffff:ffff:ffff:fffe')); - $this->assertFalse($this->allowList->isAllowed('2002:db8:0000:0000:ffff:ffff:ffff:fffe')); - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/BlockedGeoIpTest.php b/plugins/TrackingSpamPrevention/tests/Integration/BlockedGeoIpTest.php deleted file mode 100644 index 4533e106794375788e655e5d4e5071d71fe28a53..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/BlockedGeoIpTest.php +++ /dev/null @@ -1,72 +0,0 @@ -blockedGeoIp = new BlockedGeoIp(['mytest']); - } - - public function test_detectLocation() - { - $this->assertEquals([ 'country_code' => 'xx', - 'continent_code' => 'unk', - 'continent_name' => 'General_Unknown', - 'country_name' => 'General_Unknown'], $this->blockedGeoIp->detectLocation('127.0.0.1', 'en')); - } - - public function test_isExcludedCountry_noCountriesGiven() - { - $this->assertFalse($this->blockedGeoIp->isExcludedCountry('127.0.0.1', 'en', [], [])); - } - - public function test_isExcludedCountry_excludedCountriesGiven() - { - // this IP matches country "xx" - $this->assertTrue($this->blockedGeoIp->isExcludedCountry('127.0.0.1', 'en', ['fr', 'xx'], [])); - $this->assertFalse($this->blockedGeoIp->isExcludedCountry('127.0.0.1', 'en', ['de', 'nz'], [])); - } - - public function test_isExcludedCountry_includedCountriesGiven() - { - // this IP matches country "xx" - $this->assertFalse($this->blockedGeoIp->isExcludedCountry('127.0.0.1', 'en', [], ['fr', 'xx'])); - $this->assertTrue($this->blockedGeoIp->isExcludedCountry('127.0.0.1', 'en', [], ['de', 'nz'])); - } - - public function test_isExcluded() - { - $this->assertFalse($this->blockedGeoIp->isExcludedProvider('127.0.0.1', 'en')); - } - - public function test_isExcluded_When_UserCountryPluginIsDisabled() - { - \Piwik\Plugin\Manager::getInstance()->deactivatePlugin('UserCountry'); - $this->assertFalse($this->blockedGeoIp->isExcludedProvider('127.0.0.1', 'en')); - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/BlockedIpRanges/ProvidersTest.php b/plugins/TrackingSpamPrevention/tests/Integration/BlockedIpRanges/ProvidersTest.php deleted file mode 100644 index e0dcf82b62f3df43d4727f1618ffa202a88bc312..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/BlockedIpRanges/ProvidersTest.php +++ /dev/null @@ -1,56 +0,0 @@ -getRanges(); - $this->assertNotEmpty($ranges); - $this->assertTrue(is_array($ranges)); - $this->assertGreaterThan(5, count($ranges)); - } - - public function test_getDownloadUrl_Azure() - { - $azure = new BlockedIpRanges\Azure(); - $url = $azure->getDownloadUrl(); - $this->assertStringStartsWith('https://download.microsoft.com/download/', $url); - $substr = trim($url, '.json'); - $parts = explode('_', $substr); - $dateStr = $parts[count($parts) - 1]; - $this->assertSame(8, strlen($dateStr), 'The string should be a valid Ymd (8 digit) date'); - $time = strtotime($dateStr); - $this->assertGreaterThan(0, $time, 'The date string should have parsed into a valid time'); - } - - public function getIpRangeProviderDataProvider() - { - return [ - [new BlockedIpRanges\Aws()], - [new BlockedIpRanges\Azure()], - [new BlockedIpRanges\DigitalOcean()], - [new BlockedIpRanges\Gcloud()], - [new BlockedIpRanges\Oracle()], - ]; - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/BlockedIpRangesTest.php b/plugins/TrackingSpamPrevention/tests/Integration/BlockedIpRangesTest.php deleted file mode 100644 index 636adb7fd3737e946ff5b54f4e511863a3a29a86..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/BlockedIpRangesTest.php +++ /dev/null @@ -1,210 +0,0 @@ -ranges = new BlockedIpRanges($ranges, new Configuration()); - } - - public function tearDown(): void - { - parent::tearDown(); - } - - public function test_getBlockedRanges_nothingStored() - { - $this->assertSame([], $this->ranges->getBlockedRanges()); - } - - public function test_setBlockedRanges_getBlockedRanges_unsetAllIpRanges() - { - $this->ranges->setBlockedRanges(['10.' => ['10.10.10.10/21'], '172.' => ['172.172.0.0/22']]); - $this->assertSame(['10.' => ['10.10.10.10/21'], '172.' => ['172.172.0.0/22']], $this->ranges->getBlockedRanges()); - - $this->ranges->unsetAllIpRanges(); - $this->assertSame([], $this->ranges->getBlockedRanges()); - } - - public function test_banIp() - { - $this->ranges->banIp('10.10.10.10'); - $this->assertSame(['10.' => ['10.10.10.10/32']], $this->ranges->getBlockedRanges()); - $this->ranges->banIp('172.172.0.0'); - $this->assertSame(['10.' => ['10.10.10.10/32'], '172.' => ['172.172.0.0/32']], $this->ranges->getBlockedRanges()); - $this->ranges->banIp('2000::'); - $this->assertSame(['10.' => ['10.10.10.10/32'], '172.' => ['172.172.0.0/32'], '2000:' => ['2000::/128']], $this->ranges->getBlockedRanges()); - $this->ranges->banIp('172.172.1.0'); - $this->assertSame(['10.' => ['10.10.10.10/32'], '172.' => ['172.172.0.0/32', '172.172.1.0/32'], '2000:' => ['2000::/128']], $this->ranges->getBlockedRanges()); - } - - public function test_banIpWontBanSameIpTwice() - { - $this->ranges->banIp('10.10.10.10'); - $this->assertSame(['10.' => ['10.10.10.10/32']], $this->ranges->getBlockedRanges()); - - $this->ranges->banIp('10.10.10.10'); - $this->assertSame(['10.' => ['10.10.10.10/32']], $this->ranges->getBlockedRanges()); - } - - public function test_updateBlockedIpRanges() - { - $this->ranges->updateBlockedIpRanges(); - $this->assertEquals(array ( - '10.' => - array ( - 0 => '10.10.0.0/21', - ), - '11.' => - array ( - 0 => '11.11.0.0/22', - ), - '127.' => - array ( - 0 => '127.0.0.0/23', - 1 => '127.0.255.0/22', - ), - '2001:' => - array ( - 0 => '2001:db8::/42', - 1 => '2001:db8::/126', - 2 => '2001:db9::/42', - 3 => '2001:db7::/125', - ), - '192.' => - array ( - 0 => '192.168.10.0/24', - 1 => '192.168.0.0/23', - ), - '15.' => - array ( - 0 => '15.15.15.0/21', - ), - '2002:' => - array ( - 0 => '2002:db7::/126', - ), - '190.' => - array ( - 0 => '190.168.0.0/23', - ), - ), $this->ranges->getBlockedRanges()); - } - - public function test_updateBlockedIpRanges_withExceptionButCaught() - { - $ranges = [ - new BlockedIpRanges\VariableRange([ - '15.15.15.0/21', - ]), - new BlockedIpRanges\ExceptionRange(), - new BlockedIpRanges\VariableRange([ - '16.16.16.0/21', - ]), - ]; - $this->ranges = new BlockedIpRanges($ranges, new Configuration()); - - $this->ranges->updateBlockedIpRanges(); - $this->assertSame([ - '15.' => ['15.15.15.0/21'], - '16.' => ['16.16.16.0/21'] - ], $this->ranges->getBlockedRanges()); - } - - public function test_updateBlockedIpRanges_withExceptionNotCaught() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('Failed to get any range'); - - Config::getInstance()->TrackingSpamPrevention[Configuration::KEY_RANGE_THROW_EXCEPTION] = 1; - $ranges = [ - new BlockedIpRanges\VariableRange([ - '15.15.15.0/21', - ]), - new BlockedIpRanges\ExceptionRange(), - new BlockedIpRanges\VariableRange([ - '16.16.16.0/21', - ]), - ]; - - $ranges = new BlockedIpRanges($ranges, new Configuration()); - $ranges->updateBlockedIpRanges(); - } - - public function isExcluded_ipv4() - { - $this->ranges->banIp(['10.10.10.10']); - $this->assertTrue($this->ranges->isExcluded('10.10.10.10')); - $this->assertFalse($this->ranges->isExcluded('10.10.10.9')); - $this->assertFalse($this->ranges->isExcluded('10.10.10.11')); - } - - public function isExcluded_ipv6() - { - $this->ranges->banIp(['2001:db8::']); - $this->assertTrue($this->ranges->isExcluded('2001:db8::')); - $this->assertTrue($this->ranges->isExcluded('2001:db8:0000:0000:ffff:ffff:ffff:ffff')); - $this->assertFalse($this->ranges->isExcluded('2001:db8:0000:0000:ffff:ffff:ffff:fffe')); - $this->assertFalse($this->ranges->isExcluded('2002:db8:0000:0000:ffff:ffff:ffff:fffe')); - } - - public function isExcluded_manyRanges() - { - $this->ranges->updateBlockedIpRanges(); - $this->ranges->banIp(['10.10.10.10']); - $this->assertTrue($this->ranges->isExcluded('10.10.0.0')); - $this->assertTrue($this->ranges->isExcluded('10.10.0.1')); - $this->assertTrue($this->ranges->isExcluded('192.168.10.0')); - $this->assertTrue($this->ranges->isExcluded('192.168.10.255')); - $this->assertFalse($this->ranges->isExcluded('192.168.11.0')); - $this->assertFalse($this->ranges->isExcluded('18.18.18.17')); - - $this->assertTrue($this->ranges->isExcluded('2001:db8:0000:0000:ffff:ffff:ffff:ffff')); - $this->assertFalse($this->ranges->isExcluded('2001:db8:0000:0000:ffff:ffff:ffff:fffe')); - $this->assertFalse($this->ranges->isExcluded('2002:db8:0000:0000:ffff:ffff:ffff:fffe')); - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/BrowserDetectionTest.php b/plugins/TrackingSpamPrevention/tests/Integration/BrowserDetectionTest.php deleted file mode 100644 index 079c7889f28e358a2712bdbad2c6d0b208462fcb..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/BrowserDetectionTest.php +++ /dev/null @@ -1,75 +0,0 @@ -browser = new BrowserDetection(); - } - - /** - * @dataProvider getHeadlessBrowsersProvider - */ - public function test_isHeadlessBrowser($expected, $userAgent) - { - $this->assertSame($expected, $this->browser->isHeadlessBrowser($userAgent)); - } - - public function getHeadlessBrowsersProvider() - { - return [ - [false, ''], - [false, null], - [false, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'], - [false, 'Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0'], - [true, 'Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.8 Safari/534.34'], - [true, 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/79.0.3945.0 Safari/537.36'], - [true, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) electron/1.0.0 Chrome/53.0.2785.113 Electron/1.4.3 Safari/537.36'], - ]; - } - - /** - * @dataProvider getServerSideLibraries - */ - public function test_isLibrary($expected, $userAgent) - { - $this->assertSame($expected, $this->browser->isLibrary($userAgent)); - } - - public function getServerSideLibraries() - { - $isMatomoPhp8Compatible = version_compare(Version::VERSION, '4.7.0-b1', '>=') || version_compare(PHP_VERSION, '8.0.0', '<'); - return [ - [false, ''], - [false, null], - [false, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'], - [false, 'Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0'], - [$isMatomoPhp8Compatible, 'curl/7.68.0'], - [$isMatomoPhp8Compatible, 'Wget/1.20.3 (linux-gnu)'], - ]; - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/ConfigurationTest.php b/plugins/TrackingSpamPrevention/tests/Integration/ConfigurationTest.php deleted file mode 100644 index 535c6303f14e8623feaa7bc65b13daa07e85be97..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/ConfigurationTest.php +++ /dev/null @@ -1,80 +0,0 @@ -configuration = new Configuration(); - $this->configuration->install(); - } - - public function test_shouldInstallConfig() - { - $this->configuration->install(); - - $configs = Config::getInstance()->TrackingSpamPrevention; - $this->assertEquals(array( - 'block_cloud_sync_throw_exception_on_error' => 0, - 'iprange_allowlist' => [''], - 'block_geoip_organisations' => Configuration::DEFAULT_GEOIP_MATCH_PROVIDERS, - ), $configs); - } - - public function test_shouldThrowExceptionOnIpRangeSync_default() - { - $this->assertFalse($this->configuration->shouldThrowExceptionOnIpRangeSync()); - } - - public function test_shouldThrowExceptionOnIpRangeSync_enabled() - { - Config::getInstance()->TrackingSpamPrevention[Configuration::KEY_RANGE_THROW_EXCEPTION] = 1; - $this->assertTrue($this->configuration->shouldThrowExceptionOnIpRangeSync()); - } - - public function test_getIpRangesAlwaysAllowed_byDefault() - { - $this->assertSame([], $this->configuration->getIpRangesAlwaysAllowed()); - } - - public function test_getIpRangesAlwaysAllowed_custom() - { - Config::getInstance()->TrackingSpamPrevention = array( - Configuration::KEY_RANGE_ALLOW_LIST => ['10.12.13.14/32', 'f::f/52', '', '11.12.13.14/21', '12.14.15.16', 'f::f'] - ); - $this->assertSame(['10.12.13.14/32', 'f::f/52', '11.12.13.14/21', '12.14.15.16/32', 'f::f/128'], $this->configuration->getIpRangesAlwaysAllowed()); - } - - public function test_getIpRangesAlwaysAllowed_invalid() - { - Config::getInstance()->TrackingSpamPrevention = array( - Configuration::KEY_RANGE_ALLOW_LIST => 'foobar' - ); - $this->assertSame([], $this->configuration->getIpRangesAlwaysAllowed()); - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/NotificationEmailTest.php b/plugins/TrackingSpamPrevention/tests/Integration/NotificationEmailTest.php deleted file mode 100644 index 548e42806801fdbe5d755050f22f80371abbb05e..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/NotificationEmailTest.php +++ /dev/null @@ -1,64 +0,0 @@ -email = new BanIpNotificationEmail(); - } - - public function test_send_noValidEmail() - { - $this->assertNull($this->email->send('10.10.10.10/32', '10.10.10.10', 'foo', 100, ['test'], '2020-12-14 01:42:27')); - } - - public function test_send_ValidEmail() - { - $this->assertEquals( - 'This is for your information. The following IP was banned because visit tried to track more than 112 actions: - -"10.10.10.10/12" - -URL: localhost -Current date (UTC): 2020-12-14 01:42:27 -IP as detected in header: 127.0.0.1 -GET request info: [] -POST request info: [] -Geo IP info: {"test":"foo","bar":"baz"}', - trim( - $this->email->send( - '10.10.10.10/12', - '127.0.0.1', - 'foo@matomo.org', - 112, - ['test' => 'foo', 'bar' => 'baz'], - '2020-12-14 01:42:27' - ) - ) - ); - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/SystemSettingsTest.php b/plugins/TrackingSpamPrevention/tests/Integration/SystemSettingsTest.php deleted file mode 100644 index 54cc168f8e83832db9577c42aba16b3586ccecd5..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/SystemSettingsTest.php +++ /dev/null @@ -1,181 +0,0 @@ -settings = new SystemSettings(); - } - - public function test_max_actions_default() - { - $this->assertSame(0, $this->settings->max_actions->getValue()); - } - - public function test_block_cloud_default() - { - $this->assertSame(false, $this->settings->block_clouds->getValue()); - } - - public function test_block_cloud_enable_getOldValue() - { - $this->settings->block_clouds->setValue(1); - $this->assertSame(true, $this->settings->block_clouds->getValue()); - $this->assertSame(false, $this->settings->block_clouds->getOldValue()); - } - - public function test_block_headless_default() - { - $this->assertSame(true, $this->settings->blockHeadless->getValue()); - } - - public function test_block_Headless_disable() - { - $this->settings->blockHeadless->setValue(0); - $this->assertSame(false, $this->settings->blockHeadless->getValue()); - } - - public function test_notification_email_default() - { - $this->assertSame('', $this->settings->notification_email->getValue()); - } - - public function test_notification_email_errrosWhenNotValidEmail() - { - $this->expectException(\Exception::class); - $this->settings->notification_email->setValue('foo'); - } - - public function test_notification_email_setValidEmail() - { - $this->settings->notification_email->setValue('foo@matomo.org'); - $this->assertSame('foo@matomo.org', $this->settings->notification_email->getValue()); - } - - public function test_notification_email_setEmptyValue() - { - $this->settings->notification_email->setValue(''); - $this->assertSame('', $this->settings->notification_email->getValue()); - } - - public function test_exclude_countries_default() - { - $this->assertSame([], $this->settings->excludedCountries->getValue()); - } - - public function test_exclude_getExcludedCountryCodes_default() - { - $this->assertSame([], $this->settings->getExcludedCountryCodes()); - } - - public function test_exclude_countries() - { - $this->settings->excludedCountries->setValue([ - ['country' => 'de'],['country' => 'fr'], ['country' => 'nz'] - ]); - $this->assertSame(['de', 'fr', 'nz'], $this->settings->getExcludedCountryCodes()); - } - - public function test_excludeCountries_setInvalidValue() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('Invalid country code'); - $this->settings->excludedCountries->setValue([ - ['country' => 'de'],['country' => 'foo'] - ]); - } - - public function test_include_countries_default() - { - $this->assertSame([], $this->settings->includedCountries->getValue()); - } - - public function test_include_countries() - { - $this->settings->includedCountries->setValue([ - ['country' => 'de'],['country' => 'fr'], ['country' => 'nz'] - ]); - $this->assertSame(['de', 'fr', 'nz'], $this->settings->getIncludedCountryCodes()); - } - - public function test_includeCountries_setInvalidValue() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('Invalid country code'); - $this->settings->includedCountries->setValue([ - ['country' => 'de'],['country' => 'foo'] - ]); - } - - public function test_include_getIncludedCountryCodes_default() - { - $this->assertSame([], $this->settings->getIncludedCountryCodes()); - } - - public function test_save_shouldSyncWhenEnabled() - { - $ranges = $this->makeRanges(); - $this->assertEmpty($ranges->getBlockedRanges()); - $this->settings->block_clouds->setValue(true); - $this->settings->save(); - $this->assertNotEmpty($ranges->getBlockedRanges()); - } - - public function test_save_shouldEmptyRangesWhenDisabledButNoChange() - { - $ranges = $this->makeRanges(); - $ranges->updateBlockedIpRanges(); - $this->assertNotEmpty($ranges->getBlockedRanges()); - $this->settings->block_clouds->setValue(false); - $this->settings->save(); - $this->assertNotEmpty($ranges->getBlockedRanges()); - } - - public function test_save_shouldEmptyRangesWhenDisabled() - { - $ranges = $this->makeRanges(); - $ranges->updateBlockedIpRanges(); - $this->assertNotEmpty($ranges->getBlockedRanges()); - $this->settings->block_clouds->setValue(true);// need to make it think there was a change - $this->settings->block_clouds->setValue(false); - $this->settings->save(); - $this->assertEmpty($ranges->getBlockedRanges()); - } - - private function makeRanges() - { - $ranges = [ - new BlockedIpRanges\VariableRange([ - '10.10.0.0/21', - ]), - ]; - - return new BlockedIpRanges($ranges, new Configuration()); - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/TasksTest.php b/plugins/TrackingSpamPrevention/tests/Integration/TasksTest.php deleted file mode 100644 index 1ecdd95ec455613cd9f2bd7c37afce4afa4e3108..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/TasksTest.php +++ /dev/null @@ -1,66 +0,0 @@ -settings = new SystemSettings(); - - $ranges = [ - new BlockedIpRanges\VariableRange([ - '10.10.0.0/21', - ]), - ]; - - $this->ranges = new BlockedIpRanges($ranges, new Configuration()); - $this->task = new Tasks($this->settings, $this->ranges); - } - - public function tearDown(): void - { - parent::tearDown(); - } - - public function test_updateBlockedIpRanges_blockCloudDisabled_shouldEmptyQueue() - { - $this->ranges->setBlockedRanges(['11.' => ['11.12.10.10/1']]); - $this->settings->block_clouds->setValue(false); - $this->task->updateBlockedIpRanges(); - $this->assertSame([], $this->ranges->getBlockedRanges()); - } - - public function test_updateBlockedIpRanges_blockCloudEnabled() - { - $this->settings->block_clouds->setValue(true); - $this->task->updateBlockedIpRanges(); - $this->assertSame(['10.' => ['10.10.0.0/21']], $this->ranges->getBlockedRanges()); - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/Tracker/RequestProcessorTest.php b/plugins/TrackingSpamPrevention/tests/Integration/Tracker/RequestProcessorTest.php deleted file mode 100644 index 1efabf359dc1f51e4b096d294f8265f68aec8cb7..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/Tracker/RequestProcessorTest.php +++ /dev/null @@ -1,116 +0,0 @@ -settings = new SystemSettings(); - - $ranges = [ - new BlockedIpRanges\VariableRange([ - '10.10.0.0/21', - ]), - ]; - - $this->ranges = new BlockedIpRanges($ranges, new Configuration()); - $this->processor = new RequestProcessor($this->settings, $this->ranges); - } - - public function tearDown(): void - { - parent::tearDown(); - } - - public function test_updateBlockedIpRanges_maxActionsDisabled_shouldNeverBlock() - { - $this->settings->max_actions->setValue(0); - $this->assertNull($this->processor->afterRequestProcessed($this->makeVisit(100000), $this->makeRequest())); - $this->assertSame([], $this->ranges->getBlockedRanges()); - } - - public function test_updateBlockedIpRanges_maxActionsEnabled_limitNotReached_shouldNotBanIpAndNotStopTracking() - { - $this->settings->max_actions->setValue(200); - - $this->assertNull($this->processor->afterRequestProcessed($this->makeVisit(199), $this->makeRequest())); - $this->assertSame([], $this->ranges->getBlockedRanges()); - } - - public function test_updateBlockedIpRanges_maxActionsEnabled_limitReached_shouldStopRequestAndBanIP() - { - $this->settings->max_actions->setValue(200); - - $this->assertTrue($this->processor->afterRequestProcessed($this->makeVisit(200), $this->makeRequest())); - $this->assertSame(['11.' => ['11.12.13.14/32']], $this->ranges->getBlockedRanges()); - } - - public function test_updateBlockedIpRanges_maxActionsEnabled_limitReached_shouldIgnoreAllowedIp() - { - Config::getInstance()->TrackingSpamPrevention = [ - Configuration::KEY_RANGE_ALLOW_LIST => ['10.12.13.14/32', 'f::f/52', '', '11.12.13.14/21', '12.14.15.16', 'f::f'] - ]; - $this->settings->max_actions->setValue(200); - - $this->assertNull($this->processor->afterRequestProcessed($this->makeVisit(200), $this->makeRequest())); - $this->assertSame([], $this->ranges->getBlockedRanges()); - } - - public function test_updateBlockedIpRanges_maxActionsEnabled_limitReached_shouldIgnoreAllowedIpHigherActions() - { - Config::getInstance()->TrackingSpamPrevention = [ - Configuration::KEY_RANGE_ALLOW_LIST => ['10.12.13.14/32', 'f::f/52', '', '11.12.13.14/21', '12.14.15.16', 'f::f'] - ]; - $this->settings->max_actions->setValue(200); - - $this->assertNull($this->processor->afterRequestProcessed($this->makeVisit(800), $this->makeRequest())); - $this->assertSame([], $this->ranges->getBlockedRanges()); - } - - private function makeVisit($actions) - { - $visit = new VisitProperties(); - $visit->setProperty('visit_total_actions', $actions); - return $visit; - } - - private function makeRequest() - { - $req = new Request(array('idsite' => 1, 'cip' => '11.12.13.14', 'token_auth' => Fixture::getTokenAuth())); - $req->isAuthenticated(); - return $req; - } -} diff --git a/plugins/TrackingSpamPrevention/tests/Integration/TrackingSpamPreventionTest.php b/plugins/TrackingSpamPrevention/tests/Integration/TrackingSpamPreventionTest.php deleted file mode 100644 index 3ab2da58b5bdb8405db2ac0bb6007a83649c2c15..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/Integration/TrackingSpamPreventionTest.php +++ /dev/null @@ -1,236 +0,0 @@ -setBlockClouds(true); - StaticContainer::get(BlockedIpRanges::class)->updateBlockedIpRanges(); - } - - private function makeExcluded($ip) - { - $req = new Request(['idsite' => 1, 'cip' => $ip, 'token_auth' => Fixture::getTokenAuth(), 'rec' => 1]); - return new VisitExcluded($req); - } - - public function test_trackerCache() - { - $cache = Cache::getCacheGeneral(); - $this->assertEquals([ - '10.' => ['10.10.0.0/21'], - '200.' => ['200.200.0.0/21'] - ], $cache[BlockedIpRanges::OPTION_KEY]); - } - - public function test_isExcludedVisit_whenBlockedUserAgentWhenGoodUserAgentWontBlock() - { - StaticContainer::get(SystemSettings::class)->blockHeadless->setValue(1); - Cache::clearCacheGeneral(); - - $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'; - $excluded = $this->makeExcluded('22.22.22.22'); - $isExcluded = $excluded->isExcluded(); - unset($_SERVER['HTTP_USER_AGENT']); - $this->assertFalse($isExcluded); - } - - public function test_isExcludedVisit_whenBlockedUserAgent() - { - StaticContainer::get(SystemSettings::class)->blockHeadless->setValue(1); - Cache::clearCacheGeneral(); - - $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/79.0.3945.0 Safari/537.36'; - $excluded = $this->makeExcluded('22.22.22.22'); - $isExcluded = $excluded->isExcluded(); - unset($_SERVER['HTTP_USER_AGENT']); - $this->assertTrue($isExcluded); - } - - public function test_isExcludedVisit_whenHeadlessClientHint() - { - StaticContainer::get(SystemSettings::class)->blockHeadless->setValue(1); - Cache::clearCacheGeneral(); - - // set normal browser not a headless browser - $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.0 Safari/537.36'; - $excluded = $this->makeExcluded('22.22.22.22'); - $excluded->request->setParam('uadata', '{"fullVersionList":[{"brand":"Not A(Brand","version":"99.0.0.0"},{"brand":"HeadlessChrome","version":"121.0.6167.57"},{"brand":"Chromium","version":"121.0.6167.57"}],"mobile":false,"model":"","platform":"Linux","platformVersion":"5.15.0"}'); - $isExcluded = $excluded->isExcluded(); - unset($_SERVER['HTTP_USER_AGENT']); - $this->assertTrue($isExcluded); - } - - public function test_isExcludedVisit_whenBlockedUserAgentDisabled() - { - StaticContainer::get(SystemSettings::class)->blockHeadless->setValue(0); - Cache::clearCacheGeneral(); - - $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/79.0.3945.0 Safari/537.36'; - $excluded = $this->makeExcluded('22.22.22.22'); - $isExcluded = $excluded->isExcluded(); - unset($_SERVER['HTTP_USER_AGENT']); - $this->assertFalse($isExcluded); - } - - public function test_isExcludedVisit_whenNothingBlocked() - { - StaticContainer::get(BlockedIpRanges::class)->unsetAllIpRanges(); - $excluded = $this->makeExcluded('10.10.0.3'); - $this->assertFalse($excluded->isExcluded()); - } - - public function test_isExcludedVisit_whenBlockServerSideLibraryDisabledAndNotServerSideUserAgent() - { - StaticContainer::get(SystemSettings::class)->blockServerSideLibraries->setValue(0); - Cache::clearCacheGeneral(); - - $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'; - $excluded = $this->makeExcluded('22.22.22.22'); - $isExcluded = $excluded->isExcluded(); - unset($_SERVER['HTTP_USER_AGENT']); - $this->assertFalse($isExcluded); - } - - public function test_isExcludedVisit_whenBlockServerSideLibraryDisabledAndServerSideUserAgent() - { - StaticContainer::get(SystemSettings::class)->blockServerSideLibraries->setValue(0); - Cache::clearCacheGeneral(); - - $_SERVER['HTTP_USER_AGENT'] = 'curl/7.68.0'; - $excluded = $this->makeExcluded('22.22.22.22'); - $isExcluded = $excluded->isExcluded(); - unset($_SERVER['HTTP_USER_AGENT']); - $this->assertFalse($isExcluded); - } - - public function test_isExcludedVisit_whenBlockServerSideLibraryEnabledAndNotServerSideUserAgent() - { - StaticContainer::get(SystemSettings::class)->blockServerSideLibraries->setValue(1); - Cache::clearCacheGeneral(); - - $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'; - $excluded = $this->makeExcluded('22.22.22.22'); - $isExcluded = $excluded->isExcluded(); - unset($_SERVER['HTTP_USER_AGENT']); - $this->assertFalse($isExcluded); - } - - public function test_isExcludedVisit_whenBlockServerSideLibraryEnabledAndServerSideUserAgent() - { - StaticContainer::get(SystemSettings::class)->blockServerSideLibraries->setValue(1); - Cache::clearCacheGeneral(); - - $_SERVER['HTTP_USER_AGENT'] = 'curl/7.68.0'; - $excluded = $this->makeExcluded('22.22.22.22'); - $isExcluded = $excluded->isExcluded(); - unset($_SERVER['HTTP_USER_AGENT']); - if (version_compare(Version::VERSION, '4.7.0-b1', '>=') || version_compare(PHP_VERSION, '8.0.0', '<')) { - $this->assertTrue($isExcluded); - } else { - $this->assertFalse($isExcluded); - } - } - - public function test_isExcludedVisit_whenIpBlocked() - { - $excluded = $this->makeExcluded('10.10.0.3'); - $this->assertTrue($excluded->isExcluded()); - $excluded = $this->makeExcluded('200.200.0.1'); - $this->assertTrue($excluded->isExcluded()); - } - - public function test_isExcludedVisit_whenWhiteListUsed() - { - Config::getInstance()->TrackingSpamPrevention[Configuration::KEY_RANGE_ALLOW_LIST] = [ - '10.10.0.4/32', '10.10.0.3/32', - ]; - $excluded = $this->makeExcluded('10.10.0.2'); - $this->assertTrue($excluded->isExcluded()); - - $excluded = $this->makeExcluded('10.10.0.3'); - $this->assertFalse($excluded->isExcluded()); - - $excluded = $this->makeExcluded('10.10.0.4'); - $this->assertFalse($excluded->isExcluded()); - - $excluded = $this->makeExcluded('10.10.0.5'); - $this->assertTrue($excluded->isExcluded()); - } - - public function test_isExcludedVisit_whenIpNotBlocked() - { - $excluded = $this->makeExcluded('20.20.20.20'); - $this->assertFalse($excluded->isExcluded()); - } - - public function test_isExcludedVisit_excludeCountries() - { - StaticContainer::get(SystemSettings::class)->excludedCountries->setValue( - [['country' => 'xx'],['country' => 'fr'], ['country' => 'nz'], ['country' => 'de'], ['country' => 'us']] - ); - - $excluded = $this->makeExcluded('127.0.0.1'); - $this->assertTrue($excluded->isExcluded()); - - StaticContainer::get(SystemSettings::class)->excludedCountries->setValue( - [['country' => 'ai']] - ); - - $excluded = $this->makeExcluded('127.0.0.1'); - $this->assertFalse($excluded->isExcluded()); - } - - public function test_isExcludedVisit_includeCountries() - { - StaticContainer::get(SystemSettings::class)->includedCountries->setValue( - [['country' => 'xx'],['country' => 'fr'], ['country' => 'nz'], ['country' => 'de'], ['country' => 'us']] - ); - - $excluded = $this->makeExcluded('127.0.0.1'); - $this->assertFalse($excluded->isExcluded()); - - StaticContainer::get(SystemSettings::class)->includedCountries->setValue( - [['country' => 'ai']] - ); - - $excluded = $this->makeExcluded('127.0.0.1'); - $this->assertTrue($excluded->isExcluded()); - } - - private function setBlockClouds($val) - { - StaticContainer::get(SystemSettings::class)->block_clouds->setValue($val); - Cache::clearCacheGeneral(); - } -} diff --git a/plugins/TrackingSpamPrevention/tests/System/CheckDirectDependencyUseCommandTest.php b/plugins/TrackingSpamPrevention/tests/System/CheckDirectDependencyUseCommandTest.php deleted file mode 100644 index 9f843485b91a35886d51f2f47eb3eb07637b2b6d..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/System/CheckDirectDependencyUseCommandTest.php +++ /dev/null @@ -1,56 +0,0 @@ -markTestSkipped('tests:check-direct-dependency-use is not available in this version'); - } - - $pluginName = 'TrackingSpamPrevention'; - - $checkDirectDependencyUse = new CheckDirectDependencyUse(); - - $console = new \Piwik\Console(self::$fixture->piwikEnvironment); - $console->addCommands([$checkDirectDependencyUse]); - $command = $console->find('tests:check-direct-dependency-use'); - $arguments = [ - 'command' => 'tests:check-direct-dependency-use', - '--plugin' => $pluginName, - '--grep-vendor', - ]; - - $inputObject = new ArrayInput($arguments); - $command->run($inputObject, new NullOutput()); - - $this->assertEquals([ - 'Symfony\Component\Console' => [ - 'TrackingSpamPrevention/tests/System/CheckDirectDependencyUseCommandTest.php' - ], - 'Matomo\Network' => [ - 'TrackingSpamPrevention/AllowListIpRange.php', - 'TrackingSpamPrevention/BlockedIpRanges.php', - 'TrackingSpamPrevention/TrackingSpamPrevention.php', - ], - 'DI' => [ - 'TrackingSpamPrevention/TrackingSpamPrevention.php', - ] - ], $checkDirectDependencyUse->usesFoundList[$pluginName]); - } -} diff --git a/plugins/TrackingSpamPrevention/tests/UI/.gitignore b/plugins/TrackingSpamPrevention/tests/UI/.gitignore deleted file mode 100644 index f39be478e7a412cafbcc27f53a9875baaa92b664..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/UI/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/processed-ui-screenshots -/screenshot-diffs \ No newline at end of file diff --git a/plugins/TrackingSpamPrevention/tests/UI/Settings_spec.js b/plugins/TrackingSpamPrevention/tests/UI/Settings_spec.js deleted file mode 100644 index d38b40a0290534f4236e09b42c864703277b1d1a..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/UI/Settings_spec.js +++ /dev/null @@ -1,29 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * Screenshot integration tests. - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -describe("TrackingSpamPreventionSettings", function () { - this.timeout(0); - - this.fixture = "Piwik\\Plugins\\TrackingSpamPrevention\\tests\\Fixtures\\TrackingFixture"; - - var selector = '.card-content:contains(\'TrackingSpamPrevention\')'; - var url = "?module=CoreAdminHome&action=generalSettings&idSite=1&period=day&date=yesterday"; - - before(function () { - testEnvironment.pluginsToLoad = ['TrackingSpamPrevention']; - testEnvironment.save(); - }); - - it("should display the settings page", async function () { - await page.goto(url); - await page.waitForNetworkIdle(); - await page.waitForTimeout(20000); - expect(await page.screenshotSelector(selector)).to.matchImage('page'); - }); -}); \ No newline at end of file diff --git a/plugins/TrackingSpamPrevention/tests/UI/expected-screenshots/.gitkeep b/plugins/TrackingSpamPrevention/tests/UI/expected-screenshots/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/plugins/TrackingSpamPrevention/tests/UI/expected-screenshots/TrackingSpamPreventionSettings_page.png b/plugins/TrackingSpamPrevention/tests/UI/expected-screenshots/TrackingSpamPreventionSettings_page.png deleted file mode 100644 index 3147a8fbb007ec06558e903c89c843ecdd641eac..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/UI/expected-screenshots/TrackingSpamPreventionSettings_page.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0dae007f153847712e503e427befab829ca43093920cd9a4a6041bfa15f65fda -size 131 diff --git a/plugins/TrackingSpamPrevention/tests/travis/before_install.after.yml b/plugins/TrackingSpamPrevention/tests/travis/before_install.after.yml deleted file mode 100644 index b39166d384f92569973ec0276fd1c2d3f8a3fa5b..0000000000000000000000000000000000000000 --- a/plugins/TrackingSpamPrevention/tests/travis/before_install.after.yml +++ /dev/null @@ -1 +0,0 @@ -- if [[ "${TEST_SUITE}" == "UITests" ]]; then git lfs fetch; git lfs checkout; fi diff --git a/plugins/Transitions/API.php b/plugins/Transitions/API.php deleted file mode 100644 index 48366f1d21b6fe35753c01affb9b0ef3d3138a92..0000000000000000000000000000000000000000 --- a/plugins/Transitions/API.php +++ /dev/null @@ -1,802 +0,0 @@ -getTransitionsForAction($pageTitle, 'title', $idSite, $period, $date, $segment, $limitBeforeGrouping); - } - - /** - * Returns transition data for the specified page URL. - * - * @param string $pageUrl The page URL to analyze. - * @param int $idSite The numeric ID of the website to query. - * @param 'day'|'week'|'month'|'year'|'range' $period The period to process, processes data for the - * period containing the specified date. - * @param string $date The date or date range to process. - * 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), - * or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX). - * @param string|null|false $segment Custom segment to filter the report. - * Example: "referrerName==example.com" - * Supports AND (;) and OR (,) operators. - * @param int|string $limitBeforeGrouping Maximum number of transition rows to keep before grouping the - * remainder. - * @return array Transition metrics and related referrer/action tables for the requested page URL. - */ - public function getTransitionsForPageUrl(string $pageUrl, int $idSite, string $period, string $date, $segment = false, $limitBeforeGrouping = 0) - { - return $this->getTransitionsForAction($pageUrl, 'url', $idSite, $period, $date, $segment, $limitBeforeGrouping); - } - - /** - * Returns transition data for the specified page action. - * - * @param string $actionName The page URL or title to analyze. - * @param 'url'|'title' $actionType Whether the action name is a URL or title. - * @param int $idSite The numeric ID of the website to query. - * @param 'day'|'week'|'month'|'year'|'range' $period The period to process, processes data for the - * period containing the specified date. - * @param string $date The date or date range to process. - * 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), - * or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX). - * @param string|null|false $segment Custom segment to filter the report. - * Example: "referrerName==example.com" - * Supports AND (;) and OR (,) operators. - * @param int|string $limitBeforeGrouping Maximum number of transition rows to keep before grouping the - * remainder. - * @param string $parts Comma-separated list of transition report parts to include, or `all`. - * @return array Transition metrics and related referrer/action tables for the requested action. - */ - public function getTransitionsForAction( - string $actionName, - string $actionType, - int $idSite, - string $period, - string $date, - $segment = false, - $limitBeforeGrouping = 0, - $parts = 'all' - ) { - Piwik::checkUserHasViewAccess($idSite); - - if (!$this->isPeriodAllowed($idSite, $period, $date)) { - throw new Exception('PeriodNotAllowed'); - } - - if ($limitBeforeGrouping && !is_numeric($limitBeforeGrouping)) { - throw new Exception('limitBeforeGrouping has to be an integer.'); - } - //convert string to int - $limitBeforeGrouping = (int)$limitBeforeGrouping; - - // get idaction of the requested action - $idaction = $this->deriveIdAction($actionName, $actionType); - if ($idaction === null) { - throw new Exception('NoDataForAction'); - } - - // prepare log aggregator - $site = new Site($idSite); - $period = Period\Factory::build($period, $date); - $segment = new Segment( - $segment ?: '', - [$idSite], - $period->getDateTimeStart()->setTimezone($site->getTimezone()), - $period->getDateTimeEnd()->setTimezone($site->getTimezone()) - ); - $params = new ArchiveProcessor\Parameters($site, $period, $segment); - $logAggregator = new LogAggregator($params); - - // prepare the report - $report = [ - 'date' => Period\Factory::build($period->getLabel(), $date)->getLocalizedShortString(), - ]; - - try { - $partsArray = explode(',', $parts); - if ($parts == 'all' || in_array('internalReferrers', $partsArray)) { - $this->addInternalReferrers($logAggregator, $report, $idaction, $actionType, $limitBeforeGrouping); - } - if ($parts == 'all' || in_array('followingActions', $partsArray)) { - $includeLoops = $parts != 'all' && !in_array('internalReferrers', $partsArray); - $this->addFollowingActions($logAggregator, $report, $idaction, $actionType, $limitBeforeGrouping, $includeLoops); - } - if ($parts == 'all' || in_array('externalReferrers', $partsArray)) { - $this->addExternalReferrers($logAggregator, $report, $idaction, $actionType, $limitBeforeGrouping); - } - - // derive the number of exits from the other metrics - if ($parts == 'all') { - $report['pageMetrics']['exits'] = $report['pageMetrics']['pageviews'] - - $this->getTotalTransitionsToFollowingActions() - - $report['pageMetrics']['loops']; - } - } catch (\Exception $e) { - Model::handleMaxExecutionTimeError( - Db::getReader(), - $e, - $segment->getString(), - $period->getDateStart(), - $period->getDateEnd(), - 0, - GeneralConfig::getConfigValue('live_query_max_execution_time'), - ['method' => 'Transitions.getTransitionsForAction', 'actionName' => $actionName, 'actionType' => $actionType] - ); - throw $e; - } - - - // replace column names in the data tables - $reportNames = [ - 'previousPages' => true, - 'previousSiteSearches' => false, - 'followingPages' => true, - 'followingSiteSearches' => false, - 'outlinks' => true, - 'downloads' => true, - ]; - foreach ($reportNames as $reportName => $replaceLabel) { - if (isset($report[$reportName])) { - $columnNames = [Metrics::INDEX_NB_ACTIONS => 'referrals']; - if ($replaceLabel) { - $columnNames[Metrics::INDEX_NB_ACTIONS] = 'referrals'; - } - $report[$reportName]->filter('ReplaceColumnNames', [$columnNames]); - } - } - - return $report; - } - - /** - * Derive the action ID from the request action name and type. - */ - private function deriveIdAction(string $actionName, string $actionType): ?int - { - switch ($actionType) { - case 'url': - $originalActionName = $actionName; - $actionName = Common::unsanitizeInputValue($actionName); - - $id = TableLogAction::getIdActionFromSegment($actionName, 'idaction_url', SegmentExpression::MATCH_EQUAL, 'pageUrl'); - - if (!is_numeric($id) || $id < 0) { - // an example where this is needed is urls containing < or > - $actionName = $originalActionName; - $id = TableLogAction::getIdActionFromSegment($actionName, 'idaction_url', SegmentExpression::MATCH_EQUAL, 'pageUrl'); - } - - return is_numeric($id) && $id > 0 ? (int)$id : null; - - case 'title': - $id = TableLogAction::getIdActionFromSegment($actionName, 'idaction_name', SegmentExpression::MATCH_EQUAL, 'pageTitle'); - - if (!is_numeric($id) || $id < 0) { - $unknown = ArchivingHelper::getUnknownActionName(Action::TYPE_PAGE_TITLE); - if (trim($actionName) == trim($unknown)) { - return 0; - } - } - - return is_numeric($id) && $id > 0 ? (int)$id : null; - - default: - throw new Exception('Unknown action type'); - } - } - - /** - * Add the internal referrers to the report: - * previous pages and previous site searches - * - * @param array $report - * @throws Exception - */ - private function addInternalReferrers(LogAggregator $logAggregator, array &$report, int $idaction, string $actionType, int $limitBeforeGrouping): void - { - $data = $this->queryInternalReferrers($idaction, $actionType, $logAggregator, $limitBeforeGrouping); - - if ($data['pageviews'] == 0) { - throw new Exception('NoDataForAction'); - } - - $report['previousPages'] = & $data['previousPages']; - $report['previousSiteSearches'] = & $data['previousSiteSearches']; - $report['pageMetrics']['loops'] = $data['loops']; - $report['pageMetrics']['pageviews'] = $data['pageviews']; - } - - /** - * Add the following actions to the report: - * following pages, downloads, outlinks - * - * @param array $report - */ - private function addFollowingActions(LogAggregator $logAggregator, array &$report, int $idaction, string $actionType, int $limitBeforeGrouping = 0, bool $includeLoops = false): void - { - - $data = $this->queryFollowingActions( - $idaction, - $actionType, - $logAggregator, - $limitBeforeGrouping, - $includeLoops - ); - - foreach ($data as $tableName => $table) { - $report[$tableName] = $table; - } - } - - /** - * Get information about the following actions (following pages, site searches, outlinks, downloads) - * - * @return array - */ - protected function queryFollowingActions( - int $idaction, - string $actionType, - LogAggregator $logAggregator, - int $limitBeforeGrouping = 0, - bool $includeLoops = false - ): array { - $types = []; - - if ($actionType != 'title') { - // specific setup for page urls - $types[Action::TYPE_PAGE_URL] = 'followingPages'; - $dimension = 'if ( %1$s.idaction_url IS NULL, %1$s.idaction_name, %1$s.idaction_url )'; - $dimension = sprintf($dimension, 'log_link_visit_action'); - // site search referrers are logged with url=NULL - // when we find one, we have to join on name - $joinLogActionColumn = $dimension; - $selects = ['log_action.name', 'log_action.url_prefix', 'log_action.type']; - } else { - // specific setup for page titles: - $types[Action::TYPE_PAGE_TITLE] = 'followingPages'; - // join log_action on name and url and pick depending on url type - // the table joined on url is log_action1 - $joinLogActionColumn = ['idaction_url', 'idaction_name']; - $dimension = ' - CASE - ' /* following site search */ . ' - WHEN log_link_visit_action.idaction_url IS NULL THEN log_action2.idaction - ' /* following page view: use page title */ . ' - WHEN log_action1.type = ' . Action::TYPE_PAGE_URL . ' THEN log_action2.idaction - ' /* following download or outlink: use url */ . ' - ELSE log_action1.idaction - END - '; - $selects = [ - 'CASE - ' /* following site search */ . ' - WHEN log_link_visit_action.idaction_url IS NULL THEN log_action2.name - ' /* following page view: use page title */ . ' - WHEN log_action1.type = ' . Action::TYPE_PAGE_URL . ' THEN log_action2.name - ' /* following download or outlink: use url */ . ' - ELSE log_action1.name - END AS `name`', - 'CASE - ' /* following site search */ . ' - WHEN log_link_visit_action.idaction_url IS NULL THEN log_action2.type - ' /* following page view: use page title */ . ' - WHEN log_action1.type = ' . Action::TYPE_PAGE_URL . ' THEN log_action2.type - ' /* following download or outlink: use url */ . ' - ELSE log_action1.type - END AS `type`', - 'NULL AS `url_prefix`', - ]; - } - - // these types are available for both titles and urls - $types[Action::TYPE_SITE_SEARCH] = 'followingSiteSearches'; - $types[Action::TYPE_OUTLINK] = 'outlinks'; - $types[Action::TYPE_DOWNLOAD] = 'downloads'; - - $rankingQuery = new RankingQuery($limitBeforeGrouping ? $limitBeforeGrouping : $this->limitBeforeGrouping); - $rankingQuery->setOthersLabel('Others'); - $rankingQuery->addLabelColumn(['name', 'url_prefix']); - $rankingQuery->partitionResultIntoMultipleGroups('type', array_keys($types)); - - $type = $this->getColumnTypeSuffix($actionType); - $where = 'log_link_visit_action.idaction_' . $type . '_ref = ' . intval($idaction); - if (!$includeLoops) { - $where .= ' AND (log_link_visit_action.idaction_' . $type . ' IS NULL OR ' - . 'log_link_visit_action.idaction_' . $type . ' != ' . intval($idaction) . ')'; - } - - $metrics = [Metrics::INDEX_NB_ACTIONS]; - $data = $logAggregator->queryActionsByDimension( - [$dimension], - $where, - $selects, - $metrics, - $rankingQuery, - $joinLogActionColumn, - $secondaryOrderBy = "`name`", - GeneralConfig::getConfigValue('live_query_max_execution_time') - ); - - $dataTables = $this->makeDataTablesFollowingActions($types, $data); - - return $dataTables; - } - - /** - * Get information about external referrers (i.e. search engines, websites & campaigns) - * - * @throws Exception - */ - protected function queryExternalReferrers(int $idaction, string $actionType, LogAggregator $logAggregator, int $limitBeforeGrouping = 0): DataTable - { - - $rankingQuery = new RankingQuery($limitBeforeGrouping ?: $this->limitBeforeGrouping); - $rankingQuery->setOthersLabel('Others'); - - // we generate a single column that contains the interesting data for each referrer. - // the reason we cannot group by referer_* becomes clear when we look at search engine keywords. - // referer_url contains the url from the search engine, referer_keyword the keyword we want to - // group by. when we group by both, we don't get a single column for the keyword but instead - // one column per keyword + search engine url. this way, we could not get the top keywords using - // the ranking query. - $dimensions = [ - 'referrer_data' => 'CASE log_visit.referer_type - WHEN ' . Common::REFERRER_TYPE_DIRECT_ENTRY . ' THEN \'\' - WHEN ' . Common::REFERRER_TYPE_SEARCH_ENGINE . ' THEN log_visit.referer_name - WHEN ' . Common::REFERRER_TYPE_SOCIAL_NETWORK . ' THEN log_visit.referer_name - WHEN ' . Common::REFERRER_TYPE_AI_ASSISTANT . ' THEN log_visit.referer_name - WHEN ' . Common::REFERRER_TYPE_WEBSITE . ' THEN log_visit.referer_url - WHEN ' . Common::REFERRER_TYPE_CAMPAIGN . ' THEN CONCAT_WS(\' \', log_visit.referer_name, log_visit.referer_keyword) - END', 'referer_type', - ]; - $rankingQuery->addLabelColumn('referrer_data'); - - // get one limited group per referrer type - $rankingQuery->partitionResultIntoMultipleGroups('referer_type', [ - Common::REFERRER_TYPE_DIRECT_ENTRY, - Common::REFERRER_TYPE_SEARCH_ENGINE, - Common::REFERRER_TYPE_SOCIAL_NETWORK, - Common::REFERRER_TYPE_AI_ASSISTANT, - Common::REFERRER_TYPE_WEBSITE, - Common::REFERRER_TYPE_CAMPAIGN, - ]); - - $type = $this->getColumnTypeSuffix($actionType); - $where = 'visit_entry_idaction_' . $type . ' = ' . intval($idaction); - $metrics = [Metrics::INDEX_NB_VISITS]; - $data = $logAggregator->queryVisitsByDimension($dimensions, $where, [], $metrics, $rankingQuery, false, GeneralConfig::getConfigValue('live_query_max_execution_time')); - - // array is prefilled with available keys and empty values are removed in the end to ensure the order is static - $referrerData = [ - Common::REFERRER_TYPE_DIRECT_ENTRY => [], - Common::REFERRER_TYPE_SEARCH_ENGINE => [], - Common::REFERRER_TYPE_SOCIAL_NETWORK => [], - Common::REFERRER_TYPE_AI_ASSISTANT => [], - Common::REFERRER_TYPE_WEBSITE => [], - Common::REFERRER_TYPE_CAMPAIGN => [], - ]; - $referrerSubData = []; - - foreach ($data as $referrerType => &$subData) { - $referrerData[$referrerType] = [Metrics::INDEX_NB_VISITS => 0]; - if ($referrerType != Common::REFERRER_TYPE_DIRECT_ENTRY) { - $referrerSubData[$referrerType] = []; - } - - foreach ($subData as &$row) { - if ($referrerType == Common::REFERRER_TYPE_SEARCH_ENGINE && empty($row['referrer_data'])) { - $row['referrer_data'] = Piwik::translate('General_Unknown'); - } - - $referrerData[$referrerType][Metrics::INDEX_NB_VISITS] += $row[Metrics::INDEX_NB_VISITS]; - - $label = $row['referrer_data']; - if ($label) { - $referrerSubData[$referrerType][$label] = [ - Metrics::INDEX_NB_VISITS => $row[Metrics::INDEX_NB_VISITS], - ]; - } - } - } - - // remove empty records - $referrerData = array_filter($referrerData); - - $array = new DataArray($referrerData, $referrerSubData); - return $array->asDataTable(); - } - - /** - * Get information about internal referrers (previous pages & loops, i.e. page refreshes) - * - * @return array{pageviews: int, previousPages: DataTable, previousSiteSearches: DataTable, loops: int} - */ - protected function queryInternalReferrers(int $idaction, string $actionType, LogAggregator $logAggregator, int $limitBeforeGrouping = 0): array - { - $keyIsOther = 0; - $keyIsPageUrlAction = 1; - $keyIsSiteSearchAction = 2; - - $rankingQuery = new RankingQuery($limitBeforeGrouping ? $limitBeforeGrouping : $this->limitBeforeGrouping); - $rankingQuery->setOthersLabel('Others'); - $rankingQuery->addLabelColumn(['name', 'url_prefix']); - $rankingQuery->setColumnToMarkExcludedRows('is_self'); - $rankingQuery->partitionResultIntoMultipleGroups('action_partition', [$keyIsOther, $keyIsPageUrlAction, $keyIsSiteSearchAction]); - - $type = $this->getColumnTypeSuffix($actionType); - $mainActionType = Action::TYPE_PAGE_URL; - $dimension = 'idaction_url_ref'; - - if ($actionType == 'title') { - $mainActionType = Action::TYPE_PAGE_TITLE; - $dimension = 'idaction_name_ref'; - } - - $selects = [ - 'log_action.name', - 'log_action.url_prefix', - 'CASE WHEN log_link_visit_action.idaction_' . $type . '_ref = ' . intval($idaction) . ' THEN 1 ELSE 0 END AS `is_self`', - 'CASE - WHEN log_action.type = ' . $mainActionType . ' THEN ' . $keyIsPageUrlAction . ' - WHEN log_action.type = ' . Action::TYPE_SITE_SEARCH . ' THEN ' . $keyIsSiteSearchAction . ' - ELSE ' . $keyIsOther . ' - END AS `action_partition`', - ]; - - $where = ' log_link_visit_action.idaction_' . $type . ' = ' . intval($idaction); - - if ($dimension == 'idaction_url_ref') { - // site search referrers are logged with url_ref=NULL - // when we find one, we have to join on name_ref - $dimension = 'if ( %1$s.idaction_url_ref IS NULL, %1$s.idaction_name_ref, %1$s.idaction_url_ref )'; - $dimension = sprintf($dimension, 'log_link_visit_action'); - $joinLogActionOn = $dimension; - } else { - $joinLogActionOn = $dimension; - } - $metrics = [Metrics::INDEX_NB_ACTIONS]; - $data = $logAggregator->queryActionsByDimension( - [$dimension], - $where, - $selects, - $metrics, - $rankingQuery, - $joinLogActionOn, - $secondaryOrderBy = "`name`", - GeneralConfig::getConfigValue('live_query_max_execution_time') - ); - - $loops = 0; - $nbPageviews = 0; - $previousPagesDataTable = new DataTable(); - if (isset($data['result'][$keyIsPageUrlAction])) { - foreach ($data['result'][$keyIsPageUrlAction] as &$page) { - $nbActions = intval($page[Metrics::INDEX_NB_ACTIONS]); - $previousPagesDataTable->addRow(new Row([ - Row::COLUMNS => [ - 'label' => $this->getPageLabel($page, Action::TYPE_PAGE_URL), - Metrics::INDEX_NB_ACTIONS => $nbActions, - ], - ])); - $nbPageviews += $nbActions; - } - } - - $previousSearchesDataTable = new DataTable(); - if (isset($data['result'][$keyIsSiteSearchAction])) { - foreach ($data['result'][$keyIsSiteSearchAction] as &$search) { - $nbActions = intval($search[Metrics::INDEX_NB_ACTIONS]); - $previousSearchesDataTable->addRow(new Row([ - Row::COLUMNS => [ - 'label' => $search['name'], - Metrics::INDEX_NB_ACTIONS => $nbActions, - ], - ])); - $nbPageviews += $nbActions; - } - } - - if (isset($data['result'][0])) { - foreach ($data['result'][0] as &$referrer) { - $nbPageviews += intval($referrer[Metrics::INDEX_NB_ACTIONS]); - } - } - - if (count($data['excludedFromLimit'])) { - $loops += intval($data['excludedFromLimit'][0][Metrics::INDEX_NB_ACTIONS]); - $nbPageviews += $loops; - } - - return [ - 'pageviews' => $nbPageviews, - 'previousPages' => $previousPagesDataTable, - 'previousSiteSearches' => $previousSearchesDataTable, - 'loops' => $loops, - ]; - } - - /** - * @param array $pageRecord - * @param int|string $type - * @return string|null - */ - private function getPageLabel(&$pageRecord, $type) - { - if ($type == Action::TYPE_PAGE_TITLE) { - $label = $pageRecord['name']; - if (empty($label)) { - $label = ArchivingHelper::getUnknownActionName(Action::TYPE_PAGE_TITLE); - } - return $label; - } - - if ($type == Action::TYPE_OUTLINK || $type == Action::TYPE_DOWNLOAD) { - return PageUrl::reconstructNormalizedUrl($pageRecord['name'], $pageRecord['url_prefix']); - } - - return $pageRecord['name']; - } - - /** - * @param string $actionType - */ - private function getColumnTypeSuffix($actionType): string - { - if ($actionType == 'title') { - return 'name'; - } - return 'url'; - } - - /** - * @var int - */ - private $limitBeforeGrouping = 5; - - /** - * @var int - */ - private $totalTransitionsToFollowingPages = 0; - - /** - * Get the sum of all transitions to following actions (pages, outlinks, downloads). - * Only works if queryFollowingActions() has been used directly before. - */ - protected function getTotalTransitionsToFollowingActions(): int - { - return $this->totalTransitionsToFollowingPages; - } - - /** - * Add the external referrers to the report: - * direct entries, websites, campaigns, search engines - * - * @param array $report - */ - private function addExternalReferrers(LogAggregator $logAggregator, array &$report, int $idaction, string $actionType, int $limitBeforeGrouping): void - { - $data = $this->queryExternalReferrers( - $idaction, - $actionType, - $logAggregator, - $limitBeforeGrouping - ); - - $report['pageMetrics']['entries'] = 0; - $report['referrers'] = []; - foreach ($data->getRows() as $row) { - /** @var int|string $referrerId */ - $referrerId = $row->getColumn('label'); - $visits = $row->getColumn(Metrics::INDEX_NB_VISITS); - if ($visits) { - // load details (i.e. subtables) - $details = []; - $subTable = $row->getSubtable(); - if ($subTable) { - foreach ($subTable->getRows() as $subRow) { - $details[] = [ - 'label' => $subRow->getColumn('label'), - 'referrals' => $subRow->getColumn(Metrics::INDEX_NB_VISITS), - ]; - } - } - $report['referrers'][] = [ - 'label' => $this->getReferrerLabel($referrerId), - 'shortName' => \Piwik\Plugins\Referrers\getReferrerTypeFromShortName($referrerId), - 'visits' => $visits, - 'details' => $details, - ]; - $report['pageMetrics']['entries'] += $visits; - } - } - - // if there's no data for referrers, ResponseBuilder::handleMultiDimensionalArray - // does not detect the multi dimensional array and the data is rendered differently, which - // causes an exception. - if (count($report['referrers']) == 0) { - $report['referrers'][] = [ - 'label' => $this->getReferrerLabel(Common::REFERRER_TYPE_DIRECT_ENTRY), - 'shortName' => \Piwik\Plugins\Referrers\getReferrerTypeLabel(Common::REFERRER_TYPE_DIRECT_ENTRY), - 'visits' => 0, - ]; - } - } - - /** - * @param int|string $referrerId - */ - private function getReferrerLabel($referrerId): string - { - switch ($referrerId) { - case Common::REFERRER_TYPE_DIRECT_ENTRY: - return Controller::getTranslation('directEntries'); - case Common::REFERRER_TYPE_SEARCH_ENGINE: - return Controller::getTranslation('fromSearchEngines'); - case Common::REFERRER_TYPE_SOCIAL_NETWORK: - return Controller::getTranslation('fromSocialNetworks'); - case Common::REFERRER_TYPE_AI_ASSISTANT: - return Controller::getTranslation('fromAIAssistants'); - case Common::REFERRER_TYPE_WEBSITE: - return Controller::getTranslation('fromWebsites'); - case Common::REFERRER_TYPE_CAMPAIGN: - return Controller::getTranslation('fromCampaigns'); - default: - return Piwik::translate('General_Others'); - } - } - - /** - * @internal - */ - public function getTranslations(): array - { - $controller = new Controller(); - return $controller->getTranslations(); - } - - /** - * @param array $types - * @param array $data - * @return array - */ - protected function makeDataTablesFollowingActions(array $types, array $data): array - { - $this->totalTransitionsToFollowingPages = 0; - $dataTables = array(); - foreach ($types as $type => $recordName) { - $dataTable = new DataTable(); - if (isset($data[$type])) { - foreach ($data[$type] as &$record) { - $actions = intval($record[Metrics::INDEX_NB_ACTIONS]); - $dataTable->addRow(new Row(array( - Row::COLUMNS => array( - 'label' => $this->getPageLabel($record, $type), - Metrics::INDEX_NB_ACTIONS => $actions, - ), - ))); - - $this->processTransitionsToFollowingPages($type, $actions); - } - } - $dataTables[$recordName] = $dataTable; - } - return $dataTables; - } - - /** - * @param int $type - * @param int $actions - */ - protected function processTransitionsToFollowingPages($type, $actions): void - { - // Downloads and Outlinks are not included as these actions count towards a Visit Exit - $actionTypesNotExitActions = array( - Action::TYPE_SITE_SEARCH, - Action::TYPE_PAGE_TITLE, - Action::TYPE_PAGE_URL, - ); - if (in_array($type, $actionTypesNotExitActions)) { - $this->totalTransitionsToFollowingPages += $actions; - } - } - - - /** - * Check if a period is allowed by config settings - * - * @param int $idSite - * @param string $period - * @param string $date - */ - public function isPeriodAllowed($idSite, $period, $date): bool - { - $maxPeriodAllowed = Transitions::getPeriodAllowedConfig($idSite); - if ($maxPeriodAllowed === 'all') { - return true; - } - - // If the period is a range then the number of days in the range must be less or equal to the max period allowed - if ($period === 'range') { - $range = new Period\Range($period, $date); - $rangeDays = $range->getDayCount(); - - switch ($maxPeriodAllowed) { - case 'day': - return $rangeDays == 1; - case 'week': - return $rangeDays <= 7; - case 'month': - return $rangeDays <= 31; - case 'year': - return $rangeDays <= 365; - } - } - - switch ($maxPeriodAllowed) { - case 'day': - return $period === 'day'; - case 'week': - return in_array($period, ['day', 'week']); - case 'month': - return in_array($period, ['day', 'week', 'month']); - case 'year': - return in_array($period, ['day', 'week', 'month', 'year']); - } - - return false; - } -} diff --git a/plugins/Transitions/Categories/TransitionsSubcategory.php b/plugins/Transitions/Categories/TransitionsSubcategory.php deleted file mode 100644 index 0c1c30ff74070281fe427c3c17d0be033d690f38..0000000000000000000000000000000000000000 --- a/plugins/Transitions/Categories/TransitionsSubcategory.php +++ /dev/null @@ -1,28 +0,0 @@ -' . Piwik::translate('Transitions_TransitionsSubcategoryHelp1') . '

' - . '

' . Url::getExternalLinkTag('https://matomo.org/docs/transitions/', null, null, 'App.Transitions.getTransitions') - . Piwik::translate('Transitions_TransitionsSubcategoryHelp2') . '

'; - } -} diff --git a/plugins/Transitions/Controller.php b/plugins/Transitions/Controller.php deleted file mode 100644 index d24612eb2f41ca3f08c2f7418a5250f0b2006765..0000000000000000000000000000000000000000 --- a/plugins/Transitions/Controller.php +++ /dev/null @@ -1,95 +0,0 @@ - 'Transitions_NumPageviews', - 'loopsInline' => 'Transitions_LoopsInline', - 'fromPreviousPages' => 'Transitions_FromPreviousPages', - 'fromPreviousPagesInline' => 'Transitions_FromPreviousPagesInline', - 'fromPreviousSiteSearches' => 'Transitions_FromPreviousSiteSearches', - 'fromPreviousSiteSearchesInline' => 'Transitions_FromPreviousSiteSearchesInline', - 'fromSearchEngines' => 'Transitions_FromSearchEngines', - 'fromSearchEnginesInline' => 'Referrers_TypeSearchEngines', - 'fromSocialNetworks' => 'Transitions_FromSocialNetworks', - 'fromSocialNetworksInline' => 'Referrers_TypeSocialNetworks', - 'fromAIAssistants' => 'Transitions_FromAIAssistants', - 'fromAIAssistantsInline' => 'Referrers_TypeAIAssistants', - 'fromWebsites' => 'Transitions_FromWebsites', - 'fromWebsitesInline' => 'Referrers_TypeWebsites', - 'fromCampaigns' => 'Transitions_FromCampaigns', - 'fromCampaignsInline' => 'Referrers_TypeCampaigns', - 'directEntries' => 'Transitions_DirectEntries', - 'directEntriesInline' => 'Referrers_TypeDirectEntries', - 'toFollowingPages' => 'Transitions_ToFollowingPages', - 'toFollowingPagesInline' => 'Transitions_ToFollowingPagesInline', - 'toFollowingSiteSearches' => 'Transitions_ToFollowingSiteSearches', - 'toFollowingSiteSearchesInline' => 'Transitions_ToFollowingSiteSearchesInline', - 'downloads' => 'General_Downloads', - 'downloadsInline' => 'Transitions_NumDownloads', - 'outlinks' => 'General_Outlinks', - 'outlinksInline' => 'Transitions_NumOutlinks', - 'exits' => 'General_ColumnExits', - 'exitsInline' => 'Transitions_ExitsInline', - 'bouncesInline' => 'Transitions_BouncesInline', - ); - - /** - * Translations that are added to JS - */ - private static $jsTranslations = array( - 'XOfY' => 'Transitions_XOutOfYVisits', - 'XOfAllPageviews' => 'Transitions_XOfAllPageviews', - 'NoDataForAction' => 'Transitions_NoDataForAction', - 'NoDataForActionDetails' => 'Transitions_NoDataForActionDetails', - 'NoDataForActionBack' => 'Transitions_ErrorBack', - 'PeriodNotAllowed' => 'Transitions_PeriodNotAllowed', - 'PeriodNotAllowedDetails' => 'Transitions_PeriodNotAllowedDetails', - 'PeriodNotAllowedBack' => 'Transitions_ErrorBack', - 'ShareOfAllPageviews' => 'Transitions_ShareOfAllPageviews', - 'DateRange' => 'General_DateRange', - ); - - public static function getTranslation($key) - { - return Piwik::translate(self::$metricTranslations[$key]); - } - - /** - * The main method of the plugin. - * It is triggered from the Transitions data table action. - */ - public function renderPopover() - { - $view = new View('@Transitions/renderPopover'); - $view->translations = $this->getTranslations(); - return $view->render(); - } - - public function getTranslations() - { - $translations = self::$metricTranslations + self::$jsTranslations; - foreach ($translations as &$message) { - $message = Piwik::translate($message); - } - return $translations; - } -} diff --git a/plugins/Transitions/Transitions.php b/plugins/Transitions/Transitions.php deleted file mode 100644 index c68c9803d827afafc16bfe5db89ea4015bde491e..0000000000000000000000000000000000000000 --- a/plugins/Transitions/Transitions.php +++ /dev/null @@ -1,100 +0,0 @@ - 'getStylesheetFiles', - 'AssetManager.getJavaScriptFiles' => 'getJsFiles', - 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', - 'API.getPagesComparisonsDisabledFor' => 'getPagesComparisonsDisabledFor', - 'Template.jsGlobalVariables' => 'addJsGlobalVariables', - ); - } - - public function getPagesComparisonsDisabledFor(&$pages) - { - $pages[] = "General_Actions.Transitions_Transitions"; - } - - public function getStylesheetFiles(&$stylesheets) - { - $stylesheets[] = 'plugins/Transitions/stylesheets/transitions.less'; - $stylesheets[] = 'plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.less'; - } - - public function getJsFiles(&$jsFiles) - { - $jsFiles[] = 'plugins/Transitions/javascripts/transitions.js'; - } - - public function getClientSideTranslationKeys(&$translationKeys) - { - $translationKeys[] = 'General_TransitionsRowActionTooltipTitle'; - $translationKeys[] = 'General_TransitionsRowActionTooltip'; - $translationKeys[] = 'Actions_PageUrls'; - $translationKeys[] = 'Actions_WidgetPageTitles'; - $translationKeys[] = 'Transitions_NumPageviews'; - $translationKeys[] = 'Transitions_Transitions'; - $translationKeys[] = 'CoreHome_ThereIsNoDataForThisReport'; - $translationKeys[] = 'General_Others'; - $translationKeys[] = 'Actions_ActionType'; - $translationKeys[] = 'Transitions_TopX'; - $translationKeys[] = 'Transitions_AvailableInOtherReports'; - $translationKeys[] = 'Actions_SubmenuPageTitles'; - $translationKeys[] = 'Actions_SubmenuPagesEntry'; - $translationKeys[] = 'Actions_SubmenuPagesExit'; - $translationKeys[] = 'Transitions_AvailableInOtherReports2'; - $translationKeys[] = 'Transitions_FeatureDescription'; - } - - public function addJsGlobalVariables(&$out) - { - $idSite = Common::getRequestVar('idSite', 1, 'int'); - $maxPeriodAllowed = self::getPeriodAllowedConfig($idSite); - - $out .= ' piwik.transitionsMaxPeriodAllowed = "' . ($maxPeriodAllowed ? $maxPeriodAllowed : 'all') . '"' . "\n"; - } - - /** - * Retrieve the max period allowed config setting for the given site, - * falling back to the general config when no site is given. - * - * @param int|null $idSite - */ - public static function getPeriodAllowedConfig($idSite): string - { - $transitionsGeneralConfig = Config::getInstance()->Transitions; - $generalMaxPeriodAllowed = ($transitionsGeneralConfig && !empty($transitionsGeneralConfig['max_period_allowed']) ? $transitionsGeneralConfig['max_period_allowed'] : null); - - $siteMaxPeriodAllowed = null; - if ($idSite) { - $sectionName = 'Transitions_' . $idSite; - $transitionsSiteConfig = Config::getInstance()->$sectionName; - $siteMaxPeriodAllowed = ($transitionsSiteConfig && !empty($transitionsSiteConfig['max_period_allowed']) ? $transitionsSiteConfig['max_period_allowed'] : null); - } - - if (!$generalMaxPeriodAllowed && !$siteMaxPeriodAllowed) { - return 'all'; // No config setting, so all periods are valid - } - - // Site setting overrides general, if it exists - return $siteMaxPeriodAllowed ?? $generalMaxPeriodAllowed; - } -} diff --git a/plugins/Transitions/Widgets/GetTransitions.php b/plugins/Transitions/Widgets/GetTransitions.php deleted file mode 100644 index 3f75b53eba354c3fa6d247c93baeb4a0b881bab6..0000000000000000000000000000000000000000 --- a/plugins/Transitions/Widgets/GetTransitions.php +++ /dev/null @@ -1,36 +0,0 @@ -setCategoryId('General_Actions'); - $config->setSubcategoryId('Transitions_Transitions'); - $config->setName('Transitions_Transitions'); - $config->setOrder(99); - $config->setClientSideComponent('Transitions', 'TransitionsPage'); - $idSite = self::getIdSite(); - if (!$idSite || !Piwik::isUserHasViewAccess($idSite)) { - $config->disable(); - } - } - - private static function getIdSite() - { - return Request::fromRequest()->getIntegerParameter('idSite', 0); - } -} diff --git a/plugins/Transitions/config/config.php b/plugins/Transitions/config/config.php deleted file mode 100644 index d5be5de26f92a935f318ed4c0a04fe01434bfe66..0000000000000000000000000000000000000000 --- a/plugins/Transitions/config/config.php +++ /dev/null @@ -1,3 +0,0 @@ - '; // LabelFilter::SEPARATOR_RECURSIVE_LABEL - var labelParts = label.split(separator); - for (var i = 0; i < labelParts.length; i++) { - var labelPart = labelParts[i].replace('@', ''); - labelParts[i] = $.trim(decodeURIComponent(labelPart)); - } - var delimiter = piwik.config.action_url_category_delimiter; - if(this.dataTable.param.action.indexOf('PageTitles') !== false) { - delimiter = piwik.config.action_title_category_delimiter; - } - label = labelParts.join(delimiter); - this.openPopover('title:' + label); -}; - -DataTable_RowActions_Transitions.prototype.doOpenPopover = function (link) { - var ALLOWED_OVERRIDE_PARAMS = ['segment', 'date', 'period', 'idSite']; - - var parts = link.split(':'); - - var overrideParams = {}; - - var i = 0; - while (i < parts.length) { - var paramName = ''; - - try { - paramName = decodeURIComponent(parts[i]); - } catch (e) { - // invalid parameter - } - - if (ALLOWED_OVERRIDE_PARAMS.indexOf(paramName) === -1) { - i += 1; - continue; - } - - overrideParams[paramName] = decodeURIComponent(parts[i + 1]); - parts.splice(i, 2); - } - - if (parts.length < 2) { - return; - } - - var actionType = parts[0]; - parts.shift(); - var actionName = parts.join(':'); - - if (this.transitions === null) { - this.transitions = new Piwik_Transitions(actionType, actionName, this, overrideParams); - } else { - this.transitions.reset(actionType, actionName, segment); - } - this.transitions.showPopover(); -}; - -DataTable_RowActions_Registry.register({ - - name: 'Transitions', - - dataTableIcon: 'icon-transition', - - order: 20, - - dataTableIconTooltip: [ - _pk_translate('General_TransitionsRowActionTooltipTitle'), - _pk_translate('General_TransitionsRowActionTooltip') - ], - - createInstance: function (dataTable) { - return new DataTable_RowActions_Transitions(dataTable); - }, - - isAvailableOnReport: function (dataTableParams) { - - if (piwik.transitionsMaxPeriodAllowed && dataTableParams['period']) { - - if (dataTableParams['period'] === 'range') { - - var piwikPeriods = window.CoreHome.Periods; - if (piwikPeriods) { - var range = piwikPeriods.parse(dataTableParams['period'], dataTableParams['date']); - if (range) { - var rangeDays = range.getDayCount(); - if ((piwik.transitionsMaxPeriodAllowed === 'day' && rangeDays > 1) || - (piwik.transitionsMaxPeriodAllowed === 'week' && rangeDays > 7) || - (piwik.transitionsMaxPeriodAllowed === 'month' && rangeDays > 31) || - (piwik.transitionsMaxPeriodAllowed === 'year' && rangeDays > 365)) - { - return false; - } - } - } - } else { - if (piwik.transitionsMaxPeriodAllowed === 'day' && dataTableParams['period'] !== 'day') { - return false; - } - if (piwik.transitionsMaxPeriodAllowed === 'week' && dataTableParams['period'] !== 'day' - && dataTableParams['period'] !== 'week') { - return false; - } - if (piwik.transitionsMaxPeriodAllowed === 'month' && dataTableParams['period'] !== 'day' - && dataTableParams['period'] !== 'week' && dataTableParams['period'] !== 'month') { - return false; - } - if (piwik.transitionsMaxPeriodAllowed === 'year' && dataTableParams['period'] !== 'day' - && dataTableParams['period'] !== 'week' && dataTableParams['period'] !== 'month' - && dataTableParams['period'] !== 'year' - ) { - return false; - } - } - } - var i = 0; - for (i; i < DataTable_RowActions_Transitions.registeredReports.length; i++) { - var report = DataTable_RowActions_Transitions.registeredReports[i]; - if (report - && report.isAvailableOnReport - && report.isAvailableOnReport(dataTableParams)) { - return true; - } - } - - return false; - }, - - isAvailableOnRow: function (dataTableParams, tr) { - if (tr.hasClass('subDataTable') || tr.hasClass('totalsRow')) { - // not available on groups (i.e. folders) - return false; - } - - var i = 0; - for (i; i < DataTable_RowActions_Transitions.registeredReports.length; i++) { - var report = DataTable_RowActions_Transitions.registeredReports[i]; - if (report - && report.isAvailableOnRow - && report.isAvailableOnReport - && report.isAvailableOnReport(dataTableParams)) { - return report.isAvailableOnRow(dataTableParams, tr); - } - } - - return true; - } - -}); - -// -// TRANSITIONS IMPLEMENTATION -// - -function Piwik_Transitions(actionType, actionName, rowAction, overrideParams) { - this.reset(actionType, actionName, overrideParams); - this.rowAction = rowAction; - - this.ajax = new Piwik_Transitions_Ajax(); - this.model = new Piwik_Transitions_Model(this.ajax); - - this.leftGroups = ['previousPages', 'previousSiteSearches', 'searchEngines', 'socialNetworks', 'aiAssistants', 'websites', 'campaigns']; - this.rightGroups = ['followingPages', 'followingSiteSearches', 'downloads', 'outlinks']; -} - -Piwik_Transitions.prototype.reset = function (actionType, actionName, overrideParams) { - this.actionType = actionType; - this.actionName = actionName; - this.overrideParams = overrideParams; - - this.popover = null; - this.canvas = null; - this.centerBox = null; - - this.leftOpenGroup = 'previousPages'; - this.rightOpenGroup = 'followingPages'; - - this.highlightedGroup = false; - this.highlightedGroupSide = false; - this.highlightedGroupCenterEl = false; -}; - -/** Open the popover */ -Piwik_Transitions.prototype.showPopover = function (showEmbeddedInReport) { - var self = this; - this.showEmbeddedInReport = showEmbeddedInReport; - Piwik_Transitions.currentInstance = this; - - $('#transitions_report .popoverContainer').hide(); - - if (showEmbeddedInReport) { - this.popover = $('#transitions_report'); - $('#Transitions_Error_Container').hide(); - $('#transitions_inline_loading').show(); - } else { - this.popover = Piwik_Popover.showLoading('Transitions', self.actionName, 550); - Piwik_Popover.addHelpButton(_pk_externalRawLink('https://matomo.org/docs/transitions')); - } - - var bothLoaded = function () { - if (showEmbeddedInReport) { - $('#transitions_inline_loading').hide(); - } - - self.restorePopoverContent(); - self.model.htmlLoaded(); - self.renderPopover(); - }; - - // load the popover HTML (only done once) - var callbackForHtml = false; - if (typeof Piwik_Transitions.popoverHtml == 'undefined') { - this.ajax.callTransitionsController('renderPopover', function (html) { - Piwik_Transitions.popoverHtml = html; - if (callbackForHtml !== false) { - callbackForHtml(); - } - }); - } - - // load the data - self.model.loadData(self.actionType, self.actionName, self.overrideParams, function () { - if (typeof Piwik_Transitions.popoverHtml == 'undefined') { - // html not there yet - callbackForHtml = bothLoaded; - } else { - // html already loaded - bothLoaded(); - } - }); -}; - -/** Prepare the popover with the basic DOM to add data later. */ -Piwik_Transitions.prototype.preparePopover = function () { - var self = this; - - var width = 900; - var height = 550; - - var canvasBgLeft = self.prepareCanvas('Background_Left', width, height); - var canvasBgRight = self.prepareCanvas('Background_Right', width, height); - var canvasLeft = self.prepareCanvas('Left', width, height); - var canvasRight = self.prepareCanvas('Right', width, height); - var canvasLoops = self.prepareCanvas('Loops', width, height); - - self.canvas = new Piwik_Transitions_Canvas(canvasBgLeft, canvasBgRight, canvasLeft, canvasRight, - canvasLoops, width, height); - - self.centerBox = self.popover.find('#Transitions_CenterBox'); - - var title = self.actionName; - if (self.actionType == 'url') { - title = Piwik_Transitions_Util.shortenUrl(title, true); - } - var h2 = self.centerBox.find('h2'); - var textContainer = h2; - if (self.actionType == 'url') { - var a = $(document.createElement('a')); - a.attr('href', self.actionName); - a.attr('rel', 'noreferrer noopener'); - a.attr('target', '_blank'); - h2.append(a); - textContainer = a; - } - - textContainer.addClass('Transitions_ApplyTextAndTruncate') - .data('text', title) - .data('maxLines', 3); - - var element = textContainer.add(self.popover.find('p.Transitions_Pageviews')); - - element.tooltip({ - track: true, - content: function () { - var totalNbPageviews = self.model.getTotalNbPageviews(); - if (totalNbPageviews > 0) { - - var share = NumberFormatter.formatPercent(Math.round(self.model.pageviews / totalNbPageviews * 1000) / 10); - - var text = Piwik_Transitions_Translations.ShareOfAllPageviews; - text = sprintf(text, NumberFormatter.formatNumber(self.model.pageviews), share); - text += '
' + Piwik_Transitions_Translations.DateRange + ' ' + self.model.date + ''; - - var title = '

' + piwikHelper.addBreakpointsToUrl(self.actionName) + '

'; - - return title + text; - } - return false; - }, - items: '*', - tooltipClass: 'Transitions_Tooltip_Small', - show: false, - hide: false - }); -}; - -Piwik_Transitions.prototype.prepareCanvas = function (canvasId, width, height) { - canvasId = 'Transitions_Canvas_' + canvasId; - var div = $('#' + canvasId).width(width).height(height); - var canvas; - - if (typeof Piwik_Transitions.canvasCache == 'undefined' - || typeof window.G_vmlCanvasManager != "undefined") { - // no recycling for excanvas because they are disposed properly anyway and - // recycling doesn't work this way in IE8 - Piwik_Transitions.canvasCache = {}; - } - - if (typeof Piwik_Transitions.canvasCache[canvasId] == 'undefined') { - Piwik_Transitions.canvasCache[canvasId] = document.createElement('canvas'); - canvas = Piwik_Transitions.canvasCache[canvasId]; - canvas.width = width; - canvas.height = height; - } else { - canvas = Piwik_Transitions.canvasCache[canvasId]; - canvas.getContext('2d').clearRect(0, 0, width, height); - } - - div.append(canvas); - return canvas; -}; - -/** Render the popover content */ -Piwik_Transitions.prototype.render = function () { - this.renderCenterBox(); - - this.renderLeftSide(); - this.renderRightSide(); - - this.renderLoops(); - - window.CoreHome.Matomo.postEvent('Transitions.dataChanged', {'actionType': this.actionType, 'actionName': this.actionName}); -}; - -Piwik_Transitions.prototype.restorePopoverContent = function () { - if (this.showEmbeddedInReport) { - this.popover.find('.popoverContainer').html(Piwik_Transitions.popoverHtml).show(); - } else { - Piwik_Popover.setContent(Piwik_Transitions.popoverHtml); - } -}; - -Piwik_Transitions.prototype.renderPopover = function () { - this.preparePopover(); - - if (this.model.searchEnginesNbTransitions > 0 && this.model.websitesNbTransitions > 0 && this.model.socialNetworksNbTransitions > 0 - && this.model.aiAssistantsNbTransitions > 0 && this.model.campaignsNbTransitions > 0) { - this.canvas.narrowMode(); - } - - this.canvas.truncateVisibleBoxTexts(); - this.render(); - this.canvas.truncateVisibleBoxTexts(); -}; - -Piwik_Transitions.prototype.refreshTheme = function () { - if (!this.popover || !this.popover.length - || !$.contains(document.documentElement, this.popover[0]) - || typeof Piwik_Transitions.popoverHtml == 'undefined') { - return; - } - - this.restorePopoverContent(); - this.renderPopover(); -}; - -/** Render left side: referrer groups & direct entries */ -Piwik_Transitions.prototype.renderLeftSide = function (onlyBg) { - this.renderGroups(this.leftGroups, this.leftOpenGroup, 'left', onlyBg); - this.renderEntries(onlyBg); - - this.reRenderIfNeededToCenter('left', onlyBg); -}; - -/** Render right side: following pages & exits */ -Piwik_Transitions.prototype.renderRightSide = function (onlyBg) { - this.renderGroups(this.rightGroups, this.rightOpenGroup, 'right', onlyBg); - this.renderExits(onlyBg); - - this.reRenderIfNeededToCenter('right', onlyBg); -}; - -/** Helper method to render open and closed groups for both sides */ -Piwik_Transitions.prototype.renderGroups = function (groups, openGroup, side, onlyBg) { - for (var i = 0; i < groups.length; i++) { - var groupName = groups[i]; - if (groupName == openGroup) { - if (i != 0) { - var spacing = this.canvas.isNarrowMode() ? 7 : 13; - this.canvas.addBoxSpacing(spacing, side); - } - this.renderOpenGroup(groupName, side, onlyBg); - } else { - this.renderClosedGroup(groupName, side, onlyBg); - } - } - - this.canvas.addBoxSpacing(13, side); -}; - -/** - * If one side doesn't have much information, it doesn't look good to start from y=0. - * In this case, add some spacing on top and redraw. - */ -Piwik_Transitions.prototype.reRenderIfNeededToCenter = function (side, onlyBg) { - var height = (side == 'left' ? this.canvas.leftBoxPositionY : this.canvas.rightBoxPositionY) - 20; - if (height < 460 && !this.reRendering) { - var yOffset = (460 - height) / 2; - this.canvas.clearSide(side, onlyBg); - this.canvas.addBoxSpacing(yOffset, side); - this.reRendering = true; - side == 'left' ? this.renderLeftSide(onlyBg) : this.renderRightSide(onlyBg); - this.reRendering = false; - } -}; - -/** Render the center box with the main metrics */ -Piwik_Transitions.prototype.renderCenterBox = function () { - var box = this.centerBox; - - Piwik_Transitions_Util.replacePlaceholderInHtml( - box.find('.Transitions_Pageviews'), NumberFormatter.formatNumber(this.model.pageviews)); - - var self = this; - var showMetric = function (cssClass, modelProperty, highlightCurveOnSide, groupCanBeExpanded) { - var el = box.find('.Transitions_' + cssClass); - Piwik_Transitions_Util.replacePlaceholderInHtml(el, NumberFormatter.formatNumber(self.model[modelProperty])); - - if (self.model[modelProperty] == 0) { - el.addClass('Transitions_Value0'); - } else { - self.addTooltipShowingPercentageOfAllPageviews(el, modelProperty); - var groupName = cssClass.charAt(0).toLowerCase() + cssClass.slice(1); - el.hover(function () { - self.highlightGroup(groupName, highlightCurveOnSide); - }, function () { - self.unHighlightGroup(groupName, highlightCurveOnSide); - }); - if (groupCanBeExpanded) { - el.click(function () { - self.openGroup(highlightCurveOnSide, groupName); - }).css('cursor', 'pointer'); - } - } - }; - - showMetric('DirectEntries', 'directEntries', 'left', false); - showMetric('PreviousSiteSearches', 'previousSiteSearchesNbTransitions', 'left', true); - showMetric('PreviousPages', 'previousPagesNbTransitions', 'left', true); - showMetric('SearchEngines', 'searchEnginesNbTransitions', 'left', true); - showMetric('SocialNetworks', 'socialNetworksNbTransitions', 'left', true); - showMetric('AIAssistants', 'aiAssistantsNbTransitions', 'left', true); - showMetric('Websites', 'websitesNbTransitions', 'left', true); - showMetric('Campaigns', 'campaignsNbTransitions', 'left', true); - - showMetric('FollowingPages', 'followingPagesNbTransitions', 'right', true); - showMetric('FollowingSiteSearches', 'followingSiteSearchesNbTransitions', 'right', true); - showMetric('Outlinks', 'outlinksNbTransitions', 'right', true); - showMetric('Downloads', 'downloadsNbTransitions', 'right', true); - showMetric('Exits', 'exits', 'right', false); - - box.find('.Transitions_CenterBoxMetrics').show(); -}; - -Piwik_Transitions.prototype.addTooltipShowingPercentageOfAllPageviews = function (element, metric) { - var tip = Piwik_Transitions_Translations.XOfAllPageviews; - var percentage = this.model.getPercentage(metric, true); - tip = sprintf(tip, '' + percentage + ''); - - element.tooltip({ - track: true, - content: tip, - items: '*', - tooltipClass: 'Transitions_Tooltip_Small', - show: false, - hide: false - }); -}; - -/** Render the loops (i.e. page reloads) */ -Piwik_Transitions.prototype.renderLoops = function () { - if (this.model.loops == 0) { - return; - } - - var loops = this.popover.find('#Transitions_Loops').show(); - Piwik_Transitions_Util.replacePlaceholderInHtml(loops, NumberFormatter.formatNumber(this.model.loops)); - - this.addTooltipShowingPercentageOfAllPageviews(loops, 'loops'); - - this.canvas.renderLoops(this.model.getPercentage('loops')); - loops.css({marginTop: $('#Transitions_CenterBox').outerHeight() + 45}); -}; - -Piwik_Transitions.prototype.renderEntries = function (onlyBg) { - if (this.model.directEntries > 0) { - var self = this; - - var isHighlighted = this.highlightedGroup == 'directEntries'; - var gradient = this.canvas.createHorizontalGradient('entries', 'left', isHighlighted); - - this.canvas.renderBox({ - side: 'left', - onlyBg: onlyBg, - share: this.model.getPercentage('directEntries'), - gradient: gradient, - boxText: Piwik_Transitions_Translations.directEntries, - boxTextNumLines: 1, - boxTextCssClass: 'SingleLine', - smallBox: true, - onMouseOver: function () { - self.highlightGroup('directEntries', 'left'); - }, - onMouseOut: function () { - self.unHighlightGroup('directEntries', 'left'); - } - }); - this.canvas.addBoxSpacing(20, 'left'); - } -}; - -Piwik_Transitions.prototype.renderExits = function (onlyBg) { - if (this.model.exits > 0) { - var self = this; - - var isHighlighted = this.highlightedGroup == 'exits'; - var gradient = this.canvas.createHorizontalGradient('exits', 'right', isHighlighted); - - this.canvas.renderBox({ - side: 'right', - onlyBg: onlyBg, - share: this.model.getPercentage('exits'), - gradient: gradient, - boxText: Piwik_Transitions_Translations.exits, - boxTextNumLines: 1, - boxTextCssClass: 'SingleLine', - smallBox: true, - onMouseOver: function () { - self.highlightGroup('exits', 'right'); - }, - onMouseOut: function () { - self.unHighlightGroup('exits', 'right'); - } - }); - this.canvas.addBoxSpacing(20, 'right'); - } -}; - -/** Render the open group with the detailed data */ -Piwik_Transitions.prototype.renderOpenGroup = function (groupName, side, onlyBg) { - var self = this; - - // get data from the model - var nbTransitionsVarName = groupName + 'NbTransitions'; - var nbTransitions = self.model[nbTransitionsVarName]; - if (nbTransitions == 0) { - return; - } - - var totalShare = this.model.getPercentage(nbTransitionsVarName); - var details = self.model.getDetailsForGroup(groupName); - - // prepare gradients - var gradientItems = this.canvas.createHorizontalGradient('items', side); - var gradientOthers = this.canvas.createHorizontalGradient('others', side); - var gradientBackground = - this.canvas.createHorizontalGradient('background', side, groupName == this.highlightedGroup); - - // remember current offsets to reset them later for drawing the background - var boxPositionBefore, curvePositionBefore; - if (side == 'left') { - boxPositionBefore = this.canvas.leftBoxPositionY; - curvePositionBefore = this.canvas.leftCurvePositionY; - } else { - boxPositionBefore = this.canvas.rightBoxPositionY; - curvePositionBefore = this.canvas.rightCurvePositionY; - } - - // headline of the open group - var titleX, titleClass; - if (side == 'left') { - titleX = this.canvas.leftBoxBeginX + 10; - titleClass = 'BoxTextLeft'; - } else { - titleX = this.canvas.rightBoxBeginX - 1; - titleClass = 'BoxTextRight'; - } - if (!onlyBg) { - var groupTitle = self.model.getGroupTitle(groupName); - var titleEl = this.canvas.renderText(groupTitle, titleX, boxPositionBefore + 11, - [titleClass, 'TitleOfOpenGroup']); - titleEl.hover(function () { - self.highlightGroup(groupName, side); - }, function () { - self.unHighlightGroup(groupName, side); - }); - } - this.canvas.addBoxSpacing(34, side); - - // draw detail boxes - for (var i = 0; i < details.length; i++) { - var data = details[i]; - var label = (typeof data.url != 'undefined' ? data.url : data.label); - label = (typeof label != 'undefined' && label !== null ? label : ''); - var isOthers = (label == 'Others'); - var onClick = false; - if (!isOthers && (groupName == 'previousPages' || groupName == 'followingPages')) { - - if (this.showEmbeddedInReport) { - onClick = (function (url) { - return function () { - window.CoreHome.Matomo.postEvent('Transitions.switchTransitionsUrl', { - url: url, - }); - }; - })(label); - } else { - onClick = (function (url) { - return function () { - if (self.actionType == 'url') { - url = url.replace(/^(?!http)/, 'http://'); - } - self.reloadPopover(url); - }; - })(label); - } - - } else if (!isOthers && (groupName == 'outlinks' || groupName == 'websites' || groupName == 'downloads')) { - onClick = label - } - - var tooltip = Piwik_Transitions_Translations.XOfY; - tooltip = '' + sprintf(tooltip, data.referrals, nbTransitions) + ''; - tooltip = this.model.getShareInGroupTooltip(tooltip, groupName); - - var fullLabel = label; - var shortened = false; - if ((this.actionType == 'url' && (groupName == 'previousPages' || groupName == 'followingPages')) - || groupName == 'downloads') { - // remove http + www + domain for internal URLs - label = Piwik_Transitions_Util.shortenUrl(label, true); - shortened = true; - } else if (groupName == 'outlinks' || groupName == 'websites') { - // remove http + www for external URLs - label = Piwik_Transitions_Util.shortenUrl(label); - shortened = true; - } - - this.canvas.renderBox({ - side: side, - onlyBg: onlyBg, - share: data.percentage / 100 * totalShare, - gradient: isOthers ? gradientOthers : gradientItems, - boxText: label, - boxTextTooltip: isOthers || !shortened ? false : fullLabel, - boxTextNumLines: 3, - curveText: NumberFormatter.formatPercent(data.percentage), - curveTextTooltip: tooltip, - onClick: onClick - }); - } - - // draw background - var boxPositionAfter, curvePositionAfter; - if (side == 'left') { - boxPositionAfter = this.canvas.leftBoxPositionY; - curvePositionAfter = this.canvas.leftCurvePositionY; - this.canvas.leftBoxPositionY = boxPositionBefore; - this.canvas.leftCurvePositionY = curvePositionBefore; - } else { - boxPositionAfter = this.canvas.rightBoxPositionY; - curvePositionAfter = this.canvas.rightCurvePositionY; - this.canvas.rightBoxPositionY = boxPositionBefore; - this.canvas.rightCurvePositionY = curvePositionBefore; - } - - this.canvas.renderBox({ - side: side, - boxHeight: boxPositionAfter - boxPositionBefore - this.canvas.boxSpacing - 2, - curveHeight: curvePositionAfter - curvePositionBefore - this.canvas.curveSpacing, - gradient: gradientBackground, - bgCanvas: true - }); - - var spacing = this.canvas.isNarrowMode() ? 8 : 15; - this.canvas.addBoxSpacing(spacing, side); -}; - -/** Render a closed group without detailed data, only one box for the sum */ -Piwik_Transitions.prototype.renderClosedGroup = function (groupName, side, onlyBg) { - var self = this; - - var isHighlighted = groupName == this.highlightedGroup; - var gradient = this.canvas.createHorizontalGradient('closed-group', side, isHighlighted); - - var nbTransitionsVarName = groupName + 'NbTransitions'; - - if (self.model[nbTransitionsVarName] == 0) { - return; - } - - self.canvas.renderBox({ - side: side, - onlyBg: onlyBg, - share: self.model.getPercentage(nbTransitionsVarName), - gradient: gradient, - boxText: self.model.getGroupTitle(groupName), - boxTextNumLines: 1, - boxTextCssClass: 'SingleLine', - boxIcon: 'plugins/Morpheus/images/plus_blue.png', - smallBox: true, - onClick: function () { - self.unHighlightGroup(groupName, side); - self.openGroup(side, groupName); - }, - onMouseOver: function () { - self.highlightGroup(groupName, side); - }, - onMouseOut: function () { - self.unHighlightGroup(groupName, side); - } - }); -}; - -/** Reload the entire popover for a different URL */ -Piwik_Transitions.prototype.reloadPopover = function (url) { - if (this.rowAction) { - this.rowAction.openPopover(this.actionType + ':' + url); - } else { - this.reset(this.actionType, url); - this.showPopover(); - } -}; - -/** Redraw the left or right sides with a different group opened */ -Piwik_Transitions.prototype.openGroup = function (side, groupName) { - - this.canvas.clearSide(side); - - if (side == 'left') { - this.leftOpenGroup = groupName; - this.renderLeftSide(); - } else { - this.rightOpenGroup = groupName; - this.renderRightSide(); - } - - this.renderLoops(); - - this.canvas.truncateVisibleBoxTexts(); -}; - -/** Highlight a group: change curve color and highlight metric in the center box */ -Piwik_Transitions.prototype.highlightGroup = function (groupName, side) { - if (this.highlightedGroup == groupName) { - return; - } - if (this.highlightedGroup !== false) { - this.unHighlightGroup(this.highlightedGroup, this.highlightedGroupSide); - } - - this.highlightedGroup = groupName; - this.highlightedGroupSide = side; - - var cssClass = 'Transitions_' + groupName.charAt(0).toUpperCase() + groupName.slice(1); - this.highlightedGroupCenterEl = this.canvas.container.find('.' + cssClass); - this.highlightedGroupCenterEl.addClass('Transitions_Highlighted'); - - this.canvas.clearSide(side, true); - if (side == 'left') { - this.renderLeftSide(true); - } else { - this.renderRightSide(true); - } - this.renderLoops(); -}; - -/** Remove highlight after using highlightGroup() */ -Piwik_Transitions.prototype.unHighlightGroup = function (groupName, side) { - if (this.highlightedGroup === false) { - return; - } - - this.highlightedGroupCenterEl.removeClass('Transitions_Highlighted'); - - this.highlightedGroup = false; - this.highlightedGroupSide = false; - this.highlightedGroupCenterEl = false; - - this.canvas.clearSide(side, true); - if (side == 'left') { - this.renderLeftSide(true); - } else { - this.renderRightSide(true); - } - this.renderLoops(); -}; - -// -------------------------------------- -// CANVAS -// -------------------------------------- - -function Piwik_Transitions_Canvas(canvasBgLeft, canvasBgRight, canvasLeft, canvasRight, canvasLoops, width, height) { - - if (typeof window.G_vmlCanvasManager != "undefined") { - window.G_vmlCanvasManager.initElement(canvasBgLeft); - window.G_vmlCanvasManager.initElement(canvasBgRight); - window.G_vmlCanvasManager.initElement(canvasLeft); - window.G_vmlCanvasManager.initElement(canvasRight); - window.G_vmlCanvasManager.initElement(canvasLoops); - } - - if (!canvasBgLeft.getContext) { - alert('Your browser is not supported.'); - return; - } - - /** DOM element that contains the canvas */ - this.container = $(canvasBgLeft).parent().parent(); - - /** Drawing context of the canvases */ - this.contextBgLeft = canvasBgLeft.getContext('2d'); - this.contextBgRight = canvasBgRight.getContext('2d'); - this.contextLeft = canvasLeft.getContext('2d'); - this.contextRight = canvasRight.getContext('2d'); - this.contextLoops = canvasLoops.getContext('2d'); - - /** Width of the entire canvas */ - this.width = width; - /** Height of the entire canvas */ - this.height = height; - - /** Current Y positions */ - this.leftBoxPositionY = this.originalBoxPositionY = 0; - this.leftCurvePositionY = this.originalCurvePositionY = 110; - this.rightBoxPositionY = this.originalBoxPositionY; - this.rightCurvePositionY = this.originalCurvePositionY; - - /** Width of the rectangular box */ - this.boxWidth = 175; - /** Height of the rectangular box */ - this.boxHeight = 53; - /** Height of a smaller rectangular box */ - this.smallBoxHeight = 30; - /** Width of the curve that connects the boxes to the center */ - this.curveWidth = 170; - /** Line-height of the text */ - this.lineHeight = 14; - /** Spacing between rectangular boxes */ - this.boxSpacing = 7; - /** Spacing between the curves where they connect to the center */ - this.curveSpacing = 1.5; - - /** The total net height (without curve spacing) of the curves as they connect to the center */ - this.totalHeightOfConnections = 205; - - /** X positions of the left box - begin means left, end means right */ - this.leftBoxBeginX = 0; - this.leftCurveBeginX = this.leftBoxBeginX + this.boxWidth; - this.leftCurveEndX = this.leftCurveBeginX + this.curveWidth; - - /** X positions of the right box - begin means left, end means right */ - this.rightBoxEndX = this.width; - this.rightBoxBeginX = this.rightCurveEndX = this.rightBoxEndX - this.boxWidth; - this.rightCurveBeginX = this.rightCurveEndX - this.curveWidth; - - // load gradient colors from CSS - this.colors = {}; - - var transitionsColorNamespaces = ['entries', 'exits', 'background', 'closed-group', 'items', 'others', 'loops']; - var gradientColorNames = ['light', 'dark', 'light-highlighted', 'dark-highlighted']; - for (var i = 0; i != transitionsColorNamespaces.length; ++i) { - var namespace = 'transition-' + transitionsColorNamespaces[i]; - this.colors[namespace] = piwik.ColorManager.getColors(namespace, gradientColorNames); - } -} - -/** - * Activate narrow mode: draw groups a bit more compact in order to save space - * for more than 3 referrer groups. - */ -Piwik_Transitions_Canvas.prototype.narrowMode = function () { - this.smallBoxHeight = 26; - this.boxSpacing = 4; - this.narrowMode = true; -}; - -window.addEventListener('themeModeChange', function () { - if (Piwik_Transitions.currentInstance) { - Piwik_Transitions.currentInstance.refreshTheme(); - } -}); - -Piwik_Transitions_Canvas.prototype.isNarrowMode = function () { - return typeof this.narrowMode != 'undefined'; -}; - -/** - * Helper to create horizontal gradients - * - * @param {String} colorGroup - * @param {String} position left|right - * @param {Boolean} isHighlighted - */ -Piwik_Transitions_Canvas.prototype.createHorizontalGradient = function (colorGroup, position, isHighlighted) { - var fromX, toX, fromColor, toColor, lightColor, darkColor; - - colorGroup = 'transition-' + colorGroup; - if (isHighlighted) { - lightColor = this.colors[colorGroup]['light-highlighted']; - darkColor = this.colors[colorGroup]['dark-highlighted']; - } else { - lightColor = this.colors[colorGroup]['light']; - darkColor = this.colors[colorGroup]['dark']; - } - - if (position == 'left') { - // gradient is used to fill a box on the left - fromX = this.leftBoxBeginX + 50; - toX = this.leftCurveEndX - 20; - fromColor = lightColor; - toColor = darkColor; - } else { - // gradient is used to fill a box on the right - fromX = this.rightCurveBeginX + 20; - toX = this.rightBoxEndX - 50; - fromColor = darkColor; - toColor = lightColor; - } - - var gradient = this.contextBgLeft.createLinearGradient(fromX, 0, toX, 0); - gradient.addColorStop(0, fromColor); - gradient.addColorStop(1, toColor); - - return gradient; -}; - -/** Render text using a div inside the container */ -Piwik_Transitions_Canvas.prototype.renderText = function (text, x, y, cssClass, onClick, icon, maxLines) { - var div = this.addDomElement('div', 'Text'); - div.css({ - left: x + 'px', - top: y + 'px' - }); - if (icon) { - div.addClass('Transitions_HasBackground'); - div.css({backgroundImage: 'url(' + icon + ')'}); - } - if (cssClass) { - if (typeof cssClass == 'object') { - for (var i = 0; i < cssClass.length; i++) { - div.addClass('Transitions_' + cssClass[i]); - } - } else { - div.addClass('Transitions_' + cssClass); - } - } - var textContainer = div; - if (onClick) { - if (typeof onClick == 'function') { - div.css('cursor', 'pointer').hover(function () { - $(this).addClass('Transitions_Hover'); - },function () { - $(this).removeClass('Transitions_Hover'); - }).click(onClick); - } else { - var a = $(document.createElement('a')); - a.attr('href', onClick); - a.attr('rel', 'noreferrer noopener'); - a.attr('target', '_blank'); - div.append(a); - textContainer = a; - } - } - if (maxLines) { - textContainer.addClass('Transitions_ApplyTextAndTruncate').data('text', text); - } else { - textContainer.html(text); - } - return div; -}; - -/** Add a DOM element inside the container (as a sibling of the canvas) */ -Piwik_Transitions_Canvas.prototype.addDomElement = function (tagName, cssClass) { - var el = $(document.createElement('div')).addClass('Transitions_' + cssClass); - this.container.append(el); - return el; -}; - -/** - * Truncate box texts by replacing the middle part with ... - * This method looks for the class Transitions_ApplyTextAndTruncate. - * It then looks up data-text and truncates it until it fits. - */ -Piwik_Transitions_Canvas.prototype.truncateVisibleBoxTexts = function () { - this.container.find('.Transitions_ApplyTextAndTruncate').each(function () { - var container = $(this).html(''); - var span = container.find('span'); - - var text = container.data('text'); - span.html(piwikHelper.addBreakpointsToUrl(text)); - - var divHeight = container.innerHeight(); - if (container.data('maxLines')) { - divHeight = container.data('maxLines') * (parseInt(container.css('lineHeight'), 10) + .2); - } - - var leftPart = false; - var rightPart = false; - - while (divHeight < span.outerHeight()) { - if (leftPart === false) { - var middle = Math.round(text.length / 2); - leftPart = text.substring(0, middle); - rightPart = text.substring(middle, text.length); - } - leftPart = leftPart.substring(0, leftPart.length - 2); - rightPart = rightPart.substring(2, rightPart.length); - text = leftPart + '...' + rightPart; - span.html(piwikHelper.addBreakpointsToUrl(text)); - } - }); -}; - -/** - * Render a box. - * This method automatically keeps track of the current position. - * - * PARAMS (pass as object): - * side: left or right - * share: of the box in the total amount of incoming transitions - * gradient: for filling the box - * boxText: to be placed inside the box (optional) - * boxTextNumLines: the number of lines to be placed in the box (optional) - * boxTextCssClass: for divs containing the texts (optional) - * boxTextTooltip: text for a tooltip this is when hovering the box text (optional) - * curveText: to be placed where the curve begins (optional) - * curveTextTooltip: text for a tooltip that is shown when hovering the curve text (optional) - * smallBox: use this.smallBoxHeight instead of this.boxHeight (optional) - * boxIcon: path to an icon that is put in front of the text (optional) - * onClick: click callback for the text in the box (optional) - * onMouseOver: mouse over callback for the text in the box (optional) - * onMouseOut: mouse over callback for the text in the box (optional) - * onlyBg: render only the background, not the text; used for highlighting (optional) - * - * Only used for background: - * curveHeight: fix height in px instead of share - * boxHeight: fix box height in px - * bgCanvas: true to draw on background canvas - */ -Piwik_Transitions_Canvas.prototype.renderBox = function (params) { - var curveHeight = params.curveHeight ? params.curveHeight : - Math.round(this.totalHeightOfConnections * params.share); - curveHeight = Math.max(curveHeight, 1); - - var boxHeight = this.boxHeight; - if (params.smallBox) { - boxHeight = this.smallBoxHeight; - } - if (params.boxHeight) { - boxHeight = params.boxHeight; - } - - var context; - if (params.bgCanvas) { - context = params.side == 'left' ? this.contextBgLeft : this.contextBgRight; - } else { - context = params.side == 'left' ? this.contextLeft : this.contextRight; - } - - // background - context.fillStyle = params.gradient; - context.beginPath(); - if (params.side == 'left') { - this.renderLeftBoxBg(context, boxHeight, curveHeight); - } else { - this.renderRightBoxBg(context, boxHeight, curveHeight); - } - if (typeof context.endPath == 'function') { - context.endPath(); - } - - // text inside the box - if (params.boxText && !params.onlyBg) { - var onClick = params.onClick; - var boxTextLeft, boxTextTop, el; - if (params.side == 'left') { - boxTextLeft = this.leftBoxBeginX + 10; - boxTextTop = this.leftBoxPositionY + boxHeight / 2 - params.boxTextNumLines * this.lineHeight / 2; - el = this.renderText(params.boxText, boxTextLeft, boxTextTop, 'BoxTextLeft', onClick, params.boxIcon, - params.boxTextNumLines); - } else { - boxTextLeft = this.rightBoxBeginX; - boxTextTop = this.rightBoxPositionY + boxHeight / 2 - params.boxTextNumLines * this.lineHeight / 2; - el = this.renderText(params.boxText, boxTextLeft, boxTextTop, 'BoxTextRight', onClick, params.boxIcon, - params.boxTextNumLines); - } - if (params.boxTextCssClass) { - el.addClass('Transitions_' + params.boxTextCssClass); - } - // tooltip - if (params.boxTextTooltip) { - var tip = piwikHelper.addBreakpointsToUrl(params.boxTextTooltip); - el.tooltip({ - track: true, - content: tip, - items: '*', - tooltipClass: 'Transitions_Tooltip_Small', - show: false, - hide: false - }); - } - if (typeof params.onMouseOver == 'function') { - el.mouseenter(params.onMouseOver); - } - if (typeof params.onMouseOut == 'function') { - el.mouseleave(params.onMouseOut); - } - } - - // text at the beginning of the curve - if (params.curveText && !params.onlyBg) { - var curveTextLeft, curveTextTop; - if (params.side == 'left') { - curveTextLeft = this.leftBoxBeginX + this.boxWidth + 3; - curveTextTop = this.leftBoxPositionY + boxHeight / 2 - this.lineHeight / 2; - } else { - curveTextLeft = this.rightBoxBeginX - 37; - curveTextTop = this.rightBoxPositionY + boxHeight / 2 - this.lineHeight / 2; - } - var textDiv = this.renderText(params.curveText, curveTextLeft, curveTextTop, - params.side == 'left' ? 'CurveTextLeft' : 'CurveTextRight'); - // tooltip - if (params.curveTextTooltip) { - textDiv.tooltip({ - track: true, - content: params.curveTextTooltip, - items: '*', - tooltipClass: 'Transitions_Tooltip_Small', - show: false, - hide: false - }); - } - } - - if (params.side == 'left') { - this.leftBoxPositionY += boxHeight + this.boxSpacing; - this.leftCurvePositionY += curveHeight + this.curveSpacing; - } else { - this.rightBoxPositionY += boxHeight + this.boxSpacing; - this.rightCurvePositionY += curveHeight + this.curveSpacing; - } -}; - -Piwik_Transitions_Canvas.prototype.renderLeftBoxBg = function (context, boxHeight, curveHeight) { - // derive coordinates for ths curve - var leftUpper = {x: this.leftCurveBeginX, y: this.leftBoxPositionY}; - var leftLower = {x: this.leftCurveBeginX, y: this.leftBoxPositionY + boxHeight}; - var rightUpper = {x: this.leftCurveEndX, y: this.leftCurvePositionY}; - var rightLower = {x: this.leftCurveEndX, y: this.leftCurvePositionY + curveHeight}; - - // derive control points for bezier curve - var center = (this.leftCurveBeginX + this.leftCurveEndX) / 2; - var cp1Upper = {x: center, y: leftUpper.y}; - var cp2Upper = {x: center, y: rightUpper.y}; - var cp1Lower = {x: center, y: rightLower.y}; - var cp2Lower = {x: center, y: leftLower.y}; - - // the flow - context.moveTo(leftUpper.x, leftUpper.y); - context.bezierCurveTo(cp1Upper.x, cp1Upper.y, cp2Upper.x, cp2Upper.y, rightUpper.x, rightUpper.y); - context.lineTo(rightLower.x, rightLower.y); - context.bezierCurveTo(cp1Lower.x, cp1Lower.y, cp2Lower.x, cp2Lower.y, leftLower.x, leftLower.y); - - // the box - context.lineTo(leftLower.x - this.boxWidth + 2, leftLower.y); - context.lineTo(leftLower.x - this.boxWidth, leftUpper.y); - context.lineTo(leftUpper.x, leftUpper.y); - context.fill(); -}; - -Piwik_Transitions_Canvas.prototype.renderRightBoxBg = function (context, boxHeight, curveHeight) { - // derive coordinates for curve - var leftUpper = {x: this.rightCurveBeginX, y: this.rightCurvePositionY}; - var leftLower = {x: this.rightCurveBeginX, y: this.rightCurvePositionY + curveHeight}; - var rightUpper = {x: this.rightCurveEndX, y: this.rightBoxPositionY}; - var rightLower = {x: this.rightCurveEndX, y: this.rightBoxPositionY + boxHeight}; - - // derive control points for bezier curve - var center = (this.rightCurveBeginX + this.rightCurveEndX) / 2; - var cp1Upper = {x: center, y: leftUpper.y}; - var cp2Upper = {x: center, y: rightUpper.y}; - var cp1Lower = {x: center, y: rightLower.y}; - var cp2Lower = {x: center, y: leftLower.y}; - - // the flow part 1 - context.moveTo(leftUpper.x, leftUpper.y); - context.bezierCurveTo(cp1Upper.x, cp1Upper.y, cp2Upper.x, cp2Upper.y, rightUpper.x, rightUpper.y); - - // the box - context.lineTo(rightUpper.x + this.boxWidth, rightUpper.y); - context.lineTo(rightLower.x + this.boxWidth - 2, rightLower.y); - context.lineTo(rightLower.x, rightLower.y); - - // the flow part 2 - context.bezierCurveTo(cp1Lower.x, cp1Lower.y, cp2Lower.x, cp2Lower.y, leftLower.x, leftLower.y); - context.lineTo(leftUpper.x, leftUpper.y); - context.fill(); -}; - -/** Add spacing after the current box */ -Piwik_Transitions_Canvas.prototype.addBoxSpacing = function (spacing, side) { - if (side == 'left') { - this.leftBoxPositionY += spacing; - } else { - this.rightBoxPositionY += spacing; - } -}; - -Piwik_Transitions_Canvas.prototype.renderLoops = function (share) { - var curveHeight = Math.round(this.totalHeightOfConnections * share); - curveHeight = Math.max(curveHeight, 1); - - // create gradient - var gradient = this.contextLoops.createLinearGradient(this.leftCurveEndX - 50, 0, this.rightCurveBeginX + 50, 0); - var light = this.colors['transition-loops']['light']; - var dark = this.colors['transition-loops']['dark']; - gradient.addColorStop(0, dark); - gradient.addColorStop(.5, light); - gradient.addColorStop(1, dark); - - this.contextLoops.fillStyle = gradient; - - this.contextLoops.beginPath(); - - // curve from the upper left connection to the center box to the lower left connection to the text box - var point1 = {x: this.leftCurveEndX, y: this.leftCurvePositionY}; - var point2 = {x: this.leftCurveEndX, y: $('#Transitions_CenterBox').outerHeight() + 70}; - - var cpLeftX = (this.leftCurveBeginX + this.leftCurveEndX) / 2 + 30; - var cp1 = {x: cpLeftX, y: point1.y}; - var cp2 = {x: cpLeftX, y: point2.y}; - - this.contextLoops.moveTo(point1.x, point1.y); - this.contextLoops.bezierCurveTo(cp1.x, cp1.y, cp2.x, cp2.y, point2.x, point2.y); - - // lower line of text box - var point3 = {x: this.rightCurveBeginX, y: point2.y}; - this.contextLoops.lineTo(point3.x, point3.y); - - // curve to upper right connection to the center box - var point4 = {x: this.rightCurveBeginX, y: this.rightCurvePositionY}; - var cpRightX = (this.rightCurveBeginX + this.rightCurveEndX) / 2 - 30; - var cp3 = {x: cpRightX, y: point3.y}; - var cp4 = {x: cpRightX, y: point4.y}; - this.contextLoops.bezierCurveTo(cp3.x, cp3.y, cp4.x, cp4.y, point4.x, point4.y); - - // line to lower right connection to the center box - var point5 = {x: point4.x, y: point4.y + curveHeight}; - this.contextLoops.lineTo(point5.x, point5.y); - - // curve to upper right connection to the text box - var point6 = {x: point5.x, y: point2.y - 25}; - cpRightX -= 30; - var cp5 = {x: cpRightX, y: point5.y}; - var cp6 = {x: cpRightX, y: point6.y}; - this.contextLoops.bezierCurveTo(cp5.x, cp5.y, cp6.x, cp6.y, point6.x, point6.y); - - // upper line of the text box - var point7 = {x: point1.x, y: point6.y}; - this.contextLoops.lineTo(point7.x, point7.y); - - // line to lower left connection to the center box - var point8 = {x: point1.x, y: point1.y + curveHeight}; - cpLeftX += 30; - var cp7 = {x: cpLeftX, y: point7.y}; - var cp8 = {x: cpLeftX, y: point8.y}; - this.contextLoops.bezierCurveTo(cp7.x, cp7.y, cp8.x, cp8.y, point8.x, point8.y); - - this.contextLoops.fill(); - - if (typeof this.contextLoops.endPath == 'function') { - this.contextLoops.endPath(); - } - -}; - -/** Clear one side for redrawing */ -Piwik_Transitions_Canvas.prototype.clearSide = function (side, onlyBg) { - if (side == 'left') { - this.contextBgLeft.clearRect(0, 0, this.width, this.height); - this.contextLeft.clearRect(0, 0, this.width, this.height); - } else { - this.contextBgRight.clearRect(0, 0, this.width, this.height); - this.contextRight.clearRect(0, 0, this.width, this.height); - } - this.contextLoops.clearRect(0, 0, this.width, this.height); - - if (side == 'left') { - if (!onlyBg) { - this.container.find('.Transitions_BoxTextLeft').remove(); - this.container.find('.Transitions_CurveTextLeft').remove(); - } - this.leftBoxPositionY = this.originalBoxPositionY; - this.leftCurvePositionY = this.originalCurvePositionY; - } else { - if (!onlyBg) { - this.container.find('.Transitions_BoxTextRight').remove(); - this.container.find('.Transitions_CurveTextRight').remove(); - } - this.rightBoxPositionY = this.originalBoxPositionY; - this.rightCurvePositionY = this.originalCurvePositionY; - } -}; - -// -------------------------------------- -// MODEL -// -------------------------------------- - -function Piwik_Transitions_Model(ajax) { - this.ajax = ajax; - - this.groupTitles = {}; -} - -Piwik_Transitions_Model.prototype.htmlLoaded = function () { - this.groupTitles.previousPages = Piwik_Transitions_Translations.fromPreviousPages; - this.groupTitles.previousSiteSearches = Piwik_Transitions_Translations.fromPreviousSiteSearches; - this.groupTitles.followingPages = Piwik_Transitions_Translations.toFollowingPages; - this.groupTitles.followingSiteSearches = Piwik_Transitions_Translations.toFollowingSiteSearches; - this.groupTitles.outlinks = Piwik_Transitions_Translations.outlinks; - this.groupTitles.downloads = Piwik_Transitions_Translations.downloads; - - this.shareInGroupTexts = { - previousPages: Piwik_Transitions_Translations.fromPreviousPagesInline, - previousSiteSearches: Piwik_Transitions_Translations.fromPreviousSiteSearchesInline, - followingPages: Piwik_Transitions_Translations.toFollowingPagesInline, - followingSiteSearches: Piwik_Transitions_Translations.toFollowingSiteSearchesInline, - searchEngines: Piwik_Transitions_Translations.fromSearchEnginesInline, - socialNetworks: Piwik_Transitions_Translations.fromSocialNetworksInline, - aiAssistants: Piwik_Transitions_Translations.fromAIAssistantsInline, - websites: Piwik_Transitions_Translations.fromWebsitesInline, - campaigns: Piwik_Transitions_Translations.fromCampaignsInline, - outlinks: Piwik_Transitions_Translations.outlinksInline, - downloads: Piwik_Transitions_Translations.downloadsInline - }; -}; - -Piwik_Transitions_Model.prototype.loadData = function (actionType, actionName, overrideParams, callback) { - var self = this; - - this.pageviews = 0; - this.exits = 0; - this.loops = 0; - - this.directEntries = 0; - - this.searchEnginesNbTransitions = 0; - this.searchEngines = []; - - this.socialNetworksNbTransitions = 0; - this.socialNetworks = []; - - this.aiAssistantsNbTransitions = 0; - this.aiAssistants = []; - - this.websitesNbTransitions = 0; - this.websites = []; - - this.campaignsNbTransitions = 0; - this.campaigns = []; - - this.previousPagesNbTransitions = 0; - this.previousPages = []; - - this.followingPagesNbTransitions = 0; - this.followingPages = []; - - this.downloadsNbTransitions = 0; - this.downloads = []; - - this.outlinksNbTransitions = 0; - this.outlinks = []; - - this.previousSiteSearchesNbTransitions = 0; - this.previousSiteSearches = []; - - this.followingSiteSearchesNbTransitions = 0; - this.followingSiteSearches = []; - - this.date = ''; - - var params = { - actionType: actionType, - actionName: actionName, - expanded: 1 - }; - if (overrideParams) { - $.extend(params, overrideParams); - } - - this.ajax.callApi('Transitions.getTransitionsForAction', params, - function (report) { - self.date = report.date; - - // load page metrics - self.pageviews = report.pageMetrics.pageviews; - self.loops = report.pageMetrics.loops; - self.exits = report.pageMetrics.exits; - - // load referrers: split direct entries and others - for (var i = 0; i < report.referrers.length; i++) { - var referrer = report.referrers[i]; - if (referrer.shortName == 'direct') { - self.directEntries = referrer.visits; - } else if (referrer.shortName == 'search') { - self.searchEnginesNbTransitions = referrer.visits; - self.searchEngines = referrer.details; - self.groupTitles.searchEngines = referrer.label; - } else if (referrer.shortName == 'social') { - self.socialNetworksNbTransitions = referrer.visits; - self.socialNetworks = referrer.details; - self.groupTitles.socialNetworks = referrer.label; - } else if (referrer.shortName == 'ai') { - self.aiAssistantsNbTransitions = referrer.visits; - self.aiAssistants = referrer.details; - self.groupTitles.aiAssistants = referrer.label; - } else if (referrer.shortName == 'website') { - self.websitesNbTransitions = referrer.visits; - self.websites = referrer.details; - self.groupTitles.websites = referrer.label; - } else if (referrer.shortName == 'campaign') { - self.campaignsNbTransitions = referrer.visits; - self.campaigns = referrer.details; - self.groupTitles.campaigns = referrer.label; - } - } - - self.loadAndSumReport(report, 'previousPages'); - self.loadAndSumReport(report, 'previousSiteSearches'); - self.loadAndSumReport(report, 'followingPages'); - self.loadAndSumReport(report, 'followingSiteSearches'); - self.loadAndSumReport(report, 'downloads'); - self.loadAndSumReport(report, 'outlinks'); - - if (typeof Piwik_Transitions_Model.totalNbPageviews == 'undefined') { - Piwik_Transitions_Model.totalNbPageviews = false; - self.ajax.loadTotalNbPageviews(function (nbPageviews) { - Piwik_Transitions_Model.totalNbPageviews = nbPageviews; - }); - } - - callback(); - }); -}; - -Piwik_Transitions_Model.prototype.loadAndSumReport = function (apiData, reportName) { - var data = this[reportName] = apiData[reportName]; - var sumVarName = reportName + 'NbTransitions'; - - this[sumVarName] = 0; - for (var i = 0; i < data.length; i++) { - this[sumVarName] += data[i].referrals; - } -}; - -Piwik_Transitions_Model.prototype.getTotalNbPageviews = function () { - if (typeof Piwik_Transitions_Model.totalNbPageviews == 'undefined') { - return false; - } - return Piwik_Transitions_Model.totalNbPageviews; -}; - -Piwik_Transitions_Model.prototype.getGroupTitle = function (groupName) { - if (typeof this.groupTitles[groupName] != 'undefined') { - return this.groupTitles[groupName]; - } - return groupName; -}; - -Piwik_Transitions_Model.prototype.getShareInGroupTooltip = function (share, groupName) { - var tip = this.shareInGroupTexts[groupName]; - return sprintf(tip, share); -}; - -Piwik_Transitions_Model.prototype.getDetailsForGroup = function (groupName) { - return this.addPercentagesToData(this[groupName]); -}; - -Piwik_Transitions_Model.prototype.getPercentage = function (metric, formatted) { - var percentage = (this.pageviews == 0 ? 0 : this[metric] / this.pageviews); - - if (formatted) { - - percentage = this.roundPercentage(percentage); - return NumberFormatter.formatPercent(percentage); - } - - return percentage; -}; - -Piwik_Transitions_Model.prototype.addPercentagesToData = function (data) { - var total = 0; - - for (var i = 0; i < data.length; i++) { - total += parseInt(data[i].referrals, 10); - } - - for (i = 0; i < data.length; i++) { - data[i].percentage = this.roundPercentage(data[i].referrals / total); - } - - return data; -}; - -Piwik_Transitions_Model.prototype.roundPercentage = function (value) { - if (value < .1) { - return Math.round(value * 1000) / 10.0; - } else { - return Math.round(value * 100); - } -}; - -// -------------------------------------- -// AJAX -// -------------------------------------- - -function Piwik_Transitions_Ajax() { -} - -Piwik_Transitions_Ajax.prototype.loadTotalNbPageviews = function (callback) { - this.callApi('Actions.get', { - columns: 'nb_pageviews' - }, function (response) { - var value = typeof response.value != 'undefined' ? response.value : false; - callback(value); - }); -}; - -Piwik_Transitions_Ajax.prototype.callTransitionsController = function (action, callback) { - var ajaxRequest = new ajaxHelper(); - ajaxRequest.addParams({ - module: 'Transitions', - action: action - }, 'get'); - ajaxRequest.setCallback(callback); - ajaxRequest.setFormat('html'); - ajaxRequest.send(); -}; - -Piwik_Transitions_Ajax.prototype.callApi = function (method, params, callback) { - var self = this; - - params.format = 'JSON'; - params.module = 'API'; - params.method = method; - params.filter_limit = '-1'; - - var ajaxRequest = new ajaxHelper(); - ajaxRequest.addParams(params, 'get'); - ajaxRequest.useCallbackInCaseOfError(); - ajaxRequest.setCallback( - function (result) { - if (typeof result.result != 'undefined' && result.result == 'error') { - var errorName = result.message; - var showError = function () { - var errorTitle, errorMessage, errorBack; - if (typeof Piwik_Transitions_Translations[errorName] == 'undefined') { - errorTitle = 'Exception'; - errorMessage = errorName; - errorBack = '<<<'; - } else { - errorTitle = Piwik_Transitions_Translations[errorName]; - errorMessage = Piwik_Transitions_Translations[errorName + 'Details']; - errorBack = Piwik_Transitions_Translations[errorName + 'Back']; - } - - if (typeof params.actionName != 'undefined') { - var url = params.actionName; - url = piwikHelper.addBreakpointsToUrl(url); - errorTitle = sprintf(errorTitle, '' + url + ''); - } - - errorMessage = sprintf(errorMessage, '
'); - var inlineErrorNode = $('#Transitions_Error_Container'); - if (inlineErrorNode.length) { - // viewing it as report, not popover - inlineErrorNode.html(''); - var theContentNode = $(document.createElement('div')).addClass('Piwik_Popover_Error'); - - var p = $(document.createElement('p')).addClass('Piwik_Popover_Error_Title'); - theContentNode.append(p.html(errorTitle)); - - if (errorMessage) { - p = $(document.createElement('p')).addClass('Piwik_Popover_Error_Message'); - theContentNode.append(p.html(errorMessage)); - } - inlineErrorNode.append(theContentNode); - inlineErrorNode.show(); - $('#transitions_report .popoverContainer').hide(); - } else { - Piwik_Popover.showError(errorTitle, errorMessage, errorBack); - } - - $('#transitions_inline_loading').hide(); - }; - - if (typeof Piwik_Transitions_Translations == 'undefined') { - self.callApi('Transitions.getTranslations', {}, function (response) { - if (typeof response == 'object') { - Piwik_Transitions_Translations = response; - } else { - Piwik_Transitions_Translations = {}; - } - showError(); - }); - } else { - showError(); - } - } - else { - callback(result); - } - } - ); - ajaxRequest.send(); -}; - -// -------------------------------------- -// STATIC UTIL FUNCTIONS -// -------------------------------------- - -Piwik_Transitions_Util = { - - /** - * Removes protocol, www and trailing slashes from a URL. - * If removeDomain is set, the domain is removed as well. - */ - shortenUrl: function (url, removeDomain) { - if (url == 'Others') { - return url; - } - - var urlBackup = url; - url = url.replace(/http(s)?:\/\/(www\.)?/, ''); - - if (urlBackup == url) { - return url; - } - - if (removeDomain) { - url = url.replace(/[^\/]*/, ''); - if (url == '/') { - url = urlBackup; - } - } - - url = url.replace(/\/$/, ''); - - return url; - }, - - /** - * Replaces a %s placeholder in the HTML. - * The special feature is that it can be called multiple times, replacing the already - * replaced placeholder again. It creates a span that can be assigned a class using the - * spanClass parameter. The default class is 'Transitions_Metric'. - */ - replacePlaceholderInHtml: function (container, value, spanClass) { - var span = container.find('span'); - if (!span.length) { - var html = container.html().replace(/%s/, ''); - span = container.html(html).find('span'); - if (!spanClass) { - spanClass = 'Transitions_Metric'; - } - span.addClass(spanClass); - } - span.html(value); - } - -}; diff --git a/plugins/Transitions/lang/am.json b/plugins/Transitions/lang/am.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/am.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/ar.json b/plugins/Transitions/lang/ar.json deleted file mode 100644 index c186c3e24f0a74b52f00fe914402f62e16f53300..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ar.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Transitions": { - "TransitionsSubcategoryHelp2": "تفاصيل أكثر" - } -} diff --git a/plugins/Transitions/lang/az.json b/plugins/Transitions/lang/az.json deleted file mode 100644 index 09813de36553c3c5f95fdf9ad6b6996b1ab653cb..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/az.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Transitions": { - "TransitionsSubcategoryHelp2": "Daha ətraflı" - } -} diff --git a/plugins/Transitions/lang/be.json b/plugins/Transitions/lang/be.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/be.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/bg.json b/plugins/Transitions/lang/bg.json deleted file mode 100644 index b81ce7949a7a60b645e67ae1e8b5db0be384a0f5..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/bg.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Знаехте ли? Преходите също са налични като действие на ред в следните отчети:", - "AvailableInOtherReports2": "Стартирайте преходите, като кликнете върху тяхната икона (%s), след като задържите курсора на мишката върху ред в който и да е от тези отчети.", - "BouncesInline": "%s еднократни посещения", - "DirectEntries": "Директни посещения", - "ErrorBack": "Върнете се на предишната страница", - "ExitsInline": "%s изходи", - "FeatureDescription": "Преходите са отчет, показващ нещата, които Вашите посетители са направили директно преди и след разглеждане на дадена страница. Тази страница обяснява как да получите достъп, разберете и използвате мощния отчет „Преходи“.", - "FromCampaigns": "От кампании", - "FromPreviousPages": "От вътрешни страници", - "FromPreviousPagesInline": "%s от вътреши страници", - "FromPreviousSiteSearches": "От вътрешни търсения", - "FromPreviousSiteSearchesInline": "%s от вътрешни търсения", - "FromSearchEngines": "От търсачки", - "FromSocialNetworks": "От социални мрежи", - "FromWebsites": "От уебсайтове", - "IncomingTraffic": "Входящ трафик", - "LoopsInline": "%s страница се презарежда", - "NoDataForAction": "Няма информация за %s", - "NoDataForActionDetails": "Действието или не е имало показвания на страници през периода, или е невалидно.", - "NumDownloads": "%s изтегляния", - "NumOutlinks": "%s препращания", - "NumPageviews": "%s показвания на страници", - "OutgoingTraffic": "Изходящ трафик", - "PageURLTransitions": "URL преходи на страницата", - "PeriodNotAllowed": "Изберете валиден период от време", - "PeriodNotAllowedDetails": "Опитайте да изберете период с по-малко дни за тази функция.", - "PluginDescription": "Отчита предишни и следващи действия за всеки URL адрес на страница в нов отчет „Преходи“, достъпен в отчетите „Действия“ чрез нова икона.", - "ShareOfAllPageviews": "Тази страница има %1$s разглеждания (от всички %2$s разглеждания)", - "ToFollowingPages": "Към вътрешни страници", - "ToFollowingPagesInline": "%s за вътрешни страници", - "ToFollowingSiteSearches": "Външни търсения", - "ToFollowingSiteSearchesInline": "%s вътрешни търсения", - "TopX": "Топ %s етикети", - "Transitions": "Преходи", - "TransitionsSubcategoryHelp1": "Преходите са отчет, показващ нещата, които Вашите посетители са направили директно преди и след разглеждане на дадена страница. Тази страница обяснява как да получите достъп, разберете и използвате мощния отчет „Преходи“.", - "TransitionsSubcategoryHelp2": "Повече детайли", - "XOfAllPageviews": "%s на всички показания за тази страница", - "XOutOfYVisits": "%1$s (от %2$s)" - } -} diff --git a/plugins/Transitions/lang/bn.json b/plugins/Transitions/lang/bn.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/bn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/bs.json b/plugins/Transitions/lang/bs.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/bs.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/ca.json b/plugins/Transitions/lang/ca.json deleted file mode 100644 index 97bc6472568505211065491ab82226d26cdae40d..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ca.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Ho sabies? Les transicions també estan disponibles com a acció de fila als informes següents:", - "AvailableInOtherReports2": "Inicieu les transicions fent clic a la seva icona (%s) després de passar el cursor per una fila en qualsevol d'aquests informes.", - "BouncesInline": "%s rebots", - "DirectEntries": "Entrades directes", - "ErrorBack": "Ves a l'acció anterior", - "ExitsInline": "%s surts", - "FeatureDescription": "Transicions és un informe que mostra les coses que van fer els vostres visitants directament abans i després de veure una pàgina determinada. Aquesta pàgina explica com accedir, entendre i utilitzar el potent informe \"Transicions\".", - "FromAIAssistants": "Dels assistents d'IA", - "FromCampaigns": "De campanyes", - "FromPreviousPages": "Des de pàgines internes", - "FromPreviousPagesInline": "%s de pàgines internes", - "FromPreviousSiteSearches": "De la cerca interna", - "FromPreviousSiteSearchesInline": "%s de la cerques internes", - "FromSearchEngines": "De cercadors", - "FromSocialNetworks": "De xarxes socials", - "FromWebsites": "De llocs web", - "IncomingTraffic": "Tràfic entrant", - "LoopsInline": "%s refrescos de pàgina", - "NoDataForAction": "Sense informació per %s", - "NoDataForActionDetails": "O l'acció no ha estat vista cap vegada durant el període o és invàlida.", - "NumDownloads": "%s descàrregues", - "NumOutlinks": "%s enllaços sortints", - "NumPageviews": "%s pàgines vistes", - "OutgoingTraffic": "Trànsit sortint", - "PageURLTransitions": "Transicions d'URL de pàgina", - "PeriodNotAllowed": "Seleccioneu un període de temps vàlid", - "PeriodNotAllowedDetails": "Proveu de seleccionar un període amb menys dies per a aquesta funció.", - "PluginDescription": "Informa de les accions anteriors i posteriors per a cada URL de pàgina en un informe de Transicions nou, disponible als informes d'Accions mitjançant una icona nova.", - "ShareOfAllPageviews": "Aquesta pàgina ha tingut %1$s visites (%2$s de totes les visites)", - "ToFollowingPages": "A pàgines internes", - "ToFollowingPagesInline": "%s a pàgines internes", - "ToFollowingSiteSearches": "Cerques internes", - "ToFollowingSiteSearchesInline": "%s cerques internes", - "TopX": "Top %s d'etiquetes", - "Transitions": "Transicions", - "TransitionsSubcategoryHelp1": "Transicions és un informe que mostra les coses que van fer els vostres visitants directament abans i després de veure una pàgina determinada. Aquesta pàgina explica com accedir, entendre i utilitzar el potent informe \"Transicions\".", - "TransitionsSubcategoryHelp2": "Més detalls", - "XOfAllPageviews": "%s de totes les visualitzacions d'aquesta pàgina", - "XOutOfYVisits": "%1$s (de %2$s)" - } -} diff --git a/plugins/Transitions/lang/cs.json b/plugins/Transitions/lang/cs.json deleted file mode 100644 index 723913b14c52ba38ae34e5c5a7641ce71e7d283c..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/cs.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Věděl jsi, že Transitions jsou k dispozici také ve formě řady akcí v následujících přehledech:", - "AvailableInOtherReports2": "Jednoduše umístěte kurzor na některý z těchto přehledů a kliknutím na transition ikonu %s jej spusťte.", - "BouncesInline": "%s okamžitých opuštění stránky", - "DirectEntries": "Přímé vstupy", - "ErrorBack": "Přejít k předchozí akci", - "ExitsInline": "%s odchody", - "FeatureDescription": "Transitions vám poskytuje přehled, který ukazuje akce, které vaši návštěvníci provedli přímo před a po zobrazení určité stránky. Tato stránka vysvětlí, jak přistupovat, porozumět a používat Transitions přehledy.", - "FromCampaigns": "Z kampaní", - "FromPreviousPages": "Z interních stránek", - "FromPreviousPagesInline": "%s z interních stránek", - "FromPreviousSiteSearches": "Z interního vyhledávání", - "FromPreviousSiteSearchesInline": "%s z interních vyhledávání", - "FromSearchEngines": "Z vyhledávačů", - "FromSocialNetworks": "Ze sociálních sítí", - "FromWebsites": "Z webových stránek", - "IncomingTraffic": "Příchozí traffic", - "LoopsInline": "%s obnovení stránky", - "NoDataForAction": "Pro %s nejsou žádná data", - "NoDataForActionDetails": "Buď akce neměla za období žádné zobrazení stránky, nebo je neplatná.", - "NumDownloads": "%s stažení", - "NumOutlinks": "%s externích odkazů", - "NumPageviews": "%s zobrazení stránky", - "OutgoingTraffic": "Odchozí traffic", - "PageURLTransitions": "Transitions URL stránky", - "PluginDescription": "Zobrazuje předchozí a následující akce pro každou adresu URL v novém přechodovém přehledu, který je k dispozici v přehledech akcí prostřednictvím nové ikony.", - "ShareOfAllPageviews": "Tato stránka měla %1$s zobrazení (%2$s všech zobrazení)", - "ToFollowingPages": "Na interní stránky", - "ToFollowingPagesInline": "%s na interní stránky", - "ToFollowingSiteSearches": "Interní vyhledávání", - "ToFollowingSiteSearchesInline": "%s interních vyhledávání", - "TopX": "Top %s štítky", - "Transitions": "Transitions", - "TransitionsSubcategoryHelp1": "Transitions vám poskytuje přehled, který ukazuje akce, které vaši návštěvníci provedli přímo před a po zobrazení určité stránky. Tato stránka vysvětlí, jak přistupovat, porozumět a používat Transitions přehledy.", - "TransitionsSubcategoryHelp2": "Více podrobností", - "XOfAllPageviews": "%s ze všech zobrazení této stránky", - "XOutOfYVisits": "%1$s (z %2$s)" - } -} diff --git a/plugins/Transitions/lang/cy.json b/plugins/Transitions/lang/cy.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/cy.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/da.json b/plugins/Transitions/lang/da.json deleted file mode 100644 index a34b92f9f3af6dd41eeb58c516d604520e99d630..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/da.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s afvisninger", - "DirectEntries": "Direkte besøg", - "ErrorBack": "Gå tilbage til forrige handling", - "ExitsInline": "%s afslutninger", - "FeatureDescription": "Overgange giver dig en rapport over, hvad dine besøgende gjorde umiddelbart før og efter at have besøgt en given side. Denne side vil forklare, hvordan du tilgår forstår og anvender denne effektive rapport.", - "FromCampaigns": "Fra kampagner", - "FromPreviousPages": "Fra interne sider", - "FromPreviousPagesInline": "%s fra interne sider", - "FromPreviousSiteSearches": "Fra intern søgning", - "FromPreviousSiteSearchesInline": "%s fra interne søgninger", - "FromSearchEngines": "Fra søgemaskiner", - "FromSocialNetworks": "Fra sociale netværk", - "FromWebsites": "Fra hjemmesider", - "IncomingTraffic": "Indkommende trafik", - "LoopsInline": "%s side genindlæsninger", - "NoDataForAction": "Der er ingen data for %s", - "NoDataForActionDetails": "Enten havde handlingen ingen sidevisninger i perioden eller den er ugyldig.", - "OutgoingTraffic": "Udgående trafik", - "PageURLTransitions": "Side-URL-overgange", - "ShareOfAllPageviews": "Denne side havde %1$s sidevisninger (%2$s af alle sidevisninger)", - "ToFollowingPages": "Til interne sider", - "ToFollowingPagesInline": "%s til interne sider", - "ToFollowingSiteSearches": "Interne søgninger", - "ToFollowingSiteSearchesInline": "%s interne søgninger", - "Transitions": "Overgange", - "TransitionsSubcategoryHelp1": "Overgange giver dig en rapport over, hvad dine besøgende gjorde umiddelbart før og efter at have besøgt en given side. Denne side vil forklare, hvordan du tilgår forstår og anvender denne effektive rapport.", - "TransitionsSubcategoryHelp2": "Flere detaljer", - "XOfAllPageviews": "%s af alle visninger af denne side", - "XOutOfYVisits": "%1$s (ud af %2$s)" - } -} diff --git a/plugins/Transitions/lang/de.json b/plugins/Transitions/lang/de.json deleted file mode 100644 index a27bcda0df95611946c3894b53b4c304f3198a4b..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/de.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Schon gewusst? Transitionen sind auch als Zeilenaktionen in folgenden Berichten verfügbar:", - "AvailableInOtherReports2": "Starten Sie Transitionen, in dem Sie das Icon (%s) klicken, nachdem Sie eine Zeile des Berichts markiert haben.", - "BouncesInline": "%s Absprünge", - "DirectEntries": "Direkte Einträge", - "ErrorBack": "Gehe zurück zur letzten Aktion", - "ExitsInline": "%s Ausstiege", - "FeatureDescription": "Transitionen ist ein Bericht, der zeigt, was Ihre Besucher direkt vor und nach dem Betrachten einer bestimmten Seite getan haben. Auf dieser Seite wird erklärt, wie Sie auf den leistungsstarken Bericht \"Transitionen\" zugreifen, ihn verstehen und verwenden können.", - "FromAIAssistants": "Von KI-Assistenten", - "FromCampaigns": "Von Kampagnen", - "FromPreviousPages": "Von internen Seiten", - "FromPreviousPagesInline": "%s von internen Seiten", - "FromPreviousSiteSearches": "Von der internen Suche", - "FromPreviousSiteSearchesInline": "%s von internen Suchen", - "FromSearchEngines": "Von Suchmaschinen", - "FromSocialNetworks": "Aus sozialen Netzwerken", - "FromWebsites": "Von Webseiten", - "IncomingTraffic": "Eingehender Traffic", - "LoopsInline": "%s Seite erneut geladen", - "NoDataForAction": "Keine Daten für %s verfügbar", - "NoDataForActionDetails": "Entweder hatte diese Aktion während des Zeitraums keine Seitenansichten oder sie ist ungültig.", - "NumDownloads": "%s Downloads", - "NumOutlinks": "%s ausgehende Verweise", - "NumPageviews": "%s Seitenansichten", - "OutgoingTraffic": "Ausgehender Traffic", - "PageURLTransitions": "Seiten URL Übergänge", - "PeriodNotAllowed": "Wählen Sie einen gültigen Zeitraum", - "PeriodNotAllowedDetails": "Versuchen Sie, für dieses Feature einen Zeitraum mit weniger Tagen auszuwählen.", - "PluginDescription": "Zeigt vorherige und nachfolgende Aktionen für jede Seiten-URL in einem neuen Bericht \"Transitionen\" an, der in den \"Aktionen\"-Berichten über ein neues Icon verfügbar ist.", - "ShareOfAllPageviews": "Diese Seite wurde %1$s mal angesehen (%2$s aller Seitenansichten)", - "ToFollowingPages": "Auf interne Seiten", - "ToFollowingPagesInline": "%s zu internen Seiten", - "ToFollowingSiteSearches": "Interne Suchen", - "ToFollowingSiteSearchesInline": "%s interne Suchen", - "TopX": "Top %s Beschriftungen", - "Transitions": "Transitionen", - "TransitionsSubcategoryHelp1": "Transitionen ist ein Bericht, der zeigt, was Ihre Besucher direkt vor und nach dem Betrachten einer bestimmten Seite getan haben. Diese Seite erklärt, wie Sie auf den leistungsstarken Bericht \"Transitionen\" zugreifen, ihn verstehen und verwenden können.", - "TransitionsSubcategoryHelp2": "Mehr Details", - "XOfAllPageviews": "%s von allen Seitenansichten", - "XOutOfYVisits": "%1$s (von insgesamt %2$s)" - } -} diff --git a/plugins/Transitions/lang/dv.json b/plugins/Transitions/lang/dv.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/dv.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/el.json b/plugins/Transitions/lang/el.json deleted file mode 100644 index 3ea18a9cc0f396c63853288376eb38df21de750d..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/el.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Το γνωρίζετε; Οι μεταβάσεις είναι πλέον διαθέσιμες ως ενέργεια γραμμής στις παρακάτω αναφορές:", - "AvailableInOtherReports2": "Εκτέλεση των μεταβάσεων με κλικ στο εικονίδιό τους (%s) μετά την αιώρηση πάνω από μια γραμμή σε οποιαδήποτε από τις αναφορές.", - "BouncesInline": "%s αναπηδήσεις", - "DirectEntries": "Άμεσες εισαγωγές", - "ErrorBack": "Μετάβαση στην προηγούμενη ενέργεια", - "ExitsInline": "%s έξοδοι", - "FeatureDescription": "Οι μεταβάσεις είναι μια αναφορά που εμφανίζει τι έκαναν οι επισκέπτες σας αμέσως πριν και μετά που είδαν μια συγκεκριμένη σελίδα. Η σελίδα αυτή εξηγεί πως μπορείτε να προσπελάσετε, καταλάβετε και να χρησιμοποιήσετε την ισχυρή αναφορά \"Μεταβάσεων\".", - "FromAIAssistants": "Από βοηθούς ΤΝ", - "FromCampaigns": "Από εκστρατείες", - "FromPreviousPages": "Από εσωτερικές σελίδες", - "FromPreviousPagesInline": "%s από εσωτερικές σελίδες", - "FromPreviousSiteSearches": "Από εσωτερική αναζήτηση", - "FromPreviousSiteSearchesInline": "%s από εσωτερικές αναζητήσεις", - "FromSearchEngines": "Από μηχανές αναζήτησης", - "FromSocialNetworks": "Από κοινωνικά δίκτυα", - "FromWebsites": "Από ιστοσελίδες", - "IncomingTraffic": "Εισερχόμενη κίνηση", - "LoopsInline": "%s ανανεώσεις σελίδας", - "NoDataForAction": "Χωρίς δεδομένα για %s", - "NoDataForActionDetails": "Είτε η ενέργεια δεν είχε προβολές σελίδας (pageviews) κατά τη διάρκεια της περιόδου ή είναι άκυρη.", - "NumDownloads": "%s λήψεις", - "NumOutlinks": "%s σύνδεσμοι προς εξωτερικό", - "NumPageviews": "%s προβολές σελίδων", - "OutgoingTraffic": "Εξερχόμενη κίνηση", - "PageURLTransitions": "Διευθύνσεις URL μεταβάσεων σελίδων", - "PeriodNotAllowed": "Επιλογή έγκυρης χρονικής περιόδου", - "PeriodNotAllowedDetails": "Δοκιμάστε να επιλέξτε μια περίοδο με λιγότερες ημέρες για αυτό το χαρακτηριστικό.", - "PluginDescription": "Αναφέρει προηγούμενες και επόμενες ενέργειες για κάθε σελίδα σε νέα αναφορά \"Μεταβάσεων\", διαθέσιμη στις αναφορές \"Ενεργειών\" από ένα νέο εικονίδιο.", - "ShareOfAllPageviews": "Η σελίδα είχε %1$s αναγνώσεις (%2$s από όλες τις αναγνώσεις σελίδων)", - "ToFollowingPages": "Προς εσωτερικές σελίδες", - "ToFollowingPagesInline": "%s προς εσωτερικές σελίδες", - "ToFollowingSiteSearches": "Εσωτερικές αναζητήσεις", - "ToFollowingSiteSearchesInline": "%s εσωτερικές αναζητήσεις", - "TopX": "Οι κορυφαίες %s ετικέτες", - "Transitions": "Μεταβάσεις", - "TransitionsSubcategoryHelp1": "Οι μεταβάσεις είναι μια αναφορά που εμφανίζει τι έκαναν οι επισκέπτες σας αμέσως πριν και μετά που είδαν μια συγκεκριμένη σελίδα. Η σελίδα αυτή εξηγεί πως να προσπελάσετε, κατανοήσετε και χρησιμοποιήσετε την δυνατή αναφορά \"Μεταβάσεων\".", - "TransitionsSubcategoryHelp2": "Περισσότερες λεπτομέρειες", - "XOfAllPageviews": "%s από όλες τις προβολές αυτής της σελίδας", - "XOutOfYVisits": "%1$s (από %2$s)" - } -} diff --git a/plugins/Transitions/lang/en.json b/plugins/Transitions/lang/en.json deleted file mode 100644 index bda79ebb71cbcae96b408bb1f318e8c1fe1dd097..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/en.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s bounces", - "DirectEntries": "Direct entries", - "Transitions": "Transitions", - "ErrorBack": "Go back to the previous action", - "ExitsInline": "%s exits", - "NumPageviews": "%s pageviews", - "NumDownloads": "%s downloads", - "NumOutlinks": "%s outlinks", - "TopX": "Top %s labels", - "FeatureDescription": "Transitions is a report showing the things your visitors did directly before and after viewing a given page. This page explains how to access, understand, and use the powerful \"Transitions\" report.", - "AvailableInOtherReports": "Did you know? Transitions are also available as a row action in the following reports:", - "AvailableInOtherReports2": "Launch transitions by clicking their icon (%s) after hovering a row in any of these reports.", - "FromCampaigns": "From campaigns", - "FromPreviousPages": "From internal pages", - "FromPreviousPagesInline": "%s from internal pages", - "FromPreviousSiteSearches": "From internal search", - "FromPreviousSiteSearchesInline": "%s from internal searches", - "FromSearchEngines": "From search engines", - "FromSocialNetworks": "From social networks", - "FromAIAssistants": "From AI assistants", - "FromWebsites": "From websites", - "IncomingTraffic": "Incoming traffic", - "LoopsInline": "%s page reloads", - "NoDataForAction": "No data for %s", - "NoDataForActionDetails": "Either the action had no pageviews during the period, or it is invalid.", - "PeriodNotAllowed": "Select a valid time period", - "PeriodNotAllowedDetails": "Try selecting a period with fewer days for this feature.", - "OutgoingTraffic": "Outgoing traffic", - "PluginDescription": "Reports previous and following actions for each page URL in a new \"Transitions\" report, available in the \"Actions\" reports via a new icon.", - "ShareOfAllPageviews": "This page had %1$s pageviews (%2$s of all pageviews)", - "ToFollowingPages": "To internal pages", - "ToFollowingPagesInline": "%s to internal pages", - "ToFollowingSiteSearches": "Internal searches", - "ToFollowingSiteSearchesInline": "%s internal searches", - "XOfAllPageviews": "%s of all views of this page", - "XOutOfYVisits": "%1$s (out of %2$s)", - "PageURLTransitions": "Page URL transitions", - "TransitionsSubcategoryHelp1": "Transitions is a report showing the things your visitors did directly before and after viewing a given page. This page explains how to access, understand, and use the powerful \"Transitions\" report.", - "TransitionsSubcategoryHelp2": "More details" - } -} diff --git a/plugins/Transitions/lang/eo.json b/plugins/Transitions/lang/eo.json deleted file mode 100644 index 317bb6928f153217c3a56ae7236da131478c4796..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/eo.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Transitions": { - "TransitionsSubcategoryHelp2": "Pli detala" - } -} diff --git a/plugins/Transitions/lang/es-ar.json b/plugins/Transitions/lang/es-ar.json deleted file mode 100644 index 02b36770ab6a7f25ef33fb0dbeb9d89876a06c84..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/es-ar.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "¿Lo sabías? Las transiciones también están disponibles como una acción de fila en los siguientes informes:", - "AvailableInOtherReports2": "Simplemente pasá el mouse sobre una fila de cualquiera de estos informes y hacé clic en el ícono de transición %s para ejecutarlo.", - "BouncesInline": "%s rebotes", - "DirectEntries": "Entradas directas", - "ErrorBack": "Volver a la acción anterior", - "ExitsInline": "%s salidas", - "FeatureDescription": "Las transiciones te dan un informe que muestra las cosas que tus visitantes hicieron directamente antes y después de ver cierta página. Esta página explicará cómo acceder, entender y usar el poderoso informe de Transiciones.", - "FromCampaigns": "Desde campañas", - "FromPreviousPages": "Desde páginas internas", - "FromPreviousPagesInline": "%s desde páginas internas", - "FromPreviousSiteSearches": "Desde búsquedas internas", - "FromPreviousSiteSearchesInline": "%s desde búsquedas internas", - "FromSearchEngines": "Desde motores de búsqueda", - "FromSocialNetworks": "Desde redes sociales", - "FromWebsites": "Desde sitios web", - "IncomingTraffic": "Tráfico entrante", - "LoopsInline": "%s recargas de página", - "NoDataForAction": "No hay datos para %s", - "NoDataForActionDetails": "O la acción no tuvo vistas de páginas durante el período o no es válida.", - "NumDownloads": "%s descargas", - "NumOutlinks": "%s enlaces externos", - "NumPageviews": "%s vistas", - "OutgoingTraffic": "Tráfico saliente", - "PageURLTransitions": "Dirección web de la página de transiciones", - "PluginDescription": "Acciones siguientes y anteriores del informe para cada dirección web de página en un nuevo informe de Transiciones, disponible en lis informes de Acciones a través de un nuevo ícono.", - "ShareOfAllPageviews": "Esta página tuvo %1$s vistas de página (%2$s de todas las vistas de páginas)", - "ToFollowingPages": "A páginas internas", - "ToFollowingPagesInline": "%s a páginas internas", - "ToFollowingSiteSearches": "Búsquedas internas", - "ToFollowingSiteSearchesInline": "%s búsquedas internas", - "TopX": "Principales %s etiquetas", - "Transitions": "Transiciones", - "TransitionsSubcategoryHelp1": "Las transiciones te dan un informe que muestra las cosas que tus visitantes hicieron directamente antes y después de ver cierta página. Esta página explicará cómo acceder, entender y usar el poderoso informe de Transiciones.", - "TransitionsSubcategoryHelp2": "Más detalles", - "XOfAllPageviews": "%s de todas las vistas de esta página", - "XOutOfYVisits": "%1$s (de %2$s)" - } -} diff --git a/plugins/Transitions/lang/es.json b/plugins/Transitions/lang/es.json deleted file mode 100644 index 5cb8b2fb2255ecb3b2dcf8d5c18ca46ac1feec5c..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/es.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "¿Sabías? Las transiciones también están disponibles como una acción de fila en los siguientes informes:", - "AvailableInOtherReports2": "Inicie las transiciones haciendo clic en su icono (%s) después de pasar el cursor sobre una fila en cualquiera de estos informes.", - "BouncesInline": "%s rebotes", - "DirectEntries": "Entradas directas", - "ErrorBack": "Regresar a la acción anterior", - "ExitsInline": "%s salidas", - "FeatureDescription": "Transiciones es un informe que muestra las cosas que sus visitantes hicieron directamente antes y después de ver una página determinada. Esta página explica cómo acceder, comprender y utilizar el potente informe \"Transiciones\".", - "FromCampaigns": "De campañas", - "FromPreviousPages": "De páginas internas", - "FromPreviousPagesInline": "%s desde páginas internas", - "FromPreviousSiteSearches": "De la búsqueda interna", - "FromPreviousSiteSearchesInline": "%s desde búsquedas internas", - "FromSearchEngines": "De los motores de búsqueda", - "FromSocialNetworks": "De las redes sociales", - "FromWebsites": "De sitios web", - "IncomingTraffic": "Tráfico entrante", - "LoopsInline": "%s recargas de página", - "NoDataForAction": "Sin datos para %s", - "NoDataForActionDetails": "O la acción no tuvo vistas de páginas durante el período o es inválida.", - "NumDownloads": "%s descargas", - "NumOutlinks": "%s enlaces salientes", - "NumPageviews": "%s páginas visitadas", - "OutgoingTraffic": "Tráfico saliente", - "PageURLTransitions": "Transiciones de la URL de la página", - "PeriodNotAllowed": "Seleccione un período de tiempo válido", - "PeriodNotAllowedDetails": "Intente seleccionar un período con menos días para esta función.", - "PluginDescription": "Informa sobre las acciones anteriores y siguientes para cada URL de página en un nuevo informe de \"Transiciones\", disponible en los informes de \"Acciones\" a través de un nuevo icono.", - "ShareOfAllPageviews": "Esta página tuvo %1$s vistas de página (%2$s de todas las vistas de páginas)", - "ToFollowingPages": "A páginas internas", - "ToFollowingPagesInline": "%s a páginas internas", - "ToFollowingSiteSearches": "Búsquedas internas", - "ToFollowingSiteSearchesInline": "%s búsquedas internas", - "TopX": "Etiquetas %s superiores", - "Transitions": "Transiciones", - "TransitionsSubcategoryHelp1": "Transiciones es un informe que muestra las cosas que sus visitantes hicieron directamente antes y después de ver una página determinada. Esta página explica cómo acceder, comprender y utilizar el potente informe \"Transiciones\".", - "TransitionsSubcategoryHelp2": "Más detalles", - "XOfAllPageviews": "%s de todas las vistas de esta página", - "XOutOfYVisits": "%1$s (de %2$s)" - } -} diff --git a/plugins/Transitions/lang/et.json b/plugins/Transitions/lang/et.json deleted file mode 100644 index 11fea92e7e5e890df341ab8b4d142ad97ffad08d..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/et.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s põrget", - "DirectEntries": "Otse sisenemisi", - "ErrorBack": "Mine tagasi eelmisele tegevusele", - "ExitsInline": "%s väljumist", - "FromCampaigns": "Tuldud kampaaniad", - "FromPreviousPages": "Tuldud sisemised lehed", - "FromPreviousPagesInline": "%s tuli sisemistelt lehtedelt", - "FromPreviousSiteSearches": "Tuldud sisemised otsingud", - "FromPreviousSiteSearchesInline": "%s tuli sisemisest otsingust", - "FromSearchEngines": "Tuldud otsingumootorid", - "FromWebsites": "Tuldud veebilehed", - "IncomingTraffic": "Sisenev liiklus", - "LoopsInline": "%s lehe korduvat laadimist", - "NoDataForAction": "Tegevuse %s kohta puuduvad andmed", - "OutgoingTraffic": "Väljuv liiklus", - "ShareOfAllPageviews": "See leht sai %1$s vaatamist (%2$s kõigist vaatamistest)", - "ToFollowingPages": "Sisemistele lehtedele", - "ToFollowingPagesInline": "%s läks sisemistele lehtedele", - "ToFollowingSiteSearches": "Sisemised otsingud", - "ToFollowingSiteSearchesInline": "%s sisemist otsingut", - "TransitionsSubcategoryHelp2": "Rohkem detaile", - "XOfAllPageviews": "%s kõigist antud lehe vaatamistest", - "XOutOfYVisits": "%1$s (%2$s kõigist)" - } -} diff --git a/plugins/Transitions/lang/eu.json b/plugins/Transitions/lang/eu.json deleted file mode 100644 index 0d95a0197b2901695f9479812ebe6580ef2c9abf..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/eu.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Bazenekien? Trantsizioak errenkadako ekintza bezala ere erabilgarri daude ondorengo txostenetan:", - "AvailableInOtherReports2": "Abiarazi trantsizioak sagua txosten horietako errenkada baten gainean jarri eta bere ikonoan (%s) klik eginez.", - "BouncesInline": "%s errebote", - "DirectEntries": "Sarrera zuzenak", - "ErrorBack": "Itzuli aurreko ekintzara", - "ExitsInline": "%s irteera", - "FeatureDescription": "Trantsizioak txostenean ikus dezakezu zer egin duten bisitariek orri jakin bat ikusi aurretik eta ondoren. Orri honetan azaltzen da nola atzitu, ulertu eta erabili \"Trantsizioak\" txosten ahaltsua.", - "FromCampaigns": "Kanpainetatik", - "FromPreviousPages": "Barne-orrietatik", - "FromPreviousPagesInline": "%s barne-orrietatik", - "FromPreviousSiteSearches": "Barne bilaketatik", - "FromPreviousSiteSearchesInline": "%s barne bilaketetatik", - "FromSearchEngines": "Bilatzaileetatik", - "FromSocialNetworks": "Sare sozialetatik", - "FromWebsites": "Webguneetatik", - "IncomingTraffic": "Sarrerako trafikoa", - "LoopsInline": "%s orri birkargatze", - "NoDataForAction": "Daturik ez %s(r)entzat", - "NoDataForActionDetails": "Ekintzak ez du orri-ikustaldirik tarte horretan edo baliogabea da.", - "NumDownloads": "%s deskarga", - "NumOutlinks": "%s kanpo esteka", - "NumPageviews": "%s orri-ikustaldi", - "OutgoingTraffic": "Kanporako trafikoa", - "PageURLTransitions": "Orrien URLen trantsizioak", - "PeriodNotAllowed": "Hautatu baliozko denbora-tartea", - "PeriodNotAllowedDetails": "Saiatu egun gutxiago dituen tartea hautatzen ezaugarri honentzat.", - "PluginDescription": "Aurreko eta ondorengo ekintzen berri ematen du orri URL bakoitzarentzat, \"Trantsizioak\" txosten berrian, \"Ekintzak\" txostenetan ere erabilgarri dago ikono berria erabiliz.", - "ShareOfAllPageviews": "Orri honek %1$s ikustaldi izan ditu (orri-ikustaldi guztien %2$s)", - "ToFollowingPages": "Barne orrietara", - "ToFollowingPagesInline": "%s barne orrietara", - "ToFollowingSiteSearches": "Barne bilaketak", - "ToFollowingSiteSearchesInline": "%s barne bilaketa", - "TopX": "%s etiketa gorenak", - "Transitions": "Trantsizioak", - "TransitionsSubcategoryHelp1": "Trantsizioak txostenean ikus dezakezu zer egin duten bisitariek orri jakin bat ikusi aurretik eta ondoren. Orri honetan azaltzen da nola atzitu, ulertu eta erabili \"Trantsizioak\" txosten ahaltsua.", - "TransitionsSubcategoryHelp2": "Xehetasun gehiago", - "XOfAllPageviews": "Orri honen ikustaldi guztien %s", - "XOutOfYVisits": "%1$s (guztira %2$s)" - } -} diff --git a/plugins/Transitions/lang/fa.json b/plugins/Transitions/lang/fa.json deleted file mode 100644 index 7750f20b78bb6e37da78fc0e091fdcc672c62bf4..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/fa.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s پس زده", - "DirectEntries": "ورودی های مستقیم", - "ErrorBack": "به فعالیت قبلی برگرد", - "ExitsInline": "%s خروج", - "FromCampaigns": "از کمپین", - "FromPreviousPages": "از صفحه های داخلی", - "FromPreviousPagesInline": "%s از صفحه های داخلی", - "FromPreviousSiteSearches": "از جستجوی داخلی", - "FromPreviousSiteSearchesInline": "%s از جستجوهای داخلی", - "FromSearchEngines": "از موتورهای جستجو", - "FromWebsites": "از وبسایت ها", - "IncomingTraffic": "ترافیک ورودی", - "LoopsInline": "%s بارگذاری مجدد صفحه", - "NoDataForAction": "هیچ داده ای وجود ندارد برای %s", - "OutgoingTraffic": "ترافیک خروجی", - "ShareOfAllPageviews": "این صفحه %1$s بازدیدازصفحه دارد(%2$s از تمام بازدیدازصفحه ها)", - "ToFollowingPages": "به صفحه های داخلی", - "ToFollowingPagesInline": "%s به صفحه های داخلی", - "ToFollowingSiteSearches": "جستجوهای داخلی", - "ToFollowingSiteSearchesInline": "%s جستجوهای داخلی", - "TransitionsSubcategoryHelp2": "جزئیات بیشتر", - "XOfAllPageviews": "%s از همه ی بازدیدهای این صفحه", - "XOutOfYVisits": "%1$s (از %2$s)" - } -} diff --git a/plugins/Transitions/lang/fi.json b/plugins/Transitions/lang/fi.json deleted file mode 100644 index ea2478794d4ac3093b5380f535bc5f8b246bc3aa..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/fi.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s käväisyä", - "DirectEntries": "Suorat merkinnät", - "ErrorBack": "Palaa takaisin edelliseen toimintoon", - "ExitsInline": "%s poistumista", - "FromCampaigns": "Kampanjoista", - "FromPreviousPages": "Sisäisiltä sivuilta", - "FromPreviousPagesInline": "%s sisäisiltä sivuilta", - "FromPreviousSiteSearches": "Sisäisestä hausta", - "FromPreviousSiteSearchesInline": "%s sisäisestä hausta", - "FromSearchEngines": "Hakukoneista", - "FromSocialNetworks": "Sosiaalisista verkostoista", - "FromWebsites": "Verkkosivuilta", - "IncomingTraffic": "Sisääntuleva liikenne", - "LoopsInline": "%s sivujen uudelleenlatausta", - "NoDataForAction": "%s:lle ei ole tietoja", - "NoDataForActionDetails": "Joko toiminnolle ei ole tietoja aikavälille tai toiminto on virheellinen.", - "NumDownloads": "%s tiedoston latausta", - "NumOutlinks": "%s lähtevää linkki", - "NumPageviews": "%s sivunavausta", - "OutgoingTraffic": "Lähtevä liikenne", - "PluginDescription": "Raportoi edellisen ja seuraavat toiminnot jokaiselle sivulle. Saatavilla \"Toiminnot\"-raportissa uuden ikonin takaa.", - "ShareOfAllPageviews": "Tällä sivulla on %1$s sivunavausta (%2$s kaikista)", - "ToFollowingPages": "Sisäisille sivuille", - "ToFollowingPagesInline": "%s sisäisille sivuille", - "ToFollowingSiteSearches": "Sisäisiä hakuja", - "ToFollowingSiteSearchesInline": "%s sisäistä hakua", - "Transitions": "Siirtymät", - "TransitionsSubcategoryHelp2": "Lisätietoja", - "XOfAllPageviews": "%s kaikista tämän sivun katseluista", - "XOutOfYVisits": "%1$s (%2$s:stä)" - } -} diff --git a/plugins/Transitions/lang/fr.json b/plugins/Transitions/lang/fr.json deleted file mode 100644 index f152713bc8e861ef6d792b17410f01dcb43eedf2..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/fr.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Le saviez-vous ? Les transitions sont également disponibles sous forme d'action en ligne dans les rapports suivants :", - "AvailableInOtherReports2": "Lancez les transitions en cliquant sur leur icône (%s) après avoir survolé une ligne dans l'un de ces rapports.", - "BouncesInline": "%s rebonds", - "DirectEntries": "Entrées directes", - "ErrorBack": "Retour à l'action précédente", - "ExitsInline": "%s sorties", - "FeatureDescription": "Les transitions sont un rapport montrant ce que vos visiteurs ont fait directement avant et après avoir consulté une page donnée. Cette page explique comment accéder, comprendre et utiliser le puissant rapport \"Transitions\".", - "FromAIAssistants": "Depuis les assistants IA", - "FromCampaigns": "Depuis des campagnes", - "FromPreviousPages": "Depuis des pages internes", - "FromPreviousPagesInline": "%s depuis des pages internes", - "FromPreviousSiteSearches": "Depuis des recherches internes", - "FromPreviousSiteSearchesInline": "%s depuis des recherches internes", - "FromSearchEngines": "Depuis les moteurs de recherche", - "FromSocialNetworks": "Depuis des réseaux sociaux", - "FromWebsites": "Depuis des sites web", - "IncomingTraffic": "Trafic entrant", - "LoopsInline": "%s rechargements de pages", - "NoDataForAction": "Aucune données pour %s", - "NoDataForActionDetails": "Soit l'action n'a généré aucune vue de page pendant la période, soit elle est invalide.", - "NumDownloads": "%s téléchargements", - "NumOutlinks": "%s liens sortant", - "NumPageviews": "%s pages vues", - "OutgoingTraffic": "Trafic sortant", - "PageURLTransitions": "Transitions d'URL de page", - "PeriodNotAllowed": "Sélectionnez une période valide", - "PeriodNotAllowedDetails": "Essayez de sélectionner une période plus courte pour cette fonctionnalité.", - "PluginDescription": "Rapporte les actions précédentes et suivantes pour chacune des URL's de page dans un nouveau rapport de Transitions, disponible depuis le rapports des Actions via un nouvel icône.", - "ShareOfAllPageviews": "Cette page a eu %1$s affichages (%2$s de tous les affichages)", - "ToFollowingPages": "Vers des pages internes", - "ToFollowingPagesInline": "%s vers des pages internes", - "ToFollowingSiteSearches": "Recherches internes", - "ToFollowingSiteSearchesInline": "%s recherches internes", - "TopX": "Top %s des étiquettes", - "Transitions": "Transitions", - "TransitionsSubcategoryHelp1": "Le rapport « Transitions » présente les actions de vos visiteurs juste avant et juste après la consultation d'une page. Cette page explique comment accéder à ce rapport, le comprendre et l'utiliser.", - "TransitionsSubcategoryHelp2": "Plus de détails", - "XOfAllPageviews": "%s de toutes les pages vues", - "XOutOfYVisits": "%1$s (de %2$s)" - } -} diff --git a/plugins/Transitions/lang/ga.json b/plugins/Transitions/lang/ga.json deleted file mode 100644 index 4d0cd0022c2be72cb627c523ecd258bdd1733548..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ga.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "An raibh a fhios agat? Tá aistrithe ar fáil freisin mar ghníomh as a chéile sna tuarascálacha seo a leanas:", - "AvailableInOtherReports2": "Seoladh trasdulta trí chliceáil ar a n-íocón (%s) tar éis duit sraith a chur in aon cheann de na tuarascálacha seo.", - "BouncesInline": "Preab %s", - "DirectEntries": "Iontrálacha díreacha", - "ErrorBack": "Téigh ar ais go dtí an gníomh roimhe seo", - "ExitsInline": "Scoir %s", - "FeatureDescription": "Is éard is Transitions ann ná tuairisc a thaispeánann na rudaí a rinne do chuairteoirí go díreach roimh agus tar éis féachaint ar leathanach áirithe. Míníonn an leathanach seo conas an tuarascáil chumhachtach \"Aistrithe\" a rochtain, a thuiscint agus a úsáid.", - "FromAIAssistants": "Ó chúntóirí AI", - "FromCampaigns": "Ó feachtais", - "FromPreviousPages": "Ó leathanaigh inmheánacha", - "FromPreviousPagesInline": "%s ó leathanaigh inmheánacha", - "FromPreviousSiteSearches": "Ó chuardach inmheánach", - "FromPreviousSiteSearchesInline": "%s ó chuardaigh inmheánacha", - "FromSearchEngines": "Ó innill chuardaigh", - "FromSocialNetworks": "Ó líonraí sóisialta", - "FromWebsites": "Ó láithreáin ghréasáin", - "IncomingTraffic": "Trácht ag teacht isteach", - "LoopsInline": "%s leathanach á hathluchtú", - "NoDataForAction": "%s leathanach á athluchtú", - "NoDataForActionDetails": "Ní raibh aon amharc leathanaigh ar an ngníomh le linn na tréimhse, nó tá sé neamhbhailí.", - "NumDownloads": "%s íosluchtú", - "NumOutlinks": "%s imlíne", - "NumPageviews": "%s amharc leathanaigh", - "OutgoingTraffic": "Trácht ag dul as oifig", - "PageURLTransitions": "Aistrithe URL an leathanaigh", - "PeriodNotAllowed": "Roghnaigh tréimhse ama bhailí", - "PeriodNotAllowedDetails": "Bain triail as tréimhse a roghnú le níos lú laethanta don ghné seo.", - "PluginDescription": "Tuairiscíonn gníomhartha roimhe seo agus ina dhiaidh sin do gach URL leathanaigh i dtuarascáil nua \"Aistrithe\", atá ar fáil sna tuarascálacha \"Gníomhartha\" trí dheilbhín nua.", - "ShareOfAllPageviews": "Bhí %1$s amharc leathanaigh ar an leathanach seo (%2$s de gach amharc leathanaigh)", - "ToFollowingPages": "Go leathanaigh inmheánacha", - "ToFollowingPagesInline": "%s go leathanaigh inmheánacha", - "ToFollowingSiteSearches": "Cuardach inmheánach", - "ToFollowingSiteSearchesInline": "%s cuardaigh inmheánacha", - "TopX": "Lipéid %s is fearr", - "Transitions": "Aistrithe", - "TransitionsSubcategoryHelp1": "Is éard is Transitions ann ná tuairisc a thaispeánann na rudaí a rinne do chuairteoirí go díreach roimh agus tar éis féachaint ar leathanach áirithe. Míníonn an leathanach seo conas an tuarascáil chumhachtach \"Aistrithe\" a rochtain, a thuiscint agus a úsáid.", - "TransitionsSubcategoryHelp2": "Tuilleadh sonraí", - "XOfAllPageviews": "%s de gach amharc ar an leathanach seo", - "XOutOfYVisits": "%1$s (as %2$s)" - } -} diff --git a/plugins/Transitions/lang/gl.json b/plugins/Transitions/lang/gl.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/gl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/gu.json b/plugins/Transitions/lang/gu.json deleted file mode 100644 index c22c61672e36d409c3ee04bfc439a5e97e0e2fc1..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/gu.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "તમને ખબર છે? નીચેના અહેવાલોમાં સંક્રમણો પંક્તિ ક્રિયા તરીકે પણ ઉપલબ્ધ છે:", - "AvailableInOtherReports2": "આમાંના કોઈપણ અહેવાલમાં એક પંક્તિને હોવર કર્યા પછી તેમના ચિહ્નો(%s) પર ક્લિક કરીને સંક્રમણ શરૂ કરો.", - "BouncesInline": "%s બાઉન્સ", - "DirectEntries": "સીધી એન્ટ્રીઓ", - "ErrorBack": "પાછલી ક્રિયા પર પાછા જાઓ", - "ExitsInline": "%s બહાર નીકળે છે", - "FeatureDescription": "ટ્રાન્ઝિશન એ એક રિપોર્ટ છે જે દર્શાવે છે કે તમારા મુલાકાતીઓએ આપેલ પૃષ્ઠ જોયા પહેલા અને પછી સીધું કર્યું. આ પૃષ્ઠ સમજાવે છે કે કેવી રીતે શક્તિશાળી \"સંક્રમણ\" અહેવાલને ઍક્સેસ કરવો, સમજવું અને તેનો ઉપયોગ કરવો.", - "FromCampaigns": "ઝુંબેશમાંથી", - "FromPreviousPages": "આંતરિક પૃષ્ઠોમાંથી", - "FromPreviousPagesInline": "આંતરિક પૃષ્ઠોમાંથી %s", - "FromPreviousSiteSearches": "આંતરિક શોધમાંથી", - "FromPreviousSiteSearchesInline": "આંતરિક શોધમાંથી %s", - "FromSearchEngines": "સર્ચ એન્જિનમાંથી", - "FromSocialNetworks": "સામાજિક નેટવર્ક્સમાંથી", - "FromWebsites": "વેબસાઇટ્સ પરથી", - "IncomingTraffic": "ઇનકમિંગ ટ્રાફિક", - "LoopsInline": "%s પૃષ્ઠ ફરીથી લોડ થાય છે", - "NoDataForAction": "%s માટે કોઈ ડેટા નથી", - "NoDataForActionDetails": "કાં તો આ સમયગાળા દરમિયાન ક્રિયામાં કોઈ પેજવ્યૂ નહોતા અથવા તે અમાન્ય છે.", - "NumDownloads": "%s ડાઉનલોડ્સ", - "NumOutlinks": "%s આઉટલિંક", - "NumPageviews": "%s પૃષ્ઠ દૃશ્યો", - "OutgoingTraffic": "આઉટગોઇંગ ટ્રાફિક", - "PageURLTransitions": "પૃષ્ઠ URL સંક્રમણો", - "PeriodNotAllowed": "માન્ય સમયગાળો પસંદ કરો", - "PeriodNotAllowedDetails": "આ સુવિધા માટે ઓછા દિવસોનો સમયગાળો પસંદ કરવાનો પ્રયાસ કરો.", - "PluginDescription": "નવી \"સંક્રમણ\" રિપોર્ટમાં દરેક પૃષ્ઠ URL માટે અગાઉની અને નીચેની ક્રિયાઓની જાણ કરે છે, જે નવા આઇકન દ્વારા \"ક્રિયાઓ\" રિપોર્ટ્સમાં ઉપલબ્ધ છે.", - "ShareOfAllPageviews": "આ પૃષ્ઠ પર %1$s પૃષ્ઠ દૃશ્યો હતા (તમામ પૃષ્ઠ દૃશ્યોમાંથી %2$s)", - "ToFollowingPages": "આંતરિક પૃષ્ઠો પર", - "ToFollowingPagesInline": "આંતરિક પૃષ્ઠો પર %s", - "ToFollowingSiteSearches": "આંતરિક શોધો", - "ToFollowingSiteSearchesInline": "%s આંતરિક શોધ", - "TopX": "ટોચના %s લેબલ્સ", - "Transitions": "સંક્રમણો", - "TransitionsSubcategoryHelp1": "ટ્રાન્ઝિશન એ એક રિપોર્ટ છે જે દર્શાવે છે કે તમારા મુલાકાતીઓએ આપેલ પૃષ્ઠ જોયા પહેલા અને પછી સીધું કર્યું. આ પૃષ્ઠ સમજાવે છે કે કેવી રીતે શક્તિશાળી \"સંક્રમણ\" અહેવાલને ઍક્સેસ કરવો, સમજવું અને તેનો ઉપયોગ કરવો.", - "TransitionsSubcategoryHelp2": "વધુ વિગતો", - "XOfAllPageviews": "આ પૃષ્ઠના તમામ દૃશ્યોના %s", - "XOutOfYVisits": "%1$s (%2$s માંથી)" - } -} diff --git a/plugins/Transitions/lang/he.json b/plugins/Transitions/lang/he.json deleted file mode 100644 index f85d7159289002d055e20f4b142fb4b35c6bf5aa..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/he.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s קפיצות", - "TransitionsSubcategoryHelp2": "פרטים נוספים" - } -} diff --git a/plugins/Transitions/lang/hi.json b/plugins/Transitions/lang/hi.json deleted file mode 100644 index 66cfa20e624b25865264a7664f46e101278e4897..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/hi.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s उछाल", - "DirectEntries": "सीधी प्रविष्टियां", - "ErrorBack": "पिछली कार्रवाई के लिए वापस जाओ", - "ExitsInline": "%s बाहर निकलता है", - "FromCampaigns": "अभियान से", - "FromPreviousPages": "आंतरिक पृष्ठों से", - "FromPreviousPagesInline": "%s आंतरिक पृष्ठों से", - "FromPreviousSiteSearches": "आंतरिक खोज से", - "FromPreviousSiteSearchesInline": "%s आंतरिक खोजों से", - "FromSearchEngines": "खोज इंजन से", - "FromWebsites": "वेबसाइटों से", - "IncomingTraffic": "आने वाले यातायात", - "LoopsInline": "पृष्ठ पुनः लोड %s", - "NoDataForAction": "%s के लिए कोई डेटा नहीं है", - "NoDataForActionDetails": "या तो कार्रवाई की अवधि के दौरान कोई पेज देखा गया था या यह अवैध है.", - "OutgoingTraffic": "निवर्तमान यातायात", - "ShareOfAllPageviews": "यह पृष्ठ का %1$s पृष्ठ दृश्य (सभी पृष्ठ दृश्य का %2$s)किया था", - "ToFollowingPages": "आंतरिक पृष्ठ", - "ToFollowingPagesInline": "%s आंतरिक पृष्ठ", - "ToFollowingSiteSearches": "आंतरिक खोजें", - "ToFollowingSiteSearchesInline": "%s आंतरिक खोजें", - "TransitionsSubcategoryHelp2": "अधिक जानकारी", - "XOfAllPageviews": "इस पृष्ठ के सभी दृश्यों का %s", - "XOutOfYVisits": "%1$s (बाहर %2$s)" - } -} diff --git a/plugins/Transitions/lang/hr.json b/plugins/Transitions/lang/hr.json deleted file mode 100644 index 481d24ac75b8e566e8797ab5ceff422aa448aeee..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/hr.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Je li već znaš? Tranzicije su također dostupne kao radnja po retku u sljedećim izvještajima:", - "AvailableInOtherReports2": "Pokreni tranzicije klikom na njihovu ikonu (%s) nakon što prijeđeš mišem preko retka u bilo kojem od ovih izvještaja.", - "BouncesInline": "%s napuštanja", - "DirectEntries": "Izravni unosi", - "ErrorBack": "Vrati se na prethodnu radnju", - "ExitsInline": "%s izlaza", - "FeatureDescription": "„Tranzicije” je izvještaj koji prikazuje što su tvoji posjetitelji radili neposredno prije i nakon što su pogledali određenu stranicu. Ova stranica objašnjava kako pristupiti izvještaju „Tranzicije”, kako ga razumjeti i koristiti.", - "FromAIAssistants": "Od UI asistenta", - "FromCampaigns": "Od kampanja", - "FromPreviousPages": "Od internih stranica", - "FromPreviousPagesInline": "%s od internih stranica", - "FromPreviousSiteSearches": "Od interne pretrage", - "FromPreviousSiteSearchesInline": "%s od internih pretraga", - "FromSearchEngines": "Od tražilica", - "FromSocialNetworks": "Od društvenih mreža", - "FromWebsites": "Od web-stranica", - "IncomingTraffic": "Dolazni promet", - "LoopsInline": "%s ponovna učitavanja stranice", - "NoDataForAction": "Nema podataka za %s", - "NoDataForActionDetails": "Radnja nije imala prikaza stranice tijekom razdoblja ili je nevažeća.", - "NumDownloads": "%s preuzimanja", - "NumOutlinks": "%s vanjske poveznice", - "NumPageviews": "%s prikaza stranice", - "OutgoingTraffic": "Odlazni promet", - "PageURLTransitions": "Tranzicije URL-ova stranica", - "PeriodNotAllowed": "Odaberi valjano vremensko razdoblje", - "PeriodNotAllowedDetails": "Pokušaj odabrati razdoblje s manje dana za ovu funkciju.", - "PluginDescription": "Prikazuje prethodne i sljedeće radnje za svaki URL stranice u novom izvještaju „Tranizicije” dostupnom u izvještajima „Radnje” putem nove ikone.", - "ShareOfAllPageviews": "Ova je stranica imala %1$s prikaza stranice (%2$s od svih prikaza stranica)", - "ToFollowingPages": "Prema internim stranicama", - "ToFollowingPagesInline": "%s prema internim stranicama", - "ToFollowingSiteSearches": "Interne pretrage", - "ToFollowingSiteSearchesInline": "%s interne pretrage", - "TopX": "Najbolje %s oznake", - "Transitions": "Tranzicije", - "TransitionsSubcategoryHelp1": "„Tranzicije” je izvještaj koji prikazuje što su tvoji posjetitelji radili neposredno prije i nakon što su pogledali određenu stranicu. Ova stranica objašnjava kako pristupiti izvještaju „Tranzicije”, kako ga razumjeti i koristiti.", - "TransitionsSubcategoryHelp2": "Više detalja", - "XOfAllPageviews": "%s od svih prikaza ove stranice", - "XOutOfYVisits": "%1$s (od %2$s)" - } -} diff --git a/plugins/Transitions/lang/hu.json b/plugins/Transitions/lang/hu.json deleted file mode 100644 index 5e5ae6cac9c2010806e18969a88971da4addb570..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/hu.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Transitions": { - "TransitionsSubcategoryHelp2": "több részlet" - } -} diff --git a/plugins/Transitions/lang/hy.json b/plugins/Transitions/lang/hy.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/hy.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/id.json b/plugins/Transitions/lang/id.json deleted file mode 100644 index 93e4d930ec46ed9e4b41f88c4b57c452a0d7e852..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/id.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Tahukah Anda? Transisi juga tersedia sebagai tindakan baris dalam laporan berikut:", - "AvailableInOtherReports2": "Cukup arahkan satu baris di salah satu laporan ini dan klik ikon transisi %s untuk meluncurkannya.", - "BouncesInline": "%s pantulan", - "DirectEntries": "Entri langsung", - "ErrorBack": "Kembali ke aksi sebelumnya", - "ExitsInline": "%s keluar", - "FeatureDescription": "Transisi memberi Anda laporan yang menampilkan hal-hal yang dilakukan oleh pengunjung Anda secara langsung sebelum dan sesudah melihat laman tertentu. Halaman ini akan menjelaskan cara mengakses, memahami, dan menggunakan laporan Transisi yang canggih.", - "FromAIAssistants": "Dari asisten AI", - "FromCampaigns": "Dari Kampanye", - "FromPreviousPages": "Dari halaman internal", - "FromPreviousPagesInline": "%s dari halaman internal", - "FromPreviousSiteSearches": "Dari pencarian internal", - "FromPreviousSiteSearchesInline": "%s dari pencarian internal", - "FromSearchEngines": "Dari mesin pencari", - "FromSocialNetworks": "Dari jaringan sosial", - "FromWebsites": "Dari website", - "IncomingTraffic": "Lalu lintas masuk", - "LoopsInline": "%s halaman dimuat ulang", - "NoDataForAction": "Tidak ada data untuk %s", - "NoDataForActionDetails": "Baik tindakan tidak memiliki pageviews selama periode tersebut, atau tidak valid.", - "NumDownloads": "%s unduhan", - "NumOutlinks": "%s tautan keluar", - "NumPageviews": "%s tampilan halaman", - "OutgoingTraffic": "Lalu lintas keluar", - "PageURLTransitions": "Transisi URL Halaman", - "PeriodNotAllowed": "Pilih periode waktu yang valid", - "PeriodNotAllowedDetails": "Coba pilih periode dengan hari yang lebih sedikit untuk fitur ini.", - "PluginDescription": "Melaporkan tindakan sebelumnya dan berikutnya untuk setiap URL halaman dalam laporan \"Transisi\" baru, tersedia di laporan \"Tindakan\" melalui ikon baru.", - "ShareOfAllPageviews": "Halaman ini memiliki %1$s tampilan halaman (%2$s dari semua tampilan halaman)", - "ToFollowingPages": "Ke halaman internal", - "ToFollowingPagesInline": "%s ke halaman internal", - "ToFollowingSiteSearches": "Pencarian internal", - "ToFollowingSiteSearchesInline": "%s pencarian internal", - "TopX": "%s label teratas", - "Transitions": "Transisi", - "TransitionsSubcategoryHelp1": "Transisi adalah laporan yang menunjukkan hal-hal yang dilakukan pengunjung Anda langsung sebelum dan setelah melihat halaman tertentu. Halaman ini menjelaskan cara mengakses, memahami, dan menggunakan laporan \"Transisi\" yang kuat.", - "TransitionsSubcategoryHelp2": "Lebih banyak detail", - "XOfAllPageviews": "%s dari semua tampilan halaman ini", - "XOutOfYVisits": "%1$s (dari %2$s)" - } -} diff --git a/plugins/Transitions/lang/is.json b/plugins/Transitions/lang/is.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/is.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/it.json b/plugins/Transitions/lang/it.json deleted file mode 100644 index 14dc5f080a6fd0c964b5cfd1d831c0ebfbdfc001..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/it.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Lo sapevi? Le transizioni sono disponibili anche come azione di riga nei report seguenti:", - "AvailableInOtherReports2": "Avvia le transizioni facendo clic sulla relativa icona (%s) dopo aver passato il mouse su una riga in uno di questi rapporti.", - "BouncesInline": "%s rimbalzi", - "DirectEntries": "Accessi diretti", - "ErrorBack": "Torna all'azione precedente", - "ExitsInline": "%s uscite", - "FeatureDescription": "Le transizioni sono un report che mostra le cose che i tuoi visitatori hanno fatto direttamente prima e dopo aver visualizzato una determinata pagina. Questa pagina spiega come accedere, comprendere e utilizzare il potente rapporto Transizioni.", - "FromAIAssistants": "Da assistenti AI", - "FromCampaigns": "Da campagne", - "FromPreviousPages": "Da pagine interne", - "FromPreviousPagesInline": "%s da pagine interne", - "FromPreviousSiteSearches": "Da ricerca interna", - "FromPreviousSiteSearchesInline": "%s da ricerche interne", - "FromSearchEngines": "Da motori di ricerca", - "FromSocialNetworks": "Da social network", - "FromWebsites": "Da siti web", - "IncomingTraffic": "Traffico entrante", - "LoopsInline": "%s pagine ricaricate", - "NoDataForAction": "Non ci sono dati per %s", - "NoDataForActionDetails": "O l'azione non ha avuto pagine viste durante il periodo o non è valida.", - "NumDownloads": "%s download", - "NumOutlinks": "%s link di uscita", - "NumPageviews": "%s pagine viste", - "OutgoingTraffic": "Traffico uscente", - "PageURLTransitions": "Transizioni URL di pagina", - "PeriodNotAllowed": "Seleziona un periodo di tempo valido", - "PeriodNotAllowedDetails": "Per questa funzione prova a selezionare un periodo di tempo con meno giorni.", - "PluginDescription": "Segnala le azioni precedenti e seguenti per ciascun URL di pagina in un nuovo report \"Transizioni\", disponibile tra i report \"Azioni\" con una nuova icona.", - "ShareOfAllPageviews": "Questa pagina ha avuto %1$s visualizzazioni (%2$s di tutte le visualizzazioni)", - "ToFollowingPages": "A pagine interne", - "ToFollowingPagesInline": "%s a pagine interne", - "ToFollowingSiteSearches": "Ricerche interne", - "ToFollowingSiteSearchesInline": "%s ricerche interne", - "TopX": "Principali %s etichette", - "Transitions": "Transizioni", - "TransitionsSubcategoryHelp1": "Le Transizioni sono un report che mostra le cose che i tuoi visitatori hanno fatto immediatamente prima e dopo aver visualizzato una determinata pagina. Questa pagina spiega come accedere, comprendere e utilizzare il potente report \"Transizioni\".", - "TransitionsSubcategoryHelp2": "Maggiori dettagli", - "XOfAllPageviews": "%s di tutte le visualizzazioni di questa pagina", - "XOutOfYVisits": "%1$s (su %2$s)" - } -} diff --git a/plugins/Transitions/lang/ja.json b/plugins/Transitions/lang/ja.json deleted file mode 100644 index c73e8cdfced36e10fc150b07bfa3f64f550bee51..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ja.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "ご存知ですか? トランジションは、次のレポートの行アクションとしても利用できます。", - "AvailableInOtherReports2": "これらのレポートのいずれかの行にカーソルを合わせた後、アイコン (%s) をクリックしてトランジションを起動します。", - "BouncesInline": "%s のバウンス", - "DirectEntries": "直接エントリー", - "ErrorBack": "前の操作に戻る", - "ExitsInline": "%s 終了", - "FeatureDescription": "トランジションは、が特定ビジターのページを表示する直前と直後に行ったことを示すレポートです。 このページでは、強力な「トランジション」レポートにアクセスし、理解し、使用する方法について説明します。", - "FromCampaigns": "キャンペーンから", - "FromPreviousPages": "内部ページから", - "FromPreviousPagesInline": "内部ページからの %s", - "FromPreviousSiteSearches": "内部検索から", - "FromPreviousSiteSearchesInline": "内部検索からの %s", - "FromSearchEngines": "検索エンジンから", - "FromSocialNetworks": "ソーシャルネットワークから", - "FromWebsites": "ウェブサイトから", - "IncomingTraffic": "受信トラフィック", - "LoopsInline": "%s ページリロード", - "NoDataForAction": "%s のデータがありません", - "NoDataForActionDetails": "期間中にアクションのページビューがなかったか、アクションが無効です。", - "NumDownloads": "%s ダウンロード", - "NumOutlinks": "%s アウトリンク", - "NumPageviews": "%s ページビュー", - "OutgoingTraffic": "送信トラフィック", - "PageURLTransitions": "ページURLのトランジション", - "PeriodNotAllowed": "有効な期間を選択してください", - "PeriodNotAllowedDetails": "この機能の日数が少ない期間を選択してみてください。", - "PluginDescription": "各ページ URL の前後のアクションを新しい「トランジション」レポートでレポートします。新しいアイコンを介して「アクション」レポートで利用できます。", - "ShareOfAllPageviews": "このページは、%1$s ページビューでした ( 全ページビューの %2$s )", - "ToFollowingPages": "内部ページへ", - "ToFollowingPagesInline": "内部ページへの %s", - "ToFollowingSiteSearches": "内部検索", - "ToFollowingSiteSearchesInline": "%s 内部検索", - "TopX": "上位 %s のラベル", - "Transitions": "トランジション", - "TransitionsSubcategoryHelp1": "トランジションは、ビジターが特定のページを表示する直前と直後に行ったことを示すレポートです。 このページでは、強力な \"トランジション\" レポートにアクセスし、理解し、使用する方法について説明します。", - "TransitionsSubcategoryHelp2": "詳細", - "XOfAllPageviews": "このページの全ビューの %s", - "XOutOfYVisits": "(%2$s の内の ) %1$s" - } -} diff --git a/plugins/Transitions/lang/ka.json b/plugins/Transitions/lang/ka.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ka.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/ko.json b/plugins/Transitions/lang/ko.json deleted file mode 100644 index a7d35ae46705cf025647cdd71c837d3cc9717901..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ko.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s 반송", - "DirectEntries": "직접 항목", - "ErrorBack": "이전 동작으로 돌아가기", - "ExitsInline": "%s 이탈", - "FromCampaigns": "캠페인에서", - "FromPreviousPages": "내부 페이지에서", - "FromPreviousPagesInline": "%s 내부 페이지에서", - "FromPreviousSiteSearches": "내부 검색에서", - "FromPreviousSiteSearchesInline": "%s 내부 검색에서", - "FromSearchEngines": "검색 엔진에서", - "FromWebsites": "웹사이트에서", - "IncomingTraffic": "들어오는 트래픽", - "LoopsInline": "%s 페이지 새로고침", - "NoDataForAction": "%s 데이터 없음", - "NoDataForActionDetails": "특정 동작은 을 하는 기간 동안 페이지뷰가 일어나지 않거나 유효하지 않습니다.", - "OutgoingTraffic": "나가는 트래픽", - "PluginDescription": "새로운 변화에 대한 보고서 내 각 페이지 URL에 대한 이전 및 다음의 보고서는 새 아이콘을 통한 동작 보고서에서 확인할 수 있습니다.", - "ShareOfAllPageviews": "이 페이지의 페이지뷰 %1$s (전체 페이지뷰 수 %2$s)", - "ToFollowingPages": "내부 페이지로", - "ToFollowingPagesInline": "%s 내부 페이지", - "ToFollowingSiteSearches": "내부 검색", - "ToFollowingSiteSearchesInline": "%s 내부 검색", - "TransitionsSubcategoryHelp2": "자세히", - "XOfAllPageviews": "이 페이지의 모든 보기 중 %s", - "XOutOfYVisits": "%1$s (%2$s 나감)" - } -} diff --git a/plugins/Transitions/lang/ku.json b/plugins/Transitions/lang/ku.json deleted file mode 100644 index 12037f8751ad20e25a7a152b3cfb07787b58c0ef..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ku.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Transitions": { - "TransitionsSubcategoryHelp2": "وردەکاریی زیاتر" - } -} diff --git a/plugins/Transitions/lang/lb.json b/plugins/Transitions/lang/lb.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/lb.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/lt.json b/plugins/Transitions/lang/lt.json deleted file mode 100644 index f66c3f18e98b928076bd7d077719a9858601a613..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/lt.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Transitions": { - "FromPreviousSiteSearches": "Iš vidinės paieškos", - "ToFollowingSiteSearches": "Vidinės paieškos", - "TransitionsSubcategoryHelp2": "Išsamiau" - } -} diff --git a/plugins/Transitions/lang/lv.json b/plugins/Transitions/lang/lv.json deleted file mode 100644 index 5b8e10f2b9628ac5e25d9b6e4a893a6b9b63e643..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/lv.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Transitions": { - "TransitionsSubcategoryHelp2": "Vairāk Detaļas" - } -} diff --git a/plugins/Transitions/lang/ms.json b/plugins/Transitions/lang/ms.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ms.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/nb.json b/plugins/Transitions/lang/nb.json deleted file mode 100644 index 833ec0b6045803d77359011d1d0feff883f47019..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/nb.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Visste du at overganger også er tilgjengelig som en rad-handling i følgende rapporter:", - "AvailableInOtherReports2": "Hold pekeren over en av disse rapportene og klikk på overgangsikonet %s for å starte den.", - "BouncesInline": "%s sprett", - "DirectEntries": "Direkte treff", - "ErrorBack": "Gå tilbake til forrige handling", - "ExitsInline": "%s utganger", - "FeatureDescription": "Overganger gir deg en rapport som viser deg tingene dine besøkere gjorde før eller etter visning av en gitt side. Denne siden forklarer hvor man finner, forstår og bruker den kraftige overgangsrapporten.", - "FromCampaigns": "Fra kampanjer", - "FromPreviousPages": "Fra interne sider", - "FromPreviousPagesInline": "%s fra interne sider", - "FromPreviousSiteSearches": "Fra interne søk", - "FromPreviousSiteSearchesInline": "%s fra interne søk", - "FromSearchEngines": "Fra søkemotorer", - "FromSocialNetworks": "Fra sosiale nettverk", - "FromWebsites": "Fra nettsider", - "IncomingTraffic": "Innkommende trafikk", - "LoopsInline": "%s innlastinger av side på nytt", - "NoDataForAction": "Det finnes ingen data for %s", - "NoDataForActionDetails": "Enten har handlingen ingen sidevisninger i perioden eller så er den ugyldig.", - "NumDownloads": "%s nedlastinger", - "NumOutlinks": "%s utlenker", - "NumPageviews": "%s sidevisninger", - "OutgoingTraffic": "Utgående trafikk", - "PageURLTransitions": "Sidens nettadresse-overganger", - "PeriodNotAllowed": "Tidsperioden tillates ikke", - "PeriodNotAllowedDetails": "Denne funksjonen er ikke tilgjengelig i denne perioden. Prøv å velge en med færre dager.", - "PluginDescription": "Rapporterer forrige og neste handlinger for hver URL i en ny Overganger-rapport, tilgjengelig i Handlinger-rapporten og via et nytt ikon.", - "ShareOfAllPageviews": "Denne siden hadde %1$s sidevisninger (%2$s av alle sidevisninger)", - "ToFollowingPages": "Til interne sider", - "ToFollowingPagesInline": "%s til interne sider", - "ToFollowingSiteSearches": "Interne søk", - "ToFollowingSiteSearchesInline": "%s interne søk", - "TopX": "Toppetiketter for %s", - "Transitions": "Overganger", - "TransitionsSubcategoryHelp1": "Overganger gir den en rapport som viser deg de tingene besøkende gjorde rett før eller etter de så en gitt side. Denne siden forklarer hvordan man finner, forstår og bruker den kraftige overgangsrapporten.", - "TransitionsSubcategoryHelp2": "Flere detaljer", - "XOfAllPageviews": "%s av alle besøk på denne siden", - "XOutOfYVisits": "%1$s (av %2$s)" - } -} diff --git a/plugins/Transitions/lang/nl.json b/plugins/Transitions/lang/nl.json deleted file mode 100644 index 18a999d49fbe0d53f82c4ff483d22195d860c17f..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/nl.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Wist u dit? Transities zijn ook beschikbaar als een rij-actie in de volgende rapporten:", - "AvailableInOtherReports2": "Start transities door op hun pictogram (%s) te klikken nadat je met de muis over een rij in een van deze rapporten beweegt.", - "BouncesInline": "%s bounces", - "DirectEntries": "Directe bezoeken", - "ErrorBack": "Ga terug naar de vorige actie", - "ExitsInline": "%s einde bezoeken", - "FeatureDescription": "Transities is een rapport dat weergeeft wat uw bezoekers deden meteen voor en na het bekijken van een bepaalde pagina. Op deze pagina wordt uitgelegd hoe u het krachtige rapport \"Transities\" kunt openen, begrijpen en gebruiken.", - "FromCampaigns": "Van campagnes", - "FromPreviousPages": "Van interne pagina's", - "FromPreviousPagesInline": "%s van interne pagina's", - "FromPreviousSiteSearches": "Van interne zoekopdracht", - "FromPreviousSiteSearchesInline": "%s van interne zoekopdrachten", - "FromSearchEngines": "Van zoekmachines", - "FromSocialNetworks": "Van sociale netwerken", - "FromWebsites": "Van websites", - "IncomingTraffic": "Inkomend verkeer", - "LoopsInline": "%s pagina herladen", - "NoDataForAction": "Geen gegevens voor %s", - "NoDataForActionDetails": "Deze activiteit had geen paginaweergaves gedurende de periode, of is ongeldig.", - "NumDownloads": "%s downloads", - "NumOutlinks": "%s uitgaande linken", - "NumPageviews": "%s paginaweergaven", - "OutgoingTraffic": "Uitgaand verkeer", - "PageURLTransitions": "Pagina URL-transities", - "PeriodNotAllowed": "Selecteer een geldige periode", - "PeriodNotAllowedDetails": "Probeer voor deze functionaliteit een periode met minder dagen te selecteren.", - "PluginDescription": "Rapporteert vorige en volgende acties voor elke pagina-URL in een nieuw rapport \"Transities\", beschikbaar in de rapporten \"Acties\" via een nieuw pictogram.", - "ShareOfAllPageviews": "Deze pagina had %1$s paginaweergaven (%2$s van alle paginaweergaven)", - "ToFollowingPages": "Naar interne pagina's", - "ToFollowingPagesInline": "%s naar interne pagina's", - "ToFollowingSiteSearches": "Interne zoekopdrachten", - "ToFollowingSiteSearchesInline": "%s interne zoekopdrachten", - "TopX": "Top %s labels", - "Transitions": "Transities", - "TransitionsSubcategoryHelp1": "Transities is een rapport dat toont wat uw bezoekers deden meteen voor en na het bekijken van een bepaalde pagina. Op deze pagina wordt uitgelegd hoe u het krachtige rapport \"Transities\" kunt openen, begrijpen en gebruiken.", - "TransitionsSubcategoryHelp2": "Meer details", - "XOfAllPageviews": "%s van alle weergaven van deze pagina", - "XOutOfYVisits": "%1$s (van de %2$s)" - } -} diff --git a/plugins/Transitions/lang/nn.json b/plugins/Transitions/lang/nn.json deleted file mode 100644 index 306f674866a583eb8b86df1e3da18a1b2c401260..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/nn.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Transitions": { - "TransitionsSubcategoryHelp2": "Meer details" - } -} diff --git a/plugins/Transitions/lang/pl.json b/plugins/Transitions/lang/pl.json deleted file mode 100644 index 703049167988c13194f38c2d1894349b0e41f1aa..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/pl.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s porzucenia", - "DirectEntries": "Wejścia Bezpośrednie", - "ErrorBack": "Cofnij do poprzedniej akcji", - "ExitsInline": "%s wyjścia", - "FromCampaigns": "Z Kampanii", - "FromPreviousPages": "Ze stron serwisu", - "FromPreviousPagesInline": "%s stron serwisu", - "FromPreviousSiteSearches": "Z wyszukiwarki serwisu", - "FromPreviousSiteSearchesInline": "%s z wyszukiwarki serwisu", - "FromSearchEngines": "Z wyszukiwarek", - "FromWebsites": "Z serwisów", - "IncomingTraffic": "Ruch przychodzący", - "LoopsInline": "%s odświeżeń strony", - "NoDataForAction": "Brak danych dla %s", - "NoDataForActionDetails": "Akcja nie powodowała wyświetleń strony w czasie lub jest błędna.", - "NumDownloads": "%s pobrania", - "NumOutlinks": "%s linków zewnętrznych", - "NumPageviews": "%s wyświetleń strony", - "OutgoingTraffic": "Ruch wychodzący", - "PluginDescription": "Prezentuje poprzednie i następne akcje dla każdej strony w raporcie Transitions, dostępne w raporcie Akcji poprzez nową ikonę.", - "ShareOfAllPageviews": "Wybrana strona miała %1$s wyświetleń (%2$s wszystkich wyświetleń)", - "ToFollowingPages": "Do stron serwisu", - "ToFollowingPagesInline": "%s stron serwisu", - "ToFollowingSiteSearches": "Wewnętrzne Wyszukiwania", - "ToFollowingSiteSearchesInline": "%s wewnętrznych wyszukiwań", - "Transitions": "Przejścia", - "TransitionsSubcategoryHelp2": "Więcej informacji", - "XOfAllPageviews": "%s wszystkich wyświetleń tej strony", - "XOutOfYVisits": "%1$s (z %2$s)" - } -} diff --git a/plugins/Transitions/lang/pt-br.json b/plugins/Transitions/lang/pt-br.json deleted file mode 100644 index c9822bb1590ba0684d1470cbad9a07aa746e9a7e..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/pt-br.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Você sabia? Transições também está disponível como uma ação de linha nos seguintes relatórios:", - "AvailableInOtherReports2": "Inicie as transições clicando em seu ícone (%s) depois de passar o mouse sobre uma linha em qualquer um desses relatórios.", - "BouncesInline": "%s rejeições", - "DirectEntries": "Entradas diretas", - "ErrorBack": "Voltar para a ação anterior", - "ExitsInline": "%s saídas", - "FeatureDescription": "Transições é um relatório que mostra as coisas que seus visitantes fizeram diretamente antes e depois de visualizar uma determinada página. Esta página explica como acessar, entender e usar o poderoso relatório \"Transições\".", - "FromAIAssistants": "De assistentes de IA", - "FromCampaigns": "De campanhas", - "FromPreviousPages": "De páginas internas", - "FromPreviousPagesInline": "%s de páginas internas", - "FromPreviousSiteSearches": "De pesquisa interna", - "FromPreviousSiteSearchesInline": "%s de pesquisas internas", - "FromSearchEngines": "Dos motores de busca", - "FromSocialNetworks": "Das redes sociais", - "FromWebsites": "De sites web", - "IncomingTraffic": "Tráfego de entrada", - "LoopsInline": "%s atualizações de página", - "NoDataForAction": "Não há dados para %s", - "NoDataForActionDetails": "A ação não teve exibições de página durante o período ou é inválida.", - "NumDownloads": "%s baixados", - "NumOutlinks": "%s links externos", - "NumPageviews": "%s exibições de página", - "OutgoingTraffic": "Tráfego de saída", - "PageURLTransitions": "Transições de URL da página", - "PeriodNotAllowed": "Selecione um período de tempo válido", - "PeriodNotAllowedDetails": "Tente selecionar um período com menos dias para esse recurso.", - "PluginDescription": "Relata as ações anteriores e seguintes para cada URL da página em um novo relatório \"Transições\", disponível nos relatórios \"Ações\" por meio de um novo ícone.", - "ShareOfAllPageviews": "Esta página teve %1$s exibições (%2$s de todas as exibições)", - "ToFollowingPages": "Para páginas internas", - "ToFollowingPagesInline": "%s para páginas internas", - "ToFollowingSiteSearches": "Pesquisas internas", - "ToFollowingSiteSearchesInline": "%s pesquisas internas", - "TopX": "%s principais rótulos", - "Transitions": "Transições", - "TransitionsSubcategoryHelp1": "Transições é um relatório que mostra as coisas que seus visitantes fizeram diretamente antes e depois de visualizar uma determinada página. Esta página explica como acessar, entender e usar o poderoso relatório \"Transições\".", - "TransitionsSubcategoryHelp2": "Mais detalhes", - "XOfAllPageviews": "%s de todas as visualizações desta página", - "XOutOfYVisits": "%1$s (de %2$s)" - } -} diff --git a/plugins/Transitions/lang/pt.json b/plugins/Transitions/lang/pt.json deleted file mode 100644 index 914718bd4874ccba658c2f416f31b85bf108c78b..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/pt.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Sabia que? As transições também estão disponíveis como uma ação de linha nos seguintes relatórios:", - "AvailableInOtherReports2": "Inicie as transições clicando em seu ícone (%s) depois de passar o mouse sobre uma linha em qualquer um desses relatórios.", - "BouncesInline": "%s ressaltos", - "DirectEntries": "Entradas diretas", - "ErrorBack": "Voltar à ação anterior", - "ExitsInline": "%s saídas", - "FeatureDescription": "Transições é um relatório que mostra as coisas que seus visitantes fizeram diretamente antes e depois de visualizar uma determinada página. Esta página explica como acessar, entender e usar o poderoso relatório \"Transições\".", - "FromCampaigns": "De campanhas", - "FromPreviousPages": "De páginas internas", - "FromPreviousPagesInline": "%s de páginas internas", - "FromPreviousSiteSearches": "Da pesquisa interna", - "FromPreviousSiteSearchesInline": "%s de pesquisas internas", - "FromSearchEngines": "Dos motores de busca", - "FromSocialNetworks": "Das redes sociais", - "FromWebsites": "De sites", - "IncomingTraffic": "Tráfego de entrada", - "LoopsInline": "%s recarregamentos de páginas", - "NoDataForAction": "Sem dados para %s", - "NoDataForActionDetails": "A ação não teve exibições de página durante o período ou é inválida.", - "NumDownloads": "%s descargas", - "NumOutlinks": "%s ligações de saída", - "NumPageviews": "%s visualizações de páginas", - "OutgoingTraffic": "Tráfego de saída", - "PageURLTransitions": "Endereços de páginas de transição", - "PeriodNotAllowed": "Selecione um período de tempo válido", - "PeriodNotAllowedDetails": "Tente selecionar um período com menos dias para esse recurso.", - "PluginDescription": "Relata as ações anteriores e seguintes para cada URL da página em um novo relatório \"Transições\", disponível nos relatórios \"Ações\" por meio de um novo ícone.", - "ShareOfAllPageviews": "Esta página teve %1$s visualizações (de todas as %2$s visualizações)", - "ToFollowingPages": "Para páginas internas", - "ToFollowingPagesInline": "%s para páginas internas", - "ToFollowingSiteSearches": "Pesquisas internas", - "ToFollowingSiteSearchesInline": "%s pesquisas internas", - "TopX": "%s principais etiquetas", - "Transitions": "Transições", - "TransitionsSubcategoryHelp1": "Transições é um relatório que mostra as coisas que seus visitantes fizeram diretamente antes e depois de visualizar uma determinada página. Esta página explica como acessar, entender e usar o poderoso relatório \"Transições\".", - "TransitionsSubcategoryHelp2": "Mais detalhes", - "XOfAllPageviews": "%s de todas as visualizações desta página", - "XOutOfYVisits": "%1$s (de %2$s)" - } -} diff --git a/plugins/Transitions/lang/ro.json b/plugins/Transitions/lang/ro.json deleted file mode 100644 index 5a47950395688391c93510c116848fcec3ccfb65..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ro.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s salturi", - "DirectEntries": "Intrări directe", - "ErrorBack": "Du-te înapoi la acțiunea anterioară", - "ExitsInline": "%s ieșiri", - "FromCampaigns": "Din campanii", - "FromPreviousPages": "De la pagini interne", - "FromPreviousPagesInline": "%s de la paginile interne", - "FromPreviousSiteSearches": "De la cautare interna", - "FromPreviousSiteSearchesInline": "%s de la cautarile interne", - "FromSearchEngines": "De la motoarele de căutare", - "FromWebsites": "De pe website-uri", - "IncomingTraffic": "Traficul de intrare", - "LoopsInline": "%s reincarcare pagina", - "NoDataForAction": "Nu este nici o data pentru %s", - "NoDataForActionDetails": "Fie acțiunea nu a avut nici o afișări de pagină în timpul perioadei sau este invalida.", - "NumDownloads": "%sdescărcări", - "OutgoingTraffic": "traficul de ieșire", - "ShareOfAllPageviews": "Această pagină a avut vizualizări de %1$s pagini (%2$s din toate vizualizări de pagini)", - "ToFollowingPages": "Către paginile interne", - "ToFollowingPagesInline": "%s la pagini interne", - "ToFollowingSiteSearches": "Căutări interne", - "ToFollowingSiteSearchesInline": "%s căutări interne", - "TransitionsSubcategoryHelp2": "Mai multe detalii", - "XOfAllPageviews": "%s toate vizualizarile de pe aceasta pagina", - "XOutOfYVisits": "%1$s (din %2$s)" - } -} diff --git a/plugins/Transitions/lang/ru.json b/plugins/Transitions/lang/ru.json deleted file mode 100644 index 0f629128456cc7fc393d5afa6cf6c3591b51725d..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ru.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Вы знали? Переходы также доступны как действие строки в следующих отчётах:", - "AvailableInOtherReports2": "Просто наведите указатель на строку в любом из этих отчётов и щелкните значок перехода %s, чтобы запустить его.", - "BouncesInline": "%s отскоков (отказов)", - "DirectEntries": "Прямых входов", - "ErrorBack": "Верниться к предыдущему действию", - "ExitsInline": "%s уходов с сайта", - "FeatureDescription": "Переходы предоставляют вам отчёт, который показывает, что ваши посетители делали непосредственно до и после просмотра определенной страницы. На этой странице объясняется, как получить доступ, понять и использовать мощный отчёт о переходах.", - "FromCampaigns": "Из кампаний", - "FromPreviousPages": "С внутренних страниц", - "FromPreviousPagesInline": "%s с внутренних страниц", - "FromPreviousSiteSearches": "С внутреннего поиска по сайту", - "FromPreviousSiteSearchesInline": "%s с внутреннего поиска по сайту", - "FromSearchEngines": "Из поисковых систем", - "FromSocialNetworks": "Из социальных сетей", - "FromWebsites": "С сайтов", - "IncomingTraffic": "Входящий трафик", - "LoopsInline": "%s обновлений страницы", - "NoDataForAction": "Нет данных для %s", - "NoDataForActionDetails": "Не было совершено таких действий или они неправильны.", - "NumDownloads": "%s загрузок", - "NumOutlinks": "%s исходящих ссылок", - "NumPageviews": "%s просмотров страниц", - "OutgoingTraffic": "Исходящий трафик", - "PageURLTransitions": "URL страницы перехода", - "PluginDescription": "Сообщает о предыдущих и последующих действиях для каждого URL-адреса страницы в новом отчёте о переходах, доступном в отчётах о действиях с помощью нового значка.", - "ShareOfAllPageviews": "У этой страницы %1$s просмотров (всего просмотров страниц: %2$s)", - "ToFollowingPages": "На страницы сайта", - "ToFollowingPagesInline": "%s на внутренние страницы", - "ToFollowingSiteSearches": "внутренних поисков по сайту", - "ToFollowingSiteSearchesInline": "%s внутренних поисков по сайту", - "TopX": "Топ %s меток", - "Transitions": "Переходы", - "TransitionsSubcategoryHelp1": "Переходы предоставляют вам отчёт, который показывает, что ваши посетители делали непосредственно до и после просмотра определенной страницы. На этой странице объясняется, как получить доступ, понять и использовать мощный отчёт о переходах.", - "TransitionsSubcategoryHelp2": "Детализация", - "XOfAllPageviews": "%s из всех просмотров страницы", - "XOutOfYVisits": "%1$s (из %2$s)" - } -} diff --git a/plugins/Transitions/lang/si.json b/plugins/Transitions/lang/si.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/si.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/sk.json b/plugins/Transitions/lang/sk.json deleted file mode 100644 index 4d5f38fc074cb9c0b4af1d7ca9850e1d31dc0714..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/sk.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Transitions": { - "TransitionsSubcategoryHelp2": "Viac informácií" - } -} diff --git a/plugins/Transitions/lang/sl.json b/plugins/Transitions/lang/sl.json deleted file mode 100644 index 24f1597292c99940562d73eea535db16fa8cb733..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/sl.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s odbojev", - "ErrorBack": "Nazaj na prejšnje dejanje", - "ExitsInline": "%s izhodov", - "FromPreviousPages": "Iz notranjih strani", - "FromPreviousPagesInline": "%s iz notranjih strani", - "FromSearchEngines": "S spletnih iskalnikov", - "NoDataForAction": "Ni podatkov za %s", - "OutgoingTraffic": "Izhodni promet", - "ShareOfAllPageviews": "Ta stran je imela %1$s ogledov strani (%2$s od vseh ogledov strani)", - "ToFollowingPages": "Na notranje strani", - "ToFollowingPagesInline": "%s na notranje strani", - "ToFollowingSiteSearches": "Notranja iskanja", - "ToFollowingSiteSearchesInline": "%s notranjih iskanj", - "TransitionsSubcategoryHelp2": "Več podrobnosti", - "XOutOfYVisits": "%1$s (od %2$s)" - } -} diff --git a/plugins/Transitions/lang/sq.json b/plugins/Transitions/lang/sq.json deleted file mode 100644 index 68b27be6fc130fa8164e0c802fe58b98137cbec0..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/sq.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "A e dinit? Tranzicionet janë të passhme edhe si veprim rreshti në raportet vijues:", - "AvailableInOtherReports2": "Thjesht kaloni kursorin përsipër një rreshti te cilido prej këtyre raporteve dhe klikoni mbi ikonën e tranzicionit (%s) për ta vënë në punë.", - "BouncesInline": "%s kthime", - "DirectEntries": "Hyrje të drejtpërdrejta", - "ErrorBack": "Kthehu te veprimi i mëparshëm", - "ExitsInline": "%s largime", - "FeatureDescription": "Tranzicionet janë një raport që tregon gjëra që vizitorët tuaj bënë fill para dhe pas parjes së një faqeje të dhënë. Kjo faqe do të shpjegojë si të hyhet, të kuptohet dhe të përdoret raporti i fuqishëm “Tranzicione”.", - "FromAIAssistants": "Nga asistentë IA", - "FromCampaigns": "Prej fushatash", - "FromPreviousPages": "Prej faqesh të brendshme", - "FromPreviousPagesInline": "%s prej faqesh të brendshme", - "FromPreviousSiteSearches": "Prej kërkimesh të brendshme", - "FromPreviousSiteSearchesInline": "%s prej kërkimesh të brendshme", - "FromSearchEngines": "Prej motorë kërkimesh", - "FromSocialNetworks": "Prej rrjetesh shoqërore", - "FromWebsites": "Prej sajtesh", - "IncomingTraffic": "Trafik ardhës", - "LoopsInline": "%s ringarkime faqesh", - "NoDataForAction": "S’ka të dhëna për %s", - "NoDataForActionDetails": "Ose veprimi nuk ka parje faqesh gjatë periudhës, ose është i pavlefshëm.", - "NumDownloads": "%s shkarkime", - "NumOutlinks": "%s lidhje për jashtë", - "NumPageviews": "%s parje faqesh", - "OutgoingTraffic": "Trafik ikës", - "PageURLTransitions": "Tranzicione URL-je faqeje", - "PeriodNotAllowed": "Përzgjidhni një periudhë kohore të vlefshme", - "PeriodNotAllowedDetails": "Provoni për këtë veçori përzgjedhjen e një periudhe me më pak ditë.", - "PluginDescription": "Raporton, në një raport të ri “Tranzicione”, veprime të mëparshme dhe në vijim për çdo URL faqeje, i passhëm te raportet “Veprime” përmes një ikone të re.", - "ShareOfAllPageviews": "Kjo faqe pati %1$s parje faqesh (%2$s e krejt parjeve të faqeve)", - "ToFollowingPages": "Te faqe të brendshme", - "ToFollowingPagesInline": "%s te faqe të brendshme", - "ToFollowingSiteSearches": "Kërkime të brendshme", - "ToFollowingSiteSearchesInline": "%s kërkime të brendshme", - "TopX": "%s etiketat kryesuese", - "Transitions": "Tranzicione", - "TransitionsSubcategoryHelp1": "Tranzicionet janë një raport që tregon gjëra që vizitorët tuaj bënë fill para dhe pas parjes së një faqeje të dhënë. Kjo faqe do të shpjegojë si të hyhet, të kuptohet dhe të përdoret raporti i fuqishëm “Tranzicione”.", - "TransitionsSubcategoryHelp2": "Më tepër hollësi", - "XOfAllPageviews": "%s e krejt parjeve të kësaj faqeje", - "XOutOfYVisits": "%1$s (nga %2$s gjithsej)" - } -} diff --git a/plugins/Transitions/lang/sr.json b/plugins/Transitions/lang/sr.json deleted file mode 100644 index c44766a5ebc11f359128d48c8409614afacd251c..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/sr.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s odbijanja", - "DirectEntries": "Direktni ulasci", - "ErrorBack": "Vrati se na prethodnu akciju", - "ExitsInline": "%s izlaza", - "FromCampaigns": "Iz kampanja", - "FromPreviousPages": "Od internih stranica", - "FromPreviousPagesInline": "%s sa internih strana", - "FromPreviousSiteSearches": "Iz pretraga sajta", - "FromPreviousSiteSearchesInline": "%s iz pretraživanja sajta", - "FromSearchEngines": "Od pretraživača", - "FromWebsites": "Od sajtova", - "IncomingTraffic": "Dolazni saobraćaj", - "LoopsInline": "%s ponovnih učitavanja stranice", - "NoDataForAction": "Nema podataka za %s", - "NoDataForActionDetails": "Ili akcija nema nijedan pregled stranica za dati period ili ona nije validna.", - "NumDownloads": "%s preuzimanja", - "NumOutlinks": "%s izlaznih linkova", - "NumPageviews": "%s prikaza stranica", - "OutgoingTraffic": "Odlazni saobraćaj", - "PluginDescription": "Izveštaj o prethodnoj i sledećoj akciji za svaki URL", - "ShareOfAllPageviews": "Ova stranica ima %1$s pregleda (%2$s od svih pregleda)", - "ToFollowingPages": "Ka internim stranicama", - "ToFollowingPagesInline": "%s ka drugim stranicama", - "ToFollowingSiteSearches": "Pretraživanja sajta", - "ToFollowingSiteSearchesInline": "%s pretraživanja sajta", - "TransitionsSubcategoryHelp2": "Više detalja", - "XOfAllPageviews": "%s od svih pregleda ove strane", - "XOutOfYVisits": "%1$s (od %2$s)" - } -} diff --git a/plugins/Transitions/lang/sv.json b/plugins/Transitions/lang/sv.json deleted file mode 100644 index 9b5db69331b0d5e67d7643e9459c456b6a1aa732..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/sv.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Visste du att övergångar även finns som en radåtgärd i följande rapporter:", - "AvailableInOtherReports2": "För muspekaren över en rad i någon av dessa rapporter och klicka på övergångsikonen %s för att starta den.", - "BouncesInline": "%s avvisningar", - "DirectEntries": "Direktträffar", - "ErrorBack": "Gå tillbaka till föregående åtgärd", - "ExitsInline": "%s utgångar", - "FeatureDescription": "Övergångar ger dig en rapport som visar de saker som dina besökare gjorde direkt före och efter visning av en viss sida. Den här sidan kommer att förklara hur du får åtkomst till, förstår och använder den kraftfulla Övergångar-rapporten.", - "FromAIAssistants": "Från AI-assistenter", - "FromCampaigns": "Från kampanjer", - "FromPreviousPages": "Från interna sidor", - "FromPreviousPagesInline": "%s från interna sidor", - "FromPreviousSiteSearches": "Från intern webbplatssök", - "FromPreviousSiteSearchesInline": "%s från interna sökningar", - "FromSearchEngines": "Från sökmotorer", - "FromSocialNetworks": "Från sociala nätverk", - "FromWebsites": "Från webbplatser", - "IncomingTraffic": "Inkommande trafik", - "LoopsInline": "%s siduppdateringar", - "NoDataForAction": "Inga data för %s", - "NoDataForActionDetails": "Antingen har händelsen inte haft några sidvisningar under perioden eller så är den ogiltig.", - "NumDownloads": "%s nerladdningar", - "NumOutlinks": "%s utlänkar", - "NumPageviews": "%s sidvisningar", - "OutgoingTraffic": "Utgående trafik", - "PageURLTransitions": "Sidans URL-övergångar", - "PeriodNotAllowed": "Välj en giltig tidsperiod", - "PeriodNotAllowedDetails": "Försök välja en period med färre dagar för denna funktion.", - "PluginDescription": "Rapporterar tidigare och efterföljande händelser för varje sid-URL i en ny Övergångsrapport, som finns i Händelserapporter via en ny ikon.", - "ShareOfAllPageviews": "Den här sidan hade %1$s sidvisningar (%2$s av alla sidvisningar)", - "ToFollowingPages": "Till interna sidor", - "ToFollowingPagesInline": "%s till interna sidor", - "ToFollowingSiteSearches": "Interna sökningar", - "ToFollowingSiteSearchesInline": "%s interna sökningar", - "TopX": "%s främsta etiketterna", - "Transitions": "Övergångar", - "TransitionsSubcategoryHelp1": "Övergångar ger dig en rapport som visar de saker som dina besökare gjorde direkt före och efter visning av en viss sida. Den här sidan kommer att förklara hur du får åtkomst till, förstår och använder den kraftfulla Övergång-rapporten.", - "TransitionsSubcategoryHelp2": "Fler detaljer", - "XOfAllPageviews": "%s av alla sidvisningar", - "XOutOfYVisits": "%1$s (av %2$s)" - } -} diff --git a/plugins/Transitions/lang/ta.json b/plugins/Transitions/lang/ta.json deleted file mode 100644 index b3f3b8cd4b54efb3e567c92911f153f71b684013..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ta.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "உங்களுக்குத் தெரியுமா? பின்வரும் அறிக்கைகளில் ஒரு வரிசை நடவடிக்கையாக மாற்றங்கள் கிடைக்கின்றன:", - "AvailableInOtherReports2": "இந்த அறிக்கைகளில் ஏதேனும் ஒரு வரிசையை வட்டமிட்ட பிறகு அவர்களின் ஐகானை (%s) சொடுக்கு செய்வதன் மூலம் மாற்றங்களைத் தொடங்கவும்.", - "BouncesInline": "%s பவுன்ச்", - "DirectEntries": "நேரடி உள்ளீடுகள்", - "ErrorBack": "முந்தைய செயலுக்குச் செல்லுங்கள்", - "ExitsInline": "%s வெளியேறுகின்றன", - "FeatureDescription": "மாற்றங்கள் என்பது கொடுக்கப்பட்ட பக்கத்தைப் பார்ப்பதற்கு முன்னும் பின்னும் உங்கள் பார்வையாளர்கள் செய்த காரியங்களைக் காட்டும் ஒரு அறிக்கை. சக்திவாய்ந்த \"மாற்றங்கள்\" அறிக்கையை எவ்வாறு அணுகுவது, புரிந்துகொள்வது மற்றும் பயன்படுத்துவது என்பதை இந்த பக்கம் விளக்குகிறது.", - "FromAIAssistants": "செஅ உதவியாளர்களிடமிருந்து", - "FromCampaigns": "பிரச்சாரங்களிலிருந்து", - "FromPreviousPages": "உள் பக்கங்களிலிருந்து", - "FromPreviousPagesInline": "உள் பக்கங்களிலிருந்து %s", - "FromPreviousSiteSearches": "உள் தேடலில் இருந்து", - "FromPreviousSiteSearchesInline": "உள் தேடல்களிலிருந்து %s", - "FromSearchEngines": "தேடுபொறிகளிலிருந்து", - "FromSocialNetworks": "சமூக வலைப்பின்னல்களிலிருந்து", - "FromWebsites": "வலைத்தளங்களிலிருந்து", - "IncomingTraffic": "உள்வரும் போக்குவரத்து", - "LoopsInline": "%s பக்க மறுஏற்றம்", - "NoDataForAction": "%s க்கு தரவு இல்லை", - "NoDataForActionDetails": "இந்த நடவடிக்கைக்கு காலகட்டத்தில் எந்த பக்கக் காட்சிகளும் இல்லை, அல்லது அது தவறானது.", - "NumDownloads": "%s பதிவிறக்கங்கள்", - "NumOutlinks": "%s அவுட்லின்கள்", - "NumPageviews": "%s பக்கக் காட்சிகள்", - "OutgoingTraffic": "வெளிச்செல்லும் போக்குவரத்து", - "PageURLTransitions": "பக்க முகவரி மாற்றங்கள்", - "PeriodNotAllowed": "செல்லுபடியாகும் காலத்தைத் தேர்ந்தெடுக்கவும்", - "PeriodNotAllowedDetails": "இந்த அம்சத்திற்கு குறைவான நாட்களுடன் ஒரு காலத்தைத் தேர்ந்தெடுக்க முயற்சிக்கவும்.", - "PluginDescription": "புதிய \"மாற்றங்கள்\" அறிக்கையில் ஒவ்வொரு பக்க முகவரி க்கான முந்தைய மற்றும் பின்வரும் செயல்களை அறிக்கைகள் புதிய படவுரு வழியாக \"செயல்கள்\" அறிக்கைகளில் கிடைக்கின்றன.", - "ShareOfAllPageviews": "இந்த பக்கத்தில் %1$s பக்கக் காட்சிகள் இருந்தன (அனைத்து பக்கக் காட்சிகளிலும் %2$s)", - "ToFollowingPages": "உள் பக்கங்களுக்கு", - "ToFollowingPagesInline": "உள் பக்கங்களுக்கு %s", - "ToFollowingSiteSearches": "உள் தேடல்கள்", - "ToFollowingSiteSearchesInline": "%s உள் தேடல்கள்", - "TopX": "சிறந்த %s லேபிள்கள்", - "Transitions": "மாற்றங்கள்", - "TransitionsSubcategoryHelp1": "மாற்றங்கள் என்பது கொடுக்கப்பட்ட பக்கத்தைப் பார்ப்பதற்கு முன்னும் பின்னும் உங்கள் பார்வையாளர்கள் செய்த காரியங்களைக் காட்டும் ஒரு அறிக்கை. சக்திவாய்ந்த \"மாற்றங்கள்\" அறிக்கையை எவ்வாறு அணுகுவது, புரிந்துகொள்வது மற்றும் பயன்படுத்துவது என்பதை இந்த பக்கம் விளக்குகிறது.", - "TransitionsSubcategoryHelp2": "மேலும் விவரங்கள்", - "XOfAllPageviews": "இந்த பக்கத்தின் அனைத்து பார்வைகளின் %s", - "XOutOfYVisits": "%1$s ( %2$s இல்)" - } -} diff --git a/plugins/Transitions/lang/te.json b/plugins/Transitions/lang/te.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/te.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/th.json b/plugins/Transitions/lang/th.json deleted file mode 100644 index 6d9456d0d4007d661258da7ebf624be3c8ea9bb7..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/th.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Transitions": { - "FromCampaigns": "จากแคมเปญ", - "FromWebsites": "จากเว็บไซต์", - "NoDataForAction": "ยังไม่มีข้อมูลสำหรับ %s" - } -} diff --git a/plugins/Transitions/lang/tl.json b/plugins/Transitions/lang/tl.json deleted file mode 100644 index 3569e2819a2c3c7abcff7189e1a272b1274f6955..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/tl.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s mga bounce", - "DirectEntries": "Direktang mga entry", - "ErrorBack": "Bumalik sa nakaraang aksyon", - "ExitsInline": "%s paglabas", - "FromCampaigns": "Mula sa campaigns", - "FromPreviousPages": "Mula sa Panloob na Pahina", - "FromPreviousPagesInline": "%s mula sa mga panloob na mga pahina", - "FromPreviousSiteSearches": "Mula sa panloob na paghahanap", - "FromPreviousSiteSearchesInline": "%s mula sa mga panloob na paghahanap", - "FromSearchEngines": "Mula sa Search Engine", - "FromWebsites": "Mula sa mga website", - "IncomingTraffic": "Incoming traffic", - "LoopsInline": "muling pagload ng pahina %s", - "NoDataForAction": "Walang data para sa %s", - "NoDataForActionDetails": "Maaaring ang aksyon ay walang pageview sa panahon ng o ito ay hindi wasto.", - "OutgoingTraffic": "Mga outgoing na traffic", - "ShareOfAllPageviews": "Ang pahinang ito ay may %1$s na pageview (%2$s ng lahat ng mga pageview)", - "ToFollowingPages": "Sa mga panloob na mga pahina", - "ToFollowingPagesInline": "%s panloob na mga pahina", - "ToFollowingSiteSearches": "Panloob na paghahanap", - "ToFollowingSiteSearchesInline": "panloob na paghahanap %s", - "TransitionsSubcategoryHelp2": "Higit pang mga detalye", - "XOfAllPageviews": "%s ng lahat ng mga tanawin ng pahinang ito", - "XOutOfYVisits": "%1$s (mula sa %2$s)" - } -} diff --git a/plugins/Transitions/lang/tr.json b/plugins/Transitions/lang/tr.json deleted file mode 100644 index 5368368642c750ab0d930a606b4f5d13159d96f6..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/tr.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Geçişlerin ayrıca şu raporlarda da satır işlemi olarak bulunduğunu biliyor musunuz:", - "AvailableInOtherReports2": "Bu raporlardaki herhangi bir satırın üzerine gelip simgesine (%s) tıklayarak geçişleri görüntüleyebilirsiniz.", - "BouncesInline": "%s hemen çıkma", - "DirectEntries": "Doğrudan girişler", - "ErrorBack": "Önceki işleme dön", - "ExitsInline": "%s çıkış", - "FeatureDescription": "Geçişler raporu, kullanıcıların belirtilen bir sayfaya gelmeden önce ve sonra yaptıkları işlemleri görüntüler. Bu bölümde, güçlü \"Geçişler\" raporuna nasıl erişeceğinizi ve raporun içeriğini nasıl anlayıp kullanabileceğinizi anlatan bilgiler bulunur.", - "FromAIAssistants": "Yapay zeka yardımcılarından", - "FromCampaigns": "Kampanyalardan", - "FromPreviousPages": "İç sayfalardan", - "FromPreviousPagesInline": "%s iç sayfalardan", - "FromPreviousSiteSearches": "İç aramalardan", - "FromPreviousSiteSearchesInline": "%s iç aramalardan", - "FromSearchEngines": "Arama motorlarından", - "FromSocialNetworks": "Sosyal ağlardan", - "FromWebsites": "Sitelerden", - "IncomingTraffic": "Gelen trafik", - "LoopsInline": "%s sayfa yüklemesi", - "NoDataForAction": "%s için herhangi bir veri yok", - "NoDataForActionDetails": "Zaman aralığından işlem için hiç bir sayfa görüntülenmemiş ya da geçersiz.", - "NumDownloads": "%s indirme", - "NumOutlinks": "%s dış bağlantı", - "NumPageviews": "%s sayfa gösterimi", - "OutgoingTraffic": "Giden trafik", - "PageURLTransitions": "Sayfa adresi geçişleri", - "PeriodNotAllowed": "Geçerli bir zaman aralığı seçin", - "PeriodNotAllowedDetails": "Bu özellik için daha az günü kapsayan bir aralık seçmeyi deneyin.", - "PluginDescription": "\"İşlemler\" raporlarındaki yeni simgesi ile erişilebilen yeni \"Geçişler\" raporunda her sayfa adresi için önceki ve sonraki işlemleri görüntüler.", - "ShareOfAllPageviews": "Bu sayfa %1$s kez gösterilmiş (toplam sayfa gösterimi %2$s)", - "ToFollowingPages": "İç sayfalara", - "ToFollowingPagesInline": "%s iç sayfalara", - "ToFollowingSiteSearches": "İç aramalar", - "ToFollowingSiteSearchesInline": "%s iç arama", - "TopX": "İlk %s etiket", - "Transitions": "Geçişler", - "TransitionsSubcategoryHelp1": "Geçişler raporu, kullanıcıların belirtilen bir sayfaya gelmeden önce ve sonra yaptıkları işlemleri görüntüler. Bu bölümde, güçlü \"Geçişler\" raporuna nasıl erişeceğinizi ve raporun içeriğini nasıl anlayıp kullanabileceğinizi anlatan bilgiler bulunur.", - "TransitionsSubcategoryHelp2": "Ayrıntılı bilgi alın", - "XOfAllPageviews": "Bu sayfanın tüm görüntülenmelerinden %s", - "XOutOfYVisits": "%1$s (toplam %2$s)" - } -} diff --git a/plugins/Transitions/lang/tzm.json b/plugins/Transitions/lang/tzm.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/tzm.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/Transitions/lang/uk.json b/plugins/Transitions/lang/uk.json deleted file mode 100644 index 4339d8cc6c8757fc6aaf810b98eb6e9503fbb207..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/uk.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "Ви знали? Переходи також доступні як дії рядка в таких звітах:", - "AvailableInOtherReports2": "Запустіть переходи, клацнувши їхню піктограму (%s) після наведення курсора на рядок у будь-якому з цих звітів.", - "BouncesInline": "%s відскоків (відмов)", - "DirectEntries": "Прямі входи", - "ErrorBack": "Повернутися до попередньої дії", - "ExitsInline": "%s виходів з сайту", - "FeatureDescription": "Переходи надають вам звіт, який показує, що відвідувачі робили безпосередньо до і після перегляду певної сторінки. На цій сторінці пояснюється, як отримати доступ, зрозуміти та використовувати потужний звіт про переходи.", - "FromCampaigns": "З кампаній", - "FromPreviousPages": "З внутрішніх сторінок", - "FromPreviousPagesInline": "%s з внутрішніх сторінок", - "FromPreviousSiteSearches": "З внутрішнього пошуку", - "FromPreviousSiteSearchesInline": "%s з внутрішнього пошуку по сайту", - "FromSearchEngines": "З пошукових систем", - "FromSocialNetworks": "Із соціальних мереж", - "FromWebsites": "Із сайтів", - "IncomingTraffic": "Вхідний трафік", - "LoopsInline": "%s оновлень сторінки", - "NoDataForAction": "Немає даних для %s", - "NoDataForActionDetails": "Або дія не мала переглядів сторінок протягом періоду, або вона недійсна.", - "NumDownloads": "%s завантажень", - "NumOutlinks": "%s вихідних посилань", - "NumPageviews": "%s переглядів сторінок", - "OutgoingTraffic": "Вихідний трафік", - "PageURLTransitions": "Переходи за URL-адресами сторінок", - "PeriodNotAllowed": "Виберіть дійсний період часу", - "PeriodNotAllowedDetails": "Спробуйте вибрати період з меншою кількістю днів для цієї функції.", - "PluginDescription": "Звітує про попередні та наступні дії для кожної URL-адреси сторінки в новому звіті «Переходи», доступному у звітах «Дії» через нову піктограму.", - "ShareOfAllPageviews": "У цієї сторінки %1$s переглядів (%2$s з переглядів всіх сторінок)", - "ToFollowingPages": "На внутрішні сторінки", - "ToFollowingPagesInline": "%s на внутрішні сторінки", - "ToFollowingSiteSearches": "Внутрішній пошук", - "ToFollowingSiteSearchesInline": "%s внутрішніх пошуків по сайту", - "TopX": "Топ %s міток", - "Transitions": "Переходи", - "TransitionsSubcategoryHelp1": "Переходи надають вам звіт, який показує, що відвідувачі робили безпосередньо до і після перегляду певної сторінки. На цій сторінці пояснюється, як отримати доступ, зрозуміти та використовувати потужний звіт про переходи.", - "TransitionsSubcategoryHelp2": "Докладніше", - "XOfAllPageviews": "%s з усіх переглядів сторінки", - "XOutOfYVisits": "%1$s (з %2$s)" - } -} diff --git a/plugins/Transitions/lang/ur.json b/plugins/Transitions/lang/ur.json deleted file mode 100644 index bda952e1f2044b6d4383109d67dc5e1adfa40e3b..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/ur.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Transitions": { - "TransitionsSubcategoryHelp2": "مزید تفصیلات" - } -} diff --git a/plugins/Transitions/lang/vi.json b/plugins/Transitions/lang/vi.json deleted file mode 100644 index d2751038fd78ae8f1151089df18d0ae5f77481c1..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/vi.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Transitions": { - "BouncesInline": "%s bị trả lại", - "DirectEntries": "Các mục trực tiếp", - "ErrorBack": "Quay trở lại hành động trước đó", - "ExitsInline": "%s thoát", - "FromCampaigns": "Từ các chiến dịch", - "FromPreviousPages": "Từ các trang nội bộ", - "FromPreviousPagesInline": "%s từ các trang nội bộ", - "FromPreviousSiteSearches": "Từ các tìm kiếm nội bộ", - "FromPreviousSiteSearchesInline": "%s Từ các tìm kiếm nội bộ", - "FromSearchEngines": "Từ các công cụ tìm kiếm", - "FromWebsites": "Từ các Website", - "IncomingTraffic": "Lưu lượng truy cập đến", - "LoopsInline": "các lượt tải lại trang %s", - "NoDataForAction": "Không có dữ liệu cho %s", - "NoDataForActionDetails": "Hay là hành động không có lượt xem trang trong thời gian hoặc không hợp lệ.", - "OutgoingTraffic": "Lưu lượng truy cập đi", - "ShareOfAllPageviews": "Trang này đã có %1$s lượt xem trang (%2$s của tất cả các lượt xem trang)", - "ToFollowingPages": "Tới các trang nội bộ", - "ToFollowingPagesInline": "%s tới các trang nội bộ", - "ToFollowingSiteSearches": "Các tìm kiếm nội bộ", - "ToFollowingSiteSearchesInline": "%s Các tìm kiếm nội bộ", - "TransitionsSubcategoryHelp2": "Xem chi tiết hơn", - "XOfAllPageviews": "%s của tất cả các lượt xem của trang này", - "XOutOfYVisits": "%1$s (trong số %2$s)" - } -} diff --git a/plugins/Transitions/lang/zh-cn.json b/plugins/Transitions/lang/zh-cn.json deleted file mode 100644 index 563eb2100486915e721d84cca1a104257b71734c..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/zh-cn.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "你知道吗?在以下报表中,转换也可用作行操作:", - "AvailableInOtherReports2": "在这些报表中的任何一行悬停后,单击它们的图标(%s)来启动转换。", - "BouncesInline": "%s 次跳出", - "DirectEntries": "直接进入", - "ErrorBack": "返回上次的活动", - "ExitsInline": "%s 次退出", - "FeatureDescription": "过渡是一个报告,显示访问者在查看给定页面之前和之后直接做的事情。本页解释如何访问、理解和使用强大的“过渡”报告。", - "FromCampaigns": "来自活动", - "FromPreviousPages": "来自内部页面", - "FromPreviousPagesInline": "%s 次来自站内页面", - "FromPreviousSiteSearches": "通过内部搜索", - "FromPreviousSiteSearchesInline": "%s 次来自站内搜索", - "FromSearchEngines": "来自搜索引擎", - "FromSocialNetworks": "来自社交网络", - "FromWebsites": "来自网站", - "IncomingTraffic": "入口流量", - "LoopsInline": "%s 次刷新页面", - "NoDataForAction": "%s 没有数据", - "NoDataForActionDetails": "该操作在此期间没有综合浏览量,或者无效。", - "NumDownloads": "%s 下载", - "NumOutlinks": "%s 外链", - "NumPageviews": "%s PV", - "OutgoingTraffic": "出口流量", - "PageURLTransitions": "页面 URL 转换", - "PeriodNotAllowed": "选择有效时间段", - "PeriodNotAllowedDetails": "尝试为此功能选择天数较少的时间段。", - "PluginDescription": "在新的“转换”报告中报告每个页面 URL 的先前和后续操作,可通过新图标在“操作”报告中使用。", - "ShareOfAllPageviews": "本页面被访问 %1$s 次 (总访问量的 %2$s)", - "ToFollowingPages": "前往内部页面", - "ToFollowingPagesInline": "%s 次转向站内页面", - "ToFollowingSiteSearches": "内部搜索", - "ToFollowingSiteSearchesInline": "%s 次站内搜索", - "TopX": "前%s个标签", - "Transitions": "转场", - "TransitionsSubcategoryHelp1": "转换是一份报告,显示访问者在查看给定页面之前和之后直接执行的操作。本页介绍如何访问、理解和使用强大的“转换”报告。", - "TransitionsSubcategoryHelp2": "更多细节", - "XOfAllPageviews": "%s 的本页浏览量", - "XOutOfYVisits": "%1$s (共 %2$s)" - } -} diff --git a/plugins/Transitions/lang/zh-tw.json b/plugins/Transitions/lang/zh-tw.json deleted file mode 100644 index d64e751e4005700a1cb73fbed13f2325e7e9889e..0000000000000000000000000000000000000000 --- a/plugins/Transitions/lang/zh-tw.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "Transitions": { - "AvailableInOtherReports": "你知道嗎?行為流程也可以在以下的報表中的列表動作使用:", - "AvailableInOtherReports2": "只要將滑鼠移動到這些報表的列表上,並點擊行為流程圖示 %s 即可開啟。", - "BouncesInline": "%s 跳出", - "DirectEntries": "直接流量", - "ErrorBack": "返回上一個動作", - "ExitsInline": "%s 個離開數", - "FeatureDescription": "你可以在行為流程中查看訪客在查看特定網頁之前和之後做的事情。這個頁面將解釋如何存取、了解和使用強大的行為流程報表。", - "FromCampaigns": "來自廣告活動", - "FromPreviousPages": "來自站內網頁", - "FromPreviousPagesInline": "%s 來自站內網頁", - "FromPreviousSiteSearches": "來自站內搜尋", - "FromPreviousSiteSearchesInline": "%s 來自站內搜尋", - "FromSearchEngines": "來自搜尋引擎", - "FromSocialNetworks": "來自社群網站", - "FromWebsites": "來自網站", - "IncomingTraffic": "進站流量", - "LoopsInline": "%s 次頁面重整", - "NoDataForAction": "%s 中沒有資料", - "NoDataForActionDetails": "活動在所選的期間內沒有瀏覽數或是無效。", - "NumDownloads": "%s 次下載數", - "NumOutlinks": "%s 個離開連結", - "NumPageviews": "%s 次瀏覽數", - "OutgoingTraffic": "離站流量", - "PageURLTransitions": "網頁網址行為流程", - "PluginDescription": "在行為流程報表中查看訪客在每個網頁網址中的上一步和下一步動作,可以點擊動作報表中的圖示來檢視。", - "ShareOfAllPageviews": "此網頁有 %1$s 個瀏覽數(%2$s 總瀏覽數)", - "ToFollowingPages": "進入站內頁面", - "ToFollowingPagesInline": "%s 進入站內頁面", - "ToFollowingSiteSearches": "站內搜尋", - "ToFollowingSiteSearchesInline": "%s 站內搜尋", - "TopX": "前 %s 標籤", - "Transitions": "行為流程", - "TransitionsSubcategoryHelp1": "你可以在行為流程中查看訪客在查看特定網頁之前和之後做的事情。這個頁面將解釋如何存取、了解和使用強大的行為流程報表。", - "TransitionsSubcategoryHelp2": "更多資訊", - "XOfAllPageviews": "此網頁所有訪問中的 %s", - "XOutOfYVisits": "%2$s 中的 %1$s" - } -} diff --git a/plugins/Transitions/stylesheets/_transitionColors.less b/plugins/Transitions/stylesheets/_transitionColors.less deleted file mode 100644 index b2736987e4028428426f40517ba3042718f1c9a8..0000000000000000000000000000000000000000 --- a/plugins/Transitions/stylesheets/_transitionColors.less +++ /dev/null @@ -1,113 +0,0 @@ -// -// transitions colors -// - -// colors for entries/exits/background gradients -.transition-entries[data-name=light], -.transition-exits[data-name=light], -.transition-background[data-name=light] { - color: #fff; - - .inDarkMode({ - color: #202329; - }); -} - -.transition-entries[data-name=dark], -.transition-exits[data-name=dark], -.transition-background[data-name=dark] { - color: #BACFE8; - - .inDarkMode({ - color: #5d7194; - }); -} - -.transition-entries[data-name=light-highlighted], -.transition-exits[data-name=light-highlighted], -.transition-background[data-name=light-highlighted] { - color: #fff; - - .inDarkMode({ - color: #352f24; - }); -} - -.transition-entries[data-name=dark-highlighted], -.transition-exits[data-name=dark-highlighted], -.transition-background[data-name=dark-highlighted] { - color: #FAD293; - - .inDarkMode({ - color: #8a7345; - }); -} - -// closed group gradient colors -.transition-closed-group[data-name=light] { - color: #DDE4ED; - - .inDarkMode({ - color: #2a2f36; - }); -} - -.transition-closed-group[data-name=dark] { - color: #9BBADE; - - .inDarkMode({ - color: #53667f; - }); -} - -.transition-closed-group[data-name=light-highlighted] { - color: #FAE2C0; - - .inDarkMode({ - color: #3a3125; - }); -} - -.transition-closed-group[data-name=dark-highlighted] { - color: #FAD293; - - .inDarkMode({ - color: #8a7345; - }); -} - -// items gradient colors -.transition-items[data-name=light] { - color: #E3DFD1; - - .inDarkMode({ - color: #2f2c26; - }); -} - -.transition-items[data-name=dark] { - color: #E8E4D5; - - .inDarkMode({ - color: #696353; - }); -} - -// 'others' and loop gradients colors -.transition-others[data-name=light], -.transition-loops[data-name=light] { - color: #F5F3EB; - - .inDarkMode({ - color: #25231f; - }); -} - -.transition-others[data-name=dark], -.transition-loops[data-name=dark] { - color: #E8E4D5; - - .inDarkMode({ - color: #5d584d; - }); -} diff --git a/plugins/Transitions/stylesheets/transitions.less b/plugins/Transitions/stylesheets/transitions.less deleted file mode 100644 index afbec5a964f7508c1eb61171bd9ac6a9bf53a9e5..0000000000000000000000000000000000000000 --- a/plugins/Transitions/stylesheets/transitions.less +++ /dev/null @@ -1,258 +0,0 @@ -@import "_transitionColors"; - -#Transitions_Container { - position: relative; - z-index: 1500; - height: 550px; - text-align: left; - margin-left: 50px; -} -.Transitions_Canvas_Container { - position: absolute; -} - -#Transitions_Canvas_Background_Left { - z-index: 1501; -} - -#Transitions_Canvas_Background_Right { - z-index: 1502; -} - -#Transitions_Canvas_Left { - z-index: 1503; -} - -#Transitions_Canvas_Right { - z-index: 1504; -} - -#Transitions_Canvas_Loops { - z-index: 1505; -} - -.Transitions_Text { - color: @theme-color-text; - font-size: 11px; - line-height: 14px; - position: absolute; - background: rgba(0, 0, 0, 0); /* without this, IE9 triggers hover only on the text, not the box */ - z-index: 1506; - word-wrap: break-word; - text-align: left; - cursor: default; -} - -#Transitions_CenterBox { - margin: 27px 0 0 345px; - width: 208px; - min-height: 373px; - background: @theme-color-background-contrast; - border: 1px solid @theme-color-border; - border-radius: 10px; - -webkit-box-shadow: 0 0 9px 0 @theme-color-boxShadow; - -moz-box-shadow: 0 0 9px 0 @theme-color-boxShadow; - box-shadow: 0 0 9px 0 @theme-color-boxShadow; - z-index: 1507; -} - -#Transitions_CenterBox h2 { - font-size: 12px; - line-height: 16px; - padding: 10px; - border-bottom: 1px dotted @theme-color-border; - font-weight: bold; - overflow: hidden; - color: @theme-color-link; - margin: 0; - - a { - color: inherit; - } -} - -.Transitions_Pageviews { - text-align: center; -} - -.Transitions_OutgoingTraffic { - text-align: right; -} - -.Transitions_CenterBoxMetrics { - padding: 15px 10px 0 10px; - display: none; - font-size: 12px; -} - -.Transitions_CenterBoxMetrics table td { - padding: 0 0 5px 0; -} - -.Transitions_CenterBoxMetrics table td.Transitions_Percentage { - padding-right: 6px; - font-weight: bold; -} - -#Transitions_CenterBox h3 { - font-weight: bold; - font-size: 12px; - margin: 15px 0 7px 0; - padding: 0; - color: @theme-color-text-light; -} - -#Transitions_Loops { - margin: 445px 0 0 346px; - width: 208px; - text-align: center; - line-height: 25px; - font-size: 12px; - display: none; - z-index: 1506; - cursor: default; -} - -.Transitions_CenterBoxMetrics p { - margin: 0 0 3px 0; - padding: 0; - cursor: default; - font-size: 12px; - line-height: 15px; -} - -.Transitions_CenterBoxMetrics p.Transitions_Margin { - margin-bottom: 11px; -} - -.Transitions_CenterBoxMetrics .Transitions_Highlighted { - color: @theme-color-link; -} - -span.Transitions_Metric { - font-weight: bold; - cursor: default; -} - -.Transitions_Value0 { - color: @theme-color-text-lighter; -} - -.Transitions_TitleOfOpenGroup { - font-size: 12px; - color: @theme-color-link; - font-weight: bold; -} - -.Transitions_BoxTextLeft, -.Transitions_BoxTextRight { - width: 165px; - height: 42px; - overflow: hidden; -} - -.Transitions_BoxTextRight { - text-align: right; -} - -.Transitions_BoxTextLeft.Transitions_HasBackground, -.Transitions_BoxTextRight.Transitions_HasBackground { - background-repeat: no-repeat; - height: 18px; -} - -.Transitions_BoxTextLeft.Transitions_HasBackground { - background-position: 0 1px; - width: 175px; -} - -.Transitions_BoxTextLeft.Transitions_HasBackground span { - display: block; - padding-left: 16px; -} - -.Transitions_BoxTextRight.Transitions_HasBackground { - background-position: right 1px; -} - -.Transitions_BoxTextRight.Transitions_HasBackground span { - display: block; - padding-right: 17px; -} - -.Transitions_CurveTextLeft, -.Transitions_CurveTextRight { - color: @theme-color-link; - font-weight: bold; - width: 34px; - text-align: center; - cursor: default; -} - -body .ui-tooltip.Transitions_Tooltip_Small { - font-size: 11px; - padding: 3px 5px 3px 6px; - background: @theme-color-background-contrast; - color: @theme-color-text; - border: 1px solid @theme-color-border; -} - -.Transitions_SingleLine { - font-size: 12px; - height: 21px; -} - -#transitions_report { - #Transitions_Container { - z-index: 0; - } - #Transitions_CenterBox { - z-index: 987; - } - .Transitions_Text, - #Transitions_Loops { - z-index: 986; - } - #Transitions_Canvas_Background_Left { - z-index: 981; - } - #Transitions_Canvas_Background_Right { - z-index: 982; - } - #Transitions_Canvas_Left { - z-index: 983; - } - #Transitions_Canvas_Right { - z-index: 984; - } - #Transitions_Canvas_Loops { - z-index: 985; - } - div[name=actionType] { - margin-left: -0.75rem; - } - div[name=actionName] { - margin-right: -0.75rem; - } - & > .row { - margin-left: 0; - margin-right: 0; - - body.widgetized & { - margin-left: 0.75rem; - margin-right: 0.75rem; - } - } -} - -.widget #Transitions_Container h3 { - padding: 0 !important; -} - -#dashboardWidgetsArea { - #transitions_report { - #Transitions_Container { - overflow: scroll; - } - } -} diff --git a/plugins/Transitions/templates/renderPopover.twig b/plugins/Transitions/templates/renderPopover.twig deleted file mode 100644 index ae41381366d20ee2e28358c3714d207a0440edfa..0000000000000000000000000000000000000000 --- a/plugins/Transitions/templates/renderPopover.twig +++ /dev/null @@ -1,73 +0,0 @@ -
-
-

- -
-

{{ translations.pageviewsInline|translate }}

- -
-

{{ 'Transitions_IncomingTraffic'|translate }}

- -

{{ translations.fromPreviousPagesInline|translate }}

- -

{{ translations.fromPreviousSiteSearchesInline|translate }}

- -

{{ translations.fromSearchEnginesInline|translate }}

- -

{{ translations.fromSocialNetworksInline|translate }}

- -

{{ translations.fromAIAssistantsInline|translate }}

- -

{{ translations.fromWebsitesInline|translate }}

- -

{{ translations.fromCampaignsInline|translate }}

- -

{{ translations.directEntriesInline|translate }}

-
- -
-

{{ 'Transitions_OutgoingTraffic'|translate }}

- -

{{ translations.toFollowingPagesInline|translate }}

- -

{{ translations.toFollowingSiteSearchesInline|translate }}

- -

{{ translations.downloadsInline|translate }}

- - - -

{{ translations.exitsInline|translate }}

-
-
-
-
- {{ translations.loopsInline|translate }} -
-
-
-
-
-
-
- - - - \ No newline at end of file diff --git a/plugins/Transitions/tests/Integration/TransitionsMaxAllowedPeriodTest.php b/plugins/Transitions/tests/Integration/TransitionsMaxAllowedPeriodTest.php deleted file mode 100644 index b1ba96b5d54456de0a163c96f5852e122462e87b..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/Integration/TransitionsMaxAllowedPeriodTest.php +++ /dev/null @@ -1,192 +0,0 @@ -createSuperUser = true; - } - - public function setUp(): void - { - parent::setUp(); - Fixture::createWebsite('2010-02-03 00:00:00'); - $this->api = API::getInstance(); - - $t = Fixture::getTracker(1, '2012-08-09 01:02:03', $defaultInit = true, $useLocalTracker = false); - - $t->setUrl('http://example.org/page/one.html'); - $t->doTrackPageView('incredible title '); - } - - public function testShouldThrowExceptionIfPeriodNotAllowed() - { - $invalidPeriods = [ - 'day' => ['week', 'month', 'year'], - 'week' => ['month', 'year'], - 'month' => ['year'], - ]; - foreach ($invalidPeriods as $period => $invalids) { - Config::setSetting('Transitions_1', 'max_period_allowed', $period); - foreach ($invalids as $ip) { - try { - $this->api->getTransitionsForAction( - 'http://example.org/page/one.html', - 'url', - 1, - $ip, - '2012-08-09' - ); - $this->fail("Failed asserting that exception 'PeriodNotAllowed' was thrown"); - } catch (\Exception $e) { - $this->assertEquals('PeriodNotAllowed', $e->getMessage()); - } - } - } - } - - public function testShouldReturnDataIfPeriodAllowed() - { - $validPeriods = [ - 'day' => ['day'], - 'week' => ['day', 'week'], - 'month' => ['day', 'week', 'month'], - 'year' => ['day', 'week', 'month', 'year'], - 'all' => ['day', 'week', 'month', 'year'], - ]; - foreach ($validPeriods as $period => $valids) { - Config::setSetting('Transitions_1', 'max_period_allowed', $period); - foreach ($valids as $vp) { - $r = $this->api->getTransitionsForAction( - 'http://example.org/page/one.html', - 'url', - 1, - $vp, - '2012-08-09' - ); - self::assertEquals(1, $r['pageMetrics']['pageviews']); - } - } - } - - public function testShouldThrowExceptionIfInvalidLimitBeforeGroup() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('limitBeforeGrouping has to be an integer.'); - $this->api->getTransitionsForAction( - 'http://example.org/page/one.html', - 'url', - 1, - 'range', - '2012-08-09,2012-08-10', - false, - 'all' - ); - } - - public function testShouldPassIfLimitBeforeGroupPassingIntAsString() - { - $report = $this->api->getTransitionsForAction( - 'http://example.org/page/one.html', - 'url', - 1, - 'range', - '2012-08-09,2012-08-10', - false, - '100' - ); - $this->assertIsArray($report); - } - - public function testShouldThrowExceptionIfRangeDayCountIsLargerThanDayPeriod() - { - Config::setSetting('Transitions_1', 'max_period_allowed', 'day'); - $this->expectException(\Exception::class); - $this->expectExceptionMessage('PeriodNotAllowed'); - $this->api->getTransitionsForAction( - 'http://example.org/page/one.html', - 'url', - 1, - 'range', - '2012-08-09,2012-08-10' - ); - } - - public function testShouldThrowExceptionIfRangeDayCountIsLargerThanWeekPeriod() - { - Config::setSetting('Transitions_1', 'max_period_allowed', 'day'); - $this->expectException(\Exception::class); - $this->expectExceptionMessage('PeriodNotAllowed'); - $this->api->getTransitionsForAction( - 'http://example.org/page/one.html', - 'url', - 1, - 'range', - '2012-08-09,2012-08-17' - ); - } - - public function testShouldThrowExceptionIfRangeDayCountIsLargerThanMonthPeriod() - { - Config::setSetting('Transitions_1', 'max_period_allowed', 'day'); - $this->expectException(\Exception::class); - $this->expectExceptionMessage('PeriodNotAllowed'); - $this->api->getTransitionsForAction( - 'http://example.org/page/one.html', - 'url', - 1, - 'range', - '2012-08-09,2012-09-10' - ); - } - - public function testShouldThrowExceptionIfRangeDayCountIsLargerThanYearPeriod() - { - Config::setSetting('Transitions_1', 'max_period_allowed', 'day'); - $this->expectException(\Exception::class); - $this->expectExceptionMessage('PeriodNotAllowed'); - $this->api->getTransitionsForAction( - 'http://example.org/page/one.html', - 'url', - 1, - 'range', - '2012-08-09,2013-08-10' - ); - } - - public function testShouldUseSiteConfigInsteadOfGeneralIfSiteConfigExists() - { - Config::setSetting('Transitions_1', 'max_period_allowed', null); - Config::setSetting('Transitions', 'max_period_allowed', 'month'); - $maxAllowedPeriod = Transitions::getPeriodAllowedConfig(1); - $this->assertEquals('month', $maxAllowedPeriod); - - Config::setSetting('Transitions_1', 'max_period_allowed', 'week'); - $maxAllowedPeriod = Transitions::getPeriodAllowedConfig(1); - $this->assertEquals('week', $maxAllowedPeriod); - } -} diff --git a/plugins/Transitions/tests/System/TransitionsTest.php b/plugins/Transitions/tests/System/TransitionsTest.php deleted file mode 100644 index 8017cdd71a07656391177f6b647db270c97758c3..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/TransitionsTest.php +++ /dev/null @@ -1,119 +0,0 @@ -runApiTests($api, $params); - } - - public function getApiForTesting() - { - $return = array(); - $return[] = array('Transitions.getTransitionsForPageUrl', array( - 'idSite' => self::$fixture->idSite, - 'date' => self::$fixture->dateTime, - 'periods' => array('day', 'month'), - 'testSuffix' => '_noLimit', - 'otherRequestParameters' => array( - 'pageUrl' => 'http://example.org/page/one.html', - ), - )); - $return[] = array('Transitions.getTransitionsForPageTitle', array( - 'idSite' => self::$fixture->idSite, - 'date' => self::$fixture->dateTime, - 'periods' => array('day', 'month'), - 'testSuffix' => '_noLimit', - 'otherRequestParameters' => array( - 'pageTitle' => 'page title - page/one.html', - ), - )); - - // test w/ pages that don't exist - $return[] = array('Transitions.getTransitionsForPageUrl', array( - 'idSite' => self::$fixture->idSite, - 'date' => self::$fixture->dateTime, - 'periods' => array('day', 'month'), - 'testSuffix' => '_noData', - 'otherRequestParameters' => array( - 'pageUrl' => 'http://example.org/not/a/page.html', - ), - )); - $return[] = array('Transitions.getTransitionsForPageTitle', array( - 'idSite' => self::$fixture->idSite, - 'date' => self::$fixture->dateTime, - 'periods' => array('day', 'month'), - 'testSuffix' => '_noData', - 'otherRequestParameters' => array( - 'pageTitle' => 'not a page title', - ), - )); - - $return[] = array('Transitions.getTransitionsForPageUrl', array( // test w/ limiting - 'idSite' => self::$fixture->idSite, - 'date' => self::$fixture->dateTime, - 'periods' => array('day', 'month'), - 'otherRequestParameters' => array( - 'pageUrl' => 'http://example.org/page/one.html', - 'limitBeforeGrouping' => 2, - ), - )); - - $return[] = array('Transitions.getTransitionsForPageUrl', array( // test w/ segment - 'idSite' => self::$fixture->idSite, - 'date' => self::$fixture->dateTime, - 'periods' => array('day'), - 'testSuffix' => '_withSegment', - 'segment' => 'visitConvertedGoalId!%3D2', - 'otherRequestParameters' => array( - 'pageUrl' => 'http://example.org/page/one.html', - 'limitBeforeGrouping' => 2, - ), - )); - $return[] = array('Transitions.getTransitionsForPageTitle', array( - 'idSite' => self::$fixture->idSite, - 'date' => self::$fixture->dateTime, - 'periods' => array('day'), - 'testSuffix' => '_withSegment', - 'otherRequestParameters' => array( - 'pageTitle' => 'page title - page/one.html', - ), - )); - return $return; - } - - public static function getOutputPrefix() - { - return 'Transitions'; - } - - public static function getPathToTestDirectory() - { - return dirname(__FILE__); - } -} - -TransitionsTest::$fixture = new SomeVisitsManyPageviewsWithTransitions(); diff --git a/plugins/Transitions/tests/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_day.xml b/plugins/Transitions/tests/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_day.xml deleted file mode 100644 index a87828a02f7c781d3ad90067470a9c1a22d81b39..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_day.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - Sat, Mar 6 - - - - 3 - - - - 2 - - - - 2 - - - - - - 1 - - - - 5 - 19 - 5 - 5 - - - - - 3 - - - - 2 - - - - 3 - - - - - - 1 - - - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - - - direct - 1 -
-
-
- - - search - 2 -
- - - 2 - -
-
- - - website - 1 -
- - - 1 - -
-
- - - campaign - 1 -
- - - 1 - -
-
-
-
\ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_month.xml b/plugins/Transitions/tests/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_month.xml deleted file mode 100644 index 498e9f6f3b6f6eee20d2ac0a09c405d4b04649b9..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_month.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - Mar 2010 - - - - 3 - - - - 2 - - - - 2 - - - - - - 1 - - - - 7 - 22 - 5 - 5 - - - - - 3 - - - - 2 - - - - 3 - - - - - - 2 - - - - - - 1 - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - 1 - - - - - - direct - 1 -
-
-
- - - search - 2 -
- - - 2 - -
-
- - - website - 1 -
- - - 1 - -
-
- - - campaign - 1 -
- - - 1 - -
-
-
-
\ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_day.xml b/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_day.xml deleted file mode 100644 index a0995fa6e9344faf3aec953398ca4d2f53c5391b..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_day.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_month.xml b/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_month.xml deleted file mode 100644 index a0995fa6e9344faf3aec953398ca4d2f53c5391b..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_month.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_day.xml b/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_day.xml deleted file mode 100644 index a0995fa6e9344faf3aec953398ca4d2f53c5391b..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_day.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_month.xml b/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_month.xml deleted file mode 100644 index a0995fa6e9344faf3aec953398ca4d2f53c5391b..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_month.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_day.xml b/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_day.xml deleted file mode 100644 index c439a7bdd9f85719aef7031cd9385a4cc1e53ac4..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_day.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - Sat, Mar 6 - - - - 3 - - - - 2 - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - 5 - 18 - 4 - 4 - - - - - 2 - - - - 2 - - - - 2 - - - - 1 - - - - 1 - - - - - - 1 - - - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - - - direct - 1 -
-
-
- - - search - 2 -
- - - 2 - -
-
- - - website - 1 -
- - - 1 - -
-
-
-
\ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_month.xml b/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_month.xml deleted file mode 100644 index d63a4f9994d2eacae5830937bafeaa708d873f91..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_month.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - Mar 2010 - - - - 3 - - - - 2 - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - 1 - - - - 7 - 21 - 4 - 4 - - - - - 2 - - - - 2 - - - - 2 - - - - 1 - - - - 1 - - - - - - 2 - - - - - - 1 - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - 1 - - - - - - direct - 1 -
-
-
- - - search - 2 -
- - - 2 - -
-
- - - website - 1 -
- - - 1 - -
-
-
-
\ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_day.xml b/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_day.xml deleted file mode 100644 index 078e47a6993693909c8da01bafb7ad047ad351c8..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_day.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - Sat, Mar 6 - - - - 3 - - - - 2 - - - - 2 - - - - - - 1 - - - - 5 - 19 - 5 - 5 - - - - - 3 - - - - 2 - - - - 2 - - - - 1 - - - - - - 1 - - - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - - - direct - 1 -
-
-
- - - search - 2 -
- - - 2 - -
-
- - - website - 1 -
- - - 1 - -
-
- - - campaign - 1 -
- - - 1 - -
-
-
-
\ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_month.xml b/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_month.xml deleted file mode 100644 index 708b3876e9bc6cd53c790b38f25c32cf31eecc50..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_month.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - Mar 2010 - - - - 3 - - - - 2 - - - - 2 - - - - - - 1 - - - - 7 - 22 - 5 - 5 - - - - - 3 - - - - 2 - - - - 2 - - - - 1 - - - - - - 2 - - - - - - 1 - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - 1 - - - - - - direct - 1 -
-
-
- - - search - 2 -
- - - 2 - -
-
- - - website - 1 -
- - - 1 - -
-
- - - campaign - 1 -
- - - 1 - -
-
-
-
\ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_withSegment__Transitions.getTransitionsForPageTitle_day.xml b/plugins/Transitions/tests/System/expected/test_Transitions_withSegment__Transitions.getTransitionsForPageTitle_day.xml deleted file mode 100644 index c439a7bdd9f85719aef7031cd9385a4cc1e53ac4..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_withSegment__Transitions.getTransitionsForPageTitle_day.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - Sat, Mar 6 - - - - 3 - - - - 2 - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - 5 - 18 - 4 - 4 - - - - - 2 - - - - 2 - - - - 2 - - - - 1 - - - - 1 - - - - - - 1 - - - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - - - direct - 1 -
-
-
- - - search - 2 -
- - - 2 - -
-
- - - website - 1 -
- - - 1 - -
-
-
-
\ No newline at end of file diff --git a/plugins/Transitions/tests/System/expected/test_Transitions_withSegment__Transitions.getTransitionsForPageUrl_day.xml b/plugins/Transitions/tests/System/expected/test_Transitions_withSegment__Transitions.getTransitionsForPageUrl_day.xml deleted file mode 100644 index a87828a02f7c781d3ad90067470a9c1a22d81b39..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/System/expected/test_Transitions_withSegment__Transitions.getTransitionsForPageUrl_day.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - Sat, Mar 6 - - - - 3 - - - - 2 - - - - 2 - - - - - - 1 - - - - 5 - 19 - 5 - 5 - - - - - 3 - - - - 2 - - - - 3 - - - - - - 1 - - - - - - 1 - - - - 1 - - - - - - 1 - - - - 1 - - - - - - direct - 1 -
-
-
- - - search - 2 -
- - - 2 - -
-
- - - website - 1 -
- - - 1 - -
-
- - - campaign - 1 -
- - - 1 - -
-
-
-
\ No newline at end of file diff --git a/plugins/Transitions/tests/UI/Transitions_spec.js b/plugins/Transitions/tests/UI/Transitions_spec.js deleted file mode 100644 index 554587bf994a04f61e4591af6f807d7df919cc4c..0000000000000000000000000000000000000000 --- a/plugins/Transitions/tests/UI/Transitions_spec.js +++ /dev/null @@ -1,153 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * transitions screenshot tests - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -describe("Transitions", function () { - var generalParams = 'idSite=1&period=year&date=2012-08-09', - urlBase = 'module=CoreHome&action=index&' + generalParams; - - async function setThemeMode(themeMode) - { - await page.evaluate((mode) => { - window.piwik.setThemeMode(mode); - }, themeMode); - await page.waitForFunction((mode) => window.piwik.getThemeMode() === mode, {}, themeMode); - } - - async function selectValue(field, title) - { - await page.webpage.evaluate((field) => { - $(field + ' input.select-dropdown').click() - }, field); - await page.waitForTimeout(500); - await page.webpage.evaluate((field, title) => { - $(field + ' .dropdown-content li:contains("' + title + '"):first').click() - }, field, title); - } - - it('should load the transitions popup correctly for the page titles report', async function() { - await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Actions_SubmenuPageTitles"); - - await (await page.jQuery('div.dataTable tbody tr:contains("Space Quest")')).hover(); - await (await page.jQuery('a.actionTransitions:visible')).hover(); // necessary to get popover to display - await (await page.jQuery('a.actionTransitions:visible')).click(); - - await page.waitForNetworkIdle(); - await page.waitForSelector('.ui-dialog', { visible: true }); - - expect(await page.screenshotSelector('.ui-dialog')).to.matchImage('transitions_popup_titles'); - }); - - it('should load the transitions popup correctly for the page urls report', async function() { - await page.goto('about:blank'); - await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=General_Pages&" - + "popover=RowAction$3ATransitions$3Aurl$3Ahttp$3A$2F$2Fpiwik.net$2Fdocs$2Fmanage-websites$2F"); - await page.waitForNetworkIdle(); - - await (await page.$('.Transitions_CurveTextRight')).hover(); - await page.waitForSelector('.ui-tooltip', { visible: true }); - - // the tooltip will, in most cases, not be visible in the screenshot - // removing and re-adding a clone to the DOM seems to fix that problem - await page.evaluate(() => $('.ui-dialog').append($('.ui-tooltip').remove().clone())); - - expect(await page.screenshotSelector('.ui-dialog')).to.matchImage('transitions_popup_urls'); - }); - - it('should show no data message in selector', async function () { - await page.goto("?module=Widgetize&action=iframe&widget=1&moduleToWidgetize=Transitions&actionToWidgetize=getTransitions&idSite=1&period=day&date=today&disableLink=1&widget=1"); - expect(await page.screenshotSelector('body')).to.matchImage('transitions_report_no_data_widget'); - }); - - it('should show report in reporting ui with data', async function () { - await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Transitions_Transitions"); - await page.waitForNetworkIdle(); - expect(await page.screenshotSelector('.pageWrap')).to.matchImage('transitions_report_with_data_report'); - }); - - it('should show report in widget ui in selector', async function () { - await page.goto("?module=Widgetize&action=iframe&widget=1&moduleToWidgetize=Transitions&actionToWidgetize=getTransitions&"+generalParams+"&disableLink=1&widget=1"); - await page.waitForNetworkIdle(); - expect(await page.screenshotSelector('body')).to.matchImage('transitions_report_with_data_widget'); - }); - - it('should be possible to switch report', async function () { - await selectValue('[name="actionName"]', 'category/meta'); - await page.waitForNetworkIdle(); - expect(await page.screenshotSelector('body')).to.matchImage('transitions_report_switch_url'); - }); - - it('should be possible to show page titles', async function () { - await selectValue('[name="actionType"]', 'Title'); - await page.waitForNetworkIdle(); - expect(await page.screenshotSelector('body')).to.matchImage('transitions_report_switch_type_title'); - }); - - it('should show the search engines when clicked', async function () { - await page.evaluate(() => $('.Transitions_SingleLine:contains(From search engines)').click()); - expect(await page.screenshotSelector('body')).to.matchImage('transitions_report_search_engines'); - }); - - it('should show period not allowed for disabled periods', async function () { - - await testEnvironment.overrideConfig('Transitions_1', 'max_period_allowed', 'day'); - await testEnvironment.save(); - try { - await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Transitions_Transitions"); - await page.waitForNetworkIdle(); - expect(await page.screenshotSelector('.pageWrap')) - .to - .matchImage('transitions_report_period_not_allowed'); - } finally { - await testEnvironment.overrideConfig('Transitions_1', 'max_period_allowed', 'all'); - await testEnvironment.save(); - } - }); - - it('should escape the export overlay title correctly', async function () { - await page.goto("?" + urlBase + "#?idSite=1&period=day&date=2012-01-16&category=General_Actions&subcategory=Transitions_Transitions"); - await page.waitForNetworkIdle(); - - await page.webpage.evaluate(() => { - $('[name="actionName"] input.select-dropdown').click() - }); - await page.waitForTimeout(500); - await page.webpage.evaluate(() => { - $('[name="actionName"] .dropdown-content li:contains("script"):last').click() - }); - await page.waitForNetworkIdle(); - - await page.click('.icon-export'); - await page.waitForTimeout(100); - - const title = await page.$('.ui-dialog-title'); - const titleText = await title.getProperty('textContent'); - - expect(await titleText.jsonValue()).to.be.equal('http://example.org/ Transitions'); - }); - - it('should keep the transitions popover open when the theme changes live', async function() { - await page.goto('about:blank'); - await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Actions_SubmenuPageTitles"); - - await setThemeMode('light'); - - await (await page.jQuery('div.dataTable tbody tr:contains("Space Quest")')).hover(); - await (await page.jQuery('a.actionTransitions:visible')).hover(); // necessary to get popover to display - await (await page.jQuery('a.actionTransitions:visible')).click(); - - await page.waitForNetworkIdle(); - await page.waitForSelector('#Transitions_CenterBox'); - - await setThemeMode('dark'); - const centerBoxCount = await page.evaluate(() => $('#Transitions_CenterBox').length); - expect(centerBoxCount).to.be.equal(1); - - await setThemeMode('light'); - }); -}); diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_titles.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_titles.png deleted file mode 100644 index 0b33b13a69987fd466f251ff7fd89ff1dda43d19..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_titles.png and /dev/null differ diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_urls.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_urls.png deleted file mode 100644 index 550532e4b6d0e2e088ab2e630cdabbf63fb122e1..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_popup_urls.png and /dev/null differ diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data.png deleted file mode 100644 index 6a77086372f0db3e92a83a5dc28c913726abc587..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data.png and /dev/null differ diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data_widget.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data_widget.png deleted file mode 100644 index e9407a7549724b5bfcf2ebb7cdda0dce9569d887..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_no_data_widget.png and /dev/null differ diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_period_not_allowed.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_period_not_allowed.png deleted file mode 100644 index e86e6fd1d5ce05624d3222d59124ebb313460400..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_period_not_allowed.png and /dev/null differ diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_search_engines.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_search_engines.png deleted file mode 100644 index 5108feb9373a2c5f68400fb8e64f01bc3fc38093..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_search_engines.png and /dev/null differ diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_type_title.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_type_title.png deleted file mode 100644 index 05c175c93b7171cba432f4b5ef8a0c30c5781fe7..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_type_title.png and /dev/null differ diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_url.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_url.png deleted file mode 100644 index fba85a9e55d5f56fb1ef404810dfc785a7c38d1d..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_switch_url.png and /dev/null differ diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_report.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_report.png deleted file mode 100644 index 18f5424f580a4e203dff409adbd6a40536cb4d94..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_report.png and /dev/null differ diff --git a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_widget.png b/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_widget.png deleted file mode 100644 index 8e5d2ee4e781770984902ab3cb4d7faa8b05e27c..0000000000000000000000000000000000000000 Binary files a/plugins/Transitions/tests/UI/expected-screenshots/Transitions_transitions_report_with_data_widget.png and /dev/null differ diff --git a/plugins/Transitions/vue/dist/Transitions.umd.js b/plugins/Transitions/vue/dist/Transitions.umd.js deleted file mode 100644 index 977f49b25e6269de484a01da1d16074aeb82f170..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/dist/Transitions.umd.js +++ /dev/null @@ -1,675 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("CoreHome"), require("vue"), require("CorePluginsAdmin")); - else if(typeof define === 'function' && define.amd) - define(["CoreHome", , "CorePluginsAdmin"], factory); - else if(typeof exports === 'object') - exports["Transitions"] = factory(require("CoreHome"), require("vue"), require("CorePluginsAdmin")); - else - root["Transitions"] = factory(root["CoreHome"], root["Vue"], root["CorePluginsAdmin"]); -})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "plugins/Transitions/vue/dist/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "fae3"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "19dc": -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__; - -/***/ }), - -/***/ "8bbf": -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__; - -/***/ }), - -/***/ "a5a2": -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__; - -/***/ }), - -/***/ "fae3": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "TransitionExporter", function() { return /* reexport */ TransitionExporter; }); -__webpack_require__.d(__webpack_exports__, "TransitionSwitcher", function() { return /* reexport */ TransitionSwitcher; }); -__webpack_require__.d(__webpack_exports__, "TransitionsPage", function() { return /* reexport */ TransitionsPage; }); -__webpack_require__.d(__webpack_exports__, "TransitionExporterLink", function() { return /* reexport */ TransitionExporterLink; }); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js -// This file is imported into lib/wc client bundles. - -if (typeof window !== 'undefined') { - var currentScript = window.document.currentScript - if (false) { var getCurrentScript; } - - var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/) - if (src) { - __webpack_require__.p = src[1] // eslint-disable-line - } -} - -// Indicate to webpack that this file can be concatenated -/* harmony default export */ var setPublicPath = (null); - -// EXTERNAL MODULE: external "CoreHome" -var external_CoreHome_ = __webpack_require__("19dc"); - -// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} -var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.vue?vue&type=template&id=2826c363 - -const _hoisted_1 = { - class: "transition-export-popover row" -}; -const _hoisted_2 = { - class: "col l6" -}; -const _hoisted_3 = { - class: "input-field" -}; -const _hoisted_4 = { - class: "matomo-field" -}; -const _hoisted_5 = { - class: "col l12" -}; -const _hoisted_6 = ["href"]; -function render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { - uicontrol: "radio", - name: "exportFormat", - title: _ctx.translate('CoreHome_ExportFormat'), - "model-value": _ctx.exportFormat, - "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.exportFormat = $event), - "full-width": true, - options: _ctx.exportFormatOptions - }, null, 8, ["title", "model-value", "options"])])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - class: "btn", - href: _ctx.exportLink, - target: "_new", - title: "translate('CoreHome_ExportTooltip')" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Export')), 9, _hoisted_6)])]); -} -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.vue?vue&type=template&id=2826c363 - -// EXTERNAL MODULE: external "CorePluginsAdmin" -var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); - -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionExporter/transitionParams.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - -const actionType = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(''); -const actionName = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(''); -const onDataChanged = params => { - actionType.value = params.actionType; - actionName.value = params.actionName; -}; -external_CoreHome_["Matomo"].on('Transitions.dataChanged', onDataChanged); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.vue?vue&type=script&lang=ts - - - - -/* harmony default export */ var TransitionExporterPopovervue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - exportFormatOptions: { - type: Object, - required: true - } - }, - components: { - Field: external_CorePluginsAdmin_["Field"] - }, - data() { - return { - exportFormat: 'JSON' - }; - }, - computed: { - exportLink() { - const exportUrlParams = { - module: 'API' - }; - exportUrlParams.method = 'Transitions.getTransitionsForAction'; - exportUrlParams.actionType = actionType.value; - exportUrlParams.actionName = actionName.value; - exportUrlParams.idSite = external_CoreHome_["Matomo"].idSite; - exportUrlParams.period = external_CoreHome_["Matomo"].period; - exportUrlParams.date = external_CoreHome_["Matomo"].currentDateString; - exportUrlParams.format = this.exportFormat; - exportUrlParams.token_auth = external_CoreHome_["Matomo"].token_auth; - exportUrlParams.force_api_session = 1; - const currentUrl = window.location.href; - const urlParts = currentUrl.split('/'); - urlParts.pop(); - const url = urlParts.join('/'); - return `${url}/index.php?${external_CoreHome_["MatomoUrl"].stringify(exportUrlParams)}`; - } - } -})); -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.vue - - - -TransitionExporterPopovervue_type_script_lang_ts.render = render - -/* harmony default export */ var TransitionExporterPopover = (TransitionExporterPopovervue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionExporter/TransitionExporter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - -const { - Piwik_Popover -} = window; -/* harmony default export */ var TransitionExporter = ({ - mounted(element) { - element.addEventListener('click', e => { - e.preventDefault(); - const props = { - exportFormat: 'JSON', - exportFormatOptions: [{ - key: 'JSON', - value: 'JSON' - }, { - key: 'XML', - value: 'XML' - }] - }; - const app = Object(external_CoreHome_["createVueApp"])({ - template: '', - data() { - return { - bind: props - }; - } - }); - app.component('popover', TransitionExporterPopover); - const mountPoint = document.createElement('div'); - app.mount(mountPoint); - Piwik_Popover.showLoading(''); - Piwik_Popover.setTitle(`${external_CoreHome_["Matomo"].helper.htmlEntities(actionName.value)} ${Object(external_CoreHome_["translate"])('Transitions_Transitions')}`); - Piwik_Popover.setContent(mountPoint); - Piwik_Popover.onClose(() => { - app.unmount(); - }); - }); - } -}); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Transitions/vue/src/TransitionSwitcher/TransitionSwitcher.vue?vue&type=template&id=765d8cb1 - -const TransitionSwitchervue_type_template_id_765d8cb1_hoisted_1 = { - class: "row" -}; -const TransitionSwitchervue_type_template_id_765d8cb1_hoisted_2 = { - class: "col s12 m3" -}; -const TransitionSwitchervue_type_template_id_765d8cb1_hoisted_3 = { - name: "actionType" -}; -const TransitionSwitchervue_type_template_id_765d8cb1_hoisted_4 = { - class: "col s12 m9" -}; -const TransitionSwitchervue_type_template_id_765d8cb1_hoisted_5 = { - name: "actionName" -}; -const TransitionSwitchervue_type_template_id_765d8cb1_hoisted_6 = { - class: "loadingPiwik", - style: { - "display": "none" - }, - id: "transitions_inline_loading" -}; -const _hoisted_7 = { - class: "popoverContainer" -}; -const _hoisted_8 = { - id: "Transitions_Error_Container" -}; -const _hoisted_9 = { - class: "dataTableWrapper" -}; -const _hoisted_10 = { - class: "dataTableFeatures" -}; -const _hoisted_11 = { - class: "dataTableFooterNavigation" -}; -const _hoisted_12 = { - class: "dataTableControls" -}; -const _hoisted_13 = { - class: "row" -}; -const _hoisted_14 = { - class: "dataTableAction" -}; -const _hoisted_15 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: "icon-export" -}, null, -1); -const _hoisted_16 = [_hoisted_15]; -const _hoisted_17 = { - class: "alert alert-info" -}; -const _hoisted_18 = ["innerHTML"]; -function TransitionSwitchervue_type_template_id_765d8cb1_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); - const _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); - const _component_MatomoLoader = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MatomoLoader"); - const _directive_transition_exporter = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("transition-exporter"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({ - widgetBody: _ctx.isWidget - }), - id: "transitions_report" - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", TransitionSwitchervue_type_template_id_765d8cb1_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", TransitionSwitchervue_type_template_id_765d8cb1_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", TransitionSwitchervue_type_template_id_765d8cb1_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { - uicontrol: "select", - name: "actionType", - modelValue: _ctx.actionType, - "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.actionType = $event), - title: _ctx.translate('Actions_ActionType'), - "full-width": true, - options: _ctx.actionTypeOptions - }, null, 8, ["modelValue", "title", "options"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", TransitionSwitchervue_type_template_id_765d8cb1_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", TransitionSwitchervue_type_template_id_765d8cb1_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { - uicontrol: "select", - name: "actionName", - modelValue: _ctx.actionName, - "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.actionName = $event), - title: _ctx.translate('Transitions_TopX', 100), - "full-width": true, - disabled: !_ctx.isEnabled, - options: _ctx.actionNameOptions - }, null, 8, ["modelValue", "title", "disabled", "options"])])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { - loading: _ctx.isLoading - }, null, 8, ["loading"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", TransitionSwitchervue_type_template_id_765d8cb1_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_MatomoLoader), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_LoadingData')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_7, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading && _ctx.isEnabled]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_8, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", _hoisted_14, _hoisted_16)), [[_directive_transition_exporter]])])])])])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isEnabled]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Transitions_AvailableInOtherReports')) + " " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Actions_PageUrls')) + ", " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Actions_SubmenuPageTitles')) + ", " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Actions_SubmenuPagesEntry')) + " " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_And')) + " " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Actions_SubmenuPagesExit')) + ". ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - innerHTML: _ctx.$sanitize(_ctx.availableInOtherReports2) - }, null, 8, _hoisted_18)])], 2); -} -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionSwitcher/TransitionSwitcher.vue?vue&type=template&id=765d8cb1 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Transitions/vue/src/TransitionSwitcher/TransitionSwitcher.vue?vue&type=script&lang=ts - - - - -/* harmony default export */ var TransitionSwitchervue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - isWidget: Boolean - }, - components: { - ActivityIndicator: external_CoreHome_["ActivityIndicator"], - Field: external_CorePluginsAdmin_["Field"], - MatomoLoader: external_CoreHome_["MatomoLoader"] - }, - directives: { - TransitionExporter: TransitionExporter - }, - data() { - return { - actionType: 'Actions.getPageUrls', - actionNameOptions: [], - actionTypeOptions: [{ - key: 'Actions.getPageUrls', - value: Object(external_CoreHome_["translate"])('Actions_PageUrls') - }, { - key: 'Actions.getPageTitles', - value: Object(external_CoreHome_["translate"])('Actions_WidgetPageTitles') - }], - isLoading: false, - actionName: null, - isEnabled: true, - noDataKey: '_____ignore_____' - }; - }, - setup() { - let transitionsInstance = null; - const transitionsUrl = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(); - const onSwitchTransitionsUrl = params => { - if (params !== null && params !== void 0 && params.url) { - transitionsUrl.value = params.url; - } - }; - external_CoreHome_["Matomo"].on('Transitions.switchTransitionsUrl', onSwitchTransitionsUrl); - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["onBeforeUnmount"])(() => { - external_CoreHome_["Matomo"].off('Transitions.switchTransitionsUrl', onSwitchTransitionsUrl); - }); - const createTransitionsInstance = (type, actionName) => { - if (!transitionsInstance) { - transitionsInstance = new window.Piwik_Transitions(type, actionName, null, ''); - } else { - transitionsInstance.reset(type, actionName, ''); - } - }; - const getTransitionsInstance = () => transitionsInstance; - return { - transitionsUrl, - createTransitionsInstance, - getTransitionsInstance - }; - }, - watch: { - transitionsUrl(newValue) { - let url = newValue; - if (this.isUrlReport) { - url = url.replace('https://', '').replace('http://', ''); - } - const found = this.actionNameOptions.find(option => { - let optionUrl = option.url; - if (optionUrl && this.isUrlReport) { - optionUrl = String(optionUrl).replace('https://', '').replace('http://', ''); - } else { - optionUrl = undefined; - } - return option.key === url || url === optionUrl && optionUrl; - }); - if (found) { - this.actionName = found.key; - } else { - // we only fetch top 100 in the report... so the entry the user clicked on, might not - // be in the top 100 - this.actionNameOptions = [...this.actionNameOptions, { - key: url, - value: url - }]; - this.actionName = url; - } - }, - actionName(newValue) { - if (newValue === null || newValue === this.noDataKey) { - return; - } - const type = this.isUrlReport ? 'url' : 'title'; - this.createTransitionsInstance(type, newValue); - this.getTransitionsInstance().showPopover(true); - }, - actionType(newValue) { - this.fetch(newValue); - } - }, - created() { - this.fetch(this.actionType); - }, - methods: { - detectActionName(reports) { - const othersLabel = Object(external_CoreHome_["translate"])('General_Others'); - reports.forEach(report => { - if (!report) { - return; - } - if (report.label === othersLabel) { - return; - } - const key = this.isUrlReport ? report.url : report.label; - if (key) { - const pageviews = Object(external_CoreHome_["translate"])('Transitions_NumPageviews', report.nb_hits); - const label = `${report.label} (${pageviews})`; - this.actionNameOptions.push({ - key, - value: label, - url: report.url - }); - if (!this.actionName) { - this.actionName = key; - } - } - }); - }, - fetch(type) { - this.isLoading = true; - this.actionNameOptions = []; - this.actionName = null; - external_CoreHome_["AjaxHelper"].fetch({ - method: type, - flat: 1, - filter_limit: 100, - filter_sort_order: 'desc', - filter_sort_column: 'nb_hits', - showColumns: 'label,nb_hits,url' - }).then(report => { - this.isLoading = false; - this.actionNameOptions = []; - this.actionName = null; - if (report !== null && report !== void 0 && report.length) { - this.isEnabled = true; - this.detectActionName(report); - } - if (this.actionName === null || this.actionNameOptions.length === 0) { - this.isEnabled = false; - this.actionName = this.noDataKey; - this.actionNameOptions.push({ - key: this.noDataKey, - value: Object(external_CoreHome_["translate"])('CoreHome_ThereIsNoDataForThisReport') - }); - } - }).catch(() => { - this.isLoading = false; - this.isEnabled = false; - }); - } - }, - computed: { - isUrlReport() { - return this.actionType === 'Actions.getPageUrls'; - }, - availableInOtherReports2() { - return Object(external_CoreHome_["translate"])('Transitions_AvailableInOtherReports2', ''); - } - } -})); -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionSwitcher/TransitionSwitcher.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionSwitcher/TransitionSwitcher.vue - - - -TransitionSwitchervue_type_script_lang_ts.render = TransitionSwitchervue_type_template_id_765d8cb1_render - -/* harmony default export */ var TransitionSwitcher = (TransitionSwitchervue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Transitions/vue/src/TransitionsPage/TransitionsPage.vue?vue&type=template&id=7f0eaf9e - -function TransitionsPagevue_type_template_id_7f0eaf9e_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_TransitionSwitcher = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("TransitionSwitcher"); - const _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); - return !_ctx.isWidget ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ContentBlock, { - key: 0, - "help-text": _ctx.translate('Transitions_FeatureDescription'), - "help-url": _ctx.externalRawLink('https://matomo.org/docs/transitions/'), - "content-title": _ctx.translate('Transitions_Transitions') - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_TransitionSwitcher, { - "is-widget": _ctx.isWidget - }, null, 8, ["is-widget"])]), - _: 1 - }, 8, ["help-text", "help-url", "content-title"])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_TransitionSwitcher, { - key: 1, - "is-widget": _ctx.isWidget - }, null, 8, ["is-widget"])); -} -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionsPage/TransitionsPage.vue?vue&type=template&id=7f0eaf9e - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Transitions/vue/src/TransitionsPage/TransitionsPage.vue?vue&type=script&lang=ts - - - -/* harmony default export */ var TransitionsPagevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - isWidget: Boolean - }, - components: { - ContentBlock: external_CoreHome_["ContentBlock"], - TransitionSwitcher: TransitionSwitcher - } -})); -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionsPage/TransitionsPage.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionsPage/TransitionsPage.vue - - - -TransitionsPagevue_type_script_lang_ts.render = TransitionsPagevue_type_template_id_7f0eaf9e_render - -/* harmony default export */ var TransitionsPage = (TransitionsPagevue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterLink.vue?vue&type=template&id=e5b0991c - -const TransitionExporterLinkvue_type_template_id_e5b0991c_hoisted_1 = { - class: "dataTableAction" -}; -const TransitionExporterLinkvue_type_template_id_e5b0991c_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: "icon-export" -}, null, -1); -const TransitionExporterLinkvue_type_template_id_e5b0991c_hoisted_3 = [TransitionExporterLinkvue_type_template_id_e5b0991c_hoisted_2]; -function TransitionExporterLinkvue_type_template_id_e5b0991c_render(_ctx, _cache, $props, $setup, $data, $options) { - const _directive_transition_exporter = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("transition-exporter"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", TransitionExporterLinkvue_type_template_id_e5b0991c_hoisted_1, TransitionExporterLinkvue_type_template_id_e5b0991c_hoisted_3)), [[_directive_transition_exporter]]); -} -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterLink.vue?vue&type=template&id=e5b0991c - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterLink.vue?vue&type=script&lang=ts - - -/* harmony default export */ var TransitionExporterLinkvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - directives: { - TransitionExporter: TransitionExporter - } -})); -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterLink.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/TransitionExporter/TransitionExporterLink.vue - - - -TransitionExporterLinkvue_type_script_lang_ts.render = TransitionExporterLinkvue_type_template_id_e5b0991c_render - -/* harmony default export */ var TransitionExporterLink = (TransitionExporterLinkvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/Transitions/vue/src/index.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - - -// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js - - - - -/***/ }) - -/******/ }); -}); -//# sourceMappingURL=Transitions.umd.js.map \ No newline at end of file diff --git a/plugins/Transitions/vue/dist/Transitions.umd.min.js b/plugins/Transitions/vue/dist/Transitions.umd.min.js deleted file mode 100644 index ec51ac5ac346459a1a91a6790368b496c71ae1d2..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/dist/Transitions.umd.min.js +++ /dev/null @@ -1,20 +0,0 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["Transitions"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["Transitions"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/Transitions/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"TransitionExporter",(function(){return N})),n.d(t,"TransitionSwitcher",(function(){return H})),n.d(t,"TransitionsPage",(function(){return q})),n.d(t,"TransitionExporterLink",(function(){return Q})),"undefined"!==typeof window){var o=window.document.currentScript,i=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var a=n("19dc"),r=n("8bbf");const s={class:"transition-export-popover row"},l={class:"col l6"},c={class:"input-field"},d={class:"matomo-field"},p={class:"col l12"},u=["href"];function m(e,t,n,o,i,a){const m=Object(r["resolveComponent"])("Field");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",s,[Object(r["createElementVNode"])("div",l,[Object(r["createElementVNode"])("div",c,[Object(r["createElementVNode"])("div",d,[Object(r["createVNode"])(m,{uicontrol:"radio",name:"exportFormat",title:e.translate("CoreHome_ExportFormat"),"model-value":e.exportFormat,"onUpdate:modelValue":t[0]||(t[0]=t=>e.exportFormat=t),"full-width":!0,options:e.exportFormatOptions},null,8,["title","model-value","options"])])])]),Object(r["createElementVNode"])("div",p,[Object(r["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:"translate('CoreHome_ExportTooltip')"},Object(r["toDisplayString"])(e.translate("General_Export")),9,u)])])}var b=n("a5a2"); -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */const O=Object(r["ref"])(""),h=Object(r["ref"])(""),v=e=>{O.value=e.actionType,h.value=e.actionName};a["Matomo"].on("Transitions.dataChanged",v);var f=Object(r["defineComponent"])({props:{exportFormatOptions:{type:Object,required:!0}},components:{Field:b["Field"]},data(){return{exportFormat:"JSON"}},computed:{exportLink(){const e={module:"API",method:"Transitions.getTransitionsForAction"};e.actionType=O.value,e.actionName=h.value,e.idSite=a["Matomo"].idSite,e.period=a["Matomo"].period,e.date=a["Matomo"].currentDateString,e.format=this.exportFormat,e.token_auth=a["Matomo"].token_auth,e.force_api_session=1;const t=window.location.href,n=t.split("/");n.pop();const o=n.join("/");return`${o}/index.php?${a["MatomoUrl"].stringify(e)}`}}});f.render=m;var j=f; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */const{Piwik_Popover:g}=window;var N={mounted(e){e.addEventListener("click",e=>{e.preventDefault();const t={exportFormat:"JSON",exportFormatOptions:[{key:"JSON",value:"JSON"},{key:"XML",value:"XML"}]},n=Object(a["createVueApp"])({template:'',data(){return{bind:t}}});n.component("popover",j);const o=document.createElement("div");n.mount(o),g.showLoading(""),g.setTitle(`${a["Matomo"].helper.htmlEntities(h.value)} ${Object(a["translate"])("Transitions_Transitions")}`),g.setContent(o),g.onClose(()=>{n.unmount()})})}};const T={class:"row"},y={class:"col s12 m3"},_={name:"actionType"},E={class:"col s12 m9"},w={name:"actionName"},x={class:"loadingPiwik",style:{display:"none"},id:"transitions_inline_loading"},V={class:"popoverContainer"},k={id:"Transitions_Error_Container"},C={class:"dataTableWrapper"},S={class:"dataTableFeatures"},A={class:"dataTableFooterNavigation"},P={class:"dataTableControls"},D={class:"row"},F={class:"dataTableAction"},L=Object(r["createElementVNode"])("span",{class:"icon-export"},null,-1),M=[L],B={class:"alert alert-info"},U=["innerHTML"];function I(e,t,n,o,i,a){const s=Object(r["resolveComponent"])("Field"),l=Object(r["resolveComponent"])("ActivityIndicator"),c=Object(r["resolveComponent"])("MatomoLoader"),d=Object(r["resolveDirective"])("transition-exporter");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{class:Object(r["normalizeClass"])({widgetBody:e.isWidget}),id:"transitions_report"},[Object(r["createElementVNode"])("div",T,[Object(r["createElementVNode"])("div",y,[Object(r["createElementVNode"])("div",_,[Object(r["createVNode"])(s,{uicontrol:"select",name:"actionType",modelValue:e.actionType,"onUpdate:modelValue":t[0]||(t[0]=t=>e.actionType=t),title:e.translate("Actions_ActionType"),"full-width":!0,options:e.actionTypeOptions},null,8,["modelValue","title","options"])])]),Object(r["createElementVNode"])("div",E,[Object(r["createElementVNode"])("div",w,[Object(r["createVNode"])(s,{uicontrol:"select",name:"actionName",modelValue:e.actionName,"onUpdate:modelValue":t[1]||(t[1]=t=>e.actionName=t),title:e.translate("Transitions_TopX",100),"full-width":!0,disabled:!e.isEnabled,options:e.actionNameOptions},null,8,["modelValue","title","disabled","options"])])])]),Object(r["createVNode"])(l,{loading:e.isLoading},null,8,["loading"]),Object(r["createElementVNode"])("div",x,[Object(r["createVNode"])(c),Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",V,null,512),[[r["vShow"],!e.isLoading&&e.isEnabled]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",k,null,512),[[r["vShow"],!e.isLoading]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",C,[Object(r["createElementVNode"])("div",S,[Object(r["createElementVNode"])("div",A,[Object(r["createElementVNode"])("div",P,[Object(r["createElementVNode"])("div",D,[Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("a",F,M)),[[d]])])])])])],512),[[r["vShow"],e.isEnabled]]),Object(r["createElementVNode"])("div",B,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("Transitions_AvailableInOtherReports"))+" "+Object(r["toDisplayString"])(e.translate("Actions_PageUrls"))+", "+Object(r["toDisplayString"])(e.translate("Actions_SubmenuPageTitles"))+", "+Object(r["toDisplayString"])(e.translate("Actions_SubmenuPagesEntry"))+" "+Object(r["toDisplayString"])(e.translate("General_And"))+" "+Object(r["toDisplayString"])(e.translate("Actions_SubmenuPagesExit"))+". ",1),Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.availableInOtherReports2)},null,8,U)])],2)}var R=Object(r["defineComponent"])({props:{isWidget:Boolean},components:{ActivityIndicator:a["ActivityIndicator"],Field:b["Field"],MatomoLoader:a["MatomoLoader"]},directives:{TransitionExporter:N},data(){return{actionType:"Actions.getPageUrls",actionNameOptions:[],actionTypeOptions:[{key:"Actions.getPageUrls",value:Object(a["translate"])("Actions_PageUrls")},{key:"Actions.getPageTitles",value:Object(a["translate"])("Actions_WidgetPageTitles")}],isLoading:!1,actionName:null,isEnabled:!0,noDataKey:"_____ignore_____"}},setup(){let e=null;const t=Object(r["ref"])(),n=e=>{null!==e&&void 0!==e&&e.url&&(t.value=e.url)};a["Matomo"].on("Transitions.switchTransitionsUrl",n),Object(r["onBeforeUnmount"])(()=>{a["Matomo"].off("Transitions.switchTransitionsUrl",n)});const o=(t,n)=>{e?e.reset(t,n,""):e=new window.Piwik_Transitions(t,n,null,"")},i=()=>e;return{transitionsUrl:t,createTransitionsInstance:o,getTransitionsInstance:i}},watch:{transitionsUrl(e){let t=e;this.isUrlReport&&(t=t.replace("https://","").replace("http://",""));const n=this.actionNameOptions.find(e=>{let n=e.url;return n=n&&this.isUrlReport?String(n).replace("https://","").replace("http://",""):void 0,e.key===t||t===n&&n});n?this.actionName=n.key:(this.actionNameOptions=[...this.actionNameOptions,{key:t,value:t}],this.actionName=t)},actionName(e){if(null===e||e===this.noDataKey)return;const t=this.isUrlReport?"url":"title";this.createTransitionsInstance(t,e),this.getTransitionsInstance().showPopover(!0)},actionType(e){this.fetch(e)}},created(){this.fetch(this.actionType)},methods:{detectActionName(e){const t=Object(a["translate"])("General_Others");e.forEach(e=>{if(!e)return;if(e.label===t)return;const n=this.isUrlReport?e.url:e.label;if(n){const t=Object(a["translate"])("Transitions_NumPageviews",e.nb_hits),o=`${e.label} (${t})`;this.actionNameOptions.push({key:n,value:o,url:e.url}),this.actionName||(this.actionName=n)}})},fetch(e){this.isLoading=!0,this.actionNameOptions=[],this.actionName=null,a["AjaxHelper"].fetch({method:e,flat:1,filter_limit:100,filter_sort_order:"desc",filter_sort_column:"nb_hits",showColumns:"label,nb_hits,url"}).then(e=>{this.isLoading=!1,this.actionNameOptions=[],this.actionName=null,null!==e&&void 0!==e&&e.length&&(this.isEnabled=!0,this.detectActionName(e)),null!==this.actionName&&0!==this.actionNameOptions.length||(this.isEnabled=!1,this.actionName=this.noDataKey,this.actionNameOptions.push({key:this.noDataKey,value:Object(a["translate"])("CoreHome_ThereIsNoDataForThisReport")}))}).catch(()=>{this.isLoading=!1,this.isEnabled=!1})}},computed:{isUrlReport(){return"Actions.getPageUrls"===this.actionType},availableInOtherReports2(){return Object(a["translate"])("Transitions_AvailableInOtherReports2",'')}}});R.render=I;var H=R;function W(e,t,n,o,i,a){const s=Object(r["resolveComponent"])("TransitionSwitcher"),l=Object(r["resolveComponent"])("ContentBlock");return e.isWidget?(Object(r["openBlock"])(),Object(r["createBlock"])(s,{key:1,"is-widget":e.isWidget},null,8,["is-widget"])):(Object(r["openBlock"])(),Object(r["createBlock"])(l,{key:0,"help-text":e.translate("Transitions_FeatureDescription"),"help-url":e.externalRawLink("https://matomo.org/docs/transitions/"),"content-title":e.translate("Transitions_Transitions")},{default:Object(r["withCtx"])(()=>[Object(r["createVNode"])(s,{"is-widget":e.isWidget},null,8,["is-widget"])]),_:1},8,["help-text","help-url","content-title"]))}var $=Object(r["defineComponent"])({props:{isWidget:Boolean},components:{ContentBlock:a["ContentBlock"],TransitionSwitcher:H}});$.render=W;var q=$;const G={class:"dataTableAction"},J=Object(r["createElementVNode"])("span",{class:"icon-export"},null,-1),K=[J];function X(e,t,n,o,i,a){const s=Object(r["resolveDirective"])("transition-exporter");return Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("a",G,K)),[[s]])}var z=Object(r["defineComponent"])({directives:{TransitionExporter:N}});z.render=X;var Q=z; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */}})})); -//# sourceMappingURL=Transitions.umd.min.js.map \ No newline at end of file diff --git a/plugins/Transitions/vue/dist/umd.metadata.json b/plugins/Transitions/vue/dist/umd.metadata.json deleted file mode 100644 index dce4477a3c58c74fe9a906c021f164b7fa49111e..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/dist/umd.metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependsOn": [ - "CoreHome", - "CorePluginsAdmin" - ] -} \ No newline at end of file diff --git a/plugins/Transitions/vue/src/TransitionExporter/TransitionExporter.ts b/plugins/Transitions/vue/src/TransitionExporter/TransitionExporter.ts deleted file mode 100644 index 51f1653658a5031e3a8e4cdcd11d4125b48cc0b5..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/src/TransitionExporter/TransitionExporter.ts +++ /dev/null @@ -1,51 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -import { createVueApp, translate, Matomo } from 'CoreHome'; -import TransitionExporterPopover from './TransitionExporterPopover'; -import { actionName } from './transitionParams'; - -const { Piwik_Popover } = window; - -export default { - mounted(element: HTMLElement): void { - element.addEventListener('click', (e) => { - e.preventDefault(); - - const props = { - exportFormat: 'JSON', - exportFormatOptions: [ - { key: 'JSON', value: 'JSON' }, - { key: 'XML', value: 'XML' }, - ], - }; - - const app = createVueApp({ - template: '', - data() { - return { - bind: props, - }; - }, - }); - app.component('popover', TransitionExporterPopover); - - const mountPoint = document.createElement('div'); - app.mount(mountPoint); - - Piwik_Popover.showLoading(''); - Piwik_Popover.setTitle( - `${Matomo.helper.htmlEntities(actionName.value)} ${translate('Transitions_Transitions')}`, - ); - Piwik_Popover.setContent(mountPoint); - - Piwik_Popover.onClose(() => { - app.unmount(); - }); - }); - }, -}; diff --git a/plugins/Transitions/vue/src/TransitionExporter/TransitionExporterLink.vue b/plugins/Transitions/vue/src/TransitionExporter/TransitionExporterLink.vue deleted file mode 100644 index 729fe91b9f2f5d1a522e44feaeae0ffe625218b2..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/src/TransitionExporter/TransitionExporterLink.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.less b/plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.less deleted file mode 100644 index 468c55cb8d8bb27118371404561d6d487908bb46..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.less +++ /dev/null @@ -1,52 +0,0 @@ -.transitions-export-popover { - - [name=format] { - .form-group label.fieldRadioTitle { - display: block; - } - - p.radio { - width: 50%; - float: left; - display: block; - } - } - - textarea { - word-break: break-all; - padding: 5px; - height: 80px; - } - - .toggle-export-url { - font-size: 14px; - margin-left: 20px; - } - - .filter_limit { - clear: both; - float: none; - - .matomo-field { - width: 50%; - float: left; - } - } - - .showoptions > span { - color: @color-blue-matomo; - cursor: pointer; - text-decoration: underline; - } - - .tooltip { - color: @color-silver; - font-size: 13px; - padding: 5px; - } - - .tooltip > a { - color: @color-blue-matomo; - text-decoration: underline; - } -} \ No newline at end of file diff --git a/plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.vue b/plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.vue deleted file mode 100644 index e57a4ff0ffa89d85e2b7b7735b7fe245cff7b9a0..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/src/TransitionExporter/TransitionExporterPopover.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - - - diff --git a/plugins/Transitions/vue/src/TransitionExporter/transitionParams.ts b/plugins/Transitions/vue/src/TransitionExporter/transitionParams.ts deleted file mode 100644 index 2bf87ef1336391d2eea9277d3ed0e04b8cc3129f..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/src/TransitionExporter/transitionParams.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -import { ref } from 'vue'; -import { Matomo } from 'CoreHome'; - -interface DataChangedParams { - actionType: string; - actionName: string; -} - -const actionType = ref(''); -const actionName = ref(''); - -const onDataChanged = (params: DataChangedParams) => { - actionType.value = params.actionType; - actionName.value = params.actionName; -}; - -Matomo.on('Transitions.dataChanged', onDataChanged); - -export { - actionType, - actionName, -}; diff --git a/plugins/Transitions/vue/src/TransitionSwitcher/TransitionSwitcher.vue b/plugins/Transitions/vue/src/TransitionSwitcher/TransitionSwitcher.vue deleted file mode 100644 index ca32b21d5b309f865d33743386cc67e2dce558b7..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/src/TransitionSwitcher/TransitionSwitcher.vue +++ /dev/null @@ -1,311 +0,0 @@ - - - - - diff --git a/plugins/Transitions/vue/src/TransitionsPage/TransitionsPage.vue b/plugins/Transitions/vue/src/TransitionsPage/TransitionsPage.vue deleted file mode 100644 index 18c64733033f971887e851ec361d8a64590f8327..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/src/TransitionsPage/TransitionsPage.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/plugins/Transitions/vue/src/index.ts b/plugins/Transitions/vue/src/index.ts deleted file mode 100644 index ccb1d3ee548aae2ef554f31f390098b2e1320dd5..0000000000000000000000000000000000000000 --- a/plugins/Transitions/vue/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -export { default as TransitionExporter } from './TransitionExporter/TransitionExporter'; -export { default as TransitionSwitcher } from './TransitionSwitcher/TransitionSwitcher.vue'; -export { default as TransitionsPage } from './TransitionsPage/TransitionsPage.vue'; -export { default as TransitionExporterLink } from './TransitionExporter/TransitionExporterLink.vue'; diff --git a/plugins/TreemapVisualization/.gitattributes b/plugins/TreemapVisualization/.gitattributes deleted file mode 100644 index d6be3a7c5c8b4d8096ac6f5a2cbdf08284bae50a..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -# Files excluded from git packages -tests/ export-ignore -.github/ export-ignore -.gitignore export-ignore -.gitattributes export-ignore -.travis.yml export-ignore diff --git a/plugins/TreemapVisualization/.github/workflows/matomo-ai-checklist.yml b/plugins/TreemapVisualization/.github/workflows/matomo-ai-checklist.yml deleted file mode 100644 index cc2c022da6f944b9683668c262330ca060d15f8b..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/.github/workflows/matomo-ai-checklist.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Action for running tests - -name: AI Checklist - -on: - pull_request: - types: [opened, synchronize, reopened, edited] - -permissions: - actions: read - checks: none - contents: none - deployments: none - issues: none - packages: none - pull-requests: read - repository-projects: none - security-events: none - statuses: none - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - AiChecklist: - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - steps: - - name: Run tests - uses: matomo-org/github-action-checklist-gate@main diff --git a/plugins/TreemapVisualization/.github/workflows/matomo-tests.yml b/plugins/TreemapVisualization/.github/workflows/matomo-tests.yml deleted file mode 100644 index fff0a8d494cbe242bed38b9705c044aac7ee51ac..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/.github/workflows/matomo-tests.yml +++ /dev/null @@ -1,75 +0,0 @@ -# Action for running tests -# This file has been automatically created. -# To recreate it you can run this command -# ./console generate:test-action --plugin="TreemapVisualization" --php-versions="matomo5_min_php,matomo5_max_php" --schedule-cron="5 2 * * 6" - -name: Plugin TreemapVisualization Tests - -on: - pull_request: - types: [opened, synchronize] - push: - branches: - - '**.x-dev' - workflow_dispatch: - schedule: - - cron: "5 2 * * 6" - -permissions: - actions: read - checks: none - contents: read - deployments: none - issues: read - packages: none - pull-requests: read - repository-projects: none - security-events: none - statuses: none - -concurrency: - group: php-${{ github.ref }} - cancel-in-progress: true - -jobs: - PluginTests: - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - php: [ 'matomo5_min_php', 'matomo5_max_php' ] - target: ['minimum_required_matomo', 'maximum_supported_matomo'] - steps: - - uses: actions/checkout@v3 - with: - lfs: true - persist-credentials: false - - name: Install package ripgrep - run: sudo apt-get install ripgrep - - name: Run tests - uses: matomo-org/github-action-tests@main - with: - plugin-name: 'TreemapVisualization' - php-version: ${{ matrix.php }} - test-type: 'PluginTests' - matomo-test-branch: ${{ matrix.target }} - artifacts-pass: ${{ secrets.ARTIFACTS_PASS }} - upload-artifacts: ${{ matrix.php == 'matomo5_min_php' && matrix.target == 'maximum_supported_matomo' }} - UI: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v3 - with: - lfs: true - persist-credentials: false - - name: running tests - uses: matomo-org/github-action-tests@main - with: - testomatio: ${{secrets.TESTOMATIO}} - plugin-name: 'TreemapVisualization' - matomo-test-branch: 'maximum_supported_matomo' - test-type: 'UI' - php-version: 'matomo5_min_php' - node-version: '16' - artifacts-pass: ${{ secrets.ARTIFACTS_PASS }} - upload-artifacts: true diff --git a/plugins/TreemapVisualization/.github/workflows/phpcs.yml b/plugins/TreemapVisualization/.github/workflows/phpcs.yml deleted file mode 100644 index 23b2f9cc6fe3c91a86d00b4565d22239d7349933..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/.github/workflows/phpcs.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: PHPCS check - -on: pull_request - -permissions: - actions: read - checks: read - contents: read - deployments: none - issues: read - packages: none - pull-requests: read - repository-projects: none - security-events: none - statuses: read - -jobs: - phpcs: - name: PHPCS - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - lfs: false - persist-credentials: false - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - tools: cs2pr - - name: Install dependencies - run: - composer init --name=matomo/treemapvisualization --quiet; - composer --no-plugins config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true -n; - composer config repositories.matomo-coding-standards vcs https://github.com/matomo-org/matomo-coding-standards -n; - composer require matomo-org/matomo-coding-standards:dev-master; - composer install --dev --prefer-dist --no-progress --no-suggest - - name: Check PHP code styles - id: phpcs - run: ./vendor/bin/phpcs --report-full --standard=phpcs.xml --report-checkstyle=./phpcs-report.xml - - name: Show PHPCS results in PR - if: ${{ always() && steps.phpcs.outcome == 'failure' }} - run: cs2pr ./phpcs-report.xml --prepend-filename diff --git a/plugins/TreemapVisualization/.gitignore b/plugins/TreemapVisualization/.gitignore deleted file mode 100644 index f804bc720f8b9cfa31879770038fc6817dd53cfd..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea -/tests/UI/processed-ui-screenshots/ \ No newline at end of file diff --git a/plugins/TreemapVisualization/API.php b/plugins/TreemapVisualization/API.php deleted file mode 100644 index deb7f75150d629edbc68e34b516bbaf11ffd66a6..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/API.php +++ /dev/null @@ -1,116 +0,0 @@ - The treemap root node data, or an empty array when the - * request does not produce a DataTable. - */ - public function getTreemapData( - $apiMethod, - $column, - $period, - $date, - $availableWidth = false, - $availableHeight = false, - $show_evolution_values = false - ) { - if (!Request::isCurrentApiRequestTheRootApiRequest() && !defined('PIWIK_TEST_MODE')) { - return []; - } - list($module, $method) = explode('.', $apiMethod); - $disAllowedApiActions = ['getBulkRequest']; - // Block if API action does not start with get - if (!$method || in_array($method, $disAllowedApiActions) || stripos($method, 'get') !== 0) { - throw new BadRequestException(Piwik::translate('TreemapVisualization_InvalidApiMethodException')); - } - - if ( - $period == 'range' - || Common::getRequestVar('idSubtable', false) - ) { - $show_evolution_values = false; - } - - $params = array(); - if ($show_evolution_values) { - list($previousDate, $ignore) = Range::getLastDate($date, $period); - $params['date'] = $previousDate . ',' . $date; - } - - $params['filter_limit'] = false; - $params['disable_queued_filters'] = true; - - $dataTable = Request::processRequest("$apiMethod", $params); - - if (!$dataTable instanceof DataTable) { - return []; - } - - $columns = explode(',', $column); - $column = reset($columns); - - $translations = Metrics::getDefaultMetricTranslations(); - $translation = empty($translations[$column]) ? $column : $translations[$column]; - - $generator = new TreemapDataGenerator($column, $translation); - $generator->setInitialRowOffset(Common::getRequestVar('filter_offset', 0, 'int')); - $generator->setAvailableDimensions($availableWidth, $availableHeight); - if ($show_evolution_values) { - $generator->showEvolutionValues(); - } - - $generator->truncateBasedOnAvailableSpace($dataTable); - $dataTable->applyQueuedFilters(); - - list($module, $method) = explode('.', $apiMethod); - if ($module == 'Actions') { - Treemap::configureGeneratorIfActionsUrlReport($generator, $method); - } - - return $generator->generate($dataTable); - } -} diff --git a/plugins/TreemapVisualization/CHANGELOG.md b/plugins/TreemapVisualization/CHANGELOG.md deleted file mode 100644 index 32be82c95303f09f4f6f7a20fa1a3a326b08ddc2..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/CHANGELOG.md +++ /dev/null @@ -1,28 +0,0 @@ -## Changelog - -# 5.0.7 - 2026-04-27 -- Updated API documentation - -# 5.0.6 - 2026-03-02 -- Updated API documentation - -# 5.0.5 - 2026-02-16 -- Added validation rules for ApiAction - -# 5.0.4 - 2025-07-07 -- Textual changes - -# 5.0.3 - 2025-01-20 -- Added code to allow calling Treemap API only directly - -# 5.0.2 - 2025-01-10 -- Avoids recursion in API calls - -# 5.0.1 -- Added plugin category for Marketplace - -# 5.0.0 -- Compatibility with Matomo 5 - -# 4.0.2 -- Translation changes and made plugin translatable diff --git a/plugins/TreemapVisualization/LICENSE b/plugins/TreemapVisualization/LICENSE deleted file mode 100644 index f288702d2fa16d3cdf0035b15a9fcbc552cd88e7..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/plugins/TreemapVisualization/README.md b/plugins/TreemapVisualization/README.md deleted file mode 100644 index 7ab3f8e3cccf779f1ec79dd244cd7de115bf4a2c..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/README.md +++ /dev/null @@ -1,23 +0,0 @@ -[![Build Status](https://github.com/matomo-org/plugin-TreemapVisualization/actions/workflows/matomo-tests.yml/badge.svg?branch=4.x-dev)](https://github.com/matomo-org/plugin-TreemapVisualization/actions/workflows/matomo-tests.yml) - -## Description - -TreemapVisualization contains a new report visualization that will display your reports as tiles of different sizes and will show you how each metric has changed from the last period. - -The treemap visualization displays rows of data as squares whose size corresponds to a metric in each row. - -If you're looking at the visits in a report, the row with the most visits will take up the most space. Just like other graph visualizations, **you can use it to easily see which rows have the largest values**. The treemap differs from other graphs though, in that **it can show many more rows**. - -#### Treemap colors for comparison with previous period - -The treemap visualization will also show you one thing that no other visualization included with Matomo does: the **evolution** of each row. Hovering over a treemap square will show you how much the row changed from the last period (ie, the last day, week, etc.). - -Each treemap square is colored based on the evolution value **so you can easily see how your data is changing**. A red square means the change is negative; a green square means the change is positive. The more green the bigger the change; the more red the smaller the change. - -#### Known limitations - -* Treemaps will not work with flattened tables. Currently, if a table is flattened, the treemap icon will be removed. -* Evolution values cannot be calculated for subtables (reports that are displayed when you click on a row or node). - -#### Feedback, bug report or requests - [github.com/matono-org/plugin-TreemapVisualization/issues](https://github.com/matomo-org/plugin-TreemapVisualization/issues) diff --git a/plugins/TreemapVisualization/TreemapConfig.php b/plugins/TreemapVisualization/TreemapConfig.php deleted file mode 100644 index 7d266813770451b45088cfbdb53ec091472ffb10..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/TreemapConfig.php +++ /dev/null @@ -1,46 +0,0 @@ -columns_to_display)) { - $this->setDefaultColumnsToDisplay(array('nb_visits'), false, false); - } - - $this->allow_multi_select_series_picker = false; - - $this->addPropertiesThatShouldBeAvailableClientSide(array( - 'filter_offset', - 'max_graph_elements', - 'show_evolution_values', - 'subtable_controller_action' - )); - } -} diff --git a/plugins/TreemapVisualization/TreemapDataGenerator.php b/plugins/TreemapVisualization/TreemapDataGenerator.php deleted file mode 100644 index 1b88b363cf27fe92877b513366d787ebf5fbe98b..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/TreemapDataGenerator.php +++ /dev/null @@ -1,334 +0,0 @@ -metricToGraph = $metricToGraph; - $this->metricTranslation = $metricTranslation; - } - - /** - * Sets the name of the root node. - * - * @param string $name - */ - public function setRootNodeName($name) - { - $this->rootName = $name; - } - - /** - * Sets the offset of the first row in the converted DataTable. - * - * @param int $offset - */ - public function setInitialRowOffset($offset) - { - $this->firstRowOffset = (int)$offset; - } - - /** - * Configures the generator to calculate the evolution of column values and include - * this data in the outputted tree structure. - */ - public function showEvolutionValues() - { - $this->showEvolutionValues = true; - } - - /** - * Sets the callback used to format row labels before they are used in treemap nodes. - * - * @param callback $formatter - */ - public function setLabelFormatter($formatter) - { - $this->labelFormatter = $formatter; - } - - /** - * Sets the available screen dimensions for this visualization. - * - * @param int $availableWidth The available screen width for the display. - * @param int $availableHeight The available screen height for the display. - */ - public function setAvailableDimensions($availableWidth, $availableHeight) - { - $this->availableWidth = $availableWidth; - $this->availableHeight = $availableHeight; - } - - /** - * Generates an array that can be encoded as JSON and used w/ the JavaScript Infovis Toolkit. - * - * @param \Piwik\DataTable $dataTable - * @return array - */ - public function generate($dataTable) - { - // sanity check: if the dataTable is not a Map, we don't have the data to calculate evolution - // values, so make sure we don't try - if (!($dataTable instanceof Map)) { - $this->showEvolutionValues = false; - } - - // if showEvolutionValues is true, $dataTable must be a DataTable\Map w/ two child tables - $pastData = false; - if ($this->showEvolutionValues) { - $pastData = $dataTable->getFirstRow(); - $dataTable = $dataTable->getLastRow(); - - $this->pastDataDate = $pastData->getMetadata(DataTableFactory::TABLE_METADATA_PERIOD_INDEX)->getLocalizedShortString(); - } - - $root = $this->makeNode('treemap-root', $this->rootName); - - $tableId = Common::getRequestVar('idSubtable', ''); - $this->addDataTableToNode($root, $dataTable, $pastData, $tableId, $this->firstRowOffset); - return $root; - } - - /** - * Computes the maximum number of elements allowed in the report to display, based on the - * available screen width/height, and truncates the report data so the number of rows - * will not exceed the max. - * - * @param DataTable $dataTable The report data. Must be sorted by the metric to graph. - * @param int $availableWidth Available width in pixels. - * @param int $availableHeight Available height in pixels. - */ - public function truncateBasedOnAvailableSpace($dataTable) - { - $truncateAfter = self::DEFAULT_MAX_ELEMENTS - 1; - if ( - is_numeric($this->availableWidth) - && is_numeric($this->availableHeight) - ) { - $totalArea = $this->availableWidth * $this->availableHeight; - - $dataTable->filter('ReplaceColumnNames'); - - $metricValues = $dataTable->getColumn($this->metricToGraph); - $metricSum = array_sum($metricValues); - - if ($metricSum != 0) { - // find the row index in $dataTable for which all rows after it will have treemap - // nodes that are too small. this is the row from which we truncate. - // Note: $dataTable is sorted at this point, so $metricValues is too - $result = 0; - foreach ($metricValues as $value) { - $nodeArea = ($totalArea * $value) / $metricSum; - - if ($nodeArea < self::MIN_NODE_AREA) { - break; - } else { - ++$result; - } - } - $truncateAfter = $result; - } - } - - $dataTable->filter('Truncate', array($truncateAfter)); - } - - private function addDataTableToNode(&$node, $dataTable, $pastData = false, $tableId = '', $offset = 0) - { - foreach ($dataTable->getRows() as $rowId => $row) { - $pastRow = $pastData ? $pastData->getRowFromLabel($row->getColumn('label')) : false; - - $childNode = $this->makeNodeFromRow($tableId, $rowId, $row, $pastRow); - if (empty($childNode)) { - continue; - } - - if ($rowId == DataTable::ID_SUMMARY_ROW) { - $childNode['data']['aggregate_offset'] = $offset + $dataTable->getRowsCount() - 1; - } elseif ($row->getIdSubDataTable() !== null) { - $childNode['data']['idSubtable'] = $row->getIdSubDataTable(); - } - - $node['children'][] = $childNode; - } - } - - private function makeNodeFromRow($tableId, $rowId, $row, $pastRow) - { - $label = $row->getColumn('label'); - if ($this->labelFormatter) { - $formatter = $this->labelFormatter; - $label = $formatter($row, $label); - } - - $columnValue = $row->getColumn($this->metricToGraph) ?: 0; - - if ($columnValue == 0) { // avoid issues in JIT w/ 0 $area values - return false; - } - - $data = array(); - $data['$area'] = $columnValue; - - // add metadata - if ($rowId !== DataTable::ID_SUMMARY_ROW) { - foreach (self::$rowMetadataToCopy as $metadataName) { - $metadataValue = $row->getMetadata($metadataName); - if ($metadataValue !== false) { - $data['metadata'][$metadataName] = $metadataValue; - } - } - } - - // add evolution - if ( - $rowId !== DataTable::ID_SUMMARY_ROW - && $this->showEvolutionValues - ) { - if ($pastRow === false) { - $data['evolution'] = 100; - } else { - $pastValue = $pastRow->getColumn($this->metricToGraph) ?: 0; - $data['evolution'] = CalculateEvolutionFilter::calculate( - $columnValue, - $pastValue, - $quotientPrecision = 0, - $appendPercentSign = false - ); - } - } - - // add node tooltip - $data['metadata']['tooltip'] = "\n" . $columnValue . ' ' . $this->metricTranslation; - if (isset($data['evolution'])) { - $plusOrMinus = $data['evolution'] >= 0 ? '+' : '-'; - $evolutionChange = $plusOrMinus . abs($data['evolution']) . '%'; - - $data['metadata']['tooltip'] = Piwik::translate('General_XComparedToY', array( - $data['metadata']['tooltip'] . "\n" . $evolutionChange, - $this->pastDataDate - )); - } - - return $this->makeNode($this->getNodeId($tableId, $rowId), $label, $data); - } - - private function getNodeId($tableId, $rowId) - { - if ($rowId == DataTable::ID_SUMMARY_ROW) { - $rowId = $this->firstRowOffset . '_' . $rowId; - } else { - $rowId = $this->firstRowOffset += $rowId; - } - - return $tableId . '_' . $rowId; - } - - private function makeNode($id, $title, $data = array()) - { - return array('id' => $id, 'name' => $title, 'data' => $data, 'children' => array()); - } -} diff --git a/plugins/TreemapVisualization/TreemapVisualization.php b/plugins/TreemapVisualization/TreemapVisualization.php deleted file mode 100644 index 51729c0f19fec827968066bb071ec8e91ed16168..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/TreemapVisualization.php +++ /dev/null @@ -1,61 +0,0 @@ - 'getStylesheetFiles', - 'AssetManager.getJavaScriptFiles' => 'getJsFiles', - 'ViewDataTable.addViewDataTable' => 'getAvailableVisualizations', // Piwik 2.X - 'ViewDataTable.filterViewDataTable' => 'removeTreemapVisualizationIfFlattenIsUsed' // Piwik 3.X - ); - } - - public function getAvailableVisualizations(&$visualizations) - { - // treemap doesn't work w/ flat=1 - if (Common::getRequestVar('flat', 0)) { - $key = array_search('Piwik\\Plugins\\TreemapVisualization\\Visualizations\\Treemap', $visualizations); - if ($key !== false) { - unset($visualizations[$key]); - } - } - } - - public function removeTreemapVisualizationIfFlattenIsUsed(&$visualizations) - { - // treemap doesn't work w/ flat=1 - if (Common::getRequestVar('flat', 0) && isset($visualizations[Treemap::ID])) { - unset($visualizations[Treemap::ID]); - } - } - - public function getStylesheetFiles(&$stylesheets) - { - $stylesheets[] = 'plugins/TreemapVisualization/stylesheets/treemap.less'; - $stylesheets[] = 'plugins/TreemapVisualization/stylesheets/treemapColors.less'; - } - - public function getJsFiles(&$jsFiles) - { - $jsFiles[] = 'plugins/TreemapVisualization/libs/Jit/jit-2.0.1-yc.js'; - $jsFiles[] = 'plugins/TreemapVisualization/javascripts/treemapViz.js'; - } -} diff --git a/plugins/TreemapVisualization/Visualizations/Treemap.php b/plugins/TreemapVisualization/Visualizations/Treemap.php deleted file mode 100644 index 85ee15cc3ae416e9884a6726f74e9836d8f882f2..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/Visualizations/Treemap.php +++ /dev/null @@ -1,222 +0,0 @@ -config->datatable_js_type = 'TreemapDataTable'; - $this->config->show_flatten_table = false; - $this->config->show_pagination_control = false; - $this->config->show_offset_information = false; - - if ('ExampleUI' == $this->requestConfig->getApiModuleToRequest()) { - $this->config->show_evolution_values = false; - } - - if ('Actions' === $this->requestConfig->getApiModuleToRequest()) { - $this->configureForActionsReports(); - } - - $this->assignTemplateVar('generator', $this->generator); - } - - public function configureForActionsReports() - { - $this->config->show_all_views_icons = true; - $this->config->show_bar_chart = false; - $this->config->show_pie_chart = false; - $this->config->show_tag_cloud = false; - - $method = $this->requestConfig->getApiMethodToRequest(); - - // for some actions reports, use all available space - if (in_array($method, self::$fullWidthActionsReports)) { - $this->config->datatable_css_class = 'infoviz-treemap-full-width'; - $this->config->max_graph_elements = 50; - } else { - $this->config->max_graph_elements = max(10, $this->config->max_graph_elements); - } - - self::configureGeneratorIfActionsUrlReport($this->generator, $method); - } - - public static function configureGeneratorIfActionsUrlReport($generator, $method) - { - if (in_array($method, self::$actionsUrlReports)) { - $generator->setLabelFormatter(function ($row, $label) { - if ($row->getIdSubDataTable() !== null) { - return $label . '/'; - } else { - return $label; - } - }); - } - } - - public function beforeLoadDataTable() - { - $this->config->max_graph_elements = false; - - parent::beforeLoadDataTable(); - - $metric = $this->getMetricToGraph($this->config->columns_to_display); - $translation = empty($this->config->translations[$metric]) ? $metric : $this->config->translations[$metric]; - - $this->generator = new TreemapDataGenerator($metric, $translation); - - $filterOffset = $this->requestConfig->filter_offset ?: 0; - $this->generator->setInitialRowOffset($filterOffset); - - $this->handleShowEvolutionValues(); - - $availableWidth = false; - if (!empty($this->config->custom_parameters['availableWidth'])) { - $availableWidth = (int)$this->config->custom_parameters['availableWidth']; - } - - $availableHeight = false; - if (!empty($this->config->custom_parameters['availableHeight'])) { - $availableHeight = (int)$this->config->custom_parameters['availableHeight']; - } - - $availableWidth = Common::getRequestVar('availableWidth', $availableWidth); - $availableHeight = Common::getRequestVar('availableHeight', $availableHeight); - $this->generator->setAvailableDimensions($availableWidth, $availableHeight); - - $this->assignTemplateVar('availableWidth', $availableWidth); - $this->assignTemplateVar('availableHeight', $availableHeight); - } - - public function afterGenericFiltersAreAppliedToLoadedDataTable() - { - $this->generator->truncateBasedOnAvailableSpace($this->getCurrentData($this->dataTable)); - } - - public function beforeGenericFiltersAreAppliedToLoadedDataTable() - { - $this->config->custom_parameters['columns'] = $this->getMetricToGraph($this->config->columns_to_display); - } - - /** - * Checks if the data obtained by ViewDataTable has data or not. Since we get the last period - * when calculating evolution, we need this hook to determine if there's data in the latest - * table. - * - * @return bool - */ - public function isThereDataToDisplay() - { - return $this->getCurrentData($this->dataTable)->getRowsCount() != 0; - } - - private function getCurrentData($dataTable) - { - if ($dataTable instanceof Map) { // will be true if calculating evolution values - $childTables = $dataTable->getDataTables(); - return end($childTables); - } else { - return $dataTable; - } - } - - public function getMetricToGraph($columnsToDisplay) - { - $firstColumn = reset($columnsToDisplay); - if ('label' == $firstColumn) { - $firstColumn = next($columnsToDisplay); - } - return $firstColumn; - } - - private function handleShowEvolutionValues() - { - // evolution values cannot be calculated if range period is used or subtable is being loaded - $period = Common::getRequestVar('period'); - if ( - $period == 'range' - || $this->requestConfig->idSubtable - ) { - return; - } - - if ($this->config->show_evolution_values) { - $date = Common::getRequestVar('date'); - list($previousDate, $ignore) = Range::getLastDate($date, $period); - - $this->requestConfig->request_parameters_to_modify['date'] = $previousDate . ',' . $date; - - $this->generator->showEvolutionValues(); - } - } -} diff --git a/plugins/TreemapVisualization/images/treemap-icon.png b/plugins/TreemapVisualization/images/treemap-icon.png deleted file mode 100644 index be66a718683bf5c84f2dcbb0914204301556e2d1..0000000000000000000000000000000000000000 Binary files a/plugins/TreemapVisualization/images/treemap-icon.png and /dev/null differ diff --git a/plugins/TreemapVisualization/javascripts/treemapViz.js b/plugins/TreemapVisualization/javascripts/treemapViz.js deleted file mode 100644 index 5236de6a6f35a0c3d6f97e4bb93ce003dda68006..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/javascripts/treemapViz.js +++ /dev/null @@ -1,629 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -(function ($, $jit, require) { - - var exports = require('piwik/UI'), - DataTable = exports.DataTable, - dataTablePrototype = DataTable.prototype, - - fullPageReports = { - 'Actions.getPageUrls': true, - 'Actions.getEntryPageUrls': true, - 'Actions.getExitPageUrls': true, - 'Actions.getEntryPageTitles': true, - 'Actions.getExitPageTitles': true, - 'Actions.getPageTitles': true, - 'Actions.getOutlinks': true, - 'Actions.getDownloads': true - }, - - COLOR_NAMESPACE_NORMAL = 'infoviz-treemap-colors', - COLOR_NAMESPACE_EVOLUTION = 'infoviz-treemap-evolution-colors'; - - /** - * Class that handles UI behavior for the treemap visualization. - */ - exports.TreemapDataTable = function (element) { - DataTable.call(this, element); - }; - - $.extend(exports.TreemapDataTable.prototype, dataTablePrototype, { - - /** - * Constructor. - */ - init: function () { - dataTablePrototype.init.call(this); - - var domElem = this.$element; - var treemapContainerId = this.workingDivId + '-infoviz-treemap'; - var treemapContainer = $('.infoviz-treemap', domElem).attr('id', treemapContainerId); - - if (!treemapContainer[0]) { - return; - } - - // we need to fix the width/height, otherwise treemap is not displayed in case treemap is the default - // visualization for a report eg PageUrls - if (!treemapContainer.height() && this.param.availableHeight) { - treemapContainer.height(this.param.availableHeight); - } - if (!treemapContainer.width() && this.param.availableWidth) { - treemapContainer.width(this.param.availableWidth); - } - - this._bindEventCallbacks(domElem); - - var self = this; - setTimeout(function () { // use a timeout in case nothing in the DOM has been sized yet - self.createJitTreemap(treemapContainer); - }, 1); - }, - - /** - * Creates the internal treemap object and renders it. - */ - createJitTreemap: function (treemapContainer) { - var treemapContainerId = treemapContainer.attr('id'), - domElem = this.$element, - headerColor = piwik.ColorManager.getColor(COLOR_NAMESPACE_NORMAL, 'header-background-color'), - self = this; - - this.treemap = new $jit.TM.Squarified({ - injectInto: treemapContainerId, - titleHeight: 24, - animate: true, // TODO: disable on ipad/w/o native canvas support - offset: 1, - levelsToShow: 1, - constrained: true, - Node: { - color: headerColor - }, - Events: { - enable: true, - onClick: function (node, info, event) { - if (event.which == 2) { - self._onMiddleClick(node); - } else { - self._onLeftClickNode(node); - } - }, - onRightClick: function (node) { - self._onRightClickNode(node); - } - }, - duration: 1000, - Tips: { - enable: false // TODO: show more in tooltips - }, - onCreateLabel: function (nodeElement, node) { - self._initNode(nodeElement, node); - }, - onPlaceLabel: function (nodeElement, node) { - self._toggleLabelBasedOnAvailableSpace(nodeElement, node); - } - }); - - this.data = this._prepareTreemapData(treemapContainer.attr('data-data')); - this._refreshTreemap({animate: true}); - this._addSeriesPicker(domElem); - }, - - /** - * Recursively iterates over the entire data tree and executes a function with - * each node. - * - * @param {Function} f The function to execute. Accepts one argument, the node. - * @param {Object} [node] The JSON node object to start from. This defaults to the root - * of the entire tree. - */ - foreachNode: function (f, node) { - node = node || this.data; - - f(node); - for (var i = 0; i != (node.children || []).length; ++i) { - this.foreachNode(f, node.children[i]); - } - }, - - /** - * Changes the metric the treemap displays. - * - * @param {String} metric The name of the metric, e.g. 'nb_visits', 'nb_actions', etc. - */ - changeMetric: function (metric) { - this.param.columns = metric; - this.reloadAjaxDataTable(); - }, - - /** - * Handle events to make this control functional. - */ - _bindEventCallbacks: function (domElem) { - var self = this; - domElem.on('click', '.infoviz-treemap-zoom-out', function (e) { - e.preventDefault(); - self._leaveNode(); - return false; - }); - - this.onWidgetResize(function () { - self.resize(); - }); - }, - - resize: function () { - var $treemap = this.$element.find('.infoviz-treemap'); - var height = $treemap.height(); - - if (!height && this.param.availableHeight) { - height = this.param.availableHeight; - } - - var width = $treemap.width(); - if (!width && this.param.availableWidth) { - width = this.param.availableWidth; - } - - this.treemap.canvas.resize(width, height); - }, - - /** - * Adds the SeriesPicker DataTable visualization widget to this treemap visualization. - */ - _addSeriesPicker: function (dataTableDomElem) { - var self = this; - var SeriesPicker = require('piwik/DataTableVisualizations/Widgets').SeriesPicker; - - this._seriesPicker = new SeriesPicker(this); - - $(this._seriesPicker).bind('placeSeriesPicker', function () { - var displayedColumn = this.getMetricTranslation(self.param.columns); - - var metricLabel = $('') - .addClass('infoviz-treemap-colors') - .attr('data-name', 'header-color') - .text("— " + displayedColumn) - ; - - var seriesPickerContainer = $('
') // TODO: this behavior should probably be a part of SeriesPicker - .addClass('infoviz-treemap-series-picker') - .append(metricLabel) - .append(this.domElem) - ; - - dataTableDomElem.find('.infoviz-treemap').prepend(seriesPickerContainer); - }); - - $(this._seriesPicker).bind('seriesPicked', function (e, columns) { - self.changeMetric(columns[0]); - }); - - this._seriesPicker.init(); - }, - - /** - * Initializes the display of a treemap node element. - */ - _initNode: function (nodeElement, node) { - var $nodeElement = $(nodeElement), - nodeHasUrl = node.data.metadata && node.data.metadata.url, - nodeHasLogo = node.data.metadata && node.data.metadata.logo; - - // add label (w/ logo if it exists) - var $label = $('
').addClass("infoviz-treemap-node-label"); - $label.append($('').text(node.name)); - - var leftImage = null; - if (nodeHasLogo) { - leftImage = node.data.metadata.logo; - } else if (nodeHasUrl) { - leftImage = 'plugins/Morpheus/images/link.png'; - } - - if (leftImage) { - $label.prepend($('').attr('src', leftImage)); - } - - $nodeElement.append($label); - - // set node tooltip - var tooltip = node.name; - if (nodeHasUrl) { - tooltip += ' (' + node.data.metadata.url + ')'; - } - if (node.data.metadata - && node.data.metadata.tooltip - ) { - tooltip += ' ' + node.data.metadata.tooltip; - } - $nodeElement.attr('title', tooltip); - - // set label color - if (this.labelColor) { - $label.css('color', this.labelColor); - } - - // if the node can be clicked into, show a pointer cursor over it - if (this._canEnterNode(node) - || nodeHasUrl - ) { - $nodeElement.addClass("infoviz-treemap-enterable-node"); - } - }, - - /** - * Shows/hides the label depending on whether there's enough vertical space in the node - * to show it. - */ - _toggleLabelBasedOnAvailableSpace: function (nodeElement, node) { - var $nodeElement = $(nodeElement), - $label = $nodeElement.children('span'); - $label.toggle($nodeElement.height() > $label.height()); - }, - - /** - * Prepares data obtained from Matomo server-side code to be used w/ the JIT Treemap - * visualization. Will make sure each node ID is unique and has a color. - */ - _prepareTreemapData: function (data) { - if (typeof data == 'string') { - data = JSON.parse(data); - } - - this._prependDataTableIdToNodeIds(this.workingDivId, data); - this._setTreemapColors(data); - return data; - }, - - /** - * Reloads the treemap visualization using this.data. - */ - _refreshTreemap: function (options) { - if (!options.animate) { - this.treemap.config.animate = false; - } - - this.treemap.loadJSON(this.data); - this.treemap.refresh(); - - if (!options.animate) { - this.treemap.config.animate = true; - } - }, - - /** - * Alters the ID of each node in tree so it will be unique even if more than one treemap - * is displayed. - */ - _prependDataTableIdToNodeIds: function (idPrefix, tree) { - tree.id = idPrefix + '-' + tree.id; - - var children = tree.children || []; - for (var i = 0; i != children.length; ++i) { - this._prependDataTableIdToNodeIds(idPrefix, children[i]); - } - }, - - /** - * Sets the color of each treemap node. - */ - _setTreemapColors: function (root) { - if (this.props.show_evolution_values) { - this._setTreemapColorsFromEvolution(root); - } else { - this._setTreemapColorsNormal(root); - } - }, - - _setTreemapColorsFromEvolution: function (root) { - // get colors - var colorManager = piwik.ColorManager; - var colorNames = ['no-change', 'negative-change-max', 'positive-change-max', 'label']; - var colors = colorManager.getColors(COLOR_NAMESPACE_EVOLUTION, colorNames); - - // find min-max evolution values to make colors relative to - var minEvolution = -100, maxEvolution = 100; - this.foreachNode(function (node) { - var evolution = node.data.evolution || 0; - - if (evolution < 0) { - minEvolution = Math.min(minEvolution, evolution); - } else if (evolution > 0) { - maxEvolution = Math.max(maxEvolution, evolution); - } - }, root); - - // color each node - var self = this, - negativeChangeColor = colorManager.getRgb(colors['negative-change-max'] || '#f00'), - positiveChangeColor = colorManager.getRgb(colors['positive-change-max'] || '#0f0'), - noChangeColor = colorManager.getRgb(colors['no-change'] || '#333'); - - this.foreachNode(function (node) { - var evolution = node.data.evolution || 0; - - var color; - if (evolution < 0) { - var colorPercent = (minEvolution - evolution) / minEvolution; - color = colorManager.getSingleColorFromGradient(negativeChangeColor, noChangeColor, colorPercent); - } else if (evolution > 0) { - var colorPercent = (maxEvolution - evolution) / maxEvolution; - color = colorManager.getSingleColorFromGradient(positiveChangeColor, noChangeColor, colorPercent); - } else { - color = colors['no-change']; - } - - node.data.$color = color; - }, root); - - this.labelColor = colors.label; - }, - - /** - * Sets the color of treemap nodes using pie-graph-colors. - */ - _setTreemapColorsNormal: function (root) { - var normalColor = piwik.ColorManager.getColor(COLOR_NAMESPACE_NORMAL, 'normal-node-color'); - this.foreachNode(function (node) { - node.data.$color = normalColor; - }, root); - }, - - /** - * Event handler for when a node is left-clicked. - * - * This function will enter the node if it can be entered. If it can't be entered, we try - * and open the node's associated URL, if it has one. - */ - _onLeftClickNode: function (node) { - if (!node) { - return; - } - - if (this._nodeHasSubtable(node)) { - this._enterSubtable(node); - } else { - this._openNodeUrl(node); - } - }, - - /** - * Event handler for when a node is middle clicked. - * - * If the node has a url, this function will load the URL in a new tab/window. - */ - _onMiddleClick: function (node) { - if (!node) { - return; - } - - this._openNodeUrl(node); - }, - - /** - * If the given node has an associated URL, it is opened in a new tab/window. - */ - _openNodeUrl: function (node) { - if (node.data.metadata - && node.data.metadata.url - ) { - window.open(node.data.metadata.url, '_blank'); - } - }, - - /** - * Event handler for when a node is right clicked. - * - * This function will advance to the parent of the current node, if it has one. - */ - _onRightClickNode: function (node) { - this._leaveNode(); - }, - - /** - * Enter a treemap node that is a node for a row w/ a subtable. - */ - _enterSubtable: function (node) { - if (node.data.loading) { - return; - } - - if (!node.data.loaded) { - var self = this; - this._loadSubtableNodeChildren(node, function (newNode) { - self._enterNode(newNode); - }); - } else { - this._enterNode(node); - } - }, - - /** - * Enters a node and toggles the zoom out link. - */ - _enterNode: function (node) { - this.treemap.enter(node); - this._toggleZoomOut(true); - }, - - /** - * Leaves a node and toggles the zoom out link if at the root node. - */ - _leaveNode: function () { - this.treemap.out(); - this._toggleZoomOut(); - }, - - /** - * Show/hide the zoom out button based on the currently selected node. - */ - _toggleZoomOut: function (toggle) { - var toggle = toggle || (this.treemap.clickedNode && !this._isFirstLevelNode(this.treemap.clickedNode)); - $('.infoviz-treemap-zoom-out', this.$element).css('visibility', toggle ? 'visible' : 'hidden'); - }, - - /** - * Returns true if node is a child of the root node, false if it represents a subtable row. - */ - _isFirstLevelNode: function (node) { - var parents = node.getParents(); - - if (!parents || !parents.length) { - return true; - } - - var parent = parents[0]; - return !parent || parent.id.indexOf('treemap-root') != -1; - }, - - /** - * Loads data for a node's subtable without reloading the datatable view. - */ - _loadSubtableNodeChildren: function (node, callback) { - var ajax = this._getNodeChildrenAjax({ - idSubtable: node.data.idSubtable - - }, node, callback); - ajax.send(); - }, - - /** - * Loads a node's children via AJAX and updates w/o reloading the datatable view. - */ - _getNodeChildrenAjax: function (overrideParams, node, callback) { - var self = this, - dataNode = self._findNodeWithId(node.id), - params = $.extend({}, self.param, overrideParams, { - module: 'API', - method: 'TreemapVisualization.getTreemapData', - action: 'index', - apiMethod: self.param.module + '.' + self.props.subtable_controller_action, - format: 'json', - column: self.param.columns, - show_evolution_values: self.props.show_evolution_values || 0 - }); - - // make sure parallel load data requests aren't made - node.data.loading = dataNode.data.loading = true; - - var ajax = new ajaxHelper(); - ajax.addParams(params, 'get'); - ajax.setLoadingElement('#' + self.workingDivId + ' .loadingPiwikBelow'); - ajax.setCallback(function (response) { - dataNode.data.loaded = true; - delete dataNode.data.loading; - - var repsonse = self._prepareTreemapData(response); - dataNode.children = response.children; - - self._refreshTreemap({animate: false}); - - callback(self.treemap.graph.getNode(node.id)); - }); - ajax.setFormat('json'); - return ajax; - }, - - /** - * Returns true if the given node is the node of an aggregate row, false if otherwise. - */ - _isOthersNode: function (node) { - return this._getRowIdFromNode(node) == -1; - }, - - /** - * Returns true if the given node has a subtable, false if otherwise. - */ - _nodeHasSubtable: function (node) { - return !!node.data.idSubtable; - }, - - /** - * Returns true if the given node can be entered, false if otherwise. - * - * A node can be entered if it has a subtable. - */ - _canEnterNode: function (node) { - return this._nodeHasSubtable(node); - }, - - /** - * Returns the ID of the DataTable row associated with a node. - */ - _getRowIdFromNode: function (node) { - return node.id.substring(node.id.lastIndexOf('_') + 1); - }, - - /** - * Find node in the JSON data used to initialize the Treemap by its ID. - */ - _findNodeWithId: function (id, node) { - if (!node) { - node = this.data; - } - - if (node.id == id) { - return node; - } - - for (var i = 0; i != node.children.length; ++i) { - var result = this._findNodeWithId(id, node.children[i]); - if (result) { - return result; - } - } - } - }); - - DataTable.registerFooterIconHandler('infoviz-treemap', function (dataTable, viewDataTableId) { - var filters = dataTable.resetAllFilters(); - - // make sure only one column is used - var columns = filters.columns || 'nb_visits'; - if (columns.indexOf(',') != -1) { - columns = columns.split(',')[0]; - } - dataTable.param.columns = columns; - - // determine what the width of a treemap will be, by inserting a dummy infoviz-treemap element - // into the DOM - var $wrapper = dataTable.$element.find('.dataTableWrapper'), - $reportHeader = dataTable._findReportHeader(dataTable.$element), - $dummyTreemap = $('
').addClass('infoviz-treemap').css({'visibility': 'hidden', 'position': 'absolute'}); - - $wrapper.prepend($dummyTreemap); - var width = $dummyTreemap.width(), height = $dummyTreemap.height(); - - var report = dataTable.$element.attr('data-report'), - isFullpage = fullPageReports[report]; - if (isFullpage) { - height = $(window).height() - dataTable.$element.find('.dataTableFeatures').height() - $reportHeader.height() - 20; - } - - // send available width & height so we can pick the best number of elements to display - dataTable.param.availableWidth = width; - dataTable.param.availableHeight = height; - - dataTable.param.viewDataTable = viewDataTableId; - dataTable.reloadAjaxDataTable(true, function (response) { - dataTable.dataTableLoaded(response, dataTable.workingDivId); - - if (isFullpage) { - piwikHelper.lazyScrollTo($reportHeader || dataTable.$element, 400, true); - } - }); - dataTable.notifyWidgetParametersChange(dataTable.$element, { - viewDataTable: viewDataTableId, - availableWidth: width, - availableHeight: height, - columns: columns - }); - }); - -}(jQuery, $jit, require)); \ No newline at end of file diff --git a/plugins/TreemapVisualization/lang/am.json b/plugins/TreemapVisualization/lang/am.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/am.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/ar.json b/plugins/TreemapVisualization/lang/ar.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ar.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/az.json b/plugins/TreemapVisualization/lang/az.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/az.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/be.json b/plugins/TreemapVisualization/lang/be.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/be.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/bg.json b/plugins/TreemapVisualization/lang/bg.json deleted file mode 100644 index cd7ff7ead1338ce85a7d7c4f2b693fc4d0cc616e..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/bg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Визуализирайте всеки отчет в Matomo като Treemap. Кликнете върху иконата Treemap във всеки отчет, за да заредите визуализацията.", - "Treemap": "Дървовидна карта" - } -} diff --git a/plugins/TreemapVisualization/lang/bn.json b/plugins/TreemapVisualization/lang/bn.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/bn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/bs.json b/plugins/TreemapVisualization/lang/bs.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/bs.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/ca.json b/plugins/TreemapVisualization/lang/ca.json deleted file mode 100644 index 4880e945c719be095f74a2a7b7ec670fa8f6ff81..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ca.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Visualitza qualsevol informe a Matomo com un mapa d'arbre. Feu clic a la icona del mapa d'arbre de cada informe per carregar la visualització.", - "Treemap": "Mapa d'arbre" - } -} diff --git a/plugins/TreemapVisualization/lang/cs.json b/plugins/TreemapVisualization/lang/cs.json deleted file mode 100644 index d95bf83dbca7a4bf9b269e552b0424d0676e41e3..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/cs.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Vizualizujte libovolnou sestavu v aplikaci Matomo jako mapu stromů. Kliknutím na ikonu mapy stromů v každé sestavě načtete vizualizaci.", - "Treemap": "Mapa stromů" - } -} diff --git a/plugins/TreemapVisualization/lang/cy.json b/plugins/TreemapVisualization/lang/cy.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/cy.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/da.json b/plugins/TreemapVisualization/lang/da.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/da.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/de.json b/plugins/TreemapVisualization/lang/de.json deleted file mode 100644 index 2c7f78cb731fc1666210fa68901ad408940cc305..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/de.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "InvalidApiMethodException": "Ungültige API-Methode.", - "PluginDescription": "Visualisieren Sie jeden Bericht in Matomo als Treemap. Klicken Sie auf das Treemap-Symbol in einem Bericht, um die Visualisierung zu laden.", - "Treemap": "Verzeichnisbaum" - } -} diff --git a/plugins/TreemapVisualization/lang/dv.json b/plugins/TreemapVisualization/lang/dv.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/dv.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/el.json b/plugins/TreemapVisualization/lang/el.json deleted file mode 100644 index 851ef030a20d61fe3bc118f6d27d4be5e2b21a4e..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/el.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "InvalidApiMethodException": "Μη έγκυρη μέθοδος API.", - "PluginDescription": "Οπτικοποιήστε οποιαδήποτε αναφορά στο Matomo ως Χάρτης δέντρου. Κάντε κλικ στο εικονίδιο του Χάρτη δέντρου για να φορτωθεί η οπτικοποίηση.", - "Treemap": "Χάρτης δέντρου" - } -} diff --git a/plugins/TreemapVisualization/lang/en.json b/plugins/TreemapVisualization/lang/en.json deleted file mode 100644 index e4bd7ee0a426cdac6013d3f717d2603368c6c788..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/en.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Visualise any report in Matomo as a Treemap. Click on the Treemap icon in each report to load the visualisation.", - "Treemap": "Treemap", - "InvalidApiMethodException": "Invalid API method." - } -} \ No newline at end of file diff --git a/plugins/TreemapVisualization/lang/eo.json b/plugins/TreemapVisualization/lang/eo.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/eo.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/es-ar.json b/plugins/TreemapVisualization/lang/es-ar.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/es-ar.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/es.json b/plugins/TreemapVisualization/lang/es.json deleted file mode 100644 index 8c6e2ef49ba7eb7441e0044770beb4803c8bf35e..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/es.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Visualice cualquier informe en Matomo como un diagrama de árbol. Haga clic en el icono de Treemap en cada informe para cargar la visualización.", - "Treemap": "Mapa de árbol" - } -} diff --git a/plugins/TreemapVisualization/lang/et.json b/plugins/TreemapVisualization/lang/et.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/et.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/eu.json b/plugins/TreemapVisualization/lang/eu.json deleted file mode 100644 index 70491b1cc14d84f7ed5fe9a1109a8ee6c278b393..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/eu.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Bistaratu Matomoko edozein txosten laukizuzen moduko diagrama bezala. Egin klik txosten bakoitzeko Laukizuzen modukoa ikonoan bisualizazioa kargatzeko.", - "Treemap": "Laukizuzen modukoa" - } -} diff --git a/plugins/TreemapVisualization/lang/fa.json b/plugins/TreemapVisualization/lang/fa.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/fa.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/fi.json b/plugins/TreemapVisualization/lang/fi.json deleted file mode 100644 index 58c799da98b59d16884659e0d03d151e3bedd12c..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/fi.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Visualisoi mikä tahansa raportti Matomossa Treemap-muodossa. Lataa visualisointi napsauttamalla kunkin raportin Treemap-kuvaketta." - } -} diff --git a/plugins/TreemapVisualization/lang/fr.json b/plugins/TreemapVisualization/lang/fr.json deleted file mode 100644 index a08e06b7c18175689274e09cefd747a92b057837..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/fr.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "InvalidApiMethodException": "Méthode d'API invalide.", - "PluginDescription": "Visualisez n'importe quel rapport dans Matomo sous forme de Treemap. Cliquez sur l'icône Treemap dans chaque rapport pour charger la visualisation.", - "Treemap": "Treemp" - } -} diff --git a/plugins/TreemapVisualization/lang/ga.json b/plugins/TreemapVisualization/lang/ga.json deleted file mode 100644 index 9499ab86142f376709758cf54dd94dade2d424c3..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ga.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "InvalidApiMethodException": "Modh API neamhbhailí.", - "PluginDescription": "Amharc ar aon tuairisc in Matomo mar Threapchlár. Cliceáil ar an deilbhín Treemap i ngach tuairisc chun an léirshamhlú a luchtú.", - "Treemap": "Mapa crainn" - } -} diff --git a/plugins/TreemapVisualization/lang/gl.json b/plugins/TreemapVisualization/lang/gl.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/gl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/gu.json b/plugins/TreemapVisualization/lang/gu.json deleted file mode 100644 index 3e4133c9c47b7c240c113508a9ec1630991ea550..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/gu.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Matomo માં કોઈપણ અહેવાલને ટ્રીમેપ તરીકે વિઝ્યુઅલાઈઝ કરો. વિઝ્યુલાઇઝેશન લોડ કરવા માટે દરેક રિપોર્ટમાં ટ્રીમેપ આઇકોન પર ક્લિક કરો.", - "Treemap": "ટ્રીમેપ" - } -} diff --git a/plugins/TreemapVisualization/lang/he.json b/plugins/TreemapVisualization/lang/he.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/he.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/hi.json b/plugins/TreemapVisualization/lang/hi.json deleted file mode 100644 index 9d118bde80177207f88b6ed8d876647c785b46ce..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/hi.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "माटोमो में किसी भी रिपोर्ट को ट्रीमैप के रूप में विज़ुअलाइज़ करें। विज़ुअलाइज़ेशन लोड करने के लिए प्रत्येक रिपोर्ट में ट्रीमैप आइकन पर क्लिक करें।", - "Treemap": "ट्रीमैप" - } -} diff --git a/plugins/TreemapVisualization/lang/hr.json b/plugins/TreemapVisualization/lang/hr.json deleted file mode 100644 index d4d332f7becbe6b4002d53fb9b1ba5b8146eca6c..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/hr.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "InvalidApiMethodException": "Nevaljana API metoda.", - "PluginDescription": "Vizualiziraj bilo koje izvještaj u Matomu kao hijerarhijsku kartu (Treemap). Klikni na ikonu Treemap u svakom izvještaju kako biste učitali vizualizaciju.", - "Treemap": "Treemap" - } -} diff --git a/plugins/TreemapVisualization/lang/hu.json b/plugins/TreemapVisualization/lang/hu.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/hu.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/hy.json b/plugins/TreemapVisualization/lang/hy.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/hy.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/id.json b/plugins/TreemapVisualization/lang/id.json deleted file mode 100644 index 1d8aa7176d09b0c033f69b6a4b994515bf827ba1..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/id.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Memvisualisasikan laporan apa pun di Matomo sebagai Peta Hierarki. Klik ikon Peta Hierarki di setiap laporan untuk memuat visualisasi.", - "Treemap": "Peta Hierarki" - } -} diff --git a/plugins/TreemapVisualization/lang/is.json b/plugins/TreemapVisualization/lang/is.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/is.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/it.json b/plugins/TreemapVisualization/lang/it.json deleted file mode 100644 index 4373cc95fc9fb2ff4d8d362eaec7954ab24956aa..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/it.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Visualizza qualsiasi report in Matomo come mappa ad albero. Clicca sull'icona della mappa ad albero in ciascun report per caricarne la visualizzazione.", - "Treemap": "Mappa ad albero" - } -} diff --git a/plugins/TreemapVisualization/lang/ja.json b/plugins/TreemapVisualization/lang/ja.json deleted file mode 100644 index 887324f673883a149e26d49abfaa7625e890dd5f..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ja.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Matomo のレポートをツリーマップとして視覚化します。 各レポートのツリーマップ アイコンをクリックして、視覚化を読み込みます。", - "Treemap": "ツリーマップ" - } -} diff --git a/plugins/TreemapVisualization/lang/ka.json b/plugins/TreemapVisualization/lang/ka.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ka.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/ko.json b/plugins/TreemapVisualization/lang/ko.json deleted file mode 100644 index 9e953488a568eb64c6eacce857043ccc8e0d9803..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ko.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Matomo의 모든 보고서를 트리맵으로 시각화합니다. 각 보고서에서 트리맵 아이콘을 클릭하여 비주얼리제이션을 불러옵니다.", - "Treemap": "트리맵" - } -} diff --git a/plugins/TreemapVisualization/lang/ku.json b/plugins/TreemapVisualization/lang/ku.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ku.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/lb.json b/plugins/TreemapVisualization/lang/lb.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/lb.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/lt.json b/plugins/TreemapVisualization/lang/lt.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/lt.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/lv.json b/plugins/TreemapVisualization/lang/lv.json deleted file mode 100644 index 3be09ebd2bce0da0919d536c01dd2a25979c1852..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/lv.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Vizualizējiet jebkuru Matomo ziņojumu kā koku diagrammu. Klikšķiet uz koku diagrammas ikonas katrā ziņojumā, lai ielādētu vizualizāciju.", - "Treemap": "Koku diagramma" - } -} diff --git a/plugins/TreemapVisualization/lang/ms.json b/plugins/TreemapVisualization/lang/ms.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ms.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/nb.json b/plugins/TreemapVisualization/lang/nb.json deleted file mode 100644 index 0a10da39d1146229ecae4471fc1c1a96035be414..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/nb.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Klikk på blokkdiagramsikonet i hvilken som helst rapport i Matomo for å visualisere den som et blokkdiagram.", - "Treemap": "Blokkdiagram" - } -} diff --git a/plugins/TreemapVisualization/lang/nl.json b/plugins/TreemapVisualization/lang/nl.json deleted file mode 100644 index b6ee389da050b95b4b3e1630ebdeaa771e391e59..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/nl.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Visualiseer elk rapport in Matomo als een Treemap. Klik in elk rapport op het Treemap-pictogram om de visualisatie te laden.", - "Treemap": "Boomdiagram" - } -} diff --git a/plugins/TreemapVisualization/lang/nn.json b/plugins/TreemapVisualization/lang/nn.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/nn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/pl.json b/plugins/TreemapVisualization/lang/pl.json deleted file mode 100644 index 47d4e2189b5d1e379ad0a45efb5d8ff769051e4d..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/pl.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "InvalidApiMethodException": "Niepoprawna metoda API.", - "PluginDescription": "Wizualizacja dowolnego raportu w Matomo jako mapy drzewa. Kliknij na ikonę Mapy drzewa w każdym raporcie, aby załadować wizualizację.", - "Treemap": "Mapa drzewa" - } -} diff --git a/plugins/TreemapVisualization/lang/pt-br.json b/plugins/TreemapVisualization/lang/pt-br.json deleted file mode 100644 index 7e2a81489e088b153b94fb0210e1607ce1287f35..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/pt-br.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "InvalidApiMethodException": "Método de API inválido.", - "PluginDescription": "Visualize qualquer relatório no Matomo como um Treemap. Clique no ícone Treemap em cada relatório para carregar a visualização.", - "Treemap": "Mapa de árvore" - } -} diff --git a/plugins/TreemapVisualization/lang/pt.json b/plugins/TreemapVisualization/lang/pt.json deleted file mode 100644 index c40dbd230e44d86b6c905b9ad74bf312e41cb0d7..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/pt.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Visualize qualquer relatório no Matomo como um Treemap (árvore). Clique no ícone Treemap em cada relatório para carregar a visualização.", - "Treemap": "Treemap (árvore)" - } -} diff --git a/plugins/TreemapVisualization/lang/ro.json b/plugins/TreemapVisualization/lang/ro.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ro.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/ru.json b/plugins/TreemapVisualization/lang/ru.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ru.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/si.json b/plugins/TreemapVisualization/lang/si.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/si.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/sk.json b/plugins/TreemapVisualization/lang/sk.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/sk.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/sl.json b/plugins/TreemapVisualization/lang/sl.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/sl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/sq.json b/plugins/TreemapVisualization/lang/sq.json deleted file mode 100644 index c8d2b1af628066b636eb1d2adc957e5ecb83e507..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/sq.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "InvalidApiMethodException": "Metodë API e pavlefshme.", - "PluginDescription": "Shfaqeni çfarëdo raporti në Matomo në trajtën e një peme. Që të ngarkohet ajo paraqitje, klikoni mbi ikonën e Pemës te secili raport.", - "Treemap": "Pemë" - } -} diff --git a/plugins/TreemapVisualization/lang/sr.json b/plugins/TreemapVisualization/lang/sr.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/sr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/sv.json b/plugins/TreemapVisualization/lang/sv.json deleted file mode 100644 index 0d86d94f1975e36b752cabd1b342c93780f84690..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/sv.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Visualisera alla rapporter i Matomo som en trädkarta. Klicka på Treemap-ikonen i varje rapport för att ladda visualiseringen.", - "Treemap": "Trädkarta" - } -} diff --git a/plugins/TreemapVisualization/lang/ta.json b/plugins/TreemapVisualization/lang/ta.json deleted file mode 100644 index 9b9b0f95ae284862b77b9a287f06f8a64941c180..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "மாடோமோவில் எந்தவொரு அறிக்கையையும் ஒரு ட்ரீமாப் என்று காட்சிப்படுத்துங்கள். காட்சிப்படுத்தலை ஏற்ற ஒவ்வொரு அறிக்கையிலும் உள்ள TREEMAP ஐகானைக் சொடுக்கு செய்க.", - "Treemap": "ட்ரீமாப்" - } -} diff --git a/plugins/TreemapVisualization/lang/te.json b/plugins/TreemapVisualization/lang/te.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/te.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/th.json b/plugins/TreemapVisualization/lang/th.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/th.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/tl.json b/plugins/TreemapVisualization/lang/tl.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/tl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/tr.json b/plugins/TreemapVisualization/lang/tr.json deleted file mode 100644 index e21580e23d8852b2dfb5996bb6e036493fa430b5..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/tr.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "TreemapVisualization": { - "InvalidApiMethodException": "API yöntemi geçersiz.", - "PluginDescription": "Matomo üzerindeki herhangi bir raporu ağaç biçiminde görselleştirin. Görselleştirmeyi yüklemek için her rapordaki Ağaç simgesine tıklayabilirsiniz.", - "Treemap": "Ağaç" - } -} diff --git a/plugins/TreemapVisualization/lang/tzm.json b/plugins/TreemapVisualization/lang/tzm.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/tzm.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/uk.json b/plugins/TreemapVisualization/lang/uk.json deleted file mode 100644 index d2c56a8f58daf87812c5c08a5c9bba1e4c74f8a7..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/uk.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "Візуалізуйте будь-який звіт в Matomo у вигляді карти-схеми. Клацніть на піктограму карти в кожному звіті, щоб завантажити візуалізацію.", - "Treemap": "Карта-схема" - } -} diff --git a/plugins/TreemapVisualization/lang/ur.json b/plugins/TreemapVisualization/lang/ur.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/ur.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/vi.json b/plugins/TreemapVisualization/lang/vi.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/vi.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/zh-cn.json b/plugins/TreemapVisualization/lang/zh-cn.json deleted file mode 100644 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/zh-cn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/plugins/TreemapVisualization/lang/zh-tw.json b/plugins/TreemapVisualization/lang/zh-tw.json deleted file mode 100644 index fe99a7cf739656396936f2f8b2417a216b78df8d..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/lang/zh-tw.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TreemapVisualization": { - "PluginDescription": "在 Matomo 中以樹狀圖視覺化任何報表。在報表中點擊樹狀圖圖示,來載入此視覺化圖。", - "Treemap": "樹狀圖" - } -} diff --git a/plugins/TreemapVisualization/libs/Jit/jit-2.0.1-yc.js b/plugins/TreemapVisualization/libs/Jit/jit-2.0.1-yc.js deleted file mode 100644 index abdcf7a02f0efe6b355970374cfa5f41f19b86fc..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/libs/Jit/jit-2.0.1-yc.js +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (c) 2011 Sencha Inc. - Author: Nicolas Garcia Belmonte (http://philogb.github.com/) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - */ - (function(){window.$jit=function(x){x=x||window;for(var y in $jit){if($jit[y].$extend){x[y]=$jit[y]}}};$jit.version="2.0.1";var c=function(w){return document.getElementById(w)};c.empty=function(){};c.extend=function(y,w){for(var x in (w||{})){y[x]=w[x]}return y};c.lambda=function(w){return(typeof w=="function")?w:function(){return w}};c.time=Date.now||function(){return +new Date};c.splat=function(x){var w=c.type(x);return w?((w!="array")?[x]:x):[]};c.type=function(x){var w=c.type.s.call(x).match(/^\[object\s(.*)\]$/)[1].toLowerCase();if(w!="object"){return w}if(x&&x.$$family){return x.$$family}return(x&&x.nodeName&&x.nodeType==1)?"element":w};c.type.s=Object.prototype.toString;c.each=function(B,A){var z=c.type(B);if(z=="object"){for(var y in B){A(B[y],y)}}else{for(var x=0,w=B.length;x>16,y>>8&255,y&255]}};c.destroy=function(w){c.clean(w);if(w.parentNode){w.parentNode.removeChild(w)}if(w.clearAttributes){w.clearAttributes()}};c.clean=function(z){for(var y=z.childNodes,x=0,w=y.length;x-1};c.addClass=function(x,w){if(!c.hasClass(x,w)){x.className=(x.className+" "+w)}};c.removeClass=function(x,w){x.className=x.className.replace(new RegExp("(^|\\s)"+w+"(?:\\s|$)"),"$1")};c.getPos=function(y){var B=A(y);var w=z(y);return{x:B.x-w.x,y:B.y-w.y};function A(D){var C={x:0,y:0};while(D&&!x(D)){C.x+=D.offsetLeft;C.y+=D.offsetTop;D=D.offsetParent}return C}function z(D){var C={x:0,y:0};while(D&&!x(D)){C.x+=D.scrollLeft;C.y+=D.scrollTop;D=D.parentNode}return C}function x(C){return(/^(?:body|html)$/i).test(C.tagName)}};c.event={get:function(x,w){w=w||window;return x||w.event},getWheel:function(w){return w.wheelDelta?w.wheelDelta/120:-(w.detail||0)/3},isRightClick:function(w){return(w.which==3||w.button==2)},getPos:function(z,y){y=y||window;z=z||y.event;var x=y.document;x=x.documentElement||x.body;if(z.touches&&z.touches.length){z=z.touches[0]}var w={x:z.pageX||(z.clientX+x.scrollLeft),y:z.pageY||(z.clientY+x.scrollTop)};return w},stop:function(w){if(w.stopPropagation){w.stopPropagation()}w.cancelBubble=true;if(w.preventDefault){w.preventDefault()}else{w.returnValue=false}}};$jit.util=$jit.id=c;var q=function(x){x=x||{};var w=function(){for(var A in this){if(typeof this[A]!="function"){this[A]=c.unlink(this[A])}}this.constructor=w;if(q.prototyping){return this}var z=this.initialize?this.initialize.apply(this,arguments):this;this.$$family="class";return z};for(var y in q.Mutators){if(!x[y]){continue}x=q.Mutators[y](x,x[y]);delete x[y]}c.extend(w,this);w.constructor=q;w.prototype=x;return w};q.Mutators={Implements:function(w,x){c.each(c.splat(x),function(z){q.prototyping=z;var y=(typeof z=="function")?new z:z;for(var A in y){if(!(A in w)){w[A]=y[A]}}delete q.prototyping});return w}};c.extend(q,{inherit:function(w,z){for(var y in z){var x=z[y];var B=w[y];var A=c.type(x);if(B&&A=="function"){if(x!=B){q.override(w,y,x)}}else{if(A=="object"){w[y]=c.merge(B,x)}else{w[y]=x}}}return w},override:function(x,w,A){var z=q.prototyping;if(z&&x[w]!=z[w]){z=null}var y=function(){var B=this.parent;this.parent=z?z[w]:x[w];var C=A.apply(this,arguments);this.parent=B;return C};x[w]=y}});q.prototype.implement=function(){var w=this.prototype;c.each(Array.prototype.slice.call(arguments||[]),function(x){q.inherit(w,x)});return this};$jit.Class=q;$jit.json={prune:function(x,w){this.each(x,function(z,y){if(y==w&&z.children){delete z.children;z.children=[]}})},getParent:function(w,A){if(w.id==A){return false}var z=w.children;if(z&&z.length>0){for(var y=0;y=(7-4*z)/11){A=y*y-Math.pow((11-6*z-11*B)/4,2);break}}return A},Elastic:function(z,y){return Math.pow(2,10*--z)*Math.cos(20*z*Math.PI*(y[0]||1)/3)}};c.each(x,function(z,y){i[y]=w(z)});c.each(["Quad","Cubic","Quart","Quint"],function(z,y){i[z]=w(function(A){return Math.pow(A,[y+2])})})})();var u=new q({initialize:function(w){this.setOptions(w)},setOptions:function(w){var x={duration:2500,fps:40,transition:i.Quart.easeInOut,compute:c.empty,complete:c.empty,link:"ignore"};this.opt=c.merge(x,w||{});return this},step:function(){var x=c.time(),w=this.opt;if(xD.height)?(F.y-C.height-E):F.y+E)+"px";A.left=((F.x+C.width+w>D.width)?(F.x-C.width-w):F.x+w)+"px"},hide:function(w){this.tip.style.display="none";w&&this.config.onHide()}});o.Classes.NodeStyles=new q({Implements:[t,h],initializePost:function(){this.fx=this.viz.fx;this.types=this.viz.fx.nodeTypes;this.nStyles=this.config;this.nodeStylesOnHover=this.nStyles.stylesHover;this.nodeStylesOnClick=this.nStyles.stylesClick;this.hoveredNode=false;this.fx.nodeFxAnimation=new u();this.down=false;this.move=false},onMouseOut:function(y,x){this.down=this.move=false;if(!this.hoveredNode){return}if(this.dom&&this.isLabel(y,x,true)){this.toggleStylesOnHover(this.hoveredNode,false)}var w=y.relatedTarget,z=this.canvas.getElement();while(w&&w.parentNode){if(z==w.parentNode){return}w=w.parentNode}this.toggleStylesOnHover(this.hoveredNode,false);this.hoveredNode=false},onMouseOver:function(z,y){var w;if(this.dom&&(w=this.isLabel(z,y,true))){var x=this.viz.graph.getNode(w.id);if(x.selected){return}this.hoveredNode=x;this.toggleStylesOnHover(this.hoveredNode,true)}},onMouseDown:function(A,z,x,y){if(y){return}var w;if(this.dom&&(w=this.isLabel(A,z))){this.down=this.viz.graph.getNode(w.id)}else{if(!this.dom){this.down=x.getNode()}}this.move=false},onMouseUp:function(z,y,w,x){if(x){return}if(!this.move){this.onClick(w.getNode())}this.down=this.move=false},getRestoredStyles:function(x,w){var z={},y=this["nodeStylesOn"+w];for(var A in y){z[A]=x.styles["$"+A]}return z},toggleStylesOnHover:function(w,x){if(this.nodeStylesOnHover){this.toggleStylesOn("Hover",w,x)}},toggleStylesOnClick:function(w,x){if(this.nodeStylesOnClick){this.toggleStylesOn("Click",w,x)}},toggleStylesOn:function(A,w,C){var D=this.viz;var B=this.nStyles;if(C){var z=this;if(!w.styles){w.styles=c.merge(w.data,{})}for(var E in this["nodeStylesOn"+A]){var x="$"+E;if(!(x in w.styles)){w.styles[x]=w.getData(E)}}D.fx.nodeFx(c.extend({elements:{id:w.id,properties:z["nodeStylesOn"+A]},transition:i.Quart.easeOut,duration:300,fps:40},this.config))}else{var y=this.getRestoredStyles(w,A);D.fx.nodeFx(c.extend({elements:{id:w.id,properties:y},transition:i.Quart.easeOut,duration:300,fps:40},this.config))}},onClick:function(w){if(!w){return}var x=this.nodeStylesOnClick;if(!x){return}if(w.selected){this.toggleStylesOnClick(w,false);delete w.selected}else{this.viz.graph.eachNode(function(z){if(z.selected){for(var y in x){z.setData(y,z.styles["$"+y],"end")}delete z.selected}});this.toggleStylesOnClick(w,true);w.selected=true;delete w.hovered;this.hoveredNode=false}},onMouseMove:function(C,B,z){if(this.down){this.move=true}if(this.dom&&this.isLabel(C,B)){return}var A=this.nodeStylesOnHover;if(!A){return}if(!this.dom){if(this.hoveredNode){var x=this.types[this.hoveredNode.getData("type")];var w=x&&x.contains&&x.contains.call(this.fx,this.hoveredNode,z.getPos());if(w){return}}var y=z.getNode();if(!this.hoveredNode&&!y){return}if(y.hovered){return}if(y&&!y.selected){this.fx.nodeFxAnimation.stopTimer();this.viz.graph.eachNode(function(E){if(E.hovered&&!E.selected){for(var D in A){E.setData(D,E.styles["$"+D],"end")}delete E.hovered}});y.hovered=true;this.hoveredNode=y;this.toggleStylesOnHover(y,true)}else{if(this.hoveredNode&&!this.hoveredNode.selected){this.fx.nodeFxAnimation.stopTimer();this.toggleStylesOnHover(this.hoveredNode,false);delete this.hoveredNode.hovered;this.hoveredNode=false}}}}});o.Classes.Navigation=new q({Implements:[t,h],initializePost:function(){this.pos=false;this.pressed=false},onMouseWheel:function(z,y,w){if(!this.config.zooming){return}c.event.stop(c.event.get(z,y));var A=this.config.zooming/1000,x=1+w*A;this.canvas.scale(x,x)},onMouseDown:function(B,A,z){if(!this.config.panning){return}if(this.config.panning=="avoid nodes"&&(this.dom?this.isLabel(B,A):z.getNode())){return}this.pressed=true;this.pos=z.getPos();var y=this.canvas,x=y.translateOffsetX,w=y.translateOffsetY,D=y.scaleOffsetX,C=y.scaleOffsetY;this.pos.x*=D;this.pos.x+=x;this.pos.y*=C;this.pos.y+=w},onMouseMove:function(D,C,F){if(!this.config.panning){return}if(!this.pressed){return}if(this.config.panning=="avoid nodes"&&(this.dom?this.isLabel(D,C):F.getNode())){return}var B=this.pos,E=F.getPos(),z=this.canvas,A=z.translateOffsetX,w=z.translateOffsetY,J=z.scaleOffsetX,H=z.scaleOffsetY;E.x*=J;E.y*=H;E.x+=A;E.y+=w;var I=E.x-B.x,G=E.y-B.y;this.pos=E;this.canvas.translate(I*1/J,G*1/H)},onMouseUp:function(z,y,x,w){if(!this.config.panning){return}this.pressed=false}});var l;(function(){var w=typeof HTMLCanvasElement,y=(w=="object"||w=="function");function x(z,A){var B=document.createElement(z);for(var C in A){if(typeof A[C]=="object"){c.extend(B[C],A[C])}else{B[C]=A[C]}}if(z=="canvas"&&!y&&G_vmlCanvasManager){B=G_vmlCanvasManager.initElement(document.body.appendChild(B))}return B}$jit.Canvas=l=new q({canvases:[],pos:false,element:false,labelContainer:false,translateOffsetX:0,translateOffsetY:0,scaleOffsetX:1,scaleOffsetY:1,initialize:function(L,E){this.viz=L;this.opt=this.config=E;var B=c.type(E.injectInto)=="string"?E.injectInto:E.injectInto.id,K=E.type,C=B+"-label",z=c(B),D=E.width||z.offsetWidth,M=E.height||z.offsetHeight;this.id=B;var F={injectInto:B,width:D,height:M};this.element=x("div",{id:B+"-canvaswidget",style:{position:"relative",width:D+"px",height:M+"px"}});this.labelContainer=this.createLabelContainer(E.Label.type,C,F);this.canvases.push(new l.Base[K]({config:c.extend({idSuffix:"-canvas"},F),plot:function(N){L.fx.plot()},resize:function(){L.refresh()}}));var G=E.background;if(G){var J=new l.Background[G.type](L,c.extend(G,F));this.canvases.push(new l.Base[K](J))}var I=this.canvases.length;while(I--){this.element.appendChild(this.canvases[I].canvas);if(I>0){this.canvases[I].plot()}}this.element.appendChild(this.labelContainer);z.appendChild(this.element);var A=null,H=this;c.addEvent(window,"scroll",function(){clearTimeout(A);A=setTimeout(function(){H.getPos(true)},500)})},getCtx:function(z){return this.canvases[z||0].getCtx()},getConfig:function(){return this.opt},getElement:function(){return this.element},getSize:function(z){return this.canvases[z||0].getSize()},resize:function(D,z){this.getPos(true);this.translateOffsetX=this.translateOffsetY=0;this.scaleOffsetX=this.scaleOffsetY=1;for(var B=0,A=this.canvases.length;BE){A=x((E+((B-C)-E)*F))}else{A=x((E-C+(B-(E))*F))}}else{if(D>=z){if(B>E){A=x((E+((B-C)-E)*F))}else{A=x((E-C+(B-(E-C))*F))}}else{A=x((E+(B-E)*F))}}var w=(this.rho-y.rho)*F+y.rho;return{theta:A,rho:w}}};var k=function(x,w){return new b(x,w)};b.KER=k(0,0);var p=function(w,z){this.x=w||0;this.y=z||0};$jit.Complex=p;p.prototype={getc:function(){return this},getp:function(w){return this.toPolar(w)},set:function(w){w=w.getc(true);this.x=w.x;this.y=w.y},setc:function(w,z){this.x=w;this.y=z},setp:function(x,w){this.x=Math.cos(x)*w;this.y=Math.sin(x)*w},clone:function(){return new p(this.x,this.y)},toPolar:function(y){var w=this.norm();var x=Math.atan2(this.y,this.x);if(x<0){x+=Math.PI*2}if(y){return{theta:x,rho:w}}return new b(x,w)},norm:function(){return Math.sqrt(this.squaredNorm())},squaredNorm:function(){return this.x*this.x+this.y*this.y},add:function(w){return new p(this.x+w.x,this.y+w.y)},prod:function(w){return new p(this.x*w.x-this.y*w.y,this.y*w.x+this.x*w.y)},conjugate:function(){return new p(this.x,-this.y)},scale:function(w){return new p(this.x*w,this.y*w)},equals:function(w){return this.x==w.x&&this.y==w.y},$add:function(w){this.x+=w.x;this.y+=w.y;return this},$prod:function(A){var w=this.x,z=this.y;this.x=w*A.x-z*A.y;this.y=z*A.x+w*A.y;return this},$conjugate:function(){this.y=-this.y;return this},$scale:function(w){this.x*=w;this.y*=w;return this},$div:function(B){var w=this.x,A=this.y;var z=B.squaredNorm();this.x=w*B.x+A*B.y;this.y=A*B.x-w*B.y;return this.$scale(1/z)},isZero:function(){var x=0.0001,w=Math.abs;return w(this.x)=F&&I<=G&&w(H)){B(H,I)}if(II){y(K,F,G)}})}})(A,E+D,x+D)},eachSubgraph:function(x,y,w){this.eachLevel(x,0,false,y,w)},eachSubnode:function(x,y,w){this.eachLevel(x,1,1,y,w)},anySubnode:function(z,y,x){var w=false;y=y||c.lambda(true);var A=c.type(y)=="string"?function(B){return B[y]}:y;this.eachSubnode(z,function(B){if(A(B)){w=true}},x);return w},getSubnodes:function(B,C,w){var y=[],A=this;C=C||0;var z,x;if(c.type(C)=="array"){z=C[0];x=C[1]}else{z=C;x=Number.MAX_VALUE-B._depth}this.eachLevel(B,z,x,function(D){y.push(D)},w);return y},getParents:function(x){var w=[];this.eachAdjacency(x,function(y){var z=y.nodeTo;if(z._depth-1)){H.endData[J]=G[J]}else{H.data[J]=G[J]}}}});B.graph.eachNode(function(G){if(G.ignore){return}G.eachAdjacency(function(H){if(H.nodeFrom.ignore||H.nodeTo.ignore){return}var I=C.getNode(H.nodeFrom.id);var J=C.getNode(H.nodeTo.id);if(!I.adjacentTo(J)){var H=B.graph.getAdjacence(I.id,J.id);w=true;H.setData("alpha",1);H.setData("alpha",1,"start");H.setData("alpha",0,"end")}})});var w=this.preprocessSum(C);var y=!w?["node-property:alpha"]:["node-property:alpha","edge-property:alpha"];y[0]=y[0]+(("node-property" in z)?(":"+c.splat(z["node-property"]).join(":")):"");y[1]=(y[1]||"edge-property:alpha")+(("edge-property" in z)?(":"+c.splat(z["edge-property"]).join(":")):"");if("label-property" in z){y.push("label-property:"+c.splat(z["label-property"]).join(":"))}if(B.reposition){B.reposition()}else{B.compute("end")}B.graph.eachNode(function(G){if(G.id!=A&&G.pos.getp().equals(b.KER)){G.pos.set(G.endPos);G.startPos.set(G.endPos)}});B.fx.animate(c.merge(F,{modes:[z.position||"polar"].concat(y),onComplete:function(){B.graph.eachNode(function(G){if(G.ignore){B.graph.removeNode(G.id)}});B.graph.eachNode(function(G){G.eachAdjacency(function(H){if(H.ignore){B.graph.removeAdjacence(H.nodeFrom.id,H.nodeTo.id)}})});F.onComplete()}}));break;default:}},contract:function(y,x){var w=this.viz;if(y.collapsed||!y.anySubnode(c.lambda(true))){return}x=c.merge(this.options,w.config,x||{},{modes:["node-property:alpha:span","linear"]});y.collapsed=true;(function z(A){A.eachSubnode(function(B){B.ignore=true;B.setData("alpha",0,x.type=="animate"?"end":"current");z(B)})})(y);if(x.type=="animate"){w.compute("end");if(w.rotated){w.rotate(w.rotated,"none",{property:"end"})}(function z(A){A.eachSubnode(function(B){B.setPos(y.getPos("end"),"end");z(B)})})(y);w.fx.animate(x)}else{if(x.type=="replot"){w.refresh()}}},expand:function(y,x){if(!("collapsed" in y)){return}var w=this.viz;x=c.merge(this.options,w.config,x||{},{modes:["node-property:alpha:span","linear"]});delete y.collapsed;(function z(A){A.eachSubnode(function(B){delete B.ignore;B.setData("alpha",1,x.type=="animate"?"end":"current");z(B)})})(y);if(x.type=="animate"){w.compute("end");if(w.rotated){w.rotate(w.rotated,"none",{property:"end"})}w.fx.animate(x)}else{if(x.type=="replot"){w.refresh()}}},preprocessSum:function(x){var w=this.viz;x.eachNode(function(z){if(!w.graph.hasNode(z.id)){w.graph.addNode(z);var A=w.graph.getNode(z.id);A.setData("alpha",0);A.setData("alpha",0,"start");A.setData("alpha",1,"end")}});var y=false;x.eachNode(function(z){z.eachAdjacency(function(A){var B=w.graph.getNode(A.nodeFrom.id);var C=w.graph.getNode(A.nodeTo.id);if(!B.adjacentTo(C)){var A=w.graph.addAdjacence(B,C,A.data);if(B.startAlpha==B.endAlpha&&C.startAlpha==C.endAlpha){y=true;A.setData("alpha",0);A.setData("alpha",0,"start");A.setData("alpha",1,"end")}}})});return y}};var a={none:{render:c.empty,contains:c.lambda(false)},circle:{render:function(z,A,w,y){var x=y.getCtx();x.beginPath();x.arc(A.x,A.y,w,0,Math.PI*2,true);x.closePath();x[z]()},contains:function(B,A,w){var y=B.x-A.x,x=B.y-A.y,z=y*y+x*x;return z<=w*w}},ellipse:{render:function(C,E,w,F,x){var G=x.getCtx(),z=1,y=1,D=1,B=1,A=0;if(w>F){A=w/2;y=F/w;B=w/F}else{A=F/2;z=w/F;D=F/w}G.save();G.scale(z,y);G.beginPath();G.arc(E.x*D,E.y*B,A,0,Math.PI*2,true);G.closePath();G[C]();G.restore()},contains:function(w,D,x,F){var C=0,B=1,A=1,z=0,y=0,E=0;if(x>F){C=x/2;A=F/x}else{C=F/2;B=x/F}z=(w.x-D.x)*(1/B);y=(w.y-D.y)*(1/A);E=z*z+y*y;return E<=C*C}},square:{render:function(x,z,y,w){w.getCtx()[x+"Rect"](z.x-y,z.y-y,2*y,2*y)},contains:function(y,x,w){return Math.abs(x.x-y.x)<=w&&Math.abs(x.y-y.y)<=w}},rectangle:{render:function(z,A,y,w,x){x.getCtx()[z+"Rect"](A.x-y/2,A.y-w/2,y,w)},contains:function(z,y,x,w){return Math.abs(y.x-z.x)<=x/2&&Math.abs(y.y-z.y)<=w/2}},triangle:{render:function(C,D,z,w){var G=w.getCtx(),y=D.x,x=D.y-z,F=y-z,E=D.y+z,B=y+z,A=E;G.beginPath();G.moveTo(y,x);G.lineTo(F,E);G.lineTo(B,A);G.closePath();G[C]()},contains:function(y,x,w){return a.circle.contains(y,x,w)}},star:{render:function(A,C,B,x){var w=x.getCtx(),z=Math.PI/5;w.save();w.translate(C.x,C.y);w.beginPath();w.moveTo(B,0);for(var y=0;y<9;y++){w.rotate(z);if(y%2==0){w.lineTo((B/0.525731)*0.200811,0)}else{w.lineTo(B,0)}}w.closePath();w[A]();w.restore()},contains:function(y,x,w){return a.circle.contains(y,x,w)}}};var m={line:{render:function(z,y,x){var w=x.getCtx();w.beginPath();w.moveTo(z.x,z.y);w.lineTo(y.x,y.y);w.stroke()},contains:function(G,y,B,E){var z=Math.min,C=Math.max,x=z(G.x,y.x),F=C(G.x,y.x),w=z(G.y,y.y),D=C(G.y,y.y);if(B.x>=x&&B.x<=F&&B.y>=w&&B.y<=D){if(Math.abs(y.x-G.x)<=E){return true}var A=(y.y-G.y)/(y.x-G.x)*(B.x-G.x)+G.y;return Math.abs(A-B.y)<=E}return false}},arrow:{render:function(F,G,z,x,w){var H=w.getCtx();if(x){var y=F;F=G;G=y}var C=new p(G.x-F.x,G.y-F.y);C.$scale(z/C.norm());var A=new p(G.x-C.x,G.y-C.y),B=new p(-C.y/2,C.x/2),E=A.add(B),D=A.$add(B.$scale(-1));H.beginPath();H.moveTo(F.x,F.y);H.lineTo(G.x,G.y);H.stroke();H.beginPath();H.moveTo(E.x,E.y);H.lineTo(D.x,D.y);H.lineTo(G.x,G.y);H.closePath();H.fill()},contains:function(x,w,z,y){return m.line.contains(x,w,z,y)}},hyperline:{render:function(D,E,w,y){var F=y.getCtx();var z=A(D,E);if(z.a>1000||z.b>1000||z.ratio<0){F.beginPath();F.moveTo(D.x*w,D.y*w);F.lineTo(E.x*w,E.y*w);F.stroke()}else{var C=Math.atan2(E.y-z.y,E.x-z.x);var B=Math.atan2(D.y-z.y,D.x-z.x);var x=x(C,B);F.beginPath();F.arc(z.x*w,z.y*w,z.ratio*w,C,B,x);F.stroke()}function A(S,R){var K=(S.x*R.y-S.y*R.x),G=K;var J=S.squaredNorm(),I=R.squaredNorm();if(K==0){return{x:0,y:0,ratio:-1}}var Q=(S.y*I-R.y*J+S.y-R.y)/K;var O=(R.x*J-S.x*I+R.x-S.x)/G;var P=-Q/2;var N=-O/2;var M=(Q*Q+O*O)/4-1;if(M<0){return{x:0,y:0,ratio:-1}}var L=Math.sqrt(M);var H={x:P,y:N,ratio:L>1000?-1:L,a:Q,b:O};return H}function x(G,H){return(GH)?false:true):((H+Math.PI>G)?true:false)}},contains:c.lambda(false)}};e.Plot={initialize:function(x,w){this.viz=x;this.config=x.config;this.node=x.config.Node;this.edge=x.config.Edge;this.animation=new u;this.nodeTypes=new w.Plot.NodeTypes;this.edgeTypes=new w.Plot.EdgeTypes;this.labels=x.labels},nodeHelper:a,edgeHelper:m,Interpolator:{map:{border:"color",color:"color",width:"number",height:"number",dim:"number",alpha:"number",lineWidth:"number",angularWidth:"number",span:"number",valueArray:"array-number",dimArray:"array-number"},canvas:{globalAlpha:"number",fillStyle:"color",strokeStyle:"color",lineWidth:"number",shadowBlur:"number",shadowColor:"color",shadowOffsetX:"number",shadowOffsetY:"number",miterLimit:"number"},label:{size:"number",color:"color"},compute:function(y,x,w){return y+(x-y)*w},moebius:function(D,C,F,z){var B=z.scale(-F);if(B.norm()<1){var w=B.x,E=B.y;var A=D.startPos.getc().moebiusTransformation(B);D.pos.setc(A.x,A.y);B.x=w;B.y=E}},linear:function(x,w,A){var z=x.startPos.getc(true);var y=x.endPos.getc(true);x.pos.setc(this.compute(z.x,y.x,A),this.compute(z.y,y.y,A))},polar:function(y,x,B){var A=y.startPos.getp(true);var z=y.endPos.getp();var w=z.interpolate(A,B);y.pos.setp(w.theta,w.rho)},number:function(x,C,B,w,A){var z=x[w](C,"start");var y=x[w](C,"end");x[A](C,this.compute(z,y,B))},color:function(y,w,E,B,z){var C=c.hexToRgb(y[B](w,"start"));var D=c.hexToRgb(y[B](w,"end"));var A=this.compute;var x=c.rgbToHex([parseInt(A(C[0],D[0],E)),parseInt(A(C[1],D[1],E)),parseInt(A(C[2],D[2],E))]);y[z](w,x)},"array-number":function(z,y,J,G,B){var H=z[G](y,"start"),I=z[G](y,"end"),K=[];for(var E=0,A=H.length;E=0.95){C.labels.plotLabel(y,I,x)}else{C.labels.hideLabel(I,false)}}I.visited=!z})},plotTree:function(A,x,E){var B=this,C=this.viz,y=C.canvas,z=this.config,D=y.getCtx();var w=A.getData("alpha");A.eachSubnode(function(G){if(x.plotSubtree(A,G)&&G.exist&&G.drawn){var F=A.getAdjacency(G.id);!E&&x.onBeforePlotLine(F);B.plotLine(F,y,E);!E&&x.onAfterPlotLine(F);B.plotTree(G,x,E)}});if(A.drawn){!E&&x.onBeforePlotNode(A);this.plotNode(A,y,E);!E&&x.onAfterPlotNode(A);if(!x.hideLabels&&x.withLabels&&w>=0.95){this.labels.plotLabel(y,A,x)}else{this.labels.hideLabel(A,false)}}else{this.labels.hideLabel(A,true)}},plotNode:function(y,x,F){var C=y.getData("type"),B=this.node.CanvasStyles;if(C!="none"){var w=y.getData("lineWidth"),A=y.getData("color"),z=y.getData("alpha"),D=x.getCtx();D.save();D.lineWidth=w;D.fillStyle=D.strokeStyle=A;D.globalAlpha=z;for(var E in B){D[E]=y.getCanvasStyle(E)}this.nodeTypes[C].render.call(this,y,x,F);D.restore()}},plotLine:function(C,x,G){var B=C.getData("type"),z=this.edge.CanvasStyles;if(B!="none"){var w=C.getData("lineWidth"),y=C.getData("color"),E=x.getCtx(),A=C.nodeFrom,D=C.nodeTo;E.save();E.lineWidth=w;E.fillStyle=E.strokeStyle=y;E.globalAlpha=Math.min(A.getData("alpha"),D.getData("alpha"),C.getData("alpha"));for(var F in z){E[F]=C.getCanvasStyle(F)}this.edgeTypes[B].render.call(this,C,x,G);E.restore()}}};e.Plot3D=c.merge(e.Plot,{Interpolator:{linear:function(x,w,A){var z=x.startPos.getc(true);var y=x.endPos.getc(true);x.pos.setc(this.compute(z.x,y.x,A),this.compute(z.y,y.y,A),this.compute(z.z,y.z,A))}},plotNode:function(x,w){if(x.getData("type")=="none"){return}this.plotElement(x,w,{getAlpha:function(){return x.getData("alpha")}})},plotLine:function(w,x){if(w.getData("type")=="none"){return}this.plotElement(w,x,{getAlpha:function(){return Math.min(w.nodeFrom.getData("alpha"),w.nodeTo.getData("alpha"),w.getData("alpha"))}})},plotElement:function(Y,E,z){var V=E.getCtx(),F=new Matrix4,x=E.config.Scene.Lighting,Z=E.canvases[0],K=Z.program,X=Z.camera;if(!Y.geometry){Y.geometry=new O3D[Y.getData("type")]}Y.geometry.update(Y);if(!Y.webGLVertexBuffer){var J=[],B=[],P=[],N=0,S=Y.geometry;for(var W=0,U=S.vertices,H=S.faces,G=H.length;W=x.width||y.x<0||y.y>=x.height||y.y<0){return false}return true}});e.Label.HTML=new q({Implements:e.Label.DOM,plotLabel:function(z,A,y){var B=A.id,w=this.getLabel(B);if(!w&&!(w=document.getElementById(B))){w=document.createElement("div");var x=this.getLabelContainer();w.id=B;w.className="node";w.style.position="absolute";y.onCreateLabel(w,A);x.appendChild(w);this.labels[A.id]=w}this.placeLabel(w,A,y)}});e.Label.SVG=new q({Implements:e.Label.DOM,plotLabel:function(z,B,y){var D=B.id,w=this.getLabel(D);if(!w&&!(w=document.getElementById(D))){var A="http://www.w3.org/2000/svg";w=document.createElementNS(A,"svg:text");var C=document.createElementNS(A,"svg:tspan");w.appendChild(C);var x=this.getLabelContainer();w.setAttribute("id",D);w.setAttribute("class","node");x.appendChild(w);y.onCreateLabel(w,B);this.labels[B.id]=w}this.placeLabel(w,B,y)}});e.Geom=new q({initialize:function(w){this.viz=w;this.config=w.config;this.node=w.config.Node;this.edge=w.config.Edge},translate:function(x,w){w=c.splat(w);this.viz.graph.eachNode(function(y){c.each(w,function(z){y.getPos(z).$add(x)})})},setRightLevelToShow:function(z,w,B){var A=this.getRightLevelToShow(z,w),y=this.viz.labels,x=c.merge({execShow:true,execHide:true,onHide:c.empty,onShow:c.empty},B||{});z.eachLevel(0,this.config.levelsToShow,function(D){var C=D._depth-z._depth;if(C>A){x.onHide(D);if(x.execHide){D.drawn=false;D.exist=false;y.hideLabel(D,false)}}else{x.onShow(D);if(x.execShow){D.exist=true}}});z.drawn=true},getRightLevelToShow:function(z,x){var w=this.config;var A=w.levelsToShow;var y=w.constrained;if(!y){return A}while(!this.treeFitsInCanvas(z,x,A)&&A>1){A--}return A}});var d={construct:function(x){var y=(c.type(x)=="array");var w=new e(this.graphOptions,this.config.Node,this.config.Edge,this.config.Label);if(!y){(function(z,B){z.addNode(B);if(B.children){for(var A=0,C=B.children;AC?F:C;D.setData("width",E);D.setData("height",E);D.setData("dim",E)}}})},initializeLabel:function(w){if(!this.label){this.label=document.createElement("div");document.body.appendChild(this.label)}this.setLabelStyles(w)},setLabelStyles:function(w){c.extend(this.label.style,{visibility:"hidden",position:"absolute",width:"auto",height:"auto"});this.label.className="jit-autoadjust-label"}};g.Tree=(function(){var F=Array.prototype.slice;function D(P,K,H,N,I){var M=K.Node;var J=K.multitree;if(M.overridable){var O=-1,L=-1;P.eachNode(function(S){if(S._depth==H&&(!J||("$orn" in S.data)&&S.data.$orn==N)){var Q=S.getData("width",I);var R=S.getData("height",I);O=(O0)?E[0]:null;D(E)}for(var z=0,A=[C.id].concat(x);z=D._depth)});for(var B=0;B0&&J.drawn){J.drawn=false;x[A.id].push(J)}else{if((!E||!D)&&J.drawn){J.drawn=false;x[A.id].push(J)}}});A.drawn=true}if(w.length>0){F.fx.plot()}for(B in x){c.each(x[B],function(J){J.drawn=true})}for(B=0;Bw?y:w)+this.config.subtreeOffset},getEdge:function(C,B,A){var y=function(E,w){return function(){return C.pos.add(new p(E,w))}};var D=this.node;var x=C.getData("width");var z=C.getData("height");if(B=="begin"){if(D.align=="center"){return this.dispatch(A,y(0,z/2),y(-x/2,0),y(0,-z/2),y(x/2,0))}else{if(D.align=="left"){return this.dispatch(A,y(0,z),y(0,0),y(0,0),y(x,0))}else{if(D.align=="right"){return this.dispatch(A,y(0,0),y(-x,0),y(0,-z),y(0,0))}else{throw"align: not implemented"}}}}else{if(B=="end"){if(D.align=="center"){return this.dispatch(A,y(0,-z/2),y(x/2,0),y(0,z/2),y(-x/2,0))}else{if(D.align=="left"){return this.dispatch(A,y(0,0),y(x,0),y(0,z),y(0,0))}else{if(D.align=="right"){return this.dispatch(A,y(0,-z),y(0,0),y(0,0),y(-x,0))}else{throw"align: not implemented"}}}}}},getScaledTreePosition:function(B,D){var C=this.node;var x=B.getData("width");var A=B.getData("height");var z=(this.config.multitree&&("$orn" in B.data)&&B.data.$orn)||this.config.orientation;var y=function(E,w){return function(){return B.pos.add(new p(E,w)).$scale(1-D)}};if(C.align=="left"){return this.dispatch(z,y(0,A),y(0,0),y(0,0),y(x,0))}else{if(C.align=="center"){return this.dispatch(z,y(0,A/2),y(-x/2,0),y(0,-A/2),y(x/2,0))}else{if(C.align=="right"){return this.dispatch(z,y(0,0),y(-x,0),y(0,-A),y(0,0))}else{throw"align: not implemented"}}}},treeFitsInCanvas:function(B,w,C){var y=w.getSize();var z=(this.config.multitree&&("$orn" in B.data)&&B.data.$orn)||this.config.orientation;var x=this.dispatch(z,y.width,y.height);var A=this.getTreeBaseSize(B,C,function(E,D){return E===0||!D.anySubnode()});return(A=0){z.drawn=false;var D=x.getCtx();var B=C.geom.getScaledTreePosition(z,A);D.translate(B.x,B.y);D.scale(A,A)}this.plotTree(z,c.merge(w,{withLabels:true,hideLabels:!!A,plotSubtree:function(I,G){var F=y.multitree&&!("$orn" in z.data);var H=F&&z.getData("orns");return !F||H.indexOf(z.getData("orn"))>-1}}),E);if(A>=0){z.drawn=true}},getAlignedPos:function(B,z,w){var y=this.node;var A,x;if(y.align=="center"){A={x:B.x-z/2,y:B.y-w/2}}else{if(y.align=="left"){x=this.config.orientation;if(x=="bottom"||x=="top"){A={x:B.x-z/2,y:B.y}}else{A={x:B.x,y:B.y-w/2}}}else{if(y.align=="right"){x=this.config.orientation;if(x=="bottom"||x=="top"){A={x:B.x-z/2,y:B.y-w}}else{A={x:B.x-z,y:B.y-w/2}}}else{throw"align: not implemented"}}}return A},getOrientation:function(w){var y=this.config;var x=y.orientation;if(y.multitree){var z=w.nodeFrom;var A=w.nodeTo;x=(("$orn" in z.data)&&z.data.$orn)||(("$orn" in A.data)&&A.data.$orn)}return x}});$jit.ST.Label={};$jit.ST.Label.Native=new q({Implements:e.Label.Native,renderLabel:function(z,B,y){var x=z.getCtx(),D=B.pos.getc(true),A=B.getData("width"),w=B.getData("height"),C=this.viz.fx.getAlignedPos(D,A,w);x.fillText(B.name,C.x+A/2,C.y+w/2)}});$jit.ST.Label.DOM=new q({Implements:e.Label.DOM,placeLabel:function(P,J,F){var B=J.pos.getc(true),O=this.viz.config,K=O.Node,x=this.viz.canvas,C=J.getData("width"),M=J.getData("height"),y=x.getSize(),G,N;var A=x.translateOffsetX,z=x.translateOffsetY,E=x.scaleOffsetX,D=x.scaleOffsetY,I=B.x*E+A,H=B.y*D+z;if(K.align=="center"){G={x:Math.round(I-C/2+y.width/2),y:Math.round(H-M/2+y.height/2)}}else{if(K.align=="left"){N=O.orientation;if(N=="bottom"||N=="top"){G={x:Math.round(I-C/2+y.width/2),y:Math.round(H+y.height/2)}}else{G={x:Math.round(I+y.width/2),y:Math.round(H-M/2+y.height/2)}}}else{if(K.align=="right"){N=O.orientation;if(N=="bottom"||N=="top"){G={x:Math.round(I-C/2+y.width/2),y:Math.round(H-M+y.height/2)}}else{G={x:Math.round(I-C+y.width/2),y:Math.round(H-M/2+y.height/2)}}}else{throw"align: not implemented"}}}var L=P.style;L.left=G.x+"px";L.top=G.y+"px";L.display=this.fitsInCanvas(G,x)?"":"none";F.onPlaceLabel(P,J)}});$jit.ST.Label.SVG=new q({Implements:[$jit.ST.Label.DOM,e.Label.SVG],initialize:function(w){this.viz=w}});$jit.ST.Label.HTML=new q({Implements:[$jit.ST.Label.DOM,e.Label.HTML],initialize:function(w){this.viz=w}});$jit.ST.Plot.NodeTypes=new q({none:{render:c.empty,contains:c.lambda(false)},circle:{render:function(x,w){var z=x.getData("dim"),A=this.getAlignedPos(x.pos.getc(true),z,z),y=z/2;this.nodeHelper.circle.render("fill",{x:A.x+y,y:A.y+y},y,w)},contains:function(w,A){var y=w.getData("dim"),z=this.getAlignedPos(w.pos.getc(true),y,y),x=y/2;this.nodeHelper.circle.contains({x:z.x+x,y:z.y+x},A,x)}},square:{render:function(x,w){var z=x.getData("dim"),y=z/2,A=this.getAlignedPos(x.pos.getc(true),z,z);this.nodeHelper.square.render("fill",{x:A.x+y,y:A.y+y},y,w)},contains:function(w,A){var y=w.getData("dim"),z=this.getAlignedPos(w.pos.getc(true),y,y),x=y/2;this.nodeHelper.square.contains({x:z.x+x,y:z.y+x},A,x)}},ellipse:{render:function(z,x){var y=z.getData("width"),w=z.getData("height"),A=this.getAlignedPos(z.pos.getc(true),y,w);this.nodeHelper.ellipse.render("fill",{x:A.x+y/2,y:A.y+w/2},y,w,x)},contains:function(y,A){var x=y.getData("width"),w=y.getData("height"),z=this.getAlignedPos(y.pos.getc(true),x,w);this.nodeHelper.ellipse.contains({x:z.x+x/2,y:z.y+w/2},A,x,w)}},rectangle:{render:function(z,x){var y=z.getData("width"),w=z.getData("height"),A=this.getAlignedPos(z.pos.getc(true),y,w);this.nodeHelper.rectangle.render("fill",{x:A.x+y/2,y:A.y+w/2},y,w,x)},contains:function(y,A){var x=y.getData("width"),w=y.getData("height"),z=this.getAlignedPos(y.pos.getc(true),x,w);this.nodeHelper.rectangle.contains({x:z.x+x/2,y:z.y+w/2},A,x,w)}}});$jit.ST.Plot.EdgeTypes=new q({none:c.empty,line:{render:function(x,z){var y=this.getOrientation(x),A=x.nodeFrom,B=x.nodeTo,w=A._depth1&&D[0]!=y.id);this.edgeHelper.arrow.render(E,F,A,z,x)},contains:function(x,D){var y=this.getOrientation(x),z=x.nodeFrom,A=x.nodeTo,w=z._depth0||F[ah][1]>0)){var R=K+F[ah][0],P=E+F[ah][1],ag=Math.atan((P-R)/w),Z=55;var V=M.createLinearGradient(ab+w/2,aa-(R+P)/2,ab+w/2+Z*Math.sin(ag),aa-(R+P)/2+Z*Math.cos(ag));var Q=c.rgbToHex(c.map(c.hexToRgb(I[ah%C].slice(1)),function(x){return(x*0.85)>>0}));V.addColorStop(0,I[ah%C]);V.addColorStop(1,Q);M.fillStyle=V}M.beginPath();M.moveTo(ab,aa-K);M.lineTo(ab+w,aa-E);M.lineTo(ab+w,aa-E-F[ah][1]);M.lineTo(ab,aa-K-F[ah][0]);M.lineTo(ab,aa-K);M.fill();M.restore();if(H){var S=H.name==L[ah];var z=S?0.7:0.8;var Q=c.rgbToHex(c.map(c.hexToRgb(I[ah%C].slice(1)),function(x){return(x*z)>>0}));M.strokeStyle=Q;M.lineWidth=S?4:1;M.save();M.beginPath();if(H.index===0){M.moveTo(ab,aa-K);M.lineTo(ab,aa-K-F[ah][0])}else{M.moveTo(ab+w,aa-E);M.lineTo(ab+w,aa-E-F[ah][1])}M.stroke();M.restore()}K+=(F[ah][0]||0);E+=(F[ah][1]||0);if(F[ah][0]>0){X+=(B[ah][0]||0)}}if(T&&ae.type=="Native"){M.save();M.beginPath();M.fillStyle=M.strokeStyle=ae.color;M.font=ae.style+" "+ae.size+"px "+ae.family;M.textAlign="center";M.textBaseline="middle";var O=N(W.name,ad,ac,W,X);if(O!==false){M.fillText(O!==true?O:X,ab,aa-K-Y.labelOffset-ae.size/2,w)}if(ai(W.name,ad,ac,W)){M.fillText(W.name,ab,aa+ae.size/2+Y.labelOffset)}M.restore()}}},contains:function(C,E){var J=C.pos.getc(true),z=C.getData("width"),N=C.getData("height"),M=this.getAlignedPos(J,z,N),L=M.x,K=M.y,O=C.getData("dimArray"),w=E.x-L;if(E.xL+z||E.y>K||E.y=G){var H=+(w>z/2);return{name:C.getData("stringArray")[F],color:C.getData("colorArray")[F],value:C.getData("valueArray")[F][H],index:H}}}return false}}});$jit.AreaChart=new q({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:false,initialize:function(y){this.controller=this.config=c.merge(n("Canvas","Margin","Label","AreaChart"),{Label:{type:"Native"}},y);var z=this.config.showLabels,x=c.type(z),A=this.config.showAggregates,w=c.type(A);this.config.showLabels=x=="function"?z:c.lambda(z);this.config.showAggregates=w=="function"?A:c.lambda(A);this.initializeViz()},initializeViz:function(){var x=this.config,B=this,w=x.type.split(":")[0],A={};var z=new $jit.ST({injectInto:x.injectInto,width:x.width,height:x.height,orientation:"bottom",levelDistance:0,siblingOffset:0,subtreeOffset:0,withLabels:x.Label.type!="Native",useCanvas:x.useCanvas,Label:{type:x.Label.type},Node:{overridable:true,type:"areachart-"+w,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:x.Tips.enable,type:"Native",force:true,onShow:function(G,F,D){var E=D;x.Tips.onShow(G,E,F)}},Events:{enable:true,type:"Native",onClick:function(F,G,D){if(!x.filterOnClick&&!x.Events.enable){return}var E=G.getContains();if(E){x.filterOnClick&&B.filter(E.name)}x.Events.enable&&x.Events.onClick(E,G,D)},onRightClick:function(E,F,D){if(!x.restoreOnRightClick){return}B.restore()},onMouseMove:function(F,G,D){if(!x.selectOnHover){return}if(F){var E=G.getContains();B.select(F.id,E.name,E.index)}else{B.select(false,false,false)}}},onCreateLabel:function(J,G){var P=x.Label,O=G.getData("valueArray"),H=c.reduce(O,function(Q,R){return Q+R[0]},0),M=c.reduce(O,function(Q,R){return Q+R[1]},0);if(G.getData("prev")){var L={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")};var D=L.wrapper,N=L.label,E=L.aggregate,F=D.style,K=N.style,I=E.style;A[G.id]=L;D.appendChild(N);D.appendChild(E);if(!x.showLabels(G.name,H,M,G)){N.style.display="none"}if(!x.showAggregates(G.name,H,M,G)){E.style.display="none"}F.position="relative";F.overflow="visible";F.fontSize=P.size+"px";F.fontFamily=P.family;F.color=P.color;F.textAlign="center";I.position=K.position="absolute";J.style.width=G.getData("width")+"px";J.style.height=G.getData("height")+"px";N.innerHTML=G.name;J.appendChild(D)}},onPlaceLabel:function(V,P){if(!P.getData("prev")){return}var T=A[P.id],E=T.wrapper.style,D=T.label.style,O=T.aggregate.style,M=P.getData("width"),K=P.getData("height"),J=P.getData("dimArray"),G=P.getData("valueArray"),L=c.reduce(G,function(W,X){return W+X[0]},0),H=c.reduce(G,function(W,X){return W+X[1]},0),I=parseInt(E.fontSize,10),N=V.style;if(J&&G){if(x.showLabels(P.name,L,H,P)){D.display=""}else{D.display="none"}var F=x.showAggregates(P.name,L,H,P);if(F!==false){O.display=""}else{O.display="none"}E.width=O.width=D.width=V.style.width=M+"px";O.left=D.left=-M/2+"px";for(var S=0,Q=G.length,R=0,U=0;S0){R+=G[S][0];U+=J[S][0]}}O.top=(-I-x.labelOffset)+"px";D.top=(x.labelOffset+U)+"px";V.style.top=parseInt(V.style.top,10)-U+"px";V.style.height=E.height=U+"px";T.aggregate.innerHTML=F!==true?F:R}}});var y=z.canvas.getSize(),C=x.Margin;z.config.offsetY=-y.height/2+C.bottom+(x.showLabels&&(x.labelOffset+x.Label.size));z.config.offsetX=(C.right-C.left)/2;this.delegate=z;this.canvas=this.delegate.canvas},loadJSON:function(N){var J=c.time(),B=[],M=this.delegate,Q=c.splat(N.label),I=c.splat(N.color||this.colors),O=this.config,x=!!O.type.split(":")[1],z=O.animate;for(var K=0,y=N.values,H=y.length;K-1)?G:[0,0]}),"end")});this.delegate.fx.animate({modes:["node-property:dimArray"],duration:1500,onComplete:function(){y.busy=false;A&&A.onComplete()}})},restore:function(x){if(this.busy){return}this.busy=true;if(this.config.Tips.enable){this.delegate.tips.hide()}this.select(false,false,false);this.normalizeDims();var w=this;this.delegate.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){w.busy=false;x&&x.onComplete()}})},select:function(B,x,w){if(!this.config.selectOnHover){return}var y=this.selected;if(y.id!=B||y.name!=x||y.index!=w){y.id=B;y.name=x;y.index=w;this.delegate.graph.eachNode(function(C){C.setData("border",false)});if(B){var A=this.delegate.graph.getNode(B);A.setData("border",y);var z=w===0?"prev":"next";z=A.getData(z);if(z){A=this.delegate.graph.getByName(z);if(A){A.setData("border",{name:x,index:1-w})}}}this.delegate.plot()}},getLegend:function(){var y={};var z;this.delegate.graph.getNode(this.delegate.root).eachAdjacency(function(A){z=A.nodeTo});var x=z.getData("colorArray"),w=x.length;c.each(z.getData("stringArray"),function(B,A){y[B]=x[A%w]});return y},getMaxValue:function(){var w=0;this.delegate.graph.eachNode(function(B){var y=B.getData("valueArray"),x=0,A=0;c.each(y,function(C){x+=+C[0];A+=+C[1]});var z=A>x?A:x;w=w>z?w:z});return w},normalizeDims:function(){var C=this.delegate.graph.getNode(this.delegate.root),z=0;C.eachAdjacency(function(){z++});var B=this.getMaxValue()||1,F=this.delegate.canvas.getSize(),y=this.config,A=y.Margin,D=y.labelOffset+y.Label.size,w=(F.width-(A.left+A.right))/z,x=y.animate,E=F.height-(A.top+A.bottom)-(y.showAggregates&&D)-(y.showLabels&&D);this.delegate.graph.eachNode(function(L){var I=0,K=0,G=[];c.each(L.getData("valueArray"),function(M){I+=+M[0];K+=+M[1];G.push([0,0])});var J=K>I?K:I;L.setData("width",w);if(x){L.setData("height",J*E/B,"end");L.setData("dimArray",c.map(L.getData("valueArray"),function(M){return[M[0]*E/B,M[1]*E/B]}),"end");var H=L.getData("dimArray");if(!H){L.setData("dimArray",G)}}else{L.setData("height",J*E/B);L.setData("dimArray",c.map(L.getData("valueArray"),function(M){return[M[0]*E/B,M[1]*E/B]}))}})}});n.BarChart={$extend:true,animate:true,type:"stacked",labelOffset:3,barsOffset:0,hoveredColor:"#9fd4ff",orientation:"horizontal",showAggregates:true,showLabels:true,Tips:{enable:false,onShow:c.empty,onHide:c.empty},Events:{enable:false,onClick:c.empty}};$jit.ST.Plot.NodeTypes.implement({"barchart-stacked":{render:function(R,C){var H=R.pos.getc(true),Q=R.getData("width"),O=R.getData("height"),M=this.getAlignedPos(H,Q,O),L=M.x,K=M.y,N=R.getData("dimArray"),F=R.getData("valueArray"),E=R.getData("colorArray"),B=E.length,Y=R.getData("stringArray");var T=C.getCtx(),w={},U=R.getData("border"),z=R.getData("gradient"),aa=R.getData("config"),A=aa.orientation=="horizontal",D=aa.showAggregates,P=aa.showLabels,J=aa.Label;if(E&&N&&Y){for(var X=0,S=N.length,W=0,G=0;X>0}));Z.addColorStop(0,V);Z.addColorStop(0.5,E[X%B]);Z.addColorStop(1,V);T.fillStyle=Z}if(A){T.fillRect(L+W,K,N[X],O)}else{T.fillRect(L,K-W-N[X],Q,N[X])}if(U&&U.name==Y[X]){w.acum=W;w.dimValue=N[X]}W+=(N[X]||0);G+=(F[X]||0)}if(U){T.save();T.lineWidth=2;T.strokeStyle=U.color;if(A){T.strokeRect(L+w.acum+1,K+1,w.dimValue-2,O-2)}else{T.strokeRect(L+1,K-w.acum-w.dimValue+1,Q-2,w.dimValue-2)}T.restore()}if(J.type=="Native"){T.save();T.fillStyle=T.strokeStyle=J.color;T.font=J.style+" "+J.size+"px "+J.family;T.textBaseline="middle";var I=D(R.name,G,R);if(I!==false){I=I!==true?I:G;if(A){T.textAlign="right";T.fillText(I,L+W-aa.labelOffset,K+O/2)}else{T.textAlign="center";T.fillText(I,L+Q/2,K-O-J.size/2-aa.labelOffset)}}if(P(R.name,G,R)){if(A){T.textAlign="center";T.translate(L-aa.labelOffset-J.size/2,K+O/2);T.rotate(Math.PI/2);T.fillText(R.name,0,0)}else{T.textAlign="center";T.fillText(R.name,L+Q/2,K+J.size/2+aa.labelOffset)}}T.restore()}}},contains:function(D,F){var I=D.pos.getc(true),A=D.getData("width"),N=D.getData("height"),M=this.getAlignedPos(I,A,N),L=M.x,J=M.y,O=D.getData("dimArray"),B=D.getData("config"),z=F.x-L,w=B.orientation=="horizontal";if(w){if(F.xL+A||F.y>J+N||F.yL+A||F.y>J||F.y=H){return{name:D.getData("stringArray")[G],color:D.getData("colorArray")[G],value:D.getData("valueArray")[G],label:D.name}}}}return false}},"barchart-grouped":{render:function(S,C){var I=S.pos.getc(true),R=S.getData("width"),P=S.getData("height"),N=this.getAlignedPos(I,R,P),M=N.x,L=N.y,O=S.getData("dimArray"),G=S.getData("valueArray"),Y=G.length,F=S.getData("colorArray"),B=F.length,aa=S.getData("stringArray");var U=C.getCtx(),w={},V=S.getData("border"),z=S.getData("gradient"),ac=S.getData("config"),A=ac.orientation=="horizontal",E=ac.showAggregates,Q=ac.showLabels,K=ac.Label,D=(A?P:R)/Y;if(F&&O&&aa){for(var Z=0,T=Y,X=0,H=0;Z>0}));ab.addColorStop(0,W);ab.addColorStop(0.5,F[Z%B]);ab.addColorStop(1,W);U.fillStyle=ab}if(A){U.fillRect(M,L+D*Z,O[Z],D)}else{U.fillRect(M+D*Z,L-O[Z],D,O[Z])}if(V&&V.name==aa[Z]){w.acum=D*Z;w.dimValue=O[Z]}X+=(O[Z]||0);H+=(G[Z]||0)}if(V){U.save();U.lineWidth=2;U.strokeStyle=V.color;if(A){U.strokeRect(M+1,L+w.acum+1,w.dimValue-2,D-2)}else{U.strokeRect(M+w.acum+1,L-w.dimValue+1,D-2,w.dimValue-2)}U.restore()}if(K.type=="Native"){U.save();U.fillStyle=U.strokeStyle=K.color;U.font=K.style+" "+K.size+"px "+K.family;U.textBaseline="middle";var J=E(S.name,H,S);if(J!==false){J=J!==true?J:H;if(A){U.textAlign="right";U.fillText(J,M+Math.max.apply(null,O)-ac.labelOffset,L+P/2)}else{U.textAlign="center";U.fillText(J,M+R/2,L-Math.max.apply(null,O)-K.size/2-ac.labelOffset)}}if(Q(S.name,H,S)){if(A){U.textAlign="center";U.translate(M-ac.labelOffset-K.size/2,L+P/2);U.rotate(Math.PI/2);U.fillText(S.name,0,0)}else{U.textAlign="center";U.fillText(S.name,M+R/2,L+K.size/2+ac.labelOffset)}}U.restore()}}},contains:function(J,F){var B=J.pos.getc(true),I=J.getData("width"),H=J.getData("height"),E=this.getAlignedPos(B,I,H),D=E.x,C=E.y,G=J.getData("dimArray"),M=G.length,P=J.getData("config"),A=F.x-D,w=P.orientation=="horizontal",z=(w?H:I)/M;if(w){if(F.xD+I||F.y>C+H||F.yD+I||F.y>C||F.y=N&&F.y<=N+z){return{name:J.getData("stringArray")[L],color:J.getData("colorArray")[L],value:J.getData("valueArray")[L],label:J.name}}}else{var N=D+z*L;if(F.x>=N&&F.x<=N+z&&F.y>=C-O){return{name:J.getData("stringArray")[L],color:J.getData("colorArray")[L],value:J.getData("valueArray")[L],label:J.name}}}}return false}}});$jit.BarChart=new q({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:false,initialize:function(y){this.controller=this.config=c.merge(n("Canvas","Margin","Label","BarChart"),{Label:{type:"Native"}},y);var z=this.config.showLabels,x=c.type(z),A=this.config.showAggregates,w=c.type(A);this.config.showLabels=x=="function"?z:c.lambda(z);this.config.showAggregates=w=="function"?A:c.lambda(A);this.initializeViz()},initializeViz:function(){var x=this.config,B=this;var w=x.type.split(":")[0],D=x.orientation=="horizontal",A={};var z=new $jit.ST({injectInto:x.injectInto,width:x.width,height:x.height,orientation:D?"left":"bottom",levelDistance:0,siblingOffset:x.barsOffset,subtreeOffset:0,withLabels:x.Label.type!="Native",useCanvas:x.useCanvas,Label:{type:x.Label.type},Node:{overridable:true,type:"barchart-"+w,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:x.Tips.enable,type:"Native",force:true,onShow:function(H,G,E){var F=E;x.Tips.onShow(H,F,G)}},Events:{enable:true,type:"Native",onClick:function(G,H,E){if(!x.Events.enable){return}var F=H.getContains();x.Events.onClick(F,H,E)},onMouseMove:function(G,H,E){if(!x.hoveredColor){return}if(G){var F=H.getContains();B.select(G.id,F.name,F.index)}else{B.select(false,false,false)}}},onCreateLabel:function(J,H){var P=x.Label,N=H.getData("valueArray"),M=c.reduce(N,function(Q,R){return Q+R},0);var L={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")};var E=L.wrapper,O=L.label,F=L.aggregate,G=E.style,K=O.style,I=F.style;A[H.id]=L;E.appendChild(O);E.appendChild(F);if(!x.showLabels(H.name,M,H)){K.display="none"}if(!x.showAggregates(H.name,M,H)){I.display="none"}G.position="relative";G.overflow="visible";G.fontSize=P.size+"px";G.fontFamily=P.family;G.color=P.color;G.textAlign="center";I.position=K.position="absolute";J.style.width=H.getData("width")+"px";J.style.height=H.getData("height")+"px";I.left=K.left="0px";O.innerHTML=H.name;J.appendChild(E)},onPlaceLabel:function(U,P){if(!A[P.id]){return}var T=A[P.id],G=T.wrapper.style,E=T.label.style,O=T.aggregate.style,V=x.type.split(":")[0]=="grouped",F=x.orientation=="horizontal",K=P.getData("dimArray"),I=P.getData("valueArray"),M=(V&&F)?Math.max.apply(null,K):P.getData("width"),L=(V&&!F)?Math.max.apply(null,K):P.getData("height"),J=parseInt(G.fontSize,10),N=U.style;if(K&&I){G.width=O.width=E.width=U.style.width=M+"px";for(var S=0,Q=I.length,R=0;S0){R+=I[S]}}if(x.showLabels(P.name,R,P)){E.display=""}else{E.display="none"}var H=x.showAggregates(P.name,R,P);if(H!==false){O.display=""}else{O.display="none"}if(x.orientation=="horizontal"){O.textAlign="right";E.textAlign="left";E.textIndex=O.textIndent=x.labelOffset+"px";O.top=E.top=(L-J)/2+"px";U.style.height=G.height=L+"px"}else{O.top=(-J-x.labelOffset)+"px";E.top=(x.labelOffset+L)+"px";U.style.top=parseInt(U.style.top,10)-L+"px";U.style.height=G.height=L+"px"}T.aggregate.innerHTML=H!==true?H:R}}});var y=z.canvas.getSize(),C=x.Margin;if(D){z.config.offsetX=y.width/2-C.left-(x.showLabels&&(x.labelOffset+x.Label.size));z.config.offsetY=(C.bottom-C.top)/2}else{z.config.offsetY=-y.height/2+C.bottom+(x.showLabels&&(x.labelOffset+x.Label.size));z.config.offsetX=(C.right-C.left)/2}this.delegate=z;this.canvas=this.delegate.canvas},loadJSON:function(K){if(this.busy){return}this.busy=true;var H=c.time(),C=[],J=this.delegate,N=c.splat(K.label),G=c.splat(K.color||this.colors),L=this.config,w=!!L.type.split(":")[1],z=L.animate,y=L.orientation=="horizontal",A=this;for(var I=0,x=K.values,E=x.length;Iz?x:z});return x},setBarType:function(w){this.config.type=w;this.delegate.config.Node.type="barchart-"+w.split(":")[0]},normalizeDims:function(){var G=this.delegate.graph.getNode(this.delegate.root),B=0;G.eachAdjacency(function(){B++});var D=this.getMaxValue()||1,J=this.delegate.canvas.getSize(),z=this.config,C=z.Margin,H=C.left+C.right,A=C.top+C.bottom,x=z.orientation=="horizontal",w=(J[x?"height":"width"]-(x?A:H)-(B-1)*z.barsOffset)/B,y=z.animate,I=J[x?"width":"height"]-(x?H:A)-(!x&&z.showAggregates&&(z.Label.size+z.labelOffset))-(z.showLabels&&(z.Label.size+z.labelOffset)),F=x?"height":"width",E=x?"width":"height";this.delegate.graph.eachNode(function(N){var M=0,K=[];c.each(N.getData("valueArray"),function(O){M+=+O;K.push(0)});N.setData(F,w);if(y){N.setData(E,M*I/D,"end");N.setData("dimArray",c.map(N.getData("valueArray"),function(O){return O*I/D}),"end");var L=N.getData("dimArray");if(!L){N.setData("dimArray",K)}}else{N.setData(E,M*I/D);N.setData("dimArray",c.map(N.getData("valueArray"),function(O){return O*I/D}))}})}});n.PieChart={$extend:true,animate:true,offset:25,sliceOffset:0,labelOffset:3,type:"stacked",hoveredColor:"#9fd4ff",Events:{enable:false,onClick:c.empty},Tips:{enable:false,onShow:c.empty,onHide:c.empty},showLabels:true,resizeLabels:false,updateHeights:false};g.Radial=new q({compute:function(x){var y=c.splat(x||["current","start","end"]);f.compute(this.graph,y,this.config);this.graph.computeLevels(this.root,0,"ignore");var w=this.createLevelDistanceFunc();this.computeAngularWidths(y);this.computePositions(y,w)},computePositions:function(D,A){var F=D;var E=this.graph;var B=E.getNode(this.root);var C=this.parent;var w=this.config;for(var y=0,x=F.length;yJ[Z]?Y:J[Z]):Y}G.push(W)},"ignore");if(C&&C.id==K.id&&G.length>0&&G[0].dist){G.sort(function(W,V){return(W.dist>=V.dist)-(W.dist<=V.dist)})}for(var M=0,O=G.length;MF/2&&B.theta<3*F/2);var L=I?B.theta+F:B.theta;if(I){M-=Math.abs(Math.cos(B.theta)*A.width);K+=Math.sin(B.theta)*A.width}else{if(E.id==this.viz.root){M-=A.width/2}}}O.save();O.translate(M,K);O.rotate(L);O.fillText(E.name,0,0);O.restore()}});w.Label.SVG=new q({Implements:e.Label.SVG,initialize:function(x){this.viz=x},placeLabel:function(N,C,E){var J=C.pos.getc(true),M=this.viz,A=this.viz.canvas;var F=A.getSize();var B={x:Math.round(J.x+F.width/2),y:Math.round(J.y+F.height/2)};N.setAttribute("x",B.x);N.setAttribute("y",B.y);var G=N.getBBox();if(G){var L=N.getAttribute("x");var I=N.getAttribute("y");var z=C.pos.getp(true);var D=Math.PI;var H=(z.theta>D/2&&z.theta<3*D/2);if(H){N.setAttribute("x",L-G.width);N.setAttribute("y",I-G.height)}else{if(C.id==M.root){N.setAttribute("x",L-G.width/2)}}var K=H?z.theta+D:z.theta;if(C._depth){N.setAttribute("transform","rotate("+K*360/(2*D)+" "+L+" "+I+")")}}E.onPlaceLabel(N,C)}});w.Label.HTML=new q({Implements:e.Label.HTML,initialize:function(x){this.viz=x},placeLabel:function(G,A,C){var E=A.pos.clone(),y=this.viz.canvas,F=A.getData("height"),B=((F||A._depth==0)?F:this.viz.config.levelDistance)/2,D=y.getSize();E.rho+=B;E=E.getc(true);var z={x:Math.round(E.x+D.width/2),y:Math.round(E.y+D.height/2)};var x=G.style;x.left=z.x+"px";x.top=z.y+"px";x.display=this.fitsInCanvas(z,y)?"":"none";C.onPlaceLabel(G,A)}});w.Plot.NodeTypes=new q({none:{render:c.empty,contains:c.lambda(false),anglecontains:function(B,D){var A=B.getData("span")/2,y=B.pos.theta;var z=y-A,x=y+A;if(z<0){z+=Math.PI*2}var C=Math.atan2(D.y,D.x);if(C<0){C+=Math.PI*2}if(z>x){return(C>z&&C<=Math.PI*2)||Cz&&C=z*C)&&(y<=(z*C+B))}return false}},"gradient-multipie":{render:function(A,x){var F=x.getCtx();var E=A.getData("height");var B=E?E:this.config.levelDistance;var y=F.createRadialGradient(0,0,A.getPos().rho,0,0,A.getPos().rho+B);var D=c.hexToRgb(A.getData("color")),C=[];c.each(D,function(G){C.push(parseInt(G*0.5,10))});var z=c.rgbToHex(C);y.addColorStop(0,z);y.addColorStop(1,A.getData("color"));F.fillStyle=y;this.nodeTypes.multipie.render.call(this,A,x)},contains:function(x,y){return this.nodeTypes.multipie.contains.call(this,x,y)}},"gradient-pie":{render:function(C,z){var x=z.getCtx();var D=x.createRadialGradient(0,0,0,0,0,C.getPos().rho);var B=c.hexToRgb(C.getData("color")),y=[];c.each(B,function(E){y.push(parseInt(E*0.5,10))});var A=c.rgbToHex(y);D.addColorStop(1,A);D.addColorStop(0,C.getData("color"));x.fillStyle=D;this.nodeTypes.pie.render.call(this,C,z)},contains:function(x,y){return this.nodeTypes.pie.contains.call(this,x,y)}}});w.Plot.EdgeTypes=new q({none:c.empty,line:{render:function(x,y){var A=x.nodeFrom.pos.getc(true),z=x.nodeTo.pos.getc(true);this.edgeHelper.line.render(A,z,y)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.line.contains(z,y,A,this.edge.epsilon)}},arrow:{render:function(y,z){var D=y.nodeFrom.pos.getc(true),C=y.nodeTo.pos.getc(true),B=y.getData("dim"),A=y.data.$direction,x=(A&&A.length>1&&A[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render(D,C,B,x,z)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.arrow.contains(z,y,A,this.edge.epsilon)}},hyperline:{render:function(x,y){var B=x.nodeFrom.pos.getc(),A=x.nodeTo.pos.getc(),z=Math.max(B.norm(),A.norm());this.edgeHelper.hyperline.render(B.$scale(1/z),A.$scale(1/z),z,y)},contains:c.lambda(false)}})})($jit.Sunburst);$jit.Sunburst.Plot.NodeTypes.implement({"piechart-stacked":{render:function(U,A){var T=U.pos.getp(true),C=U.getData("dimArray"),S=U.getData("valueArray"),G=U.getData("colorArray"),z=G.length,M=U.getData("stringArray"),P=U.getData("span")/2,K=U.pos.theta,F=K-P,J=K+P,R=new b;var N=A.getCtx(),L={},I=U.getData("gradient"),D=U.getData("border"),Z=U.getData("config"),ai=Z.showLabels,Y=Z.resizeLabels,ab=Z.Label;var ae=Z.sliceOffset*Math.cos((F+J)/2);var E=Z.sliceOffset*Math.sin((F+J)/2);if(G&&C&&M){for(var af=0,ac=C.length,w=0,X=0;af>0}),y=c.rgbToHex(W);ad.addColorStop(0,ag);ad.addColorStop(0.5,ag);ad.addColorStop(1,y);N.fillStyle=ad}R.rho=w+Z.sliceOffset;R.theta=F;var ah=R.getc(true);R.theta=J;var O=R.getc(true);R.rho+=B;var aj=R.getc(true);R.theta=F;var Q=R.getc(true);N.beginPath();N.arc(ae,E,w+0.01,F,J,false);N.arc(ae,E,w+B+0.01,J,F,true);N.fill();if(D&&D.name==M[af]){L.acum=w;L.dimValue=C[af];L.begin=F;L.end=J}w+=(B||0);X+=(S[af]||0)}if(D){N.save();N.globalCompositeOperation="source-over";N.lineWidth=2;N.strokeStyle=D.color;var aa=F>0;H=H<+Y?+Y:H;N.font=ab.style+" "+H+"px "+ab.family;N.textBaseline="middle";N.textAlign="center";R.rho=w+Z.labelOffset+Z.sliceOffset;R.theta=U.pos.theta;var ak=R.getc(true);N.fillText(U.name,ak.x,ak.y);N.restore()}}},contains:function(z,D){if(this.nodeTypes.none.anglecontains.call(this,z,D)){var F=Math.sqrt(D.x*D.x+D.y*D.y);var w=this.config.levelDistance,C=z._depth;var x=z.getData("config");if(F<=w*C+x.sliceOffset){var G=z.getData("dimArray");for(var B=0,A=G.length,E=x.sliceOffset;B=E&&F<=E+y){return{name:z.getData("stringArray")[B],color:z.getData("colorArray")[B],value:z.getData("valueArray")[B],label:z.name}}E+=y}}return false}return false}}});$jit.PieChart=new q({sb:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:false,initialize:function(w){this.controller=this.config=c.merge(n("Canvas","PieChart","Label"),{Label:{type:"Native"}},w);this.initializeViz()},initializeViz:function(){var x=this.config,B=this;var w=x.type.split(":")[0];var A=new $jit.Sunburst({injectInto:x.injectInto,width:x.width,height:x.height,useCanvas:x.useCanvas,withLabels:x.Label.type!="Native",Label:{type:x.Label.type},Node:{overridable:true,type:"piechart-"+w,width:1,height:1},Edge:{type:"none"},Tips:{enable:x.Tips.enable,type:"Native",force:true,onShow:function(F,E,C){var D=C;x.Tips.onShow(F,D,E)}},Events:{enable:true,type:"Native",onClick:function(E,F,C){if(!x.Events.enable){return}var D=F.getContains();x.Events.onClick(D,F,C)},onMouseMove:function(E,F,C){if(!x.hoveredColor){return}if(E){var D=F.getContains();B.select(E.id,D.name,D.index)}else{B.select(false,false,false)}}},onCreateLabel:function(F,E){var C=x.Label;if(x.showLabels){var D=F.style;D.fontSize=C.size+"px";D.fontFamily=C.family;D.color=C.color;D.textAlign="center";F.innerHTML=E.name}},onPlaceLabel:function(S,M){if(!x.showLabels){return}var G=M.pos.getp(true),J=M.getData("dimArray"),P=M.getData("span")/2,H=M.pos.theta,R=H-P,D=H+P,U=new b;var L=x.showLabels,F=x.resizeLabels,I=x.Label;if(J){for(var Q=0,N=J.length,O=0;Q>0;C=C<+F?+F:C;S.style.fontSize=C+"px";U.rho=O+x.labelOffset+x.sliceOffset;U.theta=(R+D)/2;var G=U.getc(true);var E=B.canvas.getSize();var K={x:Math.round(G.x+E.width/2),y:Math.round(G.y+E.height/2)};S.style.left=K.x+"px";S.style.top=K.y+"px"}}});var z=A.canvas.getSize(),y=Math.min;A.config.levelDistance=y(z.width,z.height)/2-x.offset-x.sliceOffset;this.delegate=A;this.canvas=this.delegate.canvas;this.canvas.getCtx().globalCompositeOperation="lighter"},loadJSON:function(K){var H=c.time(),B=[],J=this.delegate,N=c.splat(K.label),D=N.length,G=c.splat(K.color||this.colors),y=G.length,L=this.config,w=!!L.type.split(":")[1],z=L.animate,F=D==1;for(var I=0,x=K.values,E=x.length;Iy?w:y});return w},normalizeDims:function(){var x=this.delegate.graph.getNode(this.delegate.root),w=0;x.eachAdjacency(function(){w++});var B=this.getMaxValue()||1,A=this.config,y=A.animate,z=this.delegate.config.levelDistance;this.delegate.graph.eachNode(function(G){var F=0,C=[];c.each(G.getData("valueArray"),function(H){F+=+H;C.push(1)});var E=(C.length==1)&&!A.updateHeights;if(y){G.setData("dimArray",c.map(G.getData("valueArray"),function(H){return E?z:(H*z/B)}),"end");var D=G.getData("dimArray");if(!D){G.setData("dimArray",C)}}else{G.setData("dimArray",c.map(G.getData("valueArray"),function(H){return E?z:(H*z/B)}))}G.setData("normalizedDim",F/B)})}});g.TM={};g.TM.SliceAndDice=new q({compute:function(B){var x=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(x);var z=this.canvas.getSize(),y=this.config,A=z.width,w=z.height;this.graph.computeLevels(this.root,0,"ignore");x.getPos(B).setc(-A/2,-w/2);x.setData("width",A,B);x.setData("height",w+y.titleHeight,B);this.computePositions(x,x,this.layout.orientation,B);this.controller.onAfterCompute(x)},computePositions:function(F,D,P,y){var M=0;F.eachSubnode(function(R){M+=R.getData("area",y)});var Q=this.config,N=Q.offset,J=F.getData("width",y),H=Math.max(F.getData("height",y)-Q.titleHeight,0),x=F==D?1:(D.getData("area",y)/M);var I,G,L,B,A,E,C;var O=(P=="h");if(O){P="v";I=H;G=J*x;L="height";B="y";A="x";E=Q.titleHeight;C=0}else{P="h";I=H*x;G=J;L="width";B="x";A="y";E=0;C=Q.titleHeight}var w=D.getPos(y);D.setData("width",G,y);D.setData("height",I,y);var K=0,z=this;D.eachSubnode(function(S){var R=S.getPos(y);R[B]=K+w[B]+E;R[A]=w[A]+C;z.computePositions(D,S,P,y);K+=S.getData(L,y)})}});g.TM.Area={compute:function(w){w=w||"current";var C=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(C);var y=this.config,F=this.canvas.getSize(),x=F.width,E=F.height,D=y.offset,z=x-D,B=E-D;this.graph.computeLevels(this.root,0,"ignore");C.getPos(w).setc(-x/2,-E/2);C.setData("width",x,w);C.setData("height",E,w);var A={top:-E/2+y.titleHeight,left:-x/2,width:z,height:B-y.titleHeight};this.computePositions(C,A,w);this.controller.onAfterCompute(C)},computeDim:function(B,C,E,A,z,x){if(B.length+C.length==1){var y=(B.length==1)?B:C;this.layoutLast(y,E,A,x);return}if(B.length>=2&&C.length==0){C=[B.shift()]}if(B.length==0){if(C.length>0){this.layoutRow(C,E,A,x)}return}var D=B[0];if(z(C,E)>=z([D].concat(C),E)){this.computeDim(B.slice(1),C.concat([D]),E,A,z,x)}else{var F=this.layoutRow(C,E,A,x);this.computeDim(B,[],F.dim,F,z,x)}},worstAspectRatio:function(x,F){if(!x||x.length==0){return Number.MAX_VALUE}var y=0,G=0,B=Number.MAX_VALUE;for(var D=0,C=x.length;Dz?G:z}var E=F*F,A=y*y;return Math.max(E*G/A,A/(E*B))},avgAspectRatio:function(B,y){if(!B||B.length==0){return Number.MAX_VALUE}var D=0;for(var z=0,x=B.length;zA?y/A:A/y}return D/x},layoutLast:function(y,x,B,A){var z=y[0];z.getPos(A).setc(B.left,B.top);z.setData("width",B.width,A);z.setData("height",B.height,A)}};g.TM.Squarified=new q({Implements:g.TM.Area,computePositions:function(A,D,x){var z=this.config,F=Math.max;if(D.width>=D.height){this.layout.orientation="h"}else{this.layout.orientation="v"}var w=A.getSubnodes([1,1],"ignore");if(w.length>0){this.processChildrenLayout(A,w,D,x);for(var C=0,B=w.length;C0){this.processChildrenLayout(A,w,D,x);for(var C=0,B=w.length;CF){F=I}});var y=this.graph.getNode(this.clickedNode&&this.clickedNode.id||D.id);var x=Math.min(F,C-1);var B=y._depth;if(this.layout.horizontal()){this.computeSubtree(y,-w/2,-G/2,w/(x+1),G,B,x,E)}else{this.computeSubtree(y,-w/2,-G/2,w,G/(x+1),B,x,E)}},computeSubtree:function(G,I,F,w,L,E,A,H){G.getPos(H).setc(I,F);G.setData("width",w,H);G.setData("height",L,H);var C,K=0,J=0;var z=e.Util.getSubnodes(G,[1,1],"ignore");if(!z.length){return}c.each(z,function(x){J+=x.getData("dim")});for(var D=0,B=z.length;D>0}));I.addColorStop(0,A);I.addColorStop(1,E);J.fillStyle=I}if(B){J.strokeStyle=B;J.lineWidth=3}J.fillRect(F,D,Math.max(0,w-C),Math.max(0,H-C));B&&J.strokeRect(G.x,G.y,w,H)},contains:function(y,A){if(this.viz.clickedNode&&!$jit.Graph.Util.isDescendantOf(y,this.viz.clickedNode.id)){return false}var z=y.pos.getc(true),x=y.getData("width"),w=y.getData("height");return this.nodeHelper.rectangle.contains({x:z.x+x/2,y:z.y+w/2},A,x,w)}}});$jit.Icicle.Plot.EdgeTypes=new q({none:c.empty});g.ForceDirected=new q({getOptions:function(D){var B=this.canvas.getSize();var y=B.width,A=B.height;var C=0;this.graph.eachNode(function(w){C++});var E=y*A/C,z=Math.sqrt(E);var x=this.config.levelDistance;return{width:y,height:A,tstart:y*0.1,nodef:function(w){return E/(w||1)},edgef:function(w){return z*(w-x)}}},compute:function(x,y){var z=c.splat(x||["current","start","end"]);var w=this.getOptions();f.compute(this.graph,z,this.config);this.graph.computeLevels(this.root,0,"ignore");this.graph.eachNode(function(A){c.each(z,function(B){var C=A.getPos(B);if(C.equals(p.KER)){C.x=w.width/5*(Math.random()-0.5);C.y=w.height/5*(Math.random()-0.5)}A.disp={};c.each(z,function(D){A.disp[D]=r(0,0)})})});this.computePositions(z,w,y)},computePositions:function(A,y,B){var C=this.config.iterations,x=0,z=this;if(B){(function w(){for(var E=B.iter,D=0;D=C){B.onComplete();return}}B.onStep(Math.round(x/(C-1)*100));setTimeout(w,1)})()}else{for(;x1&&A[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render(D,C,B,x,z)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.arrow.contains(z,y,A,this.edge.epsilon)}}})})($jit.ForceDirected);$jit.TM={};var v=$jit.TM;$jit.TM.$extend=true;v.Base={layout:{orientation:"h",vertical:function(){return this.orientation=="v"},horizontal:function(){return this.orientation=="h"},change:function(){this.orientation=this.vertical()?"h":"v"}},initialize:function(w){var x={orientation:"h",titleHeight:13,offset:2,levelsToShow:0,constrained:false,animate:false,Node:{type:"rectangle",overridable:true,width:3,height:3,color:"#444"},Label:{textAlign:"center",textBaseline:"top"},Edge:{type:"none"},duration:700,fps:45};this.controller=this.config=c.merge(n("Canvas","Node","Edge","Fx","Controller","Tips","NodeStyles","Events","Navigation","Label"),x,w);this.layout.orientation=this.config.orientation;var y=this.config;if(y.useCanvas){this.canvas=y.useCanvas;this.config.labelContainer=this.canvas.id+"-label"}else{if(y.background){y.background=c.merge({type:"Circles"},y.background)}this.canvas=new l(this,y);this.config.labelContainer=(typeof y.injectInto=="string"?y.injectInto:y.injectInto.id)+"-label"}this.graphOptions={klass:p,Node:{selected:false,exist:true,drawn:true}};this.graph=new e(this.graphOptions,this.config.Node,this.config.Edge);this.labels=new v.Label[y.Label.type](this);this.fx=new v.Plot(this);this.op=new v.Op(this);this.group=new v.Group(this);this.geom=new v.Geom(this);this.clickedNode=null;this.busy=false;this.initializeExtras()},refresh:function(){if(this.busy){return}this.busy=true;var x=this;if(this.config.animate){this.compute("end");this.config.levelsToShow>0&&this.geom.setRightLevelToShow(this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root));this.fx.animate(c.merge(this.config,{modes:["linear","node-property:width:height"],onComplete:function(){x.busy=false}}))}else{var w=this.config.Label.type;if(w!="Native"){var x=this;this.graph.eachNode(function(y){x.labels.hideLabel(y,false)})}this.busy=false;this.compute();this.config.levelsToShow>0&&this.geom.setRightLevelToShow(this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root));this.plot()}},plot:function(){this.fx.plot()},leaf:function(w){return w.getSubnodes([1,1],"ignore").length==0},enter:function(C){if(this.busy){return}this.busy=true;var y=this,x=this.config,A=this.graph,w=C,z=this.clickedNode;var B={onComplete:function(){if(x.levelsToShow>0){y.geom.setRightLevelToShow(C)}if(x.levelsToShow>0||x.request){y.compute()}if(x.animate){A.nodeList.setData("alpha",0,"end");C.eachSubgraph(function(D){D.setData("alpha",1,"end")},"ignore");y.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){y.clickedNode=w;y.compute("end");y.clickedNode=z;y.fx.animate({modes:["linear","node-property:width:height"],duration:1000,onComplete:function(){y.busy=false;y.clickedNode=w}})}})}else{y.busy=false;y.clickedNode=C;y.refresh()}}};if(x.request){this.requestNodes(w,B)}else{B.onComplete()}},out:function(){if(this.busy){return}this.busy=true;this.events.hoveredNode=false;var A=this,y=this.config,C=this.graph,x=C.getNode(this.clickedNode&&this.clickedNode.id||this.root).getParents(),z=x[0],w=z,B=this.clickedNode;if(!z){this.busy=false;return}callback={onComplete:function(){A.clickedNode=z;if(y.request){A.requestNodes(z,{onComplete:function(){A.compute();A.plot();A.busy=false}})}else{A.compute();A.plot();A.busy=false}}};if(y.levelsToShow>0){this.geom.setRightLevelToShow(z)}if(y.animate){this.clickedNode=w;this.compute("end");this.clickedNode=B;this.fx.animate({modes:["linear","node-property:width:height"],duration:1000,onComplete:function(){A.clickedNode=w;C.eachNode(function(D){D.setDataset(["current","end"],{alpha:[0,1]})},"ignore");B.eachSubgraph(function(D){D.setData("alpha",1)},"ignore");A.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){callback.onComplete()}})}})}else{callback.onComplete()}},requestNodes:function(y,z){var x=c.merge(this.controller,z),w=this.config.levelsToShow;if(x.request){var B=[],A=y._depth;y.eachLevel(0,w,function(D){var C=w-(D._depth-A);if(D.drawn&&!D.anySubnode()&&C>0){B.push(D);D._level=C}});this.group.requestNodes(B,x)}else{x.onComplete()}},reposition:function(){this.compute("end")}};v.Op=new q({Implements:e.Op,initialize:function(w){this.viz=w}});v.Geom=new q({Implements:e.Geom,getRightLevelToShow:function(){return this.viz.config.levelsToShow},setRightLevelToShow:function(x){var y=this.getRightLevelToShow(),w=this.viz.labels;x.eachLevel(0,y+1,function(A){var z=A._depth-x._depth;if(z>y){A.drawn=false;A.exist=false;A.ignore=true;w.hideLabel(A,false)}else{A.drawn=true;A.exist=true;delete A.ignore}});x.drawn=true;delete x.ignore}});v.Group=new q({initialize:function(w){this.viz=w;this.canvas=w.canvas;this.config=w.config},requestNodes:function(B,A){var z=0,x=B.length,D={};var y=function(){A.onComplete()};var w=this.viz;if(x==0){y()}for(var C=0;C>0}));K.addColorStop(0,A);K.addColorStop(1,F);L.fillStyle=K}L.fillRect(G,E,w-I,J-I);if(B){L.save();L.strokeStyle=B;L.strokeRect(G,E,w-I,J-I);L.restore()}}else{if(C>0){L.fillRect(H.x+I/2,H.y+I/2,w-I,C-I);if(B){L.save();L.strokeStyle=B;L.strokeRect(H.x+I/2,H.y+I/2,w-I,J-I);L.restore()}}}},contains:function(z,B){if(this.viz.clickedNode&&!z.isDescendantOf(this.viz.clickedNode.id)||z.ignore){return false}var A=z.pos.getc(true),y=z.getData("width"),x=this.viz.leaf(z),w=x?z.getData("height"):this.config.titleHeight;return this.nodeHelper.rectangle.contains({x:A.x+y/2,y:A.y+w/2},B,y,w)}}});v.Plot.EdgeTypes=new q({none:c.empty});v.SliceAndDice=new q({Implements:[d,o,v.Base,g.TM.SliceAndDice]});v.Squarified=new q({Implements:[d,o,v.Base,g.TM.Squarified]});v.Strip=new q({Implements:[d,o,v.Base,g.TM.Strip]});$jit.RGraph=new q({Implements:[d,o,g.Radial],initialize:function(w){var x=$jit.RGraph;var y={interpolation:"linear",levelDistance:100};this.controller=this.config=c.merge(n("Canvas","Node","Edge","Fx","Controller","Tips","NodeStyles","Events","Navigation","Label"),y,w);var z=this.config;if(z.useCanvas){this.canvas=z.useCanvas;this.config.labelContainer=this.canvas.id+"-label"}else{if(z.background){z.background=c.merge({type:"Circles"},z.background)}this.canvas=new l(this,z);this.config.labelContainer=(typeof z.injectInto=="string"?z.injectInto:z.injectInto.id)+"-label"}this.graphOptions={klass:b,Node:{selected:false,exist:true,drawn:true}};this.graph=new e(this.graphOptions,this.config.Node,this.config.Edge);this.labels=new x.Label[z.Label.type](this);this.fx=new x.Plot(this,x);this.op=new x.Op(this);this.json=null;this.root=null;this.busy=false;this.parent=false;this.initializeExtras()},createLevelDistanceFunc:function(){var w=this.config.levelDistance;return function(x){return(x._depth+1)*w}},refresh:function(){this.compute();this.plot()},reposition:function(){this.compute("end")},plot:function(){this.fx.plot()},getNodeAndParentAngle:function(D){var y=false;var C=this.graph.getNode(D);var A=C.getParents();var z=(A.length>0)?A[0]:false;if(z){var w=z.pos.getc(),B=C.pos.getc();var x=w.add(B.scale(-1));y=Math.atan2(x.y,x.x);if(y<0){y+=2*Math.PI}}return{parent:z,theta:y}},tagChildren:function(A,C){if(A.angleSpan){var B=[];A.eachAdjacency(function(D){B.push(D.nodeTo)},"ignore");var w=B.length;for(var z=0;z1&&A[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render(D,C,B,x,z)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.arrow.contains(z,y,A,this.edge.epsilon)}}})})($jit.RGraph);p.prototype.moebiusTransformation=function(y){var w=this.add(y);var x=y.$conjugate().$prod(this);x.x++;return w.$div(x)};e.Util.moebiusTransformation=function(y,A,z,x,w){this.eachNode(y,function(C){for(var B=0;B=2){return B(z-0.01)}}return B(0.75)},getRadius:function(){var w=this.config.radius;if(w!=="auto"){return w}var x=this.canvas.getSize();return Math.min(x.width,x.height)/2},refresh:function(w){if(w){this.reposition();this.graph.eachNode(function(x){x.startPos.rho=x.pos.rho=x.endPos.rho;x.startPos.theta=x.pos.theta=x.endPos.theta})}else{this.compute()}this.plot()},reposition:function(){this.compute("end");var w=this.graph.getNode(this.root).pos.getc().scale(-1);e.Util.moebiusTransformation(this.graph,[w],["end"],"end","ignore");this.graph.eachNode(function(x){if(x.ignore){x.endPos.rho=x.pos.rho;x.endPos.theta=x.pos.theta}})},plot:function(){this.fx.plot()},onClick:function(y,w){var x=this.graph.getNode(y).pos.getc(true);this.move(x,w)},move:function(A,y){var x=r(A.x,A.y);if(this.busy===false&&x.norm()<1){this.busy=true;var w=this.graph.getClosestNodeToPos(x),z=this;this.graph.computeLevels(w.id,0);this.controller.onBeforeCompute(w);y=c.merge({onComplete:c.empty},y||{});this.fx.animate(c.merge({modes:["moebius"],hideLabels:true},y,{onComplete:function(){z.busy=false;y.onComplete()}}),x)}}});$jit.Hypertree.$extend=true;(function(w){w.Op=new q({Implements:e.Op});w.Plot=new q({Implements:e.Plot});w.Label={};w.Label.Native=new q({Implements:e.Label.Native,initialize:function(x){this.viz=x},renderLabel:function(z,B,y){var x=z.getCtx();var C=B.pos.getc(true);var A=this.viz.getRadius();x.fillText(B.name,C.x*A,C.y*A)}});w.Label.SVG=new q({Implements:e.Label.SVG,initialize:function(x){this.viz=x},placeLabel:function(I,C,D){var G=C.pos.getc(true),z=this.viz.canvas,A=z.translateOffsetX,y=z.translateOffsetY,H=z.scaleOffsetX,F=z.scaleOffsetY,E=z.getSize(),x=this.viz.getRadius();var B={x:Math.round((G.x*H)*x+A+E.width/2),y:Math.round((G.y*F)*x+y+E.height/2)};I.setAttribute("x",B.x);I.setAttribute("y",B.y);D.onPlaceLabel(I,C)}});w.Label.HTML=new q({Implements:e.Label.HTML,initialize:function(x){this.viz=x},placeLabel:function(J,D,E){var H=D.pos.getc(true),A=this.viz.canvas,B=A.translateOffsetX,z=A.translateOffsetY,I=A.scaleOffsetX,G=A.scaleOffsetY,F=A.getSize(),x=this.viz.getRadius();var C={x:Math.round((H.x*I)*x+B+F.width/2),y:Math.round((H.y*G)*x+z+F.height/2)};var y=J.style;y.left=C.x+"px";y.top=C.y+"px";y.display=this.fitsInCanvas(C,A)?"":"none";E.onPlaceLabel(J,D)}});w.Plot.NodeTypes=new q({none:{render:c.empty,contains:c.lambda(false)},circle:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.circle.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.circle.contains(z,A,y)}},ellipse:{render:function(A,y){var B=A.pos.getc().$scale(A.scale),z=A.getData("width"),x=A.getData("height");this.nodeHelper.ellipse.render("fill",B,z,x,y)},contains:function(z,B){var y=z.getData("width"),x=z.getData("height"),A=z.pos.getc().$scale(z.scale);return this.nodeHelper.circle.contains(A,B,y,x)}},square:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.square.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.square.contains(z,A,y)}},rectangle:{render:function(B,y){var A=this.node,z=B.getData("width"),x=B.getData("height"),C=B.pos.getc();z=A.transform?z*(1-C.squaredNorm()):z;x=A.transform?x*(1-C.squaredNorm()):x;C.$scale(B.scale);if(z>0.2&&x>0.2){this.nodeHelper.rectangle.render("fill",C,z,x,y)}},contains:function(z,B){var y=z.getData("width"),x=z.getData("height"),A=z.pos.getc().$scale(z.scale);return this.nodeHelper.rectangle.contains(A,B,y,x)}},triangle:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.triangle.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.triangle.contains(z,A,y)}},star:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.star.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.star.contains(z,A,y)}}});w.Plot.EdgeTypes=new q({none:c.empty,line:{render:function(x,y){var B=x.nodeFrom.pos.getc(true),A=x.nodeTo.pos.getc(true),z=x.nodeFrom.scale;this.edgeHelper.line.render({x:B.x*z,y:B.y*z},{x:A.x*z,y:A.y*z},y)},contains:function(x,B){var A=x.nodeFrom.pos.getc(true),z=x.nodeTo.pos.getc(true),y=x.nodeFrom.scale;this.edgeHelper.line.contains({x:A.x*y,y:A.y*y},{x:z.x*y,y:z.y*y},B,this.edge.epsilon)}},arrow:{render:function(y,z){var E=y.nodeFrom.pos.getc(true),D=y.nodeTo.pos.getc(true),A=y.nodeFrom.scale,C=y.getData("dim"),B=y.data.$direction,x=(B&&B.length>1&&B[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render({x:E.x*A,y:E.y*A},{x:D.x*A,y:D.y*A},C,x,z)},contains:function(x,B){var A=x.nodeFrom.pos.getc(true),z=x.nodeTo.pos.getc(true),y=x.nodeFrom.scale;this.edgeHelper.arrow.contains({x:A.x*y,y:A.y*y},{x:z.x*y,y:z.y*y},B,this.edge.epsilon)}},hyperline:{render:function(x,y){var B=x.nodeFrom.pos.getc(),A=x.nodeTo.pos.getc(),z=this.viz.getRadius();this.edgeHelper.hyperline.render(B,A,z,y)},contains:c.lambda(false)}})})($jit.Hypertree)})(); \ No newline at end of file diff --git a/plugins/TreemapVisualization/phpcs.xml b/plugins/TreemapVisualization/phpcs.xml deleted file mode 100644 index 2c671f61060e8f081c19b13346d3058d8897a5f1..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/phpcs.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - Matomo Coding Standard for TreemapVisualization plugin - - - - . - - tests/javascript/* - */vendor/* - - - - - - - - tests/* - - - - - Updates/* - - - - - tests/* - - - - - tests/* - - \ No newline at end of file diff --git a/plugins/TreemapVisualization/phpstan.neon b/plugins/TreemapVisualization/phpstan.neon deleted file mode 100644 index 64792859e3b2e8cdbd21ece0643bde0450b5016b..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/phpstan.neon +++ /dev/null @@ -1,18 +0,0 @@ -parameters: - level: 1 - phpVersion: 70200 - tmpDir: /tmp/phpstan/TreemapVisualization/main - paths: - - . - excludePaths: - - tests/* - - vendor/ - - github-action-tests/ - bootstrapFiles: - - ../../bootstrap-phpstan.php - universalObjectCratesClasses: - - Piwik\Config - - Piwik\View - - Piwik\ViewDataTable\Config - scanDirectories: - - ../../ diff --git a/plugins/TreemapVisualization/plugin.json b/plugins/TreemapVisualization/plugin.json deleted file mode 100644 index 27b51eaf105bc10493a0155af82417bf2b460194..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/plugin.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "TreemapVisualization", - "version": "5.0.7", - "description": "Visualise any report in Matomo as a Treemap. Click on the Treemap icon in each report to load the visualisation.", - "keywords": ["treemap", "graph", "visualization", "infovis", "jit"], - "license": "GPL v3+", - "homepage": "https://matomo.org", - "require": { - "matomo": ">=5.0.0-b1,<6.0.0-b1" - }, - "support": { - "email": "hello@matomo.org", - "issues": "https://github.com/matomo-org/plugin-TreemapVisualization/issues", - "forum": "https://forum.matomo.org", - "source": "https://github.com/matomo-org/plugin-TreemapVisualization", - "docs": "https://matomo.org/docs/", - "rss": "https://matomo.org/feed/" - }, - "authors": [ - { - "name": "Matomo", - "email": "hello@matomo.org", - "homepage": "https://matomo.org" - } - ], - "category": "insights" -} diff --git a/plugins/TreemapVisualization/pull_request_template.md b/plugins/TreemapVisualization/pull_request_template.md deleted file mode 100644 index 211089bb4ec77dcc05db341c8d1be45bae811eea..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/pull_request_template.md +++ /dev/null @@ -1,29 +0,0 @@ -## Description - - -## Issue No - - -## Steps to Replicate the Issue -1. -2. -3. - - - -## Checklist -- [✔/✖] Tested locally or on demo2/demo3? -- [✔/✖/NA] New test case added/updated? -- [✔/✖/NA] Are all newly added texts included via translation? -- [✔/✖/NA] Are text sanitized properly? (Eg use of v-text v/s v-html for vue) -- [✔/✖/NA] Version bumped? -- [✔/✖/NA] I have understood, reviewed, and tested all AI outputs before use -- [✔/✖/NA] All AI instructions respect security, IP, and privacy rules -- [✔/✖/NA] Documentation updated? diff --git a/plugins/TreemapVisualization/screenshots/Screen_Resolution_Treemap.png b/plugins/TreemapVisualization/screenshots/Screen_Resolution_Treemap.png deleted file mode 100644 index dd5791042c6ba065ea500c3642aaa483fec025dd..0000000000000000000000000000000000000000 Binary files a/plugins/TreemapVisualization/screenshots/Screen_Resolution_Treemap.png and /dev/null differ diff --git a/plugins/TreemapVisualization/screenshots/Social_Network_Treemap.png b/plugins/TreemapVisualization/screenshots/Social_Network_Treemap.png deleted file mode 100644 index d7b3c77e05e37df9cc3392faf9b743044dd1401e..0000000000000000000000000000000000000000 Binary files a/plugins/TreemapVisualization/screenshots/Social_Network_Treemap.png and /dev/null differ diff --git a/plugins/TreemapVisualization/screenshots/Treemap.png b/plugins/TreemapVisualization/screenshots/Treemap.png deleted file mode 100644 index 4ad6150884fdba8dd90f009dbc84fe22b80c2af8..0000000000000000000000000000000000000000 Binary files a/plugins/TreemapVisualization/screenshots/Treemap.png and /dev/null differ diff --git a/plugins/TreemapVisualization/stylesheets/treemap.less b/plugins/TreemapVisualization/stylesheets/treemap.less deleted file mode 100644 index 83997210dcd8d8ccb54ffb43b25a01e35167cedb..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/stylesheets/treemap.less +++ /dev/null @@ -1,92 +0,0 @@ -.infoviz-treemap-node-label { - margin: 3px 6px 0 6px; - display: block; - - > img { - margin: 2px 6px 0 0; - display: inline-block; - vertical-align: top; - float: left; - } - - > span { - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - vertical-align: top; - display: block; - } -} - -.infoviz-treemap-zoom-out { - position: absolute; - right: 6px; - z-index: 1000; - top: 30px; - background-color: #e9e8e1; - display: none; - padding: 3px 1px 2px 3px; - border-radius: 3px; - opacity: .6; - cursor: pointer; -} - -.infoviz-treemap:hover .infoviz-treemap-zoom-out { - display: inline; -} - -.infoviz-treemap-zoom-out:hover { - opacity: .7; -} - -.infoviz-treemap-enterable-node { - cursor: pointer; -} - -.infoviz-treemap-enterable-node:hover { - .infoviz-treemap-node-label { - text-decoration:underline; - } -} - -.infoviz-treemap { - width: 450px; - height: 320px; - position: relative; - - .node { - overflow: hidden; - } -} - -.infoviz-treemap-full-width > .dataTableWrapper { - width: 100%; - - .infoviz-treemap { - width: 100%; - height:auto; - } -} - -.widget .infoviz-treemap { - width: 100% !important; -} - -.infoviz-treemap-series-picker { - display: inline-block; - position: absolute; - right: 0; - z-index: 1000; - - > span { - vertical-align: top; - line-height: 23px; - height: 23px; - } - - > .jqplot-seriespicker { - display: inline-block; - position: relative; - margin-left: 4px; - } -} \ No newline at end of file diff --git a/plugins/TreemapVisualization/stylesheets/treemapColors.less b/plugins/TreemapVisualization/stylesheets/treemapColors.less deleted file mode 100644 index 146db153a7aae68fa7debbe219a725cb5511696a..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/stylesheets/treemapColors.less +++ /dev/null @@ -1,27 +0,0 @@ -.infoviz-treemap-evolution-colors[data-name=no-change] { - color: #444; -} - -.infoviz-treemap-evolution-colors[data-name=negative-change-max] { - color: red; -} - -.infoviz-treemap-evolution-colors[data-name=positive-change-max] { - color: green; -} - -.infoviz-treemap-evolution-colors[data-name=label] { - color: white; -} - -.infoviz-treemap-colors[data-name=header-color] { - color: white; -} - -.infoviz-treemap-colors[data-name=header-background-color] { - color: #6a6a6a; -} - -.infoviz-treemap-colors[data-name=normal-node-color] { - color: #ccc; -} \ No newline at end of file diff --git a/plugins/TreemapVisualization/templates/_dataTableViz_treemap.twig b/plugins/TreemapVisualization/templates/_dataTableViz_treemap.twig deleted file mode 100644 index b4f4620de5c97d354824319b13b20ea341866261..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/templates/_dataTableViz_treemap.twig +++ /dev/null @@ -1,3 +0,0 @@ -
- -
\ No newline at end of file diff --git a/plugins/TreemapVisualization/tests/Integration/ApiTest.php b/plugins/TreemapVisualization/tests/Integration/ApiTest.php deleted file mode 100644 index 0641c091e8f0f5997049dc8ed8d9262013f7ad4f..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/tests/Integration/ApiTest.php +++ /dev/null @@ -1,78 +0,0 @@ -api = API::getInstance(); - } - - /** - * @dataProvider validMethod - */ - public function testGetTreemapDataAllowsValidApiMethod($method): void - { - $result = $this->api->getTreemapData( - $method, - 'nb_visits', - 'day', - '2025-02-03' - ); - - $this->assertIsArray($result); - } - - /** - * @dataProvider inValidMethod - */ - public function testGetTreemapDataRejectsInvalidApiMethod($method): void - { - $this->expectException(BadRequestException::class); - $this->api->getTreemapData( - $method, - 'nb_visits', - 'day', - '2025-02-03' - ); - } - - public function validMethod() - { - return [ - ['API.getMatomoVersion'], - ['API.getPhpVersion'], - ]; - } - - public function inValidMethod() - { - return [ - ['API.getBulkRequest'], - ['UsersManager.deleteUser'], - ]; - } -} diff --git a/plugins/TreemapVisualization/tests/System/CheckDirectDependencyUseCommandTest.php b/plugins/TreemapVisualization/tests/System/CheckDirectDependencyUseCommandTest.php deleted file mode 100644 index b4d671ae16dbc93fab854ccbaf9a30d773531347..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/tests/System/CheckDirectDependencyUseCommandTest.php +++ /dev/null @@ -1,54 +0,0 @@ -markTestSkipped('tests:check-direct-dependency-use is not available in this version'); - } - - $pluginName = 'TreemapVisualization'; - $checkDirectDependencyUse = new CheckDirectDependencyUse(); - - $console = new \Piwik\Console(self::$fixture->piwikEnvironment); - $console->addCommands([$checkDirectDependencyUse]); - $command = $console->find('tests:check-direct-dependency-use'); - $arguments = [ - 'command' => 'tests:check-direct-dependency-use', - '--plugin' => $pluginName, - '--grep-vendor', - ]; - - $inputObject = new ArrayInput($arguments); - $command->run($inputObject, new NullOutput()); - - $this->assertEquals([ - 'Symfony\Component\Console' => [ - 'TreemapVisualization/tests/System/CheckDirectDependencyUseCommandTest.php' - ], - ], $checkDirectDependencyUse->usesFoundList[$pluginName]); - } -} diff --git a/plugins/TreemapVisualization/tests/UI/Treemap_spec.js b/plugins/TreemapVisualization/tests/UI/Treemap_spec.js deleted file mode 100644 index c3bb887302eda3c60f381a35df6fa42b62027e98..0000000000000000000000000000000000000000 --- a/plugins/TreemapVisualization/tests/UI/Treemap_spec.js +++ /dev/null @@ -1,45 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * Screenshot test for TasksTimetable main page. - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -describe("Treemap", function () { - this.timeout(0); - - var generalParams = 'idSite=1&period=year&date=2012-08-09', - urlBase = 'module=CoreHome&action=index&' + generalParams, - normalUrl = "?module=Widgetize&action=iframe&moduleToWidgetize=DevicesDetection&idSite=1&period=year&date=2012-08-09&" - + "actionToWidgetize=getBrowsers&viewDataTable=table&filter_limit=5&isFooterExpandedInDashboard=1", - actionsUrl = "?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=General_Pages" - ; - - it('should load a normal report w/ the treemap visualization correctly', async function () { - await page.goto(normalUrl); - await page.evaluate(function () { - $('.tableIcon[data-footer-icon-id=infoviz-treemap]').click(); - }); - await page.waitForNetworkIdle(); - await page.waitForTimeout(1000); - expect(await page.screenshotSelector('.widget')).to.matchImage('normal_treemap'); - }); - - it('should load a report directly as treemap visualization correctly', async function () { - await page.goto(normalUrl + "&viewDataTable=infoviz-treemap"); - await page.waitForTimeout(1000); - expect(await page.screenshotSelector('.widget')).to.matchImage('initial_treemap'); - }); - - it('should load an actions report on the actions page w/ the treemap visualization correctly', async function (){ - await page.goto(actionsUrl); - await page.evaluate(function () { - $('.tableIcon[data-footer-icon-id=infoviz-treemap]').click(); - }); - await page.waitForNetworkIdle(); - await page.waitForTimeout(1000); - expect(await page.screenshotSelector('.pageWrap')).to.matchImage('actions_treemap'); - }); -}); \ No newline at end of file diff --git a/plugins/TreemapVisualization/tests/UI/expected-ui-screenshots/Treemap_actions_treemap.png b/plugins/TreemapVisualization/tests/UI/expected-ui-screenshots/Treemap_actions_treemap.png deleted file mode 100644 index a411824c7f7001e3d0f090f6fa76e26a46f8fb0a..0000000000000000000000000000000000000000 Binary files a/plugins/TreemapVisualization/tests/UI/expected-ui-screenshots/Treemap_actions_treemap.png and /dev/null differ diff --git a/plugins/TreemapVisualization/tests/UI/expected-ui-screenshots/Treemap_initial_treemap.png b/plugins/TreemapVisualization/tests/UI/expected-ui-screenshots/Treemap_initial_treemap.png deleted file mode 100644 index f91f3b6921a762f89e3d3110b939ec3160d1216d..0000000000000000000000000000000000000000 Binary files a/plugins/TreemapVisualization/tests/UI/expected-ui-screenshots/Treemap_initial_treemap.png and /dev/null differ diff --git a/plugins/TreemapVisualization/tests/UI/expected-ui-screenshots/Treemap_normal_treemap.png b/plugins/TreemapVisualization/tests/UI/expected-ui-screenshots/Treemap_normal_treemap.png deleted file mode 100644 index 947b68e4a355cd37199269309f2c2e2e5d4efb96..0000000000000000000000000000000000000000 Binary files a/plugins/TreemapVisualization/tests/UI/expected-ui-screenshots/Treemap_normal_treemap.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/.gitignore b/plugins/TwoFactorAuth/.gitignore deleted file mode 100644 index c8c9480010db494b8cf54ca8f9561e7a14ff51ea..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tests/System/processed/*xml \ No newline at end of file diff --git a/plugins/TwoFactorAuth/API.php b/plugins/TwoFactorAuth/API.php deleted file mode 100644 index 8bf38be8d2289587fa40152ef5a5db141bbe9f7c..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/API.php +++ /dev/null @@ -1,48 +0,0 @@ -twoFa = $twoFa; - } - - /** - * Disables two-factor authentication for the specified user. - * - * @param string $userLogin The login of the user whose two-factor authentication should be reset. - * @param string $passwordConfirmation The current superuser's password confirmation. - * @return void - */ - public function resetTwoFactorAuth( - string $userLogin, - #[\SensitiveParameter] - string $passwordConfirmation = '' - ) { - Piwik::checkUserHasSuperUserAccess(); - - $this->confirmCurrentUserPassword($passwordConfirmation); - $this->twoFa->disable2FAforUser($userLogin); - } -} diff --git a/plugins/TwoFactorAuth/Commands/Disable2FAForUser.php b/plugins/TwoFactorAuth/Commands/Disable2FAForUser.php deleted file mode 100644 index 8cbe5787fd0a9006e592e7cb6303f7750137abaa..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/Commands/Disable2FAForUser.php +++ /dev/null @@ -1,44 +0,0 @@ -setName('twofactorauth:disable-2fa-for-user'); - $this->setDescription( - 'Disable two-factor authentication for a user. Useful if a user loses the device that was used for' - . ' two-factor authentication. After it was disabled, the user will be able to set it up again.' - ); - $this->addRequiredValueOption('login', null, 'Login of an existing user'); - } - - protected function doExecute(): int - { - $input = $this->getInput(); - $output = $this->getOutput(); - $this->checkAllRequiredOptionsAreNotEmpty(); - $login = $input->getOption('login'); - - // Note: We can't use API here, as the API method would require a password confirmation - $t2f = StaticContainer::get(TwoFactorAuthentication::class); - $t2f->disable2FAforUser($login); - - $message = sprintf('Disabled two-factor authentication for user: %s', $login); - $output->writeln($message); - - return self::SUCCESS; - } -} diff --git a/plugins/TwoFactorAuth/Controller.php b/plugins/TwoFactorAuth/Controller.php deleted file mode 100644 index d27e98c638c13a9fcf2660a13a29e64c84292cf8..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/Controller.php +++ /dev/null @@ -1,377 +0,0 @@ -settings = $systemSettings; - $this->recoveryCodeDao = $recoveryCodeDao; - $this->passwordVerify = $passwordVerify; - $this->twoFa = $twoFa; - $this->validator = $validator; - - parent::__construct(); - } - - public function loginTwoFactorAuth() - { - $this->validator->checkCanUseTwoFa(); - - if (!$this->validator->isCurrentUserMatchingSessionUser()) { - return $this->renderFreshLoginAfterResettingPendingTwoFactorSession(); - } - - $this->validator->check2FaEnabled(); - $this->validator->checkNotVerified2FAYet(); - - $messageNoAccess = null; - - $view = new View('@TwoFactorAuth/loginTwoFactorAuth'); - $form = new FormTwoFactorAuthCode(); - $form->removeAttribute('action'); // remove action attribute, otherwise hash part will be lost - if ($form->validate()) { - $nonce = $form->getSubmitValue('form_nonce'); - $messageNoAccess = Nonce::verifyNonceWithErrorMessage(self::LOGIN_2FA_NONCE, $nonce); - if ($nonce && $messageNoAccess === "" && $form->validate()) { - $authCode = $form->getSubmitValue('form_authcode'); - if ($authCode && is_string($authCode)) { - $authCode = str_replace('-', '', $authCode); - $authCode = strtoupper($authCode); // recovery codes are stored upper case, app codes are only numbers - $authCode = trim($authCode); - } - - if ($this->twoFa->validateAuthCode(Piwik::getCurrentUserLogin(), $authCode)) { - $sessionFingerprint = new SessionFingerprint(); - $sessionFingerprint->setTwoFactorAuthenticationVerified(Piwik::getCurrentUserLogin()); - Url::redirectToUrl(Url::getCurrentUrl()); - } else { - $messageNoAccess = Piwik::translate('TwoFactorAuth_InvalidAuthCode'); - try { - $bruteForce = StaticContainer::get('Piwik\Plugins\Login\Security\BruteForceDetection'); - if ($bruteForce->isEnabled()) { - $bruteForce->addFailedAttempt(IP::getIpFromHeader(), Piwik::getCurrentUserLogin()); - } - } catch (Exception $e) { - // ignore error eg if login plugin is disabled - } - } - } - } - $view->contactEmail = implode(',', Piwik::getContactEmailAddresses()); - $view->loginModule = Piwik::getLoginPluginName(); - $view->AccessErrorString = $messageNoAccess; - $view->addForm($form); - $this->setBasicVariablesView($view); - $view->nonce = Nonce::getNonce(self::LOGIN_2FA_NONCE); - - return $view->render(); - } - - private function renderFreshLoginAfterResettingPendingTwoFactorSession() - { - \Piwik\Plugins\Login\Controller::clearSession(); - Access::getInstance()->setSessionExpired(true); - - return StaticContainer::get(\Piwik\Plugins\Login\Controller::class)->login( - null, - Piwik::translate('General_YourSessionHasExpired') - ); - } - - public function userSettings() - { - $this->validator->checkCanUseTwoFa(); - - return $this->renderTemplate('userSettings', array( - 'isEnabled' => TwoFactorAuthentication::isUserUsingTwoFactorAuthentication(Piwik::getCurrentUserLogin()), - 'isForced' => $this->twoFa->isUserRequiredToHaveTwoFactorEnabled(), - 'disableNonce' => Nonce::getNonce(self::DISABLE_2FA_NONCE), - )); - } - - public function disableTwoFactorAuth() - { - $this->validator->checkCanUseTwoFa(); - $this->validator->check2FaEnabled(); - $this->validator->checkVerified2FA(); - - if ($this->twoFa->isUserRequiredToHaveTwoFactorEnabled()) { - throw new Exception('Two-factor authentication cannot be disabled as it is enforced'); - } - - $nonce = Common::getRequestVar('disableNonce', null, 'string'); - $params = array('module' => 'TwoFactorAuth', 'action' => 'disableTwoFactorAuth', 'disableNonce' => $nonce); - - if ($this->passwordVerify->requirePasswordVerifiedRecently($params)) { - Nonce::checkNonce(self::DISABLE_2FA_NONCE, $nonce); - - $this->twoFa->disable2FAforUser(Piwik::getCurrentUserLogin()); - $this->passwordVerify->forgetVerifiedPassword(); - - $container = StaticContainer::getContainer(); - $email = $container->make(TwoFactorAuthDisabledEmail::class, array( - 'login' => Piwik::getCurrentUserLogin(), - 'emailAddress' => Piwik::getCurrentUserEmail(), - )); - $email->safeSend(); - - $this->redirectToIndex('UsersManager', 'userSecurity', null, null, null, array( - 'disableNonce' => false, - )); - } - } - - private function make2faSession() - { - return new SessionNamespace('TwoFactorAuthenticator'); - } - - public function onLoginSetupTwoFactorAuth() - { - // called when 2fa is required, but user has not yet set up 2fa - - return $this->setupTwoFactorAuth($standalone = true); - } - - /** - * Action to setup two factor authentication - * - * @return string - * @throws \Exception - */ - public function setupTwoFactorAuth($standalone = false) - { - $this->validator->checkCanUseTwoFa(); - - if ($standalone) { - $view = new View('@TwoFactorAuth/setupTwoFactorAuthStandalone'); - $this->setBasicVariablesView($view); - $view->submitAction = 'onLoginSetupTwoFactorAuth'; - } else { - $view = new View('@TwoFactorAuth/setupTwoFactorAuth'); - $this->setGeneralVariablesView($view); - $view->submitAction = 'setupTwoFactorAuth'; - - $redirectParams = array('module' => 'TwoFactorAuth', 'action' => 'setupTwoFactorAuth'); - if (!$this->passwordVerify->requirePasswordVerified($redirectParams)) { - // should usually not go in here but redirect instead - throw new Exception('You have to verify your password first.'); - } - } - - $session = $this->make2faSession(); - - if (empty($session->secret)) { - $session->secret = $this->twoFa->generateSecret(); - } - - $secret = $session->secret; - $session->setExpirationSeconds(60 * 15, 'secret'); - - $authCode = Common::getRequestVar('authCode', '', 'string'); - $authCodeNonce = Common::getRequestVar('authCodeNonce', '', 'string'); - $hasSubmittedForm = !empty($authCodeNonce) || !empty($authCode); - $accessErrorString = ''; - $login = Piwik::getCurrentUserLogin(); - - if ( - !empty($secret) && !empty($authCode) - && Nonce::verifyNonce(self::AUTH_CODE_NONCE, $authCodeNonce) - ) { - if ($this->twoFa->validateAuthCodeDuringSetup(trim($authCode), $secret)) { - $this->twoFa->saveSecret($login, $secret); - $fingerprint = new SessionFingerprint(); - $fingerprint->setTwoFactorAuthenticationVerified($login); - unset($session->secret); - $this->passwordVerify->forgetVerifiedPassword(); - - Piwik::postEvent('TwoFactorAuth.enabled', array($login)); - - $container = StaticContainer::getContainer(); - $email = $container->make(TwoFactorAuthEnabledEmail::class, array( - 'login' => Piwik::getCurrentUserLogin(), - 'emailAddress' => Piwik::getCurrentUserEmail(), - )); - $email->safeSend(); - - if ($standalone) { - $this->redirectToIndex('CoreHome', 'index'); - return; - } - - $view = new View('@TwoFactorAuth/setupFinished'); - $this->setGeneralVariablesView($view); - return $view->render(); - } else { - $accessErrorString = Piwik::translate('TwoFactorAuth_WrongAuthCodeTryAgain'); - } - } elseif (!$standalone) { - // the user has not posted the form... at least not with a valid nonce... we make sure the password verify - // is valid for at least another 15 minutes and if not, ask for another password confirmation to avoid - // the user may be posting a valid auth code after rendering this screen but the password verify is invalid - // by then. - $redirectParams = array('module' => 'TwoFactorAuth', 'action' => 'setupTwoFactorAuth'); - if (!$this->passwordVerify->requirePasswordVerifiedRecently($redirectParams)) { - throw new Exception('You have to verify your password first.'); - } - } - - if ( - !$this->recoveryCodeDao->getAllRecoveryCodesForLogin($login) - || (!$hasSubmittedForm && !TwoFactorAuthentication::isUserUsingTwoFactorAuthentication($login)) - ) { - // we cannot generate new codes after form has been submitted and user is not yet using 2fa cause we would - // change recovery codes in the background without the user noticing... we cannot simply do this: - // if !getAllRecoveryCodesForLogin => createRecoveryCodesForLogin. Because it could be a security issue that - // user might start the setup but never finishes. Before setting up 2fa the first time we have to change - // the recovery codes - $this->recoveryCodeDao->createRecoveryCodesForLogin($login); - } - - $view->title = $this->settings->twoFactorAuthTitle->getValue(); - $view->description = $login; - $view->authCodeNonce = Nonce::getNonce(self::AUTH_CODE_NONCE); - $view->AccessErrorString = $accessErrorString; - $view->isAlreadyUsing2fa = TwoFactorAuthentication::isUserUsingTwoFactorAuthentication($login); - $view->newSecret = $secret; - $view->twoFaBarCodeSetupUrl = $this->getTwoFaBarCodeSetupUrl($secret); - $view->codes = $this->recoveryCodeDao->getAllRecoveryCodesForLogin($login); - $view->standalone = $standalone; - - return $view->render(); - } - - public function showRecoveryCodes() - { - $this->validator->checkCanUseTwoFa(); - $this->validator->checkVerified2FA(); - $this->validator->check2FaEnabled(); - - $regenerateNonce = Common::getRequestVar('regenerateNonce', '', 'string', $_POST); - $postedValidNonce = !empty($regenerateNonce) && Nonce::verifyNonce( - self::REGENERATE_CODES_2FA_NONCE, - $regenerateNonce - ); - - $regenerateSuccess = false; - $regenerateError = false; - $container = StaticContainer::getContainer(); - - if ($postedValidNonce && $this->passwordVerify->hasBeenVerified()) { - $this->passwordVerify->forgetVerifiedPassword(); - $this->recoveryCodeDao->createRecoveryCodesForLogin(Piwik::getCurrentUserLogin()); - $regenerateSuccess = true; - - $email = $container->make(RecoveryCodesRegeneratedEmail::class, array( - 'login' => Piwik::getCurrentUserLogin(), - 'emailAddress' => Piwik::getCurrentUserEmail(), - )); - $email->safeSend(); - // no need to redirect as password was verified nonce - // if user has posted a valid nonce, we do not need to require password again as nonce must have been generated recent - // avoids use case where eg password verify is only valid for one more minute when opening the page but user regenerates 2min later - } elseif (!$this->passwordVerify->requirePasswordVerifiedRecently(array('module' => 'TwoFactorAuth', 'action' => 'showRecoveryCodes'))) { - // should usually not go in here but redirect instead - throw new Exception('You have to verify your password first.'); - } - - if (!$postedValidNonce && !empty($regenerateNonce)) { - $regenerateError = true; - } - - $recoveryCodes = $this->recoveryCodeDao->getAllRecoveryCodesForLogin(Piwik::getCurrentUserLogin()); - - if (!$regenerateSuccess && !$regenerateError) { - $email = $container->make(RecoveryCodesShowedEmail::class, array( - 'login' => Piwik::getCurrentUserLogin(), - 'emailAddress' => Piwik::getCurrentUserEmail(), - )); - $email->safeSend(); - } - - return $this->renderTemplate('showRecoveryCodes', array( - 'codes' => $recoveryCodes, - 'regenerateNonce' => Nonce::getNonce(self::REGENERATE_CODES_2FA_NONCE), - 'regenerateError' => $regenerateError, - 'regenerateSuccess' => $regenerateSuccess, - )); - } - - private function getTwoFaBarCodeSetupUrl( - #[\SensitiveParameter] - $secret - ) { - $title = $this->settings->twoFactorAuthTitle->getValue(); - $descr = Piwik::getCurrentUserLogin(); - - $url = 'otpauth://totp/' . urlencode($descr) . '?secret=' . $secret; - if (isset($title)) { - $url .= '&issuer=' . urlencode($title); - } - - return $url; - } - - protected function getQRUrl($description, $title) - { - return sprintf('index.php?module=TwoFactorAuth&action=showQrCode&cb=%s&title=%s&descr=%s', Common::getRandomString(8), urlencode($title), urlencode($description)); - } -} diff --git a/plugins/TwoFactorAuth/Dao/RecoveryCodeDao.php b/plugins/TwoFactorAuth/Dao/RecoveryCodeDao.php deleted file mode 100644 index 39ff046ef31579f1d65152cedaeb51dea81385a4..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/Dao/RecoveryCodeDao.php +++ /dev/null @@ -1,87 +0,0 @@ -tablePrefixed = Common::prefixTable($this->table); - $this->generator = $generator; - } - - public function getPrefixedTableName() - { - return $this->tablePrefixed; - } - - public function createRecoveryCodesForLogin($login) - { - $codes = array(); - $this->deleteAllRecoveryCodesForLogin($login); - - for ($i = 0; $i < 10; $i++) { - $code = $this->generator->generateCode(); - $code = mb_strtoupper($code); - $this->insertRecoveryCode($login, $code); - $codes[] = $code; - } - return $codes; - } - - public function insertRecoveryCode($login, $recoveryCode) - { - // we do not really care about duplicates as it is very unlikely to happen, that's why we don't even use a - // unique login,recovery_code index - $sql = sprintf('INSERT INTO `%s` (`login`, `recovery_code`) VALUES(?,?)', $this->tablePrefixed); - Db::query($sql, array($login, $recoveryCode)); - } - - public function useRecoveryCode($login, $recoveryCode) - { - if ($this->deleteRecoveryCode($login, $recoveryCode)) { - return true; - } - return false; - } - - public function getAllRecoveryCodesForLogin($login) - { - $sql = sprintf('SELECT recovery_code FROM `%s` WHERE login = ?', $this->tablePrefixed); - $rows = Db::fetchAll($sql, array($login)); - $codes = array_column($rows, 'recovery_code'); - return $codes; - } - - public function deleteRecoveryCode($login, $recoveryCode) - { - $sql = sprintf('DELETE FROM `%s` WHERE login = ? and recovery_code = ?', $this->tablePrefixed); - $query = Db::query($sql, array($login, $recoveryCode)); - return $query->rowCount(); - } - - public function deleteAllRecoveryCodesForLogin($login) - { - $query = sprintf('DELETE FROM `%s` WHERE login = ?', $this->tablePrefixed); - - Db::query($query, array($login)); - } -} diff --git a/plugins/TwoFactorAuth/Dao/RecoveryCodeRandomGenerator.php b/plugins/TwoFactorAuth/Dao/RecoveryCodeRandomGenerator.php deleted file mode 100644 index d71bd11f8b8fda6ef12b8ba98a0525bd246c72ed..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/Dao/RecoveryCodeRandomGenerator.php +++ /dev/null @@ -1,20 +0,0 @@ -index++; - return str_pad($this->index, 16, '0'); - } -} diff --git a/plugins/TwoFactorAuth/Dao/TwoFaSecretRandomGenerator.php b/plugins/TwoFactorAuth/Dao/TwoFaSecretRandomGenerator.php deleted file mode 100644 index caec8610555cac85eb768f7facad42dcda106e97..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/Dao/TwoFaSecretRandomGenerator.php +++ /dev/null @@ -1,21 +0,0 @@ -createSecret(16); - } -} diff --git a/plugins/TwoFactorAuth/Dao/TwoFaSecretStaticGenerator.php b/plugins/TwoFactorAuth/Dao/TwoFaSecretStaticGenerator.php deleted file mode 100644 index 55eeee98982c4b41e46a112f96c3ad6e25d47143..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/Dao/TwoFaSecretStaticGenerator.php +++ /dev/null @@ -1,18 +0,0 @@ -addElement('text', 'form_authcode') - ->addRule( - 'required', - Piwik::translate('General_Required', 'Authentication code') - ); - - $this->addElement('hidden', 'form_nonce'); - - $this->addElement('submit', 'submit'); - } -} diff --git a/plugins/TwoFactorAuth/SystemSettings.php b/plugins/TwoFactorAuth/SystemSettings.php deleted file mode 100644 index 16cdee8a071347b1b0ae0aedfc9e5eaeadee2a2d..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/SystemSettings.php +++ /dev/null @@ -1,61 +0,0 @@ -twoFactorAuthRequired = $this->createRequire2FA(); - $this->twoFactorAuthTitle = $this->create2FATitle(); - } - - private function createRequire2FA() - { - $setting = $this->makeSetting('twoFactorAuthRequired', $default = false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) { - $field->title = Piwik::translate('TwoFactorAuth_RequireTwoFAForAll'); - $field->description = Piwik::translate('TwoFactorAuth_RequireTwoFAForAllInformation'); - $field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; - - $isWritable = defined('PIWIK_TEST_MODE') || TwoFactorAuthentication::isUserUsingTwoFactorAuthentication(Piwik::getCurrentUserLogin()); - if (!$isWritable) { - $field->uiControlAttributes = ['disabled' => 'disabled']; - } - }); - - return $setting; - } - - private function create2FATitle() - { - $default = 'Analytics - ' . Url::getCurrentHost(''); - if (Plugin\Manager::getInstance()->isPluginActivated('WhiteLabel')) { - $default = 'Matomo ' . $default; - } - return $this->makeSetting('twoFactorAuthName', $default, FieldConfig::TYPE_STRING, function (FieldConfig $field) { - $field->title = 'Two-factor authentication title'; - $field->uiControl = FieldConfig::UI_CONTROL_TEXT; - $field->description = 'The name of the title to display that will be displayed in the Authenticator app.'; - }); - } -} diff --git a/plugins/TwoFactorAuth/Tasks.php b/plugins/TwoFactorAuth/Tasks.php deleted file mode 100644 index 84bad73b097feffcdef8ecc84843ce36a77f7da9..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/Tasks.php +++ /dev/null @@ -1,33 +0,0 @@ -twoFa = $twoFa; - } - - public function schedule() - { - $this->daily('cleanupTwoFaCodesUsedRecently'); - } - - public function cleanupTwoFaCodesUsedRecently() - { - $this->twoFa->cleanupTwoFaCodesUsedRecently(); - } -} diff --git a/plugins/TwoFactorAuth/TwoFactorAuth.php b/plugins/TwoFactorAuth/TwoFactorAuth.php deleted file mode 100644 index 878799235742a979134c5a094349cf36a162b3cb..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/TwoFactorAuth.php +++ /dev/null @@ -1,354 +0,0 @@ - array('function' => 'onRequestDispatch', 'after' => true), - 'AssetManager.getJavaScriptFiles' => 'getJsFiles', - 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', - 'API.UsersManager.deleteUser.end' => 'deleteRecoveryCodes', - 'API.UsersManager.createAppSpecificTokenAuth.end' => 'onCreateAppSpecificTokenAuth', - 'Request.dispatch.end' => array('function' => 'onRequestDispatchEnd', 'after' => true), - 'Template.userSecurity.afterPassword' => 'render2FaUserSettings', - 'Login.authenticate.processSuccessfulSession.end' => 'onSuccessfulSession', - 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', - ); - } - - public function getClientSideTranslationKeys(&$translations) - { - $translations[] = 'TwoFactorAuth_WarningChangingConfiguredDevice'; - $translations[] = 'TwoFactorAuth_SetupIntroFollowSteps'; - $translations[] = 'TwoFactorAuth_StepX'; - $translations[] = 'TwoFactorAuth_RecoveryCodes'; - $translations[] = 'TwoFactorAuth_RecoveryCodesExplanation'; - $translations[] = 'TwoFactorAuth_RecoveryCodesSecurity'; - $translations[] = 'TwoFactorAuth_RecoveryCodesAllUsed'; - $translations[] = 'General_Download'; - $translations[] = 'General_Print'; - $translations[] = 'General_Copy'; - $translations[] = 'General_Continue'; - $translations[] = 'TwoFactorAuth_SetupBackupRecoveryCodes'; - $translations[] = 'General_Next'; - $translations[] = 'TwoFactorAuth_SetupAuthenticatorOnDeviceStep1'; - $translations[] = 'General_Or'; - $translations[] = 'TwoFactorAuth_ConfirmSetup'; - $translations[] = 'TwoFactorAuth_VerifyAuthCodeIntro'; - $translations[] = 'TwoFactorAuth_AuthenticationCode'; - $translations[] = 'TwoFactorAuth_VerifyAuthCodeHelp'; - $translations[] = 'General_Confirm'; - $translations[] = 'TwoFactorAuth_SetupAuthenticatorOnDeviceStep2ShowCodes'; - $translations[] = 'TwoFactorAuth_ShowCodes'; - $translations[] = 'TwoFactorAuth_DontHaveOTPApp'; - $translations[] = 'TwoFactorAuth_ShowCodeModalInstructions1'; - $translations[] = 'TwoFactorAuth_ShowCodeModalInstructions2'; - $translations[] = 'TwoFactorAuth_ShowCodeModalInstructions3'; - $translations[] = 'TwoFactorAuth_SetupAuthenticatorOnDevice'; - $translations[] = 'TwoFactorAuth_TwoFactorAuthentication'; - $translations[] = 'General_Error'; - $translations[] = 'TwoFactorAuth_VerifyIdentifyExplanation'; - $translations[] = 'TwoFactorAuth_DontHaveYourMobileDevice'; - $translations[] = 'TwoFactorAuth_EnterRecoveryCodeInstead'; - $translations[] = 'TwoFactorAuth_NotPossibleToLogIn'; - $translations[] = 'TwoFactorAuth_LostAuthenticationDevice'; - $translations[] = 'TwoFactorAuth_AskSuperUserResetAuthenticationCode'; - $translations[] = 'General_Logout'; - $translations[] = 'TwoFactorAuth_Your2FaAuthSecret'; - $translations[] = 'TwoFactorAuth_GenerateNewRecoveryCodes'; - $translations[] = 'TwoFactorAuth_GenerateNewRecoveryCodesInfo'; - $translations[] = 'TwoFactorAuth_RecoveryCodesRegenerated'; - $translations[] = 'General_ExceptionSecurityCheckFailed'; - $translations[] = 'TwoFactorAuth_TwoFAShort'; - $translations[] = 'TwoFactorAuth_TwoFactorAuthenticationIntro'; - $translations[] = 'TwoFactorAuth_TwoFactorAuthenticationIsEnabled'; - $translations[] = 'TwoFactorAuth_TwoFactorAuthenticationRequired'; - $translations[] = 'TwoFactorAuth_ConfigureDifferentDevice'; - $translations[] = 'TwoFactorAuth_DisableTwoFA'; - $translations[] = 'TwoFactorAuth_ShowRecoveryCodes'; - $translations[] = 'TwoFactorAuth_TwoFactorAuthenticationIsDisabled'; - $translations[] = 'TwoFactorAuth_EnableTwoFA'; - $translations[] = 'TwoFactorAuth_ConfirmDisableTwoFA'; - $translations[] = 'General_Yes'; - $translations[] = 'General_No'; - $translations[] = 'TwoFactorAuth_RequiredToSetUpTwoFactorAuthentication'; - $translations[] = 'TwoFactorAuth_SetUpTwoFactorAuthentication'; - $translations[] = 'TwoFactorAuth_SetupFinishedTitle'; - $translations[] = 'TwoFactorAuth_SetupFinishedSubtitle'; - $translations[] = 'General_Continue'; - $translations[] = 'TwoFactorAuth_Verify'; - } - - public function getStylesheetFiles(&$stylesheets) - { - $stylesheets[] = "plugins/TwoFactorAuth/stylesheets/twofactorauth.less"; - } - - public function getJsFiles(&$jsFiles) - { - $jsFiles[] = "node_modules/qrcodejs2/qrcode.min.js"; - } - - public function deleteRecoveryCodes($returnedValue, $params) - { - $model = new Model(); - if ( - !empty($params['parameters']['userLogin']) - && !$model->userExists($params['parameters']['userLogin']) - ) { - // we delete only if the deletion was really successful - $dao = StaticContainer::get(RecoveryCodeDao::class); - $dao->deleteAllRecoveryCodesForLogin($params['parameters']['userLogin']); - } - } - - public function render2FaUserSettings(&$out) - { - $validator = $this->getValidator(); - if ($validator->canUseTwoFa()) { - $content = FrontController::getInstance()->dispatch('TwoFactorAuth', 'userSettings'); - if (!empty($content)) { - $out .= $content; - } - } - } - - public function onSuccessfulSession($login) - { - if (Piwik::getModule() === 'Login' && Piwik::getAction() === 'logme' && $login) { - // we allow user to send an "authCode" along logme to directly log in... if not, user will see the - // auth code verification screen after logme - $authCode = Common::getRequestVar('authCode', '', 'string'); - $twoFa = $this->getTwoFa(); - - if ($authCode && TwoFactorAuthentication::isUserUsingTwoFactorAuthentication($login)) { - if ($twoFa->validateAuthCode($login, $authCode)) { - $sessionFingerprint = new SessionFingerprint(); - $sessionFingerprint->setTwoFactorAuthenticationVerified($login); - } else { - $this->recordFailedTwoFactorAttempt($login); - } - } - } - } - - private function getTwoFa() - { - return StaticContainer::get(TwoFactorAuthentication::class); - } - - private function getValidator() - { - return StaticContainer::get(Validator::class); - } - - private function isValidTokenAuth( - #[\SensitiveParameter] - $tokenAuth - ) { - $model = new Model(); - $user = $model->getUserByTokenAuth($tokenAuth, true); - return !empty($user); - } - - public function onCreateAppSpecificTokenAuth($returnedValue, array $params): void - { - if (!SettingsPiwik::isMatomoInstalled()) { - return; - } - - if (!empty($returnedValue) && !empty($params['parameters']['userLogin'])) { - $login = UserLoginHelper::findCanonicalLoginByLoginOrEmail($params['parameters']['userLogin']); - $twoFa = $this->getTwoFa(); - - if (!empty($login) && TwoFactorAuthentication::isUserUsingTwoFactorAuthentication($login) && $this->isValidTokenAuth($returnedValue)) { - $authCode = \Piwik\Request::fromRequest()->getStringParameter('authCode', ''); - // we only return an error when the login/password combo was correct. otherwise you could brute force - // auth tokens - if (!$authCode) { - $this->recordFailedTwoFactorAttempt($login); - throw new NoPrivilegesException(Piwik::translate('TwoFactorAuth_MissingAuthCodeAPI')); - } - if (!$twoFa->validateAuthCode($login, $authCode)) { - $this->recordFailedTwoFactorAttempt($login); - throw new NoPrivilegesException(Piwik::translate('TwoFactorAuth_InvalidAuthCode')); - } - } elseif ( - $twoFa->isUserRequiredToHaveTwoFactorEnabled() - && (empty($login) || !TwoFactorAuthentication::isUserUsingTwoFactorAuthentication($login)) - ) { - throw new Exception(Piwik::translate('TwoFactorAuth_RequiredAuthCodeNotConfiguredAPI')); - } - } - } - - /** - * Records a failed login attempt so the existing brute-force protection can engage. - */ - private function recordFailedTwoFactorAttempt(string $login): void - { - try { - $bruteForce = StaticContainer::get('Piwik\Plugins\Login\Security\BruteForceDetection'); - if ($bruteForce->isEnabled()) { - $bruteForce->addFailedAttempt(IP::getIpFromHeader(), $login); - } - } catch (Exception $e) { - // ignore error eg if login plugin is disabled - } - } - - public function onRequestDispatch(&$module, &$action, $parameters) - { - $validator = $this->getValidator(); - if (!$validator->canUseTwoFa()) { - return; - } - - if ($module === 'Proxy') { - return false; - } - - if (!$this->requiresAuth($module, $action, $parameters)) { - return; - } - - if ( - $validator->hasPendingSessionTwoFactorAuthentication() - && !$validator->isCurrentUserMatchingSessionUser() - ) { - if (!Request::isRootRequestApiRequest()) { - $this->resetPendingTwoFactorSessionAndRequireFreshLogin($module, $action); - } elseif (StaticContainer::get(AuthenticationToken::class)->isSessionToken()) { - throw new Exception(Piwik::translate('General_YourSessionHasExpired')); - } - return; - } - - $twoFa = $this->getTwoFa(); - - $isUsing2FA = TwoFactorAuthentication::isUserUsingTwoFactorAuthentication(Piwik::getCurrentUserLogin()); - if ($isUsing2FA && Session::isStarted()) { - $sessionFingerprint = new SessionFingerprint(); - if (!$sessionFingerprint->hasVerifiedTwoFactor()) { - if (!Request::isRootRequestApiRequest()) { - $module = 'TwoFactorAuth'; - $action = 'loginTwoFactorAuth'; - } elseif (StaticContainer::get(AuthenticationToken::class)->isSessionToken()) { - // don't allow API requests with session auth if 2fa code hasn't been verified. - throw new Exception(Piwik::translate('General_YourSessionHasExpired')); - } - } - } elseif (!$isUsing2FA && $twoFa->isUserRequiredToHaveTwoFactorEnabled()) { - $module = 'TwoFactorAuth'; - $action = 'onLoginSetupTwoFactorAuth'; - } - } - - private function resetPendingTwoFactorSessionAndRequireFreshLogin(&$module, &$action) - { - LoginController::clearSession(); - Access::getInstance()->setSessionExpired(true); - - $module = Piwik::getLoginPluginName(); - $action = 'login'; - } - - private function requiresAuth($module, $action, $parameters) - { - if ($module === 'TwoFactorAuth' && $action === 'showQrCode') { - return false; - } - - if ($module === 'CorePluginsAdmin' && strtolower($action) === 'safemode') { - return false; - } - - if ($module === 'CoreUpdater' && $action !== 'newVersionAvailable' && $action !== 'oneClickUpdate') { - return false; - } - - if ($module === Piwik::getLoginPluginName() && $action === 'logout') { - return false; - } - - $auth = StaticContainer::get('Piwik\Auth'); - if (!$auth->getLogin() && method_exists($auth, 'getTokenAuth') && $auth->getTokenAuth()) { - // when authenticated by token only, we do not require 2fa - // needed eg for rendering exported widgets authenticated by token - return false; - } - - $requiresAuth = true; - Piwik::postEvent('TwoFactorAuth.requiresTwoFactorAuthentication', array(&$requiresAuth, $module, $action, $parameters)); - - return $requiresAuth; - } - - public function onRequestDispatchEnd(&$result, $module, $action, $parameters) - { - $validator = $this->getValidator(); - if (!$validator->canUseTwoFa()) { - return; - } - - if (!$this->requiresAuth($module, $action, $parameters)) { - return; - } - - $twoFa = $this->getTwoFa(); - - $isUsing2FA = TwoFactorAuthentication::isUserUsingTwoFactorAuthentication(Piwik::getCurrentUserLogin()); - if ($isUsing2FA && !Request::isRootRequestApiRequest()) { - $sessionFingerprint = new SessionFingerprint(); - if (!$sessionFingerprint->hasVerifiedTwoFactor()) { - $result = $this->removeTokenFromOutput($result); - } - } elseif (!$isUsing2FA && $twoFa->isUserRequiredToHaveTwoFactorEnabled()) { - $result = $this->removeTokenFromOutput($result); - } - } - - private function removeTokenFromOutput($output) - { - if (empty($output)) { - return $output; - } - - $token = Piwik::getCurrentUserTokenAuth(); - // make sure to not leak the token... otherwise someone could log in using someone's credentials... - // and then maybe in the auth screen look into the DOM to find the token... and then bypass the - // auth code using API - return str_replace($token, md5('') . '2fareplaced', $output); - } -} diff --git a/plugins/TwoFactorAuth/TwoFactorAuthentication.php b/plugins/TwoFactorAuth/TwoFactorAuthentication.php deleted file mode 100644 index a33b581e78dfa78e930790ee01a9b2a19d431ad7..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/TwoFactorAuthentication.php +++ /dev/null @@ -1,277 +0,0 @@ -settings = $systemSettings; - $this->recoveryCodeDao = $recoveryCodeDao; - $this->secretGenerator = $twoFaSecretRandomGenerator; - } - - private static function getUserModel(): Model - { - return new Model(); - } - - /** - * @return string - */ - public function generateSecret() - { - return $this->secretGenerator->generateSecret(); - } - - /** - * @param string $login - * @return void - */ - public function disable2FAforUser($login) - { - $this->saveSecret($login, ''); - $this->recoveryCodeDao->deleteAllRecoveryCodesForLogin($login); - - Piwik::postEvent('TwoFactorAuth.disabled', array($login)); - } - - private static function isAnonymous(string $login): bool - { - return strtolower($login) === 'anonymous'; - } - - /** - * @param string $login - * @param string $secret - * @return void - */ - public function saveSecret( - $login, - #[\SensitiveParameter] - $secret - ) { - if (self::isAnonymous($login)) { - throw new Exception('Anonymous cannot use two-factor authentication'); - } - - if (!empty($secret) && !$this->recoveryCodeDao->getAllRecoveryCodesForLogin($login)) { - // ensures the user has seen and ideally backuped the recovery codes... we don't create them here on demand - throw new Exception('Cannot enable two-factor authentication, no recovery codes have been created'); - } - - $model = self::getUserModel(); - $model->updateUserFields($login, array('twofactor_secret' => $secret)); - } - - /** - * @return bool - */ - public function isUserRequiredToHaveTwoFactorEnabled() - { - return !!$this->settings->twoFactorAuthRequired->getValue(); - } - - /** - * @param string $login - * @return bool - */ - public static function isUserUsingTwoFactorAuthentication($login) - { - if (self::isAnonymous($login)) { - return false; // not possible to use auth code with anonymous - } - - $user = self::getUser($login); - return !empty($user['twofactor_secret']); - } - - private static function getUser(string $login): array - { - $model = self::getUserModel(); - return $model->getUser($login); - } - - private function wasTwoFaCodeUsedRecently( - string $login, - #[\SensitiveParameter] - string $authCode - ): bool { - $time = Option::get($this->gettwoFaCodeUsedKey($login, $authCode)); - if (empty($time)) { - return false; - } - $blockWindowSeconds = 60 * self::BLOCK_TWOFA_CODE_MINUTES; - return (int)$time >= time() - $blockWindowSeconds; - } - - private function gettwoFaCodeUsedKey( - string $login, - #[\SensitiveParameter] - string $authCode - ): string { - return self::OPTION_PREFIX_TWO_FA_CODE_USED . md5($login . $authCode . SettingsPiwik::getSalt()); - } - - private function setTwoFaCodeWasUsed( - string $login, - #[\SensitiveParameter] - string $authCode - ): bool { - $table = Common::prefixTable('option'); - $optionName = $this->gettwoFaCodeUsedKey($login, $authCode); - $currentTime = time(); - $bind = [$optionName, $currentTime, 0]; - try { - Db::query('INSERT INTO `' . $table . '` (option_name, option_value, autoload) VALUES (?, ?, ?) ', $bind); - Option::clearCachedOption($optionName); - return true; - } catch (Exception $e) { - // when 2 processes try to insert at same time this can fail with duplicate key. - // if the record is older than the block window, refresh the timestamp and allow usage again. - $blockWindowSeconds = 60 * self::BLOCK_TWOFA_CODE_MINUTES; - $staleThreshold = $currentTime - $blockWindowSeconds; - $updateBind = [$currentTime, $optionName, $staleThreshold]; - - $result = Db::query( - 'UPDATE `' . $table . '` SET option_value = ?, autoload = 0 WHERE option_name = ? AND CAST(option_value AS UNSIGNED) <= ?', - $updateBind - ); - - $didUpdateRecord = (bool) Db::get()->rowCount($result); - if ($didUpdateRecord) { - Option::clearCachedOption($optionName); - } - - return $didUpdateRecord; - } - } - - /** - * @return void - */ - public function cleanupTwoFaCodesUsedRecently() - { - $values = Option::getLike(TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . '%'); - if (!empty($values)) { - foreach ($values as $optionName => $timeCodeWasUsed) { - $fiveMinutesAgo = time() - (60 * self::BLOCK_TWOFA_CODE_MINUTES); - if ($timeCodeWasUsed < $fiveMinutesAgo) { - // delete any entry created more than 5 min ago - Option::delete($optionName); - } - } - } - } - - /** - * @param string $login - * @param string $authCode - * @return bool - */ - public function validateAuthCode( - $login, - #[\SensitiveParameter] - $authCode - ) { - if (!self::isUserUsingTwoFactorAuthentication($login)) { - return false; - } - - $user = self::getUser($login); - - if (!is_string($authCode)) { - return false; - } - - if ($this->wasTwoFaCodeUsedRecently($user['login'], $authCode)) { - return false; - } - - if (!$this->setTwoFaCodeWasUsed($user['login'], $authCode)) { - return false; - } - - if ( - !empty($user['twofactor_secret']) - && $this->validateAuthCodeDuringSetup($authCode, $user['twofactor_secret']) - ) { - return true; - } - - if ($this->recoveryCodeDao->useRecoveryCode($user['login'], $authCode)) { - return true; - } - - return false; - } - - /** - * @param string $authCode - * @param string $secret - * @return bool - */ - public function validateAuthCodeDuringSetup( - #[\SensitiveParameter] - $authCode, - #[\SensitiveParameter] - $secret - ) { - $twoFactorAuth = $this->makeAuthenticator(); - - if (!empty($secret) && $twoFactorAuth->verifyCode($secret, $authCode, 2)) { - return true; - } - return false; - } - - private function makeAuthenticator(): \TwoFactorAuthenticator - { - return new \TwoFactorAuthenticator(); - } -} diff --git a/plugins/TwoFactorAuth/Validator.php b/plugins/TwoFactorAuth/Validator.php deleted file mode 100644 index 035dba2e35cb7677c1365f6f69e9e9ab76c52454..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/Validator.php +++ /dev/null @@ -1,135 +0,0 @@ -twoFa = $twoFactorAuthentication; - } - - public function canUseTwoFa() - { - if (Common::isPhpCliMode() && (!defined('PIWIK_TEST_MODE') || !PIWIK_TEST_MODE)) { - // eg when archiving or executing other commands - return false; - } - - if (!SettingsPiwik::isMatomoInstalled()) { - return false; - } - - return !Piwik::isUserIsAnonymous(); - } - - public function checkCanUseTwoFa() - { - Piwik::checkUserIsNotAnonymous(); - - if (!SettingsPiwik::isMatomoInstalled()) { - throw new NotYetInstalledException('Matomo is not set up yet'); - } - } - - public function check2FaIsRequired() - { - if (!$this->twoFa->isUserRequiredToHaveTwoFactorEnabled()) { - throw new Exception('not available'); - } - } - - public function check2FaEnabled() - { - if (!TwoFactorAuthentication::isUserUsingTwoFactorAuthentication(Piwik::getCurrentUserLogin())) { - throw new Exception('not available'); - } - } - - public function check2FaNotEnabled() - { - if (TwoFactorAuthentication::isUserUsingTwoFactorAuthentication(Piwik::getCurrentUserLogin())) { - throw new Exception('not available'); - } - } - - public function checkVerified2FA() - { - $sessionFingerprint = $this->getSessionFingerPrint(); - if (!$sessionFingerprint->hasVerifiedTwoFactor()) { - throw new Exception('not available'); - } - } - - public function checkNotVerified2FAYet() - { - $sessionFingerprint = $this->getSessionFingerPrint(); - if ($sessionFingerprint->hasVerifiedTwoFactor()) { - throw new Exception('not available'); - } - } - - public function getSessionUser() - { - $sessionFingerprint = $this->getSessionFingerPrint(); - return $sessionFingerprint->getUser(); - } - - public function isCurrentUserMatchingSessionUser() - { - $sessionUser = $this->getSessionUser(); - if (empty($sessionUser)) { - return false; - } - - return $sessionUser === Piwik::getCurrentUserLogin(); - } - - public function checkCurrentUserMatchesSessionUser() - { - if (!$this->isCurrentUserMatchingSessionUser()) { - throw new Exception('not available'); - } - } - - public function hasPendingSessionTwoFactorAuthentication() - { - $sessionUser = $this->getSessionUser(); - if (empty($sessionUser)) { - return false; - } - - $needsTwoFactorAuthentication = TwoFactorAuthentication::isUserUsingTwoFactorAuthentication($sessionUser) - || $this->twoFa->isUserRequiredToHaveTwoFactorEnabled(); - if (!$needsTwoFactorAuthentication) { - return false; - } - - $sessionFingerprint = $this->getSessionFingerPrint(); - return !$sessionFingerprint->hasVerifiedTwoFactor(); - } - - private function getSessionFingerPrint() - { - return new SessionFingerprint(); - } -} diff --git a/plugins/TwoFactorAuth/config/config.php b/plugins/TwoFactorAuth/config/config.php deleted file mode 100644 index d5be5de26f92a935f318ed4c0a04fe01434bfe66..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/config/config.php +++ /dev/null @@ -1,3 +0,0 @@ - Piwik\DI::autowire('Piwik\Plugins\TwoFactorAuth\Dao\TwoFaSecretStaticGenerator'), - 'Piwik\Plugins\TwoFactorAuth\Dao\RecoveryCodeRandomGenerator' => Piwik\DI::autowire('Piwik\Plugins\TwoFactorAuth\Dao\RecoveryCodeStaticGenerator'), - 'Piwik\Plugins\TwoFactorAuth\TwoFactorAuthentication' => Piwik\DI::decorate(function ($previous) { - /** @var Piwik\Plugins\TwoFactorAuth\TwoFactorAuthentication $previous */ - - if (!\Piwik\SettingsPiwik::isMatomoInstalled()) { - return $previous; - } - - $fakeCorrectAuthCode = \Piwik\Container\StaticContainer::get('test.vars.fakeCorrectAuthCode'); - if (!empty($fakeCorrectAuthCode) && !\Piwik\Common::isPhpCliMode()) { - $staticSecret = new \Piwik\Plugins\TwoFactorAuth\Dao\TwoFaSecretStaticGenerator(); - $secret = $staticSecret->generateSecret(); - - require_once PIWIK_DOCUMENT_ROOT . '/libs/Authenticator/TwoFactorAuthenticator.php'; - $authenticator = new \TwoFactorAuthenticator(); - $_GET['authcode'] = $authenticator->getCode($secret); - $_GET['authCode'] = $_GET['authcode']; - $_POST['authCode'] = $_GET['authcode']; - $_POST['authcode'] = $_GET['authcode']; - $_REQUEST['authcode'] = $_GET['authcode']; - $_REQUEST['authCode'] = $_GET['authcode']; - } - - return $previous; - }), - 'Piwik\Plugins\TwoFactorAuth\Dao\RecoveryCodeDao' => Piwik\DI::decorate(function ($previous) { - /** @var Piwik\Plugins\TwoFactorAuth\Dao\RecoveryCodeDao $previous */ - - if (!\Piwik\SettingsPiwik::isMatomoInstalled()) { - return $previous; - } - - $restoreCodes = \Piwik\Container\StaticContainer::get('test.vars.restoreRecoveryCodes'); - if (!empty($restoreCodes)) { - // we ensure this recovery code always works for those users - foreach (array('with2FA', 'with2FADisable') as $user) { - $previous->useRecoveryCode($user, '123456'); // we are using it first to make sure there is no duplicate - $previous->insertRecoveryCode($user, '123456'); - \Piwik\Option::deleteLike(\Piwik\Plugins\TwoFactorAuth\TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . '%'); - } - } - - return $previous; - }), - 'Piwik\Plugins\TwoFactorAuth\SystemSettings' => Piwik\DI::decorate(function ($previous) { - /** @var Piwik\Plugins\TwoFactorAuth\SystemSettings $previous */ - if (!\Piwik\SettingsPiwik::isMatomoInstalled()) { - return $previous; - } - - Piwik\Access::doAsSuperUser(function () use ($previous) { - $requireTwoFa = \Piwik\Container\StaticContainer::get('test.vars.requireTwoFa'); - if (!empty($requireTwoFa)) { - $previous->twoFactorAuthRequired->setValue(1); - } else { - try { - $previous->twoFactorAuthRequired->setValue(0); - } catch (Exception $e) { - // may fail when matomo is trying to update or so - } - } - }); - - return $previous; - }), -); diff --git a/plugins/TwoFactorAuth/config/tracker.php b/plugins/TwoFactorAuth/config/tracker.php deleted file mode 100644 index d5be5de26f92a935f318ed4c0a04fe01434bfe66..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/config/tracker.php +++ /dev/null @@ -1,3 +0,0 @@ -
-{% endblock %} \ No newline at end of file diff --git a/plugins/TwoFactorAuth/templates/setupFinished.twig b/plugins/TwoFactorAuth/templates/setupFinished.twig deleted file mode 100644 index b9d25c8dfea1d0ef558204b89d1b4cb18b4baf53..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/templates/setupFinished.twig +++ /dev/null @@ -1,4 +0,0 @@ -{% extends 'admin.twig' %} -{% block content %} -
-{% endblock %} diff --git a/plugins/TwoFactorAuth/templates/setupTwoFactorAuth.twig b/plugins/TwoFactorAuth/templates/setupTwoFactorAuth.twig deleted file mode 100644 index 0ca28affb2b03fc0fdd4c9aabb0b9d0357b49444..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/templates/setupTwoFactorAuth.twig +++ /dev/null @@ -1,15 +0,0 @@ -{% extends 'admin.twig' %} - -{% block content %} -
-{% endblock %} \ No newline at end of file diff --git a/plugins/TwoFactorAuth/templates/setupTwoFactorAuthStandalone.twig b/plugins/TwoFactorAuth/templates/setupTwoFactorAuthStandalone.twig deleted file mode 100644 index 282d042bbd36cbc3fea4d1919672b16da199a461..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/templates/setupTwoFactorAuthStandalone.twig +++ /dev/null @@ -1,15 +0,0 @@ -{% extends '@Login/loginLayout.twig' %} - -{% block loginContent %} -
-{% endblock %} \ No newline at end of file diff --git a/plugins/TwoFactorAuth/templates/showRecoveryCodes.twig b/plugins/TwoFactorAuth/templates/showRecoveryCodes.twig deleted file mode 100644 index fed91b49fa954f9fd0b93debffcb7c542eb19a02..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/templates/showRecoveryCodes.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'admin.twig' %} - -{% block content %} -
-{% endblock %} \ No newline at end of file diff --git a/plugins/TwoFactorAuth/templates/userSettings.twig b/plugins/TwoFactorAuth/templates/userSettings.twig deleted file mode 100644 index 0018e41908d7387f6907ad23209bf08c0c1b76f1..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/templates/userSettings.twig +++ /dev/null @@ -1,6 +0,0 @@ -
diff --git a/plugins/TwoFactorAuth/tests/Fixtures/SimpleFixtureTrackFewVisits.php b/plugins/TwoFactorAuth/tests/Fixtures/SimpleFixtureTrackFewVisits.php deleted file mode 100644 index a325781b4721715c35c80f3823159c46e01f57be..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Fixtures/SimpleFixtureTrackFewVisits.php +++ /dev/null @@ -1,43 +0,0 @@ -setUpWebsite(); - Fixture::createSuperUser(true); - $this->createSuperUser = true; - } - - public function tearDown(): void - { - // empty - } - - private function setUpWebsite() - { - if (!self::siteCreated($this->idSite)) { - $idSite = self::createWebsite($this->dateTime, $ecommerce = 1); - $this->assertSame($this->idSite, $idSite); - } - } -} diff --git a/plugins/TwoFactorAuth/tests/Fixtures/TwoFactorFixture.php b/plugins/TwoFactorAuth/tests/Fixtures/TwoFactorFixture.php deleted file mode 100644 index 39b8e68ed19ce6e32e7aa1f6c70eb369f31e655a..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Fixtures/TwoFactorFixture.php +++ /dev/null @@ -1,113 +0,0 @@ -dao = StaticContainer::get(RecoveryCodeDao::class); - $this->twoFa = StaticContainer::get(TwoFactorAuthentication::class); - - $this->setUpWebsite(); - $this->setUpUsers(); - $this->trackFirstVisit(); - } - - public function tearDown(): void - { - // empty - } - - public function setUpWebsite() - { - for ($i = 1; $i <= 2; $i++) { - if (!self::siteCreated($i)) { - $idSite = self::createWebsite($this->dateTime); - // we set type "mobileapp" to avoid the creation of a default container - $this->assertSame($i, $idSite); - } - } - } - - public function setUpUsers() - { - \Piwik\Plugins\UsersManager\API::getInstance()->addUser( - $this->superUserWith2Fa, - $this->userPassword, - $this->superUserWith2Fa . '@matomo.org' - ); - $userUpdater = new UserUpdater(); - $userUpdater->setSuperUserAccessWithoutCurrentPassword($this->superUserWith2Fa, true); - - foreach ([$this->userWith2Fa, $this->userWithout2Fa, $this->userWith2FaDisable, $this->userNo2Fa] as $user) { - \Piwik\Plugins\UsersManager\API::getInstance()->addUser($user, $this->userPassword, $user . '@matomo.org'); - // we cannot set superuser as logme won't work for super user - UsersAPI::getInstance()->setUserAccess($user, 'view', [$this->idSite, $this->idSite2]); - - if ($this->userWith2Fa === $user) { - $userModel = new Model(); - $userModel->addTokenAuth($user, 'a4ca4238a0b923820dcc509a6f75849b', 'twofa test', Date::now()->getDatetime()); - } - } - - foreach ([$this->userWith2Fa, $this->userWith2FaDisable, $this->superUserWith2Fa] as $user) { - $this->dao->insertRecoveryCode($user, '123456'); - $this->dao->insertRecoveryCode($user, '234567'); - $this->dao->insertRecoveryCode($user, '345678'); - $this->dao->insertRecoveryCode($user, '456789'); - $this->dao->insertRecoveryCode($user, '567890'); - $this->dao->insertRecoveryCode($user, '678901'); - $this->twoFa->saveSecret($user, self::USER_2FA_SECRET); - } - } - - protected function trackFirstVisit() - { - $t = self::getTracker($this->idSite, $this->dateTime, $defaultInit = true); - - $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.1)->getDatetime()); - $t->setUrl('http://example.com/'); - self::checkResponse($t->doTrackPageView('Viewing homepage')); - } -} diff --git a/plugins/TwoFactorAuth/tests/Fixtures/TwoFactorUsersManagerFixture.php b/plugins/TwoFactorAuth/tests/Fixtures/TwoFactorUsersManagerFixture.php deleted file mode 100644 index 7712905674966cfdcf15cc41506880fe89be9f8d..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Fixtures/TwoFactorUsersManagerFixture.php +++ /dev/null @@ -1,15 +0,0 @@ -api = API::getInstance(); - $this->recoveryCodes = StaticContainer::get(RecoveryCodeDao::class); - - foreach ([1,2,3] as $idsite) { - Fixture::createWebsite('2014-01-02 03:04:05'); - } - - foreach (['mylogin1', 'mylogin2', 'login'] as $user) { - UsersAPI::getInstance()->addUser($user, '123abcDk3_l3', $user . '@matomo.org'); - } - $this->twoFa = StaticContainer::get(TwoFactorAuthentication::class); - } - - public function testResetTwoFactorAuthFailsWhenNotPermissions() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('checkUserHasSuperUserAccess Fake exception'); - - $this->setAdminUser(); - $this->api->resetTwoFactorAuth('login', Fixture::ADMIN_USER_PASSWORD); - } - - public function testResetTwoFactorAuthResetsSecret() - { - $this->recoveryCodes->createRecoveryCodesForLogin('mylogin1'); - $this->recoveryCodes->createRecoveryCodesForLogin('mylogin2'); - $this->twoFa->saveSecret('mylogin1', '1234'); - $this->twoFa->saveSecret('mylogin2', '1234'); - - $this->assertTrue(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin1')); - $this->assertTrue(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin2')); - $this->api->resetTwoFactorAuth('mylogin1', Fixture::ADMIN_USER_PASSWORD); - $this->assertFalse(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin1')); - $this->assertTrue(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin2')); - - $this->assertEquals([], $this->recoveryCodes->getAllRecoveryCodesForLogin('mylogin1')); - - //Reset without a password - Piwik::addAction('Login.userRequiresPasswordConfirmation', function (&$requiresPasswordConfirmation) { - $requiresPasswordConfirmation = false; - }); - $this->api->resetTwoFactorAuth('mylogin2'); - $this->assertFalse(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin2')); - } - - protected function setAdminUser() - { - FakeAccess::clearAccess(false); - FakeAccess::$identity = 'testUser'; - FakeAccess::$idSitesView = array(); - FakeAccess::$idSitesAdmin = array(1,2,3); - } - - public function provideContainerConfig() - { - return array( - 'Piwik\Access' => new FakeAccess(), - ); - } - - protected static function configureFixture($fixture) - { - parent::configureFixture($fixture); - $fixture->createSuperUser = true; - } -} diff --git a/plugins/TwoFactorAuth/tests/Integration/Dao/RecoveryCodeDaoTest.php b/plugins/TwoFactorAuth/tests/Integration/Dao/RecoveryCodeDaoTest.php deleted file mode 100644 index bf7e2168cbcbe095099d5244923c7ff8880d2392..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Integration/Dao/RecoveryCodeDaoTest.php +++ /dev/null @@ -1,166 +0,0 @@ -dao = StaticContainer::get(RecoveryCodeDao::class); - } - - public function testShouldInstallTable() - { - $columns = DbHelper::getTableColumns($this->dao->getPrefixedTableName()); - $columns = array_keys($columns); - - $this->assertEquals(['idrecoverycode', 'login', 'recovery_code'], $columns); - } - - public function testGetAllRecoveryCodesForLoginEmptyByDefault() - { - $this->assertEquals([], $this->dao->getAllRecoveryCodesForLogin('login1')); - } - - public function testInsertRecoveryCodeGetAllRecoveryCodesForLogin() - { - $this->dao->insertRecoveryCode('login1', '123456'); - $this->dao->insertRecoveryCode('login1', '654321'); - $this->dao->insertRecoveryCode('login2', '333111'); - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login1')); - $this->assertEquals(['333111'], $this->dao->getAllRecoveryCodesForLogin('login2')); - } - - public function testDeleteRecoveryCode() - { - $this->insertManyCodesDifferentLogins(); - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login1')); - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login2')); - - $this->assertEquals(1, $this->dao->deleteRecoveryCode('login2', '654321')); // this one should be deleted - $this->assertEquals(0, $this->dao->deleteRecoveryCode('login2', 'xya123')); // cannot be found - $this->assertEquals(0, $this->dao->deleteRecoveryCode('login999', '123456')); // cannot be found - - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login1')); - $this->assertEquals(['123456'], $this->dao->getAllRecoveryCodesForLogin('login2')); - - $this->dao->deleteRecoveryCode('login2', '123456'); // delete last code for this login - $this->assertEquals([], $this->dao->getAllRecoveryCodesForLogin('login2')); - - $this->assertEquals(0, $this->dao->deleteRecoveryCode('login2', '654321')); // cannot be deleted again - } - - public function testDeleteAllRecoveryCodesForLogin() - { - $this->insertManyCodesDifferentLogins(); - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login1')); - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login2')); - - $this->dao->deleteAllRecoveryCodesForLogin('login2'); // this one should be deleted - $this->dao->deleteAllRecoveryCodesForLogin('login999'); // login cannot be found - - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login1')); - $this->assertEquals([], $this->dao->getAllRecoveryCodesForLogin('login2')); - } - - public function testUseRecoveryCode() - { - $this->insertManyCodesDifferentLogins(); - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login1')); - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login2')); - - $this->assertTrue($this->dao->useRecoveryCode('login2', '654321')); // this one should be used and deleted - - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login1')); - $this->assertEquals(['123456'], $this->dao->getAllRecoveryCodesForLogin('login2')); - - $this->assertFalse($this->dao->useRecoveryCode('login2', '654321')); // cannot be used again - $this->assertFalse($this->dao->useRecoveryCode('login2', 'xya123')); // cannot be found - $this->assertFalse($this->dao->useRecoveryCode('login999', '123456')); // cannot be found - - $this->assertEquals(['123456', '654321'], $this->dao->getAllRecoveryCodesForLogin('login1')); - $this->assertEquals(['123456'], $this->dao->getAllRecoveryCodesForLogin('login2')); - - $this->assertTrue($this->dao->useRecoveryCode('login2', '123456')); // cannot be used again - $this->assertEquals([], $this->dao->getAllRecoveryCodesForLogin('login2')); - } - - public function testCreateRecoveryCodesForLogin() - { - $this->assertEquals([], $this->dao->getAllRecoveryCodesForLogin('login1')); - $this->dao->createRecoveryCodesForLogin('login1'); - - $codes1 = $this->dao->getAllRecoveryCodesForLogin('login1'); - $this->assertCount(10, $codes1); - - // generating new codes will remove the old codes - $this->dao->createRecoveryCodesForLogin('login1'); - - $codes2 = $this->dao->getAllRecoveryCodesForLogin('login1'); - $this->assertCount(10, $codes2); - - // not the same - $this->assertCount(10, array_diff($codes1, $codes2)); - foreach ($codes1 as $code) { - // none of the old codes can be used - $this->assertFalse($this->dao->useRecoveryCode('login1', $code)); - } - foreach ($codes2 as $code) { - // all new codes can be used - $this->assertTrue($this->dao->useRecoveryCode('login1', $code)); - } - } - - public function testCreateRecoveryCodesForLoginDifferentPerLogin() - { - $this->dao->createRecoveryCodesForLogin('login1'); - $this->dao->createRecoveryCodesForLogin('login2'); - - $codes1 = $this->dao->getAllRecoveryCodesForLogin('login1'); - $codes2 = $this->dao->getAllRecoveryCodesForLogin('login2'); - - // not the same - $this->assertCount(10, array_diff($codes1, $codes2)); - - foreach ($codes1 as $code) { - // all new codes can be used - $this->assertTrue($this->dao->useRecoveryCode('login1', $code)); - } - foreach ($codes2 as $code) { - // all new codes can be used - $this->assertTrue($this->dao->useRecoveryCode('login2', $code)); - } - } - - private function insertManyCodesDifferentLogins() - { - $this->dao->insertRecoveryCode('login1', '123456'); - $this->dao->insertRecoveryCode('login1', '654321'); - $this->dao->insertRecoveryCode('login2', '123456'); - $this->dao->insertRecoveryCode('login2', '654321'); - } -} diff --git a/plugins/TwoFactorAuth/tests/Integration/Dao/RecoveryCodeRandomGeneratorTest.php b/plugins/TwoFactorAuth/tests/Integration/Dao/RecoveryCodeRandomGeneratorTest.php deleted file mode 100644 index e5e65fadc9f73aaecf1a82c84c41f2c70badd1fe..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Integration/Dao/RecoveryCodeRandomGeneratorTest.php +++ /dev/null @@ -1,43 +0,0 @@ -generator = new RecoveryCodeRandomGenerator(); - } - - public function testGeneratorCodeLength() - { - $this->assertSame(16, mb_strlen($this->generator->generateCode())); - } - - public function testGeneratorCodeAlwaysDifferent() - { - $this->assertNotEquals($this->generator->generateCode(), $this->generator->generateCode()); - } -} diff --git a/plugins/TwoFactorAuth/tests/Integration/Dao/RecoveryCodeStaticGeneratorTest.php b/plugins/TwoFactorAuth/tests/Integration/Dao/RecoveryCodeStaticGeneratorTest.php deleted file mode 100644 index 93cb2e8a7bcff770294289680788c6f6dbb2a24b..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Integration/Dao/RecoveryCodeStaticGeneratorTest.php +++ /dev/null @@ -1,49 +0,0 @@ -generator = new RecoveryCodeStaticGenerator(); - } - - public function testGeneratorCodeLength() - { - $this->assertSame(16, mb_strlen($this->generator->generateCode())); - } - - public function testGeneratorCodeAlwaysDifferent() - { - $this->assertNotEquals($this->generator->generateCode(), $this->generator->generateCode()); - } - - public function testGeneratorCodeIncreases() - { - $this->assertSame('1100000000000000', $this->generator->generateCode()); - $this->assertSame('1200000000000000', $this->generator->generateCode()); - } -} diff --git a/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretRandomGeneratorTest.php b/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretRandomGeneratorTest.php deleted file mode 100644 index 17f59ab07702b9c6ab20bcb7593a68a1f1fefda6..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretRandomGeneratorTest.php +++ /dev/null @@ -1,43 +0,0 @@ -generator = new TwoFaSecretRandomGenerator(); - } - - public function testGeneratorCodeLength() - { - $this->assertSame(16, mb_strlen($this->generator->generateSecret())); - } - - public function testGeneratorCodeAlwaysDifferent() - { - $this->assertNotEquals($this->generator->generateSecret(), $this->generator->generateSecret()); - } -} diff --git a/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretStaticGeneratorTest.php b/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretStaticGeneratorTest.php deleted file mode 100644 index b44fe80f8f8b331bce6267abc45cbf49809067f7..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretStaticGeneratorTest.php +++ /dev/null @@ -1,43 +0,0 @@ -generator = new TwoFaSecretStaticGenerator(); - } - - public function testGeneratorCodeAlwaysSame() - { - $this->assertSame($this->generator->generateSecret(), $this->generator->generateSecret()); - } - - public function testGeneratorCodeIncreases() - { - $this->assertSame('1111111111111111', $this->generator->generateSecret()); - } -} diff --git a/plugins/TwoFactorAuth/tests/Integration/SystemSettingsTest.php b/plugins/TwoFactorAuth/tests/Integration/SystemSettingsTest.php deleted file mode 100644 index 9449c0a5294de7eca432de003c06bee747a10760..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Integration/SystemSettingsTest.php +++ /dev/null @@ -1,44 +0,0 @@ -settings = new SystemSettings(); - } - - public function testTwoFactorAuthRequiredDefaultDisabled() - { - $this->assertFalse($this->settings->twoFactorAuthRequired->getValue()); - } - - public function testTwoFactorAuthTitleDefaultTitle() - { - $this->assertEquals('Analytics - ' . Url::getCurrentHost(), $this->settings->twoFactorAuthTitle->getValue()); - } -} diff --git a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php deleted file mode 100644 index 6ee85a197497b0f0647a7efcae9a8c55e072020e..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthTest.php +++ /dev/null @@ -1,374 +0,0 @@ -userWith2Fa, $this->userWithout2Fa, $this->otherUserWith2Fa] as $user) { - API::getInstance()->addUser($user, $this->userPassword, $user . '@matomo.org'); - $userUpdater = new UserUpdater(); - $userUpdater->setSuperUserAccessWithoutCurrentPassword($user, 1); - } - - $this->dao = StaticContainer::get(RecoveryCodeDao::class); - $this->settings = new SystemSettings(); - $secretGenerator = new TwoFaSecretRandomGenerator(); - $this->twoFa = new TwoFactorAuthentication($this->settings, $this->dao, $secretGenerator); - - $this->dao->createRecoveryCodesForLogin($this->userWith2Fa); - $this->dao->createRecoveryCodesForLogin($this->otherUserWith2Fa); - $this->twoFa->saveSecret($this->userWith2Fa, $this->user2faSecret); - $this->twoFa->saveSecret($this->otherUserWith2Fa, $this->otherUser2faSecret); - - $this->bruteForceDetection = StaticContainer::get(BruteForceDetection::class); - $this->bruteForceDetection->deleteAll(); - - unset($_GET['authCode']); - } - - public function tearDown(): void - { - $this->bruteForceDetection->deleteAll(); - unset($_GET['authCode'], $_GET['module'], $_GET['action']); - } - - public function testLoginTwoFactorAuthRequiresFreshLoginWhenCurrentUserDoesNotMatchPendingSessionUser() - { - $this->setCurrentUser($this->otherUserWith2Fa); - - $sessionFingerprint = new SessionFingerprint(); - $sessionFingerprint->initialize($this->userWith2Fa, 'pending-session-token'); - - $result = StaticContainer::get(Controller::class)->loginTwoFactorAuth(); - - $this->assertStringContainsString('form_login', $result); - $this->assertNull($sessionFingerprint->getUser()); - $this->assertTrue(Access::getInstance()->wasSessionExpired()); - } - - public function testLoginTwoFactorAuthRendersForPendingSessionUser() - { - $this->setCurrentUser($this->userWith2Fa); - - $sessionFingerprint = new SessionFingerprint(); - $sessionFingerprint->initialize($this->userWith2Fa, 'pending-session-token'); - - $result = StaticContainer::get(Controller::class)->loginTwoFactorAuth(); - $this->assertStringContainsString('form_authcode', $result); - } - - public function testOnRequestDispatchRequiresFreshLoginWhenDifferentUserIsAuthenticatedDuringPendingSession() - { - $this->setCurrentUser($this->otherUserWith2Fa); - $sessionFingerprint = new SessionFingerprint(); - $sessionFingerprint->initialize($this->userWith2Fa, 'pending-session-token'); - - $module = 'UsersManager'; - $action = 'index'; - $parameters = []; - - $plugin = new TwoFactorAuth(); - $plugin->onRequestDispatch($module, $action, $parameters); - - $this->assertSame(\Piwik\Piwik::getLoginPluginName(), $module); - $this->assertSame('login', $action); - $this->assertNull($sessionFingerprint->getUser()); - $this->assertTrue(Access::getInstance()->wasSessionExpired()); - } - - public function testValidatorDetectsPendingSessionUserMismatch() - { - $this->setCurrentUser($this->otherUserWith2Fa); - $sessionFingerprint = new SessionFingerprint(); - $sessionFingerprint->initialize($this->userWith2Fa, 'pending-session-token'); - - $validator = StaticContainer::get(Validator::class); - - $this->assertTrue($validator->hasPendingSessionTwoFactorAuthentication()); - $this->assertFalse($validator->isCurrentUserMatchingSessionUser()); - } - - public function testValidatorIgnoresUnverifiedSessionForUserWithoutTwoFactorAuthentication() - { - $this->setCurrentUser($this->otherUserWith2Fa); - $sessionFingerprint = new SessionFingerprint(); - $sessionFingerprint->initialize($this->userWithout2Fa, 'plain-session-token'); - - $validator = StaticContainer::get(Validator::class); - - $this->assertFalse($validator->hasPendingSessionTwoFactorAuthentication()); - $this->assertFalse($validator->isCurrentUserMatchingSessionUser()); - } - - public function testOnCreateAppSpecificTokenAuthCanAuthenticateWhenUserNotUsesTwoFA() - { - $token = Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWithout2Fa, - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - $this->assertEquals(32, strlen($token)); - } - - public function testOnCreateAppSpecificTokenAuthFailsWhenNotAuthenticatedEvenWhen2FAenabled() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('UsersManager_CurrentPasswordNotCorrect'); - - Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWith2Fa, - 'passwordConfirmation' => 'invalidPAssword', - 'description' => 'twofa test', - )); - } - - public function testOnCreateAppSpecificTokenAuthThrowsErrorWhenMissingTokenWhenUsing2FaAndAuthenticatedCorrectly() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('TwoFactorAuth_MissingAuthCodeAPI'); - - Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - - 'userLogin' => $this->userWith2Fa, - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - } - - public function testOnCreateAppSpecificTokenAuthThrowsErrorWhenInvalidTokenWhenUsing2FaAndAuthenticatedCorrectly() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('TwoFactorAuth_InvalidAuthCode'); - - $_GET['authCode'] = '111222'; - Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWith2Fa, - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - } - - public function testOnCreateAppSpecificTokenAuthThrowsErrorWhenMissingTokenWhenUsing2FaAndAuthenticatedCorrectlyUsingEmail() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('TwoFactorAuth_MissingAuthCodeAPI'); - - Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWith2Fa . '@matomo.org', - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - } - - public function testOnCreateAppSpecificTokenAuthThrowsErrorWhenInvalidTokenWhenUsing2FaAndAuthenticatedCorrectlyUsingEmail() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('TwoFactorAuth_InvalidAuthCode'); - - $_GET['authCode'] = '111222'; - Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWith2Fa . '@matomo.org', - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - } - - public function testOnCreateAppSpecificTokenAuthRecordsFailedAttemptWhenInvalidAuthCode() - { - $this->assertCount(0, $this->bruteForceDetection->getAll()); - - $_GET['authCode'] = '111222'; - try { - Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWith2Fa, - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - $this->fail('Expected an exception to be thrown for the invalid auth code'); - } catch (\Exception $e) { - $this->assertStringContainsString('TwoFactorAuth_InvalidAuthCode', $e->getMessage()); - } - - $attempts = $this->bruteForceDetection->getAll(); - $this->assertCount(1, $attempts); - $this->assertSame($this->userWith2Fa, $attempts[0]['login']); - } - - public function testOnCreateAppSpecificTokenAuthRecordsFailedAttemptWhenMissingAuthCode() - { - $this->assertCount(0, $this->bruteForceDetection->getAll()); - - try { - Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWith2Fa, - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - $this->fail('Expected an exception to be thrown for the missing auth code'); - } catch (\Exception $e) { - $this->assertStringContainsString('TwoFactorAuth_MissingAuthCodeAPI', $e->getMessage()); - } - - $attempts = $this->bruteForceDetection->getAll(); - $this->assertCount(1, $attempts); - $this->assertSame($this->userWith2Fa, $attempts[0]['login']); - } - - public function testOnCreateAppSpecificTokenAuthDoesNotRecordFailedAttemptWhenAuthCodeIsValid() - { - $_GET['authCode'] = $this->generateValidAuthCode($this->user2faSecret); - $token = Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWith2Fa, - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - - $this->assertEquals(32, strlen($token)); - $this->assertCount(0, $this->bruteForceDetection->getAll()); - } - - public function testOnCreateAppSpecificTokenAuthReturnsCorrectTokenWhenProvidingCorrectAuthTokenOnAuthenticationUsingEmail() - { - $_GET['authCode'] = $this->generateValidAuthCode($this->user2faSecret); - $token = Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWith2Fa . '@matomo.org', - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - $this->assertEquals(32, strlen($token)); - } - - public function testOnCreateAppSpecificTokenAuthReturnsCorrectTokenWhenProvidingCorrectAuthTokenOnAuthentication() - { - $_GET['authCode'] = $this->generateValidAuthCode($this->user2faSecret); - $token = Request::processRequest('UsersManager.createAppSpecificTokenAuth', array( - 'userLogin' => $this->userWith2Fa, - 'passwordConfirmation' => $this->userPassword, - 'description' => 'twofa test', - )); - $this->assertEquals(32, strlen($token)); - } - - public function testOnSuccessfulSessionRecordsFailedAttemptWhenInvalidAuthCodeDuringLogme() - { - $_GET['module'] = 'Login'; - $_GET['action'] = 'logme'; - $_GET['authCode'] = '111222'; - - $this->assertCount(0, $this->bruteForceDetection->getAll()); - - $plugin = new TwoFactorAuth(); - $plugin->onSuccessfulSession($this->userWith2Fa); - - $attempts = $this->bruteForceDetection->getAll(); - $this->assertCount(1, $attempts); - $this->assertSame($this->userWith2Fa, $attempts[0]['login']); - } - - public function testOnSuccessfulSessionDoesNotRecordFailedAttemptWhenNoAuthCodeDuringLogme() - { - $_GET['module'] = 'Login'; - $_GET['action'] = 'logme'; - - $plugin = new TwoFactorAuth(); - $plugin->onSuccessfulSession($this->userWith2Fa); - - $this->assertCount(0, $this->bruteForceDetection->getAll()); - } - - public function testOnDeleteUserRemovesAllRecoveryCodesWhenUsingTwoFa() - { - $this->assertNotEmpty($this->dao->getAllRecoveryCodesForLogin($this->userWith2Fa)); - Request::processRequest('UsersManager.deleteUser', array( - 'userLogin' => $this->userWith2Fa, - )); - $this->assertEmpty($this->dao->getAllRecoveryCodesForLogin($this->userWith2Fa)); - } - - public function testOnDeleteUserDoesNotFailToDeleteUserNotUsingTwoFa() - { - $this->expectNotToPerformAssertions(); - Request::processRequest('UsersManager.deleteUser', array( - 'userLogin' => $this->userWithout2Fa, - )); - } - - private function generateValidAuthCode($secret) - { - $code = new \TwoFactorAuthenticator(); - return $code->getCode($secret); - } - - private function setCurrentUser(string $login): void - { - $auth = $this->getMockBuilder(Auth::class) - ->onlyMethods(['getName', 'setTokenAuth', 'getTokenAuthSecret', 'getLogin', 'setLogin', 'setPassword', 'setPasswordHash', 'authenticate']) - ->getMock(); - $auth->method('authenticate') - ->willReturn(new AuthResult(AuthResult::SUCCESS, $login, $login . '-token')); - - Access::getInstance()->setSuperUserAccess(false); - Access::getInstance()->reloadAccess($auth); - } -} diff --git a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php deleted file mode 100644 index 84bc161750a480b9111de15bf8e632a9510347ab..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php +++ /dev/null @@ -1,280 +0,0 @@ -addUser($user, '123abcDk3_l3', $user . '@matomo.org'); - } - - $this->dao = StaticContainer::get(RecoveryCodeDao::class); - $this->settings = new SystemSettings(); - $secretGenerator = new TwoFaSecretRandomGenerator(); - $this->twoFa = new TwoFactorAuthentication($this->settings, $this->dao, $secretGenerator); - } - - public function testGenerateSecret() - { - $this->assertSame(16, mb_strlen($this->twoFa->generateSecret())); - } - - public function testIsUserRequiredToHaveTwoFactorEnabledNotByDefault() - { - $this->assertFalse($this->twoFa->isUserRequiredToHaveTwoFactorEnabled()); - } - - public function testIsUserRequiredToHaveTwoFactorEnabled() - { - $this->settings->twoFactorAuthRequired->setValue(1); - $this->assertTrue($this->twoFa->isUserRequiredToHaveTwoFactorEnabled()); - } - - public function testSaveSecretDisable2FAforUserIsUserUsingTwoFactorAuthentication() - { - $this->dao->createRecoveryCodesForLogin('mylogin'); - - $this->assertFalse(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin')); - $this->twoFa->saveSecret('mylogin', '123456'); - - $this->assertTrue(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin')); - $this->assertFalse(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin2')); - - $this->twoFa->disable2FAforUser('mylogin'); - - $this->assertFalse(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('mylogin')); - } - - public function testDisable2FAforUserRemovesAllRecoveryCodes() - { - $this->dao->createRecoveryCodesForLogin('mylogin'); - $this->assertNotEmpty($this->dao->getAllRecoveryCodesForLogin('mylogin')); - $this->twoFa->disable2FAforUser('mylogin'); - $this->assertEquals([], $this->dao->getAllRecoveryCodesForLogin('mylogin')); - } - - public function testSaveSecretNeverWorksForAnonymous() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('Anonymous cannot use'); - - $this->twoFa->saveSecret('anonymous', '123456'); - } - - public function testSaveSecretNotWorksWhenNoRecoveryCodesCreated() - { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('no recovery codes have been created'); - - $this->twoFa->saveSecret('not', '123456'); - } - - public function testIsUserUsingTwoFactorAuthenticationNeverWorksForAnonymous() - { - $this->assertFalse(TwoFactorAuthentication::isUserUsingTwoFactorAuthentication('anonymous')); - } - - public function testValidateAuthCodeDuringSetup() - { - $secret = '789123'; - $this->assertFalse($this->twoFa->validateAuthCodeDuringSetup('123456', $secret)); - - $authCode = $this->generateValidAuthCode($secret); - - $this->assertTrue($this->twoFa->validateAuthCodeDuringSetup($authCode, $secret)); - } - - public function testValidateAuthCodeUserIsNotUsingTwoFa() - { - $this->assertFalse($this->twoFa->validateAuthCode('mylogin', '123456')); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin', false)); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin', null)); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin', '')); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin', 0)); - } - - public function testValidateAuthCodeUserIsUsingTwoFaAuthenticatesThroughApp() - { - $secret1 = '123456'; - $secret2 = '654321'; - $this->dao->createRecoveryCodesForLogin('mylogin1'); - $this->dao->createRecoveryCodesForLogin('mylogin2'); - $this->twoFa->saveSecret('mylogin1', $secret1); - $this->twoFa->saveSecret('mylogin2', $secret2); - - $authCode1 = $this->generateValidAuthCode($secret1); - $authCode2 = $this->generateValidAuthCode($secret2); - - $this->assertTrue($this->twoFa->validateAuthCode('mylogin1', $authCode1)); - $this->assertTrue($this->twoFa->validateAuthCode('mylogin2', $authCode2)); - - $this->assertFalse($this->twoFa->validateAuthCode('mylogin2', $authCode1)); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin1', $authCode2)); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin1', false)); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin2', null)); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin2', '')); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin1', 0)); - } - - public function testValidateAuthCodeUserIsUsingTwoFaSameCodeCannotBeUsedTwice() - { - $secret1 = '654321'; - $secret2 = '654321'; - $this->dao->createRecoveryCodesForLogin('mylogin1'); - $this->dao->createRecoveryCodesForLogin('mylogin2'); - $this->twoFa->saveSecret('mylogin1', $secret1); - $this->twoFa->saveSecret('mylogin2', $secret2); - - $authCode1 = $this->generateValidAuthCode($secret1); - $authCode2 = $this->generateValidAuthCode($secret2); - - $options = Option::getLike(TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . '%'); - $this->assertEquals(array(), $options); // no token used yet - - $this->assertTrue($this->twoFa->validateAuthCode('mylogin2', $authCode2)); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin2', $authCode2)); - - // can be used by different user though - $this->assertTrue($this->twoFa->validateAuthCode('mylogin1', $authCode1)); - $this->assertFalse($this->twoFa->validateAuthCode('mylogin1', $authCode1)); - - $options = Option::getLike(TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . '%'); - $this->assertCount(2, $options); - } - - public function testValidateAuthCodeUserIsUsingTwoFaStaleRecordCanBeUsedAgainAndRefreshesTimestamp() - { - $secret = '654321'; - $this->dao->createRecoveryCodesForLogin('mylogin1'); - $this->twoFa->saveSecret('mylogin1', $secret); - - $authCode = $this->generateValidAuthCode($secret); - $optionKey = $this->getTwoFaCodeUsedOptionKey('mylogin1', $authCode); - Option::set($optionKey, time() - $this->getTwoFaCodeWindowInSeconds() - 10); - - $this->assertTrue($this->twoFa->validateAuthCode('mylogin1', $authCode)); - - $storedTime = (int) Option::get($optionKey); - $this->assertGreaterThanOrEqual(time() - 2, $storedTime); - - // record was refreshed, so immediate reuse is blocked again - $this->assertFalse($this->twoFa->validateAuthCode('mylogin1', $authCode)); - } - - public function testValidateAuthCodeUserIsUsingTwoFaStaleRecordDoesNotRequireCleanup() - { - $secret = '654321'; - $this->dao->createRecoveryCodesForLogin('mylogin1'); - $this->twoFa->saveSecret('mylogin1', $secret); - - $authCode = $this->generateValidAuthCode($secret); - $optionKey = $this->getTwoFaCodeUsedOptionKey('mylogin1', $authCode); - Option::set($optionKey, time() - $this->getTwoFaCodeWindowInSeconds() - 300); - - $this->assertTrue($this->twoFa->validateAuthCode('mylogin1', $authCode)); - } - - public function testValidateAuthCodeUserIsUsingTwoFaAuthenticatesThroughRecoveryCode() - { - $this->dao->createRecoveryCodesForLogin('mylogin1'); - $this->dao->createRecoveryCodesForLogin('mylogin2'); - $this->twoFa->saveSecret('mylogin1', '123456'); - $this->twoFa->saveSecret('mylogin2', '654321'); - - $codesLogin1 = $this->dao->getAllRecoveryCodesForLogin('mylogin1'); - $codesLogin2 = $this->dao->getAllRecoveryCodesForLogin('mylogin2'); - $this->assertNotEmpty($codesLogin1); - $this->assertNotEmpty($codesLogin2); - - foreach ($codesLogin1 as $code) { - // doesn't work cause belong to different user - $this->assertFalse($this->twoFa->validateAuthCode('mylogin2', $code)); - } - - foreach ($codesLogin1 as $code) { - $this->assertTrue($this->twoFa->validateAuthCode('mylogin1', $code)); - } - - foreach ($codesLogin1 as $code) { - // no code can be used twice - $this->assertFalse($this->twoFa->validateAuthCode('mylogin1', $code)); - } - } - - public function testCleanupTwoFaCodesUsedRecently() - { - $this->twoFa->cleanupTwoFaCodesUsedRecently(); - - Option::set(TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . 'test1', time()); - Option::set(TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . 'test2', time() - 100); - - // those two should be deleted because they were used more than 10min ago - Option::set(TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . 'test3', time() - 1000); - Option::set(TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . 'test4', time() - 5000); - - $options = Option::getLike(TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . '%'); - $this->assertCount(4, $options); - - $this->twoFa->cleanupTwoFaCodesUsedRecently(); - - $options = Option::getLike(TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . '%'); - $this->assertEquals(['twofa_codes_used_test1', 'twofa_codes_used_test2'], array_keys($options)); - } - - private function generateValidAuthCode($secret) - { - $code = new \TwoFactorAuthenticator(); - return $code->getCode($secret); - } - - private function getTwoFaCodeUsedOptionKey($login, $authCode) - { - return TwoFactorAuthentication::OPTION_PREFIX_TWO_FA_CODE_USED . md5($login . $authCode . SettingsPiwik::getSalt()); - } - - private function getTwoFaCodeWindowInSeconds() - { - return 60 * TwoFactorAuthentication::BLOCK_TWOFA_CODE_MINUTES; - } -} diff --git a/plugins/TwoFactorAuth/tests/System/TwoFactorAuthTest.php b/plugins/TwoFactorAuth/tests/System/TwoFactorAuthTest.php deleted file mode 100644 index e6ffed4e4714afdf328d749a9907d9f8d3386327..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/System/TwoFactorAuthTest.php +++ /dev/null @@ -1,80 +0,0 @@ -dao = StaticContainer::get(RecoveryCodeDao::class); - $this->settings = new SystemSettings(); - $secretGenerator = new TwoFaSecretRandomGenerator(); - $this->twoFa = new TwoFactorAuthentication($this->settings, $this->dao, $secretGenerator); - - self::$fixture->loginAsSuperUser(); - } - - public function testOnRequestDispatchEndNotRequired() - { - $this->settings->twoFactorAuthRequired->setValue(true); - $html = '' . Piwik::getCurrentUserTokenAuth() . ''; - $expected = '' . Piwik::getCurrentUserTokenAuth() . ''; - Piwik::postEvent('Request.dispatch.end', array(&$html, 'module', 'action', array())); - $this->assertSame($expected, $html); - } - - public static function getOutputPrefix() - { - return ''; - } - - public static function getPathToTestDirectory() - { - return dirname(__FILE__); - } -} - -TwoFactorAuthTest::$fixture = new SimpleFixtureTrackFewVisits(); diff --git a/plugins/TwoFactorAuth/tests/UI/.gitignore b/plugins/TwoFactorAuth/tests/UI/.gitignore deleted file mode 100644 index f39be478e7a412cafbcc27f53a9875baaa92b664..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/UI/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/processed-ui-screenshots -/screenshot-diffs \ No newline at end of file diff --git a/plugins/TwoFactorAuth/tests/UI/TwoFactorAuthUsersManager_spec.js b/plugins/TwoFactorAuth/tests/UI/TwoFactorAuthUsersManager_spec.js deleted file mode 100644 index a5fd0077d7051f20654b1de68b7f3fba3c8ef392..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/UI/TwoFactorAuthUsersManager_spec.js +++ /dev/null @@ -1,58 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * Screenshot integration tests. - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -describe("TwoFactorAuthUsersManager", function () { - this.fixture = "Piwik\\Plugins\\TwoFactorAuth\\tests\\Fixtures\\TwoFactorUsersManagerFixture"; - - var generalParams = 'idSite=1&period=day&date=2010-01-03', - usersManager = '?module=UsersManager&action=index&' + generalParams; - - before(function () { - testEnvironment.pluginsToLoad = ['TwoFactorAuth']; - testEnvironment.save(); - }); - - it('shows users with 2fa and not 2fa', async function () { - await page.goto(usersManager); - await page.evaluate(function () { - $('td#last_seen').html(''); // fix random test failure - }); - expect(await page.screenshotSelector('#content,#notificationContainer')).to.matchImage('list'); - }); - - it('menu should show 2fa tab', async function () { - await page.webpage.setViewport({ - width: 1250, - height: 768 - }); - await page.click('#manageUsersTable #row2 .edituser'); - await page.evaluate(function () { - $('.userEditForm .menuUserTwoFa a').click(); - }); - await page.waitForTimeout(250); - await page.waitForSelector('.twofa-reset > p', { visible: true }); - expect(await page.screenshotSelector('#content,#notificationContainer')).to.matchImage('edit_with_2fa'); - }); - - it('should ask for confirmation before resetting 2fa', async function () { - await page.click('.userEditForm .twofa-reset .resetTwoFa .btn'); - const modal = await page.waitForSelector('.modal.open', { visible: true }); - await page.waitForTimeout(1000); // animation - expect(await modal.screenshot()).to.matchImage('edit_with_2fa_reset_confirm'); - }); - - it('should be possible to confirm the reset', async function () { - await page.type('.confirm-password-modal input[name=currentUserPassword]', superUserPassword); - await (await page.jQuery('.confirm-password-modal .modal-close:not(.modal-no):visible')).click(); - await page.waitForNetworkIdle(); - await page.waitForTimeout(100); // wait for modal to close - expect(await page.screenshotSelector('#content,#notificationContainer')).to.matchImage('edit_with_2fa_reset_confirmed'); - }); - -}); diff --git a/plugins/TwoFactorAuth/tests/UI/TwoFactorAuth_spec.js b/plugins/TwoFactorAuth/tests/UI/TwoFactorAuth_spec.js deleted file mode 100644 index e9381332751b5bb2e1f69bddafd7aef81d70c3c2..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/tests/UI/TwoFactorAuth_spec.js +++ /dev/null @@ -1,349 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * Screenshot integration tests. - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -describe("TwoFactorAuth", function () { - this.fixture = "Piwik\\Plugins\\TwoFactorAuth\\tests\\Fixtures\\TwoFactorFixture"; - - var generalParams = 'idSite=1&period=day&date=2010-01-03', - userSettings = '?module=UsersManager&action=userSecurity&' + generalParams, - logoutUrl = '?module=Login&action=logout&period=day&date=yesterday'; - - - async function selectModalButton(button) - { - await (await page.jQuery('.modal.open .modal-footer a:contains('+button+')')).click(); - await page.waitForNetworkIdle(); - await page.waitForTimeout(250); - await page.waitForNetworkIdle(); - } - - async function loginUser(username, doAuth) - { - testEnvironment.overrideConfig('General', 'login_allow_logme', '1') - await testEnvironment.save(); - - await page.goto('about:blank'); - - // make sure to log out previous session - await page.goto(logoutUrl); - await page.waitForNetworkIdle(); - await page.waitForSelector('.loginSection', {visible: true}); - - await page.clearCookies(); - - if (typeof doAuth === 'undefined') { - doAuth = true; - } - var logMeUrl = '?module=Login&action=logme&login=' + username + '&password=240161a241087c28d92d8d7ff3b6186b'; - - // avoid loading dashboard after login as it takes long - logMeUrl += '&url=' + encodeURIComponent('index.php?category=General_Visitors&subcategory=Live_VisitorLog&' + generalParams); - - if (doAuth) { - logMeUrl += '&authCode=123456'; // we make sure in test config this code always works - } - await page.goto(logMeUrl); - await page.waitForNetworkIdle(); - await page.waitForTimeout(100); - await page.waitForNetworkIdle(); - - await page.webpage.setViewport({ - width: 1350, - height: 768, - }); - } - - async function requireTwoFa() { - testEnvironment.requireTwoFa = 1; - await testEnvironment.save(); - } - - async function fakeCorrectAuthCode() { - testEnvironment.fakeCorrectAuthCode = 1; - await testEnvironment.save(); - } - - before(async function () { - testEnvironment.pluginsToLoad = ['TwoFactorAuth']; - testEnvironment.queryParamOverride = { date: '2018-03-04' }; - await testEnvironment.save(); - }); - - beforeEach(async function () { - testEnvironment.testUseMockAuth = 0; - testEnvironment.restoreRecoveryCodes = 1; - testEnvironment.configOverride = { Development: { disable_merged_assets: 1 }}; - await testEnvironment.save(); - }); - - afterEach(async function () { - delete testEnvironment.requireTwoFa; - delete testEnvironment.restoreRecoveryCodes; - delete testEnvironment.fakeCorrectAuthCode; - delete testEnvironment.configOverride; - testEnvironment.testUseMockAuth = 1; - await testEnvironment.save(); - }); - - async function confirmPassword() - { - await page.waitForSelector('.confirmPasswordForm'); - await page.waitForNetworkIdle(); - await page.type('.confirmPasswordForm #login_form_password', '123abcDk3_l3'); - await page.click('.confirmPasswordForm #login_form_submit'); - await page.waitForNetworkIdle(); - await page.waitForTimeout(100); - await page.waitForNetworkIdle(); - } - - it('a user with 2fa can open the widgetized view by token without needing to verify', async function () { - await page.goto('?module=Widgetize&action=iframe&moduleToWidgetize=Actions&actionToWidgetize=getPageUrls&date=2018-03-04&token_auth=a4ca4238a0b923820dcc509a6f75849b&' + generalParams); - - // check if widget element is present, if login wouldn't work the login screen would be shown instead - const widgetsCount = await page.evaluate(() => $('.widget').length); - expect(widgetsCount).to.equal(1); - }); - - it('when logging in through logme and not providing auth code it should show auth code screen', async function () { - await loginUser('with2FA', false); - const section = await page.waitForSelector('.loginSection'); - expect(await section.screenshot()).to.matchImage('logme_not_verified'); - }); - - it('when logging in and providing wrong code an error is shown', async function () { - await page.type('.loginTwoFaForm #form_authcode', '555555'); - await page.evaluate(function(){ - document.querySelector('.loginTwoFaForm #login_form_submit').click(); - }); - await page.waitForNetworkIdle(); - const element = await page.waitForSelector('.loginSection'); - expect(await element.screenshot()).to.matchImage('logme_not_verified_wrong_code'); - }); - - it('when logging in through logme and verifying screen it works to access ui', async function () { - testEnvironment.overrideConfig('General', 'login_allow_logme', '1') - await testEnvironment.save(); - - await page.type('.loginTwoFaForm #form_authcode', '123456'); - await page.click('.loginTwoFaForm #login_form_submit'); - await page.waitForNetworkIdle(); - await page.waitForSelector('.widget', { timeout: 60000 }); - await page.waitForNetworkIdle(); - - // do not take a screenshot, as it's not relevant. We only check if there is the right amount of widgets loaded - const widgetsCount = await page.evaluate(() => $('.widget').length); - expect(widgetsCount).to.equal(9); - }); - - it('should show user settings when two-fa enabled', async function () { - await loginUser('with2FA'); - await page.goto(userSettings); - await page.waitForSelector('.userSettings2FA', { visible: true, timeout: 0 }); - await page.waitForTimeout(1000); // animation - const elem = await page.$('.userSettings2FA'); - expect(await elem.screenshot()).to.matchImage('usersettings_twofa_enabled'); - }); - - it('should be possible to show recovery codes step1 authentication', async function () { - await page.click('.showRecoveryCodesLink'); - const element = await page.waitForSelector('.loginSection', {visible: true}); - await page.waitForTimeout(200); - expect(await element.screenshot()).to.matchImage('show_recovery_codes_step1'); - }); - - it('should be possible to show recovery codes step2 done', async function () { - await confirmPassword(); - expect(await page.screenshotSelector('#content')).to.matchImage('show_recovery_codes_step2'); - }); - - it('should show user settings when two-fa enabled', async function () { - await requireTwoFa(); - await page.goto(userSettings); - await page.waitForSelector('.userSettings2FA', {visible: true}); - await page.waitForTimeout(200); - expect(await page.screenshotSelector('.userSettings2FA')).to.matchImage('usersettings_twofa_enabled_required'); - }); - - it('should be possible to disable two factor', async function () { - await loginUser('with2FADisable'); - await page.goto(userSettings); - await page.waitForSelector('.disable2FaLink', { timeout: 60000 }); - await page.waitForTimeout(100); - await page.waitForNetworkIdle(); - await page.click('.disable2FaLink'); - - const modal = await page.$('.modal.open'); - await page.waitForTimeout(500); // animation - expect(await modal.screenshot()).to.matchImage('usersettings_twofa_disable_step1'); - }); - - it('should be possible to disable two factor step 2 confirmed', async function () { - await selectModalButton('Yes'); - - const element = await page.waitForSelector('.loginSection', {visible: true}); - await page.waitForTimeout(150); - expect(await element.screenshot()).to.matchImage('usersettings_twofa_disable_step2'); - }); - - it('should be possible to disable two factor step 3 verified', async function () { - await confirmPassword(); - await page.waitForSelector('.userSettings2FA'); - const elem = await page.$('.userSettings2FA'); - expect(await elem.screenshot()).to.matchImage('usersettings_twofa_disable_step3'); - }); - - it('should show setup screen - step 1', async function () { - await loginUser('without2FA'); - await page.goto(userSettings); - await page.waitForTimeout(100); - await page.waitForNetworkIdle(); - await page.click('.enable2FaLink'); - await confirmPassword(); - await page.waitForSelector('.setupTwoFactorAuthentication'); - const element = await page.$('#content'); - expect(await element.screenshot()).to.matchImage('twofa_setup_step1'); - }); - - it('should move to second step in setup - step 2', async function () { - await page.evaluate(function(){ - $('.setupTwoFactorAuthentication .backupRecoveryCode:first').click(); - }); - await page.waitForNetworkIdle(); - await page.click('.setupTwoFactorAuthentication .goToStep2'); - await page.waitForNetworkIdle(); - await page.waitForTimeout(500); - - const element = await page.$('#content'); - expect(await element.screenshot()).to.matchImage('twofa_setup_step2'); - }); - - it('should open the OTP codes in modal', async function () { - await page.waitForTimeout(250); - await page.click('.setupTwoFactorAuthentication .showOtpCodes'); - await page.waitForSelector('.modal.open', {visible: true}); - await page.waitForTimeout(500); - - // replace QR with an image - await page.evaluate(function () { - const qrCodeImg = $('#qrcode img'); - qrCodeImg.attr('src', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII'); - qrCodeImg.attr('width', 200); - qrCodeImg.attr('height', 200); - }); - - await page.evaluate(() => $('.modal.open').css('max-height', '90%').css('top', '5%')); - const modal = await page.waitForSelector('.modal.open', { visible: true }); - expect(await modal.screenshot()).to.matchImage('twofa_setup_step2_showcodes'); - }); - - it('should show the manual OTP code in modal', async function () { - const codeLength = await page.evaluate(() => { - return $('.modal.open .text-code pre').text().length; - }); - - expect(codeLength).to.equal(16); - }); - - it('should not show step 3 if OTP codes modal just closed', async function () { - await selectModalButton('Cancel'); - await page.waitForTimeout(500); - - const element = await page.$('#content'); - expect(await element.screenshot()).to.matchImage('twofa_setup_step2'); - }); - - it('should move to third step in setup - step 3', async function () { - await page.waitForTimeout(250); - await page.click('.setupTwoFactorAuthentication .showOtpCodes'); - await page.waitForSelector('.modal.open', {visible: true}); - - await selectModalButton('Continue'); - await page.waitForTimeout(250); - - const element = await page.$('#content'); - expect(await element.screenshot()).to.matchImage('twofa_setup_step3'); - }); - - it('should move to third step in setup - step 4 confirm', async function () { - await fakeCorrectAuthCode(); - await page.type('.setupConfirmAuthCodeForm input[type=text]', '123458'); - await page.evaluate(function () { - $('.setupConfirmAuthCodeForm input[type=text]').change(); - }); - await page.evaluate(function () { - $('.setupConfirmAuthCodeForm .confirmAuthCode').click(); - }); - await page.waitForNetworkIdle(); - await page.waitForSelector('#content', { visible: true, timeout: 60000 }); - await page.waitForNetworkIdle(); - const element = await page.$('#content'); - expect(await element.screenshot()).to.matchImage('twofa_setup_step4'); - }); - - it('should force user to setup 2fa when not set up yet but enforced', async function () { - await requireTwoFa(); - await loginUser('no2FA', false, true); - expect(await page.screenshotSelector('.loginSection,#content,#notificationContainer')).to.matchImage('twofa_forced_step1'); - }); - - it('should force user to setup 2fa when not set up yet but enforced step 2', async function () { - await (await page.jQuery('.setupTwoFactorAuthentication .backupRecoveryCode:first')).click(); - await page.click('.setupTwoFactorAuthentication .goToStep2'); - await page.waitForTimeout(100); - await page.waitForNetworkIdle(); - await page.mouse.move(-10, -10); - await page.waitForTimeout(100); - expect(await page.screenshotSelector('.loginSection,#content,#notificationContainer')).to.matchImage('twofa_forced_step2'); - }); - - it('should force user to setup 2fa when not set up yet but enforced step 2 show codes', async function () { - await page.click('.setupTwoFactorAuthentication .showOtpCodes'); - await page.waitForTimeout(500); - - // replace QR with an image - await page.evaluate(function () { - const qrCodeImg = $('#qrcode img'); - qrCodeImg.attr('src', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII'); - qrCodeImg.attr('width', 200); - qrCodeImg.attr('height', 200); - }); - - await page.evaluate(() => $('.modal.open').css('max-height', '90%').css('top', '5%')); - const modal = await page.waitForSelector('.modal.open', { visible: true }); - expect(await modal.screenshot()).to.matchImage('twofa_forced_step2_showcodes'); - }); - - it('should force user to setup 2fa when not set up yet but enforced step 3', async function () { - await selectModalButton('Continue'); - await page.waitForTimeout(250); - - await page.mouse.move(-10, -10); - expect(await page.screenshotSelector('.loginSection,#content,#notificationContainer')).to.matchImage('twofa_forced_step3'); - }); - - it('should force user to setup 2fa when not set up yet but enforced confirm code', async function () { - await requireTwoFa(); - await fakeCorrectAuthCode(); - await page.type('.setupConfirmAuthCodeForm input[type=text]', '123458'); - await page.evaluate(function () { - $('.setupConfirmAuthCodeForm input[type=text]').change(); - }); - await page.evaluate(function () { - $('.setupConfirmAuthCodeForm .confirmAuthCode').click(); - }); - await page.waitForNetworkIdle(); - await page.waitForSelector('.widget'); - await page.waitForNetworkIdle(); - - // after setting up forced 2fa, the default page will be loaded (dashboard) - const widgetsCount = await page.evaluate(() => $('.widget').length); - expect(widgetsCount).to.equal(9); - }); - -}); diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/.gitkeep b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa.png deleted file mode 100644 index 2cb4590a10aad4dad39fcd446dd196814c9a3740..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirm.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirm.png deleted file mode 100644 index 48b41c62c8dd9c9460ba48d0e639950ef5f216d3..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirm.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirmed.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirmed.png deleted file mode 100644 index 4e58d9a036c823f0164132c7e27cbad66557097f..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_edit_with_2fa_reset_confirmed.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_list.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_list.png deleted file mode 100644 index cc6bfba52920dd7d594cf811f8bc59036714a85a..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuthUsersManager_list.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_not_verified.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_not_verified.png deleted file mode 100644 index 7994f51c6c0da46d3998284c4b98de5d7f167cf2..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_not_verified.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_not_verified_wrong_code.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_not_verified_wrong_code.png deleted file mode 100644 index d0a16ae5bcfc2115448471e32a41ecf1d6c1eddc..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_logme_not_verified_wrong_code.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_show_recovery_codes_step1.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_show_recovery_codes_step1.png deleted file mode 100644 index ffaed1edfe3c474b6fcebbe0598fb363b65343cf..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_show_recovery_codes_step1.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_show_recovery_codes_step2.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_show_recovery_codes_step2.png deleted file mode 100644 index 99681ee28d2cfd41bbaae31bb11c459397c67b6b..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_show_recovery_codes_step2.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step1.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step1.png deleted file mode 100644 index 11cbb4f7b4285b25347e6407f77c6f365ae3205a..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step1.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step2.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step2.png deleted file mode 100644 index 220b57633443c2a8152d7f47fae754475aa5f898..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step2.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step2_showcodes.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step2_showcodes.png deleted file mode 100644 index daecbfbe5cc2ce58e7774fed960e7477b73c5eab..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step2_showcodes.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step3.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step3.png deleted file mode 100644 index d350929a7645cb3c433a826e8860e67d87f6b112..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_forced_step3.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step1.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step1.png deleted file mode 100644 index f97df7ad30cf4393a6f842122a7f1fdd34dbc5dd..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step1.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step2.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step2.png deleted file mode 100644 index dd93dcd1098946f3bbe258483df84bb8121b293d..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step2.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step2_showcodes.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step2_showcodes.png deleted file mode 100644 index ca6666c35757ea60cf475ab12ba6b9db005a67b2..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step2_showcodes.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step3.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step3.png deleted file mode 100644 index bb803f0ec1d58f956db393f022dbee5891c51c75..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step3.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step4.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step4.png deleted file mode 100644 index e879f43ec4cf5a0e887f57b899413ab274c43541..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_twofa_setup_step4.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_disable_step1.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_disable_step1.png deleted file mode 100644 index 54a95e887bb8d1040526a34b439c837be37bbe8b..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_disable_step1.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_disable_step2.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_disable_step2.png deleted file mode 100644 index ffaed1edfe3c474b6fcebbe0598fb363b65343cf..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_disable_step2.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_disable_step3.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_disable_step3.png deleted file mode 100644 index bf6dacd6bf7054692274d4f5dfd38757f6ed0645..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_disable_step3.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_enabled.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_enabled.png deleted file mode 100644 index 66f8a48d70e0d464aed7425aa9d3b5815a3e10a1..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_enabled.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_enabled_required.png b/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_enabled_required.png deleted file mode 100644 index 8a9581a59126a670388157881d76e9be4041321f..0000000000000000000000000000000000000000 Binary files a/plugins/TwoFactorAuth/tests/UI/expected-screenshots/TwoFactorAuth_usersettings_twofa_enabled_required.png and /dev/null differ diff --git a/plugins/TwoFactorAuth/vue/dist/TwoFactorAuth.umd.js b/plugins/TwoFactorAuth/vue/dist/TwoFactorAuth.umd.js deleted file mode 100644 index 4cea36253b67e463f09bc91d5d92329dd8bb1209..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/dist/TwoFactorAuth.umd.js +++ /dev/null @@ -1,1072 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("CoreHome"), require("Login"), require("vue"), require("CorePluginsAdmin")); - else if(typeof define === 'function' && define.amd) - define(["CoreHome", "Login", , "CorePluginsAdmin"], factory); - else if(typeof exports === 'object') - exports["TwoFactorAuth"] = factory(require("CoreHome"), require("Login"), require("vue"), require("CorePluginsAdmin")); - else - root["TwoFactorAuth"] = factory(root["CoreHome"], root["Login"], root["Vue"], root["CorePluginsAdmin"]); -})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__5b81__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "plugins/TwoFactorAuth/vue/dist/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "fae3"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "19dc": -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__; - -/***/ }), - -/***/ "5b81": -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE__5b81__; - -/***/ }), - -/***/ "8bbf": -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__; - -/***/ }), - -/***/ "a5a2": -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__; - -/***/ }), - -/***/ "fae3": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "ShowRecoveryCodes", function() { return /* reexport */ ShowRecoveryCodes; }); -__webpack_require__.d(__webpack_exports__, "ShowRecoveryCodesPage", function() { return /* reexport */ ShowRecoveryCodesPage; }); -__webpack_require__.d(__webpack_exports__, "SetupTwoFactorAuth", function() { return /* reexport */ SetupTwoFactorAuth; }); -__webpack_require__.d(__webpack_exports__, "LoginTwoFactorAuth", function() { return /* reexport */ LoginTwoFactorAuth; }); -__webpack_require__.d(__webpack_exports__, "SetupFinished", function() { return /* reexport */ SetupFinished; }); -__webpack_require__.d(__webpack_exports__, "UserSettings", function() { return /* reexport */ UserSettings; }); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js -// This file is imported into lib/wc client bundles. - -if (typeof window !== 'undefined') { - var currentScript = window.document.currentScript - if (false) { var getCurrentScript; } - - var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/) - if (src) { - __webpack_require__.p = src[1] // eslint-disable-line - } -} - -// Indicate to webpack that this file can be concatenated -/* harmony default export */ var setPublicPath = (null); - -// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} -var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodes.vue?vue&type=template&id=43bd6978 - -const _hoisted_1 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const _hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const _hoisted_3 = { - class: "alert alert-warning" -}; -const _hoisted_4 = { - key: 0, - class: "twoFactorRecoveryCodes browser-default" -}; -const _hoisted_5 = { - key: 1, - class: "alert alert-danger" -}; -const _hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const _hoisted_7 = ["value"]; -const _hoisted_8 = ["value"]; -const _hoisted_9 = ["value"]; -function render(_ctx, _cache, $props, $setup, $data, $options) { - var _ctx$codes; - const _directive_select_on_focus = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("select-on-focus"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_RecoveryCodesExplanation')), 1), _hoisted_1, _hoisted_2]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_RecoveryCodesSecurity')), 1), (_ctx$codes = _ctx.codes) !== null && _ctx$codes !== void 0 && _ctx$codes.length ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("ul", _hoisted_4, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.codes, (code, index) => { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { - key: index - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(code.toUpperCase().match(/.{1,4}/g).join('-')), 1); - }), 128))])), [[_directive_select_on_focus, {}]]) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_RecoveryCodesAllUsed')), 1)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "button", - class: "btn backupRecoveryCode", - onClick: _cache[0] || (_cache[0] = $event => { - _ctx.downloadRecoveryCodes(); - _ctx.$emit('downloaded'); - }), - value: _ctx.translate('General_Download'), - style: { - "margin-right": "3.5px" - } - }, null, 8, _hoisted_7), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "button", - class: "btn backupRecoveryCode", - onClick: _cache[1] || (_cache[1] = $event => { - _ctx.print(); - _ctx.$emit('downloaded'); - }), - value: _ctx.translate('General_Print'), - style: { - "margin-right": "3.5px" - } - }, null, 8, _hoisted_8), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "button", - class: "btn backupRecoveryCode", - onClick: _cache[2] || (_cache[2] = $event => { - _ctx.copyRecoveryCodesToClipboard(); - _ctx.$emit('downloaded'); - }), - value: _ctx.translate('General_Copy') - }, null, 8, _hoisted_9)])]); -} -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodes.vue?vue&type=template&id=43bd6978 - -// EXTERNAL MODULE: external "CoreHome" -var external_CoreHome_ = __webpack_require__("19dc"); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodes.vue?vue&type=script&lang=ts - - -/* harmony default export */ var ShowRecoveryCodesvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - codes: { - type: Array, - default() { - return []; - } - } - }, - directives: { - SelectOnFocus: external_CoreHome_["SelectOnFocus"] - }, - emits: ['downloaded'], - methods: { - copyRecoveryCodesToClipboard() { - const textarea = document.createElement('textarea'); - textarea.value = this.codes.join('\n'); - textarea.setAttribute('readonly', ''); - textarea.style.position = 'absolute'; - textarea.style.left = '-9999px'; - document.body.appendChild(textarea); - textarea.select(); - document.execCommand('copy'); - document.body.removeChild(textarea); - }, - downloadRecoveryCodes() { - external_CoreHome_["Matomo"].helper.sendContentAsDownload('analytics_recovery_codes.txt', this.codes.join('\n')); - }, - print() { - window.print(); - } - } -})); -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodes.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodes.vue - - - -ShowRecoveryCodesvue_type_script_lang_ts.render = render - -/* harmony default export */ var ShowRecoveryCodes = (ShowRecoveryCodesvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodesPage.vue?vue&type=template&id=13e8e57f - -const ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_1 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_3 = { - key: 0, - class: "alert alert-success" -}; -const ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_4 = { - key: 1, - class: "alert alert-danger" -}; -const ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_5 = ["action"]; -const ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_6 = ["value"]; -const ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_7 = ["value"]; -function ShowRecoveryCodesPagevue_type_template_id_13e8e57f_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_ShowRecoveryCodes = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ShowRecoveryCodes"); - const _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ContentBlock, { - "content-title": _ctx.contentTitle - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ShowRecoveryCodes, { - codes: _ctx.codes - }, null, 8, ["codes"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_GenerateNewRecoveryCodes')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_GenerateNewRecoveryCodesInfo')), 1), ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_1, ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_2]), _ctx.regenerateSuccess ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_RecoveryCodesRegenerated')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.regenerateError ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ExceptionSecurityCheckFailed')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("form", { - method: "post", - action: _ctx.showRecoveryCodesLink - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "hidden", - name: "regenerateNonce", - value: _ctx.regenerateNonce - }, null, 8, ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_6), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "submit", - class: "btn", - value: _ctx.translate('TwoFactorAuth_GenerateNewRecoveryCodes') - }, null, 8, ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_7)], 8, ShowRecoveryCodesPagevue_type_template_id_13e8e57f_hoisted_5)]), - _: 1 - }, 8, ["content-title"]); -} -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodesPage.vue?vue&type=template&id=13e8e57f - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodesPage.vue?vue&type=script&lang=ts - - - -/* harmony default export */ var ShowRecoveryCodesPagevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - codes: Array, - regenerateSuccess: Boolean, - regenerateError: Boolean, - regenerateNonce: { - type: String, - required: true - } - }, - components: { - ContentBlock: external_CoreHome_["ContentBlock"], - ShowRecoveryCodes: ShowRecoveryCodes - }, - computed: { - contentTitle() { - const part1 = Object(external_CoreHome_["translate"])('TwoFactorAuth_TwoFactorAuthentication'); - const part2 = Object(external_CoreHome_["translate"])('TwoFactorAuth_RecoveryCodes'); - return `${part1} - ${part2}`; - }, - showRecoveryCodesLink() { - return `?${external_CoreHome_["MatomoUrl"].stringify(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), {}, { - module: 'TwoFactorAuth', - action: 'showRecoveryCodes' - }))}`; - } - } -})); -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodesPage.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodesPage.vue - - - -ShowRecoveryCodesPagevue_type_script_lang_ts.render = ShowRecoveryCodesPagevue_type_template_id_13e8e57f_render - -/* harmony default export */ var ShowRecoveryCodesPage = (ShowRecoveryCodesPagevue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/SetupTwoFactorAuth.vue?vue&type=template&id=2690bbc8 - -const SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_1 = { - class: "setupTwoFactorAuthentication", - ref: "root" -}; -const SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_2 = { - key: 0, - class: "alert alert-warning" -}; -const SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_3 = ["disabled"]; -const SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_4 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - name: "twoFactorStep2", - id: "twoFactorStep2", - style: { - "opacity": "0" - } -}, null, -1); -const SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_5 = ["innerHTML"]; -const SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_7 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - name: "twoFactorStep3", - id: "twoFactorStep3", - style: { - "opacity": "0" - } -}, null, -1); -const SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_8 = { - key: 0, - class: "message_container" -}; -const SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_9 = ["innerHTML"]; -const _hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const _hoisted_11 = ["action"]; -const _hoisted_12 = ["value"]; -const _hoisted_13 = ["disabled", "value"]; -const _hoisted_14 = { - class: "ui-confirm two-fa-qr-code-dialog" -}; -const _hoisted_15 = { - class: "row" -}; -const _hoisted_16 = { - class: "col l8 offset-l2 m10 offset-m1 s12 center-align" -}; -const _hoisted_17 = { - id: "qrcode", - ref: "qrcode", - title: "" -}; -const _hoisted_18 = { - class: "text-code" -}; -const _hoisted_19 = ["innerHTML"]; -const _hoisted_20 = { - class: "row" -}; -const _hoisted_21 = { - class: "col l8 offset-l2 m10 offset-m1 s12" -}; -const _hoisted_22 = ["value"]; -const _hoisted_23 = ["value"]; -function SetupTwoFactorAuthvue_type_template_id_2690bbc8_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_ShowRecoveryCodes = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ShowRecoveryCodes"); - const _component_InstallOTPApp = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("InstallOTPApp"); - const _component_Notification = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Notification"); - const _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); - const _component_MatomoDialog = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MatomoDialog"); - const _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); - const _directive_copy_to_clipboard = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("copy-to-clipboard"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ContentBlock, { - "content-title": _ctx.standalone ? _ctx.translate('TwoFactorAuth_RequiredToSetUpTwoFactorAuthentication') : _ctx.translate('TwoFactorAuth_SetUpTwoFactorAuthentication') - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_1, [_ctx.isAlreadyUsing2fa ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_WarningChangingConfiguredDevice')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_SetupIntroFollowSteps')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_StepX', 1)) + " - " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_RecoveryCodes')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ShowRecoveryCodes, { - codes: _ctx.codes, - onDownloaded: _cache[0] || (_cache[0] = $event => this.hasDownloadedRecoveryCode = true) - }, null, 8, ["codes"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { - class: "alert alert-info backupRecoveryCodesAlert" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_SetupBackupRecoveryCodes')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.step === 1]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { - class: "btn goToStep2", - onClick: _cache[1] || (_cache[1] = $event => _ctx.nextStep()), - disabled: !_ctx.hasDownloadedRecoveryCode - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Next')), 9, SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_3), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.step === 1]])]), SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_StepX', 2)) + " - " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_SetupAuthenticatorOnDevice')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_InstallOTPApp), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { - innerHTML: _ctx.$sanitize(_ctx.setupAuthenticatorOnDeviceStep2ShowCodes) - }, null, 8, SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_5), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { - class: "btn showOtpCodes", - onClick: _cache[2] || (_cache[2] = $event => _ctx.showQrCodeModal()) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_ShowCodes')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.step >= 2]])])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.step >= 2]]), SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_StepX', 3)) + " - " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_ConfirmSetup')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_VerifyAuthCodeIntro')), 1), _ctx.accessErrorString ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Notification, { - noclear: true, - context: "error" - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Error')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(": "), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - innerHTML: _ctx.$sanitize(_ctx.accessErrorString) - }, null, 8, SetupTwoFactorAuthvue_type_template_id_2690bbc8_hoisted_9), _hoisted_10]), - _: 1 - })])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("form", { - method: "post", - class: "setupConfirmAuthCodeForm", - autocorrect: "off", - autocapitalize: "none", - autocomplete: "off", - action: _ctx.linkTo({ - 'module': 'TwoFactorAuth', - 'action': _ctx.submitAction - }) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { - uicontrol: "text", - name: "authCode", - title: _ctx.translate('TwoFactorAuth_AuthenticationCode'), - modelValue: _ctx.authCode, - "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => _ctx.authCode = $event), - maxlength: 6, - placeholder: '123456', - autocomplete: "one-time-code", - "inline-help": _ctx.translate('TwoFactorAuth_VerifyAuthCodeHelp') - }, null, 8, ["title", "modelValue", "inline-help"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "hidden", - name: "authCodeNonce", - value: _ctx.authCodeNonce - }, null, 8, _hoisted_12), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "submit", - class: "btn confirmAuthCode", - disabled: _ctx.authCode.length !== 6, - value: _ctx.translate('General_Confirm') - }, null, 8, _hoisted_13)], 8, _hoisted_11)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.step >= 3]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_MatomoDialog, { - modelValue: _ctx.qrCodeDialogVisible, - "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => _ctx.qrCodeDialogVisible = $event), - onValidation: _cache[5] || (_cache[5] = $event => { - _ctx.closeQrCodeModal(); - _ctx.nextStep(); - }), - options: { - focusSelector: '.modal-action.btn' - } - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_Your2FaAuthSecret')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_ShowCodeModalInstructions1')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_17, null, 512)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_ShowCodeModalInstructions2')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("pre", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.newSecret), 1)])), [[_directive_copy_to_clipboard, {}]])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { - innerHTML: _ctx.$sanitize(_ctx.showCodeModalInstructions3) - }, null, 8, _hoisted_19)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_DontHaveOTPApp')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_InstallOTPApp)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - role: "validation", - type: "button", - value: _ctx.translate('General_Continue') - }, null, 8, _hoisted_22), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - role: "no", - type: "button", - value: _ctx.translate('General_Cancel') - }, null, 8, _hoisted_23)])]), - _: 1 - }, 8, ["modelValue", "options"])], 512)]), - _: 1 - }, 8, ["content-title"]); -} -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/SetupTwoFactorAuth.vue?vue&type=template&id=2690bbc8 - -// EXTERNAL MODULE: external "CorePluginsAdmin" -var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); - -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/types.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/InstallOTPApp.vue?vue&type=template&id=a1258308 - -const InstallOTPAppvue_type_template_id_a1258308_hoisted_1 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - target: "_blank", - rel: "noreferrer noopener", - href: "https://github.com/andOTP/andOTP#downloads" -}, "andOTP", -1); -const InstallOTPAppvue_type_template_id_a1258308_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - target: "_blank", - rel: "noreferrer noopener", - href: "https://authy.com/guides/github/" -}, "Authy", -1); -const InstallOTPAppvue_type_template_id_a1258308_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - target: "_blank", - rel: "noreferrer noopener", - href: "https://support.1password.com/one-time-passwords/" -}, "1Password", -1); -const InstallOTPAppvue_type_template_id_a1258308_hoisted_4 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - target: "_blank", - rel: "noreferrer noopener", - href: "https://helpdesk.lastpass.com/multifactor-authentication-options/lastpass-authenticator/" -}, "LastPass Authenticator", -1); -const InstallOTPAppvue_type_template_id_a1258308_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - target: "_blank", - rel: "noreferrer noopener", - href: "https://support.google.com/accounts/answer/1066447" -}, "Google Authenticator", -1); -function InstallOTPAppvue_type_template_id_a1258308_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_SetupAuthenticatorOnDeviceStep1')) + " ", 1), InstallOTPAppvue_type_template_id_a1258308_hoisted_1, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(", "), InstallOTPAppvue_type_template_id_a1258308_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(", "), InstallOTPAppvue_type_template_id_a1258308_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(", "), InstallOTPAppvue_type_template_id_a1258308_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(", " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Or')) + " ", 1), InstallOTPAppvue_type_template_id_a1258308_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(". ")]); -} -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/InstallOTPApp.vue?vue&type=template&id=a1258308 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/InstallOTPApp.vue?vue&type=script&lang=ts - -/* harmony default export */ var InstallOTPAppvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({})); -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/InstallOTPApp.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/InstallOTPApp.vue - - - -InstallOTPAppvue_type_script_lang_ts.render = InstallOTPAppvue_type_template_id_a1258308_render - -/* harmony default export */ var InstallOTPApp = (InstallOTPAppvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/SetupTwoFactorAuth.vue?vue&type=script&lang=ts - - - - - - -const { - QRCode, - $ -} = window; -/* harmony default export */ var SetupTwoFactorAuthvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - isAlreadyUsing2fa: Boolean, - accessErrorString: String, - submitAction: { - type: String, - required: true - }, - authCodeNonce: { - type: String, - required: true - }, - newSecret: { - type: String, - required: true - }, - codes: Array, - twoFaBarCodeSetupUrl: { - type: String, - required: true - }, - standalone: Boolean - }, - components: { - InstallOTPApp: InstallOTPApp, - MatomoDialog: external_CoreHome_["MatomoDialog"], - ShowRecoveryCodes: ShowRecoveryCodes, - Notification: external_CoreHome_["Notification"], - Field: external_CorePluginsAdmin_["Field"], - ContentBlock: external_CoreHome_["ContentBlock"] - }, - directives: { - CopyToClipboard: external_CoreHome_["CopyToClipboard"] - }, - data() { - return { - step: 1, - hasDownloadedRecoveryCode: false, - authCode: '', - qrCodeDialogVisible: false - }; - }, - mounted() { - setTimeout(() => { - const qrcode = this.$refs.qrcode; - // eslint-disable-next-line no-new - new QRCode(qrcode, { - text: this.twoFaBarCodeSetupUrl, - width: 200, - height: 200 - }); - $(qrcode).attr('title', ''); // do not show secret on hover - if (this.accessErrorString) { - // user entered something wrong - this.step = 3; - this.scrollToEnd(); - } - }); - }, - methods: { - scrollToEnd() { - setTimeout(() => { - let id = ''; - if (this.step === 2) { - id = '#twoFactorStep2'; - } else if (this.step === 3) { - id = '#twoFactorStep3'; - } - if (id) { - external_CoreHome_["Matomo"].helper.lazyScrollTo(id, 50, true); - } - }, 50); - }, - showQrCodeModal() { - this.qrCodeDialogVisible = true; - }, - closeQrCodeModal() { - this.qrCodeDialogVisible = false; - }, - nextStep() { - this.step += 1; - if (this.step > 3) { - this.step = 3; - } - this.scrollToEnd(); - }, - linkTo(params) { - return `?${external_CoreHome_["MatomoUrl"].stringify(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), params))}`; - } - }, - computed: { - setupAuthenticatorOnDeviceStep2ShowCodes() { - return Object(external_CoreHome_["translate"])('TwoFactorAuth_SetupAuthenticatorOnDeviceStep2ShowCodes', Object(external_CoreHome_["translate"])('TwoFactorAuth_ShowCodes')); - }, - showCodeModalInstructions3() { - return Object(external_CoreHome_["translate"])('TwoFactorAuth_ShowCodeModalInstructions3', Object(external_CoreHome_["translate"])('General_Continue')); - } - } -})); -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/SetupTwoFactorAuth.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/SetupTwoFactorAuth.vue - - - -SetupTwoFactorAuthvue_type_script_lang_ts.render = SetupTwoFactorAuthvue_type_template_id_2690bbc8_render - -/* harmony default export */ var SetupTwoFactorAuth = (SetupTwoFactorAuthvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/LoginTwoFactorAuth/LoginTwoFactorAuth.vue?vue&type=template&id=43d88a20 - -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_1 = { - class: "message_container" -}; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_2 = ["innerHTML"]; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_4 = { - class: "row" -}; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_5 = { - class: "col s12 input-field" -}; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_6 = ["value"]; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_7 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "text", - name: "form_authcode", - placeholder: "", - id: "form_authcode", - class: "input", - value: "", - size: "20", - autocorrect: "off", - autocapitalize: "none", - autocomplete: "one-time-code", - tabindex: "10", - autofocus: "autofocus" -}, null, -1); -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_8 = { - for: "form_authcode" -}; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_9 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("i", { - class: "icon-user icon" -}, null, -1); -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_10 = { - class: "row actions" -}; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_11 = { - class: "col s12" -}; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_12 = ["value"]; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_13 = ["innerHTML"]; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_14 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_15 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_16 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_17 = ["href"]; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_18 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_19 = ["href"]; -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_20 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_21 = ["href"]; -function LoginTwoFactorAuthvue_type_template_id_43d88a20_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_FormErrors = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("FormErrors"); - const _component_Notification = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Notification"); - const _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ContentBlock, { - "content-title": _ctx.translate('TwoFactorAuth_TwoFactorAuthentication') - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_FormErrors, { - "form-errors": _ctx.formData.errors - }, null, 8, ["form-errors"]), _ctx.accessErrorString ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Notification, { - key: 0, - noclear: true, - context: "error" - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Error')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(": "), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - innerHTML: _ctx.$sanitize(_ctx.accessErrorString) - }, null, 8, LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_2), LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_3]), - _: 1 - })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("form", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])(_ctx.formDataAttributes, { - class: "loginTwoFaForm" - }), [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "hidden", - name: "form_nonce", - id: "login_form_nonce", - value: _ctx.formNonce - }, null, 8, LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_6), LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_8, [LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_AuthenticationCode')), 1)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - class: "submit btn btn-block", - id: "login_form_submit", - type: "submit", - value: _ctx.translate('TwoFactorAuth_Verify'), - tabindex: "100" - }, null, 8, LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_12)])])], 16), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_VerifyIdentifyExplanation')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - innerHTML: _ctx.$sanitize(_ctx.learnMoreText) - }, null, 8, LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_13), LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_14, LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_15, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_DontHaveYourMobileDevice')), 1), LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_16, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - href: _ctx.externalRawLink('https://matomo.org/faq/how-to/faq_27248'), - rel: "noreferrer noopener", - target: "_blank" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_EnterRecoveryCodeInstead')), 9, LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_17), LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_18, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - href: _ctx.mailToLink, - rel: "noreferrer noopener" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_AskSuperUserResetAuthenticationCode')), 9, LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_19), LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_20, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - href: _ctx.logoutLink, - rel: "noreferrer noopener" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Logout')), 9, LoginTwoFactorAuthvue_type_template_id_43d88a20_hoisted_21)])]), - _: 1 - }, 8, ["content-title"]); -} -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/LoginTwoFactorAuth/LoginTwoFactorAuth.vue?vue&type=template&id=43d88a20 - -// EXTERNAL MODULE: external "Login" -var external_Login_ = __webpack_require__("5b81"); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/LoginTwoFactorAuth/LoginTwoFactorAuth.vue?vue&type=script&lang=ts - - - -/* harmony default export */ var LoginTwoFactorAuthvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - formData: { - type: Object, - required: true - }, - accessErrorString: String, - formNonce: { - type: String, - required: true - }, - loginModule: { - type: String, - required: true - }, - piwikUrl: String, - userLogin: { - type: String, - required: true - }, - contactEmail: { - type: String, - required: true - } - }, - components: { - ContentBlock: external_CoreHome_["ContentBlock"], - Notification: external_CoreHome_["Notification"], - FormErrors: external_Login_["FormErrors"] - }, - computed: { - learnMoreText() { - return Object(external_CoreHome_["translate"])('General_LearnMore', Object(external_CoreHome_["externalLink"])('https://matomo.org/faq/general/faq_27245'), ''); - }, - mailToLink() { - return `mailto:${this.contactEmail}?${external_CoreHome_["MatomoUrl"].stringify({ - subject: Object(external_CoreHome_["translate"])('TwoFactorAuth_NotPossibleToLogIn'), - body: Object(external_CoreHome_["translate"])('TwoFactorAuth_LostAuthenticationDevice', '\n\n', '\n\n', this.piwikUrl || '', '\n\n', this.userLogin, Object(external_CoreHome_["externalRawLink"])('https://matomo.org/faq/how-to/faq_27248')) - })}`; - }, - logoutLink() { - return `?${external_CoreHome_["MatomoUrl"].stringify({ - module: this.loginModule, - action: 'logout' - })}`; - }, - formDataAttributes() { - // convert html attribute string (ie 'a="b" d="f"') to JS object {a: "b", d: "f"} - return Object.fromEntries(this.formData.attributes.split(/\s+/g).filter(s => s).map(pair => pair.split('=')).map(([name, value]) => [name, external_CoreHome_["Matomo"].helper.htmlDecode(value.substr(1, value.length - 2))])); - } - } -})); -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/LoginTwoFactorAuth/LoginTwoFactorAuth.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/LoginTwoFactorAuth/LoginTwoFactorAuth.vue - - - -LoginTwoFactorAuthvue_type_script_lang_ts.render = LoginTwoFactorAuthvue_type_template_id_43d88a20_render - -/* harmony default export */ var LoginTwoFactorAuth = (LoginTwoFactorAuthvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/SetupFinished/SetupFinished.vue?vue&type=template&id=631d8678 - -const SetupFinishedvue_type_template_id_631d8678_hoisted_1 = { - class: "successMessage" -}; -const SetupFinishedvue_type_template_id_631d8678_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const SetupFinishedvue_type_template_id_631d8678_hoisted_3 = ["href"]; -function SetupFinishedvue_type_template_id_631d8678_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ContentBlock, { - class: "twoFactorSetupFinished" - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", SetupFinishedvue_type_template_id_631d8678_hoisted_1, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_SetupFinishedTitle')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_SetupFinishedSubtitle')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [SetupFinishedvue_type_template_id_631d8678_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - class: "btn", - href: _ctx.userSecurityLink - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Continue')), 9, SetupFinishedvue_type_template_id_631d8678_hoisted_3)])]), - _: 1 - }); -} -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/SetupFinished/SetupFinished.vue?vue&type=template&id=631d8678 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/SetupFinished/SetupFinished.vue?vue&type=script&lang=ts - - -/* harmony default export */ var SetupFinishedvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - components: { - ContentBlock: external_CoreHome_["ContentBlock"] - }, - computed: { - userSecurityLink() { - return `?${external_CoreHome_["MatomoUrl"].stringify(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), {}, { - module: 'UsersManager', - action: 'userSecurity' - }))}`; - } - } -})); -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/SetupFinished/SetupFinished.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/SetupFinished/SetupFinished.vue - - - -SetupFinishedvue_type_script_lang_ts.render = SetupFinishedvue_type_template_id_631d8678_render - -/* harmony default export */ var SetupFinished = (SetupFinishedvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/UserSettings/UserSettings.vue?vue&type=template&id=790c613d - -const UserSettingsvue_type_template_id_790c613d_hoisted_1 = ["innerHTML"]; -const UserSettingsvue_type_template_id_790c613d_hoisted_2 = { - key: 0 -}; -const UserSettingsvue_type_template_id_790c613d_hoisted_3 = { - class: "twoFaStatusEnabled" -}; -const UserSettingsvue_type_template_id_790c613d_hoisted_4 = { - key: 1 -}; -const UserSettingsvue_type_template_id_790c613d_hoisted_5 = { - key: 0 -}; -const UserSettingsvue_type_template_id_790c613d_hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const UserSettingsvue_type_template_id_790c613d_hoisted_7 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const UserSettingsvue_type_template_id_790c613d_hoisted_8 = ["href"]; -const UserSettingsvue_type_template_id_790c613d_hoisted_9 = { - key: 1 -}; -const UserSettingsvue_type_template_id_790c613d_hoisted_10 = ["href"]; -const UserSettingsvue_type_template_id_790c613d_hoisted_11 = ["href"]; -const UserSettingsvue_type_template_id_790c613d_hoisted_12 = ["value"]; -const UserSettingsvue_type_template_id_790c613d_hoisted_13 = ["href"]; -const UserSettingsvue_type_template_id_790c613d_hoisted_14 = { - key: 2 -}; -const UserSettingsvue_type_template_id_790c613d_hoisted_15 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const UserSettingsvue_type_template_id_790c613d_hoisted_16 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -const UserSettingsvue_type_template_id_790c613d_hoisted_17 = ["href"]; -const UserSettingsvue_type_template_id_790c613d_hoisted_18 = { - id: "confirmDisable2FA", - class: "ui-confirm", - ref: "confirmDisable2FA" -}; -const UserSettingsvue_type_template_id_790c613d_hoisted_19 = ["value"]; -const UserSettingsvue_type_template_id_790c613d_hoisted_20 = ["value"]; -function UserSettingsvue_type_template_id_790c613d_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ContentBlock, { - "content-title": _ctx.contentTitle, - class: "userSettings2FA" - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { - innerHTML: _ctx.$sanitize(_ctx.twoFactorAuthIntro) - }, null, 8, UserSettingsvue_type_template_id_790c613d_hoisted_1), _ctx.isEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserSettingsvue_type_template_id_790c613d_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", UserSettingsvue_type_template_id_790c613d_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_TwoFactorAuthenticationIsEnabled')), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.isEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserSettingsvue_type_template_id_790c613d_hoisted_4, [_ctx.isForced ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", UserSettingsvue_type_template_id_790c613d_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_TwoFactorAuthenticationRequired')) + " ", 1), UserSettingsvue_type_template_id_790c613d_hoisted_6, UserSettingsvue_type_template_id_790c613d_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - class: "btn btn-link enable2FaLink", - href: _ctx.setupTwoFactorAuthLink, - style: { - "margin-right": "3.5px" - } - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_ConfigureDifferentDevice')), 9, UserSettingsvue_type_template_id_790c613d_hoisted_8)])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", UserSettingsvue_type_template_id_790c613d_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - class: "btn btn-link enable2FaLink", - href: _ctx.setupTwoFactorAuthLink, - style: { - "margin-right": "3.5px" - } - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_ConfigureDifferentDevice')), 9, UserSettingsvue_type_template_id_790c613d_hoisted_10), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - href: _ctx.disableTwoFactorAuthLink, - style: { - "display": "none" - }, - id: "disable2fa" - }, "disable2fa", 8, UserSettingsvue_type_template_id_790c613d_hoisted_11), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "button", - class: "btn btn-link disable2FaLink", - onClick: _cache[0] || (_cache[0] = $event => _ctx.onDisable2FaLinkClick()), - value: _ctx.translate('TwoFactorAuth_DisableTwoFA'), - style: { - "margin-right": "3.5px" - } - }, null, 8, UserSettingsvue_type_template_id_790c613d_hoisted_12)])), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - class: "btn btn-link showRecoveryCodesLink", - href: _ctx.showRecoveryCodesLink - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_ShowRecoveryCodes')), 9, UserSettingsvue_type_template_id_790c613d_hoisted_13)])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserSettingsvue_type_template_id_790c613d_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_TwoFactorAuthenticationIsDisabled')), 1), UserSettingsvue_type_template_id_790c613d_hoisted_15, UserSettingsvue_type_template_id_790c613d_hoisted_16, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - class: "btn btn-link enable2FaLink", - href: _ctx.setupTwoFactorAuthLink - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_EnableTwoFA')), 9, UserSettingsvue_type_template_id_790c613d_hoisted_17)])), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserSettingsvue_type_template_id_790c613d_hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TwoFactorAuth_ConfirmDisableTwoFA')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - role: "yes", - type: "button", - value: _ctx.translate('General_Yes') - }, null, 8, UserSettingsvue_type_template_id_790c613d_hoisted_19), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - role: "no", - type: "button", - value: _ctx.translate('General_No') - }, null, 8, UserSettingsvue_type_template_id_790c613d_hoisted_20)], 512)]), - _: 1 - }, 8, ["content-title"]); -} -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/UserSettings/UserSettings.vue?vue&type=template&id=790c613d - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/TwoFactorAuth/vue/src/UserSettings/UserSettings.vue?vue&type=script&lang=ts - - -/* harmony default export */ var UserSettingsvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - isEnabled: Boolean, - isForced: Boolean, - disableNonce: { - type: String, - required: true - } - }, - components: { - ContentBlock: external_CoreHome_["ContentBlock"] - }, - computed: { - contentTitle() { - const part1 = Object(external_CoreHome_["translate"])('TwoFactorAuth_TwoFactorAuthentication'); - const part2 = Object(external_CoreHome_["translate"])('TwoFactorAuth_TwoFAShort'); - return `${part1} (${part2})`; - }, - twoFactorAuthIntro() { - return Object(external_CoreHome_["translate"])('TwoFactorAuth_TwoFactorAuthenticationIntro', Object(external_CoreHome_["externalLink"])('https://matomo.org/faq/general/faq_27245'), ''); - }, - setupTwoFactorAuthLink() { - return `?${external_CoreHome_["MatomoUrl"].stringify(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), {}, { - module: 'TwoFactorAuth', - action: 'setupTwoFactorAuth' - }))}`; - }, - disableTwoFactorAuthLink() { - return `?${external_CoreHome_["MatomoUrl"].stringify(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), {}, { - module: 'TwoFactorAuth', - action: 'disableTwoFactorAuth', - disableNonce: this.disableNonce - }))}`; - }, - showRecoveryCodesLink() { - return `?${external_CoreHome_["MatomoUrl"].stringify(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), {}, { - module: 'TwoFactorAuth', - action: 'showRecoveryCodes' - }))}`; - } - }, - methods: { - onDisable2FaLinkClick() { - const nonce = this.disableNonce; - external_CoreHome_["Matomo"].helper.modalConfirm(this.$refs.confirmDisable2FA, { - yes() { - external_CoreHome_["MatomoUrl"].updateUrl({ - module: 'TwoFactorAuth', - action: 'disableTwoFactorAuth', - disableNonce: nonce - }); - } - }); - } - } -})); -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/UserSettings/UserSettings.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/UserSettings/UserSettings.vue - - - -UserSettingsvue_type_script_lang_ts.render = UserSettingsvue_type_template_id_790c613d_render - -/* harmony default export */ var UserSettings = (UserSettingsvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/TwoFactorAuth/vue/src/index.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - - - - -// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js - - - - -/***/ }) - -/******/ }); -}); -//# sourceMappingURL=TwoFactorAuth.umd.js.map \ No newline at end of file diff --git a/plugins/TwoFactorAuth/vue/dist/TwoFactorAuth.umd.min.js b/plugins/TwoFactorAuth/vue/dist/TwoFactorAuth.umd.min.js deleted file mode 100644 index 03d94fb5a507e6f60caec390bca5109b75666af5..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/dist/TwoFactorAuth.umd.min.js +++ /dev/null @@ -1,14 +0,0 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("Login"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome","Login",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["TwoFactorAuth"]=t(require("CoreHome"),require("Login"),require("vue"),require("CorePluginsAdmin")):e["TwoFactorAuth"]=t(e["CoreHome"],e["Login"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,o,n){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="plugins/TwoFactorAuth/vue/dist/",o(o.s="fae3")}({"19dc":function(t,o){t.exports=e},"5b81":function(e,o){e.exports=t},"8bbf":function(e,t){e.exports=o},a5a2:function(e,t){e.exports=n},fae3:function(e,t,o){"use strict";if(o.r(t),o.d(t,"ShowRecoveryCodes",(function(){return f})),o.d(t,"ShowRecoveryCodesPage",(function(){return S})),o.d(t,"SetupTwoFactorAuth",(function(){return de})),o.d(t,"LoginTwoFactorAuth",(function(){return Me})),o.d(t,"SetupFinished",(function(){return Ge})),o.d(t,"UserSettings",(function(){return dt})),"undefined"!==typeof window){var n=window.document.currentScript,r=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(o.p=r[1])}var a=o("8bbf");const c=Object(a["createElementVNode"])("br",null,null,-1),l=Object(a["createElementVNode"])("br",null,null,-1),i={class:"alert alert-warning"},s={key:0,class:"twoFactorRecoveryCodes browser-default"},u={key:1,class:"alert alert-danger"},d=Object(a["createElementVNode"])("br",null,null,-1),b=["value"],p=["value"],m=["value"];function O(e,t,o,n,r,O){var j;const h=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodesExplanation")),1),c,l]),Object(a["createElementVNode"])("div",i,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodesSecurity")),1),null!==(j=e.codes)&&void 0!==j&&j.length?Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("ul",s,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.codes,(e,t)=>(Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{key:t},Object(a["toDisplayString"])(e.toUpperCase().match(/.{1,4}/g).join("-")),1))),128))])),[[h,{}]]):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",u,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodesAllUsed")),1)),Object(a["createElementVNode"])("p",null,[d,Object(a["createElementVNode"])("input",{type:"button",class:"btn backupRecoveryCode",onClick:t[0]||(t[0]=t=>{e.downloadRecoveryCodes(),e.$emit("downloaded")}),value:e.translate("General_Download"),style:{"margin-right":"3.5px"}},null,8,b),Object(a["createElementVNode"])("input",{type:"button",class:"btn backupRecoveryCode",onClick:t[1]||(t[1]=t=>{e.print(),e.$emit("downloaded")}),value:e.translate("General_Print"),style:{"margin-right":"3.5px"}},null,8,p),Object(a["createElementVNode"])("input",{type:"button",class:"btn backupRecoveryCode",onClick:t[2]||(t[2]=t=>{e.copyRecoveryCodesToClipboard(),e.$emit("downloaded")}),value:e.translate("General_Copy")},null,8,m)])])}var j=o("19dc"),h=Object(a["defineComponent"])({props:{codes:{type:Array,default(){return[]}}},directives:{SelectOnFocus:j["SelectOnFocus"]},emits:["downloaded"],methods:{copyRecoveryCodesToClipboard(){const e=document.createElement("textarea");e.value=this.codes.join("\n"),e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)},downloadRecoveryCodes(){j["Matomo"].helper.sendContentAsDownload("analytics_recovery_codes.txt",this.codes.join("\n"))},print(){window.print()}}});h.render=O;var f=h;const w=Object(a["createElementVNode"])("br",null,null,-1),y=Object(a["createElementVNode"])("br",null,null,-1),g={key:0,class:"alert alert-success"},v={key:1,class:"alert alert-danger"},C=["action"],N=["value"],E=["value"];function V(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("ShowRecoveryCodes"),i=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(i,{"content-title":e.contentTitle},{default:Object(a["withCtx"])(()=>[Object(a["createVNode"])(l,{codes:e.codes},null,8,["codes"]),Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_GenerateNewRecoveryCodes")),1),Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_GenerateNewRecoveryCodesInfo")),1),w,y]),e.regenerateSuccess?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",g,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodesRegenerated")),1)):Object(a["createCommentVNode"])("",!0),e.regenerateError?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",v,Object(a["toDisplayString"])(e.translate("General_ExceptionSecurityCheckFailed")),1)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("form",{method:"post",action:e.showRecoveryCodesLink},[Object(a["createElementVNode"])("input",{type:"hidden",name:"regenerateNonce",value:e.regenerateNonce},null,8,N),Object(a["createElementVNode"])("input",{type:"submit",class:"btn",value:e.translate("TwoFactorAuth_GenerateNewRecoveryCodes")},null,8,E)],8,C)]),_:1},8,["content-title"])}var T=Object(a["defineComponent"])({props:{codes:Array,regenerateSuccess:Boolean,regenerateError:Boolean,regenerateNonce:{type:String,required:!0}},components:{ContentBlock:j["ContentBlock"],ShowRecoveryCodes:f},computed:{contentTitle(){const e=Object(j["translate"])("TwoFactorAuth_TwoFactorAuthentication"),t=Object(j["translate"])("TwoFactorAuth_RecoveryCodes");return`${e} - ${t}`},showRecoveryCodesLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"TwoFactorAuth",action:"showRecoveryCodes"}))}}});T.render=V;var S=T;const A={class:"setupTwoFactorAuthentication",ref:"root"},F={key:0,class:"alert alert-warning"},k=["disabled"],_=Object(a["createElementVNode"])("a",{name:"twoFactorStep2",id:"twoFactorStep2",style:{opacity:"0"}},null,-1),D=["innerHTML"],B=Object(a["createElementVNode"])("br",null,null,-1),x=Object(a["createElementVNode"])("a",{name:"twoFactorStep3",id:"twoFactorStep3",style:{opacity:"0"}},null,-1),M={key:0,class:"message_container"},L=["innerHTML"],R=Object(a["createElementVNode"])("br",null,null,-1),q=["action"],U=["value"],P=["disabled","value"],G={class:"ui-confirm two-fa-qr-code-dialog"},H={class:"row"},$={class:"col l8 offset-l2 m10 offset-m1 s12 center-align"},I={id:"qrcode",ref:"qrcode",title:""},z={class:"text-code"},Q=["innerHTML"],X={class:"row"},Y={class:"col l8 offset-l2 m10 offset-m1 s12"},W=["value"],J=["value"];function K(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("ShowRecoveryCodes"),i=Object(a["resolveComponent"])("InstallOTPApp"),s=Object(a["resolveComponent"])("Notification"),u=Object(a["resolveComponent"])("Field"),d=Object(a["resolveComponent"])("MatomoDialog"),b=Object(a["resolveComponent"])("ContentBlock"),p=Object(a["resolveDirective"])("copy-to-clipboard");return Object(a["openBlock"])(),Object(a["createBlock"])(b,{"content-title":e.standalone?e.translate("TwoFactorAuth_RequiredToSetUpTwoFactorAuthentication"):e.translate("TwoFactorAuth_SetUpTwoFactorAuthentication")},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("div",A,[e.isAlreadyUsing2fa?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",F,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_WarningChangingConfiguredDevice")),1)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupIntroFollowSteps")),1),Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_StepX",1))+" - "+Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodes")),1),Object(a["createVNode"])(l,{codes:e.codes,onDownloaded:t[0]||(t[0]=e=>this.hasDownloadedRecoveryCode=!0)},null,8,["codes"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",{class:"alert alert-info backupRecoveryCodesAlert"},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupBackupRecoveryCodes")),513),[[a["vShow"],1===e.step]]),Object(a["createElementVNode"])("p",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("button",{class:"btn goToStep2",onClick:t[1]||(t[1]=t=>e.nextStep()),disabled:!e.hasDownloadedRecoveryCode},Object(a["toDisplayString"])(e.translate("General_Next")),9,k),[[a["vShow"],1===e.step]])]),_,Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_StepX",2))+" - "+Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupAuthenticatorOnDevice")),1),Object(a["createVNode"])(i),Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.setupAuthenticatorOnDeviceStep2ShowCodes)},null,8,D),Object(a["createElementVNode"])("p",null,[B,Object(a["withDirectives"])(Object(a["createElementVNode"])("button",{class:"btn showOtpCodes",onClick:t[2]||(t[2]=t=>e.showQrCodeModal())},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ShowCodes")),513),[[a["vShow"],e.step>=2]])])],512),[[a["vShow"],e.step>=2]]),x,Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_StepX",3))+" - "+Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ConfirmSetup")),1),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_VerifyAuthCodeIntro")),1),e.accessErrorString?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",M,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(s,{noclear:!0,context:"error"},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("General_Error")),1),Object(a["createTextVNode"])(": "),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.accessErrorString)},null,8,L),R]),_:1})])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("form",{method:"post",class:"setupConfirmAuthCodeForm",autocorrect:"off",autocapitalize:"none",autocomplete:"off",action:e.linkTo({module:"TwoFactorAuth",action:e.submitAction})},[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(u,{uicontrol:"text",name:"authCode",title:e.translate("TwoFactorAuth_AuthenticationCode"),modelValue:e.authCode,"onUpdate:modelValue":t[3]||(t[3]=t=>e.authCode=t),maxlength:6,placeholder:"123456",autocomplete:"one-time-code","inline-help":e.translate("TwoFactorAuth_VerifyAuthCodeHelp")},null,8,["title","modelValue","inline-help"])]),Object(a["createElementVNode"])("input",{type:"hidden",name:"authCodeNonce",value:e.authCodeNonce},null,8,U),Object(a["createElementVNode"])("input",{type:"submit",class:"btn confirmAuthCode",disabled:6!==e.authCode.length,value:e.translate("General_Confirm")},null,8,P)],8,q)],512),[[a["vShow"],e.step>=3]]),Object(a["createVNode"])(d,{modelValue:e.qrCodeDialogVisible,"onUpdate:modelValue":t[4]||(t[4]=t=>e.qrCodeDialogVisible=t),onValidation:t[5]||(t[5]=t=>{e.closeQrCodeModal(),e.nextStep()}),options:{focusSelector:".modal-action.btn"}},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("div",G,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_Your2FaAuthSecret")),1),Object(a["createElementVNode"])("div",H,[Object(a["createElementVNode"])("div",$,[Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ShowCodeModalInstructions1")),1),Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("span",I,null,512)]),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ShowCodeModalInstructions2")),1),Object(a["createElementVNode"])("div",z,[Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("pre",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.newSecret),1)])),[[p,{}]])]),Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.showCodeModalInstructions3)},null,8,Q)])]),Object(a["createElementVNode"])("div",X,[Object(a["createElementVNode"])("div",Y,[Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_DontHaveOTPApp")),1),Object(a["createVNode"])(i)])]),Object(a["createElementVNode"])("input",{role:"validation",type:"button",value:e.translate("General_Continue")},null,8,W),Object(a["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Cancel")},null,8,J)])]),_:1},8,["modelValue","options"])],512)]),_:1},8,["content-title"])}var Z=o("a5a2"); -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */const ee=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://github.com/andOTP/andOTP#downloads"},"andOTP",-1),te=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://authy.com/guides/github/"},"Authy",-1),oe=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://support.1password.com/one-time-passwords/"},"1Password",-1),ne=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://helpdesk.lastpass.com/multifactor-authentication-options/lastpass-authenticator/"},"LastPass Authenticator",-1),re=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://support.google.com/accounts/answer/1066447"},"Google Authenticator",-1);function ae(e,t,o,n,r,c){return Object(a["openBlock"])(),Object(a["createElementBlock"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupAuthenticatorOnDeviceStep1"))+" ",1),ee,Object(a["createTextVNode"])(", "),te,Object(a["createTextVNode"])(", "),oe,Object(a["createTextVNode"])(", "),ne,Object(a["createTextVNode"])(", "+Object(a["toDisplayString"])(e.translate("General_Or"))+" ",1),re,Object(a["createTextVNode"])(". ")])}var ce=Object(a["defineComponent"])({});ce.render=ae;var le=ce;const{QRCode:ie,$:se}=window;var ue=Object(a["defineComponent"])({props:{isAlreadyUsing2fa:Boolean,accessErrorString:String,submitAction:{type:String,required:!0},authCodeNonce:{type:String,required:!0},newSecret:{type:String,required:!0},codes:Array,twoFaBarCodeSetupUrl:{type:String,required:!0},standalone:Boolean},components:{InstallOTPApp:le,MatomoDialog:j["MatomoDialog"],ShowRecoveryCodes:f,Notification:j["Notification"],Field:Z["Field"],ContentBlock:j["ContentBlock"]},directives:{CopyToClipboard:j["CopyToClipboard"]},data(){return{step:1,hasDownloadedRecoveryCode:!1,authCode:"",qrCodeDialogVisible:!1}},mounted(){setTimeout(()=>{const e=this.$refs.qrcode;new ie(e,{text:this.twoFaBarCodeSetupUrl,width:200,height:200}),se(e).attr("title",""),this.accessErrorString&&(this.step=3,this.scrollToEnd())})},methods:{scrollToEnd(){setTimeout(()=>{let e="";2===this.step?e="#twoFactorStep2":3===this.step&&(e="#twoFactorStep3"),e&&j["Matomo"].helper.lazyScrollTo(e,50,!0)},50)},showQrCodeModal(){this.qrCodeDialogVisible=!0},closeQrCodeModal(){this.qrCodeDialogVisible=!1},nextStep(){this.step+=1,this.step>3&&(this.step=3),this.scrollToEnd()},linkTo(e){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),e))}},computed:{setupAuthenticatorOnDeviceStep2ShowCodes(){return Object(j["translate"])("TwoFactorAuth_SetupAuthenticatorOnDeviceStep2ShowCodes",Object(j["translate"])("TwoFactorAuth_ShowCodes"))},showCodeModalInstructions3(){return Object(j["translate"])("TwoFactorAuth_ShowCodeModalInstructions3",Object(j["translate"])("General_Continue"))}}});ue.render=K;var de=ue;const be={class:"message_container"},pe=["innerHTML"],me=Object(a["createElementVNode"])("br",null,null,-1),Oe={class:"row"},je={class:"col s12 input-field"},he=["value"],fe=Object(a["createElementVNode"])("input",{type:"text",name:"form_authcode",placeholder:"",id:"form_authcode",class:"input",value:"",size:"20",autocorrect:"off",autocapitalize:"none",autocomplete:"one-time-code",tabindex:"10",autofocus:"autofocus"},null,-1),we={for:"form_authcode"},ye=Object(a["createElementVNode"])("i",{class:"icon-user icon"},null,-1),ge={class:"row actions"},ve={class:"col s12"},Ce=["value"],Ne=["innerHTML"],Ee=Object(a["createElementVNode"])("br",null,null,-1),Ve=Object(a["createElementVNode"])("br",null,null,-1),Te=Object(a["createElementVNode"])("br",null,null,-1),Se=["href"],Ae=Object(a["createElementVNode"])("br",null,null,-1),Fe=["href"],ke=Object(a["createElementVNode"])("br",null,null,-1),_e=["href"];function De(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("FormErrors"),i=Object(a["resolveComponent"])("Notification"),s=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{"content-title":e.translate("TwoFactorAuth_TwoFactorAuthentication")},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("div",be,[Object(a["createVNode"])(l,{"form-errors":e.formData.errors},null,8,["form-errors"]),e.accessErrorString?(Object(a["openBlock"])(),Object(a["createBlock"])(i,{key:0,noclear:!0,context:"error"},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("General_Error")),1),Object(a["createTextVNode"])(": "),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.accessErrorString)},null,8,pe),me]),_:1})):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("form",Object(a["mergeProps"])(e.formDataAttributes,{class:"loginTwoFaForm"}),[Object(a["createElementVNode"])("div",Oe,[Object(a["createElementVNode"])("div",je,[Object(a["createElementVNode"])("input",{type:"hidden",name:"form_nonce",id:"login_form_nonce",value:e.formNonce},null,8,he),fe,Object(a["createElementVNode"])("label",we,[ye,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("TwoFactorAuth_AuthenticationCode")),1)])])]),Object(a["createElementVNode"])("div",ge,[Object(a["createElementVNode"])("div",ve,[Object(a["createElementVNode"])("input",{class:"submit btn btn-block",id:"login_form_submit",type:"submit",value:e.translate("TwoFactorAuth_Verify"),tabindex:"100"},null,8,Ce)])])],16),Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_VerifyIdentifyExplanation"))+" ",1),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.learnMoreText)},null,8,Ne),Ee,Ve,Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_DontHaveYourMobileDevice")),1),Te,Object(a["createElementVNode"])("a",{href:e.externalRawLink("https://matomo.org/faq/how-to/faq_27248"),rel:"noreferrer noopener",target:"_blank"},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_EnterRecoveryCodeInstead")),9,Se),Ae,Object(a["createElementVNode"])("a",{href:e.mailToLink,rel:"noreferrer noopener"},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_AskSuperUserResetAuthenticationCode")),9,Fe),ke,Object(a["createElementVNode"])("a",{href:e.logoutLink,rel:"noreferrer noopener"},Object(a["toDisplayString"])(e.translate("General_Logout")),9,_e)])]),_:1},8,["content-title"])}var Be=o("5b81"),xe=Object(a["defineComponent"])({props:{formData:{type:Object,required:!0},accessErrorString:String,formNonce:{type:String,required:!0},loginModule:{type:String,required:!0},piwikUrl:String,userLogin:{type:String,required:!0},contactEmail:{type:String,required:!0}},components:{ContentBlock:j["ContentBlock"],Notification:j["Notification"],FormErrors:Be["FormErrors"]},computed:{learnMoreText(){return Object(j["translate"])("General_LearnMore",Object(j["externalLink"])("https://matomo.org/faq/general/faq_27245"),"")},mailToLink(){return`mailto:${this.contactEmail}?${j["MatomoUrl"].stringify({subject:Object(j["translate"])("TwoFactorAuth_NotPossibleToLogIn"),body:Object(j["translate"])("TwoFactorAuth_LostAuthenticationDevice","\n\n","\n\n",this.piwikUrl||"","\n\n",this.userLogin,Object(j["externalRawLink"])("https://matomo.org/faq/how-to/faq_27248"))})}`},logoutLink(){return"?"+j["MatomoUrl"].stringify({module:this.loginModule,action:"logout"})},formDataAttributes(){return Object.fromEntries(this.formData.attributes.split(/\s+/g).filter(e=>e).map(e=>e.split("=")).map(([e,t])=>[e,j["Matomo"].helper.htmlDecode(t.substr(1,t.length-2))]))}}});xe.render=De;var Me=xe;const Le={class:"successMessage"},Re=Object(a["createElementVNode"])("br",null,null,-1),qe=["href"];function Ue(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(l,{class:"twoFactorSetupFinished"},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("h2",Le,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupFinishedTitle")),1),Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupFinishedSubtitle")),1),Object(a["createElementVNode"])("p",null,[Re,Object(a["createElementVNode"])("a",{class:"btn",href:e.userSecurityLink},Object(a["toDisplayString"])(e.translate("General_Continue")),9,qe)])]),_:1})}var Pe=Object(a["defineComponent"])({components:{ContentBlock:j["ContentBlock"]},computed:{userSecurityLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"}))}}});Pe.render=Ue;var Ge=Pe;const He=["innerHTML"],$e={key:0},Ie={class:"twoFaStatusEnabled"},ze={key:1},Qe={key:0},Xe=Object(a["createElementVNode"])("br",null,null,-1),Ye=Object(a["createElementVNode"])("br",null,null,-1),We=["href"],Je={key:1},Ke=["href"],Ze=["href"],et=["value"],tt=["href"],ot={key:2},nt=Object(a["createElementVNode"])("br",null,null,-1),rt=Object(a["createElementVNode"])("br",null,null,-1),at=["href"],ct={id:"confirmDisable2FA",class:"ui-confirm",ref:"confirmDisable2FA"},lt=["value"],it=["value"];function st(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(l,{"content-title":e.contentTitle,class:"userSettings2FA"},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.twoFactorAuthIntro)},null,8,He),e.isEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",$e,[Object(a["createElementVNode"])("strong",Ie,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_TwoFactorAuthenticationIsEnabled")),1)])):Object(a["createCommentVNode"])("",!0),e.isEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",ze,[e.isForced?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Qe,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_TwoFactorAuthenticationRequired"))+" ",1),Xe,Ye,Object(a["createElementVNode"])("a",{class:"btn btn-link enable2FaLink",href:e.setupTwoFactorAuthLink,style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ConfigureDifferentDevice")),9,We)])):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Je,[Object(a["createElementVNode"])("a",{class:"btn btn-link enable2FaLink",href:e.setupTwoFactorAuthLink,style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ConfigureDifferentDevice")),9,Ke),Object(a["createElementVNode"])("a",{href:e.disableTwoFactorAuthLink,style:{display:"none"},id:"disable2fa"},"disable2fa",8,Ze),Object(a["createElementVNode"])("input",{type:"button",class:"btn btn-link disable2FaLink",onClick:t[0]||(t[0]=t=>e.onDisable2FaLinkClick()),value:e.translate("TwoFactorAuth_DisableTwoFA"),style:{"margin-right":"3.5px"}},null,8,et)])),Object(a["createElementVNode"])("a",{class:"btn btn-link showRecoveryCodesLink",href:e.showRecoveryCodesLink},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ShowRecoveryCodes")),9,tt)])):(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",ot,[Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_TwoFactorAuthenticationIsDisabled")),1),nt,rt,Object(a["createElementVNode"])("a",{class:"btn btn-link enable2FaLink",href:e.setupTwoFactorAuthLink},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_EnableTwoFA")),9,at)])),Object(a["createElementVNode"])("div",ct,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ConfirmDisableTwoFA")),1),Object(a["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,lt),Object(a["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,it)],512)]),_:1},8,["content-title"])}var ut=Object(a["defineComponent"])({props:{isEnabled:Boolean,isForced:Boolean,disableNonce:{type:String,required:!0}},components:{ContentBlock:j["ContentBlock"]},computed:{contentTitle(){const e=Object(j["translate"])("TwoFactorAuth_TwoFactorAuthentication"),t=Object(j["translate"])("TwoFactorAuth_TwoFAShort");return`${e} (${t})`},twoFactorAuthIntro(){return Object(j["translate"])("TwoFactorAuth_TwoFactorAuthenticationIntro",Object(j["externalLink"])("https://matomo.org/faq/general/faq_27245"),"")},setupTwoFactorAuthLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"TwoFactorAuth",action:"setupTwoFactorAuth"}))},disableTwoFactorAuthLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"TwoFactorAuth",action:"disableTwoFactorAuth",disableNonce:this.disableNonce}))},showRecoveryCodesLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"TwoFactorAuth",action:"showRecoveryCodes"}))}},methods:{onDisable2FaLinkClick(){const e=this.disableNonce;j["Matomo"].helper.modalConfirm(this.$refs.confirmDisable2FA,{yes(){j["MatomoUrl"].updateUrl({module:"TwoFactorAuth",action:"disableTwoFactorAuth",disableNonce:e})}})}}});ut.render=st;var dt=ut; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */}})})); -//# sourceMappingURL=TwoFactorAuth.umd.min.js.map \ No newline at end of file diff --git a/plugins/TwoFactorAuth/vue/dist/umd.metadata.json b/plugins/TwoFactorAuth/vue/dist/umd.metadata.json deleted file mode 100644 index ed3e9b188b06343a88f0147f11d5c80238e81463..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/dist/umd.metadata.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dependsOn": [ - "CoreHome", - "CorePluginsAdmin", - "Login" - ] -} \ No newline at end of file diff --git a/plugins/TwoFactorAuth/vue/src/LoginTwoFactorAuth/LoginTwoFactorAuth.vue b/plugins/TwoFactorAuth/vue/src/LoginTwoFactorAuth/LoginTwoFactorAuth.vue deleted file mode 100644 index 1155bf9797a15fabb1b8f7e0a547453bd87c69f1..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/src/LoginTwoFactorAuth/LoginTwoFactorAuth.vue +++ /dev/null @@ -1,182 +0,0 @@ - - - - - diff --git a/plugins/TwoFactorAuth/vue/src/SetupFinished/SetupFinished.vue b/plugins/TwoFactorAuth/vue/src/SetupFinished/SetupFinished.vue deleted file mode 100644 index 19e30ef59aadcbe67a8637a4cc258517d708cc30..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/src/SetupFinished/SetupFinished.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - diff --git a/plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/InstallOTPApp.vue b/plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/InstallOTPApp.vue deleted file mode 100644 index d05687bb54d2227dcbd598e6b1211e4168c1f194..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/InstallOTPApp.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - - - diff --git a/plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/SetupTwoFactorAuth.vue b/plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/SetupTwoFactorAuth.vue deleted file mode 100644 index 885da51adb733e7075a6e07213203888bdfc26ed..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/src/SetupTwoFactorAuth/SetupTwoFactorAuth.vue +++ /dev/null @@ -1,303 +0,0 @@ - - - - - diff --git a/plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodes.vue b/plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodes.vue deleted file mode 100644 index 23a3f7cbc58f411991ef21c498814a9e765986dc..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodes.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodesPage.vue b/plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodesPage.vue deleted file mode 100644 index ec0ee558774a5d0961c13d2e0c33209e7391ad50..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/src/ShowRecoveryCodes/ShowRecoveryCodesPage.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - diff --git a/plugins/TwoFactorAuth/vue/src/UserSettings/UserSettings.vue b/plugins/TwoFactorAuth/vue/src/UserSettings/UserSettings.vue deleted file mode 100644 index 23bb9fe6f324ec944cbd6c450590c4640b0847fe..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/src/UserSettings/UserSettings.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - - - diff --git a/plugins/TwoFactorAuth/vue/src/index.ts b/plugins/TwoFactorAuth/vue/src/index.ts deleted file mode 100644 index 4165a1b99a065e1cbbc71c908ac438d1788884e1..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/src/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -export { default as ShowRecoveryCodes } from './ShowRecoveryCodes/ShowRecoveryCodes.vue'; -export { default as ShowRecoveryCodesPage } from './ShowRecoveryCodes/ShowRecoveryCodesPage.vue'; -export { default as SetupTwoFactorAuth } from './SetupTwoFactorAuth/SetupTwoFactorAuth.vue'; -export { default as LoginTwoFactorAuth } from './LoginTwoFactorAuth/LoginTwoFactorAuth.vue'; -export { default as SetupFinished } from './SetupFinished/SetupFinished.vue'; -export { default as UserSettings } from './UserSettings/UserSettings.vue'; diff --git a/plugins/TwoFactorAuth/vue/src/types.ts b/plugins/TwoFactorAuth/vue/src/types.ts deleted file mode 100644 index 8ccfb39804b2be51be2aed7abf7d74f6a79acb38..0000000000000000000000000000000000000000 --- a/plugins/TwoFactorAuth/vue/src/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -export interface QRCodeConstructor { - new (e: HTMLElement, options: unknown): unknown; -} - -declare global { - interface Window { - QRCode: QRCodeConstructor; - } -} diff --git a/plugins/UserCountry/API.php b/plugins/UserCountry/API.php deleted file mode 100644 index 443c96ceb23f0c2431e52aff17d897a1ee3ed778..0000000000000000000000000000000000000000 --- a/plugins/UserCountry/API.php +++ /dev/null @@ -1,508 +0,0 @@ -getDataTable(Archiver::COUNTRY_RECORD_NAME, $idSite, $period, $date, $segment); - - $dataTable->filter(function (DataTable $dt) { - if ($dt->getRowFromLabel('ti')) { - $dt->filter('GroupBy', array( - 'label', - function ($label) { - if ($label == 'ti') { - return 'cn'; - } - return $label; - }, - )); - } - }); - - // apply filter on the whole datatable in order the inline search to work (searches are done on "beautiful" label) - $dataTable->filter('AddSegmentValue'); - $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'code')); - $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getFlagFromCode')); - $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\countryTranslate')); - - $dataTable->queueFilter('ColumnCallbackAddMetadata', array( - array(), - 'logoHeight', - function () { - return 16; - }, - )); - - return $dataTable; - } - - /** - * Returns visit information grouped by continent. - * - * @param int|string|int[] $idSite Website ID(s) to query. - * - Single site ID (e.g. 1) - * - Multiple site IDs (e.g. [1, 4, 5]) - * - Comma-separated list ("1,4,5") or "all" - * @param 'day'|'week'|'month'|'year'|'range' $period The period to process, processes data for the period - * containing the specified date. - * @param string $date The date or date range to process. - * 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), - * or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX). - * @param string|false|null $segment Custom segment to filter the report. - * Example: "referrerName==example.com" - * Supports AND (;) and OR (,) operators. - * @return DataTable|DataTable\Map Continent rows with translated labels and continent codes. - */ - public function getContinent($idSite, string $period, string $date, $segment = false) - { - $dataTable = $this->getDataTable(Archiver::COUNTRY_RECORD_NAME, $idSite, $period, $date, $segment); - - $getContinent = array('Piwik\Common', 'getContinent'); - $dataTable->filter('GroupBy', array('label', $getContinent)); - - $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\continentTranslate')); - $dataTable->queueFilter('ColumnCallbackAddMetadata', array('label', 'code')); - - return $dataTable; - } - - /** - * Returns visit information for every region with at least one visit. - * - * @param int|string|int[] $idSite Website ID(s) to query. - * - Single site ID (e.g. 1) - * - Multiple site IDs (e.g. [1, 4, 5]) - * - Comma-separated list ("1,4,5") or "all" - * @param 'day'|'week'|'month'|'year'|'range' $period The period to process, processes data for the period - * containing the specified date. - * @param string $date The date or date range to process. - * 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), - * or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX). - * @param string|false|null $segment Custom segment to filter the report. - * Example: "referrerName==example.com" - * Supports AND (;) and OR (,) operators. - * @return DataTable|DataTable\Map Region rows with country, region, and flag metadata. - */ - public function getRegion($idSite, string $period, string $date, $segment = false) - { - $dataTable = $this->getDataTable(Archiver::REGION_RECORD_NAME, $idSite, $period, $date, $segment); - - $separator = Archiver::LOCATION_SEPARATOR; - $unk = Visit::UNKNOWN_CODE; - - $dataTable->filter(function (DataTable $dt) use ($period, $date, $separator) { - /** @var string $archiveDate */ - $archiveDate = $dt->getMetadata(DataTable::ARCHIVED_DATE_METADATA_NAME); - - // convert fips region codes to iso if required - if ($this->shouldRegionCodesBeConvertedToIso($archiveDate, $date, $period)) { - $dt->filter('GroupBy', array( - 'label', - function ($label) use ($separator) { - $regionCode = (string)getElementFromStringArray($label, $separator, 0, ''); - $countryCode = (string)getElementFromStringArray($label, $separator, 1, ''); - - list($countryCode, $regionCode) = GeoIp2::convertRegionCodeToIso( - $countryCode, - $regionCode, - true - ); - - $splitLabel = explode($separator, $label); - - if (isset($splitLabel[0])) { - $splitLabel[0] = $regionCode; - } - - if (isset($splitLabel[1])) { - $splitLabel[1] = strtolower($countryCode); - } - - return implode($separator, $splitLabel); - }, - )); - } elseif ($dt->getRowFromLabel('1|ti')) { - $dt->filter('GroupBy', array( - 'label', - function ($label) { - if ($label == '1|ti') { - return '14|cn'; - } - return $label; - }, - )); - } - }); - - $segments = array('regionCode', 'countryCode'); - $dataTable->filter('AddSegmentByLabel', array($segments, Archiver::LOCATION_SEPARATOR)); - - // split the label and put the elements into the 'region' and 'country' metadata fields - $dataTable->filter( - 'ColumnCallbackAddMetadata', - array('label', 'region', __NAMESPACE__ . '\getElementFromStringArray', array($separator, 0, $unk)) - ); - $dataTable->filter( - 'ColumnCallbackAddMetadata', - array('label', 'country', __NAMESPACE__ . '\getElementFromStringArray', array($separator, 1, $unk)) - ); - - // add country name metadata - $dataTable->filter( - 'MetadataCallbackAddMetadata', - array('country', 'country_name', __NAMESPACE__ . '\CountryTranslate', $applyToSummaryRow = false) - ); - - // get the region name of each row and put it into the 'region_name' metadata - $dataTable->filter( - 'ColumnCallbackAddMetadata', - array('label', 'region_name', __NAMESPACE__ . '\getRegionName', $params = null, - $applyToSummaryRow = false) - ); - - // add the country flag as a url to the 'logo' metadata field - $dataTable->filter('MetadataCallbackAddMetadata', array('country', 'logo', __NAMESPACE__ . '\getFlagFromCode')); - - // prettify the region label - $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getPrettyRegionName')); - - $dataTable->queueFilter('ReplaceSummaryRowLabel'); - - return $dataTable; - } - - /** - * Returns visit information for every city with at least one visit. - * - * @param int|string|int[] $idSite Website ID(s) to query. - * - Single site ID (e.g. 1) - * - Multiple site IDs (e.g. [1, 4, 5]) - * - Comma-separated list ("1,4,5") or "all" - * @param 'day'|'week'|'month'|'year'|'range' $period The period to process, processes data for the period - * containing the specified date. - * @param string $date The date or date range to process. - * 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), - * or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX). - * @param string|false|null $segment Custom segment to filter the report. - * Example: "referrerName==example.com" - * Supports AND (;) and OR (,) operators. - * @return DataTable|DataTable\Map City rows with city, region, country, and flag metadata. - */ - public function getCity($idSite, string $period, string $date, $segment = false) - { - $dataTable = $this->getDataTable(Archiver::CITY_RECORD_NAME, $idSite, $period, $date, $segment); - - $separator = Archiver::LOCATION_SEPARATOR; - $unk = Visit::UNKNOWN_CODE; - - $dataTable->filter(function (DataTable $dt) use ($period, $date, $separator) { - /** @var string $archiveDate */ - $archiveDate = $dt->getMetadata(DataTable::ARCHIVED_DATE_METADATA_NAME); - - // convert fips region codes to iso if required - if ($this->shouldRegionCodesBeConvertedToIso($archiveDate, $date, $period)) { - $dt->filter('GroupBy', array( - 'label', - function ($label) use ($separator) { - $regionCode = (string)getElementFromStringArray($label, $separator, 1, ''); - $countryCode = (string)getElementFromStringArray($label, $separator, 2, ''); - - list($countryCode, $regionCode) = GeoIp2::convertRegionCodeToIso( - $countryCode, - $regionCode, - true - ); - - $splitLabel = explode($separator, $label); - - if (isset($splitLabel[1])) { - $splitLabel[1] = $regionCode; - } - - if (isset($splitLabel[2])) { - $splitLabel[2] = strtolower($countryCode); - } - - return implode($separator, $splitLabel); - }, - )); - } else { - $dt->filter('GroupBy', array( - 'label', - function ($label) { - if (substr($label, -5) == '|1|ti') { - return substr($label, 0, -5) . '|14|cn'; - } - return $label; - }, - )); - } - }); - - $segments = array('city', 'regionCode', 'countryCode'); - $dataTable->filter('AddSegmentByLabel', array($segments, Archiver::LOCATION_SEPARATOR)); - - // split the label and put the elements into the 'city_name', 'region', 'country', - // 'lat' & 'long' metadata fields - $strUnknown = Piwik::translate('General_Unknown'); - $dataTable->filter( - 'ColumnCallbackAddMetadata', - array('label', 'city_name', __NAMESPACE__ . '\getElementFromStringArray', - array($separator, 0, $strUnknown)) - ); - $dataTable->filter( - 'MetadataCallbackAddMetadata', - array('city_name', 'city', function ($city) use ($strUnknown) { - if ($city == $strUnknown) { - return "xx"; - } else { - return false; - } - }) - ); - $dataTable->filter( - 'ColumnCallbackAddMetadata', - array('label', 'region', __NAMESPACE__ . '\getElementFromStringArray', array($separator, 1, $unk)) - ); - $dataTable->filter( - 'ColumnCallbackAddMetadata', - array('label', 'country', __NAMESPACE__ . '\getElementFromStringArray', array($separator, 2, $unk)) - ); - - // backwards compatibility: for reports that have lat|long in label - $dataTable->filter( - 'ColumnCallbackAddMetadata', - array('label', 'lat', __NAMESPACE__ . '\getElementFromStringArray', array($separator, 3, false)) - ); - $dataTable->filter( - 'ColumnCallbackAddMetadata', - array('label', 'long', __NAMESPACE__ . '\getElementFromStringArray', array($separator, 4, false)) - ); - - // add country name & region name metadata - $dataTable->filter( - 'MetadataCallbackAddMetadata', - array('country', 'country_name', __NAMESPACE__ . '\countryTranslate', $applyToSummaryRow = false) - ); - - $getRegionName = '\\Piwik\\Plugins\\UserCountry\\getRegionNameFromCodes'; - $dataTable->filter('MetadataCallbackAddMetadata', array( - array('country', 'region'), 'region_name', $getRegionName, $applyToSummaryRow = false)); - - // add the country flag as a url to the 'logo' metadata field - $dataTable->filter('MetadataCallbackAddMetadata', array('country', 'logo', __NAMESPACE__ . '\getFlagFromCode')); - - // prettify the label - $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getPrettyCityName')); - - $dataTable->queueFilter('ReplaceSummaryRowLabel'); - - return $dataTable; - } - - /** - * if no switch to ISO was done --> no conversion as only FIPS codes are in use and handled correctly - * if there has been a switch to ISO, we need to check the date: - * - if the start date of the period is after the date we switched to ISO: no conversion needed - * - if not we need to convert the codes to ISO, if the code is mappable - * Note: as all old codes are mapped, not mappable codes need to be iso codes already, so we leave them - * - * @param string $archiveDate - */ - private function shouldRegionCodesBeConvertedToIso($archiveDate, string $date, string $period): bool - { - $timeOfSwitch = Option::get(GeoIp2::SWITCH_TO_ISO_REGIONS_OPTION_NAME); - - if (empty($timeOfSwitch)) { - return false; // if option was not set, all codes are fips codes, so leave them - } - - try { - $dateOfSwitch = Date::factory((int)$timeOfSwitch); - $period = Period\Factory::build($period, $date); - $periodStart = $period->getDateStart(); - } catch (Exception $e) { - return false; - } - - // if all region codes in log tables have been converted, check if archiving date was after the date of switch to iso - // this check might not be fully correct in cases were only periods > day get recreated, but it should avoid some - // double conversion if all archives have been recreated after converting all region codes - $codesConverted = Option::get(ConvertRegionCodesToIso::OPTION_NAME); - - if ($codesConverted && $archiveDate) { - try { - $dateOfArchive = Date::factory($archiveDate); - - if ($dateOfArchive->isLater($dateOfSwitch)) { - return false; - } - } catch (Exception $e) { - } - } - - if ($dateOfSwitch->isEarlier($periodStart)) { - return false; - } - - return true; - } - - /** - * Returns a mapping from ISO country code to translated country name. - * - * @return array Country names keyed by lowercase ISO country code. - */ - public function getCountryCodeMapping(): array - { - $regionDataProvider = StaticContainer::get('Piwik\Intl\Data\Provider\RegionDataProvider'); - - $countryCodeList = $regionDataProvider->getCountryList(); - - array_walk($countryCodeList, function (&$item, $key) { - $item = Piwik::translate('Intl_Country_' . strtoupper($key)); - }); - - return $countryCodeList; - } - - /** - * Uses a location provider to find/guess the location of an IP address. - * - * See LocationProvider::getLocation to see the details - * of the result of this function. - * - * @param string|false $ip The IP address to geolocate, or `false` to use the current request IP. - * @param string|false $provider The provider ID to use, or `false` to use the currently configured provider. - * @return array Location data returned by the selected provider. - */ - public function getLocationFromIP($ip = false, $provider = false): array - { - Piwik::checkUserHasSomeViewAccess(); - - if (empty($ip)) { - $ip = IP::getIpFromHeader(); - } - - if (empty($provider)) { - $provider = LocationProvider::getCurrentProviderId(); - } - - $oProvider = LocationProvider::getProviderById($provider); - if (empty($oProvider)) { - throw new Exception("Cannot find the '$provider' provider. It is either an invalid provider " - . "ID or the ID of a provider that is not working."); - } - - $location = $oProvider->getLocation(array('ip' => $ip)); - if (empty($location)) { - throw new Exception("Could not geolocate '$ip'!"); - } - $location['ip'] = $ip; - return $location; - } - - /** - * Sets the active geolocation provider. - * - * @param string $providerId The provider ID to activate, for example `default` or `geoip2_php`. - * @return void - */ - public function setLocationProvider($providerId) - { - Piwik::checkUserHasSuperUserAccess(); - - if (!UserCountry::isGeoLocationAdminEnabled()) { - throw new \Exception('Setting geo location has been disabled in config.'); - } - - LocationProvider::setCurrentProvider($providerId); - } - - /** - * @param int|string|int[] $idSite - * @param string|false|null $segment - * @return DataTable|DataTable\Map - */ - protected function getDataTable(string $name, $idSite, string $period, string $date, $segment) - { - Piwik::checkUserHasViewAccess($idSite); - $archive = Archive::build($idSite, $period, $date, $segment); - $dataTable = $archive->getDataTable($name); - $dataTable->queueFilter('ReplaceColumnNames'); - return $dataTable; - } - - /** - * Returns the number of distinct countries in the requested period. - * - * @param int|string|int[] $idSite Website ID(s) to query. - * - Single site ID (e.g. 1) - * - Multiple site IDs (e.g. [1, 4, 5]) - * - Comma-separated list ("1,4,5") or "all" - * @param 'day'|'week'|'month'|'year'|'range' $period The period to process, processes data for the period - * containing the specified date. - * @param string $date The date or date range to process. - * 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), - * or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX). - * @param string|false|null $segment Custom segment to filter the report. - * Example: "referrerName==example.com" - * Supports AND (;) and OR (,) operators. - * @return DataTable|DataTable\Map Numeric archive result containing the number of distinct countries. - */ - public function getNumberOfDistinctCountries($idSite, string $period, string $date, $segment = false) - { - Piwik::checkUserHasViewAccess($idSite); - $archive = Archive::build($idSite, $period, $date, $segment); - return $archive->getDataTableFromNumeric(Archiver::DISTINCT_COUNTRIES_METRIC); - } -} diff --git a/plugins/UserCountry/Archiver.php b/plugins/UserCountry/Archiver.php deleted file mode 100644 index 0cd3800b42bf221b751c6f298bd3a1b3ee4bc19e..0000000000000000000000000000000000000000 --- a/plugins/UserCountry/Archiver.php +++ /dev/null @@ -1,30 +0,0 @@ -