$(document).ready(function(){ //Navigation de l'Archive $("a#next_year, a#prev_year").click(change_archive_year); /*$("a.readmore").click(function(){ var more = $(this).parent().find(".textmore"); if(more.is(":visible")){ more.slideUp("slow"); }else{ more.slideDown("slow"); } });*/ $(".categories a").click(function(){ $(".categories a").removeClass("active"); $(this).addClass("active"); var choice = $(this).attr("href"); choice = choice.replace(/#/, ""); $("div.bulletin_article").each(function(){ if (choice == 'all'){ if($(this).is(":hidden")) $(this).show(); }else if($(this).is("div." + choice)){ if($(this).is(":hidden")) $(this).show(); } else{ if($(this).is(":visible")) $(this).hide(); } }); }); var choice = document.location.href; choice = choice.split("/"); nbchoice = choice.length-1; choice = choice[nbchoice].replace(/#/, ""); $("div.bulletin_article").each(function(){ if (choice == 'all'){ if($(this).is(":hidden")) $(this).show(); }else if($(this).is("div." + choice)){ if($(this).is(":hidden")) $(this).show(); } else{ if($(this).is(":visible")) $(this).hide(); } }); }); function change_archive_year(){ var action = $(this).attr("id"); var annee = parseInt($("#annee").val()); if(action == "prev_year"){annee = annee -1;}else{annee = annee + 1;} $.post("https://bulletin-arts.uqam.ca/modules/nav_bulletin.php",{'annee':annee}, function(data){ $("#nav_bulletin").html(data); $("#next_year, #prev_year").click(change_archive_year); }); } var initAttempts = 0; function disableDays() { try { var dp = datePickerController.getDatePicker("proposition_date"); } catch(err) { if(initAttempts++ < 10) setTimeout("disableDays()", 200); return; }; var dayArr = [1,0,1,1,1,1,1]; dp.setDisabledDays(dayArr); }