121ba11c8aa8f2b35808f0ae8bf781182d8df21f
1 /***************************************************************************
2 * Copyright (C) 2003-2010 Polytechnique.org *
3 * http://opensource.polytechnique.org/ *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
19 ***************************************************************************/
21 // Page initialization {{{1
23 function wizPage_onLoad(id
)
28 while ($('.edu_' + i
).length
!= 0) {
34 checkCurrentAddress();
40 for (var i
in names
) {
41 if ($('#medal_' + i
).length
!= 0) {
43 buildGrade(i
, $('#medal_' + i
).find('[name*=medal_' + i
+ '_grade]').val());
48 for (var i
= 0 ; $('#job_' + i
).length
!= 0; ++i
) {
49 updateJobSector(i
, $('#job_' + i
).find("[name='jobs[" + i
+ "][subSector]']").val());
50 updateJobSubSector(i
, $('#job_' + i
).find("[name='jobs[" + i
+ "][subSubSector]']").val());
51 updateJobAlternates(i
);
53 if ($('#job_0').find("[name='jobs[0][name]']").val() == '') {
54 $.get(platal_baseurl
+ 'profile/ajax/job/0', makeAddJob(0));
61 var educationDegreeAll
;
62 var educationDegreeName
;
68 function toggleNamesAdvanced()
70 $('.names_advanced').toggle();
73 function addSearchName(isFemale
)
76 while ($('#search_name_' + i
).length
!= 0) {
79 Ajax
.update_html('search_name_' + i
, 'profile/ajax/searchname/' + i + '/' + isFemale
, function(data
){
80 $('#searchname').before(data
);
85 function removeSearchName(i
, isFemale
)
87 $('#search_name_' + i
).remove();
88 updateNameDisplay(isFemale
);
91 function changeNameFlag(i
)
93 $('#flag_' + i
).remove();
94 var typeid
= $('#search_name_' + i
).find('select').val();
95 var type
= $('#search_name_' + i
).find('select :selected').text();
96 if ($('[name=sn_type_' + typeid
+ '_' + i
+ ']').val() > 0) {
97 $('#flag_cb_' + i
).after('<span id="flag_' + i
+ '"> ' +
98 '<img src="images/icons/flag_green.gif" alt="site public" title="site public" />' +
99 '<input type="hidden" name="search_names[' + i
+ '][pub]" value="1"/>' +
100 '<input type="hidden" name="search_names[' + i
+ '][typeid]" value="' + typeid
+ '"/>' +
101 '<input type="hidden" name="search_names[' + i
+ '][type]" value="' + type
+ '"/></span>');
103 $('#flag_cb_' + i
).after('<span id="flag_' + i
+ '"> ' +
104 '<img src="images/icons/flag_red.gif" alt="site privé" title="site privé" />' +
105 '<input type="hidden" name="search_names[' + i
+ '][typeid]" value="' + typeid
+ '"/>' +
106 '<input type="hidden" name="search_names[' + i
+ '][type]" value="' + type
+ '"/></span>');
110 function updateNameDisplay(isFemale
)
112 var searchnames
= '';
113 for (var i
= 0; i
< 10; i
++) {
114 if ($('#search_name_' + i
).find(':text').val()) {
115 searchnames
+= $('#search_name_' + i
).find('[name*=typeid]').val() + ';';
116 searchnames
+= $('#search_name_' + i
).find(':text').val() + ';;';
119 Ajax
.update_html(null, 'profile/ajax/buildnames/' + searchnames + '/' + isFemale
, function(data
){
120 var name
= data
.split(';');
121 $('#public_name').html(name
[0]);
122 $('#private_name').html(name
[0] + name
[1]);
126 function toggleParticle(id
)
128 if ($('#search_name_' + id
).find("[name*='[particle]']").val() == '') {
129 $('#search_name_' + id
).find("[name*='[particle]']").val(1);
131 $('#search_name_' + id
).find("[name*='[particle]']").val('');
137 function togglePromotionEdition()
139 $(".promotion_edition").toggle();
142 // Nationalities {{{1
144 function delNationality(i
)
146 $('#nationality' + i
).hide().find('select').val('');
149 function addNationality()
152 if ($('#nationality2').find('select').val() == "") {
154 } else if ($('#nationality3').find('select').val() == "") {
157 if ((i
== 2) || (i
== 3)) {
158 $('#nationality' + i
).show();
164 function prepareType(id
)
166 var edu
= $('.edu_' + id
).find("[name='edus[" + id
+ "][eduid]']").val() - 1;
167 var sel
= $('.edu_' + id
).find('[name=edu_' + id
+ '_tmp]').val();
169 var length
= educationDegree
[edu
].length
;
170 for (i
= 0; i
< length
; ++i
) {
171 html
+= '<option value="' + educationDegree
[edu
][i
] + '"';
172 if (sel
== educationDegree
[edu
][i
]) {
173 html
+= ' selected="selected"';
175 html
+= '>' + educationDegreeName
[educationDegree
[edu
][i
] - 1] + '</option>';
177 $('.edu_' + id
).find("[name='edus[" + id
+ "][degreeid]']").html(html
);
187 while (!$('#edu_add').hasClass(prefix
+ i
)) {
188 if ($('.' + prefix
+ i
).length
!= 0) {
194 class_parity
= 'pair';
196 class_parity
= 'impair';
198 $('#edu_add').removeClass(prefix
+ i
);
200 $('#edu_add').addClass(prefix
+ i
);
202 $.get(platal_baseurl
+ 'profile/ajax/edu/' + i + '/' + class_parity
,
204 $('#edu_add').before(data
);
209 function removeEdu(i
)
212 $('.' + prefix
+ i
).remove();
213 while (!$('#edu_add').hasClass(prefix
+ i
)) {
214 $('.' + prefix
+ i
).toggleClass('pair');
215 $('.' + prefix
+ i
).toggleClass('impair');
222 function addNetworking()
225 while ($('#networking_' + i
).length
!= 0) {
229 var html
= '<tr id="networking_' + i
+ '">'
230 + ' <td colspan="2">'
231 + ' <div style="float: left; width: 200px;">'
232 + ' <span class="flags">'
233 + ' <input type="checkbox" name="networking[' + i
+ '][pub]"/>'
234 + ' <img src="images/icons/flag_green.gif" alt="site public" title="site public">'
236 + ' <select name="networking[' + i
+ '][type]" onchange="javascript:updateNetworking(' + i
+ ');">';
237 for (nw
in nw_list
) {
238 if (namefirst
== '') {
241 html
+= ' <option value="' + nw_list
[nw
] + '">' + nw
+ '</option>';
244 + ' <input type="hidden" name="networking[' + i
+ '][name]" value="' + namefirst
+ '"/>'
246 + ' <div style="float: left">'
247 + ' <input type="text" name="networking[' + i
+ '][address]" value="" size="30"/>'
248 + ' <a href="javascript:removeNetworking(' + i
+ ')">'
249 + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer cet élément"/>'
255 $('#networking').before(html
);
258 function removeNetworking(id
)
260 $('#networking_' + id
).remove();
263 function updateNetworking(i
)
265 $('#networking_' + i
).find("[name='networking[" + i
+ "][name]']").val($('#networking_' + i
).find('select option:selected').text());
270 function toggleAddress(id
, val
)
272 $('#addresses_' + id
+ '_grayed').toggle();
273 $('#addresses_' + id
).toggle();
274 $('#addresses_' + id
+ '_cont').find('[name*=removed]').val(val
);
275 checkCurrentAddress();
278 function checkCurrentAddress(id
)
280 var hasCurrentAddress
= id
? true : false;
282 while ($('#addresses_' + i
+ '_cont').length
!= 0) {
283 if ($('#addresses_' + i
+ '_cont').find('[name*=removed]').val() == 1) {
284 $('#addresses_' + i
+ '_cont').find('[name*=current]').attr('checked', false);
286 if (!hasCurrentAddress
&& $('#addresses_' + i
+ '_cont').find('[name*=current]:checked').length
!= 0) {
287 hasCurrentAddress
= true;
289 $('#addresses_' + i
+ '_cont').find('[name*=current]').attr('checked', false);
293 if (!hasCurrentAddress
) {
295 while ($('#addresses_' + i
+ '_cont').length
!= 0) {
296 if ($('#addresses_' + i
+ '_cont').find('[name*=removed]').val() == 0) {
297 $('#addresses_' + i
+ '_cont').find('[name*=current]').attr('checked', 'checked');
304 $('#addresses_' + id
+ '_cont').find('[name*=current]').attr('checked', 'checked');
308 function addAddress()
311 while ($('#addresses_' + i
+ '_cont').length
!= 0) {
314 $('#add_address').before('<div id="addresses_' + i
+ '_cont"></div>');
315 Ajax
.update_html('addresses_' + i
+ '_cont', 'profile/ajax/address/' + i
, checkCurrentAddress());
318 function addressChanged(prefid
)
320 $('#' + prefid
+ '_cont').find('[name*=changed]').val("1");
323 function validGeoloc(prefid
, id
, geoloc
)
326 $('#' + prefid
+ '_cont').find('[name*=text]').val($('#' + prefid
+ '_cont').find('[name*=geoloc]').val());
327 $('#' + prefid
+ '_cont').find('[name*=postalText]').val($('#' + prefid
+ '_cont').find('[name*=geocodedPostalText]').val());
330 $('#' + prefid
+ '_cont').find("[name*='[geoloc]']").remove();
332 $('#' + prefid
+ '_cont').find('[name*=text]').removeClass('error');
333 $('#' + prefid
+ '_cont').find('[name*=geoloc_choice]').val(geoloc
);
334 $('.' + prefid
+ '_geoloc').remove();
339 function addTel(prefid
, prefname
)
342 var prefix
= prefid
+ '_';
343 while ($('#' + prefix
+ i
).length
!= 0) {
346 $('#' + prefix
+ 'add').before('<div id="' + prefix
+ i
+ '" style="clear: both; padding-top: 4px; padding-bottom: 4px"></div>');
347 Ajax
.update_html(prefix
+ i
, 'profile/ajax/tel/' + prefid + '/' + prefname
+ '/' + i
);
350 function removeTel(prefname
, prefid
, id
)
353 while ($('#' + prefid
+ '_' + total
).length
!= 0) {
356 $('#' + prefid
+ '_' + id
).remove();
357 for (var i
= parseInt(id
) + 1; i
< total
; ++i
) {
358 renumberPhone(prefname
, prefid
, i
);
362 function addPhoneComment(id
)
364 $('#' + id
+ '_comment').show();
365 $('#' + id
+ '_addComment').hide();
368 function removePhoneComment(id
, pref
)
370 $('#' + id
+ '_comment').hide();
371 $('#' + id
+ '_comment').find("[name='" + pref
+ "[comment]']").val('');
372 $('#' + id
+ '_addComment').show();
375 function renumberPhone(prefname
, prefid
, i
)
378 var telprefOld
= prefname
+ '[' + i
+ ']';
379 var telpref
= prefname
+ '[' + telid
+ ']';
380 var idOld
= prefid
+ '_' + i
;
381 var id
= prefid
+ '_' + telid
;
383 $('#' + idOld
).attr('id', id
);
384 $('#' + id
).find('div.titre').html('N°' + i
);
385 $('#' + id
).find('a.removeTel').attr('href', 'javascript:removeTel(\'' + prefname
+ '\',\'' + prefid
+ '\',' + telid
+ ')');
386 $('#' + id
).find('select').attr('name', telpref
+ '[type]');
387 $('#' + id
).find("[name='" + telprefOld
+ "[display]']").attr('name', telpref
+ '[display]');
388 $('#' + id
).find("[name='" + telprefOld
+ "[comment]']").attr('name', telpref
+ '[comment]');
389 $('#' + id
).find('a.removePhoneComment').attr('href', 'javascript:removePhoneComment(' + id
+ ',' + telpref
+ ')');
390 $('#' + id
).find('#' + idOld
+ '_addComment').attr('id', id
+ '_addComment');
391 $('#' + id
).find('#' + id
+ '_addComment').attr('href', 'javascript:addPhoneComment(' + id
+ ')');
392 $('#' + id
).find('#' + idOld
+ '_comment').attr('id', id
+ '_comment');
393 $('#' + id
).find("[name='" + telprefOld
+ "[pub]']").attr('name', telpref
+ '[pub]');
400 var id
= $('#binets_table').find('[name=binets_sel]').val();
401 var text
= $('#binets_table').find('select option:selected').text();
402 var html
= '<tr id="binets_' + id
+ '">'
404 + ' <input type="hidden" name="binets[' + id
+ ']" value="' + text
+ '" />'
407 + ' <div style="float: left; width: 70%">'
410 + ' <a href="javascript:removeElement(\'binets\',' + id
+ ')">'
411 + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer ce groupe" />'
415 $('#binets_table').after(html
);
416 updateElement('binets');
419 function updateGroupSubLink()
421 var href
= $('[name*=groupesx_sub]').val() ? $('[name*=groupesx_sub]').val() : 'http://www.polytechnique.net';
422 $('#groupesx_sub').attr('href', href
);
427 function updateMedal()
429 var val
= $('#medals').find('[name*=medal_sel]').val();
430 if (val
&& ($('#medal_' + val
).length
== 0)) {
431 $('#medal_add').show();
433 $('#medal_add').hide();
437 function getMedalName(id
)
439 $('#medal_name_' + id
).html(names
[id
]);
442 function buildGrade(id
, current
)
445 var subg
= subgrades
[id
];
446 var obj
= $('#medal_grade_' + id
);
448 obj
.prepend('<input type="hidden" name="medals[' + id
+ '][grade]" value="0" />');
450 var html
= 'Agrafe : <select name="medals[' + id
+ '][grade]">';
451 html
+= '<option value="0">Non précisée</option>';
452 for (grade
= 0 ; grade
< subg
.length
; grade
++) {
453 html
+= '<option value="' + subg
[grade
][0] + '"';
454 if (subg
[grade
][0] == current
) {
455 html
+= ' selected="selected"';
457 html
+= '>' + subg
[grade
][1] + '</option>';
465 function makeAddProcess(id
)
467 return function(data
)
469 $('#medals').after(data
);
478 var id
= $('#medals').find('[name=medal_sel]').val();
479 $.get(platal_baseurl
+ 'profile/ajax/medal/' + id
, makeAddProcess(id
));
482 function removeMedal(id
)
484 $("#medal_" + id
).remove();
490 function removeJob(id
, pref
)
492 $('#' + id
+ '_cont').hide();
493 if ($('#' + id
).find("[name='" + pref
+ "[new]']").val() == '0') {
494 $('#' + id
+ '_grayed').show();
495 $('#' + id
+ '_grayed_name').html($('#' + id
).find("[name='" + pref
+ "[name]']").val());
497 $('#' + id
).find("[name='" + pref
+ "[removed]']").val('1');
500 function restoreJob(id
, pref
)
502 $('#' + id
+ '_cont').show();
503 $('#' + id
+ '_grayed').hide();
504 $('#' + id
).find("[name='" + pref
+ "[removed]']").val('0');
507 function updateJobSector(id
, sel
)
509 var sector
= $('#job_' + id
).find("[name='jobs[" + id
+ "][sector]']").val();
513 Ajax
.update_html('job_' + id
+ '_subSector', 'profile/ajax/sector/' + id + '/job_' + id
+ '/jobs[' + id + ']/' + sector
+ '/' + sel
);
516 function updateJobSubSector(id
, sel
)
518 var subSector
= $('#job_' + id
).find("[name='jobs[" + id
+ "][subSector]']").val();
519 if (subSector
== '') {
522 Ajax
.update_html('job_' + id
+ '_subSubSector', 'profile/ajax/sub_sector/' + id + '/' + subSector
+ '/' + sel
);
525 function updateJobAlternates(id
)
527 var subSubSector
= $('#job_' + id
).find("[name='jobs[" + id
+ "][subSubSector]']").val();
528 if (subSubSector
!= '') {
529 Ajax
.update_html('job_' + id
+ '_alternates', 'profile/ajax/alternates/' + id + '/' + subSubSector
);
533 function emptyJobSubSector(id
)
535 Ajax
.update_html('job_' + id
+ '_subSubSector', 'profile/ajax/sub_sector/' + id + '/-1/-1');
538 function emptyJobAlternates(id
)
540 Ajax
.update_html('job_' + id
+ '_alternates', 'profile/ajax/alternates/' + id + '/-1');
543 function displayAllSector(id
)
545 $('.sector_text_' + id
).remove();
546 $('.sector_' + id
).show();
549 function makeAddJob(id
)
551 return function(data
)
553 $('#add_job').before(data
);
554 registerEnterpriseAutocomplete(id
);
561 while ($('#job_' + i
).length
!= 0) {
564 $.get(platal_baseurl
+ 'profile/ajax/job/' + i
, makeAddJob(i
));
567 function addEntreprise(id
)
569 $('.entreprise_' + id
).toggle();
573 * Adds a job term in job profile page
574 * @param jobid id of profile's job among his different jobs
575 * @param jtid id of job term to add
576 * @param full_name full text of job term
577 * @return false if the term already exist for this job, true otherwise
579 function addJobTerm(jobid
, jtid
, full_name
)
587 formvarname
= 'terms';
589 parentpath
= '#job_'+jobid
+' ';
590 formvarname
= 'jobs['+jobid
+'][terms]';
592 var lastJobTerm
= $(parentpath
+ '.job_term:last');
593 if (lastJobTerm
.length
!= 0) {
594 termid
= parseInt(lastJobTerm
.children('input').attr('name').replace(/^(jobs\[[0-9]+\]\[terms\]|terms)\[([0-9]+)\]\[jtid\]/, '$2')) + 1;
595 if ($('#job'+jobid
+'_term'+jtid
).length
> 0) {
599 var newdiv
= '<div class="job_term" id="job'+jobid
+'_term'+jtid
+'">'+
600 '<span>'+full_name
+'</span>'+
601 '<input type="hidden" name="'+formvarname
+'['+termid
+'][jtid]" value="'+jtid
+'" />'+
602 '<img title="Retirer ce mot-clef" alt="retirer" src="images/icons/cross.gif" />'+
604 if (lastJobTerm
.length
== 0) {
605 $(parentpath
+ '.job_terms').prepend(newdiv
);
607 lastJobTerm
.after(newdiv
);
609 $('#job'+jobid
+'_term'+jtid
+' img').css('cursor','pointer').click(removeJobTerm
);
614 * Remove a job term in job profile page.
615 * Must be called from a button in a div containing the term
617 function removeJobTerm()
619 $(this).parent().remove();
623 * Prepare display for autocomplete suggestions in job terms
624 * @param row an array of (title of term, id of term)
625 * @return text to display
626 * If id is negative, it is because there are too much terms to
629 function displayJobTerm(row
)
632 return '... <em>précise ta recherche</em> ...';
638 * Function called when a job term has been selected from autocompletion
640 * @param li is the list item (<li>) that has been clicked
641 * The context is the jsquery autocomplete object.
643 function selectJobTerm(li
)
645 if (li
.extra
[0] < 0) {
648 var jobid
= this.extraParams
.jobid
;
649 addJobTerm(jobid
,li
.extra
[0],$(li
).text());
652 search_input
= $('.term_search')[0];
654 search_input
= $('#job_'+jobid
+' .term_search')[0];
656 search_input
.value
= '';
657 search_input
.focus();
661 * Function to show or hide a terms tree in job edition
662 * @param jobid is the id of the job currently edited
664 function toggleJobTermsTree(jobid
)
670 treepath
= '#job_'+jobid
+' ';
672 treepath
+= '.term_tree';
673 if ($(treepath
+ ' ul').length
> 0) {
674 $(treepath
).empty().removeClass().addClass('term_tree');
677 createJobTermsTree(treepath
, 'profile/ajax/tree/jobterms/all', 'job' + jobid
, 'chooseJobTerm');
681 * Function called when a job term is chosen from terms tree
682 * @param treeid is the full id of the tree (must look like job3)
683 * @param jtid is the id of the job term chosen
684 * @param fullname is the complete name (understandable without context) of the term
686 function chooseJobTerm(treeid
, jtid
, fullname
)
688 addJobTerm(treeid
.replace(/^job(.*)$/, '$1'), jtid
, fullname
);
693 function addSkill(cat
)
695 var val
= $('#' + cat
+ '_table').find('[name=' + cat
+ '_sel]').val();
696 var text
= $('#' + cat
+ '_table').find('[name=' + cat
+ '_sel] :selected').text();
697 $.get(platal_baseurl
+ 'profile/ajax/skill/' + cat + '/' + val
,
699 $('#' + cat
).append(data
);
700 $('#' + cat
+ '_' + val
+ '_title').text(text
);
707 function addCountry()
709 var val
= $('#countries_table').find('[name=countries_sel] :selected').val();
710 var text
= $('#countries_table').find('[name=countries_sel] :selected').text();
711 var html
= '<div id="countries_' + val
+ '" style="clear: both; margin-bottom: 0.7em">'
712 + ' <a href="javascript:removeElement(\'countries\',\'' + val
+ '\')" style="display: block; float:right">'
713 + ' <img src="images/icons/cross.gif" alt="" title="Supprimer ce pays" />'
715 + ' <div style="float: left; width: 50%">' + text
+ '</div>'
716 + ' <input type="hidden" name="countries[' + val
+ ']" value="' + text
+ '" />'
718 $('#countries').append(html
);
719 updateElement('countries');
722 function updateSubSector()
724 var s
= $('#sectorSelection').find('[name=sectorSelection]').val();
725 var ss
= $('#subSectorSelection').find("[name='jobs[-1][subSector]']").val();
726 if ((s
== '' || ss
== '') || $('#sectors_' + s
+ '_' + ss
).length
!= 0) {
727 $('#addSector').hide();
729 $('#addSector').show();
733 function removeSector(s
, ss
)
735 $('#sectors_' + s
+ '_' + ss
).remove();
739 function updateSector()
741 var sector
= $('#sectorSelection').find('[name=sectorSelection]').val();
744 $('#subSectorSelection').html('');
747 $.get(platal_baseurl
+ 'profile/ajax/sector/-1/0/0/' + sector
,
749 data
= '<a href="javascript:addSector()" style="display: none; float: right" id="addSector">'
750 + ' <img src="images/icons/add.gif" alt="Ajouter ce secteur" title="Ajouter ce secteur" />'
752 $('#subSectorSelection').html(data
);
753 $('#subSectorSelection').find("[name='jobs[-1][subSector]']").change(updateSubSector
);
759 var s
= $('#sectorSelection').find('[name=sectorSelection]').val();
760 var ss
= $('#subSectorSelection').find("[name='jobs[-1][subSector]']").val();
761 var sst
= $('#subSectorSelection').find("[name='jobs[-1][subSector]'] :selected").text();
763 var html
= '<div id="sectors_' + s
+ '_' + ss
+ '" style="clear: both; margin-top: 0.5em" class="titre">'
764 + ' <a href="javascript:removeSector(\'' + s
+ '\',\'' + ss
+ '\')" style="display: block; float: right">'
765 + ' <img src="images/icons/cross.gif" alt="" title="Supprimer ce secteur" />'
767 + ' <input type="hidden" name="sectors[' + s
+ '][' + ss
+ ']" value="' + sst
+ '" />'
770 $('#sectors').append(html
);
774 function registerEnterpriseAutocomplete(id
)
776 $(".enterpriseName").each(
778 if (id
== -1 || this.name
== "jobs[" + id
+ "][name]") {
779 $(this).autocomplete(platal_baseurl
+ "search/autocomplete/entreprise",
784 width
:$(this).width()
789 $(".sectorName").each(
791 if (id
== -1 || this.name
== "jobs[" + id
+ "][subSubSectorName]") {
792 $(this).autocomplete(platal_baseurl
+ "search/autocomplete/subSubSector",
797 width
:$(this).width()
803 // {{{1 Multiusage functions
805 function updateElement(cat
)
807 var val
= $('#' + cat
+ '_table').find('[name=' + cat
+ '_sel]').val();
808 if (val
== '' || $('#' + cat
+ '_' + val
).length
!= 0) {
809 $('#' + cat
+ '_add').hide();
811 $('#' + cat
+ '_add').show();
815 function removeElement(cat
, id
)
817 $('#' + cat
+ '_' + id
).remove();
821 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: