diff --git a/src/composable/copy.ts b/src/composable/copy.ts index c7819501..dcaed848 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 f96a8c7c..a8946127 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
- + Copy header
diff --git a/src/tools/bcrypt/bcrypt.vue b/src/tools/bcrypt/bcrypt.vue index 7e70db8f..b1667649 100644 --- a/src/tools/bcrypt/bcrypt.vue +++ b/src/tools/bcrypt/bcrypt.vue @@ -33,7 +33,7 @@ const compareMatch = computed(() => compareSync(compareString.value, compareHash
- + Copy hash
diff --git a/src/tools/benchmark-builder/benchmark-builder.vue b/src/tools/benchmark-builder/benchmark-builder.vue index 56776f27..91f3155d 100644 --- a/src/tools/benchmark-builder/benchmark-builder.vue +++ b/src/tools/benchmark-builder/benchmark-builder.vue @@ -151,10 +151,10 @@ function copyAsBulletList() {
- + Copy as markdown table - + Copy as bullet list
diff --git a/src/tools/bip39-generator/bip39-generator.vue b/src/tools/bip39-generator/bip39-generator.vue index 03c1fe38..a07941b2 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 - + - + @@ -122,7 +122,7 @@ const { copy: copyPassphrase } = useCopy({ source: passphrase, text: 'Passphrase - + diff --git a/src/tools/html-entities/html-entities.vue b/src/tools/html-entities/html-entities.vue index a0f61022..1a2192e0 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 });
- + Copy
@@ -66,7 +66,7 @@ const { copy: copyUnescaped } = useCopy({ source: unescapeOutput });
- + Copy
diff --git a/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue b/src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue index 713874a1..9085725f 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
- + Copy
diff --git a/src/tools/mac-address-lookup/mac-address-lookup.vue b/src/tools/mac-address-lookup/mac-address-lookup.vue index 05382ebf..ef0927d5 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
- + Copy vendor info
diff --git a/src/tools/random-port-generator/random-port-generator.vue b/src/tools/random-port-generator/random-port-generator.vue index e4ac609c..89ab2172 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 }}
- + Copy diff --git a/src/tools/roman-numeral-converter/roman-numeral-converter.vue b/src/tools/roman-numeral-converter/roman-numeral-converter.vue index 43901227..d365cc5a 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
{{ outputRoman }}
- + Copy
@@ -61,7 +61,7 @@ const { copy: copyArabic } = useCopy({ source: outputNumeral, text: 'Arabic numb
{{ outputNumeral }}
- + Copy diff --git a/src/tools/slugify-string/slugify-string.vue b/src/tools/slugify-string/slugify-string.vue index 9156b79f..f7666e30 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' });
- + Copy slug
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 bd8482c8..76abbc49 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.
- + Copy NATO string
diff --git a/src/tools/token-generator/token-generator.tool.vue b/src/tools/token-generator/token-generator.tool.vue index b69dec77..1019a83b 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' />
- + Copy diff --git a/src/tools/url-encoder/url-encoder.vue b/src/tools/url-encoder/url-encoder.vue index 324693b0..c43f8193 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 />
- + Copy
@@ -89,7 +89,7 @@ const { copy: copyDecoded } = useCopy({ source: decodeOutput, text: 'Decoded str />
- + Copy