var HOST_CORE = 'https://cc.v-dome-deti.ru'; /* jQuery Masked Input Plugin Copyright (c) 2007 - 2015 Josh Bush (digitalbush.com) Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) Version: 1.4.1 */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b,c=navigator.userAgent,d=/iphone/i.test(c),e=/chrome/i.test(c),f=/android/i.test(c);a.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"},a.fn.extend({caret:function(a,b){var c;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof a?(b="number"==typeof b?b:a,this.each(function(){this.setSelectionRange?this.setSelectionRange(a,b):this.createTextRange&&(c=this.createTextRange(),c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select())})):(this[0].setSelectionRange?(a=this[0].selectionStart,b=this[0].selectionEnd):document.selection&&document.selection.createRange&&(c=document.selection.createRange(),a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length),{begin:a,end:b})},unmask:function(){return this.trigger("unmask")},mask:function(c,g){var h,i,j,k,l,m,n,o;if(!c&&this.length>0){h=a(this[0]);var p=h.data(a.mask.dataName);return p?p():void 0}return g=a.extend({autoclear:a.mask.autoclear,placeholder:a.mask.placeholder,completed:null},g),i=a.mask.definitions,j=[],k=n=c.length,l=null,a.each(c.split(""),function(a,b){"?"==b?(n--,k=a):i[b]?(j.push(new RegExp(i[b])),null===l&&(l=j.length-1),k>a&&(m=j.length-1)):j.push(null)}),this.trigger("unmask").each(function(){function h(){if(g.completed){for(var a=l;m>=a;a++)if(j[a]&&C[a]===p(a))return;g.completed.call(B)}}function p(a){return g.placeholder.charAt(a=0&&!j[a];);return a}function s(a,b){var c,d;if(!(0>a)){for(c=a,d=q(b);n>c;c++)if(j[c]){if(!(n>d&&j[c].test(C[d])))break;C[c]=C[d],C[d]=p(d),d=q(d)}z(),B.caret(Math.max(l,a))}}function t(a){var b,c,d,e;for(b=a,c=p(a);n>b;b++)if(j[b]){if(d=q(b),e=C[b],C[b]=c,!(n>d&&j[d].test(e)))break;c=e}}function u(){var a=B.val(),b=B.caret();if(o&&o.length&&o.length>a.length){for(A(!0);b.begin>0&&!j[b.begin-1];)b.begin--;if(0===b.begin)for(;b.beging)&&g&&13!==g){if(i.end-i.begin!==0&&(y(i.begin,i.end),s(i.begin,i.end-1)),c=q(i.begin-1),n>c&&(d=String.fromCharCode(g),j[c].test(d))){if(t(c),C[c]=d,z(),e=q(c),f){var k=function(){a.proxy(a.fn.caret,B,e)()};setTimeout(k,0)}else B.caret(e);i.begin<=m&&h()}b.preventDefault()}}}function y(a,b){var c;for(c=a;b>c&&n>c;c++)j[c]&&(C[c]=p(c))}function z(){B.val(C.join(""))}function A(a){var b,c,d,e=B.val(),f=-1;for(b=0,d=0;n>b;b++)if(j[b]){for(C[b]=p(b);d++e.length){y(b+1,n);break}}else C[b]===e.charAt(d)&&d++,k>b&&(f=b);return a?z():k>f+1?g.autoclear||C.join("")===D?(B.val()&&B.val(""),y(0,n)):z():(z(),B.val(B.val().substring(0,f+1))),k?b:l}var B=a(this),C=a.map(c.split(""),function(a,b){return"?"!=a?i[a]?p(b):a:void 0}),D=C.join(""),E=B.val();B.data(a.mask.dataName,function(){return a.map(C,function(a,b){return j[b]&&a!=p(b)?a:null}).join("")}),B.one("unmask",function(){B.off(".mask").removeData(a.mask.dataName)}).on("focus.mask",function(){if(!B.prop("readonly")){clearTimeout(b);var a;E=B.val(),a=A(),b=setTimeout(function(){B.get(0)===document.activeElement&&(z(),a==c.replace("?","").length?B.caret(0,a):B.caret(a))},10)}}).on("blur.mask",v).on("keydown.mask",w).on("keypress.mask",x).on("input.mask paste.mask",function(){B.prop("readonly")||setTimeout(function(){var a=A(!0);B.caret(a),h()},0)}),e&&f&&B.off("input.mask").on("input.mask",u),A()})}})}); jQuery.fn.extend({ insertAtCaret: function(myValue){ return this.each(function(i) { if (document.selection) { //For browsers like Internet Explorer this.focus(); var sel = document.selection.createRange(); sel.text = myValue; this.focus(); } else if (this.selectionStart || this.selectionStart == '0') { //For browsers like Firefox and Webkit based var startPos = this.selectionStart; var endPos = this.selectionEnd; var scrollTop = this.scrollTop; this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length); this.focus(); this.selectionStart = startPos + myValue.length; this.selectionEnd = startPos + myValue.length; this.scrollTop = scrollTop; } else { this.value += myValue; this.focus(); } }); } }); var searchStr = "Поиск по сайту..."; var ZERO_PID = 'qrzbrm'; var bPop = {opacity: 0.45, speed: 0}; var bPopModal = {opacity: 0.45, speed: 0, modalClose: false, escClose: false}; if (typeof String.prototype.startsWith != 'function') { String.prototype.startsWith = function (str){ return this.slice(0, str.length) == str; }; } if (typeof String.prototype.endsWith != 'function') { String.prototype.endsWith = function (str){ return this.slice(-str.length) == str; }; } function isValidUrl(url){ return url.match(/^https?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/); } function isValidEmail(email) { if (email==undefined) return false; return email.match(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,5}/)!=null; }; var ajx = { requestA: function(params) { jQuery.ajax({ data: params.data, success: function(data) { if (params.skipProcess) { if (params.success!=undefined) { params.success(data); } } else { ajx.processResult(data, params.success); } }, error: function() { if (params.error!=undefined) { params.error(); } else { msg.showDefaultError(); } }, type: 'POST', url: params.url }); }, requestS: function(params) { var data = $.ajax({ data: params.data, type: "POST", async: false, url: params.url }).responseText; if (params.skipProcess) { if (params.success!=undefined) { params.success(data); } else { return data; } } else { if (!ajx.processResult(data, params.success)) { return data; } } }, processResult: function(data, successFn) { if (data.length==12 && data=='COMMON_ERROR') { msg.showDefaultError(); } else if (data.length>=6 && data.substring(0,6)=='ERROR:') { var err = data.substring(6); if (err=='ROBOT_CHECK') { if (captcha.captcha==undefined) { captcha.captcha = grecaptcha.render('g-recaptcha', {'sitekey' : '6LdXaRITAAAAADi2OKXaSkkROS9Su--VeMaH9zxj', 'callback' : captcha.validate, 'expired-callback' : captcha.close}); } else { grecaptcha.reset(captcha.captcha); } captcha.pop = $('#robotCheck').bPopup(bPop); } else if (err=='LOGIN_REQUIRED') { dt.loginOpen(); } else if (err=='NOT_AUTHORIZED') { dt.loginOpen(); } else if (err=='VALIDATION') { msg.showDefaultError(); } else if (err.startsWith('USER_BANNED')) { date = err.substring(11); msg.showErr('Доступ ограничен','За систематические нарушения правил нашего сайта вы были заблокированы до '+date); } else if (err=='USER_BLOCKED') { msg.showErr('Доступ ограничен','

На ваши сообщения поступило слишком много жалоб.

Ваша учетная запись была заблокирована до выяснения обстоятельств.

'); } else if (err=='NOT_ALLOWED') { msg.showErr('Доступ ограничен','Сообщение подтверждено модератором и уже не может быть изменено.'); } else if (err=='STOP_WORD_DETECTED') { msg.showErr('Доступ ограничен','Сообщение содержит запрещенные слова. Это может быть реклама или оскорбления.'); } else if (err=='COMMENTS_ADDED') { msg.showErr('Доступ ограничен','В данной теме уже начато обсуждение. Вы больше не можете менять это сообщение.'); } else if (err=='PARENT_DELETED') { msg.showErr('Доступ ограничен','Сообщение на которое вы хотите ответить было удалено.'); } else if (err=='COMMENT_DELETED' || err=='POST_DELETED') { msg.showErr('Доступ ограничен','Сообщение было удалено. Вы больше не можете его редактировать.'); } else if (err=='NEW_USER_EMAIL_EXISTS') { msg.showDefaultError(); } else if (err=='NEW_USER_NAME_EXISTS') { msg.showDefaultError(); } else { if (successFn!=undefined) { successFn(data); } else { return false; } } } else { if (successFn!=undefined) { successFn(data); } else { return false; } } return true; } }; var divClick = function(e) { var a = $(this).find('a'); if (a.length>0) { if (e.ctrlKey) { window.open(a.attr('href'), a.attr('href')+Math.random()); } else { if (a.attr('target')!=undefined) { window.open(a.attr('href'), a.attr('href')+Math.random()); } else { window.location=a.attr('href'); } } } e.preventDefault(); }; function preload(arrayOfImages) { $(arrayOfImages).each(function(){ $('')[0].src = this; }); } function openWindow(url, target) { if (target=='' || target==undefined) { window.location=url; } else { window.open(url, target); } } $(document).ready(function() { var exdate=new Date(); exdate.setDate(exdate.getDate() + 365); // document.cookie="_w=" + $('body').width()+'; expires='+exdate.toUTCString()+'; path=/'; document.cookie="_w=" + screen.width+'; expires='+exdate.toUTCString()+'; path=/'; if (typeof init !='undefined') {init();}; $('#header') .on('submit', '#searchForm', function(evt) { var val = $(searchControl).val(); if (val=='' || val==searchStr) { evt.preventDefault(); } }) .on('focus', '#searchControl', function() { var el = $(this); if (el.val()==searchStr) { el.val(''); }; }) .on('blur', '#searchControl', function() { var el = $(this); if (el.val()=='') { el.val(searchStr); }; }) .on('click', '#searchBtn', function() {$('#searchForm').submit();}) .on('mouseover', '#userMenu', function() {$('#userMenu .menuItems').show();}).on('mouseout', '#userMenu', function() {$('#userMenu .menuItems').hide();}) .on('click', '#userMenu #menuItem', divClick) .on('click', '#userMenu .main', divClick) .on('click', '#userEvents', divClick); $('#menu .item').hover(function(){$(this).addClass('over');},function(){$(this).removeClass('over');}); $('body') .on('click', '.imgPop', img.showImg) .on('click', '#imgPop', img.hideImg) .on('click', '#editor .header .photo', img.openLoadPanel) .on('click', '#editor .header .video', editor.openVideoPanel) .on('click', '#editor .header .smile, #editor .header .format', editor.showEditorTT) .on('mouseout', '#editor .header .smile, #editor .header .format', editor.hideEditorTTDelayed) .on('click', '.divClick', divClick) .on('focus', 'input[format=url]', function() { var el = $(this); if (el.val()=='http://') { el.val(''); }; }) .on('blur', 'input[format=url]', function() { var el = $(this); if (el.val()=='') { el.val('http://'); }; }) .on('click', '.imgPanel #imgD', img.download) .on('click', '.imgPanel #imgU', function() {$(this).closest('.imgPanel').find('#imgUFile').trigger('click');}) .on('change', '.imgPanel #imgUFile', img.upload) .on('click', '#imgCropDone', img.cropDone).on('click', '#imgCropCancel', img.cropCancel) .on('mouseover', '[id=chk]', function(){if ($(this).hasClass('selected')) {$(this).addClass('selected-over');} else {$(this).addClass('over');}}).on('mouseout', '[id=chk]', function(){$(this).removeClass('over').removeClass('selected-over');}) .on('mouseover', '#path .menu', function(){$(this).find('.path-menu-panel').show();}).on('mouseout', '#path .menu', function(){$(this).find('.path-menu-panel').hide();}) .on('mouseover', '#menu .item', function(){$(this).find('.top-menu-panel').show();}).on('mouseout', '#menu .item', function(){$(this).find('.top-menu-panel').hide();}) .on('mouseover', '.tt', tt.iconOver).on('mouseout', '.tt', tt.out).on('mouseover','#ttPanel', tt.ttOver).on('mouseout', '#ttPanel', tt.out) .on('mouseover', '.ttp', function() {$(this).parent().find('.tt').first().trigger('mouseover')}) .on('mouseout', '.ttp', function() {$(this).parent().find('.tt').first().trigger('mouseout')}) .on('click', '.ttp', function() {window.location=$(this).parent().find('.tt').first().find('a').attr('href')}) .on('click', '[id=chk]', dt.chkClick) .on('focus', '.fSelect select', function() { $(this).parent().addClass('fSelectFocus'); }) .on('blur', '.fText', function() { $(this).removeClass('fTextErr'); }) .on('blur', '.fSelect select', function() { $(this).parent().removeClass('fSelectFocus').removeClass('fSelectErr'); }) .on('click change keyup', '.fSelect select', function() { $(this).parent().find('span').html($(this).find("option[value='"+$(this).val()+"']").text()); }) .on('click', 'img[social=vk],img[social=ok],img[social=fb],img[social=mm]', dt.openSocialWindow) .on('click', '#regBtn' , reg.registration) .on('click', 'a[action=passwordRecovery]', dt.passwordRecoveryOpen) .on('click', 'a[action=openLoginPopup]', dt.loginOpen) .on('click', 'a[action=confirmEmail]', dt.sendActivationCode) .on('click', 'input[action=confirmEmail]', dt.sendActivationCode) .on('click', 'a[action=editChild]', children.open) .on('click', 'a[action=deleteChild]', children.deleteChild) .on('click', '#loginBtn', dt.login) .on('click', '#msgPopBtn', msg.hide) .on('click', '#recoveryBtn', dt.passwordRecoverySubmit) .on('click', 'input[action=regNextStep]', reg.nextStep) .on('click', '#avatars div.item', reg.standardAvatarSelected) .on('click', '#addChildren', children.open) .on('click', '#closeRegSteps', reg.closeRegSteps) .on('click', 'input[action=mailServer]', reg.openMailServer) .on('click', 'input[action=newTopic]', reg.openNewTopicPage) .on('click', 'input[action=popularTopics]', reg.openPopularTopics) .on('click', '#recBtn', reg.changePassword) .on('click', '#options #option', dt.optionSelected) .on('click', '[action=loadImg]', img.openLoadPanel) .on('click', 'input[action=profileAction]', profile.doAction) .on('click', '.cAction', dt.commonAction); $('a[action=registration], #join').click(reg.open); $('#prUserBD').mask('?99/99/9999'); preload([HOST_CORE+'/i/chk.png',HOST_CORE+'/i/chk-over.png',HOST_CORE+'/i/chk-selected.png',HOST_CORE+'/i/chk-selected-over.png']); if (typeof notifications !='undefined') {notifications();}; }); var profile = new Object(); profile.doAction = function() { var action = $(this).attr('actionType'); var userName = $('#prUserName').val(); if (action=='updateName') { profile.hideErrors(); var err = reg.validateUserNameSexEmailPassword(userName, undefined, undefined, undefined, undefined, false); if (err.userName==undefined) { var data = ajx.requestS({ data: {name: userName}, url: '/ajax/updateUserName/' }) if (data=='OK') { $('#header #userMenu .userName a').html(userName); msg.showInfo('Действие выполнено','Имя пользователя было успешно изменено.', 580); } } else { $('#prUserNameErr').show().html(err.userName); $('#prUserName').addClass('fTextErr'); } } else if (action=='updatePassword') { profile.hideErrors(); var p1 = $('#prPassword1').val(); var p2 = $('#prPassword2').val(); var err = reg.validateUserNameSexEmailPassword(undefined, undefined, undefined, p1, p2, false); if (err.password==undefined) { var data = ajx.requestS({ data: {password: p1}, url: '/ajax/updatePassword/' }); if (data=='OK') { msg.showInfo('Пароль изменен','Ваш пароль был успешно изменен. В дальнейшем для авторизации на сайте используйте ваш новый пароль.', 600); $('#prPassword1').val(''); $('#prPassword2').val(''); }; } else { $('#prPasswordErr').show().find('.formError').html(err.password); $('#prPassword1').addClass('fTextErr'); $('#prPassword2').addClass('fTextErr'); } } else if (action=='updatePersonal') { profile.hideErrors(); var sex = $('#prSex').val(); var location = $('#prLocation').val(); var bd = $('#prUserBD').val(); var bdValid = bd.length==0?true:dt.validateBD(bd); if (bdValid) { var data = ajx.requestS({ data: {sex: sex, location:location, bd: bd}, url: '/ajax/updateUserInfo/' }); if (data=='OK') { msg.showInfo('Действие выполнено','Ваши личные данные были успешно обновлены.', 580); }; } else { $('#prPersonalErr').show().find('.formError').html('Укажите дату в правильном формате'); $('#prUserBD').addClass('fTextErr'); } if (sex=='f') { $('#prFemaleOnly').show(); } else { $('#prFemaleOnly').hide(); } } else if (action=='updateFamilyInfo') { var panel=$('#prFamilyInfo'); reg.saveFamilyInfo(panel); msg.showInfo('Действие выполнено','Информация о вашей семье была успешно обновлена.', 580); } else if (action=='updateEmailSetup') { var emailEvents = $('#prEmailSetup #prEvents').val(); var emailNews = $('#prEmailSetup #prNews').val(); ajx.requestS({ skipProcess: true, data: {events: emailEvents, news: emailNews}, url: '/ajax/updateEmailSetup/' }); msg.showInfo('Действие выполнено','Настройки почтовых уведомлений были успешно обновлены.', 580); } else if (action=='openSubscriptions') { window.open('/subscriptions/', '/subscriptions/'); } }; profile.photoChanged = function(imgObj) { img.loadPop.close(); $('#profilePhoto').attr('src', imgObj.url); }; profile.avatarChanged = function(imgObj) { img.loadPop.close(); $('#header .avatar40').empty().append('
'); $('#profileMain .avatar65').empty().append('
'); }; profile.hideErrors = function() { $('#prUserNameErr').hide(); $('#prPersonalErr').hide(); $('#prPersonalErr').hide(); $('#optionTabs').find('input.fTextErr').removeClass('fTextErr'); }; var img = new Object(); img.crop = new Object(); img.openLoadPanel = function() { img.loadPanelParentEl = $(this); img.loadImgLoadPanelIfRequired(); var panel = $('#imgLoadPanel .imgPanel'); panel.attr('type', $(this).attr('imgType')); panel.attr('fn', $(this).attr('doneFn')); img.hideErrors(panel); panel.find('#imgDUrl').val('http://'); panel.find('#imgUFile').val(''); img.loadPop = $('#imgLoadPanel').bPopup(bPop); }; img.loadImgCropPanelIfRequired = function() { if (!$('#imgCropPanel').length) { var result = ajx.requestS({ url: '/ajax/loadImgCropPanel/' }); $('body').append(result); } }; img.loadImgLoadPanelIfRequired = function() { if (!$('#imgLoadPanel').length) { var result = ajx.requestS({ url: '/ajax/loadImgLoadPanel/' }); $('body').append(result); } }; img.upload = function() { var panel = $(this).closest('.imgPanel'); if(panel.find('#imgUFile').val()!='') { img.panel = panel; img.hideErrors(panel); panel.find('#uploadImgType').attr('value',panel.attr('type')); img.lock(); panel.find('#uploadImgForm').submit(); } }; img.uploadDone = function(data) { var panel = img.panel; var type = panel.attr('type'); var fn = panel.attr('fn'); img.unlock(); if (data.startsWith('OK:')) { var imgObj = jQuery.parseJSON(data.substring(3)); if (img.isValidSize(type, imgObj)) { if (img.isCropEnabled(type)) { img.openCropPanel(type, imgObj, fn); } else { if (fn!=undefined) { img.loadPop.close(); eval(fn)(imgObj); } } } else { img.showError(panel,'U','SMALL'); } } else { img.showError(panel,'U','COMMON'); } }; img.openCropPanel = function(type, imgObj, fn) { img.loadImgCropPanelIfRequired(); // calculate ratio var ratioX = 900 / imgObj.w; // max width var ratioY = 600 / imgObj.h; // max height var ratio = ratioX1) ratio=1; img.crop.ratio = ratio; img.crop.img = imgObj; img.crop.type = type; img.crop.fn = fn; var x = Math.round(imgObj.w*ratio); var y = Math.round(imgObj.h*ratio); var originalMinSizes = img.getMinSizes(type); var minSizes = {w: Math.ceil(originalMinSizes.w*ratio), h: Math.ceil(originalMinSizes.h*ratio)}; var dX = Math.round(x/20); var dY = Math.round(y/20); var params = {setSelect: [dX,dY,x-dX,y-dY]}; if (type=='avatar' || type=='avatar-child' || type=='admin-avatar') { var side = Math.round(0.9*(x>y?y:x)); var xStart = Math.round((x-side)/2); var yStart = Math.round((y-side)/2); params = {setSelect: [xStart,yStart,xStart+side,yStart+side], aspectRatio: 1}; } params.minSize=[minSizes.w, minSizes.h]; params.onSelect=function(sel){img.crop.selection=sel;}; params.onChange =function(sel){img.crop.selection=sel;}; $('#imgCropPanelBody').html(''); $('#cropImage').Jcrop(params); $('#imgCropErr').hide().find('td').html(''); img.crop.pop = $('#imgCropPanel').bPopup(bPopModal); }; img.cropDone = function() { var x = Math.round(img.crop.selection.x/img.crop.ratio); var y = Math.round(img.crop.selection.y/img.crop.ratio); var w = Math.round(img.crop.selection.w/img.crop.ratio); var h = Math.round(img.crop.selection.h/img.crop.ratio); $('#imgCropErr').hide(); var minSizes = img.getCropMinSizes(img.crop.type); if (w
Подождите, идет загрузка...
').bPopup(bPopModal); }; img.unlock = function() { img.lockPop.close(); }; img.showError = function(panel, type, errCode) { var err = ''; if (errCode=='COMMON') { err = 'Проблема загрузки изображения'; } else if (errCode=='SMALL') { err = 'Изображение слишком маленького размера'; } panel.find('#img'+type+'Err').html(err).show(); }; img.hideErrors = function(panel) { panel.find('.formError').hide(); }; img.getMinSizes = function(type) { var sizes = {w: 320, h: 200}; if ('avatar'==type || 'admin-avatar'==type) { sizes = {w: 80, h: 80}; } else if ('avatar-child'==type) { sizes = {w: 100, h: 100}; } else if ('profile'==type) { sizes = {w: 300, h: 300}; } else if ('motivator'==type) { sizes = {w: 480, h: 480}; } return sizes; }; img.getCropMinSizes = function(type) { var original = img.getMinSizes(type); return {w: Math.ceil(original.w*img.ratio), h: Math.ceil(original.h*img.ratio)}; }; img.isValidSize = function(type, image) { var sizes = img.getMinSizes(type); return !(image.w0) { $('#msgPopPanel').width(w); } $('#msgPopTitle').html(title); $('#msgPopTxt').html(txt); msg.pop=$('#msgPop').bPopup(bPop); $('#msgPopBtn').focus(); }; msg.confirm = function(title, txt, yesTxt, yesFn, noTxt, noFn, w) { msg.closeFn = undefined; if (w!=undefined && w>0) { $('#confirmPopPanel').width(w); } $('#confirmPopTitle').html(title); $('#confirmPopTxt').html(txt); $('#confirmYes').attr('value', yesTxt); $("#confirmYes").unbind("click"); $("#confirmYes").bind("click", yesFn); // NO $("#confirmNo").unbind("click"); if (noTxt==undefined) { $('#confirmNo').attr('value', 'Закрыть окно'); } else { $('#confirmNo').attr('value', noTxt); } if (noFn==undefined) { $("#confirmNo").bind("click", function() {msg.confirmPop.close();}); } else { $("#confirmNo").bind("click", noFn); } msg.confirmPop=$('#confirmPop').bPopup(bPop); }; msg.hide = function() { if (msg.pop!=undefined) msg.pop.close(); if (msg.closeFn!=undefined) msg.closeFn(); }; msg.showDefaultError = function() { msg.showErr('Системная ошибка', 'Запрашиваемая операция не может быть выполнена в данный момент.'); }; var dt = new Object(); dt.passwordRecoveryPopup = undefined; dt.regPopup = undefined; dt.loginPopup = undefined; dt.commonAction = function() { var el = $(this); var action = el.attr('action'); var pid = el.attr('pid'); if (pid==undefined) pid=el.closest('[pid]').attr('pid'); if (action=='like') { ajx.requestA({ //skipProcess: true, data: {pid: pid}, success: function(data, status, request) { if (data.startsWith('OK:')) { var result = data.substring(3); if (result!='') { var o = jQuery.parseJSON(result); if (o.result=='yes') { el.find('div').addClass('like24-selected'); } }; }; }, url: '/ajax/like/' }); } else if (action=='topicSubscribe') { ajx.requestA({ data: {pid: pid}, success: function(data, status, request) { if (data.startsWith('OK:')) { var result = data.substring(3); if (result!='') { var o = jQuery.parseJSON(result); if (o.result=='yes') { el.find('div').addClass('subscribe24-selected').next().html('Отписаться'); } else { el.find('div').removeClass('subscribe24-selected').next().html('Подписаться'); } }; }; }, url: '/ajax/subscribe/' }); } else if (action=='topicComplain') { dt.openComplain(pid, el); } else if (action=='topicDelete') { dt.deleteTopic(pid, el); } else if (action=='topicAdd') { dt.addTopic(); } else if (action=='topicUpdate') { dt.updateTopic(); } else if (action=='newTopic') { window.location='/topic/'; } else if (action=='saveUserGroups') { sb.saveGroups(); } else if (action=='subscription.unsubscribe') { var pid = el.closest('[pid]').attr('pid'); ajx.requestA({ data: {pid: pid}, success: function(data, status, request) { var panel = $('[pid="'+pid+'"'); if(panel.prev().attr('id')!='topicDiv' && panel.next().attr('id')=='topicDiv') { panel.next().remove(); } else { panel.prev().remove(); } panel.remove(); if($('#subscriptionPanel').find('[pid], .loadComments').length==0) { $('#errMsgBlock').show(); } }, url: '/ajax/unsubscribe/' }); } else if (action=='subscription.loadPosts') { var lastPid = el.attr('last'); el.html('Загрузка...'); ajx.requestS({ skipProcess: true, data: {lastPid: lastPid}, success: function(data, status, request) { var panel = el.closest('#subscriptionPanel'); panel.find('.loadComments').remove(); panel.append(data); var fst = panel.children().first(); if (fst.attr('id')=='topicDiv') fst.remove(); }, url: '/ajax/loadSubscriptionPosts/' }); } else if (action=='subscription.loadComments') { var lastPid = el.attr('last'); el.html('Загрузка...'); ajx.requestS({ skipProcess: true, data: {lastPid: lastPid}, success: function(data, status, request) { var panel = el.closest('#subscriptionPanel'); panel.find('.loadComments').remove(); panel.append(data); var fst = panel.children().first(); if (fst.attr('id')=='topicDiv') fst.remove(); }, url: '/ajax/loadSubscriptionComments/' }); } else if (action=='loadEvents') { var last = el.attr('last'); el.html('Загрузка...'); ajx.requestS({ skipProcess: true, data: {lastEventDate: last}, success: function(data, status, request) { var panel = el.closest('#events'); panel.find('tr').last().remove(); panel.append(data); }, url: '/ajax/loadEvents/' }); } else if (action=='getCommentRatio') { var editor = el.closest('#editor'); partner.getRatio(editor, 'topic_reply', $('[pid]').first().attr('pid')); } else if (action=='go') { window.location=el.attr('url'); } else if (action=='topicRequest') { partner.topicRequest(); } else if (action=='deleteTopicRequest') { partner.deleteTopicRequest(el); } else if (action=='partnerRequest') { partner.request(); } }; dt.addTopic = function() { dt.hideTopicErrors(); var topic = dt.getTopicObject(); if(dt.validateTopic(topic)) { if (!dt.isUserLoggedIn()) { var userName = $('#topicForm #newUserName').val(); var userEmail = $('#topicForm #newUserEmail').val(); if (userName==undefined) userName = ''; if (userEmail==undefined) userEmail = ''; var result = reg.quickRegistration(userName, userEmail, function(err) { if (err.userName!=undefined) { $('#topicForm #newUserName').addClass('fTextErr'); $('#topicForm #newUserErr').show().find('.formError').html(err.userName); } if (err.email!=undefined) { $('#topicForm #newUserEmail').addClass('fTextErr'); $('#topicForm #newEmailErr').show().find('.formError').html(err.email); } }); if (!result) return; }; ajx.requestS({ data: topic, success: function(data, status, request) { if (data.startsWith('OK:')) { window.location=data.substring(3); } }, url: '/ajax/addTopic/' }); }; }; dt.updateTopic = function() { dt.hideTopicErrors(); var topic = dt.getTopicObject(); if (dt.validateTopic(topic)) { ajx.requestS({ data: topic, success: function(data, status, request) { if (data.startsWith('OK:')) { window.location=data.substring(3); } }, url: '/ajax/updateTopic/' }); } }; dt.getTopicObject = function() { return {pid: $('#pid').val(), grp1: $('#group1').val(), grp2: $('#group2').val(), title: $('#topicTitle').val(), description: $('#topicTxt').val()}; }; dt.hideTopicErrors = function(t) { $('.fSelectErr').removeClass('fSelectErr'); $('.fTextErr').removeClass('fTextErr'); $('#titleErr').hide(); $('#groupErr').hide(); $('#topicForm #newUserErr').hide(); $('#topicForm #newEmailErr').hide(); $('#topicForm #descriptionErr').hide(); }; dt.validateTopic = function(t) { var valid = true; if (t.grp1==0 || t.grp2==0) { $('#groupErr').show(); if (t.grp1==0) { $('#group1').parent().addClass('fSelectErr'); } if (t.grp2==0) { $('#group2').parent().addClass('fSelectErr'); } valid = false; } if (t.title.length<20 || t.title.length>255) { var msg = ''; if (t.title.length==0) { msg = 'Пожалуйста, укажите заглавие вашей темы'; } else if (t.title.length<20) { msg = 'Заглавие темы для обсуждения слишком короткое'; } else if (t.title.length>255) { msg = 'Заглавие темы для обсуждения слишком длинное'; } $('#titleErr').html(msg).show(); $('#topicTitle').addClass('fTextErr'); valid = false; } if (t.description!=undefined && (t.description.length<50 || t.description.length>50000)) { var msg = ''; if (t.description.length==0) { msg = 'Напишите подробнее о том, что именно вы хотели бы обсудить'; } else if (t.description.length<50) { msg = 'Сообщение слишком короткое. Минимальная длина сообщения - 50 символов.'; } else if (t.description.length>50000) { msg = 'Сообщение слишком длинное'; } $('#descriptionErr').html(msg).show(); valid = false; } return valid; }; dt.deleteTopic = function(pid, actionEl) { msg.confirm('Удаление сообщения', 'Вы действительно хотите удалить свое сообщение? Удаленные сообщения востановлению не подлежат.', 'Удалить сообщение', function(){ ajx.requestA({ data: {pid: pid}, success: function(data, status, request) { if (data=='OK') { window.location=window.location; } }, url: '/ajax/deleteTopic/' }); msg.confirmPop.close(); }, undefined, undefined, 600); }; dt.openComplain = function(pid, actionEl) { dt.complainActionEl = actionEl; if (!$('#complainPanel').length) { var result = ajx.requestS({ url: '/ajax/loadComplainPanel/' }); $('body').append(result); var panel = $('#complainPanel'); panel.find('#sendComplain').click(dt.sendComplain); } var panel = $('#complainPanel').attr('pid', pid); panel.find('.formError').hide(); panel.find('[id=chk].selected').removeClass('selected'); dt.complainPop = panel.bPopup(bPop); }; dt.complainChanged = function(el) { var panel = el.closest('.cbPanel'); panel.find('[id=chk]').each(function() { if (!$(this).is(el)) { $(this).removeClass('selected'); } }); }; dt.sendComplain = function() { var pid = dt.complainPop.attr('pid'); var reason = dt.complainPop.find('[id=chk].selected').attr('val'); if (reason==undefined) { dt.complainPop.find('.formError').show(); } else { dt.complainActionEl.attr('class','complain-selected'); ajx.requestA({ skipProcess: true, data: {pid: pid, reason: reason}, url: '/ajax/complain/' }); dt.complainPop.close(); } }; dt.loginOpen = function() { $('#registration').remove(); $('#loginPop').remove(); var result = $.ajax({ type: "POST", async: false, url: '/ajax/loadLogin/' }).responseText; $('body').append(result); dt.loginPopup = $('#loginPop').bPopup(bPop); $('#loginEmail').focus(); }; dt.login = function() { $('#loginBtn').attr('value','Авторизация ...'); dt.loginHideErr(); var email = $('#loginEmail').val(); var pwd = $('#loginPassword').val(); if (email=='' || pwd=='') { dt.loginShowErr(); } else { var result = $.ajax({ type: "POST", data: {email: email, password: pwd}, async: false, url: '/ajax/login/' }).responseText; $('#loginBtn').attr('value','ВОЙТИ'); if (result.startsWith('OK:')) { var o = JSON.parse(result.substring(3)); if (o.result=='BAD_LOGIN') { dt.loginShowErr(); } else if (o.result=='OK') { if (dt.afterLoginURI!=undefined) { window.location=dt.afterLoginURI; } else { window.location=window.location; } } } } }; dt.loginShowErr = function() { $('#loginError').show(); $('#loginEmail').addClass('fTextErr'); $('#loginPassword').addClass('fTextErr'); }; dt.loginHideErr = function() { $('#loginError').hide(); $('#loginEmail').removeClass('fTextErr'); $('#loginPassword').removeClass('fTextErr'); }; dt.passwordRecoveryOpen = function() { if (dt.regPopup!=undefined) dt.regPopup.close(); if (dt.loginPopup!=undefined) dt.loginPopup.close(); $('#passwordRecovery').remove(); var result = $.ajax({ type: "POST", async: false, url: '/ajax/loadPasswordRecovery/' }).responseText; $('body').append(result); dt.passwordRecoveryPopup = $('#passwordRecovery').bPopup(bPop); $('#recoveryEmail').focus(); }; dt.passwordRecoverySubmit = function() { var email = $('#recoveryEmail').val(); if (email!='') { ajx.requestA({ data: {email: email}, url: '/ajax/recoverPassword/' }); dt.passwordRecoveryPopup.close(); $('#passwordRecovery').remove(); msg.showInfo('Действие выполнено','На вашу почту отправлено письмо с инструкциями по восстановлению пароля.', 600); } }; dt.chkClick=function() { var resultFn = $(this).attr('resultFn'); if (resultFn!=undefined) { eval(resultFn)($(this)); } else { var selected = false; if ($(this).hasClass('selected')) { $(this).removeClass('selected'); $(this).removeClass('selected-over'); $(this).addClass('over'); } else { $(this).addClass('selected'); $(this).addClass('selected-over'); selected = true; } var listener = $(this).attr('listener'); if (listener!=undefined) { eval(listener)($(this), selected); } } }; dt.isUserLoggedIn = function() { var el = $('#header #userLoggedIn'); return el.length==0?false:true; }; dt.isPartnerLoggedIn = function() { var el = $('#userMenu .partner'); return el.length==0?false:true; } dt.replySubscribeChanged = function(el, selected) { if (!dt.isUserLoggedIn()) { if (selected) { el.closest('#editor').find('#editorUserInfo').show(); el.closest('#editor').find('#newUserName').focus(); } else { el.closest('#editor').find('#editorUserInfo').hide(); } } }; dt.loginUser=function(headerHTML) { $('#header').html(headerHTML); $('#editor #editorUserInfo').hide(); $('#topicUserInfo').hide(); if (dt.loginPopup!=undefined) dt.loginPopup.close(); if (dt.regPopup!=undefined) dt.regPopup.close(); }; dt.openSocialWindow=function() { // save reg info first reg.userInfo = undefined; if ($('#registration').length) { var userInfo = {}; userInfo.userName = $('#regUserName').val(); userInfo.email = $('#regEmail').val(); userInfo.sex = $('#regSex').val(); reg.userInfo = userInfo; } // open window var type = $(this).attr('social'); dt.openSocialWindow0(type); }; dt.openSocialWindow0=function(type) { var h = 500; var w = 700; if (type=='fb') { w = 1000; h = 710; } window.open('/social/'+type+'/','social','height='+h+',width='+w+',location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0,top='+Math.round(($(window).height()-h)/2)+',left='+Math.round(($(window).width()-w)/2)); }; dt.socialActionDone = function(type, actionSuccess, userFound, linkAdded) { if (actionSuccess) { if (dt.regPopup!=undefined) dt.regPopup.close(); if (dt.loginPopup!=undefined) dt.loginPopup.close(); if (userFound) { if (!dt.isUserLoggedIn()) { var result = $.ajax({ type: "POST", async: false, url: '/ajax/loadHeader/' }).responseText; dt.loginUser(result); } } else { if (linkAdded) { social.changeChk(type, true); } else { if (!dt.isUserLoggedIn()) { reg.open(); } } } } }; dt.removeUserSocialLnk = function(network) { ajx.requestA({ data: {network: network}, success: function(data, status, request) { $('#socialLinks').html(data); }, url: '/ajax/removeUserSocialLink/' }); }; dt.sendActivationCode = function() { msg.hide(); ajx.requestA({ success: function(data, status, request) { if (data=='OK') { msg.showInfo('Действие выполнено','Код активации был повторно отправлен на ваш e-mail адрес.'); } }, url: '/ajax/sendActivationEmail/' }); }; dt.optionSelected = function() { var panel = $(this).closest('#options'); var fn = panel.attr('fn'); if (fn!=undefined) { panel.find('#option.selected').removeClass('selected'); $(this).addClass('selected'); var value = $(this).attr('val'); eval(fn)(value); } }; dt.validateBD = function(bd) { var bdValid = true; if (bd.length!=10) bdValid = false; if (bdValid) { var day = parseInt(bd.substr(0, 2), 10); var month = parseInt(bd.substr(3, 2), 10); var year = parseInt(bd.substr(6, 4), 10); var year = parseInt(bd.substr(6, 4), 10); var currentYear = new Date().getFullYear(); if (day<1 || day>31 || month<1 || month > 12 || year>currentYear || year<(currentYear-100)) { bdValid = false; } } return bdValid; }; var social = new Object(); social.linkChanged = function(el) { var link = el.attr('social'); result = ajx.requestS({ skipProcess: true, data: {link: link}, url: '/ajax/removeSocialLinkIfPresent/' }); if (result=='REMOVED') { social.changeChk(link, false); } else { dt.openSocialWindow0(link); } } social.changeChk = function(type, selected) { var el = $('#userSocialLinks').find('div[social='+type+']'); if (selected) { el.removeClass('over'); el.addClass('selected'); el.addClass('selected-over'); } else { el.removeClass('selected-over'); el.removeClass('selected'); el.addClass('over'); } } /* var settings = new Object(); settings.tabChanged = function(tab) { $('#optionTabs div.optionTab').hide(); $('#optionTabs [tab='+tab+']').show(); } */ var reg = new Object(); reg.open = function() { $('#registration').remove(); $('#loginPop').remove(); var result = ajx.requestS({ url: '/ajax/loadRegistration/' }) $('body').append(result); // populate form if (reg.userInfo!=undefined) { $('#regUserName').val(reg.userInfo.userName); $('#regEmail').val(reg.userInfo.email); $('#regSex').val(reg.userInfo.sex).trigger('change'); } if ($('#registration .socialData').length) { dt.regPopup = $('#registration').bPopup( $.extend({onClose: reg.clearRegData},bPop) ); } else { dt.regPopup = $('#registration').bPopup(bPop); } $('#regUserName').focus(); }; reg.hideErrors = function() { $('#registration tr.errTr').hide(); $('#registration .fTextErr').removeClass('fTextErr'); $('#registration .fSelectErr').removeClass('fSelectErr'); $('#regRestorePassword').hide(); }; reg.clearRegData = function() { reg.userInfo = undefined; ajx.requestA({ url: '/ajax/removeSocialUser/' }); }; reg.registration = function() { var userName = $('#regUserName').val(); var sex = $('#regSex').val(); var email = $('#regEmail').val(); var password1 = $('#regPassword1').val(); var password2 = $('#regPassword2').val(); var err = reg.validateUserNameSexEmailPassword(userName, sex, email, password1, password2, false); reg.hideErrors(); // submit request or display error message var password = password1==undefined?'':password1; if (jQuery.isEmptyObject(err)) { // register user $('#regBtn').attr('value','Подождите ...'); var result = $.ajax({ type: "POST", async: false, data: {userName: userName, email: email, password: password, sex: sex}, url: '/ajax/registration/' }).responseText; $('#regBtn').attr('value','Зарегистрироваться'); if (result.startsWith('OK:')) { dt.loginUser(result.substring(3)); // next step reg.registrationSteps(2); } else { msg.showDefaultError(); } } else { reg.showRegErrors(err); }; }; reg.validateUserNameSexEmailPassword=function(userName, sex, email, password1, password2, quickRegistration) { var err = {}; // validate email if (email!=undefined) { if (email=='') { err.email = quickRegistration?'Пожалуйста, укажите адрес своей электронной почты, на которую вы будете получать уведомления.':'Укажите свой электронный адрес'; } else if (email.length>64) { err.email = 'Слишком длинное значение'; } else if (!isValidEmail(email)) { err.email = quickRegistration?'Пожалуйста, проверьте правильность указанного вами электронного адреса.':'Неверный формат электронного адреса'; }; } // validate sex if (sex!=undefined) { if (sex!='f' && sex!='m') { err.sex = 'Укажите ваш пол'; }; } // validate user name if (userName!=undefined) { if (userName=='') { err.userName = quickRegistration?'Пожалуйста, укажите имя пользователя. Минимально допустимая длина имени - 3 символа.':'Укажите имя пользователя'; } else if (userName.length>30) { err.userName = 'Слишком длинное значение'; } else if (userName.length<3) { err.userName = quickRegistration?'Имя пользователья слишком короткое. Минимально допустимая длина имени - 3 символа.':'Слишком короткое значение'; }; } // validate password if (password1!=undefined && password2!=undefined) { if (password1.length==0 && password2.length==0) { err.password = 'Укажите пароль'; } else if ((password1.length>0 || password2.length>0) && password1!=password2 ) { err.password = 'Несоответствие паролей'; } else if (password1.length>0 && password1==password2 && password1.length<5 ) { err.password = 'Слишком короткий пароль'; } else if (password1.length>0 && password1==password2 && password1.length>32 ) { err.password = 'Слишком длинный пароль'; } } // is user name and email unique? if (userName!=undefined || email!=undefined) { var data = $.ajax({ type: "POST", async: false, data: {userName: userName, email: email}, url: '/ajax/checkUserNameAndEmail/' }).responseText; if (data.startsWith('OK:')) { var o = JSON.parse(data.substring(3)); if (err.userName==undefined) { if (o.userName=='busy') { err.userName = quickRegistration?'Данное имя пользователя уже используется на сайте. Попробуйте выбрать другое.':'Данное имя пользователя уже занято'; }; } if (err.email==undefined) { if (o.email=='busy') { err.email = quickRegistration?'Данный электронный адрес уже используется на сайте. Пожалуйста авторизуйтесь.':'busy'; validForm = false; }; } }; } return err; }; reg.showRegErrors = function(err) { if (err!=undefined) { if (err.userName!=undefined) { $('#regUserName').addClass('fTextErr'); $('#regUserNameErr').html(err.userName).closest('tr').show(); } if (err.sex!=undefined) { $('#regSex').parent().addClass('fSelectErr'); $('#regSexErr').html(err.sex).closest('tr').show(); } if (err.email!=undefined) { $('#regEmail').addClass('fTextErr'); if (err.email=='busy') { $('#regRestorePassword').show(); } else { $('#regEmailErr').html(err.email).closest('tr').show(); } } if (err.password!=undefined) { $('#regPassword1').addClass('fTextErr'); $('#regPassword2').addClass('fTextErr'); $('#regPasswordErr').html(err.password).closest('tr').show(); } } }; reg.quickRegistration=function(userName, email, showErrFn) { var err = reg.validateUserNameSexEmailPassword(userName, undefined, email, undefined, undefined, true); if (jQuery.isEmptyObject(err)) { // register user var result = $.ajax({ type: "POST", async: false, data: {newUserName: userName, newUserEmail: email}, url: '/ajax/quickRegistration/' }).responseText; if (result.startsWith('OK:')) { dt.loginUser(result.substring(3)); return true; } } else { if (showErrFn!=undefined) { showErrFn(err); } else { if (err.userName!=undefined) { msg.showErr('Ошибка', err.userName, 500); } else if (err.email!=undefined) { msg.showErr('Ошибка', err.email, 500); } } } return false; }; reg.registrationSteps = function(step) { var html = ajx.requestS({ url: '/ajax/loadRegistrationSteps/' }); $('body').append(html); reg.stepsPop = $('#regStep'+step).bPopup(bPopModal); } reg.nextStep = function() { var stepId = $(this).attr('step'); var saveFn = $(this).attr('saveFn'); if (saveFn!=undefined) eval(saveFn)(); reg.stepsPop.close(); reg.stepsPop = $('#regStep'+stepId).bPopup(bPopModal); ajx.requestA({ skipProcess: true, data: {stepId : stepId}, url: '/ajax/regStepChanged/' }); }; reg.saveFamilyInfo = function(panel) { if (panel==undefined) { panel = $('#regStep4'); } var maritalStatus = panel.find('#regMaritalStatus').val(); var status = 'none'; if (panel.find('#familyPlansPanel div[value=plans]').hasClass('selected')) { status = 'planning'; } else if (panel.find('#familyPlansPanel div[value=pregnant]').hasClass('selected')) { status = 'pregnant'; } var pWeeks = 0; var pDays = 0; var pInfo = 0; if (status=='pregnant') { pWeeks = panel.find('#regPregnancyWeeks').val(); pDays = panel.find('#regPregnancyDays').val(); pInfo = panel.find('#regPregnancyInfo').val(); } ajx.requestS({ skipProcess: true, data: {maritalStatus: maritalStatus, status: status, pWeeks: pWeeks, pDays: pDays, pInfo: pInfo}, url: '/ajax/updateFamilyInfo/' }) }; reg.regStepsProfile = function(imgObj) { $('#regStepsProfile').attr('src',imgObj.url); }; reg.regStepsAvatar = function(imgObj) { $('#regStep3 .avatar65').empty().append('
'); $('#header .avatar40').empty().append('
'); }; reg.standardAvatarSelected = function() { var el = $(this).find('img'); var src = el.attr('src'); $('#regStep3 .avatar65').empty().append('
'); $('#header .avatar40').empty().append('
'); ajx.requestA({ skipProcess: true, data: {pid : el.attr('pid')}, url: '/ajax/standardAvatarSelected/' }); }; reg.familyPlansChanged = function(el) { var panel = el.closest('#familyPlansPanel'); var chkType = el.attr('value'); var selected = el.hasClass('selected'); if (selected) { if (chkType=='plans') { panel.find('#chk[value=pregnant]').removeClass('selected'); panel.find('#pregnancyPanel').hide(); } else { panel.find('#chk[value=plans]').removeClass('selected'); panel.find('#pregnancyPanel').show(); } } else { if (chkType=='pregnant') { panel.find('#pregnancyPanel').hide(); } } }; reg.groupsChanged = function(el) { var selected = el.hasClass('selected'); var next = el.parent().next(); if (next.hasClass('step')) { next.find('div[id=chk]').each(function() { if (selected) { $(this).addClass('selected'); } else { $(this).removeClass('selected'); } }); } }; reg.saveGroups = function() { var data = new Object(); $('#userGroups').find('div[id=chk].selected').each(function() { var grp = $(this).attr('grp'); if (grp!=undefined) { data['grp'+grp]=1; } }); ajx.requestA({ skipProcess: true, data: data, url: '/ajax/updateGroupSubscription/' }); }; reg.closeRegSteps = function() { reg.stepsPop.close(); window.location=window.location; }; reg.openMailServer = function() { var url = $(this).attr('server'); window.open(url, url); }; reg.openPopularTopics = function() { window.location='/#popular'; }; reg.openNewTopicPage = function() { window.location='/topic/'; }; reg.changePassword = function() { $('#recovery .err').hide(); var p1=$('#recPassword1').val(); var p2=$('#recPassword2').val(); var err = ''; if (p1=='') { err='Введите новый пароль'; } else if (p1!=p2) { err='Несоответствие значений пароля'; } else if (p1.length<5) { err='Длинна пароля должна составлять от 5 до 32 символов'; } if (err=='') { var data = ajx.requestS({ data: {password: p1, security: $('#recovery').attr('security')}, url: '/ajax/changePassword/' }); if (data=='OK') { msg.showInfo('Пароль изменен','Ваш пароль был успешно изменен. Теперь вы можете авторизоваться на сайте используя новый пароль.', 600, function() {window.location='/';}); }; } else { $('#recPasswordErr').html(err); $('#recovery .err').show(); }; }; var children = new Object(); children.open = function() { var el = $(this); children.num = 1*el.attr('num'); children.list = el.closest('.childrenContainer').find('#childrenList'); children.loadChildrenPanelIfRequired(); var panel = $('#childrenPanel'); children.clearPanel(panel, children.num); if (children.num>0) { var data = ajx.requestS({ skipProcess: true, data: {num: children.num}, url: '/ajax/getChild/' }) if (data.startsWith('OK:')) { var child = jQuery.parseJSON(data.substring(3)); children.populatePanel(panel, child, children.num); } } children.pop = panel.bPopup(bPopModal); panel.find('#childName').focus(); } ; children.populatePanel = function(panel, child, num) { panel.attr('num', num); panel.find('#childName').val(child.name); panel.find('.cbPanel div[val='+child.sex+']').addClass('selected'); panel.find('input[mode=date]').val(child.bd); panel.find('#childAbout').val(child.about); if (child.photo!='') { panel.find('#childPhoto80').attr('pid', child.photo).html('
'); } children.refreshPhoto(); }; children.clearPanel = function(panel, num) { if (num==0) { panel.find('.childPanelTitle').html('Добавление информации о ребенке'); } else { panel.find('.childPanelTitle').html('Изменение информации о ребенке'); } panel.find('#childName').val(''); panel.find('div[id=chk]').removeClass('selected'); panel.find('input[mode=date]').val(''); panel.find('#childPhoto80').attr('pid','').html('
'); panel.find('#childAbout').val(''); panel.attr('num','0'); panel.find('#childSave').html('Готово'); children.hideErrors(); }; children.loadChildrenPanelIfRequired = function() { if (!$('#childrenPanel').length) { var result = ajx.requestS({ url: '/ajax/loadChildrenPanel/' }); $('body').append(result); var panel = $('#childrenPanel'); panel.find('input[mode=date]').mask('?99/99/9999').keyup(children.refreshPhoto); panel.find('#childSave').click(children.save); } }; children.sexChanged = function(el) { var val = el.attr('val'); if (el.hasClass('selected')) { if (val=='m') { el.closest('.cbPanel').find('div[val=f]').removeClass('selected'); } else { el.closest('.cbPanel').find('div[val=m]').removeClass('selected'); } } children.refreshPhoto(); }; children.refreshPhoto = function() { var panel = $('#childrenPanel'); if (panel.find('.childPhotoDefault').length) { var sex = panel.find('.cbPanel .selected').attr('val'); var baby = true; if (sex!=undefined) { var date = panel.find('#childBD').val(); if (date.length==10 && date.indexOf('_')==-1) { baby = children.isBaby(date); } } var style = ''; if (sex=='m') { if (baby) { style = 'boy1'; } else { style = 'boy2'; } } else if (sex=='f') { if (baby) { style = 'girl1'; } else { style = 'girl2'; } }; panel.find('.childPhotoDefault').removeClass('boy1 boy2 girl1 girl2').addClass(style); } }; children.isBaby = function(dateStr) { var year = parseInt(dateStr.substr(6, 4), 10); var curr = new Date(); var currYear = curr.getFullYear(); if ((currYear-year) > 3) { return false; } else if ((currYear-year) == 3) { var month = parseInt(dateStr.substr(3, 2), 10); var currMonth = curr.getMonth()+1; if (currMonth>month) { return false; } else if (currMonth==month) { var day = parseInt(dateStr.substr(0, 2), 10); var currDay = curr.getDate(); if (currDay>=day) { return false; } } } return true; } children.avatarChanged = function(imgObj) { $('#childrenPanel #childPhoto80').attr('pid',imgObj.pid).empty().append('
'); }; children.getChildObj = function() { var child = new Object(); var panel = $('#childrenPanel'); child.num = panel.attr('num'); child.name = panel.find('#childName').val(); child.sex = panel.find('.cbPanel .selected').attr('val'); child.bd = panel.find('#childBD').val(); child.photo = panel.find('#childPhoto80').attr('pid'); child.about = panel.find('#childAbout').val(); return child; }; children.validate = function(child) { children.hideErrors(); var panel = $('#childrenPanel'); var valid = true; if (child.name.length<3 || child.name.length>30) { valid = false; panel.find('#childNameErr').show(); panel.find('#childName').addClass('fTextErr'); }; if (child.sex!='m' && child.sex!='f') { valid = false; panel.find('#childSexErr').show(); } var bdValid = dt.validateBD(child.bd); if (!bdValid) { valid = false; panel.find('#childBDErr').show(); panel.find('#childBD').addClass('fTextErr'); } return valid; }; children.hideErrors = function() { var panel = $('#childNameErr').hide();; var panel = $('#childSexErr').hide();; var panel = $('#childBDErr').hide();; panel.find('input.fTextErr').removeClass('fTextErr'); }; children.save = function() { var child = children.getChildObj(); if (children.validate(child)) { var panel = $('#childrenPanel'); panel.find('#childSave').html('Сохранение ...'); ajx.requestS({ skipProcess: true, data: child, success: function(data) { if (data.startsWith('OK:')) { children.list.html(data.substring(3)); children.pop.close(); } else { panel.find('#childSave').html('Готово'); msg.showDefaultError(); } }, url: '/ajax/addOrUpdateChild' }); } }; children.deleteChild = function() { var num = $(this).attr('num'); var panel = $(this).closest('.childrenContainer').find('#childrenList'); msg.confirm('Подтверждение', 'Вы действительно хотите удалить информацию о ребенке?', 'Да, Удалить информацию', function(){ ajx.requestS({ data: {childNum: num}, success: function(data, status, request) { if (data.startsWith('OK:')) { panel.html(data.substring(3)); } }, url: '/ajax/deleteChild/' }); msg.confirmPop.close(); }, undefined, undefined, 500); } var captcha = new Object(); captcha.validate = function(response) { ajx.requestA({ data: {captchaResponse: response}, success: function(data, status, request) { captcha.close(); }, url: '/ajax/captchaResponse/' }); }; captcha.close = function() { captcha.pop.close(); }; var comments = new Object(); comments.toReplace = undefined; comments.op80add = function() {$(this).addClass('op80');}; comments.op80remove = function() {$(this).removeClass('op80');}; comments.op50add = function() {$(this).addClass('op50');}; comments.op50remove = function() {$(this).removeClass('op50');}; comments.op50addExt = function() {$(this).find('.replyIcon').addClass('op50');}; comments.op50removeExt = function() {$(this).find('.replyIcon').removeClass('op50');}; comments.op20add = function() {$(this).addClass('op20');}; comments.op20remove = function() {$(this).removeClass('op20');}; comments.bindEvents = function() { $('div[id=editor]') .on('click', 'input[action=replySave]', comments.replySave) .on('click', 'input[action=replyCancel]', comments.replyCancel); $('#comments') .on('click', '.cB .reply', comments.reply) .on('click', '.cB .subscribe', comments.subscribe) .on('mouseover', '.cB .complain', comments.op20remove).on('mouseout', '.cB .complain', comments.op20add) .on('click', '.cB .complain', function() { dt.openComplain($(this).closest('#comment').attr('pid'), $(this)); }) .on('click', '.cH .minimize', comments.minimize) .on('click', '.cH .vote .downVote', function(){comments.vote($(this),-1);}) .on('mouseover', '.cH .vote .downVote', function(){$(this).addClass('downVote-over');}).on('mouseout', '.cH .vote .downVote', function(){$(this).removeClass('downVote-over');}) .on('click', '.cH .vote .upVote', function(){comments.vote($(this),1);}) .on('mouseover', '.cH .vote .upVote', function(){$(this).addClass('upVote-over');}).on('mouseout', '.cH .vote .upVote', function(){$(this).removeClass('upVote-over');}) .on('click', '.loadComments', comments.load) .on('click', 'a[action=editReply]', comments.editReply) .on('click', 'a[action=deleteReply]', comments.deleteReply) .on('click', 'div[action=showReply]', comments.showReply) .on('click', '.actions .thread', comments.openThread) .on('click', '.actions .link', comments.getCommentLink) .on('click', '.actions .up', comments.goToParent); }; comments.goToComment = function(pid) { $('html, body').animate({ scrollTop: $('#comment[pid="'+pid+'"]').offset().top }, 20); }; comments.goToParent = function() { var parent = $(this).closest('#comment').parent().closest('#comment'); var pid = parent.attr('pid'); var el = parent; if (pid==ZERO_PID) { el = $('#postTitle'); } $('html, body').animate({ scrollTop: el.offset().top }, 500); }; comments.getCommentLink = function() { var el = $(this).closest('#comment'); var pid = el.attr('pid'); var step = el.find('.step').first(); if (step.find('.commentLink').length) { step.find('.commentLink').remove(); } else { step.append(''); } step.find('input').focus(); }; comments.openThread = function() { var pid = $(this).closest('#comment').attr('pid'); window.open('/out/thread/'+pid, pid); }; comments.showReply = function() { var comment = $(this).closest('#comment'); var cb = comment.find('.cB .step').first(); cb.find('.commentText').show(); cb.find('.actions').show(); cb.find('#commentInfoMsg').hide(); }; comments.deleteReply = function() { var comment = $(this).closest('#comment'); var pid = comment.attr('pid'); msg.confirm('Удаление сообщения', 'Вы действительно хотите удалить свой комментарий? Удаленные сообщения востановлению не подлежат.', 'Удалить сообщение', function(){ ajx.requestA({ data: {pid: pid}, success: function(data, status, request) { if (data=='DONE') { var cb = comment.find('.cB .step').first(); cb.find('.commentText').remove(); cb.find('.actions').remove(); cb.html('
!
Комментарий удален
'); } }, url: '/ajax/deleteComment/' }); msg.confirmPop.close(); }, undefined, undefined, 600); }; comments.editReply = function() { $(this).closest('#comment').find('.cB .step').first().find('#editor').remove(); // hide reply editor $(this).closest('#comment').find('.cB .step').first().find('.commentLink').remove(); // hide comment link var comment = $(this).closest('#comment'); var pid = comment.attr('pid'); ajx.requestA({ data: {pid: pid}, success: function(data, status, request) { if (data.startsWith('OK:')) { var message = data.substring(3); var editor = $('#clones #editor').clone(true).insertAfter(comment.find('.cB .actions').first()); editor.find('input[action=replySave]').attr('value','Сохранить'); editor.find('textarea').val(message).focus(); editor.attr('pid',pid); editor.find('.subscribeChk').hide(); comment.find('.cB .commentText').first().hide(); comment.find('.cB .actions').first().hide(); comments.goToComment(pid); } }, url: '/ajax/getComment/' }); }; comments.validateComment = function(editor, message) { var err = editor.find('.editorError').hide(); var result = true; if (message.length<5) { result = false; err.show().find('.formError').html('Сообщение слишком короткое'); } else if (message.length>10000) { result = false; err.show().find('.formError').html('Сообщение слишком длинное'); } return result; }; comments.replySave = function() { var editor = $(this).closest('#editor'); var message = editor.find('textarea').val(); var comment = $(this).closest('#comment'); var subscribe = editor.find('[id=chk]').first().hasClass('selected'); var valid = comments.validateComment(editor, message); if (valid) { if (subscribe && !dt.isUserLoggedIn()) { var userName = editor.find('#newUserName').val(); var userEmail = editor.find('#newUserEmail').val(); if (userName==undefined) userName = ''; if (userEmail==undefined) userEmail = ''; var result = reg.quickRegistration(userName, userEmail); if (!result) return; }; if (comment.length==0) comment = $('#comment'); // top level reply if (editor.attr('pid')==undefined) { // add new var parentId = comment.attr('pid'); var recId = $('#comments').attr('recId'); ajx.requestS({ data: {recId: recId, parentId: parentId, message: message, subscribe: subscribe}, success: function(data, status, request) { if (data.startsWith('OK:')) { o = jQuery.parseJSON(data.substring(3)); comment.find('.next-level').first().show(); var level = 1*o.level; if (level<=5) { comment.find('.cB .step').first().removeClass('break').addClass('no-break'); } comment.find('.innerComments').first().prepend(o.html); if (editor.attr('type')=='commentReply') { editor.remove(); } else { editor.find('textarea').val(''); } comments.addIgnorePidToElement(comment, o.pid); // ok, guest, hidden if (o.result=='guest') { msg.showInfo('Комментарий добавлен', '

Ваш комментарий будет доступен другим пользователям только после проверки модератором.

Комментарии зарегестрированных пользователей отображаются без проверки.

'); } else if (o.result=='hidden') { msg.showInfo('Комментарий добавлен', '

Ваш комментарий будет доступен другим пользователям только после проверки модератором.

Для того, чтобы снять это ограничение, вам необходимо подтвердить свой e-mail адрес.

На вашу почту было отправлено письмо с инструкциями о том, как это можно сделать.

Если вы не получили данное письмо, то мы можем отправить его еще раз.

'); } $('#no-comments').hide(); comments.increaseCommentsCount(); } }, url: '/ajax/addComment/' }); } else { // edit var pid = editor.attr('pid'); ajx.requestA({ data: {pid: pid, message: message}, success: function(data, status, request) { if (data.startsWith('OK:')) { var message = data.substring(3); comment.find('.commentText').first().html(message); comment.find('.cB .commentText').first().show(); comment.find('.cB .actions').first().show(); comment.find('#editor').first().remove(); } }, url: '/ajax/updateComment/' }); } } }; comments.increaseCommentsCount = function() { var total = 1*$('#comments-total span').html(); total++; $('#comments-total span').html(total); }; comments.addIgnorePidToElement = function(element, pid) { var ignorePids = element.attr('ignore'); if (ignorePids==undefined) ignorePids = ''; if (ignorePids.length>0) ignorePids += ','; ignorePids+=pid; element.attr('ignore', ignorePids); }; comments.replyCancel = function() { $(this).closest('#comment').find('.cB .commentText').first().show(); $(this).closest('#comment').find('.cB .actions').first().show(); $(this).closest('#editor').remove(); }; comments.reply = function() { var editor = $(this).closest('#comment').find('.cB .step').first().find('#editor'); if (!editor.length) { var el = $(this).closest('.actions'); var editor = $('#clones #editor').clone(true).insertAfter(el); partner.getRatio(editor, 'topic_reply', $('[pid]').first().attr('pid')); } else { editor.remove(); } }; comments.load = function() { var recId = $('#comments').attr('recId'); var cSort = $('#comments').attr('cSort'); var parent = $(this).attr('parent'); var last = $(this).attr('last'); var ignore = $(this).closest('#comment').attr('ignore'); if (ignore==undefined) ignore=''; $(this).html('Загрузка...'); comments.toReplace = $(this); ajx.requestA({ data: {sort: cSort, recId: recId, parentId: parent, lastLoadedId: last, ignore: ignore}, success: function(data, status, request) { comments.toReplace.replaceWith(data); }, url: '/ajax/loadComments/' }); }; comments.vote = function(el, vote) { var cPid = el.closest('#comment').attr('pid'); var pPid = el.closest('#comments').attr('pPid'); ajx.requestA({ data: {pPid: pPid, cPid: cPid, vote: vote}, success: function(data, status, request) { if (data.startsWith('OK:')) { var result = data.substring(3); if (result!='') { var o = jQuery.parseJSON(result); var total = 1*o.total; var vote = 1*o.vote; if (total>0) total = '+'+total; var c = $('#comment[pid="'+o.pid+'"]'); c.find('.points').first().text(total); var d = c.find('.downVote').first(); var u = c.find('.upVote').first(); if (d.hasClass('downVote-selected')) d.removeClass('downVote-selected'); if (u.hasClass('upVote-selected')) u.removeClass('upVote-selected'); if (vote>0) { u.addClass('upVote-selected'); } else if (vote<0) { d.addClass('downVote-selected'); } } }; }, url: '/ajax/vote/' }); }; comments.minimize = function(el) { if ($(this).hasClass('minimized')) { $(this).html('Свернуть').removeClass('maximize'); $(this).removeClass('minimized'); var cH = $(this).closest('.cH'); cH.removeClass('cH-minimized'); cH.find('.avatar .border').removeClass('border-minimized'); cH.find('.vote').show(); cH.next().show(); } else { $(this).html('Развернуть ('+$(this).attr('count')+')').addClass('maximize'); $(this).addClass('minimized'); var cH = $(this).closest('.cH'); cH.addClass('cH-minimized'); cH.find('.avatar40 .border').addClass('border-minimized'); cH.find('.vote').hide(); cH.next().hide(); } }; comments.subscribe = function() { var pid = $(this).closest('#comment').attr('pid'); ajx.requestA({ data: {pid: pid}, success: function(data, status, request) { if (data.startsWith('OK:')) { var result = data.substring(3); if (result!='') { var o = jQuery.parseJSON(result); var el = $('#comment[pid="'+o.pid+'"]').find('.subscribe').first(); if (o.result=='yes') { if (!el.hasClass('subscribe-selected')) { el.addClass('subscribe-selected').attr('title','Отписаться'); } } else { el.removeClass('subscribe-selected').attr('title','Подписаться'); } } }; }, url: '/ajax/subscribe/' }); }; var tt = new Object(); tt.offset = 26; tt.delay = 500; tt.dnh = false; tt.dns = false; tt.ttOver = function() { tt.dnh = true; }; tt.iconOver = function() { tt.dns = false; tt.parent = $(this); tt.type = $(this).attr('type'); setTimeout(tt.showIfPossible, 300); }; tt.showIfPossible = function() { if (!tt.dns) { tt.show(); } } tt.show = function() { tt.dnh = true; var ttp = $('#ttPanel'); tt.build(ttp, tt.parent); var pos = tt.parent.position(); var height = ttp.height(); var leftOffset = 12; var topOffset = 10; if (tt.type=='child') { leftOffset = tt.parent.width()/2; topOffset = 8; } ttp.show().css({ top: pos.top-height-topOffset+'px', left: (pos.left+leftOffset)-tt.offset+'px' }); } tt.out = function() { tt.dnh = false; tt.dns = true; setTimeout(tt.hideIfPossible, tt.delay); }; tt.hideIfPossible = function() { var ttp = $('#ttPanel'); if (!tt.dnh) { tt.hide(); } }; tt.hide = function() { tt.dnh = false; var ttp = $('#ttPanel'); ttp.hide().find('#ttMain').empty(); }; tt.build = function(panel, el) { panel.find('#ttMain').empty(); var parent = tt.parent; var type = parent.attr('type'); if (type=='child') { var tip = $('#clones #childTT').clone(); var i = parent.attr('img'); var name = parent.attr('name'); var age = parent.attr('age'); var about = parent.attr('about'); tip.find('.childName').html(name); if (i=='boy1' || i=='boy2' || i=='girl1' || i=='girl2') { tip.find('.childPhotoDefault').addClass(i); } else { tip.find('#childPhoto80').empty().html('
'); } tip.find('.childAge').html(age); if (about!=undefined) { tip.find('.childInfo').html(about); } panel.find('#ttMain').append(tip); } else if (type=='user') { var tip = $('#clones #userTT').clone(); var i = parent.attr('img'); var name = parent.attr('name'); var regDate = parent.attr('regDate'); var city = parent.attr('city'); var age = parent.attr('age'); var ms = parent.attr('ms'); if (i=='m' || i=='f') { var sex = (i=='m'?'male':'female'); tip.find('.avatar80').empty().html(''); } else { tip.find('.avatar80').empty().html('
'); } tip.find('.name').html(name); tip.find('.reg').find('span').html(regDate); if (city!=undefined) { tip.find('.city').show().find('span').html(city); } if (age!=undefined) { tip.find('.age').show().find('span').html(age); } if (ms!=undefined) { tip.find('.ms').show().find('span').html(ms); } panel.find('#ttMain').append(tip); } tt.dnh = true; }; var editor = new Object(); editor.ttDelay = 1000; editor.photoAdded = function(imgObj) { img.loadPanelParentEl.closest('#editor').find('textarea').insertAtCaret('\n{IMG:'+imgObj.we+imgObj.pid+'}\n'); }; editor.loadPanelsIfRequired = function() { if (!$('#editorPanels').length) { var includePhotoPanel = "yes"; if ($('#imgLoadPanel').length) { includePhotoPanel = "no"; } var result = ajx.requestS({ data: {includePhotoPanel: includePhotoPanel}, url: '/ajax/loadEditorPanels/' }); $('body').append(result); $('#videoPanel #videoBtn').click(editor.loadVideo); $('#smilesPanel, #formattingPanel').hover(editor.keepTTDisplayed, editor.hideEditorTTDelayed); $('#smilesPanel img').click(editor.addSmile); } }; editor.openVideoPanel = function() { editor.videoPanelParentEl = $(this); editor.loadPanelsIfRequired(); var panel = $('#videoPanel'); panel.find('#videoUrl').val('http://'); panel.find('#videoErr').hide(); editor.videoPop = $('#videoPanel').bPopup(bPop); }; editor.loadVideo = function() { var panel = $('#videoPanel'); var url = panel.find('#videoUrl').val(); if (url!='' && url!='http://') { var result = ajx.requestS({ skipProcess: true, data: {url: url}, url: '/ajax/downloadVideo/' }); if (result.startsWith('VALID:')) { editor.videoPop.close(); var id = result.substring(6); editor.videoPanelParentEl.closest('#editor').find('textarea').insertAtCaret('\n{YOUTUBE:'+id+'}\n'); } else { var err = ''; if (result=='NOT_EMBEDDABLE') { err = 'Данное видео не может быть встрено на сайт из-за ограничений YouTube'; } else { err = 'Видео не может быть встроено на сайт. Проверьте правильность указанного адреса'; } panel.find('#videoErr').show().html(err); } } }; editor.showEditorTT = function() { editor.dnh = true; editor.loadPanelsIfRequired(); var el = $(this); if (!el.is(editor.parentTT)) { editor.hideEditorTT(); } editor.parentTT = el; var pop = $('#'+$(this).attr('panel')); var height = 0; if ($(this).attr('panel')=='formattingPanel') { height = pop.height(); } else { var height = 213; } var pos = el.position(); pop.css({ top: pos.top-height-16+'px', left: pos.left+'px' }).show(); editor.currentTT = pop; }; editor.keepTTDisplayed = function() { editor.dnh = true; }; editor.hideEditorTTDelayed = function() { editor.dnh = false; setTimeout(editor.hideIfPossibleEditorTT, editor.ttDelay); }; editor.hideIfPossibleEditorTT = function() { if (!editor.dnh) { editor.hideEditorTT(); } }; editor.hideEditorTT = function() { if (editor.currentTT!=undefined) { editor.currentTT.hide(); } }; editor.addSmile = function() { var ta = editor.parentTT.closest('#editor').find('textarea'); ta.insertAtCaret(' {SMILE:'+$(this).attr('sid')+'} '); }; var topic = new Object(); topic.groupChanged = function() { var group1 = $('#group1').val(); var subGroups = groups[group1]; var el = $('#group2'); $('#group2 option:gt(0)').remove(); if (subGroups!=undefined) { $.each(subGroups, function(value,key) { el.append($("").attr("value", value).text(key)); }); } el.trigger('change'); }; var sb = new Object(); sb.saveGroups = function() { var data = new Object(); $('#userGroups').find('div[id=chk].selected').each(function() { var grp = $(this).attr('grp'); if (grp!=undefined) { data['grp'+grp]=1; } }); ajx.requestA({ data: data, success: function(data, status, request) { if (data=='OK') { msg.showInfo('Действие выполнено','Подписка на разделы сайта была обновлена', 580); }; }, url: '/ajax/updateGroupSubscription/' }); }; var partner = new Object(); partner.getRatio = function(el, type, pid) { if (dt.isPartnerLoggedIn()) { var data = {type: type}; if (pid!=undefined) { data['pid']=pid; }; ajx.requestA({ skipProcess: true, data: data, url: '/ajax/loadRatio/', success: function(data, status, request) { el.find('.ratio').remove(); el.find('.main').append(data); }, }); } }; partner.topicRequest = function() { dt.hideTopicErrors(); var topic = dt.getTopicObject(); if(dt.validateTopic(topic)) { ajx.requestS({ data: topic, success: function(data, status, request) { if (data=='OK') { window.location=window.location; } }, url: '/ajax/addTopicRequest/' }); }; }; partner.deleteTopicRequest = function(el) { var id = el.attr('id'); msg.confirm('Удаление запроса', 'Вы действительно хотите удалить запрос на создание темы для обсуждения?', 'Удалить запрос', function() { msg.confirmPop.close(); ajx.requestA({ skipProcess: true, data: {reqId: id}, url: '/ajax/deleteTopicRequest/', success: function(data, status, request) { el.closest('tr').remove(); }, }); }); }; partner.request = function() { ajx.requestA({ skipProcess: true, url: '/ajax/requestPayment/', success: function(data, status, request) { window.location=window.location; }, }); }