- Я автор
- /
- Михаил Цикалов
Михаил Цикалов
Афоризмы
- Металлолом в Москве
- 22 июля 2019
- •
- Афоризм, Психологический роман
- •
- Комментарии 2
',{'id':'bodyOverlay'}).appendTo('body').css({'display':'block'});$('
',{'id':'popupSimple','class':c}).appendTo('body').css({'display':'block'});$('#popupSimple').html(h);};$( function () {var nvActive=$('#toolbarMenu li.active');$(document).on('mouseenter', '#toolbarMenu li', function(){var $this=$(this),id=$this.attr('id'),c=$this.attr('class');if(c!='active'){nvActive.removeClass('active');$this.addClass('hover');}}).on('mouseleave', '#toolbarMenu li', function(){$(this).removeClass('hover');if(!$('#toolbarMenu .submn').is(':visible')){nvActive.addClass('active');}});$(document).on('click', '#toolbarMenu li a, #toolbarMenu li span', function(e){if(e.target.tagName.toLowerCase()=='a'){return true;}else {var $this=$(this),li=$this.parent(),id=li.attr('id'),a=id.split('-')[1];if($('#toolbarMenu .submn').is(':visible')){var submn = $('#toolbarMenu .submn:visible');submn.fadeOut(200).parent().removeClass('subactive');if(submn.hasClass('sub-'+a)) {return false;}}if(id=='nvm-forms'||id=='nvm-genres'){$('.sub-'+a).fadeIn(200);li.attr('class','subactive');}else {li.attr('class','active');}}return false;});$(document).on('click', '.nvPeriod li', function(){var $this=$(this),id=$this.attr('id'),c=$this.attr('class'),a=id.split('-')[2],params={'period':a},request=false;if(!request && c!='active') {request=true;$.get('/ajax/get/',{'a':'getProductsItemsList','t':'top','p':params},function(data){if(data.response && data.response.status==1){document.title = "Я автор. "+data.response.title;if($('.nvPeriod li.active').length){$('.nvPeriod li.active').removeClass('active');}$this.addClass('active');var html=$(data.response.html);$('.contList .itemList').html(html);html.css('display','none').fadeIn(200);$('h1.hc').html(data.response.title);$('h1.hc').css('display','none').fadeIn(200);if (isHhistoryApiAvailable()) {history.pushState(null,null,'http://'+Main.url.host+'/top/'+a+'/');}}request=false;}, 'json');}return false;});$(document).on('click', function(){var $this=$(this),id=$this.attr('id'),p=$this.parent();$('.sub-forms,.sub-genres').fadeOut(200).parent().removeClass('subactive');});var s_inp=$('#search'),s_val=s_inp.attr('data-value');s_inp.val(s_val);$('.search .submit').click(function(){var v=$('#search').val();if(v==s_val||v==''){$('#search').val('').focus();return false;}});$(document).on('focus','#search:not(.active)',function(){var t=$(this),v=t.val();if(v==s_val){t.addClass('active').val('');}});$('#search').blur(function(e){var t=$(this),v=t.val(),cl_id;if(v==s_val||v==''){if(e.relatedTarget && e.relatedTarget.id=='toolbar_searchSubmit'){return false;}else{t.removeClass('active').val(s_val);}};return false;});$('.search_form .search_submit').click(function(){if($('.search_input').val()==''){$('.search_input').focus();return false;}});$('.search_form .search_input').focus(function(){$(this).css('color','#444');return false;});$('input.plaseholder').focus(function(){});$(document).on('click','#loginLink',function(){show_auth_form();return false;});$(document).on('click','.toolbar-add',function(){if(!Main.user.id){show_auth_form();return false;}});});function isHhistoryApiAvailable(){return !!(window.history && history.pushState);};function dump(obj){var out = "";if(obj && typeof(obj) == "object"){for (var i in obj) {out += i + ": " + obj[i] + "\n";}} else {out = obj;}alert(out);};$(function(){$(document).on('click',function(e){var $this=$(this);if(e.target.id=='bodyOverlay' || e.target.id=='crossPopup' || e.target.id=='cancelLink') {$('#bodyOverlay,#popupSimple').remove();return false;};});});function setEndOfContenteditable(contentEditableElement) {var range,selection;if(document.createRange) {range = document.createRange();range.selectNodeContents(contentEditableElement);range.collapse(false);selection = window.getSelection();selection.removeAllRanges();selection.addRange(range);}else if(document.selection) {range = document.body.createTextRange();range.moveToElementText(contentEditableElement);range.collapse(false);range.select();}};