;(function($,_,undefined){$.easing['jswing']=$.easing['swing'];$.extend($.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return $.easing[$.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-$.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return $.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return $.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});$.fn.animatescroll=function(options){var opts=$.extend({},$.fn.animatescroll.defaults,options);if(typeof opts.onScrollStart=='function'){opts.onScrollStart.call(this);}
if(opts.element=="html,body"){var offset=this.offset().top;$(opts.element).stop().animate({scrollTop:offset-opts.padding},opts.scrollSpeed,opts.easing);}
else{$(opts.element).stop().animate({scrollTop:this.offset().top-this.parent().offset().top+this.parent().scrollTop()-opts.padding},opts.scrollSpeed,opts.easing);}
setTimeout(function(){if(typeof opts.onScrollEnd=='function'){opts.onScrollEnd.call(this);}},opts.scrollSpeed);};$.fn.animatescroll.defaults={easing:"swing",scrollSpeed:800,padding:0,element:"html,body"};$(document).scroll(function(){var y=$(this).scrollTop();if(y>600)
{$('#backtoTop').fadeIn();}
else
{$('#backtoTop').fadeOut();}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('plugins.easyMention',{initialize:function(){this.on('click','[data-action="mentionUser"]',this.mention);},mention:function(e){e.preventDefault();var editor=ips.ui.editor.getObj($('[data-role="replyArea"] [data-ipsEditor]'));var button=$(e.currentTarget);var html;if(button.attr('data-member-id')){html=$('<a/>').attr({'href':button.attr('data-profile'),'data-ipshover':'','data-ipshover-target':button.attr('data-hovercard'),'data-mentionid':button.attr('data-member-id'),'contenteditable':'false'}).html('@'+button.attr('data-name'))[0].outerHTML+'&nbsp;'}else{html=button.attr('data-name')+',&nbsp;';}
editor.unminimize(function(){editor.insertHtml(html);});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('plugins.minimizequote',{initialize:function()
{if($('.ipsQuote').length)
{var quoteColor=$('.ipsQuote').css('backgroundColor');if(quoteColor.indexOf('rgba')===-1)
{var fromColor=quoteColor.replace('rgb','rgba').replace(')',', 0)');var toColor=quoteColor.replace('rgb','rgba').replace(')',', 1)');var css=document.createElement("style");css.type="text/css";css.innerHTML="div.ipsQuote_contents.ipsTruncate:not(.ipsTruncate_expanded):after { background: linear-gradient( "+fromColor+", "+toColor+"); -webkit-transition: opacity 0.5s ease; -moz-transition: opacity 0.5s ease; transition: opacity 0.5s ease; pointer-events: none; content: ''; width: 100%; height: 50px; position: absolute; left: 0; bottom: 0; visibility: visible; }";document.body.appendChild(css);}}
this.minimizeQuotes();var that=this;$(document).on('contentChange',function(e,newContent)
{if(newContent instanceof jQuery)
{newContent.each(function()
{if(_.isUndefined($(this).attr('data-ipseditor'))&&$(this).parents('.cke_wysiwyg_div').length==0)
{that.minimizeQuotes();}});}
else
{if(_.isUndefined($(newContent).attr('data-ipseditor'))&&$(newContent).parents('.cke_wysiwyg_div').length==0)
{that.minimizeQuotes();}}
if(typeof PR!='undefined'){PR.prettyPrint();}});if(!_.isUndefined(window.CKEDITOR))
{this.fixEditorQuotes();}},loadTries:0,fixEditorQuotes:function()
{if((!CKEDITOR||_.isUndefined(CKEDITOR.on))&&this.loadTries<60)
{this.loadTries++;setTimeout(_.bind(this.fixEditorQuotes,this),50);return;}
CKEDITOR.on('instanceReady',this.doFixEditorQuotes);},doFixEditorQuotes:function(e)
{var editorContent=$("<div id='specialwrapperthing'>"+e.editor.getData()+"</div>");if(editorContent)
{$('.ipsTruncate_more',$(editorContent)).remove();$('.ipsQuote_contents',$(editorContent)).each(function()
{$(this).removeClass('ipsTruncate ipsClearfix');if($(this).prop('style')['height']!==""||!_.isUndefined($(this).attr('data-minimizedQuoteWasHere')))
{Debug.log('Fixing a messed up quote');$(this).removeAttr('style').removeAttr('data-minimizedQuoteWasHere');}});e.editor.setData($(editorContent).html());}},minimizeQuotes:function()
{var that=this;var size=parseInt(ips.getSetting('minimizeQuote_size'));var commentIds=[];$('blockquote[data-ipsquote]').each(function()
{var quoteContentsDiv=$(this).children('.ipsQuote_contents');if(!quoteContentsDiv.length)
{var citation=$(this).children('.ipsQuote_citation');$(this).children().wrapAll("<div class='ipsQuote_contents' />");if(citation.length>0)
{citation.detach();$(this).prepend(citation);}
quoteContentsDiv=$(this).children('.ipsQuote_contents');}
if((!_.isUndefined($(quoteContentsDiv).prop('style'))&&$(quoteContentsDiv).prop('style')['height']!=='')||!_.isUndefined($(quoteContentsDiv).attr('data-minimizedQuoteWasHere')))
{if($(quoteContentsDiv).prop('style')['height']=='auto'&&$(quoteContentsDiv).prop('style')['position']=='static'&&$(quoteContentsDiv).hasClass('ipsTruncate_expanded'))
{Debug.log("We've just expanded this one");return;}
Debug.log('Fixing messed up quote');$(quoteContentsDiv).removeAttr('style').removeAttr('data-minimizedQuoteWasHere').removeClass('ipsTruncate ipsClearfix');$(this).children('.ipsTruncate_more').remove();}
if(!_.isUndefined($(quoteContentsDiv).attr('data-ipseditor'))||$(this).closest('.ipsComposeArea').length||!_.isUndefined($(quoteContentsDiv).attr('contenteditable'))||$(this).parents('.cke_wysiwyg_div').length)
{Debug.log('In editor');return;}
$(quoteContentsDiv).attr('data-minimizedQuoteWasHere',1);if(parseInt(ips.getSetting('minimizeQuote_showFirstAppear'))==1)
{var quoteCommentId=parseInt($(this).attr('data-ipsquote-contentcommentid'));if($.inArray(quoteCommentId,commentIds)!==-1||$('div [data-commentid="'+quoteCommentId+'"]').length>0)
{ips.ui.truncate.respond($(quoteContentsDiv),{type:'hide',size:size+' lines'});}
else
{commentIds.push(quoteCommentId);}}
else
{ips.ui.truncate.respond($(quoteContentsDiv),{type:'hide',size:size+' lines'});}
$(quoteContentsDiv).on('truncateExpanded',function()
{$(quoteContentsDiv).addClass('ipsTruncate_expanded');})});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.createModule('ips.ui.spoiler',function(){ips.templates.set('core.editor.espoiler',"<div class='ipsSpoiler' data-ipsSpoiler><div class='ipsSpoiler_header'><span>{{#lang}}editorSpoiler{{/lang}}</span></div><div class='ipsSpoiler_contents'></div></div>");ips.templates.set('core.editor.espoilerHeader',"    <div class='ipsSpoiler_header ipsSpoiler_closed'>    <a href='#' data-action='toggleSpoiler'>&nbsp;</a>    <span>{{{full_annotation}}}</span>   </div>  ");var _prependAnnotation=function(annotation,text){if(!annotation)return text;return annotation+' ('+text+')';};var respond=function(elem,options,e){if(elem.parents('.cke_wysiwyg_div').length){return;}
elem.contents().hide();var existingHeader=elem.children('.ipsSpoiler_header');var header=ips.templates.render('core.editor.espoilerHeader',{full_annotation:_prependAnnotation(elem[0].getAttribute('data-ipsspoiler-option'),ips.getString('spoilerClickToReveal')),});if(existingHeader.length){existingHeader.replaceWith(header);}else{elem.prepend(header);}
elem.find('> .ipsSpoiler_header').on('click',_toggleSpoiler);},_toggleSpoiler=function(e){var header=$(e.currentTarget);var target=$(e.target);var spoiler=$(e.target).closest('[data-ipsSpoiler]');if(target.is('a:not( [data-action="toggleSpoiler"] )')||(target.closest('a').length&&!target.closest('a').is('[data-action="toggleSpoiler"]'))){return;}
e.preventDefault();var annotation=header.parents()[0].getAttribute('data-ipsspoiler-option');if(header.hasClass('ipsSpoiler_closed')){ips.utils.anim.go('fadeIn',header.siblings());header.removeClass('ipsSpoiler_closed').addClass('ipsSpoiler_open').find('span').text(_prependAnnotation(annotation,ips.getString('spoilerClickToHide')));$(document).trigger('contentChange',[spoiler]);var iframes=spoiler.find('iframe[data-embedcontent]');if(iframes.length){$.each(iframes,function(){this.src=this.src;});}}else{header.siblings().hide();header.removeClass('ipsSpoiler_open').addClass('ipsSpoiler_closed').find('span').text(_prependAnnotation(annotation,ips.getString('spoilerClickToReveal')));}
e.stopPropagation();};ips.ui.registerWidget('spoiler',ips.ui.spoiler);return{respond:respond}});}(jQuery,_));;