X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fjavascript%2Fprofile.js;h=22d0976f0fe144af8d8cef99502682f32c3ee20f;hb=16594a1ac8d7cbff8a51e422a6a6d9e575129d9c;hp=d93cb4d1b4cac73d31ee8d3c808ffd615b5eee6d;hpb=e83054cc6257fb882edbf492b8d33e3b608328a2;p=platal.git diff --git a/htdocs/javascript/profile.js b/htdocs/javascript/profile.js index d93cb4d..22d0976 100644 --- a/htdocs/javascript/profile.js +++ b/htdocs/javascript/profile.js @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2003-2007 Polytechnique.org * + * Copyright (C) 2003-2008 Polytechnique.org * * http://opensource.polytechnique.org/ * * * * This program is free software; you can redistribute it and/or modify * @@ -47,6 +47,7 @@ function wizPage_onLoad(id) updateJobSecteur(i, 'job_' + i, 'jobs[' + i + ']', document.forms.prof_annu["jobs[" + i + "][ss_secteur]"].value); } + registerEnterpriseAutocomplete(-1); break; } } @@ -350,6 +351,7 @@ function makeAddJob(id) return function(data) { $('#add_job').before(data); + registerEnterpriseAutocomplete(id); updateSecteur('job_' + id, 'jobs[' + id + ']', ''); }; } @@ -405,7 +407,7 @@ function updateCountry() { var val = document.forms.prof_annu.countries_sel.value; var show = true; - if (val == '') { + if (val == '' || val == '00') { show = false; } if (document.getElementById('countries_' + val) != null) { @@ -420,11 +422,11 @@ function addCountry() var val = cb.value; var text = cb.options[cb.selectedIndex].text; var html = '
' - + '
' + text + '
' - + ' ' - + ' ' + + ' ' + ' ' + ' ' + + '
' + text + '
' + + ' ' + '
'; $('#countries').append(html); updateCountry(); @@ -454,6 +456,8 @@ function updateSecteur() var secteur = document.forms.prof_annu.secteur_sel.value; if (secteur == '') { secteur = '-1'; + document.getElementById('ss_secteur_sel').innerHTML = ''; + return; } $.get(platal_baseurl + 'profile/ajax/secteur/-1/' + secteur, function(data) { @@ -492,4 +496,23 @@ function removeSecteur(s, ss) updateSSecteur(); } +function registerEnterpriseAutocomplete(id) +{ + alert("coucou"); + $(".enterprise_name").each( + function() { + alert(this.name); + if (id == -1 || this.name == "jobs[" + id + "][name]") { + $(this).autocomplete(platal_baseurl + "search/autocomplete/entreprise", + { + selectOnly:1, + field:this.name, + matchSubset:0, + width:$(this).width() + }); + } + } + ); +} + // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: