Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Språksamlingane
beta.ordbok.uib.no
Commits
f5735a14
Commit
f5735a14
authored
Nov 18, 2021
by
Henrik Askjer
Browse files
add copy notification
parent
30c5ab92
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/ArticleFooter.vue
View file @
f5735a14
<
template
>
<
template
>
<div
class=
"article_footer"
>
<div
class=
"article_footer"
>
<v-snackbar
center
left
light
<v-btn
v-if=
"!webShareApiSupported || $vuetify.breakpoint.mdAndUp"
x-small
depressed
class=
"toolbar-button"
rounded
tabindex=
"0"
@
click=
"copy_link"
>
v-model=
'copy_popup'
<v-icon
small
>
link
</v-icon>
<span
class =
"button-text"
>
Kopier lenke
</span>
timeout=
"2000"
>
<span
class=
"text-center"
>
Kopiert til utklippstavla
</span>
<template
v-slot:action=
"
{ attrs }">
<v-btn
color=
"primary"
text
v-bind=
"attrs"
@
click=
"copy_popup = false"
>
<v-icon>
close
</v-icon>
</v-btn>
</
template
>
</v-snackbar>
<v-btn
v-if=
"!webShareApiSupported || $vuetify.breakpoint.mdAndUp"
x-small
depressed
class=
"toolbar-button"
rounded
tabindex=
"0"
@
click=
"copy_link"
>
<v-icon
small
>
link
</v-icon><span
class =
"button-text"
>
Kopier lenke
</span>
</v-btn>
</v-btn>
<v-btn
v-if=
"webShareApiSupported"
depressed
x-small
class=
"toolbar-button"
rounded
tabindex=
"0"
@
click=
"shareViaWebShare"
>
<v-btn
v-if=
"webShareApiSupported"
depressed
x-small
class=
"toolbar-button"
rounded
tabindex=
"0"
@
click=
"shareViaWebShare"
>
<v-icon
x-small
>
share
</v-icon><span
class =
"button-text"
>
Del ordet
</span>
<v-icon
x-small
>
share
</v-icon><span
class =
"button-text"
>
Del ordet
</span>
</v-btn>
</v-btn>
...
@@ -52,6 +70,7 @@ export default {
...
@@ -52,6 +70,7 @@ export default {
},
},
data
:
function
()
{
data
:
function
()
{
return
{
return
{
copy_popup
:
false
,
citation_dialog
:
false
citation_dialog
:
false
}
}
...
@@ -85,12 +104,15 @@ export default {
...
@@ -85,12 +104,15 @@ export default {
},
},
copy_link
()
{
copy_link
()
{
navigator
.
clipboard
.
writeText
(
this
.
create_link
());
navigator
.
clipboard
.
writeText
(
this
.
create_link
());
this
.
copy_popup
=
true
},
},
copy_citation
()
{
copy_citation
()
{
let
citation
=
document
.
getElementById
(
"
citation
"
).
textContent
;
let
citation
=
document
.
getElementById
(
"
citation
"
).
textContent
;
navigator
.
clipboard
.
writeText
(
citation
)
navigator
.
clipboard
.
writeText
(
citation
)
this
.
citation_dialog
=
false
this
.
citation_dialog
=
false
this
.
copy_popup
=
true
},
},
close_citation_dialog
()
{
close_citation_dialog
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment