Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/composable/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/tools/basic-auth-generator/basic-auth-generator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/bcrypt/bcrypt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions src/tools/benchmark-builder/benchmark-builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions src/tools/bip39-generator/bip39-generator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions src/tools/html-entities/html-entities.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/mac-address-lookup/mac-address-lookup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/random-port-generator/random-port-generator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
4 changes: 2 additions & 2 deletions src/tools/roman-numeral-converter/roman-numeral-converter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/slugify-string/slugify-string.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/token-generator/token-generator.tool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
4 changes: 2 additions & 2 deletions src/tools/url-encoder/url-encoder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down