1. JavaScript / Говнокод #4149

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    function actionId(child) {
    	return child.action[{
    		'menu': 'ivrMenuId',
    		'queu': 'queueId',
    		'scenario': 'scenarioId'
    	}[child.action.type.toLowerCase()]];
    }

    Те,кто будет это поддерживать, недостойны моего сострадания!

    ixth, 01 Сентября 2010

    Комментарии (5)
  2. JavaScript / Говнокод #4145

    +159

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if(this.sideEnd=='none')
    {
    	if(this.d_obj_ll.style.display!='block')
    		this.d_obj_ll.style.display='block';
    	if(this.d_obj_lr.style.display!='block')
    		this.d_obj_lr.style.display='block';
    }

    Я такое писал когда только-только учился программировать. А тут "серьезная контора"...

    IHateBidloKod, 01 Сентября 2010

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

    +170

    1. 1
    var divComment = img.getParent('div').getChildren('div.comment-children')[0];

    Из набирающего обороты LiveStreet. В теме есть чудо-скрипт comments.js, 79-я строчка. Все аяксы и ответы на комменты держатся на стратегической картинке. Не зная всунул картинко в другое место - трахался несколько часов ):

    hybroid, 01 Сентября 2010

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

    +168

    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
    62. 62
    63. 63
    // Saves options to localStorage.
    function save_options() {
    	if(document.getElementById("rate").checked == true) {localStorage["rate"] = 1;}
    else{localStorage["rate"] = 0;}
    	if(document.getElementById("transparentmenu").checked == true) {localStorage["transparentmenu"] = 1;}
    else{localStorage["transparentmenu"] = 0;}
    	if(document.getElementById("sidebarfix").checked == true) {localStorage["sidebarfix"] = 1;}
    else{localStorage["sidebarfix"] = 0;}
    	if(document.getElementById("menufix").checked == true) {localStorage["menufix"] = 1;}
    else{localStorage["menufix"] = 0;}
    	if(document.getElementById("away").checked == true) {localStorage["away"] = 1;}
    else{localStorage["away"] = 0;}
    	if(document.getElementById("music").checked == true) {localStorage["music"] = 1;}
    else{localStorage["music"] = 0;}
    	if(document.getElementById("smiles").checked == true) {localStorage["smiles"] = 1;}
    else{localStorage["smiles"] = 0;}
    	if(document.getElementById("chat").checked == true) {localStorage["chat"] = 1;}
    else{localStorage["chat"] = 0;}
    	if(document.getElementById("wide").checked == true) {localStorage["wide"] = 1;}
    else{localStorage["wide"] = 0;}
    	if(document.getElementById("oblivionbook").checked == true) {localStorage["oblivionbook"] = 1;}
    else{localStorage["oblivionbook"] = 0;}
    	if(document.getElementById("darkblue").checked == true) {localStorage["darkblue"] = 1;}
    else{localStorage["darkblue"] = 0;}
    	if(document.getElementById("mailcollor").checked == true) {localStorage["mailcollor"] = 1;}
    else{localStorage["mailcollor"] = 0;}
    	if(document.getElementById("savetext").checked == true) {localStorage["savetext"] = 1;}
    else{localStorage["savetext"] = 0;}
    	if(document.getElementById("groupsalign").checked == true) {localStorage["groupsalign"] = 1;}
    else{localStorage["groupsalign"] = 0;}
    	if(document.getElementById("vkcom").checked == true) {localStorage["vkcom"] = 1;}
    else{localStorage["vkcom"] = 0;}
    	if(document.getElementById("messege").checked == true) {localStorage["messege"] = 1;}
    else{localStorage["messege"] = 0;}
    	if(document.getElementById("ads").checked == true) {localStorage["ads"] = 1;}
    else{localStorage["ads"] = 0;}
    	if(document.getElementById("lmessege").checked == true) {localStorage["lmessege"] = 1;}
    else{localStorage["lmessege"] = 0;}
    	if(document.getElementById("video").checked == true) {localStorage["video"] = 1;}
    else{localStorage["video"] = 0;}
    	if(document.getElementById("stylewow").checked == true) {localStorage["stylewow"] = 1;}
    else{localStorage["stylewow"] = 0;}
    	if(document.getElementById("rayman").checked == true) {localStorage["rayman"] = 1;}
    else{localStorage["rayman"] = 0;}
    	if(document.getElementById("styletf2").checked == true) {localStorage["styletf2"] = 1;}
    else{localStorage["styletf2"] = 0;}
    	if(document.getElementById("stylestandard").checked == true) {localStorage["stylestandard"] = 1;}
    else{localStorage["stylestandard"] = 0;}
    	if(document.getElementById("stylewinter").checked == true) {localStorage["stylewinter"] = 1;}
    else{localStorage["stylewinter"] = 0;}
    	if(document.getElementById("stylewide").checked == true) {localStorage["stylewide"] = 1;}
    else{localStorage["stylewide"] = 0;}
    	if(document.getElementById("styledarkforest").checked == true) {localStorage["styledarkforest"] = 1;}
    else{localStorage["styledarkforest"] = 0;}
    	if(document.getElementById("stylegray").checked == true) {localStorage["stylegray"] = 1;}
    else{localStorage["stylegray"] = 0;}
    	if(document.getElementById("styledarkkde").checked == true) {localStorage["styledarkkde"] = 1;}
    else{localStorage["styledarkkde"] = 0;}
    	if(document.getElementById("friendsonline").checked == true) {localStorage["friendsonline"] = 1;}
    else {localStorage["friendsonline"] = 0;}
    	if(document.getElementById("removeheader").checked == true) {localStorage["removeheader"] = 1;}
    else {localStorage["removeheader"] = 0;}
    }

    Сохранение настроек в одном расширении для Google Chrome. Восстановление такого же плана...

    Proxeter, 01 Сентября 2010

    Комментарии (9)
  5. JavaScript / Говнокод #4139

    +163

    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
    if (document.all('text1')!=null)
      {
       obj=document.all('text1');
       obj.style.position='absolute';
       obj.style.left=785+k;
       obj.style.top=66;
      }
      if (document.all('text1')!=null)
      {
      obj=document.all('text2');
      obj.style.position='absolute';
      obj.style.left=785+k;
      obj.style.top=88;
      }
      if (document.all('text1')!=null)
      {
      obj=document.all('img1');
      obj.style.position='absolute';
      obj.style.left=730+k;
      obj.style.top=72;
      }
      if (document.all('text1')!=null)
      {
      obj=document.all('img2');
      obj.style.position='absolute';
      obj.style.left=904+k;
      obj.style.top=84;
      }
      if (document.all('text1')!=null)
      {
      obj=document.all('img3');
      obj.style.position='absolute';
      obj.style.left=785+k;
      obj.style.top=39;
      }
      if (document.all('text1')!=null)
      {
      obj=document.all('img4');
      obj.style.position='absolute';
      obj.style.left=795+k;
      obj.style.top=109;
      }

    Надеюсь, что это генерировали в цикле, а не писали руками.

    telnet, 31 Августа 2010

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

    +159

    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
    echo "<script type='text/javascript'>  
    function checksubmit ( form )
                {  ";
        echo "if (acton) {";
    $get_count_parts="SELECT PartID, ProdDesc FROM Pr2  WHERE  ProdID='".$_SESSION["ProdID"]."' AND FOblig='*'";
    $get_count_parts1=mysql_query($get_count_parts);
    while ($pr=mysql_fetch_assoc($get_count_parts1))
    {
        echo"var zart".$pr['PartID']."=document.getElementsByName('21_".$pr['PartID']."')[0].value;
                  var name".$pr['PartID']."=document.getElementsByName('14_".$pr['PartID']."')[0].value;";    
    }
    echo "var curr=document.getElementsByName('20_1')[0].value;
              if (curr=='') { alert('Currency was not specified'); return false;}";
    $get_count_parts2=mysql_query($get_count_parts);
    while ($pr=mysql_fetch_assoc($get_count_parts2))
    {
        echo"else if (zart".$pr['PartID']."=='' &&  name".$pr['PartID']."!='') {alert('Art for ".$pr['ProdDesc']." was not specified'); return false;}";    
    }
    echo "}  return true; 
             } </script>";

    Born, 31 Августа 2010

    Комментарии (8)
  7. JavaScript / Говнокод #4092

    +164

    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
    var modo_sac = 0;
    function buscar_sacapuntas(modo){
    	try {
    		if(modo!=null || modo!='undefined')
    			modo_sac = modo;
    		cn_sac = crearXMLHttpRequest();
    		var cad_x = encodeURIComponent(null)
    		cn_sac.onreadystatechange = procesar_sacapuntas;
    		cn_sac.open("POST","extranet/portal/xml/xml_publicos/xml_sacapunta.xml",true);
    		cn_sac.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    		cn_sac.send(cad_x);
    	}catch(exception) {
    		if(exception.description == null){
    			alert("ExcepciУГn a: " + exception.message);  
    		}else{
    			alert("ExcepciУГn a: " + exception.description);
    		}//end if
    	}//end try
    }//end function

    немного о том, как говнокодит Уго Чавэс в Венесуэле:)
    http://www.opsu.gob.ve/js/js_index.js
    см. строку 4 (венесуэльное условие) и 7 (венесуэльный encodeURIComponent)

    Alfred, 24 Августа 2010

    Комментарии (9)
  8. JavaScript / Говнокод #4086

    +183

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if(!xyjax) {
            if(typeof XMLHttpRequest != "undefined") {
                xyjax = new XMLHttpRequest();
            } else {
                //failed = true; // ВАШ БРАУЗОР - ГОВНО
            }
        }

    kostya123, 24 Августа 2010

    Комментарии (8)
  9. JavaScript / Говнокод #4085

    +166

    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
    <!-- Begin
    var months=new Array(13);
    months[1]="января";
    months[2]="февраля";
    months[3]="марта";
    months[4]="апреля";
    months[5]="мая";
    months[6]="июня";
    months[7]="июля";
    months[8]="августа";
    months[9]="сентября";
    months[10]="октября";
    months[11]="ноября";
    months[12]="декабря";
    var time=new Date();
    var date=time.getDate();
    var lmonth=months[time.getMonth() + 1];
    var year=time.getYear();
    if (year < 2000)    // Y2K Fix, Isaac Powell
    year = year + 1900; // http://onyx.idbsu.edu/~ipowell
    document.write(date + " ");
    document.write( lmonth + " "+ year + " года");
    // End -->

    Приспешник Паскаля.
    http://money.webdom.biz/

    Alfred, 24 Августа 2010

    Комментарии (7)
  10. JavaScript / Говнокод #4077

    +174

    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
    /*
        Собтсвенность ZeroParking,
        скрипт не подлежит частичному или полному 
        копированию, распрастранению, модификации.
    
        Moscow, 2010.
    */
    $doc = document;
    $id = function (r) { return $doc.getElementById(r) };
    $tag = function (r) { return $doc.getElementsByTagName(r); }; 
    $class = function (clsName) {
       ........ // получает все дом-объекты с классом clsName.
    }
    $create = function (r) { return $doc.createElement(r); };
    
    function load(url) {
    .... // подгружает js по url
    }
    $load = load;
    
    function GET(){
    .... // парсит строку запроса
    }
    $get = GET();

    говнокод с копирайтом!!!!! чей-то говнолиб.
    10 строка не везде работать будет.
    за точками ничего интересного, но поверхностно можно определить запах.
    там неудачная пародия на JQuery.
    http://0pk.ru/f/ru/0pk/lib.js
    надеюсь меня не посадят за нарушение авторских прав:)

    Alfred, 23 Августа 2010

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