Skip to content
Snippets Groups Projects
Commit a311f969 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'enhancement-front' into 'develop'

Enhancement front embed wizard

See merge request funkwhale/funkwhale!619
parents f4587575 4d785d2a
No related branches found
No related tags found
No related merge requests found
Enhanced the design of the embed wizard. (!619)
...@@ -17,12 +17,14 @@ ...@@ -17,12 +17,14 @@
</template> </template>
</div> </div>
<div class="field"> <div class="field">
<button @click="copy" class="ui right floated button"><translate :translate-context="'Popup/*/Button.Label/Verb'">Copy</translate></button> <button @click="copy" class="ui right teal labeled icon floated button"><i class="copy icon"></i><translate :translate-context="'Popup/*/Button.Label/Verb'">Copy</translate></button>
<label for="embed-width"><translate :translate-context="'Popup/Embed/Input.Label/Noun'">Embed code</translate></label> <label for="embed-width"><translate :translate-context="'Popup/Embed/Input.Label/Noun'">Embed code</translate></label>
<p><translate :translate-context="'Popup/Embed/Paragraph'">Copy/paste this code in your website HTML</translate></p> <p><translate :translate-context="'Popup/Embed/Paragraph'">Copy/paste this code in your website HTML</translate></p>
<div class="ui hidden divider"></div> <textarea ref="textarea":value="embedCode" rows="5" readonly>
<textarea ref="textarea":value="embedCode" rows="3" readonly>
</textarea> </textarea>
<div class="ui right">
<p class="message" v-if=copied><translate :translate-context="'Content/*/Paragraph'">Text copied to clipboard!</translate></p>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -41,7 +43,8 @@ export default { ...@@ -41,7 +43,8 @@ export default {
let d = { let d = {
width: null, width: null,
height: 150, height: 150,
minHeight: 100 minHeight: 100,
copied: false
} }
if (this.type === 'album') { if (this.type === 'album') {
d.height = 330 d.height = 330
...@@ -70,6 +73,11 @@ export default { ...@@ -70,6 +73,11 @@ export default {
copy () { copy () {
this.$refs.textarea.select() this.$refs.textarea.select()
document.execCommand("Copy") document.execCommand("Copy")
let self = this
self.copied = true
this.timeout = setTimeout(() => {
self.copied = false
}, 5000)
} }
} }
} }
...@@ -77,4 +85,9 @@ export default { ...@@ -77,4 +85,9 @@ export default {
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped> <style scoped>
.message {
position: absolute;
right: 0;
bottom: -2em;
}
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment