mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2025-10-31 12:42:07 +00:00 
			
		
		
		
	add copy functionality
This commit is contained in:
		| @@ -14,7 +14,7 @@ | ||||
|                 <h3 class="mt-4" v-text="generatedLink" /> | ||||
|                 <div class="flex justify-end mt-4"> | ||||
|                     <button class="btn" v-t="'actions.follow_link'" @click="followLink()" /> | ||||
|                     <button class="btn ml-5" v-t="'actions.copy_link'" @click="copyLink()" /> | ||||
|                     <button class="btn ml-3" v-t="'actions.copy_link'" @click="copyLink()" /> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
| @@ -68,10 +68,18 @@ export default { | ||||
|             event.preventDefault(); | ||||
|         }, | ||||
|         followLink() { | ||||
|             window.location.href = this.generatedLink; | ||||
|             window.open(this.generatedLink, "_blank").focus(); | ||||
|         }, | ||||
|         copyLink() { | ||||
|             this.$emit("close"); | ||||
|         async copyLink() { | ||||
|             await this.copyURL(this.generatedLink); | ||||
|         }, | ||||
|         async copyURL(mytext) { | ||||
|             try { | ||||
|                 await navigator.clipboard.writeText(mytext); | ||||
|                 alert(this.$t("info.copied")); | ||||
|             } catch ($e) { | ||||
|                 alert(this.$t("info.cannot_copy")); | ||||
|             } | ||||
|         }, | ||||
|     }, | ||||
|     computed: { | ||||
|   | ||||
| @@ -149,6 +149,8 @@ | ||||
|     }, | ||||
|     "info": { | ||||
|         "preferences_note": "Note: preferences are saved in the local storage of your browser. Deleting your browser data will reset them.", | ||||
|         "page_not_found": "Page not found" | ||||
|         "page_not_found": "Page not found", | ||||
|         "copied": "Copied!", | ||||
|         "cannot_copy": "Can't copy!" | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Bnyro
					Bnyro