e0c313cfe9eac90b057f98bb9bce2fac5cad2d31
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

1) refresh_group_list=function() {
2)   grouplist=$('#group-choice')[0];
3)   $('a.group-choice').each(function(idx,a) {
4)     $(a).parent().remove();
5)   });
6) 
7)   if (groups.count()==0) {
8)     $(grouplist).prepend('<li><a class="group-choice">Aucune groupe</a></li>');
9)   }
10)   else { 
11)     groups.each(function(idx,group) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

12)       $(grouplist).prepend('<li><a class="group-choice" data-uuid="'+group.uuid+'">'+group.name+'</a></li>');
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

13)     });
14) 
15)     $('a.group-choice').each(function(idx,a) {
16)       $(a).bind('click',on_group_choice_click);
17)     });
18)   }
19) }
20) 
21) 
22) /****************
23)  * Add group
24)  ****************/
Benjamin Renard Hide navbar-groupe-collapse...

Benjamin Renard authored 10 years ago

25) 
26) on_click_add_group_btn=function(e) {
Benjamin Renard Add function navbar_collaps...

Benjamin Renard authored 10 years ago

27)   navbar_collapse_hide();
Benjamin Renard Hide navbar-groupe-collapse...

Benjamin Renard authored 10 years ago

28)   $('#add_group_modal').modal('show');
29) }
30) 
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

31) on_show_add_group_modal=function(e) {
32)   $('#add_group_modal #add_group_name').focus();
33) }
34) 
Benjamin Renard Manage submit event in moda...

Benjamin Renard authored 10 years ago

35) on_valid_add_group_modal=function (e) {
36)   e.preventDefault();
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

37)   var name=$('#add_group_name')[0].value;
38)   if (name=='') {
39)     alert('Vous devez saisir un nom !');
40)     return;
41)   }
42)   if (groups[name]!==undefined) {
43)     alert('Ce groupe exite déjà !');
44)     return;
45)   }
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

46)   var uuid=groups.newGroup(name);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

47)   refresh_group_list();
48)   $('#add_group_modal').modal('hide');
49)   groups.save();
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

50)   view_group(groups[uuid]);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

51) }
52) 
53) on_close_add_group_modal=function () {
Benjamin Renard Fix error on add_group_moda...

Benjamin Renard authored 10 years ago

54)   $('#add_group_modal form')[0].reset();
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

55) }
56) 
57) /****************
58)  * Nav bars
59)  ****************/
60) on_group_choice_click=function(e) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

61)   view_group(groups[$(e.target).data('uuid')]);
Benjamin Renard Add function navbar_collaps...

Benjamin Renard authored 10 years ago

62)   navbar_collapse_hide();
63) }
64) 
65) navbar_collapse_hide=function() {
66)   if ($('#navbar-groupe-collapse').hasClass('in')) {
67)     $('#navbar-groupe-collapse').collapse('hide');
68)   }
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

69) }
70) 
Benjamin Renard Manage multiple screen part...

Benjamin Renard authored 10 years ago

71) /****************
72)  * Parts
73)  ****************/
74) 
75) view_part=function(part) {
76)   $('.part').each(function(idx,div) {
77)     $(div).css('display','none');
78)   });
79)   $(part).css('display','block');
80) }
81) 
82) view_home=function() {
Benjamin Renard Hide navbar on view_home

Benjamin Renard authored 10 years ago

83)   navbar_collapse_hide();
Benjamin Renard Manage multiple screen part...

Benjamin Renard authored 10 years ago

84)   if (user) {
85)     $('#view-home #title').html('Bonjour '+user.name);
86)   }
87)   else {
88)     $('#view-home #title').html('Bonjour');
89)   }
90)   if (groups.count()>0) {
91)     tbody=$('#view-home #mybalances tbody');
92)     tbody.html('');
93)     balances=groups.balances();
94)     var sum=0;
95)     for (g in balances) {
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

96)       if (jQuery.type(balances[g]['balance'][user.email])!='undefined') {
97)         if (balances[g]['balance'][user.email]['diff']<0) {
98)           sum+=balances[g]['balance'][user.email]['diff'];
99)           diff='<td class="negative">'+balances[g]['balance'][user.email]['diff'].toFixed(2)+'</td>';
Benjamin Renard Manage multiple screen part...

Benjamin Renard authored 10 years ago

100)         }
101)         else {
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

102)           value=balances[g]['balance'][user.email]['total']-balances[g]['min'];
Benjamin Renard Manage multiple screen part...

Benjamin Renard authored 10 years ago

103)           sum+=value;
104)           diff='<td class="positive">+'+value.toFixed(2)+' €</td>';
105)         }
Benjamin Renard Fixed link to group in Home...

Benjamin Renard authored 10 years ago

106)         tbody.html(tbody.html()+'<tr><td><a class="group-link" data-uuid="'+g+'">'+balances[g].name+'</a></td>'+diff+'</tr>');
Benjamin Renard Manage multiple screen part...

Benjamin Renard authored 10 years ago

107)       }
108)     }
Benjamin Renard Make group name as link in...

Benjamin Renard authored 10 years ago

109)     $('#view-home #mybalances a.group-link').bind('click',function(e) {
Benjamin Renard Fixed link to group in Home...

Benjamin Renard authored 10 years ago

110)       g=$(e.target).data('uuid');
Benjamin Renard Make group name as link in...

Benjamin Renard authored 10 years ago

111)       if (jQuery.type(groups[g])!='undefined') {
112)         view_group(groups[g]);
113)       }
114)     });
Benjamin Renard Manage multiple screen part...

Benjamin Renard authored 10 years ago

115)     if (sum<0) {
116)       $('#view-home #mybalances #total-value').html('<span class="negative">'+sum.toFixed(2)+' €</span>');
117)     }
118)     else {
119)       $('#view-home #mybalances #total-value').html('<span class="positive">'+(sum==0?'':'+')+sum.toFixed(2)+' €</span>');
120)     }
Benjamin Renard Fixed table display on home...

Benjamin Renard authored 10 years ago

121)     $('#view-home #mybalances').css('display','table');
Benjamin Renard Manage multiple screen part...

Benjamin Renard authored 10 years ago

122)   }
123)   else {
124)     $('#view-home #mybalances').css('display','none');
125)   }
126)   view_part('#view-home');
127) }
128) 
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

129) /****************
130)  * View group
131)  ****************/
Benjamin Renard Add possibility to view trash

Benjamin Renard authored 10 years ago

132) view_group=function(group,contributor_email) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

133)   $('#view-group').data('uuid',group.uuid);
Benjamin Renard Replace usage of view-group...

Benjamin Renard authored 10 years ago

134)   $('#view-group h1 span:first').html(group.name);
Benjamin Renard Add possibility to view trash

Benjamin Renard authored 10 years ago

135)   set_contributors(group,contributor_email);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

136)   on_contributor_change();
Benjamin Renard Manage multiple screen part...

Benjamin Renard authored 10 years ago

137)   view_part('#view-group');
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

138) }
139) 
Benjamin Renard Add possibility to view trash

Benjamin Renard authored 10 years ago

140) set_contributors=function(group,contributor_email) {
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

141)   $('#view-group #contributor option').remove();
142)   if(group.contributors.length==0) {
143)     $('#view-group #contributor').append('<option>Aucun participant</option>');
144)   }
145)   else {
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

146)     for (email in group.contributors) {
Benjamin Renard Add possibility to view trash

Benjamin Renard authored 10 years ago

147)       if (email == contributor_email) {
148)         sel=' selected';
149)       }
150)       else {
151)         sel='';
152)       }
153)       $('#view-group #contributor').append('<option value="'+email+'"'+sel+'>'+group.contributors[email].name+'</option>');
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

154)     }
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

155)   }
156) }
157) 
158) on_contributor_change=function(e) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

159)   show_contributions(groups[$('#view-group').data('uuid')],$('#view-group #contributor')[0].value);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

160) }
161) 
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

162) show_contributions=function(group,contributor_email) {
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

163)   var tbody=$($('#view-group #contributions tbody')[0]);
164)   tbody.html('');
165)   total=$($('#view-group #total-value')[0]);
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

166)   contributions=group.contributionsByContributorEmail(contributor_email);
Benjamin Renard Sort contribution by date o...

Benjamin Renard authored 10 years ago

167)   contributions.reverse();
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

168)   if (contributions.length==0) {
169)     tbody.append('<tr><td colspan=3>Aucune contributions</td></tr>');
170)     total.html('0,00 €');
171)   }
172)   else {
173)     sum=0;
Benjamin Renard Sort contribution by date o...

Benjamin Renard authored 10 years ago

174)     for (idx in contributions) {
175)       col_actions='<td><div class="btn-group" data-uuid="'+contributions[idx].uuid+'"><button type="button" class="btn btn-default contribution_edit_btn"><span class="glyphicon glyphicon-edit"></span></button><button type="button" class="btn btn-default contribution_delete_btn"><span class="glyphicon glyphicon-trash"></span></button></div></td>';
Benjamin Renard Display date of contributions

Benjamin Renard authored 10 years ago

176)       tbody.append('<tr><td>'+contributions[idx].getTitle()+'</td><td>'+contributions[idx].cost.toFixed(2)+' €<br/><span class="date">'+moment(contributions[idx].date).format('DD/MM/YYYY')+'</span></td>'+col_actions+'</tr>');
Benjamin Renard Sort contribution by date o...

Benjamin Renard authored 10 years ago

177)       sum+=contributions[idx].cost;
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

178)     }
Benjamin Renard Sort contribution by date o...

Benjamin Renard authored 10 years ago

179)     total.html(sum.toFixed(2)+' €');
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

180)   }
Benjamin Renard Clean code

Benjamin Renard authored 10 years ago

181)   
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

182)   $('.contribution_delete_btn').bind('click',on_contribution_delete_btn_click);
183)   $('.contribution_edit_btn').bind('click',on_contribution_edit_btn_click);
184) }
185) 
Benjamin Renard Add possibility to view trash

Benjamin Renard authored 10 years ago

186) /*****************************
187)  * Trash
188)  *****************************/
189) 
190) on_trash_group_btn_click=function(e) {
191)   group=groups[$('#view-group').data('uuid')];
192)   contributor_email=$('#view-group #contributor')[0].value;
193)   view_group_trash(group,contributor_email);
194) }
195) 
196) on_go_back_group_btn_click=function(e) {
197)   group=groups[$('#view-group-trash').data('uuid')];
198)   contributor_email=$('#view-group-trash').data('contributor-email');
199)   view_group(group,contributor_email);
200) }
201) 
202) view_group_trash=function(group,contributor_email) {
203)   $('#view-group-trash').data('uuid',group.uuid);
204)   $('#view-group-trash').data('contributor-email',contributor_email);
205)   var tbody=$('#view-group-trash #trash tbody');
206)   tbody.html('');
207)   contributions=group.deletedContributionsByContributorEmail(contributor_email);
208)   contributions.reverse();
209)   if (contributions.length==0) {
210)     tbody.append('<tr><td colspan=3>Aucune contributions</td></tr>');
211)   }
212)   else {
213)     for (idx in contributions) {
214)       tbody.append('<tr data-uuid="'+contributions[idx].uuid+'"><td>'+contributions[idx].getTitle()+'</td><td>'+contributions[idx].cost.toFixed(2)+' €<br/><span class="date">'+moment(contributions[idx].date).format('DD/MM/YYYY')+'</span></td><td><button type="button" class="btn btn-default contribution_restore_btn"><span class="glyphicon glyphicon-share"></span></button></td></tr>');
215)     }
216)   }
217)   
218)   $('#view-group-trash .contribution_restore_btn').bind('click',on_contribution_restore_btn_click);
219)  
220)   view_part('#view-group-trash');
221) }
222) 
223) on_contribution_restore_btn_click=function(e) {
224)   var group=groups[$('#view-group-trash').data('uuid')];
225)   contribution_uuid=$($(e.target).parents('tr')[0]).data('uuid');
226)   contribution=group.importContribution(group.deletedContributions[contribution_uuid]);
227)   myconfirm('Etes-vous sûre de vouloir restaurer la participation '+contribution.getTitle()+' de '+contribution.contributor.name+' ?',on_confirm_contribution_restore,null,{'group':group,'contribution_uuid':contribution_uuid, 'contribution': contribution} );
228) }
229) 
230) on_confirm_contribution_restore=function(data) {
231)   data.group.restoreContribution(data.contribution_uuid);
232)   groups.save();
233)   view_group(data.group,data.contribution.contributor.email);
234) }
235) 
Benjamin Renard Manage group contributors t...

Benjamin Renard authored 10 years ago

236) on_trash_group_contributors_btn_click=function(e) {
237)   group=groups[$('#view-group').data('uuid')];
238)   view_group_trash_contributors(group);
239) }
240) 
241) on_go_back_group_trash_contributors_btn_click=function(e) {
242)   group=groups[$('#view-group-trash-contributors').data('uuid')];
243)   view_group(group);
244) }
245) 
246) view_group_trash_contributors=function(group) {
247)   $('#view-group-trash-contributors').data('uuid',group.uuid);
248)   var tbody=$('#view-group-trash-contributors #trash tbody');
249)   tbody.html('');
250)   contributors=group.getDeletedContributors();
251)   if (contributors.length==0) {
252)     tbody.append('<tr><td colspan=3>Aucun participant</td></tr>');
253)   }
254)   else {
255)     for (idx in contributors) {
256)       tbody.append('<tr data-email="'+contributors[idx].email+'"><td>'+contributors[idx].name+'</td><td><button type="button" class="btn btn-default contributor_restore_btn"><span class="glyphicon glyphicon-share"></span></button></td></tr>');
257)     }
258)   }
259) 
260)   $('#view-group-trash-contributors .contributor_restore_btn').bind('click',on_contributor_restore_btn_click);
261) 
262)   view_part('#view-group-trash-contributors');
263) }
264) 
265) on_contributor_restore_btn_click=function(e) {
266)   var group=groups[$('#view-group-trash-contributors').data('uuid')];
267)   contributor_email=$($(e.target).parents('tr')[0]).data('email');
268)   contributor=group.importContributor(group.deletedContributors[contributor_email]);
269)   myconfirm('Etes-vous sûre de vouloir restaurer '+contributor.name+' ?',on_confirm_contributor_restore,null,{'group':group,'contributor_email':contributor_email, 'contributor': contributor} );
270) }
271) 
272) on_confirm_contributor_restore=function(data) {
273)   data.group.restoreContributor(data.contributor_email);
274)   groups.save();
275)   view_group(data.group,data.contributor_email);
276) }
277) 
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

278) /******************************
279)  * Add/Edit/remove contributor
280)  ******************************/
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

281) on_click_add_contributor_btn=function() {
Benjamin Renard Fixed add contributor

Benjamin Renard authored 10 years ago

282)   $('#add_contributor_modal').data('group-uuid',$('#view-group').data('uuid'))
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

283)   $($('#add_contributor_modal h4')[0]).html('Ajouter un participant');
284)   $($('#add_contributor_modal #add_contributor_submit')[0]).html('Ajouter');
285)   $('#view-group #edit_id')[0].value='-1';
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

286)   $('#add_contributor_modal #add_contributor_email').attr('disabled',false);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

287)   $('#add_contributor_modal').modal('show');
288) }
289) 
290) on_show_add_contributor_modal=function(e) {
291)   $('#add_contributor_modal #add_contributor_name').focus();
292) }
293) 
Benjamin Renard Add contributor's email val...

Benjamin Renard authored 10 years ago

294) validateEmail=function(email) {
295)     var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
296)     return re.test(email);
297) }
298) 
Benjamin Renard Manage submit event in moda...

Benjamin Renard authored 10 years ago

299) on_valid_add_contributor_modal=function(e) {
300)   e.preventDefault();
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

301)   var group=groups[$('#add_contributor_modal').data('group-uuid')];
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

302)   var name=$('#add_contributor_name')[0].value;
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

303)   edit_id=$('#view-group #edit_id')[0].value;
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

304)   if (name=='') {
305)     alert('Vous devez saisir un nom !');
306)     return;
307)   }
308)   var email=$('#add_contributor_email')[0].value;
309)   if (email=='') {
310)     alert('Vous devez saisir un email !');
311)     return;
312)   }
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

313)   duplicate=group.contributorByEmail(email)
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

314)   if (duplicate!=undefined && edit=='-1') {
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

315)     alert('Un contributor utilise déjà cet email !');
316)     return;
317)   }
Benjamin Renard Add contributor's email val...

Benjamin Renard authored 10 years ago

318)   if (!validateEmail(email)) {
319)     alert('Email invalide !');
320)     return;
321)   }
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

322)   if(edit_id=='-1') {
323)     group.addContributor(new Contributor(name,email));
324)   }
325)   else {
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

326)     group.replaceContributor(email,new Contributor(name,email));
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

327)   }
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

328)   set_contributors(group);
329)   $('#add_contributor_modal').modal('hide');
330)   groups.save();
Benjamin Renard Display contribution of con...

Benjamin Renard authored 10 years ago

331)   view_group(group,email);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

332) }
333) 
334) on_close_add_contributor_modal=function () {
335)   $('#add_contributor_name')[0].value='';
336)   $('#add_contributor_email')[0].value='';
337) }
338) 
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

339) on_edit_contributor_btn_click=function(e) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

340)   var group=groups[$('#view-group').data('uuid')];
341)   $('#add_contributor_modal').data('group-uuid',group.uuid);
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

342)   contributor_email=$('#view-group #contributor')[0].value;
343)   contributor=group.contributorByEmail(contributor_email);
344)   $('#view-group #edit_id')[0].value=contributor_email;
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

345)   $('#add_contributor_modal #add_contributor_name')[0].value=contributor.name;
346)   $('#add_contributor_modal #add_contributor_email')[0].value=contributor.email;
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

347)   $('#add_contributor_modal #add_contributor_email').attr('disabled',true);
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

348)   $($('#add_contributor_modal h4')[0]).html('Editer un participant');
349)   $($('#add_contributor_modal #add_contributor_submit')[0]).html('Valider');
350)   $('#add_contributor_modal').modal('show');
351) }
352) 
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

353) on_click_del_contributor_btn=function() {
Benjamin Renard Fix contributor deletion

Benjamin Renard authored 10 years ago

354)   var group=groups[$('#view-group').data('uuid')];
355)   contributor=group.contributorByEmail($('#view-group #contributor')[0].value);
356)   question='Voulez-vous vraiment supprimer '+contributor.name+' ?';
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

357)   myconfirm(question,on_confirm_del_contributor,null,contributor);
358) }
359) 
360) on_confirm_del_contributor=function(contributor) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

361)   var group=groups[$('#view-group').data('uuid')];
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

362)   group.removeContributor(contributor);
Benjamin Renard Display group home after de...

Benjamin Renard authored 10 years ago

363)   view_group(group);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

364)   groups.save();
365) }
366) 
367) /********************************
368)  * Add/edit/delete contribution
369)  ********************************/
370) on_show_add_contribution_modal=function(e) {
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

371)   $('#add_contribution_modal #add_contribution_contributor_email').html($('#view-group #contributor').html());
372)   $('#add_contribution_modal #add_contribution_contributor_email')[0].value=$('#view-group #contributor')[0].value;
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

373)   $('#add_contribution_modal #add_contribution_title').focus();
374) }
375) 
376) on_click_add_contribution_btn=function() {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

377)   $('#add_contribution_modal').data('group-uuid',$('#view-group').data('uuid'));
Benjamin Renard Use UUID as Contribution id...

Benjamin Renard authored 10 years ago

378)   $('#add_contribution_modal #edit_uuid')[0].value='-1';
bn8 Add pickadate date picker

bn8 authored 10 years ago

379)   $('#add_contribution_date')[0].value=moment().format('DD/MM/YYYY');
Benjamin Renard Customize add_contribution_...

Benjamin Renard authored 10 years ago

380)   $($('#add_contribution_modal h4')[0]).html('Ajouter une contribution');
381)   $($('#add_contribution_modal #add_contribution_submit')[0]).html('Ajouter');
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

382)   $('#add_contribution_modal').modal('show');
383) }
384) 
385) on_valid_add_contribution_modal=function(e) {
386)   e.preventDefault();
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

387)   var group=groups[$('#add_contribution_modal').data('group-uuid')];
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

388)   var contributor_email=$('#add_contribution_contributor_email')[0].value;
389)   var contributor=group.contributorByEmail(contributor_email);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

390)   if (contributor==undefined) {
391)     alert('Participant inconu !');
392)     return;
393)   }
394)   var title=$('#add_contribution_title')[0].value;
395)   if (title=='') {
396)     $('#add_contribution_title')[0].focus();
397)     alert('Vous devez saisir un titre !');
398)     return;
399)   }
400)   var cost=$('#add_contribution_cost')[0].value;
401)   if (cost=='') {
402)     $('#add_contribution_cost')[0].focus();
403)     alert('Vous devez saisir un coût !');
404)     return;
405)   }
Benjamin Renard Add support of dot and comm...

Benjamin Renard authored 10 years ago

406)   else if(!RegExp('^[0-9]*((,|\.)[0-9]{1,2})*$').test(cost)) {
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

407)     $('#add_contribution_cost')[0].focus();
408)     alert('Coût incorrect !');
409)     return;
410)   }
411)   cost=parseFloat(cost.replace(',','.'));
Benjamin Renard Clean code

Benjamin Renard authored 10 years ago

412)   
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

413)   var date=$('#add_contribution_date')[0].value;
bn8 Add pickadate date picker

bn8 authored 10 years ago

414)   date.replace(/ /g,'');
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

415)   if (date!='') {
416)     if(!RegExp('^[0-3][0-9]\/[0-1][0-9]\/[0-2][0-9][0-9][0-9]$').test(date)) {
417)       $('#add_contribution_date')[0].focus();
418)       alert('Date incorrect !');
419)       return;
420)     }
421)     date=moment(date,'DD-MM-YYYY').toDate();
422)     if (jQuery.type(date)!='date') {
423)       alert('Date non-reconnu !');
424)       return;
425)     }
426)   }
427)   else {
428)     date=new Date();
429)   }
Benjamin Renard Clean code

Benjamin Renard authored 10 years ago

430)   
Benjamin Renard Use UUID as Contribution id...

Benjamin Renard authored 10 years ago

431)   if($('#add_contribution_modal #edit_uuid')[0].value=='-1') {
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

432)     group.addContribution(new Contribution(contributor,cost,title,date));
433)   }
434)   else {
Benjamin Renard Use UUID as Contribution id...

Benjamin Renard authored 10 years ago

435)     contribution_uuid=$('#add_contribution_modal #edit_uuid')[0].value;
436)     group.updateContribution(contribution_uuid,new Contribution(contributor,cost,title,date));
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

437)   }
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

438)   show_contributions(group,contributor_email);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

439)   $('#add_contribution_modal').modal('hide');
440)   $('#add_contribution_modal form')[0].reset();
441)   groups.save();
442) }
443) 
444) on_close_add_contribution_modal=function () {
445)   $('#add_contribution_modal form')[0].reset();
446) }
447) 
448) on_contribution_delete_btn_click=function(e) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

449)   var group=groups[$('#view-group').data('uuid')];
Benjamin Renard Use UUID as Contribution id...

Benjamin Renard authored 10 years ago

450)   contribution_uuid=$($(e.target).parents('div')[0]).data('uuid');
451)   contribution=group.contributions[contribution_uuid];
452)   myconfirm('Etes-vous sûre de vouloir supprimer la participation '+contribution.getTitle()+' de '+contribution.contributor.name+' ?',on_confirm_contribution_delete,null,{'group':group,'contribution_uuid':contribution_uuid, 'contribution': contribution} );
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

453) }
454) 
455) on_confirm_contribution_delete=function(data) {
Benjamin Renard Use UUID as Contribution id...

Benjamin Renard authored 10 years ago

456)   data.group.deleteContribution(data.contribution_uuid);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

457)   groups.save();
458)   on_contributor_change();
459) }
460) 
461) on_contribution_edit_btn_click=function(e) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

462)   var group=groups[$('#view-group').data('uuid')];
463)   $('#add_contribution_modal').data('group-uuid',$('#view-group').data('uuid'));
Benjamin Renard Customize add_contribution_...

Benjamin Renard authored 10 years ago

464)   $($('#add_contribution_modal h4')[0]).html('Editer une contribution');
465)   $($('#add_contribution_modal #add_contribution_submit')[0]).html('Valider');
Benjamin Renard Use UUID as Contribution id...

Benjamin Renard authored 10 years ago

466)   contribution_uuid=$($(e.target).parents('div')[0]).data('uuid');
467)   contribution=group.contributions[contribution_uuid];
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

468)   $('#add_contribution_modal #add_contribution_contributor_email')[0].value=contribution.contributor.email;
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

469)   $('#add_contribution_modal #add_contribution_title')[0].value=contribution.getTitle();
470)   $('#add_contribution_modal #add_contribution_cost')[0].value=contribution.cost;
471)   $('#add_contribution_modal #add_contribution_date')[0].value=moment(contribution.date).format('DD/MM/YYYY');
Benjamin Renard Use UUID as Contribution id...

Benjamin Renard authored 10 years ago

472)   $('#add_contribution_modal #edit_uuid')[0].value=contribution_uuid;
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

473)   $('#add_contribution_modal').modal('show');
474) }
475) 
476) 
477) 
478) /********************
479)  * Clear local data
480)  ********************/
481) clear_local_data=function() {
Benjamin Renard Add function navbar_collaps...

Benjamin Renard authored 10 years ago

482)   navbar_collapse_hide();
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

483)   myconfirm('Etes-vous sûre de vouloir supprimer les données locales ?',on_confirm_clear_local_data);
484) }
485) 
486) on_confirm_clear_local_data=function(data) {
Benjamin Renard Just remove groups from loc...

Benjamin Renard authored 10 years ago

487)   delete localStorage.groups;
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

488)   location.reload();
489) }
490) 
491) /*********************
492)  * View balance
493)  *********************/
494) 
495) on_display_balance_btn_click=function(e) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

496)   group=groups[$('#view-group').data('uuid')];
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

497)   display_balance(group);
498) }
499) 
500) display_balance=function(group) {
501)   bal=group.balance();
502)   tbody=$($('#display_balance_modal tbody')[0]);
503)   tbody.html('');
Benjamin Renard Improve balance display

Benjamin Renard authored 10 years ago

504)   for (c in bal['balance']) {
505)     if(bal['balance'][c]['diff']<0) {
506)       diff='<td class="negative">'+bal['balance'][c]['diff'].toFixed(2)+' €</td>';
507)     }
508)     else {
509)       diff='<td><span class="glyphicon glyphicon-thumbs-up"></span></td>';
510)     }
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

511)     tbody.append('<tr><td>'+bal['balance'][c]['name']+'</td><td>'+bal['balance'][c]['total'].toFixed(2)+' €</td>'+diff+'</tr>');
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

512)   }
Benjamin Renard Improve balance display

Benjamin Renard authored 10 years ago

513)   $('#display_balance_modal #total-value').html(bal.sum.toFixed(2)+' €');
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

514)   $('#display_balance_modal').modal('show');
515) }
516) 
517) /*********************
518)  * Remove group
519)  *********************/
520) 
521) on_remove_group_btn_click=function(e) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

522)   group=groups[$('#view-group').data('uuid')];
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

523)   myconfirm('Etes-vous sûre de vouloir supprimer le group '+group.name+' ?',on_confirm_remove_group,null,group);
524) }
525) 
526) on_confirm_remove_group=function(group) {
Benjamin Renard Add uuid to group and refer...

Benjamin Renard authored 10 years ago

527)   if(groups.removeGroup(group.uuid)) {
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

528)     groups.save();
529)     location.reload();
530)   }
531)   else {
532)     alert('Erreur en supprimant le groupe '+group.name+' :(');
533)   }
534) }
535) 
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

536) /********************
537)  * Login
538)  ********************/
539) on_close_login_modal=function(e) {
540)   $('#login_modal form')[0].reset();
541) }
542) 
543) sync_server=false;
544) on_valid_login_modal=function(e) {
Benjamin Renard Manage submit event in moda...

Benjamin Renard authored 10 years ago

545)   e.preventDefault();
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

546)   email=$('#login_modal #login_email')[0].value;
547)   pass=$('#login_modal #login_pass')[0].value;
548)   server=$('#login_modal #login_server')[0].value;
549)   $('#login_modal').modal('hide');
Benjamin Renard Use pleaseWaitDialog in som...

Benjamin Renard authored 10 years ago

550)   pleaseWaitShow();
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

551)   sync_server.login(server,email,pass,
552)     function(data) {
553)       localStorage.user=JSON.stringify({
554)         'name': data.name,
555)         'email': email,
556)         'password': pass,
557)         'server': server,
bn8 Add lastsync information to...

bn8 authored 10 years ago

558)         'lastsync': null
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

559)       });
Benjamin Renard Use pleaseWaitDialog in som...

Benjamin Renard authored 10 years ago

560)       pleaseWaitHide();
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

561)       logged_menu();
562)     },
563)     function(data) {
Benjamin Renard Use pleaseWaitDialog in som...

Benjamin Renard authored 10 years ago

564)       pleaseWaitHide();
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

565)       if (jQuery.type(data) != 'object' && data.loginerror) {
566)         alert(data.loginerror);
567)       }
568)       else {
569)         console.log(data);
570)         alert('Erreur durant la connexion au serveur');
571)       }
572)     }
573)   );
574) }
575) 
Benjamin Renard Add subscribe feature

Benjamin Renard authored 10 years ago

576) on_click_go_to_subscribe_btn=function() {
577)   $('#login_modal').modal('hide');
578)   $('#subscribe_modal').modal('show');
579) }
580) 
581) /********************
582)  * Subscribe
583)  ********************/
584) on_close_subscribe_modal=function(e) {
585)   $('#subscribe_modal form')[0].reset();
586) }
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

587) 
Benjamin Renard Add subscribe feature

Benjamin Renard authored 10 years ago

588) sync_server=false;
589) on_valid_subscribe_modal=function(e) {
590)   e.preventDefault();
591)   email=$('#subscribe_modal #subscribe_email')[0].value;
592)   name=$('#subscribe_modal #subscribe_name')[0].value;
593)   pass=$('#subscribe_modal #subscribe_pass')[0].value;
594)   server=$('#subscribe_modal #subscribe_server')[0].value;
595)   $('#subscribe_modal').modal('hide');
596)   pleaseWaitShow();
597)   sync_server.subscribe(server,email,name,pass,
598)     function(data) {
599)       localStorage.user=JSON.stringify({
600)         'name': data.name,
601)         'email': data.email,
602)         'password': data.password,
603)         'server': server,
604)       });
605)       pleaseWaitHide();
606)       logged_menu();
607)       alert('Bienvenu '+data.name+' !');
608)     },
609)     function(data) {
610)       pleaseWaitHide();
611)       if (jQuery.type(data) == 'object' && jQuery.type(data.subscribeerror)!='undefined') {
612)         alert(data.subscribeerror);
613)       }
614)       else {
615)         console.log(data);
616)         alert('Erreur durant la connexion au serveur');
617)       }
618)     }
619)   );
620) }
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

621) 
622) /********************
623)  * Sync
624)  ********************/
625) on_click_sync_btn=function(e) {
Benjamin Renard Hide navbar after sync btn...

Benjamin Renard authored 10 years ago

626)   navbar_collapse_hide();
Benjamin Renard Manage user global variable

Benjamin Renard authored 10 years ago

627)   if (user) {
Benjamin Renard Use pleaseWaitDialog in som...

Benjamin Renard authored 10 years ago

628)     pleaseWaitShow();
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

629)     onsuccess=function(data) {
630)       console.log(data);
631)       if (data.groups) {
632)         groups.import(data.groups);
633)         groups.save();
bn8 Add lastsync information to...

bn8 authored 10 years ago

634)         user.lastsync=new Date().getTime();
635)         localStorage.user=JSON.stringify(user);
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

636)         refresh_group_list();
Benjamin Renard Use pleaseWaitDialog in som...

Benjamin Renard authored 10 years ago

637)         pleaseWaitHide();
Benjamin Renard Display home after successf...

Benjamin Renard authored 10 years ago

638)         view_home();
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

639)         alert('Groupes synchronisés');
640)       }
641)       else {
642)         onerror(data);
643)       }
644)     }
645)     onerror=function(data) {
646)       pleaseWaitHide();
647)       console.log(data);
648)       if (jQuery.type(data['loginerror'])!='undefined') {
649)         alert(data['loginerror']);
650)       }
651)       else if (jQuery.type(data['syncerror'])!='undefined') {
652)         alert(data['syncerror']);
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

653)       }
Benjamin Renard Manage contributor by their...

Benjamin Renard authored 10 years ago

654)       else {
655)         alert('Erreur durant la synchronisation :(');
656)       }
657)     }
658)     sync_server.sync(user.server, user.email, user.password, groups.export(),onsuccess,onerror);
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

659)   }
660)   else {
661)     alert("Vous devez vous connecter pour commencer");
662)     $('#login_modal').modal('show');
663)   }
664) }
665) 
666) /*
667)  * User menu
668)  */
669) user=false;
670) logged_menu=function() {
671)   user=JSON.parse(localStorage.user);
672)   $('#user-name').html(user.name);
673)   $('#user-menu li').remove();
674)   menu=$('#user-menu');
675)   menu.html("<li><a id='myaccount_btn'>Mon compte</a></li>"+
676)   "<li><a id='sync_btn'>Synchroniser</a></li>" +
677)   "<li class='divider'></li>" +
678)   "<li><a id='logoff_btn'>Déconnexion</a></li>");
679)   $('#myaccount_btn').bind('click',on_click_myaccount_btn);
680)   $('#sync_btn').bind('click',on_click_sync_btn);
681)   $('#logoff_btn').bind('click',on_click_logoff_btn);
682) }
683) 
684) logged_out_menu=function() {
Benjamin Renard Manage user global variable

Benjamin Renard authored 10 years ago

685)   user=false;
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

686)   $('#user-name').html('Connexion');
687)   $('#user-menu li').remove();
688)   menu=$('#user-menu');
Benjamin Renard Add subscribe feature

Benjamin Renard authored 10 years ago

689)   menu.html("<li><a id='login_btn'>Connexion</a></li>"+
690) 	"<li><a id='subscribe_btn'>Inscription</a></li>");
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

691)   $('#login_btn').bind('click',on_click_login_btn);
Benjamin Renard Add subscribe feature

Benjamin Renard authored 10 years ago

692)   $('#subscribe_btn').bind('click',on_click_subscribe_btn);
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

693) }
694) 
695) on_click_myaccount_btn=function() {
696)   $('#myaccount_modal #myaccount_email').html(user.email);
697)   $('#myaccount_modal #myaccount_name')[0].value=user.name;
Benjamin Renard Display server in myaccount...

Benjamin Renard authored 10 years ago

698)   $('#myaccount_modal #myaccount_server').html(user.server);
bn8 Add lastsync information to...

bn8 authored 10 years ago

699)   if (user.lastsync) {
700)     $('#myaccount_modal #myaccount_lastsync').html(moment(user.lastsync).format('DD/MM/YYYY HH:mm:ss'));
701)   }
702)   else {
703)     $('#myaccount_modal #myaccount_lastsync').html('Jamais synchronis&eacute;');
704)   }
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

705)   $('#myaccount_modal').modal('show');
706) }
707) 
708) on_click_login_btn=function() {
709)   $('#login_modal').modal('show');
710) }
711) 
Benjamin Renard Add subscribe feature

Benjamin Renard authored 10 years ago

712) on_click_subscribe_btn=function() {
713)   $('#subscribe_modal').modal('show');
714) }
715) 
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

716) on_click_logoff_btn=function() {
717)   delete localStorage.user;
718)   logged_out_menu();
719) }
720) 
Benjamin Renard Add pleaseWaitDialog and fu...

Benjamin Renard authored 10 years ago

721) /*******************
722)  * pleaseWaitDialog
723)  *******************/
724) 
725) pleaseWaitShow=function() {
Benjamin Renard Fix please wait modal

Benjamin Renard authored 10 years ago

726)   $('#please_wait_modal').modal('show');
Benjamin Renard Add pleaseWaitDialog and fu...

Benjamin Renard authored 10 years ago

727) }
728) 
729) pleaseWaitHide=function() {
Benjamin Renard Fix please wait modal

Benjamin Renard authored 10 years ago

730)   $('#please_wait_modal').modal('hide');
Benjamin Renard Add pleaseWaitDialog and fu...

Benjamin Renard authored 10 years ago

731) }
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

732) 
733) /*********************
734)  * Activate
735)  *********************/
736) $( document ).ready( function() {
Benjamin Renard Use pleaseWaitDialog in som...

Benjamin Renard authored 10 years ago

737)   pleaseWaitShow();
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

738)   if(typeof(Storage)!=="undefined"){
739)     groups=new GroupList();
740)     groups.loadFromLocalStorage();
741)     refresh_group_list();
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

742)     if (jQuery.type(localStorage.user)!='undefined') {
743)       logged_menu();
744)     }
745)     else {
746)       logged_out_menu();
747)     }
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

748)   }
749)   else {
750)     alert('Local storage not supported !');
Benjamin Renard Use pleaseWaitDialog in som...

Benjamin Renard authored 10 years ago

751)     pleaseWaitHide();
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

752)     return;
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

753)   }
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

754)   sync_server=new SyncServer();
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

755) 
Benjamin Renard Add link on App Name in Navbar

Benjamin Renard authored 10 years ago

756)   $('#app-name').bind('click',view_home);
757) 
Benjamin Renard Hide navbar-groupe-collapse...

Benjamin Renard authored 10 years ago

758)   $('#add_group_btn').bind('click',on_click_add_group_btn);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

759)   $('#add_group_submit').bind('click',on_valid_add_group_modal);
760)   $("#add_group_modal").on('shown.bs.modal',on_show_add_group_modal);
761)   $("#add_group_modal").on('hidden.bs.modal',on_close_add_group_modal);
Benjamin Renard Manage submit event in moda...

Benjamin Renard authored 10 years ago

762)   $("#add_group_modal form").bind('submit',on_valid_add_group_modal);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

763) 
764)   $('#clear_local_data').bind('click',clear_local_data);
765) 
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

766)   $('#login_modal').on('hidden.bs.modal',on_close_login_modal);
767)   $('#login_modal #login_submit').bind('click',on_valid_login_modal);
Benjamin Renard Add subscribe feature

Benjamin Renard authored 10 years ago

768)   $('#login_modal #go_to_subscribe_btn').bind('click',on_click_go_to_subscribe_btn);
Benjamin Renard Add login and sync support

Benjamin Renard authored 10 years ago

769)   $('#login_modal form').bind('submit',on_valid_login_modal);
770) 
Benjamin Renard Add subscribe feature

Benjamin Renard authored 10 years ago

771)   $('#subscribe_modal').on('hidden.bs.modal',on_close_subscribe_modal);
772)   $('#subscribe_modal #subscribe_submit').bind('click',on_valid_subscribe_modal);
773)   $('#subscribe_modal form').bind('submit',on_valid_subscribe_modal);
774) 
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

775)   $('#view-group #contributor').bind('change',on_contributor_change);
776) 
777)   $('#add_contributor_btn').bind('click',on_click_add_contributor_btn);
778)   $('#add_contributor_submit').bind('click',on_valid_add_contributor_modal);
779)   $("#add_contributor_modal").on('shown.bs.modal',on_show_add_contributor_modal);
780)   $("#add_contributor_modal").on('hidden.bs.modal',on_close_add_contributor_modal);
Benjamin Renard Manage submit event in moda...

Benjamin Renard authored 10 years ago

781)   $("#add_contributor_modal form").bind('submit',on_valid_add_contributor_modal);
bn8 Add pickadate date picker

bn8 authored 10 years ago

782)   $("#add_contribution_date").pickadate({'format': 'dd/mm/yyyy','firstDay': 1});
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

783) 
Benjamin Renard Add edit contributor feature

Benjamin Renard authored 10 years ago

784)   $('#edit_contributor_btn').bind('click',on_edit_contributor_btn_click);
Benjamin Renard Manage group contributors t...

Benjamin Renard authored 10 years ago

785)   $('#trash_contributor_btn').bind('click',on_trash_group_contributors_btn_click);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

786)   $('#del_contributor_btn').bind('click',on_click_del_contributor_btn);
787) 
788)   $('#add_contribution_btn').bind('click',on_click_add_contribution_btn);
789)   $('#add_contribution_submit').bind('click',on_valid_add_contribution_modal);
790)   $("#add_contribution_modal").on('shown.bs.modal',on_show_add_contribution_modal);
791)   $("#add_contribution_modal").on('hidden.bs.modal',on_close_add_contribution_modal);
792)   $("#add_contribution_modal form").on('submit',on_valid_add_contribution_modal);
793) 
794)   $("#display_balance_btn").bind('click',on_display_balance_btn_click);
795) 
Benjamin Renard Add possibility to view trash

Benjamin Renard authored 10 years ago

796)   $("#view-group-trash #go-back-group").bind('click',on_go_back_group_btn_click);
Benjamin Renard Manage group contributors t...

Benjamin Renard authored 10 years ago

797)   $("#view-group-trash-contributors #go-back-group").bind('click',on_go_back_group_trash_contributors_btn_click);
Benjamin Renard Add possibility to view trash

Benjamin Renard authored 10 years ago

798) 
799)   $('#trash_group_btn').bind('click',on_trash_group_btn_click);
Benjamin Renard Initial commit

Benjamin Renard authored 10 years ago

800)   $('#remove_group_btn').bind('click',on_remove_group_btn_click);
Benjamin Renard Manage multiple screen part...

Benjamin Renard authored 10 years ago

801)   view_home();
Benjamin Renard Use pleaseWaitDialog in som...

Benjamin Renard authored 10 years ago

802)   pleaseWaitHide();