From dd20b8f01fe2420cec8f3ea90e1df2d0de2902b4 Mon Sep 17 00:00:00 2001 From: ronniew Date: Mon, 8 Nov 2021 19:53:41 +0100 Subject: [PATCH] Correct vue version docs url on vue link --- src/popup/App.vue | 155 +++++++++++++++++++++++++++++++--------------- 1 file changed, 106 insertions(+), 49 deletions(-) diff --git a/src/popup/App.vue b/src/popup/App.vue index a30ec03..14c3af1 100755 --- a/src/popup/App.vue +++ b/src/popup/App.vue @@ -13,15 +13,38 @@ target="_blank" class="mr-3" > - Open + + Open + - {{ saving ? 'Saving...' : 'Save' }} + + {{ saving ? 'Saving...' : 'Save' }} + - + - + @@ -29,22 +52,39 @@ -
+
Loading...
-
-
Please enter an url in the address bar.
+
+
+ Please enter an url in the address bar. +
- Could not save website to Vue Telescope, please try again later or contact us. + Could not save website to Vue Telescope, please try again later or + contact us.
-

+

Info

@@ -53,15 +93,11 @@ - +
{{ showcase.vueVersion }}
@@ -112,7 +148,9 @@
-

- Plugins +

+ Plugins

@@ -139,19 +181,20 @@ target="_blank" class="mb-4 mr-4 border bg-grey-50 hover:bg-grey-100 border-grey-200 rounded-xl" > - - {{ plugin.name }} - + {{ + plugin.name + }}
-

- Nuxt Modules +

+ Nuxt + Modules

@@ -163,21 +206,23 @@ target="_blank" class="mb-4 mr-4 border bg-grey-50 hover:bg-grey-100 border-grey-200 rounded-xl" > - - {{ module.name }} - + {{ + module.name + }}
-
-
Vue is not used on this website
+
+
+ Vue is not used on this website +
-
@@ -199,7 +244,7 @@ import AppButton from '../components/AppButton.vue' export default { components: { - // // ExternalLinkIcon, + // // ExternalLinkIcon, LogoIcon, TwitterIcon, GithubIcon, @@ -225,11 +270,21 @@ export default { return false } const { hostname } = new URL(this.showcase.url) - if (this.showcase.url.endsWith(hostname) || this.showcase.url.endsWith(hostname + '/')) { + if ( + this.showcase.url.endsWith(hostname) || + this.showcase.url.endsWith(hostname + '/') + ) { return true } else { return false } + }, + vueDocsURL () { + return ( + (this.showcase.vueVersion.startsWith('1') && 'https://v1.vuejs.org') || + (this.showcase.vueVersion.startsWith('2') && 'https://vuejs.org') || + (this.showcase.vueVersion.startsWith('3') && 'https://v3.vuejs.org') + ) } }, mounted () { @@ -263,20 +318,22 @@ export default { this.isLoading = false this.showcase = res.payload || null - // this.sendToContent({ - // proxyTo: 'injected', - // from: 'popup', - // payload: 'test from popup' - // }) + // this.sendToContent({ + // proxyTo: 'injected', + // from: 'popup', + // payload: 'test from popup' + // }) }, async getCurrentTab () { - return await browser.tabs.query({ currentWindow: true, active: true }).then((tabsArray) => { - const { id, status, url } = tabsArray[0] - if (status === 'complete') { - return { id, url } - } - return null - }) + return await browser.tabs + .query({ currentWindow: true, active: true }) + .then(tabsArray => { + const { id, status, url } = tabsArray[0] + if (status === 'complete') { + return { id, url } + } + return null + }) }, sendToBackground (message) { return browser.runtime.sendMessage(message) @@ -300,9 +357,9 @@ export default { return } const sse = new EventSource( - `https://service.vuetelescope.com?url=${this.showcase.url}&isPublic=true` + `https://service.vuetelescope.com?url=${this.showcase.url}&isPublic=true` ) - sse.addEventListener('message', (event) => { + sse.addEventListener('message', event => { try { const res = JSON.parse(event.data) if (!res.error && !res.isAdultContent) {