home.js 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. $(document).ready(function(){
  2. // Ouverture de la zone "ajouter un element""
  3. $('#element_add_link').click(function(){
  4. $('#element_add_box').slideDown("slow");
  5. $('#element_add_link').hide();
  6. $('form[name="search"]').slideUp();
  7. return false;
  8. });
  9. // Fermeture de la zone "ajouter un element""
  10. $('#element_add_close_link').click(function(){
  11. $('#element_add_box').slideUp("slow");
  12. $('#element_add_link').show();
  13. $('form[name="search"]').slideDown();
  14. //form_add_reinit();
  15. // copie du contenu de la fonction ci dessus, arrive pas a l'appeler ... huh
  16. $('div#element_add_box').slideUp();
  17. $('div#form_add_first_part').show();
  18. $('div#form_add_second_part').hide();
  19. $('ul#form_add_prop_tags').hide();
  20. $('ul#form_add_prop_tags_text').hide();
  21. $('input#element_add_url').val('');
  22. $('input#element_add_name').val('');
  23. return false;
  24. });
  25. // Bouton suivre
  26. $('div.show_options a.following').live({
  27. mouseenter:
  28. function()
  29. {
  30. $(this).html(string_follow_stop);
  31. },
  32. mouseleave:
  33. function()
  34. {
  35. $(this).html(string_follow_following);
  36. }
  37. }
  38. );
  39. $('div.show_options a.follow_link').live('click', function(){
  40. link = $(this);
  41. $.getJSON(link.attr('href'), function(response) {
  42. if (response.status == 'mustbeconnected')
  43. {
  44. $(location).attr('href', url_index);
  45. }
  46. if (response.status == 'success')
  47. {
  48. if (response.following)
  49. {
  50. link.html(string_follow_following);
  51. link.removeClass('notfollowing');
  52. link.addClass('following');
  53. }
  54. else
  55. {
  56. link.html(string_follow_follow);
  57. link.addClass('notfollowing');
  58. link.removeClass('following');
  59. }
  60. }
  61. });
  62. return false;
  63. });
  64. });