From 4fac5f8726453736d4bba1060481203b48290f71 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Thu, 19 Feb 2015 18:44:40 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20SRC/public/js/ListeOeuvre.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SRC/public/js/ListeOeuvre.js | 99 ++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/SRC/public/js/ListeOeuvre.js b/SRC/public/js/ListeOeuvre.js index 92e912b..b548b52 100644 --- a/SRC/public/js/ListeOeuvre.js +++ b/SRC/public/js/ListeOeuvre.js @@ -1,55 +1,56 @@ -$(document).ready( function() { - console.log( "document loaded" ); - $('.listeoeuvre').click(function() { - $('#oeuvrePic').empty(); - url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val(); - $.get(url, function( data ) { - if (data.length == 0 ) - $("#oeuvrePic").append("Aucune Oeuvre"); - data.forEach( function(el) { - $("#oeuvrePic").append('
' - +'' - +'' - +'
'); - }) - }, "json" ) - - .fail(function() { - $("#oeuvrePic").append('
' - +'Oouups! Il y a un problème.

' - +'' - +'
' - ); - }); - }); - $('.listeoeuvre').click(function() { - $('#oeuvrePic').empty(); - url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val(); - $.post(url, - dataSend, - function( data ) { - }, "json" ) - .done(function() { - $("#oeuvrePic").append('
' - +'' - +'
' +//Selection d'une recherche d'oeuvre +$('.listeoeuvre').click(function() { + $('#oeuvrePic').empty(); + url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val(); + $.get(url, function( data ) { + if (data.length == 0 ) + $("#oeuvrePic").append("Aucune Oeuvre"); + data.forEach( function(el) { + $("#oeuvrePic").append('
' + +'' + +'' + +'
'); }) - .fail(function() { - $("#oeuvrePic").append('
' - +'Oouups! Il y a un problème.

' - +'' - +'
' - ); - }); + }, "json" ) + + .fail(function() { + $("#oeuvrePic").append('
' + +'Oouups! Il y a un problème.

' + +'' + +'
' + ); + }); +}); + + +//Enregistrement d'une liste d'ouevre +$('#enregistrer').click(function() { + url = "/setListOeuvres/" + $(this).children('.idListeOeuvre').val(); + dataSend = { idListeOeuvre : 1, + oeuvres : "1-2-3-4"}; + $.post(url, + dataSend, + function( data ) { + ; + }) + .done(function() { + $("#oeuvrePic").append('
' + +'' + +'
'); + }) + .fail(function() { + $("#oeuvrePic").append('
' + +'Oouups! Il y a un problème.

' + +'' + +'
'); }); - });