X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fjavascript%2Fprofile.js;h=d625bfb43985f9944c2db3e8977080f8afc3a1f9;hb=bde2be3b1777bf1f66c6d2b2cdecc361d6191911;hp=4e16e29e54882ae1f1d7f25bdd1cf4b0008f9046;hpb=b235d980e6d9b3e1e815da91465b2a6a32f46191;p=platal.git diff --git a/htdocs/javascript/profile.js b/htdocs/javascript/profile.js index 4e16e29..d625bfb 100644 --- a/htdocs/javascript/profile.js +++ b/htdocs/javascript/profile.js @@ -237,18 +237,34 @@ function addAddress() Ajax.update_html('addresses_' + i + '_cont', 'profile/ajax/address/' + i, checkCurrentAddress); } -function addTel(id) +function addTel(prefid, prefname) { var i = 0; - var adid = 'addresses_' + id; - var tel = adid + '_tel_'; - while (document.getElementById(tel + i) != null) { + var prefix = prefid + '_'; + while (document.getElementById(prefix + i) != null) { i++; } - $('#' + adid + '_add_tel').before('
'); - Ajax.update_html(tel + i, 'profile/ajax/tel/' + id + '/' + i); + $('#' + prefix + 'add').before('
'); + Ajax.update_html(prefix + i, 'profile/ajax/tel/' + prefid + '/' + prefname + '/' + i); } +function removeTel(id) +{ + $('#' + id).remove(); +} + +function addPhoneComment(id, pref) +{ + document.getElementById(id+'_comment').style.display = ''; + document.getElementById(id+'_addComment').style.display = 'none'; +} + +function removePhoneComment(id, pref) +{ + document.getElementById(id+'_comment').style.display = 'none'; + document.forms.prof_annu[pref+ '[comment]'].value = ''; + document.getElementById(id+'_addComment').style.display = ''; +} // Geoloc