mirror of
				https://github.com/em-squared/5e-drs.git
				synced 2025-10-31 05:24:20 +00:00 
			
		
		
		
	encode url
This commit is contained in:
		
							parent
							
								
									a8170ba02e
								
							
						
					
					
						commit
						0c710ef306
					
				
					 3 changed files with 13 additions and 2 deletions
				
			
		|  | @ -54,9 +54,9 @@ | |||
|         </v-card-title> | ||||
| 
 | ||||
|         <v-card-text> | ||||
|           <v-text-field id="copy-uri" outlined readonly label="Copiez le lien pour partager" :hint="hintCopied" :value="$site.themeConfig.domain + '/homebrew/?brew=' + $store.state.shareURI" append-outer-icon="mdi-content-copy" @click:append-outer="copyURI('copy-uri')"></v-text-field> | ||||
|           <v-text-field id="copy-uri" outlined readonly label="Copiez le lien pour partager" :hint="hintCopied" :value="$site.themeConfig.domain + '/homebrew/?brew=' + encodeURI($store.state.shareURI)" append-outer-icon="mdi-content-copy" @click:append-outer="copyURI('copy-uri')"></v-text-field> | ||||
|           <div class="text-center"> | ||||
|             <v-btn color="accent" depressed link :to="{ path: '/homebrew/', query: { brew: $store.state.shareURI }}" @click="$store.commit('setIsOpenShareHomebrewDialog', !$store.state.isOpenShareHomebrewDialog)">Voir la page</v-btn> | ||||
|             <v-btn color="accent" depressed link :to="{ path: '/homebrew/', query: { brew: encodeURI($store.state.shareURI) }}" @click="$store.commit('setIsOpenShareHomebrewDialog', !$store.state.isOpenShareHomebrewDialog)">Voir la page</v-btn> | ||||
|           </div> | ||||
|         </v-card-text> | ||||
|       </v-card> | ||||
|  | @ -73,6 +73,7 @@ import RightDrawer from '@theme/components/RightDrawer.vue' | |||
| import Vue from 'vue' | ||||
| import RuleTooltip from '@theme/global-components/RT' | ||||
| import Cookies from 'js-cookie' | ||||
| import { shortlink } from 'shortlink' | ||||
| 
 | ||||
| export default { | ||||
|   name: 'GlobalLayout', | ||||
|  | @ -176,6 +177,10 @@ export default { | |||
|       this.$store.commit('setRightDrawer', !this.$store.state.rightDrawer) | ||||
|     }, | ||||
| 
 | ||||
|     encodeURI (h) { | ||||
|       return shortlink.encode(h) | ||||
|     }, | ||||
| 
 | ||||
|     copyURI(id) { | ||||
|       let toCopy = document.getElementById(id) | ||||
|       toCopy.select() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Maxime Moraine
						Maxime Moraine