From 3fdccfa68a2cbfc648be1275ff6f6632742ddd9b Mon Sep 17 00:00:00 2001 From: "Matt (IPv4) Cowley" Date: Mon, 18 Jan 2021 19:45:19 +0000 Subject: [PATCH] Refactor analytics events (#209) * Refactor analytics.js * Update analytics calls in app.vue * Update analytics calls in presets.vue * Update analytics calls in tools.vue (and app.vue) * Update analytics calls in global.vue * Update analytics calls in domain.vue * Update analytics calls in setup.vue * Add list of all events to analytics.js * Add custom copy to clipboard that emits event * Emit the events from the components * Update copyright year in all files touched * Update analytics calls in download.vue * Update analytics calls in ssl.vue * Update analytics calls in certbot.vue * Update analytics calls in domain.vue * Update analytics calls in app.vue * Note down 'Code snippet copied' events --- src/nginxconfig/templates/app.vue | 71 ++++- src/nginxconfig/templates/domain.vue | 42 ++- .../templates/domain_sections/onion.vue | 4 +- .../templates/domain_sections/presets.vue | 12 +- src/nginxconfig/templates/global.vue | 42 ++- .../templates/global_sections/tools.vue | 80 ++++-- src/nginxconfig/templates/prism/bash.vue | 9 +- src/nginxconfig/templates/prism/docker.vue | 9 +- src/nginxconfig/templates/prism/nginx.vue | 9 +- src/nginxconfig/templates/prism/yaml.vue | 9 +- src/nginxconfig/templates/setup.vue | 64 ++++- .../templates/setup_sections/certbot.vue | 39 ++- .../templates/setup_sections/download.vue | 22 +- .../templates/setup_sections/go_live.vue | 16 +- .../templates/setup_sections/ssl.vue | 19 +- src/nginxconfig/util/analytics.js | 263 +++++++++++++++--- src/nginxconfig/util/prism_bundle.js | 53 +++- 17 files changed, 650 insertions(+), 113 deletions(-) diff --git a/src/nginxconfig/templates/app.vue b/src/nginxconfig/templates/app.vue index 76874f1..da5069b 100644 --- a/src/nginxconfig/templates/app.vue +++ b/src/nginxconfig/templates/app.vue @@ -1,5 +1,5 @@ @@ -42,5 +42,10 @@ THE SOFTWARE. console.info(`Highlighting ${this.$props.cmd}...`); Prism.highlightAllUnder(this.$el); }, + methods: { + copied(event) { + this.$emit('copied', event.detail.text); + }, + }, }; diff --git a/src/nginxconfig/templates/prism/docker.vue b/src/nginxconfig/templates/prism/docker.vue index 96635db..670e13c 100644 --- a/src/nginxconfig/templates/prism/docker.vue +++ b/src/nginxconfig/templates/prism/docker.vue @@ -1,5 +1,5 @@