mirror of
				https://github.com/em-squared/5e-drs.git
				synced 2025-10-30 21:24:18 +00:00 
			
		
		
		
	share link
This commit is contained in:
		
						commit
						66757c7cf0
					
				
					 4 changed files with 20 additions and 15 deletions
				
			
		|  | @ -54,9 +54,9 @@ | ||||||
|         </v-card-title> |         </v-card-title> | ||||||
| 
 | 
 | ||||||
|         <v-card-text> |         <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=' + encodeURI($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="shortenURL($site.themeConfig.domain + '/homebrew/?h=' + $store.state.shareURI)" append-outer-icon="mdi-content-copy" @click:append-outer="copyURI('copy-uri')"></v-text-field> | ||||||
|           <div class="text-center"> |           <div class="text-center"> | ||||||
|             <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> |             <v-btn color="accent" depressed link :to="{ path: '/homebrew/', query: { h: $store.state.shareURI }}" @click="$store.commit('setIsOpenShareHomebrewDialog', !$store.state.isOpenShareHomebrewDialog)">Voir la page</v-btn> | ||||||
|           </div> |           </div> | ||||||
|         </v-card-text> |         </v-card-text> | ||||||
|       </v-card> |       </v-card> | ||||||
|  | @ -71,9 +71,7 @@ import Navbar from '@theme/components/Navbar.vue' | ||||||
| import NavDrawer from '@theme/components/NavDrawer.vue' | import NavDrawer from '@theme/components/NavDrawer.vue' | ||||||
| import RightDrawer from '@theme/components/RightDrawer.vue' | import RightDrawer from '@theme/components/RightDrawer.vue' | ||||||
| import Vue from 'vue' | import Vue from 'vue' | ||||||
| import RuleTooltip from '@theme/global-components/RT' |  | ||||||
| import Cookies from 'js-cookie' | import Cookies from 'js-cookie' | ||||||
| import { shortlink } from 'shortlink' |  | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
|   name: 'GlobalLayout', |   name: 'GlobalLayout', | ||||||
|  | @ -177,11 +175,18 @@ export default { | ||||||
|       this.$store.commit('setRightDrawer', !this.$store.state.rightDrawer) |       this.$store.commit('setRightDrawer', !this.$store.state.rightDrawer) | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|     encodeURI (h) { |     shortenURL (url) { | ||||||
|       return shortlink.encode(h) |       // var isgd = require('isgd') | ||||||
|  | 
 | ||||||
|  |       isgd.shorten('http://google.com', function(res) { | ||||||
|  |           console.log(res) | ||||||
|  |           return res | ||||||
|  |       }) | ||||||
|  | 
 | ||||||
|  |       return url | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|     copyURI(id) { |     copyURI (id) { | ||||||
|       let toCopy = document.getElementById(id) |       let toCopy = document.getElementById(id) | ||||||
|       toCopy.select() |       toCopy.select() | ||||||
|       document.execCommand( 'copy' ) |       document.execCommand( 'copy' ) | ||||||
|  |  | ||||||
|  | @ -74,7 +74,7 @@ export default { | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   mounted () { |   mounted () { | ||||||
|     let brew64 = this.$route.query.brew |     let brew64 = this.$route.query.h | ||||||
|     if (brew64) { |     if (brew64) { | ||||||
|       this.brew = decode(brew64) |       this.brew = decode(brew64) | ||||||
|     } |     } | ||||||
|  | @ -117,7 +117,7 @@ export default { | ||||||
| 
 | 
 | ||||||
|   methods: { |   methods: { | ||||||
|     share () { |     share () { | ||||||
|       this.$store.commit('setShareURI', this.$route.query.brew) |       this.$store.commit('setShareURI', this.$route.query.h) | ||||||
|       this.$store.commit('setIsOpenShareHomebrewDialog', true) |       this.$store.commit('setIsOpenShareHomebrewDialog', true) | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -16,13 +16,13 @@ | ||||||
|     "@vuepress/plugin-pwa": "^1.4.1", |     "@vuepress/plugin-pwa": "^1.4.1", | ||||||
|     "file-saver": "^2.0.2", |     "file-saver": "^2.0.2", | ||||||
|     "flexsearch": "nextapps-de/flexsearch", |     "flexsearch": "nextapps-de/flexsearch", | ||||||
|  |     "isgd": "^1.1.3", | ||||||
|     "js-cookie": "^2.2.1", |     "js-cookie": "^2.2.1", | ||||||
|     "markdown-it-div": "^1.1.0", |     "markdown-it-div": "^1.1.0", | ||||||
|     "markdown-it-multimd-table": "^4.0.1", |     "markdown-it-multimd-table": "^4.0.1", | ||||||
|     "material-design-icons-iconfont": "^5.0.1", |     "material-design-icons-iconfont": "^5.0.1", | ||||||
|     "node-sass": "^4.13.1", |     "node-sass": "^4.13.1", | ||||||
|     "sass-loader": "^8.0.2", |     "sass-loader": "^8.0.2", | ||||||
|     "shortlink": "^1.1.0", |  | ||||||
|     "slugify": "^1.4.0", |     "slugify": "^1.4.0", | ||||||
|     "vue": "^2.6.11", |     "vue": "^2.6.11", | ||||||
|     "vue-masonry-css": "^1.0.3", |     "vue-masonry-css": "^1.0.3", | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								yarn.lock
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								yarn.lock
									
										
									
									
									
								
							|  | @ -4672,6 +4672,11 @@ isexe@^2.0.0: | ||||||
|   resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" |   resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" | ||||||
|   integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= |   integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= | ||||||
| 
 | 
 | ||||||
|  | isgd@^1.1.3: | ||||||
|  |   version "1.1.3" | ||||||
|  |   resolved "https://registry.yarnpkg.com/isgd/-/isgd-1.1.3.tgz#98808dac152a7247497c5d068308012eccfa4351" | ||||||
|  |   integrity sha1-mICNrBUqckdJfF0GgwgBLsz6Q1E= | ||||||
|  | 
 | ||||||
| isobject@^2.0.0: | isobject@^2.0.0: | ||||||
|   version "2.1.0" |   version "2.1.0" | ||||||
|   resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" |   resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" | ||||||
|  | @ -7228,11 +7233,6 @@ shebang-regex@^1.0.0: | ||||||
|   resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" |   resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" | ||||||
|   integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= |   integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= | ||||||
| 
 | 
 | ||||||
| shortlink@^1.1.0: |  | ||||||
|   version "1.1.0" |  | ||||||
|   resolved "https://registry.yarnpkg.com/shortlink/-/shortlink-1.1.0.tgz#b9c4ce003fb4d5bc5948843c7077c5074a3508bb" |  | ||||||
|   integrity sha1-ucTOAD+01bxZSIQ8cHfFB0o1CLs= |  | ||||||
| 
 |  | ||||||
| signal-exit@^3.0.0, signal-exit@^3.0.2: | signal-exit@^3.0.0, signal-exit@^3.0.2: | ||||||
|   version "3.0.3" |   version "3.0.3" | ||||||
|   resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" |   resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Maxime Moraine
						Maxime Moraine