- 1
- 2
- 3
- 4
- 5
- 6
- 7
function actionId(child) {
return child.action[{
'menu': 'ivrMenuId',
'queu': 'queueId',
'scenario': 'scenarioId'
}[child.action.type.toLowerCase()]];
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+161
function actionId(child) {
return child.action[{
'menu': 'ivrMenuId',
'queu': 'queueId',
'scenario': 'scenarioId'
}[child.action.type.toLowerCase()]];
}
Те,кто будет это поддерживать, недостойны моего сострадания!
+159
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';
}
Я такое писал когда только-только учился программировать. А тут "серьезная контора"...
+170
var divComment = img.getParent('div').getChildren('div.comment-children')[0];
Из набирающего обороты LiveStreet. В теме есть чудо-скрипт comments.js, 79-я строчка. Все аяксы и ответы на комменты держатся на стратегической картинке. Не зная всунул картинко в другое место - трахался несколько часов ):
+168
// 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. Восстановление такого же плана...
+163
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;
}
Надеюсь, что это генерировали в цикле, а не писали руками.
+159
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>";
+164
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)
+183
if(!xyjax) {
if(typeof XMLHttpRequest != "undefined") {
xyjax = new XMLHttpRequest();
} else {
//failed = true; // ВАШ БРАУЗОР - ГОВНО
}
}
+166
<!-- 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/
+174
/*
Собтсвенность 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
надеюсь меня не посадят за нарушение авторских прав:)