|
6
|
1 |
(function(){ |
|
|
2 |
|
|
|
3 |
$('body').on('click focus', 'input[readonly]', function(e){ |
|
|
4 |
$(this).select(); |
|
|
5 |
}); |
|
|
6 |
|
|
|
7 |
//ZeroClipboard (fonctionne sous localhost) |
|
|
8 |
var clip = new ZeroClipboard( $('.clipboard'), { |
|
|
9 |
moviePath: "lib/ZeroClipboard/ZeroClipboard.swf" |
|
|
10 |
}); |
|
|
11 |
clip.on( 'complete', function(client, args) { |
|
|
12 |
alert("Copied text to clipboard: " + args.text ); |
|
|
13 |
}); |
|
|
14 |
|
|
|
15 |
//confirmation suppression |
|
|
16 |
$(document).on('click','.btn-delete', function(e){ |
|
|
17 |
e.preventDefault(); |
|
|
18 |
var titleMedia = $(this).attr('data-title'), |
|
|
19 |
textModal = $('<p>Êtes-vous sûr de vouloir supprimer <strong>'+titleMedia+'</strong> ?</p>'), |
|
|
20 |
eltDelete = $(this).attr('href'); |
|
|
21 |
|
|
|
22 |
$("#modal-confirm #btn-delete-modal").attr('data-id-elt-delete', eltDelete); |
|
|
23 |
$("#modal-confirm .modal-body").empty().append(textModal); |
|
|
24 |
$("#modal-confirm").modal('show'); |
|
|
25 |
}); |
|
|
26 |
|
|
|
27 |
$("#modal-confirm").on('click', '#btn-delete-modal', function(e){ |
|
|
28 |
e.preventDefault(); |
|
|
29 |
var idEltDelete = $(this).attr('data-id-elt-delete'); |
|
|
30 |
$(idEltDelete).remove(); |
|
|
31 |
$("#modal-confirm").modal('hide'); |
|
|
32 |
}); |
|
|
33 |
|
|
|
34 |
})(jQuery); |