diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/composable/copy.ts | 8 | ||||
-rw-r--r-- | src/tools/basic-auth-generator/basic-auth-generator.vue | 2 | ||||
-rw-r--r-- | src/tools/bcrypt/bcrypt.vue | 2 | ||||
-rw-r--r-- | src/tools/benchmark-builder/benchmark-builder.vue | 4 | ||||
-rw-r--r-- | src/tools/bip39-generator/bip39-generator.vue | 6 | ||||
-rw-r--r-- | src/tools/html-entities/html-entities.vue | 4 | ||||
-rw-r--r-- | src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue | 2 | ||||
-rw-r--r-- | src/tools/mac-address-lookup/mac-address-lookup.vue | 2 | ||||
-rw-r--r-- | src/tools/random-port-generator/random-port-generator.vue | 2 | ||||
-rw-r--r-- | src/tools/roman-numeral-converter/roman-numeral-converter.vue | 4 | ||||
-rw-r--r-- | src/tools/slugify-string/slugify-string.vue | 2 | ||||
-rw-r--r-- | src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue | 2 | ||||
-rw-r--r-- | src/tools/token-generator/token-generator.tool.vue | 2 | ||||
-rw-r--r-- | src/tools/url-encoder/url-encoder.vue | 4 |
14 files changed, 26 insertions, 20 deletions
diff --git a/src/composable/copy.ts b/src/composable/copy.ts index c781950..dcaed84 100644 --- a/src/composable/copy.ts +++ b/src/composable/copy.ts @@ -7,7 +7,13 @@ export function useCopy({ source, text = 'Copied to the clipboard' }: { source?: return { async copy(content?: string, { notificationMessage }: { notificationMessage?: string } = {}) { - await copy(content); + if (source) { + await copy(); + } + else { + await copy(content); + } + message.success(notificationMessage ?? text); }, }; diff --git a/src/tools/basic-auth-generator/basic-auth-generator.vue b/src/tools/basic-auth-generator/basic-auth-generator.vue index f96a8c7..a894612 100644 --- a/src/tools/basic-auth-generator/basic-auth-generator.vue +++ b/src/tools/basic-auth-generator/basic-auth-generator.vue @@ -30,7 +30,7 @@ const { copy } = useCopy({ source: header, text: 'Header copied to the clipboard </n-statistic> </c-card> <div mt-5 flex justify-center> - <c-button @click="copy"> + <c-button @click="copy()"> Copy header </c-button> </div> diff --git a/src/tools/bcrypt/bcrypt.vue b/src/tools/bcrypt/bcrypt.vue index 7e70db8..b166764 100644 --- a/src/tools/bcrypt/bcrypt.vue +++ b/src/tools/bcrypt/bcrypt.vue @@ -33,7 +33,7 @@ const compareMatch = computed(() => compareSync(compareString.value, compareHash <c-input-text :value="hashed" readonly text-center /> <div mt-5 flex justify-center> - <c-button @click="copy"> + <c-button @click="copy()"> Copy hash </c-button> </div> diff --git a/src/tools/benchmark-builder/benchmark-builder.vue b/src/tools/benchmark-builder/benchmark-builder.vue index 56776f2..91f3155 100644 --- a/src/tools/benchmark-builder/benchmark-builder.vue +++ b/src/tools/benchmark-builder/benchmark-builder.vue @@ -151,10 +151,10 @@ function copyAsBulletList() { </tbody> </n-table> <div mt-5 flex justify-center gap-3> - <c-button @click="copyAsMarkdown"> + <c-button @click="copyAsMarkdown()"> Copy as markdown table </c-button> - <c-button @click="copyAsBulletList"> + <c-button @click="copyAsBulletList()"> Copy as bullet list </c-button> </div> diff --git a/src/tools/bip39-generator/bip39-generator.vue b/src/tools/bip39-generator/bip39-generator.vue index 03c1fe3..a07941b 100644 --- a/src/tools/bip39-generator/bip39-generator.vue +++ b/src/tools/bip39-generator/bip39-generator.vue @@ -100,12 +100,12 @@ const { copy: copyPassphrase } = useCopy({ source: passphrase, text: 'Passphrase <n-input-group> <c-input-text v-model:value="entropy" placeholder="Your string..." /> - <c-button @click="refreshEntropy"> + <c-button @click="refreshEntropy()"> <n-icon size="22"> <Refresh /> </n-icon> </c-button> - <c-button @click="copyEntropy"> + <c-button @click="copyEntropy()"> <n-icon size="22"> <Copy /> </n-icon> @@ -122,7 +122,7 @@ const { copy: copyPassphrase } = useCopy({ source: passphrase, text: 'Passphrase <n-input-group> <c-input-text v-model:value="passphrase" placeholder="Your mnemonic..." raw-text /> - <c-button @click="copyPassphrase"> + <c-button @click="copyPassphrase()"> <n-icon size="22" :component="Copy" /> </c-button> </n-input-group> diff --git a/src/tools/html-entities/html-entities.vue b/src/tools/html-entities/html-entities.vue index a0f6102..1a2192e 100644 --- a/src/tools/html-entities/html-entities.vue +++ b/src/tools/html-entities/html-entities.vue @@ -37,7 +37,7 @@ const { copy: copyUnescaped } = useCopy({ source: unescapeOutput }); </n-form-item> <div flex justify-center> - <c-button @click="copyEscaped"> + <c-button @click="copyEscaped()"> Copy </c-button> </div> @@ -66,7 +66,7 @@ const { copy: copyUnescaped } = useCopy({ source: unescapeOutput }); </n-form-item> <div flex justify-center> - <c-button @click="copyUnescaped"> + <c-button @click="copyUnescaped()"> Copy </c-button> </div> diff --git a/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue b/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue index 713874a..9085725 100644 --- a/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue +++ b/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue @@ -42,7 +42,7 @@ const { copy } = useCopy({ source: loremIpsumText, text: 'Lorem ipsum copied to <c-input-text :value="loremIpsumText" multiline placeholder="Your lorem ipsum..." readonly mt-5 rows="5" /> <div mt-5 flex justify-center> - <c-button autofocus @click="copy"> + <c-button autofocus @click="copy()"> Copy </c-button> </div> diff --git a/src/tools/mac-address-lookup/mac-address-lookup.vue b/src/tools/mac-address-lookup/mac-address-lookup.vue index 05382eb..ef0927d 100644 --- a/src/tools/mac-address-lookup/mac-address-lookup.vue +++ b/src/tools/mac-address-lookup/mac-address-lookup.vue @@ -43,7 +43,7 @@ const { copy } = useCopy({ source: details, text: 'Vendor info copied to the cli </c-card> <div flex justify-center> - <c-button :disabled="!details" @click="copy"> + <c-button :disabled="!details" @click="copy()"> Copy vendor info </c-button> </div> diff --git a/src/tools/random-port-generator/random-port-generator.vue b/src/tools/random-port-generator/random-port-generator.vue index e4ac609..89ab217 100644 --- a/src/tools/random-port-generator/random-port-generator.vue +++ b/src/tools/random-port-generator/random-port-generator.vue @@ -14,7 +14,7 @@ const { copy } = useCopy({ source: port, text: 'Port copied to the clipboard' }) {{ port }} </div> <div flex justify-center gap-3> - <c-button @click="copy"> + <c-button @click="copy()"> Copy </c-button> <c-button @click="refreshPort"> diff --git a/src/tools/roman-numeral-converter/roman-numeral-converter.vue b/src/tools/roman-numeral-converter/roman-numeral-converter.vue index 4390122..d365cc5 100644 --- a/src/tools/roman-numeral-converter/roman-numeral-converter.vue +++ b/src/tools/roman-numeral-converter/roman-numeral-converter.vue @@ -49,7 +49,7 @@ const { copy: copyArabic } = useCopy({ source: outputNumeral, text: 'Arabic numb <div class="result"> {{ outputRoman }} </div> - <c-button autofocus :disabled="validationNumeral.validationStatus === 'error'" @click="copyRoman"> + <c-button autofocus :disabled="validationNumeral.validationStatus === 'error'" @click="copyRoman()"> Copy </c-button> </div> @@ -61,7 +61,7 @@ const { copy: copyArabic } = useCopy({ source: outputNumeral, text: 'Arabic numb <div class="result"> {{ outputNumeral }} </div> - <c-button :disabled="!validationRoman.isValid" @click="copyArabic"> + <c-button :disabled="!validationRoman.isValid" @click="copyArabic()"> Copy </c-button> </div> diff --git a/src/tools/slugify-string/slugify-string.vue b/src/tools/slugify-string/slugify-string.vue index 9156b79..f7666e3 100644 --- a/src/tools/slugify-string/slugify-string.vue +++ b/src/tools/slugify-string/slugify-string.vue @@ -15,7 +15,7 @@ const { copy } = useCopy({ source: slug, text: 'Slug copied to clipboard' }); <c-input-text :value="slug" multiline readonly placeholder="You slug will be generated here (ex: my-file-path)" label="Your slug" mb-5 /> <div flex justify-center> - <c-button :disabled="slug.length === 0" @click="copy"> + <c-button :disabled="slug.length === 0" @click="copy()"> Copy slug </c-button> </div> diff --git a/src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue b/src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue index bd8482c..76abbc4 100644 --- a/src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue +++ b/src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue @@ -26,7 +26,7 @@ const { copy } = useCopy({ source: natoText, text: 'NATO alphabet string copied. </c-card> <div mt-3 flex justify-center> - <c-button autofocus @click="copy"> + <c-button autofocus @click="copy()"> Copy NATO string </c-button> </div> diff --git a/src/tools/token-generator/token-generator.tool.vue b/src/tools/token-generator/token-generator.tool.vue index b69dec7..1019a83 100644 --- a/src/tools/token-generator/token-generator.tool.vue +++ b/src/tools/token-generator/token-generator.tool.vue @@ -66,7 +66,7 @@ const { copy } = useCopy({ source: token, text: 'Token copied to the clipboard' /> <div mt-5 flex justify-center gap-3> - <c-button @click="copy"> + <c-button @click="copy()"> Copy </c-button> <c-button @click="refreshToken"> diff --git a/src/tools/url-encoder/url-encoder.vue b/src/tools/url-encoder/url-encoder.vue index 324693b..c43f819 100644 --- a/src/tools/url-encoder/url-encoder.vue +++ b/src/tools/url-encoder/url-encoder.vue @@ -60,7 +60,7 @@ const { copy: copyDecoded } = useCopy({ source: decodeOutput, text: 'Decoded str /> <div flex justify-center> - <c-button @click="copyEncoded"> + <c-button @click="copyEncoded()"> Copy </c-button> </div> @@ -89,7 +89,7 @@ const { copy: copyDecoded } = useCopy({ source: decodeOutput, text: 'Decoded str /> <div flex justify-center> - <c-button @click="copyDecoded"> + <c-button @click="copyDecoded()"> Copy </c-button> </div> |