From a15dd23d606aa7334138bcad0b2da2b504ec658a Mon Sep 17 00:00:00 2001 From: LianaHus Date: Tue, 6 Oct 2020 11:06:19 +0200 Subject: [PATCH 01/14] added new item to settings for matomo --- apps/remix-ide/src/app/tabs/settings-tab.js | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) 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') From 311daa8d5893b15a3b5b581ccc43caae0d9be032 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Tue, 6 Oct 2020 12:14:13 +0200 Subject: [PATCH 02/14] text color corrected --- apps/remix-ide/src/app/tabs/settings-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/settings-tab.js b/apps/remix-ide/src/app/tabs/settings-tab.js index 431a71868f..b07385aeaa 100644 --- a/apps/remix-ide/src/app/tabs/settings-tab.js +++ b/apps/remix-ide/src/app/tabs/settings-tab.js @@ -122,7 +122,7 @@ module.exports = class SettingsTab extends ViewPlugin { this._view.useMatomoAnalytics = yo`` this._view.useMatomoAnalyticsMode = yo`` this._view.useMatomoAnalyticsLabel = yo` -