X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fjavascript%2Fprofile.js;h=2b615e87445591490293a2d2f35083e0856883f7;hb=509df5528c035f9cb792ddc504b320970a390006;hp=fea3e4bc48900b6e56950c8b830cb87af9562594;hpb=730a173a333507926e0029d8a96c3a26b55756e4;p=platal.git
diff --git a/htdocs/javascript/profile.js b/htdocs/javascript/profile.js
index fea3e4b..2b615e8 100644
--- a/htdocs/javascript/profile.js
+++ b/htdocs/javascript/profile.js
@@ -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;
}
}
@@ -109,6 +110,59 @@ function removeSearchName(i)
}
}
+function addNetworking()
+{
+ var i = 0;
+ var nw = 'networking_';
+ while (document.getElementById(nw + i) != null) {
+ i++;
+ }
+ var cb = document.forms.prof_annu['nw_type'];
+ var id = cb.value;
+ var text = cb.options[cb.selectedIndex].text;
+ var html = '
'
+ + ' '
+ + ' '
+ + ' '
+ + ' '
+ + ' '
+ + ' '
+ + ' '
+ + ' '
+ + ' '
+ + text
+ + ' '
+ + ' | '
+ + ' '
+ + ' '
+ + ' '
+ + ' '
+ + ' '
+ + ' | '
+ + '
';
+
+ if (i == 0) {
+ $('#networking').after(html);
+ } else {
+ $('#networking_'+(i-1)).after(html);
+ }
+}
+
+function removeNetworking(id)
+{
+ $('#networking_' + id).remove();
+}
+
+function updateNetworking()
+{
+ var val = document.forms.prof_annu['nw_type'].value;
+ if (val == '') {
+ document.getElementById('nw_add').style.display = 'none';
+ } else {
+ document.getElementById('nw_add').style.display = '';
+ }
+}
+
// Addresses
function removeObject(id, pref)
@@ -369,6 +423,7 @@ function makeAddJob(id)
return function(data)
{
$('#add_job').before(data);
+ registerEnterpriseAutocomplete(id);
updateSecteur('job_' + id, 'jobs[' + id + ']', '');
};
}
@@ -513,4 +568,21 @@ function removeSecteur(s, ss)
updateSSecteur();
}
+function registerEnterpriseAutocomplete(id)
+{
+ $(".enterprise_name").each(
+ function() {
+ 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: