diff --git a/client/script.js b/client/script.js
index 86bc0e3..2c97086 100644
--- a/client/script.js
+++ b/client/script.js
@@ -1082,6 +1082,7 @@ $(document).ready(function(){
'
Tableau'+
''+
''+$('.revision h3').text()+''+
+ ''+$('.share h3').text()+''+
''+$('.export h3').text()+'/'+$('.import h3').text()+''+
''+$('#tuto-faq h2').text()+''+
''
@@ -1096,11 +1097,13 @@ $(document).ready(function(){
.append($('.names, .stickers, .buttons'))
.after(
''+
+ ''+
''+
''
);
$('#export-import').append($('.export, .import'));
+ $('#share').append($('.share'));
$('#revisions').append($('.revisions'));
$('#about').append($('#tuto-faq, #le-logiciel, #jardin'));
@@ -1134,6 +1137,23 @@ $(document).ready(function(){
}
+ // put URL in share input
+ $('#taburl').val(location);
+ // copy URL to clipboard
+ $('#copyurl').click(function(e) {
+ e.preventDefault();
+ var node = document.getElementById('taburl');
+ node.disabled = null;
+ node.select();
+ var success = document.execCommand('copy');
+ if (success) {
+ getSelection().removeAllRanges();
+ node.disabled = 'disabled';
+ alert('URL du tableau copiée dans votre presse-papier !');
+ } else {
+ alert('Impossible de copier l\'URL du tableau dans votre presse-papier. Veuillez copier son adresse manuellement (Ctrl+C).')
+ }
+ });
}
});
diff --git a/views/index.jade b/views/index.jade
index 115f3d3..3279ae7 100644
--- a/views/index.jade
+++ b/views/index.jade
@@ -58,6 +58,15 @@ block body
span.you-text (vous)
ul#names-ul
+ div.share
+ h3 Partager le tableau
+ div.form-inline
+ div.input-group
+ input#taburl.form-control(disabled='disabled')
+ div.input-group-addon
+ a#copyurl(href='#', title='Copier l\'adresse du tableau dans votre presse-papier')
+ i.fa.fa-clipboard
+
div.export
h3 Exporter le tableau
button#export-txt.btn.btn-primary Format texte