ips.templates.set('core.general.loading',"      {{text}}");ips.templates.set('core.general.ajax',"
  {{#lang}}loading{{/lang}}...
");ips.templates.set('core.general.flashMsg',"
");ips.templates.set('core.hovercard.loading'," ");ips.templates.set('core.posts.spoiler'," {{#lang}}spoilerClickToReveal{{/lang}}");ips.templates.set('core.posts.spoilerOpen'," {{#lang}}spoilerClickToHide{{/lang}}");ips.templates.set('core.posts.multiQuoteOff'," ");ips.templates.set('core.posts.multiQuoteOn'," ");ips.templates.set('core.posts.multiQuoter',"
  
");ips.templates.set('core.menus.menuItem',"
  • {{title}}
  • ");ips.templates.set('core.menus.menuSep',"

  • ");ips.templates.set('core.posts.quotedSpoiler',"

    {{#lang}}quotedSpoiler{{/lang}}

    ");ips.templates.set('core.postNotify.single',"    {{{text}}}    {{#lang}}showReply{{/lang}} ");ips.templates.set('core.postNotify.multiple'," {{text}}    {{#lang}}showReplies{{/lang}} ");ips.templates.set('core.postNotify.multipleSpillOver'," {{text}} {{#canLoadNew}}    {{showFirstX}}    {{#lang}}showRepliesOr{{/lang}} {{/canLoadNew}}    {{#lang}}goToNewestPage{{/lang}} ");ips.templates.set('core.notification.flashSingle'," ");ips.templates.set('core.notification.flashMultiple'," ");ips.templates.set('core.alert.box'," ");ips.templates.set('core.alert.subText',"
    {{text}}
    ");ips.templates.set('core.alert.subTextHtml',"
    {{{text}}}
    ");ips.templates.set('core.alert.icon'," ");ips.templates.set('core.alert.button',"
  • ");ips.templates.set('core.alert.prompt',"



    ");ips.templates.set('core.lightbox.meta',"{{title}}");ips.templates.set('core.dialog.main'," ") ips.templates.set('core.tooltip'," ");ips.templates.set('core.search.loadingPanel',"
     
    ");ips.templates.set('core.editor.panelWrapper',"
    {{content}}
    ");ips.templates.set('core.editor.giphy'," ");ips.templates.set('core.editor.giphyThumb',"
    {{title}}
    ");ips.templates.set('core.editor.giphyRow',"
    {{{gifs}}}
    ");ips.templates.set('core.editor.pixabayThumb',"
    ");ips.templates.set('core.editor.pixabayRow',"
    {{{images}}}
    ");ips.templates.set('core.editor.emoticons'," ");ips.templates.set('core.editor.emoticonSection',"
    {{{content}}}
    ");ips.templates.set('core.editor.emoticonMenu'," ");ips.templates.set('core.editor.emoticonCategory',"
    {{title}}
    {{{emoticons}}}
    ");ips.templates.set('core.editor.emoticonSearch',"
    {{{emoticons}}}
    ");ips.templates.set('core.editor.emoticonRow',"
    {{{emoticons}}}
    ");ips.templates.set('core.editor.emoticonItem',"
    {{{img}}}
    ");ips.templates.set('core.editor.emoji',"
    {{{display}}}
    ");ips.templates.set('core.editor.emojiNotNative',"
    {{{img}}}
    ");ips.templates.set('core.editor.emoticonBlank',"
     
    ");ips.templates.set('core.editor.emoticonNoResults',"
    {{#lang}}no_results{{/lang}}
    ");ips.templates.set('core.editor.emojiResult',"
  • {{{emoji}}} {{short_code}}
  • ");ips.templates.set('core.editor.quote',"
    {{citation}}
    {{{contents}}}
    ");ips.templates.set('core.editor.legacyQuoteUpcast',"
    {{citation}}
    {{{contents}}}
    ");ips.templates.set('core.editor.citation',"
      {{#contenturl}} {{/contenturl}} {{{citation}}}
    ");ips.templates.set('core.editor.citationLink'," {{username}}");ips.templates.set('core.editor.spoiler',"
    {{#lang}}editorSpoiler{{/lang}}
    ");ips.templates.set('core.editor.legacySpoilerUpcast',"
    {{#lang}}editorSpoiler{{/lang}}
    {{{contents}}}
    ");ips.templates.set('core.editor.spoilerHeader',"
      {{#lang}}spoilerClickToReveal{{/lang}}
    ");ips.templates.set('core.editor.initLoading',"
     
    ");ips.templates.set('core.editor.previewLoading',"
     
    ");ips.templates.set('core.attachments.metaInfo'," {{size}} · {{downloads}} ");ips.templates.set('core.attachments.attachmentPreview'," {{title}}{{#lang}}attachmentPending{{/lang}} ");ips.templates.set('core.attachments.fileItemWrapper'," ");ips.templates.set('core.attachments.fileItem',"
    {{#thumb}} {{{thumb}}} {{/thumb}}

    {{title}}

    {{size}}

    {{#status}}{{/status}} {{#statusText}}{{statusText}}{{/statusText}}
    ");ips.templates.set('core.attachments.imageItem',"
    {{#status}} {{{status}}} {{/status}} {{#thumb}} {{{thumb}}} {{/thumb}}

    {{title}}

    {{size}} {{#statusText}}· {{statusText}}{{/statusText}}

    ");ips.templates.set('core.attachments.videoItem',"
    {{#status}} {{{status}}} {{/status}} {{#thumb}} {{/thumb}}

    {{title}}

    {{size}} {{#statusText}}· {{statusText}}{{/statusText}}

    ");ips.templates.set('core.attachments.imageItemWrapper',"
    {{{content}}}
    ");ips.templates.set('core.autocomplete.field',"
    ");ips.templates.set('core.autocomplete.addToken'," {{text}} ");ips.templates.set('core.autocomplete.resultWrapper'," ");ips.templates.set('core.autocomplete.searchTypeAhead',"
    ");ips.templates.set('core.autocomplete.resultItem',"
  • {{html}}
  • ");ips.templates.set('core.autocomplete.tagsResultItem',"
  • {{html}} {{#recommended}} {{#lang}}tag_recommended{{/lang}} {{/recommended}}
  • ");ips.templates.set('core.autocomplete.token',"
  • {{{title}}} ×
  • ");ips.templates.set('core.autocomplete.memberItem',"
  • {{{name}}}
    {{{extra}}}
  • ");ips.templates.set('core.autocomplete.optional'," {{langString}}...");ips.templates.set('core.forms.toggle'," ");ips.templates.set('core.forms.validationWrapper'," ");ips.templates.set('core.forms.validationItem',"
  • {{message}}
  • ");ips.templates.set('core.forms.advicePopup',"

    {{#lang}}password_advice_title{{/lang}}

    {{#min}} {{min}} {{/min}} {{{text}}}

    ");ips.templates.set('core.forms.validateOk'," ");ips.templates.set('core.forms.validateFail'," ");ips.templates.set('core.forms.validateFailText',"

    {{message}}

    ");ips.templates.set('core.truncate.expand'," {{text}}  ");ips.templates.set('core.selectTree.token',"
  • {{title}}
  • ");ips.templates.set('core.accessibility.border',"
    ");ips.templates.set('core.accessibility.arrow',"
    ");ips.templates.set('core.infScroll.loading',"
  • {{#lang}}loading{{/lang}}...
  • ");ips.templates.set('core.infScroll.pageBreak',"
  • {{#lang}}page{{/lang}} {{page}}
  • ");ips.templates.set('core.pageAction.actionMenuItem',"
  • {{#icon}} {{/icon}} {{^icon}} {{title}} {{/icon}}
  • ");ips.templates.set('core.pageAction.actionItem',"
  • {{#icon}} {{/icon}} {{^icon}} {{title}} {{/icon}}
  • ");ips.templates.set('core.pageAction.wrapper',"
    ");ips.templates.set('core.carousel.bulletWrapper'," ");ips.templates.set('core.carousel.bulletItem',"
  • ");ips.templates.set('core.rating.wrapper',"
    {{status}}") ips.templates.set('core.rating.star',"
  • ");ips.templates.set('core.rating.halfStar',"
  • ");ips.templates.set('core.rating.loading'," ");ips.templates.set('core.sidebar.managerWrapper',"

    {{#lang}}sidebarManager{{/lang}}

    {{#lang}}sidebarManagerDesc{{/lang}}

    {{#lang}}sidebarManagerDesc2{{/lang}}

    ");ips.templates.set('core.sidebar.blockManage',"

    {{title}}

    ");ips.templates.set('core.sidebar.blockManageNoConfig',"

    {{title}}

    ");ips.templates.set('core.sidebar.blockIsEmpty',"
    {{text}}
    ");ips.templates.set('core.follow.loading',"
    ");ips.templates.set('core.statuses.loadingComments',"    {{#lang}}loadingComments{{/lang}}");ips.templates.set('core.forms.stack',"
  • ×
    {{{field}}}
  • ");ips.templates.set('core.pollEditor.question',"
    •  

      {{#lang}}choicesTitle{{/lang}}

      {{#showCounts}}

      {{#lang}}votesTitle{{/lang}}

      {{/showCounts}}

       

    • {{{choices}}}

     

    ");ips.templates.set('core.pollEditor.choice',"
  • {{choiceID}}
    {{#showCounts}}
    {{/showCounts}}
  • ");ips.templates.set('core.coverPhoto.controls'," ");ips.templates.set('core.patchwork.imageList'," {{#showThumb}}
  • {{/showThumb}} {{^showThumb}}
  • {{/showThumb}} {{#showThumb}}{{image.title}}{{/showThumb}}
    {{image.caption}} {{#lang}}by{{/lang}} {{image.author.name}}
      {{#image.unread}}
    • {{/image.unread}} {{#image.hasState}}
    • {{#image.state.hidden}} {{/image.state.hidden}} {{#image.state.pending}} {{/image.state.pending}} {{#image.state.pinned}} {{/image.state.pinned}} {{#image.state.featured}} {{/image.state.featured}}
    • {{/image.hasState}} {{#image.allowComments}}
    • {{image.comments}}
    • {{/image.allowComments}}
    {{#image.modActions}} {{/image.modActions}}
  • ");ips.templates.set('core.editor.preferences',"
    {{#lang}}papt_warning{{/lang}}

    ");ips.templates.set('core.pagination'," ");ips.templates.set('core.selection.quote',"
    {{#lang}}quote_selected_text{{/lang}}
    ");ips.templates.set('core.contentItem.resultItem',"
  • {{{html}}}
  • ");ips.templates.set('core.contentItem.field',"
    ");ips.templates.set('core.contentItem.resultWrapper'," ");ips.templates.set('core.contentItem.item',"
  • × {{{html}}}
  • ");ips.templates.set('promote.imageUpload',"
    {{#thumbnail}}{{/thumbnail}}
    ");ips.templates.set('table.row.loading',"
  • ");ips.templates.set('licenseRenewal.wrapper',"

    {{#lang}}licenseRenewalTitle{{/lang}}

    {{#lang}}licenseRenewalText{{/lang}}

    ");ips.templates.set('core.browserNotification.prompt',"
    ×

    {{#lang}}notificationsCallout{{/lang}}

    {{#lang}}notificationsDefaultBlurb{{/lang}}

    {{#lang}}notificationsAllowPrompt{{/lang}}

    ");ips.templates.set('system.warningpenalty.nomodify'," ");ips.templates.set('core.edittags.default',"
     {{#lang}}loading{{/lang}}
    ");; ;(function($,_,undefined){"use strict";ips.createModule('ips.controller',function(){var _controllers={},_autoMixins={},_manualMixins={},_mixins={},_beingLoaded=[],_queue={},_prototypes={},instanceID=1,_controllerCaseMap={'core.front.core.autosizeiframe':'core.front.core.autoSizeIframe'};var register=function(id,definition){_controllers[id]=definition;_checkQueue(id);},isRegistered=function(id){return!_.isUndefined(_controllers[id]);},init=function(){$(document).on('contentChange',function(e,newNode){initializeControllers(newNode);});initializeControllers();},mixin=function(mixinName,controller,auto,mixinFunc){if(_.isFunction(auto)){mixinFunc=auto;auto=false;} var obj=(auto)?_autoMixins:_manualMixins;if(_.isUndefined(obj[controller])){obj[controller]={};} obj[controller][mixinName]=mixinFunc;},initializeControllers=function(node){var controllers=_findControllers(node);var needsLoading={};for(var controller in controllers){if(isRegistered(controller)){for(var i=0;i').addClass('ipsModal').hide().appendTo($('body')).identify();},init=function(){$(document).on('contentChange',function(e,newContent){if(newContent instanceof jQuery){newContent.each(function(){if(Debug.isEnabled){Debug.info("contentChange event, reinitializing widgets in "+$(this).identify().attr('id'));} _initializeWidgets(this);});}else{if(Debug.isEnabled){Debug.info("contentChange event, reinitializing widgets in "+$(newContent).identify().attr('id'));} _initializeWidgets(newContent);} if(typeof PR!='undefined'){PR.prettyPrint();}});_initializeWidgets(document);};return{registerWidget:registerWidget,init:init,zIndex:zIndex,getModal:getModal,getAcceptedOptions:getAcceptedOptions,key:key,destructAllWidgets:destructAllWidgets};});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.createModule('ips.ui.quote',function(){var defaults={timestamp:'',userid:0,username:'',contenttype:'',contentclass:'',contentid:0};var respond=function(elem,options){if(elem.data('quoteBuilt')||elem.parents('.cke_wysiwyg_div').length){return;} var existingCitation=elem.children('.ipsQuote_citation');var citation=ips.utils.getCitation(options,true,existingCitation.length?existingCitation.text():ips.getString('editorQuote'));var data={citation:citation,contenturl:options.contentid&&options.contentcommentid?ips.getSetting('baseURL')+"?app=core&module=system&controller=content&do=find&content_class="+options.contentclass+"&content_id="+options.contentid+"&content_commentid="+options.contentcommentid:''};var citation=ips.templates.render('core.editor.citation',data);if(existingCitation.length){existingCitation.replaceWith(citation);}else{elem.prepend(citation);} elem.find('> .ipsQuote_citation').on('click',_toggleQuote);elem.find('> .ipsQuote_contents').addClass('ipsClearfix').attr('data-ipsTruncate',true).attr('data-ipsTruncate-type','hide').attr('data-ipsTruncate-size','7 lines').attr('data-ipsTruncate-expandText',ips.getString('expand_quote'));if(elem.is('blockquote.ipsQuote > blockquote.ipsQuote')){elem.find('> *:not( .ipsQuote_citation )').hide().end().find('> .ipsQuote_citation').removeClass('ipsQuote_open').addClass('ipsQuote_closed');} elem.trigger('quoteBuilt.quote');elem.data('quoteBuilt',true);$(document).trigger('contentChange',[elem]);},_toggleQuote=function(e){var cite=$(e.currentTarget);var target=$(e.target);if(target.is('a:not( [data-action="toggleQuote"] )')||(target.closest('a').length&&!target.closest('a').is('[data-action="toggleQuote"]'))){return;} e.preventDefault();if(cite.hasClass('ipsQuote_closed')){ips.utils.anim.go('fadeIn',cite.siblings());cite.removeClass('ipsQuote_closed').addClass('ipsQuote_open');}else{cite.siblings().hide();cite.removeClass('ipsQuote_open').addClass('ipsQuote_closed');} e.stopPropagation();};ips.ui.registerWidget('quote',ips.ui.quote,['timestamp','userid','username','contentapp','contenttype','contentclass','contentid','contentcommentid']);return{respond:respond};});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.createModule('ips.ui.rating',function(){var defaults={changeRate:true,canRate:true};var respond=function(elem,options){if(!$(elem).data('_rating')){$(elem).data('_rating',ratingObj(elem,_.defaults(options,defaults)));}};ips.ui.registerWidget('rating',ips.ui.rating,['url','changeRate','canRate','size','value','userRated']);var ratingObj=function(elem,options){var selected=null,max=0,ratingElem=null,userRated=false,loading=false;var init=function(){elem.children().hide();if(options.value){selected=options.value;}else{selected=elem.find('input[type="radio"]:checked').val();} var maxElem=_.max(elem.find('input[type="radio"]'),function(value){return parseInt($(value).attr('value'));});max=$(maxElem).attr('value');_buildRatingElem();ratingElem.on('mouseenter','li',_enterStar);ratingElem.on('mouseleave','li',_leaveStar);ratingElem.on('click','li',_clickStar);},_buildRatingElem=function(){var content='';for(var i=1;i<=max;i++){if(i<=selected){content+=ips.templates.render('core.rating.star',{value:i,className:'ipsRating_on'});}else if((i-0.5)<=selected){content+=ips.templates.render('core.rating.halfStar',{value:i});}else{content+=ips.templates.render('core.rating.star',{value:i,className:'ipsRating_off'});}} content=ips.templates.render('core.rating.wrapper',{content:content,status:(options.userRated)?ips.pluralize(ips.getString('youRatedThis'),[options.userRated]):''});elem.append(content);ratingElem=elem.find('.ipsRating');if(options.size){ratingElem.addClass('ipsRating_'+options.size);}},_enterStar=function(e){if((selected!=null&&!options.changeRate)||!options.canRate||loading){return;} _starActive($(e.currentTarget).attr('data-ratingValue'),true);},_leaveStar=function(e){if((selected!=null&&!options.changeRate)||!options.canRate||loading){return;} _starActive(selected,false);},_clickStar=function(e){e.preventDefault();if((selected!=null&&!options.changeRate)||!options.canRate||loading){return;} var value=$(e.currentTarget).attr('data-ratingValue');selected=value;userRated=true;_starActive(value);ips.utils.anim.go('pulseOnce',$(e.currentTarget));elem.find('[data-role="ratingStatus"]').text(ips.pluralize(ips.getString('youRatedThis'),[value]));if(options.url){_remoteRating(value);return;} elem.find('input[type="radio"]').prop('checked',false).filter('input[type="radio"][value="'+value+'"]').prop('checked',true);elem.trigger('ratingSaved',{value:value});},_starActive=function(value,hover){ratingElem.find('> ul[data-role="ratingList"]').toggleClass('ipsRating_mine',(hover||userRated)).end().find('.ipsRating_half').each(function(){$(this).replaceWith(ips.templates.render('core.rating.star',{value:$(this).attr('data-ratingValue'),className:'ipsRating_off'}));}).end().find('li').removeClass('ipsRating_on').removeClass('ipsRating_hover').addClass('ipsRating_off').end().find('li[data-ratingValue="'+value+'"]').prevAll('li').andSelf().removeClass('ipsRating_off').addClass('ipsRating_on');},_remoteRating=function(value){_setLoading(true);var statusElem=elem.find('[data-role="ratingStatus"]');statusElem.html(ips.templates.render('core.rating.loading'));ips.getAjax()(options.url,{data:{rating:parseInt(value)}}).done(function(response){statusElem.text(ips.getString('rating_saved'));elem.trigger('ratingSaved',{value:value});}).fail(function(jqXHR){statusElem.text(ips.getString('rating_failed'));elem.trigger('ratingFailed',{value:value});}).always(function(){});},_setLoading=function(isLoading){loading=isLoading;ratingElem.toggleClass('ipsRating_loading',isLoading);};init();return{};};return{respond:respond};});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.createModule('ips.ui.selectTree',function(){var defaults={multiple:false,selected:false,searchable:true,placeholder:ips.getString('select')};var respond=function(elem,options){if(!$(elem).data('_selecttree')){$(elem).data('_selecttree',selectTreeObj($(elem),_.defaults(options,defaults)));}},getObj=function(elem){if($(elem).data('_selecttree')){return $(elem).data('_selecttree');} return undefined;},destruct=function(elem){var obj=getObj(elem);if(!_.isUndefined(obj)){obj.destruct();}};var selectTreeObj=function(elem,options){var results=null,elemID=null,selectedItems=[],name='';var init=function(){elemID=elem.identify().attr('id');results=elem.find('.ipsSelectTree_nodes');name=elem.attr('data-name');elem.on('click',_toggleResults);elem.on('click','[data-action="getChildren"]',_toggleChildren);elem.on('click','[data-action="nodeSelect"]',_toggleNodeSelection);elem.on('click','[data-action="nodeLoadMore"] a:not(.ipsButton_disabled)',_nodeLoadMore);if($('input[name="'+name+'-zeroVal"]')){$('input[name="'+name+'-zeroVal"]').on('change',_zeroValChange);} if(options.selected){try{var preSelected=$.parseJSON(options.selected);}catch(err){} if(preSelected&&_.isObject(preSelected)&&_.size(preSelected)){_buildPreSelected(preSelected);return;}} elem.find('.ipsSelectTree_value').addClass('ipsSelectTree_placeholder').text((options.placeholder)?options.placeholder:ips.getString('select'));_zeroValChange();},destruct=function(){$(document).off('click.'+elemID);},_buildPreSelected=function(preSelected){if(_.size(preSelected)){_.each(preSelected,function(val,key){selectedItems.push(key);if(options.multiple){var id=key;if(val.id){id=val.id;} _addToken(val.title,id);}else{_setValue(val.title);} if(results.find('[data-id="'+key+'"]').length){results.find('[data-id="'+key+'"]').addClass('ipsSelectTree_selected');}});_updateSelectedValues();elem.trigger('nodeInitialValues',{selectedItems:selectedItems});}},_zeroValChange=function(e){elem.toggleClass('ipsSelectTree_disabled',$('input[name="'+name+'-zeroVal"]').is(':checked'));if(!$('input[name="'+name+'-zeroVal"]').is(':checked')&&results.is(':visible')){_closeResults();}},_toggleChildren=function(e,ignoreClosed){e.preventDefault();e.stopPropagation();var item=$(e.currentTarget).closest('.ipsSelectTree_item');var listItem=item.closest('li');var id=item.attr('data-id');var url=options.url+'&_nodeSelect=children&_nodeId='+id;if(!item.hasClass('ipsSelectTree_withChildren')){return;} if(item.hasClass('ipsSelectTree_itemOpen')){if(ignoreClosed!==true){item.removeClass('ipsSelectTree_itemOpen');listItem.find('> [data-role="childWrapper"]').hide();_positionResults();}}else{item.addClass('ipsSelectTree_itemOpen');if(item.attr('data-childrenLoaded')){ips.utils.anim.go('fadeIn fast',listItem.find('> [data-role="childWrapper"]'));_positionResults();}else{listItem.append($('
    ').attr('data-role','childWrapper').html(ips.templates.render('core.general.loading',{text:ips.getString('loading')})));_positionResults();ips.getAjax()(url).done(function(response){item.attr('data-childrenLoaded',true);listItem.find('[data-role="childWrapper"]').html(response.output);listItem.find('[data-role="childWrapper"] .ipsSelectTree_item').each(function(){if($(this).attr('data-id')&&selectedItems.indexOf($(this).attr('data-id'))!=-1){$(this).addClass('ipsSelectTree_selected');}});_positionResults();});}}},_toggleNodeSelection=function(e){var node=$(e.currentTarget);if(node.hasClass('ipsSelectTree_selected')){_unselectNode(node,e);}else{_selectNode(node,e);} _updateSelectedValues();},_nodeLoadMore=function(e){var offset=results.find('[data-action="nodeLoadMore"]').attr('data-offset');var url=options.url+'&_nodeSelect=loadMore&_nodeSelectOffset='+offset;results.find('[data-action="nodeLoadMore"] span.ipsLoading').removeClass('ipsHide');results.find('[data-action="nodeLoadMore"] > a.ipsButton').addClass('ipsButton_disabled');ips.getAjax()(url).done(function(response){if(!_.isUndefined(response.globalOutput)){results.find('[data-role="globalNodeList"]').append(response.globalOutput);if(!_.isUndefined(response.clubsOutput)){results.find('[data-role="clubNodeList"]').append(response.clubsOutput);}} else{results.find('[data-role="nodeList"]').append(response.output);} results.find('[data-action="nodeLoadMore"] span.ipsLoading').addClass('ipsHide');if(response.loadMore){results.find('[data-action="nodeLoadMore"]').attr('data-offset',response.loadMore);} else{results.find('[data-action="nodeLoadMore"]').addClass('ipsHide');} results.find('[data-action="nodeLoadMore"] > a.ipsButton').removeClass('ipsButton_disabled');results.find('[data-role="nodeList"]').find('.ipsSelectTree_item').each(function(){if($(this).attr('data-id')&&selectedItems.indexOf($(this).attr('data-id'))!=-1){$(this).addClass('ipsSelectTree_selected');}});_positionResults();});},_selectNode=function(node,e){if(!options.multiple){elem.find('.ipsSelectTree_selected').removeClass('ipsSelectTree_selected');} node.addClass('ipsSelectTree_selected');var title=node.find('[data-role="nodeTitle"]').text();var id=node.attr('data-id');if(!options.multiple){_setValue(title);}else{_addToken(title,id);} if(options.multiple){selectedItems.push(node.attr('data-id'));}else{selectedItems=[node.attr('data-id')];} if(e){_toggleChildren(e,true);} elem.trigger('nodeItemSelected',{title:title,id:id});if(!options.multiple&&!node.hasClass('ipsSelectTree_withChildren')){setTimeout(function(){_closeResults();},200);}},_unselectNode=function(node,e){node.removeClass('ipsSelectTree_selected');selectedItems=_.without(selectedItems,node.attr('data-id'));elem.trigger('nodeItemUnselected',{title:node.find('[data-role="nodeTitle"]').text(),id:node.attr('data-id')});if(!options.multiple){_setValue();}else{_removeToken(node);}},_addToken=function(title,id){var valueElem=elem.find('.ipsSelectTree_value');var elemHeight=elem.outerHeight();if(!elem.find('[data-role="tokenList"]').length){valueElem.html($('
      ').addClass('ipsList_inline').attr('data-role','tokenList'));} elem.find('[data-role="tokenList"]').append(ips.templates.render('core.selectTree.token',{title:title,id:id}));if(elemHeight!=elem.outerHeight()){_positionResults();}},_removeToken=function(node){var id=node.attr('data-id');var tokenList=elem.find('[data-role="tokenList"]');var elemHeight=elem.outerHeight();var token=tokenList.find('[data-nodeId="'+id+'"]').closest('li').remove();if(!tokenList.find('[data-nodeId]').length){tokenList.remove();_setValue();} if(elemHeight!=elem.outerHeight()){_positionResults();}},_updateSelectedValues=function(){elem.find('[data-role="nodeValue"]').val(_.uniq(selectedItems).join(','));elem.trigger('nodeSelectedChanged',{selectedItems:selectedItems});},_setValue=function(value){if(value){elem.find('.ipsSelectTree_value').text(value).removeClass('ipsSelectTree_placeholder');}else{elem.find('.ipsSelectTree_value').text((options.placeholder)?options.placeholder:ips.getString('select')).addClass('ipsSelectTree_placeholder');}},_toggleResults=function(e){if(results.is(':visible')){_maybeHideResults(e);}else{_showResults(e);}},_maybeHideResults=function(e){var rawResults=results.get(0);if((!$.contains(rawResults,e.target)&&rawResults!=e.target)){_closeResults();}},_closeResults=function(){ips.utils.anim.go('fadeOut fast',results);$(document).off('click.'+elemID);elem.removeClass('ipsSelectTree_active');elem.trigger('nodeSelectionClosed');},_showResults=function(){$(document).on('click.'+elemID,_closeResultsOnBlur);_positionResults();results.show();elem.addClass('ipsSelectTree_active');if(elem.find('[data-role="nodeSearch"]')){elem.find('[data-role="nodeSearch"]').focus();}},_positionResults=function(){var above=false;var selectWidth=elem.outerWidth();var elemTop=elem.offset().top;var elemHeight=elem.height();if((elemTop+elemHeight+results.height())>$(window).height()){above=true;var scrollParent=_getScrollParent();var scrollParentTop=$(scrollParent).offset().top;Debug.log("elemTop: "+elemTop);Debug.log("elemTop - resultsHeight: "+(elemTop-results.height()));Debug.log("scrollParentTop: "+scrollParentTop);if((elemTop-results.height())')).end().find('.ipsSideMenu_mainTitle + div').append($(elem).find('.ipsSideMenu_title, .ipsSideMenu_subTitle, .ipsSideMenu_list'));} $(elem).on('click','.ipsSideMenu_item',_clickEvent);$(elem).on('selectItem.sideMenu',_selectItem);},_clickEvent=function(e){_doSelectItem($(e.currentTarget),e);_toggleSideMenu();},_selectItem=function(e,data){_doSelectItem(elem.find('[data-ipsMenuValue="'+data.value+'"]'),e);},_doSelectItem=function(item,e){if((_.isUndefined(item.attr('data-ipsMenuValue'))&&!item.find('input[type="radio"], input[type="checkbox"]').length)||!item.length){return;} if(e){e.preventDefault();} if(item.hasClass('ipsSideMenu_itemDisabled')){return;} var workingItems;if(!options.group){workingItems=$(elem).find('.ipsSideMenu_item');}else{workingItems=item.closest('.ipsSideMenu_list').find('.ipsSideMenu_item');} if(options.type=='check'){item.toggleClass('ipsSideMenu_itemActive').find('input[type="radio"], input[type="checkbox"]').prop("checked",function(i,val){return!val;}).change();}else{workingItems.removeClass('ipsSideMenu_itemActive').find('input[type="radio"], input[type="checkbox"]').prop("checked",false);item.addClass('ipsSideMenu_itemActive').find('input[type="radio"], input[type="checkbox"]').prop("checked",true).change();} var selectedItems=[];workingItems.filter('.ipsSideMenu_itemActive').each(function(){selectedItems.push($(this).attr('data-ipsMenuValue'));});$(elem).trigger('itemClicked.sideMenu',{id:$(elem).identify().attr('id'),menuElem:$(elem),selectedElem:item,selectedItemID:item.attr('data-ipsMenuValue'),selectedItems:selectedItems});},_toggleSideMenu=function(e){if(e){e.preventDefault();} var menuContainer=$(elem).find('.ipsSideMenu_mainTitle + div');if($(elem).hasClass('ipsSideMenu_open')){$(elem).removeClass('ipsSideMenu_open');}else{$(elem).addClass('ipsSideMenu_open');ips.utils.anim.go('fadeIn',menuContainer);}};init();return{};};return{respond:respond};});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.createModule('ips.ui.spoiler',function(){var respond=function(elem,options,e){if(!elem.find('.ipsSpoiler_contents').hasClass('ipsClearfix')){elem.find('.ipsSpoiler_contents').addClass('ipsClearfix');} if(elem.parents('.cke_wysiwyg_div').length){return;} elem.contents().hide();var existingHeader=elem.children('.ipsSpoiler_header');var header=ips.templates.render('core.editor.spoilerHeader');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();if(header.hasClass('ipsSpoiler_closed')){ips.utils.anim.go('fadeIn',header.siblings());header.removeClass('ipsSpoiler_closed').addClass('ipsSpoiler_open').find('span').text(ips.getString('spoilerClickToHide'));$(document).trigger('contentChange',[spoiler]);}else{header.siblings().hide();header.removeClass('ipsSpoiler_open').addClass('ipsSpoiler_closed').find('span').text(ips.getString('spoilerClickToReveal'));} e.stopPropagation();};ips.ui.registerWidget('spoiler',ips.ui.spoiler);return{respond:respond}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.createModule('ips.ui.stack',function(){var defaults={sortable:true,itemTemplate:'core.forms.stack'};var respond=function(elem,options){if(!$(elem).data('_stack')){$(elem).data('_stack',stackObj(elem,_.defaults(options,defaults)));}};ips.ui.registerWidget('stack',ips.ui.stack,['sortable','maxItems','itemTemplate']);return{respond:respond};});var stackObj=function(elem,options){var stack=null;var currentIndex=0;var init=function(){if(!elem.attr('data-initiated')){stack=elem.find('[data-role="stack"]');currentIndex=_getItemCount();elem.on('click','[data-action="stackAdd"]',_addItem);elem.on('click','[data-action="stackDelete"]',_deleteItem);elem.on('keydown','[data-role="stackItem"] input[type="text"]',_keyDown);if(options.sortable){ips.loader.get(['core/interface/jquery/jquery-ui.js']).then(function(){stack.sortable({handle:'[data-action="stackDrag"]'});});} elem.attr('data-initiated','true');$(elem).trigger('stackInitialized',{count:_getItemCount()});}},_keyDown=function(e){if(e.keyCode==ips.ui.key.ENTER){e.preventDefault();_addItem(null,$(e.currentTarget).closest('[data-role="stackItem"]'));}},_addItem=function(e,after){if(e){e.preventDefault();} if(options.maxItems&&_getItemCount()>=options.maxItems){return;} currentIndex++;var field=stack.find('[data-ipsStack-wrapper]').first().html().replace(/(name=['"][a-zA-Z0-9\-_]+?)\[([^\]]+?)?\]/g,'$1['+currentIndex+']').replace(/data-ipsFormData=['"](.+?)['"]/ig,'').replace(/id=['"](.+?)['"]/g,'id="$1_'+currentIndex+'"').replace(/data-toggles=['"](.+?)['"]/g,function(match,p1){var pieces=p1.split(',');var newPieces=[];_.each(pieces,function(val){if(val.match(/_[0-9]+$/g)){newPieces.push(val+'_'+currentIndex);}else{newPieces.push(val);}});return'data-toggles="'+newPieces.join(',')+'"';});field=field.replace(/\/g,'');if(stack.find('select').length){field=field.replace(/\/g,'');} var html=ips.templates.render(options.itemTemplate,{field:field});if(after){after.after(html).next('[data-role="stackItem"]').find('input,textarea').focus();}else{stack.append(html).find('[data-role="stackItem"] input,[data-role="stackItem"] textarea').last().focus();} if(options.maxItems&&_getItemCount()>=options.maxItems){elem.find('[data-action="stackAdd"]').hide();} $(document).trigger('contentChange',[elem]);$(elem).trigger('stackRowAdded',{count:_getItemCount()});},_deleteItem=function(e){e.preventDefault();var row=$(e.currentTarget).closest('[data-role="stackItem"]');if(_getItemCount()===1){row.find('input,textarea').val('');row.find("option:selected").removeAttr("selected");return;} ips.utils.anim.go('fadeOutDown',row).done(function(){row.hide();setTimeout(function(){row.remove();if(options.maxItems&&_getItemCount()