diff --git a/apps/remix-ide/src/app/tabs/settings-tab.js b/apps/remix-ide/src/app/tabs/settings-tab.js index 2c304465c2..431a71868f 100644 --- a/apps/remix-ide/src/app/tabs/settings-tab.js +++ b/apps/remix-ide/src/app/tabs/settings-tab.js @@ -37,6 +37,8 @@ module.exports = class SettingsTab extends ViewPlugin { optionVMLabel: null, personal: null, personalLabel: null, + useMatomoAnalytics: null, + useMatomoAnalyticsLabel: null, warnPersonalMode: null, generateContractMetadata: null, generateContractMetadataLabel: null, @@ -117,6 +119,17 @@ module.exports = class SettingsTab extends ViewPlugin { if (this.config.get('settings/personal-mode')) this._view.personal.setAttribute('checked', '') elementStateChanged(self._view.personalLabel, !this.config.get('settings/personal-mode')) + this._view.useMatomoAnalytics = yo`` + this._view.useMatomoAnalyticsMode = yo`` + this._view.useMatomoAnalyticsLabel = yo` + + ` + if (this.config.get('settings/matomo-analytics')) this._view.useMatomoAnalytics.setAttribute('checked', '') + elementStateChanged(self._view.personalLabel, !this.config.get('settings/matomo-analytics')) + this._view.generateContractMetadata = yo`` this._view.generateContractMetadataLabel = yo`` if (this.config.get('settings/generate-contract-metadata') === undefined) this.config.set('settings/generate-contract-metadata', true) @@ -148,6 +161,10 @@ module.exports = class SettingsTab extends ViewPlugin { ${this._view.personal}> ${this._view.personalLabel} +
+ ${this._view.useMatomoAnalytics}> + ${this._view.useMatomoAnalyticsLabel} +
` @@ -200,6 +217,13 @@ module.exports = class SettingsTab extends ViewPlugin { self.config.set('settings/personal-mode', !isChecked) elementStateChanged(self._view.personalLabel, isChecked) } + function onchangeMatomoAnalytics () { + const isChecked = self.config.get('settings/matomo-analytics') + + self.config.set('settings/matomo-analytics', !isChecked) + elementStateChanged(self._view.useMatomoAnalyticsLabel, isChecked) + } + function elementStateChanged (el, isChanged) { if (isChanged) { el.classList.remove('text-dark')