-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: updated DOIBadge component and various other fixes/updates
- Loading branch information
Showing
11 changed files
with
122 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<template> | ||
<div> | ||
<div v-if="doi"> | ||
<div | ||
class="inline-flex items-center cursor-pointer" | ||
@click.prevent="copyDOIToClipboard" | ||
> | ||
<span | ||
class="inline-flex items-center rounded-l-md border-r bg-gray-800 px-2 py-1 text-sm font-medium text-white" | ||
>DOI:</span | ||
> | ||
<span | ||
:class="[ | ||
color ? color : 'bg-blue-100', | ||
'inline-flex items-center rounded-r-md px-2 py-1 text-sm font-medium text-gray-900', | ||
]" | ||
>{{ doi }}</span | ||
> | ||
<input | ||
readonly | ||
type="hidden" | ||
:value="doi" | ||
class="rounded-l-md focus:ring-gray-500 focus:border-gray-500 block w-full rounded-none rounded-l-md sm:text-sm border-gray-300" | ||
@focus="$event.target.select()" | ||
/> | ||
<span v-if="isVisible" class="text-gray-500 text-xs ml-2" | ||
>Copied to clipboard!</span | ||
> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
components: {}, | ||
props: ["doi", "color"], | ||
data() { | ||
return { | ||
isVisible: false, | ||
}; | ||
}, | ||
methods: { | ||
copyDOIToClipboard(event) { | ||
let targetInput = | ||
event.target.parentElement.getElementsByTagName("input")[0]; | ||
if (targetInput) { | ||
this.isVisible = true; | ||
setTimeout(() => { | ||
this.isVisible = false; | ||
}, 2500); | ||
this.copyToClipboard(this.doi, targetInput); | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> |