• Страница 1 из 1
  • 1
Форум » uCoz » Помощь по uCoz » помогите найти косяк в коде
помогите найти косяк в коде
robertbat123 Оффлайн
Проверенный
5
Дата: Понедельник, 2014-11-17, 08:48 | Сообщение # 1
Привет всем.
Помогите найти косяк и исправить новый вид ЛС.
Не отправляются сообщения.

Код

if (location.href.split('/')[4] == '14-0-0' | location.href.split('/')[4] == '14') {
   $('#u1').attr({
    class: 'tabv'
   })
}
else if (location.href.split('/')[4] == '14-0-1') {
   $('#u2').attr({
    class: 'tabv'
   })
}
else if (location.href.split('/')[4] == '14-0-0-1' || $('#PMtoUser').val()) {
   $('#bar').hide();
   $('#mess').css({
    backgroundColor: '#fafafa'
   });;
   $('#mess').html('<div style="padding-top:30px;padding-bottom:30px;"><div id="valError2"></div><div id="valSuccess2"></div><div id="bmess"><div id="bmess2"><table width="100%"><tr><td align="left" valign="top"><div class="avaogets" style="margin-top:2px;"><img src='+noavatar+'></div></td><td width="100%" style="padding-left:15px;" align="left" valign="top"><div id="hname">Получатель</div><input type="text" id="nameSend"><div style="padding-top:9px;" id="hname">Тема</div><input type="text" id="tSend" value="Без темы..."></td></tr></table><textarea style="margin-top:10px;" id="message2"></textarea><div id="idCap" style="overflow:hidden;margin-top:3px;margin-left:1px;"><div style="float:left;" id="abbbb"></div><div style="float:right;"><input id="capval" maxlength="4" type="text"></div></div><div id="new_b" class="Mbd" style="margin-top:6px;" onclick="$(\'#sbm\').click()"><div id="new_b2">Отправить</div></div><div class="spanload" style="display:inline-block;padding-left:5px;"></div></div> </div></div>');
   $('#u4').attr({
    class: 'tabv'
   })
}
else if ($('.pmCatLinkActive:contains("Принятые")').text()) {
   $('#mess').css({
    backgroundColor: '#fafafa'
   });
   $('#snewmes,#bar').hide();
   $('#u3').show();
   $('#u3').attr({
    class: 'tabv'
   });
   $('#mess').html('<div style="padding-top:30px;padding-bottom:30px;"><div id="valError"></div><div id="valSuccess"></div><div id="bmess"><div id="bmess2"><table width="100%"><tr><td align="left" valign="top"><div class="avaoget" style="margin-top:2px;margin-left:-1px;"><img src='+noavatar+'></div></td><td width="100%" align="left" style="padding-left:10px;" valign="top"><div id="hname" class="tdA">' + $('td:eq(0)').find('a:first').text() + '</div><div style="padding:3px;"></div><div id="ubord"></div><div id="tmessA" style="padding-top:10px;padding-bottom:6px;">' + $('td[colspan="2"]').eq(1).html().replace(/\[\+\]/g, '1') + '</div></td></tr></table><textarea style="margin-top:8px;" id="message2"></textarea><div id="idCap" style="overflow:hidden;margin-top:3px;margin-left:1px;"><div style="float:left;" id="abbbb"></div><div style="float:right;"><input id="capval" maxlength="4" type="text"></div></div><div id="new_b" class="dbM" style="margin-top:6px;margin-left:1px;" onclick="$(\'#sbm\').click()"><div id="new_b2">Отправить</div></div><div class="spanload" style="display:inline-block;padding-left:5px;"></div></div></div></div>')
}
else if ($('.pmCatLinkActive:contains("Отправленные")').text()) {
   $('#mess').css({
    backgroundColor: '#fafafa'
   });
   $('#bar').hide();
   $('#u3').show();
   $('#u3').attr({
    class: 'tabv'
   });
   $('#mess').html('<div style="padding-top:30px;padding-bottom:30px;"><div id="valError"></div><div id="valSuccess"></div><div id="bmess"><div id="bmess2"><table width="100%"><tr><td align="left" valign="top"><div class="avaoget" style="margin-top:2px;"><img src='+noavatar+'></div></td><td width="100%" align="left" style="padding-left:10px;" valign="top"><div id="hname">Сообщение для <span class="tdA">' + $('td:eq(0)').find('a:first').text() + '</span></div><div style="padding:3px;"></div><div id="ubord"></div><div style="padding-top:10px;padding-bottom:6px;">' + $('td[colspan="2"]').eq(1).html() + '</div></td></tr></table></div></div></div>')
}
$('tr[id^="ent"]').each(function () {
   idq = $(this).find('img[id^="di"]').attr('name').substr(1);
   mthis = $(this);
   l = $(this).find('a:first').attr('href');
   if ($(this).find('b.unread').html()) {
    statMess = 'pp2';
                  statText = messageOpt[2]
   } else {
    statMess = 'pp';   
                  statText = messageOpt[1]
   };
   $('#mess').append('<div class="uentE" id=' + statMess + '><table cellpadding="0" cellspacing="0" style="width: 100%;"><tbody><tr><td style="vertical-align: top;width:300px;"><a href=' + $(this).find('a:eq(1)').attr('href') + '> ' + $(this).find('a:eq(1)').text() + '</a><br><span style="font-size:10px;color:grey;">' + $(this).find('td:eq(2)').text() + '</span></td><td style="vertical-align: top;width:500px;display:inline;"><a href=' + l + ' style="text-decoration:none;font-weight:bold;color:#808080;">' + $(this).find('a:first').text() + '</a><br><span style="color:grey;font-size:10px;">'+statText+'</span></td><td style="vertical-align: top;width:100px;text-align:right;padding-right:8px;padding-top:6px;"><a href="javascript://" alt = ' + idq + ' onclick="udel_item($(this).attr(\'alt\'));$(this).html(\'<img src=/ls/upload.gif border=0>\');$(this).hide()" style="color:#808080;text-decoration:none;border:0;outline:0" class = udel' + idq + ' ">Удалить</a></td></tr></tbody></table></div>')
});
if ($('td:contains("Сообщений нет")').text()) {
   $('#bar').hide();
   $('#mess').html('<div style="padding-top:15px;padding-bottom:15px;text-align:center;color:grey;font-size:12px;">'+messageOpt[0]+'</div>')
}

$('.checkall').click(function () {
   $(this).hide();
   $('.checkreset').show();
   $('#new_o,#delll').show();
   $('input[name="soll"]').click();
   $('#pp2,#pp').addClass('uselect');
});
$('.checkreset').click(function () {
   $('#pp2,#pp').removeClass('uselect');
   $('input[name="soll"]').click();
   $('#delll').hide();
   $(this).hide();
   $('.checkall').show();
});
$('#message2').keyup(function () {
   $('#message').val($(this).val())
});
$('#capval').keyup(function () {
   $('#secuCode').val($(this).val())
});

$('#nameSend').keyup(function () {
   $('#PMtoUser').val($(this).val())

});
$('#tSend').keyup(function () {
   $('#pmSubject').val($(this).val())
});
$('.dbM').click(function () {
   $('.spanload').html('<img src="/ls/upload.gif">');
   var setCap = setInterval(function () {
    if ($('.successText').text().indexOf('успешно') != -1) {
     $('.spanload').html('');
     $('#snewmes').hide();
     $('.d12').click();
     $('#valError').hide();
     $('#valSuccess').fadeIn().html('Сообщение успешно отправлено');
     $('#message2,#capval').val('');
     clearInterval(setCap);
    }
    else if ($('.errorText').text().indexOf('безопасности') != -1) {
     $('.spanload').html('');
     $('.d12').click();
     $('#valSuccess').hide();
     $('#valError').fadeIn().html('Неверно введён код безопасности');
     clearInterval(setCap);
    }
    else if ($('.errorText').text().indexOf('запретил') != -1) {
     $('.spanload').html('');
     $('#valError').fadeIn().html($('.errorText').text());
     clearInterval(setCap);
    }
    else if ($('.errorText').text().indexOf('самому') != -1) {
     $('.spanload').html('');
     $('#valError').fadeIn().html($('.errorText').text());
     clearInterval(setCap);
    }
    else if ($('.errorText').text().indexOf('текст сообщения') != -1) {
     $('.spanload').html('');
     $('#valError').fadeIn().html('Не указан текст сообщения');
     clearInterval(setCap);
    }
   },
   500)
});

$('.Mbd').click(function () {
   $('.spanload').html('<img src="/img/upload.gif">');
   var ssetCap = setInterval(function () {
    if ($('.successText').text().indexOf('успешно') != -1) {
     $('.spanload').html('');
     $('.d12').click();
     $('#valError2').hide();
     $('#valSuccess2').fadeIn().html('Сообщение успешно отправлено');
     $('#message2,#capval,#nameSend').val('');
                          $('#tSend').val('Без темы...');
     clearInterval(ssetCap);
    }
    else if ($('.errorText').text().indexOf('в базе') != -1) {
     $('.spanload').html('');
     $('#valSuccess2').hide();
     $('#valError2').fadeIn().html($('.errorText').text());
     clearInterval(ssetCap);
    }
    else if ($('.errorText').text().indexOf('Тема сообщения') != -1) {
     $('.spanload').html('');
     $('#valSuccess2').hide();
     $('#valError2').fadeIn().html($('.errorText').text());
     clearInterval(ssetCap);
    }
    else if ($('.errorText').text().indexOf('запретил') != -1) {
     $('.spanload').html('');
     $('#valSuccess2').hide();
     $('#valError2').fadeIn().html($('.errorText').text());
     clearInterval(ssetCap);
    }
    else if ($('.errorText').text().indexOf('самому') != -1) {
     $('.spanload').html('');
     $('#valSuccess2').hide();
     $('#valError2').fadeIn().html($('.errorText').text());
     clearInterval(ssetCap);
    }
    else if ($('.errorText').text().indexOf('безопасности') != -1) {
     $('.spanload').html('');
     $('#valSuccess2').hide();
     $('.d12').click();
     $('#valError2').fadeIn().html($('.errorText').text());
     clearInterval(ssetCap);
    }
    else if ($('.errorText').text().indexOf('текст сообщения') != -1) {
     $('.spanload').html('');
     $('#valSuccess2').hide();
     $('#valError2').fadeIn().html($('.errorText').text());
     clearInterval(ssetCap);
    }
   },
   500)
});
$('#abbbb').html('<img src="' + $('#secuImg').attr('src') + '" style="cursor:pointer;" class="d12">');
dd = $('#secuImg').attr('onclick');
if (dd) {
   $('#idCap').show()
}
else {
   $('#idCap').hide()
}
$('.d12').click(dd);
if ($('#PMtoUser').val()) {
   $('#nameSend').val($('#PMtoUser').val());
}
else {}
$.get('/index/8-0-' + $('#nameSend').val(), function (data) {
   $('.avaogets').html($('#avaget', data).html().replace(/212legion.clan.su/, '212legion.clan.su'))
});
$('#nameSend').change(function () {
   $.get('/index/8-0-' + $('#nameSend').val().replace(/-/g, '~'), function (data) {
    $('.avaogets').html($('#avaget', data).html().replace(/212legion.clan.su/, '212legion.clan.su'))
   });
});
$.get('/index/8-0-' + $('.tdA').text(), function (data) {
   $('.avaoget').html($('#avaget', data).html().replace(/212legion.clan.su/, '212legion.clan.su'))
});
$('#tmessA').find('hr:first').hide();
function udel_item(id) {
   _uPostForm('', {
    url: '/index/16-' + id
   });
}
function delAll(f) {
$('.spanload2').html('<img src="/ls/upload.gif">')
var frm=eval('document.'+f);_uPostForm(f,{type:'POST',url:frm.action});
setTimeout(function() {$('.spanload2,#bar').hide();$('#mess').replaceWith('<div style="padding-top:15px;padding-bottom:15px;text-align:center;color:grey;font-size:12px;">'+messageOpt[0]+'</div>')},2500)
}
     
$('.final_message hr:first').prevAll().css('display', 'none');
function hideContent() {
   var $hr = $('#tmessA hr:first'),
   hr = $hr[0];

   var $div = $('<div/>').css({
    display: 'none'
   });
   var next;
   for (var obj = hr.parentNode.firstChild; obj && obj != hr; obj = next) {
    next = obj.nextSibling;
    $div.append(obj);
   }
   $div.prependTo($hr.parent());
}
hideContent();


Сообщение отредактировал robertbat123 - Понедельник, 2014-11-17, 08:49
Профиль
Форум » uCoz » Помощь по uCoz » помогите найти косяк в коде
  • Страница 1 из 1
  • 1
Поиск: