integration/js/projet.js
changeset 6 547b3ddedf7f
child 9 e3d551eda5a6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/integration/js/projet.js	Thu May 16 12:58:48 2013 +0200
@@ -0,0 +1,34 @@
+(function(){
+
+    $('body').on('click focus', 'input[readonly]', function(e){
+        $(this).select();
+    });
+
+//ZeroClipboard (fonctionne sous localhost)
+    var clip = new ZeroClipboard( $('.clipboard'), {
+      moviePath: "lib/ZeroClipboard/ZeroClipboard.swf"
+    });
+    clip.on( 'complete', function(client, args) {
+      alert("Copied text to clipboard: " + args.text );
+    });
+
+//confirmation suppression
+    $(document).on('click','.btn-delete', function(e){
+        e.preventDefault();
+        var titleMedia = $(this).attr('data-title'),
+            textModal = $('<p>Êtes-vous sûr de vouloir supprimer <strong>'+titleMedia+'</strong> ?</p>'),
+            eltDelete = $(this).attr('href');
+
+        $("#modal-confirm #btn-delete-modal").attr('data-id-elt-delete', eltDelete);
+        $("#modal-confirm .modal-body").empty().append(textModal); 
+        $("#modal-confirm").modal('show');
+    });
+
+    $("#modal-confirm").on('click', '#btn-delete-modal', function(e){
+        e.preventDefault();
+        var idEltDelete = $(this).attr('data-id-elt-delete');
+        $(idEltDelete).remove();
+        $("#modal-confirm").modal('hide');
+    });
+
+})(jQuery);
\ No newline at end of file