diff -r bad0e6c60b63 -r 3848e1813a30 alcatel/static/js/cluster.js --- a/alcatel/static/js/cluster.js Mon Jul 22 14:56:35 2013 +0200 +++ b/alcatel/static/js/cluster.js Wed Aug 14 16:36:41 2013 +0200 @@ -1,50 +1,54 @@ function articles(json) +{ + document.getElementById('titleleft').innerHTML = json.cluster_title+ " »"; + $("#pickeddatebegin").val(json.query.from_date); + $("#pickeddateend").val(json.query.to_date); + $("#recherche_id").val(json.query.text); + $('input[name=categories1]').attr('checked', false); + $('input[name=categories2]').attr('checked', false); + $('input[name=categories3]').attr('checked', false); + $('input[name=categories4]').attr('checked', false); + //document.getElementById('affichage').style.display = "none"; + for (j = 0; j < json.query.categories.length; j++) { - $("#pickeddatebegincluster").val(json.query.from_date); - $("#pickeddateendcluster").val(json.query.to_date); - $("#recherche").val(json.query.text); - for (j = 0; j < json.query.categories.length; j++) + if(json.query.categories[j] == "International") + { + $('input[name=categories1]').attr('checked', true); + } + else if(json.query.categories[j] == "France") + { + $('input[name=categories2]').attr('checked', true); + } + else if(json.query.categories[j] == "Economie") { - if(json.query.categories[j] == "International") - { - alert('Inter'); - $('input[id=categorie1]').attr('checked', true); - } - else if(json.query.categories[j] == "France") - { - alert('France'); - $('input[id=categorie2]').attr('checked', true); - } - else if(json.query.categories[j] == "Economie") - { - alert('Economie'); - $('input[id=categorie3]').attr('checked', true); - } - else - { - alert('Culture'); - $('input[id=categorie4]').attr('checked', true); - } + $('input[name=categories3]').attr('checked', true); + } + else if(json.query.categories[j] == "Culture") + { + $('input[name=categories4]').attr('checked', true); } - + } - content = "
"; - for (i = 0; i < json.documents.length; i++) - { - content += "

"; - content += json.documents[i].title; - content += " »

"; - content += json.documents[i].date; - content += "
by "; - content += json.documents[i].author[0].name; - content += "

\"\"

"; - content += json.documents[i].abstract; - content += "

"; - } - content +="
"; - $("#right").empty(); - $(content).appendTo("#right"); + content = "
"; + for (i = 0; i < json.documents.length; i++) + { + + content += "

"; + content += json.documents[i].title; + content += " »

"; + content += json.documents[i].date; + content += "
by "; + content += json.documents[i].author[0].name; + content += "

\"\"

"; + content += json.documents[i].abstract; + content += "

"; } + content +="
"; + $("#right").empty(); + $(content).appendTo("#right"); +} + + $(function(){ @@ -91,6 +95,11 @@ return false; }); + $('#ajaxfiltretreemapdoc').click(function() + { + $('#ajaxfiltretreemapdoc').submit(); + }); + $('.checkbox_category').click(function(){ /*var theValue = $(this).val();*/ $('#ajax3').submit();