;(function($,_,undefined){"use strict";ips.controller.register('ignoretopics.front.topic.view',{initialize:function(){this.on(document,'click','[data-action="ignoreTopic"]',this.ignoreTopic);this.on(document,'click','[data-action="stopIgnoreTopic"]',this.stopIgnoreTopic);},ignoreTopic:function(e){var self=this;var topicId=$(e.currentTarget).attr('data-tid');ips.ui.alert.show({type:'confirm',icon:'question',message:ips.getString('it_ignore_topic'),subText:ips.getString('it_topic_ignored_blurb'),callbacks:{'ok':function(){ips.getAjax()({url:ips.getSetting('baseURL')+'index.php?app=forums&module=forums&controller=topic&id='+topicId+'&do=ignore&csrf='+ips.getSetting('csrfKey'),type:'post',showLoading:true}).done(function(response){self.scope.find('[data-role="ignoredBadge"]').show();self.scope.find('[data-id="ignoreTopic"]').hide();self.scope.find('[data-id="stopIgnoreTopic"]').show();ips.ui.flashMsg.show(ips.getString('saved'));}).fail(function(jqXHR,textStatus,errorThrown){ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('it_no_permission'),callbacks:{}});});}}});},stopIgnoreTopic:function(e){var self=this;var topicId=$(e.currentTarget).attr('data-tid');ips.ui.alert.show({type:'confirm',icon:'question',message:ips.getString('it_remove_ignore'),subText:ips.getString('it_topic_unignored_blurb'),callbacks:{'ok':function(){ips.getAjax()({url:ips.getSetting('baseURL')+'index.php?app=forums&module=forums&controller=topic&id='+topicId+'&do=removeignore&csrf='+ips.getSetting('csrfKey'),type:'post',showLoading:true}).done(function(response){self.scope.find('[data-role="ignoredBadge"]').hide();self.scope.find('[data-id="stopIgnoreTopic"]').hide();self.scope.find('[data-id="ignoreTopic"]').show();ips.ui.flashMsg.show(ips.getString('saved'));}).fail(function(jqXHR,textStatus,errorThrown){ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('it_no_permission'),callbacks:{}});});}}});}});}(jQuery,_));;