1. Список говнокодов пользователя IRIDON

    Всего: 2

  2. JavaScript / Говнокод #17174

    +156

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    var move_container_after = function(toMove, toAfter) {
    	  $(toMove).insertAfter(toAfter);
    };
    
    var move_container_before = function(toMove, toBefore) {
    	  $(toMove).insertBefore(toBefore);
    };
    
    move_container_before(".toggle.basic1-tog", ".basic1 .store-order-item-group-action-list");
    move_container_after(".toggle.basic1rn-tog", ".basic1rn .store-order-item-description");
    
    move_container_before(".toggle.basic3-tog", ".basic3 .store-order-item-group-action-list");
    move_container_after(".toggle.basic3rn-tog", ".basic3rn .store-order-item-description");
    
    move_container_before(".toggle.bundle1-tog", ".bundle1 .store-order-item-group-action-list");
    move_container_after(".toggle.bundle1rn-tog", ".bundle1rn .store-order-item-group-action-list");
    
    move_container_before(".toggle.bundle12-tog", ".bundle12 .store-order-item-group-action-list");
    move_container_after(".toggle.bundle12rn-tog", ".bundle12rn .store-order-item-group-action-list");
    
    move_container_before(".toggle.bundle3-tog", ".bundle3 .store-order-item-group-action-list");
    move_container_after(".toggle.bundle3rn-tog", ".bundle3rn .store-order-item-group-action-list");
    
    move_container_before(".toggle.bundle6-tog", ".bundle6 .store-order-item-group-action-list");
    move_container_after(".toggle.bundle6rn-tog", ".bundle6rn .store-order-item-group-action-list");
    
    move_container_before(".toggle.desktop1-tog", ".desktop1 .store-order-item-group-action-list");
    move_container_after(".toggle.desktop1rn-tog", ".desktop1rn .store-order-item-description");
    
    move_container_before(".toggle.desktop12-tog", ".desktop12 .store-order-item-group-action-list");
    move_container_after(".toggle.desktop12rn-tog", ".desktop12rn .store-order-item-description");
    
    move_container_before(".toggle.desktop3-tog", ".desktop3 .store-order-item-group-action-list");
    move_container_after(".toggle.desktop3rn-tog", ".desktop3rn .store-order-item-description");
    
    move_container_before(".toggle.desktop6-tog", ".desktop6 .store-order-item-group-action-list");
    move_container_after(".toggle.desktop6rn-tog", ".desktop6rn .store-order-item-description");
    
    move_container_before(".toggle.desktopbus12-tog", ".desktopbus12 .store-order-item-group-action-list");
    move_container_after(".toggle.desktopbus12rn-tog", ".desktopbus12rn .store-order-item-description");   
    
    move_container_before(".toggle.desktopbus6-tog", ".desktopbus6 .store-order-item-group-action-list");
    move_container_after(".toggle.desktopbus6rn-tog", ".desktopbus6rn .store-order-item-description");
    
    move_container_before(".toggle.premium1-tog", ".premium1 .store-order-item-group-action-list");
    move_container_after(".toggle.premium1rn-tog", ".premium1rn .store-order-item-description");
    
    move_container_before(".toggle.premium12-tog", ".premium12 .store-order-item-group-action-list");
    move_container_after(".toggle.premium12rn-tog", ".premium12rn .store-order-item-description");
    
    move_container_before(".toggle.premium3-tog", ".premium3 .store-order-item-group-action-list");
    move_container_after(".toggle.premium3rn-tog", ".premium3rn .store-order-item-description");
    
    move_container_before(".toggle.premium6-tog", ".premium6 .store-order-item-group-action-list");
    move_container_after(".toggle.premium6rn-tog", ".premium6rn .store-order-item-description");
    
    move_container_before(".toggle.premiumbus12-tog", ".premiumbus12 .store-order-item-group-action-list");
    move_container_after(".toggle.premiumbus12rn-tog", ".premiumbus12rn .store-order-item-description");
    
    move_container_before(".toggle.premiumbus6-tog", ".premiumbus6 .store-order-item-group-action-list");
    move_container_after(".toggle.premiumbus6rn-tog", ".premiumbus6rn .store-order-item-description");

    "Перенос" формы, для каждого ID, в HTML есть соответствующее колово форм подобного типа

    <div class="toggle basic1-tog">Auto Renew: Off
    <form method="POST" action="https://sites.fastspring.com/store/api/order">
    <input type="hidden" name="operation" value="update"/>
    <input type="hidden" name="destination" value="checkout"/>
    <input type="hidden" name="product_1_path" value="/basicsubscription1monthrn"/>
    <input type="hidden" name="product_2_path" value="/basicsubscription1month"/>
    <input type="hidden" name="product_2_quantity" value="0"/>
    <input type="submit" value="Turn On"/>
    </form>
    </div>
    <div class="toggle basic1rn-tog">Auto Renew: On
    <form method="POST" action="https://sites.fastspring.com/store/api/order">
    <input type="hidden" name="operation" value="update"/>
    <input type="hidden" name="destination" value="checkout"/>
    <input type="hidden" name="product_1_path" value="/basicsubscription1month"/>
    <input type="hidden" name="product_2_path" value="/basicsubscription1monthrn"/>
    <input type="hidden" name="product_2_quantity" value="0"/>
    <input type="submit" value="Turn Off"/>
    </form>
    </div>

    IRIDON, 25 Ноября 2014

    Комментарии (4)
  3. JavaScript / Говнокод #16787

    +158

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    $(document).ready(function() {
     $('.tab1').click(function () {
      $('.tab-t1').show();
        $('.tab-t2').hide();
        $('.tab-t3').hide();
        $('.tab1 i').addClass('active');
        $('.tab2 i').removeClass('active');
        $('.tab2 i').removeClass('active');
     });
    
     $('.tab2').click(function () {
      $('.tab-t1').hide();
        $('.tab-t2').show();
        $('.tab-t3').hide();
        $('.tab1 i').removeClass('active');
        $('.tab2 i').addClass('active');
        $('.tab3 i').removeClass('active');
     });
     $('.tab3').click(function () {
      $('.tab-t1').hide();
        $('.tab-t2').hide();
        $('.tab-t3').show();
        $('.tab1 i').removeClass('active');
        $('.tab2 i').removeClass('active');
        $('.tab3 i').addClass('active');
     });
    });

    Из тестового задания

    IRIDON, 02 Октября 2014

    Комментарии (9)