;(function($,_,undefined){"use strict";ips.controller.register('core.front.profile.body',{initialize:function(){this.on('click','[data-action="showRecentWarnings"]',this.showRecentWarnings);this.setup();},setup:function(){},showRecentWarnings:function(e){e.preventDefault();this.scope.find('[data-action="showRecentWarnings"]').hide();ips.utils.anim.go('fadeIn fast',this.scope.find('[data-role="recentWarnings"]'));}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.profile.followers',{_feedID:null,initialize:function(){this.on(document,'followingItem',this.followUser);this.on('menuItemSelected',"[data-role='followOption']",this.toggleFollowOption);this.setup();},setup:function(){this._feedID=this.scope.attr('data-feedID');},followUser:function(e,data){if(data.feedID!=this._feedID){return;} var self=this;var memberID=data.feedID.replace('member-','');ips.getAjax()(ips.getSetting('baseURL')+'index.php?app=core&module=members&controller=profile&do=followers&id='+parseInt(memberID)).done(function(response){self.scope.html(response);}).fail(function(){Debug.log('Error fetching follower HTML');});},toggleFollowOption:function(e,data){data.originalEvent.preventDefault();var url=data.menuElem.find('[data-ipsMenuValue="'+data.selectedItemID+'"] a').attr('href');ips.getAjax()(url).done(function(response){ips.ui.flashMsg.show(ips.getString('followerSettingToggled'));}).fail(function(){window.location=url;});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.profile.main',{contentArea:null,initialize:function(){this.on('click','[data-action="goToProfile"]',this.changeType);this.on('click','[data-action="browseContent"]',this.changeType);this.on('click','[data-action="repLog"]',this.changeType);History.Adapter.bind(window,'statechange',_.bind(this.stateChange,this));this.setup();},setup:function(){this.contentArea=this.scope.find('[data-role="profileContent"]');this.contentHeader=this.scope.find('[data-role="profileHeader"]');},stateChange:function(){var state=History.getState();Debug.log(state.data.section);switch(state.data.section){case'goToProfile':this._showProfile(state.url);break;case'browseContent':this._showContent(state.url);break;case'repLog':this._showRepLog(state.url);break;}},changeType:function(e){e.preventDefault();var target=$(e.currentTarget);if(!target.is('a')){target=target.find('a');} this._changeURL({section:$(e.currentTarget).attr('data-action')},target.attr('title'),target.attr('href'));},_showRepLog:function(url){var self=this;this._changeContent(true,url);this._showProfileButton();if(ips.utils.responsive.enabled()&&ips.utils.responsive.currentIs('phone')){$('#elProfileStats').addClass('cProfileHeaderContent');}},_showContent:function(url){var self=this;this._changeContent(true,url);this._showProfileButton();if(ips.utils.responsive.enabled()&&ips.utils.responsive.currentIs('phone')){$('#elProfileStats').addClass('cProfileHeaderContent');}},_showProfileButton:function(){var self=this;this.contentHeader.find('[data-action="browseContent"]').each(function(){var elem=$(this);if(elem.is(':visible')){elem.animationComplete(function(){ips.utils.anim.go('fadeIn fast',self.contentHeader.find('[data-action="goToProfile"][data-type="'+elem.attr('data-type')+'"]'));});ips.utils.anim.go('fadeOut fast',elem);}else{elem.hide();self.contentHeader.find('[data-action="goToProfile"][data-type="'+elem.attr('data-type')+'"]').show();}});},_showProfile:function(url){var self=this;this._changeContent(false,url);this._showContentButton();$('#elProfileStats').removeClass('cProfileHeaderContent');},_showContentButton:function(){var self=this;this.contentHeader.find('[data-action="goToProfile"]').each(function(){var elem=$(this);if(elem.is(':visible')){elem.animationComplete(function(){ips.utils.anim.go('fadeIn fast',self.contentHeader.find('[data-action="browseContent"][data-type="'+elem.attr('data-type')+'"]'));});ips.utils.anim.go('fadeOut fast',elem);}else{elem.hide();self.contentHeader.find('[data-action="browseContent"][data-type="'+elem.attr('data-type')+'"]').show();}});},_changeContent:function(small,url){var self=this;this.contentArea.css({height:String(this.contentArea.outerHeight())});this.contentArea.html($('
').addClass('ipsLoading').css({height:'300px'}));this.contentHeader.find('#elProfileHeader').toggleClass('cProfileHeaderMinimal',small);ips.getAjax()(url).done(function(response){self.contentArea.hide().html(response).css({height:'auto'});ips.utils.anim.go('fadeIn fast',self.contentArea);$(document).trigger('contentChange',[self.contentArea]);}).fail(function(){window.location=url;});},_changeURL:function(data,title,url){History.pushState(data,title,url);}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.profile.toggleBlock',{initialize:function(){this.on('click','[data-action="disable"]',this.toggleBlock);this.on('click','[data-action="enable"]',this.toggleBlock);},toggleBlock:function(e){e.preventDefault();var self=this;this.scope.css({opacity:"0.6"});ips.getAjax()($(e.currentTarget).attr('href'),{showLoading:true}).done(function(response){self.scope.html(response);$(document).trigger('contentChange',[self.scope]);}).fail(function(){window.location=$(e.currentTarget).attr('href');}).always(function(){self.scope.css({opacity:"1"});});}});}(jQuery,_));;