X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fjavascript%2Fsearch.js;h=989aee72c356b9003148252e2be5405f126daeb8;hb=c65aed9897893d27bc93744c801d289724ef5b7b;hp=52870adc0030221b427bbb40e34d07b0fc58cc93;hpb=5289c142e04219cb8e846c86ccd9f5005d7d49e1;p=platal.git diff --git a/htdocs/javascript/search.js b/htdocs/javascript/search.js index 52870ad..989aee7 100644 --- a/htdocs/javascript/search.js +++ b/htdocs/javascript/search.js @@ -124,7 +124,10 @@ function display_list(field_name) // }}} // {{{ Regexps to wipe out from search queries -var default_form_values = [ /&woman=0(&|$)/, /&subscriber=0(&|$)/, /&alive=0(&|$)/, /&egal[12]=[^&]*&promo[12]=(&|$)/g, /&networking_type=0(&|$)/, /&[^&=]+=(&|$)/g ]; +var default_form_values = [ /&woman=0(&|$)/, /&subscriber=0(&|$)/, /&alive=0(&|$)/, /&egal2=[^&]*&promo2=(&|$)/, + /&egal1=[^&]*&promo1=&edu_type=(?:Ing[^n]+nieur|Master|Doctorat)(&|$)/, /&networking_type=0(&|$)/, + /&origin_corps=0(&|$)/, /¤t_corps=0(&|$)/, + /corps_rank=0(&|$)/, /&has_email_redirect=0(&|$)/, /&[^&=]+=(&|$)/g ]; /** Uses javascript to clean form from all empty fields */ function cleanForm(f, targeturl) @@ -140,7 +143,11 @@ function cleanForm(f, targeturl) } while (old_query != query); } } - query = query.replace(/^&*(.*)&*$/, '$1'); + query = query.replace(/^(.*)&+$/, '$1'); + query = query.replace(/^&+(.*)$/, '$1'); + + // Removes "(n camarades)" if any of them are remaining. + query = query.replace(/\+\(\d+\+camarade(?:s)?\)/, ''); if (query == 'rechercher=Chercher') { alert("Aucun critère n'a été spécifié."); return false;