Guest User

Untitled

a guest
Dec 9th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* быдлокод начало */
  2.  
  3. function update_a_info(url) {
  4.     $.ajax({
  5.     url: url,
  6.     dataType: 'json',
  7.     success: function(data) { $("#a_urls").text('ссылок у нас: '+data.urls); $("#a_unic").text('уникальное кл.просмотров: '+data.unic); },
  8.     error: function() { $("#a_urls").text('ссылок у нас: ERROR'); $("#a_unic").text('уникальное кл.просмотров: ERROR'); }
  9.     });
  10.     return true;
  11. }
  12.  
  13. function dlg_bad_post() {
  14.     var check = ($('#god_this_not_love_dlg .check').hasClass('ok')) ? true : false;
  15.     var elems = {label: Array(), obj: Array()}
  16.     $('#god_this_not_love_dlg input').each(function(index, elem){elems.obj.push(elem)});
  17.     elems.obj.push($('#god_this_not_love_dlg textarea'));
  18.     $('#god_this_not_love_dlg label').each(function(index, elem){elems.label.push(elem)});
  19.     if (check) {
  20.         if($.trim($(elems.obj[0]).text()) == '') { alert('ПУСТОТА'); }
  21.     } else {
  22.        
  23.     }
  24.     return false;
  25. }
  26.  
  27.  
  28. function show_bad() {($('#god_this_not_love_dlg').css('display') != 'block') ? $('#god_this_not_love_dlg').show(200) :  $('#god_this_not_love_dlg').hide(200);return false;}
  29. function dlg_bad_check() {
  30.     var elem=$('#god_this_not_love_dlg .check');
  31.     if (elem.hasClass('ok')){elem.removeClass('ok');$('#god_this_not_love_dlg .inothere').each(function(index, element){$(element).hide();});}
  32.     else {elem.addClass('ok');$('#god_this_not_love_dlg .inothere').each(function(index, element){$(element).show();});}
  33.     return false;
  34. }
  35.  
  36. function loadin_page(url,gogo) {
  37.     if (location.href == url && !gogo) {return false;}
  38.     if (!window.history) {return true;}
  39.     $('#page .line').html('<div id="ajax-load"><div class="load">загружаем</div></div>');
  40.     $.ajax({type:'GET','url':url,cache:false,timeout:15000,
  41.         error: function() {$('#page .line').html('<div style="margin-top: 35px; margin-bottom: -65px;" id="ajax-load">упс, произошла ошибка во время загрузки</div>')},
  42.         success: function(data, status) {$('#page').hide(200).show(200);$('#page .line').html(data).attr('style',((/\.[a-z]{2,3}\/$/).test(url))?'padding: 8px':'');window.history.pushState( {html:data} , null, url);}
  43.     });
  44.     return false;
  45. }
  46.  
  47. $(document).ready(function(){
  48.     setTimeout(function() {$(window).bind('popstate', function (e) {
  49.         e = e.originalEvent;
  50.         if( e.state ) {$('#page .line').html(e.state.html);$('#page .line').attr('style',((/\.[a-z]{2,3}\/$/).test(location.href))?'padding: 8px':'');}
  51.         else {if ( $('#echo-qr') ) return; else loadin_page(location.href);}
  52.     })},10);
  53. });
  54.  
  55. /* быдлокод конец */
Add Comment
Please, Sign In to add comment