diff -r 000000000000 -r d970ebf37754 enmi12/glossaire/js/main.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/enmi12/glossaire/js/main.js Wed Nov 06 03:21:17 2013 +0000 @@ -0,0 +1,104 @@ +function preg_replace (array_pattern, array_pattern_replace, my_string) { var new_string = String (my_string); for (i=0; i 0) + { + var recherche = $('#champsRecherche').val().toLowerCase(); + recherche = removeAccents(recherche); + var resultat = $("[data-mot*='" + recherche + "']").add('.row-end'); + var selector = resultat; + + $('#container').isotope({ + filter: selector + }); + } + + $(".copyButton").zclip({ + path: "ZeroClipboard.swf", + copy: function(){return $(this).prev().val();}, + afterCopy: function(){$(this).text('Copié !');}, + + }); +}); + +$('.defineTile').click(function(event){ + event.stopPropagation(); + $(this).addClass('active'); + $(this).siblings('li').removeClass('active'); + $(this).parent().nextAll('.commentSection').hide(); +}); + +$('.commentTile').click(function(event){ + event.stopPropagation() + $(this).addClass('active'); + $(this).siblings('li').removeClass('active'); + $(this).parent().nextAll('.commentSection').show(); + + //xmlRequest(event); +}); + +$('#menuExtraContent a').click(function(event){ + event.stopPropagation(); + $(this).addClass('active'); + $(this).siblings('a').removeClass('active'); +}); + +$('#filters input').click(function(){ + $(this).siblings().attr('checked', false); + $(this).attr('checked', true); + + if($('#champsRecherche').val().length == 0) + { + var selector = $('div input[checked]').attr('data-filter'); + } + else + { + var recherche = $('#champsRecherche').val().toLowerCase(); + recherche = removeAccents(recherche); + var resultat = $("[data-mot*='" + recherche + "']"); + var selector = $($('div input[checked]').attr('data-filter')).filter(resultat).add('.row-end'); + } + + $('#container').isotope({ + filter: selector + }); +}); + +$('#champsRecherche').keyup(function(event){ + var recherche = $('#champsRecherche').val().toLowerCase(); + recherche = removeAccents(recherche); + var resultat = $("[data-mot*='" + recherche + "']"); + var selector = $($('div input[checked]').attr('data-filter')).filter(resultat).add('.row-end'); + + + if($('#champsRecherche').val().length == 0) + { + selector = $('div input[checked]').attr('data-filter'); + } + $('#container').isotope({ + filter: selector + }); + +}); + +$('.element').click(function(){ + if(!$(this).hasClass("folder")){ + $(this).toggleClass("large"); + if(!$(this).prevAll('.folder').first().hasClass('height2')){ + $(this).prevAll('.folder').first().toggleClass('height2'); + } + else if($(this).prevAll('.folder').first().hasClass('height2') && $(this).siblings('.large').length == 0 && !$(this).hasClass('large')){ + $(this).prevAll('.folder').first().toggleClass('height2'); + } + $('#container').isotope( + 'reLayout'); + } +}); \ No newline at end of file