From 7e7d2f99a4fc7407e2eea3f91ebd8380b180a8f9 Mon Sep 17 00:00:00 2001 From: WoltLab Date: Fri, 24 Nov 2023 14:00:17 +0000 Subject: [PATCH] Updating minified JavaScript files --- wcfsetup/install/files/js/WCF.Combined.min.js | 2 +- wcfsetup/install/files/js/WCF.Combined.tiny.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Combined.min.js b/wcfsetup/install/files/js/WCF.Combined.min.js index 89c678d691..aefd0145fb 100755 --- a/wcfsetup/install/files/js/WCF.Combined.min.js +++ b/wcfsetup/install/files/js/WCF.Combined.min.js @@ -34,7 +34,7 @@ (function (window, undefined) { "use strict";WCF.Comment={},WCF.Comment.Handler=Class.extend({_commentButtonList:{},_comments:{},_container:null,_containerID:"",_displayedComments:0,_loadNextComments:null,_loadNextResponses:{},_proxy:null,_responses:{},_responseCache:{},_commentData:{},_guestDialog:null,_permalinkComment:null,_permalinkResponse:null,_scrollTarget:null,init:function(e){var t,n;this._commentButtonList={},this._comments={},this._containerID=e,this._displayedComments=0,this._loadNextComments=null,this._loadNextResponses={},this._permalinkComment=null,this._permalinkResponse=null,this._responseAdd=null,this._responseCache={},this._responseRevert=null,this._responses={},this._scrollTarget=null,this._onResponsesLoaded=null,this._container=$("#"+$.wcfEscapeID(this._containerID)),this._container.length?(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initComments(),this._initResponses(),this._container.data("canAdd")&&(null===elBySel(".commentListAddComment .wysiwygTextarea",this._container[0])?console.error("Missing WYSIWYG implementation, adding comments is not available."):require(["WoltLabSuite/Core/Ui/Comment/Add","WoltLabSuite/Core/Ui/Comment/Response/Add"],function(e,t){new e(elBySel(".jsCommentAdd",this._container[0])),this._responseAdd=new t(elBySel(".jsCommentResponseAdd",this._container[0]),{callbackInsert:function(){null!==this._responseRevert&&(this._responseRevert(),this._responseRevert=null)}.bind(this)})}.bind(this))),require(["WoltLabSuite/Core/Ui/Comment/Edit","WoltLabSuite/Core/Ui/Comment/Response/Edit"],function(e,t){new e(this._container[0]),new t(this._container[0])}.bind(this)),WCF.DOMNodeInsertedHandler.execute(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Comment.Handler",$.proxy(this._domNodeInserted,this)),WCF.System.ObjectStore.add("WCF.Comment.Handler",this),window.addEventListener("hashchange",(function(){var e,t=window.location.hash;t&&t.match(/.+\/(comment\d+)/)&&(e=RegExp.$1,window.setTimeout((function(){var t=elById(e);t&&t.scrollIntoView({behavior:"smooth"})}),100))})),window.location.hash.match(/^#(?:[^\/]+\/)?comment(\d+)(?:\/response(\d+))?/)&&((t=elById("comment"+RegExp.$1))?RegExp.$2?(n=elById("comment"+RegExp.$1+"response"+RegExp.$2))?this._scrollTo(n,!0):this._loadResponseSegment(t,RegExp.$1,RegExp.$2):this._scrollTo(t,!0):this._loadCommentSegment(RegExp.$1,RegExp.$2))):console.debug("[WCF.Comment.Handler] Unable to find container identified by '"+this._containerID+"'")},_scrollTo:function(e,t){null===this._scrollTarget&&(this._scrollTarget=elCreate("span"),this._scrollTarget.className="commentScrollTarget",document.body.appendChild(this._scrollTarget)),this._scrollTarget.style.setProperty("top",e.getBoundingClientRect().top+window.pageYOffset-49+"px",""),require(["Ui/Scroll"],function(n){n.element(this._scrollTarget,(function(){t&&(e.classList.contains("commentHighlightTarget")&&(e.classList.remove("commentHighlightTarget"),e.offsetTop),e.classList.add("commentHighlightTarget"))}))}.bind(this))},_loadCommentSegment:function(e,t){this._permalinkComment=elCreate("li"),this._permalinkComment.className="commentPermalinkContainer loading",this._permalinkComment.innerHTML='',this._container[0].insertBefore(this._permalinkComment,this._container[0].firstChild),this._proxy.setOption("data",{actionName:"loadComment",className:"wcf\\data\\comment\\CommentAction",objectIDs:[e],parameters:{data:{objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID"),responseID:~~t}}}),this._proxy.sendRequest()},_loadResponseSegment:function(e,t,n){this._permalinkResponse=elCreate("li"),this._permalinkResponse.className="commentResponsePermalinkContainer loading",this._permalinkResponse.innerHTML='';var s=elBySel(".commentResponseList",e);s.insertBefore(this._permalinkResponse,s.firstChild),this._proxy.setOption("data",{actionName:"loadResponse",className:"wcf\\data\\comment\\CommentAction",objectIDs:[t],parameters:{data:{objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID"),responseID:~~n}}}),this._proxy.sendRequest()},_handleLoadNextComments:function(){this._displayedComments").appendTo(this._container),this._loadNextComments.children("button").click($.proxy(this._loadComments,this))),this._loadNextComments.children("button").enable()):null!==this._loadNextComments&&this._loadNextComments.remove()},_handleLoadNextResponses:function(e){var t,n=this._comments[e];n.data("displayedResponses",n.find("ul.commentResponseList > li").length),n.data("displayedResponses")'+WCF.Language.get("wcf.comment.response.more",{count:t})+"").appendTo(this._commentButtonList[e]),this._loadNextResponses[e].children("a").data("commentID",e).click($.proxy(this._loadResponses,this)),this._commentButtonList[e].parent().show()):(t=n.data("responses")-n.data("displayedResponses"),this._loadNextResponses[e][0].querySelector("a").textContent=WCF.Language.get(WCF.Language.get("wcf.comment.response.more",{count:t}))):void 0!==this._loadNextResponses[e]&&this._loadNextResponses[e].remove()},_loadComments:function(){this._loadNextComments.children("button").disable(),this._proxy.setOption("data",{actionName:"loadComments",className:"wcf\\data\\comment\\CommentAction",parameters:{data:{objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID"),lastCommentTime:this._container.data("lastCommentTime")}}}),this._proxy.sendRequest()},_loadResponses:function(e){this._loadResponsesExecute($(e.currentTarget).disable().data("commentID"),!1)},_loadResponsesExecute:function(e,t){this._proxy.setOption("data",{actionName:"loadResponses",className:"wcf\\data\\comment\\response\\CommentResponseAction",parameters:{data:{commentID:e,lastResponseTime:this._comments[e].data("lastResponseTime"),loadAllResponses:t?1:0}}}),this._proxy.sendRequest()},_domNodeInserted:function(){this._initComments(),this._initResponses()},_initComments:function(){var e,t,n,s=elBySel('link[rel="canonical"]');s=s?s.href:window.location.toString().replace(/#.+$/,""),(e=this._container[0].closest(".tabMenuContent"))&&(s+="#"+elData(e,"name")),t=this,n=!1,this._container.find(".jsComment").each((function(e,o){var i,a,l=$(o).removeClass("jsComment"),m=l.data("commentID");t._comments[m]=l,l[0].id="comment"+m,(i=l.find("ul.commentResponseList")).length||(i=l.find(".commentContent")),a=$('
').hide().insertAfter(i),t._commentButtonList[m]=$('
    ').appendTo(a),t._handleLoadNextResponses(m),t._initComment(m,l),t._initPermalink(l[0],s),t._displayedComments++,n=!0})),n&&this._handleLoadNextComments()},_initComment:function(e,t){var n;this._container.data("canAdd")&&this._initAddResponse(e,t),t.data("canEdit")&&$('
  • ").appendTo(t.find("ul.buttonList:eq(0)")),t.data("canDelete")&&$('
  • ").data("commentID",e).appendTo(t.find("ul.buttonList:eq(0)")).click($.proxy(this._delete,this)),(n=elBySel(".jsEnableComment",t[0]))&&n.addEventListener("click",this._enableComment.bind(this))},_enableComment:function(e){e.preventDefault();var t=e.currentTarget.closest(".comment");this._proxy.setOption("data",{actionName:"enable",className:"wcf\\data\\comment\\CommentAction",objectIDs:[elData(t,"object-id")]}),this._proxy.sendRequest()},_initPermalink:function(e,t){var n,s=elCreate("a");s.href=t+(-1===t.indexOf("#")?"#":"/")+"comment"+elData(e,"object-id"),(n=elBySel(".commentContent:not(.commentResponseContent) .containerHeadline time",e)).parentNode.insertBefore(s,n),s.appendChild(n)},_initResponses:function(){var e,t,n=elBySel('link[rel="canonical"]');for(t in n=n?n.href:window.location.toString().replace(/#.+$/,""),(e=this._container[0].closest(".tabMenuContent"))&&(n+="#"+elData(e,"name")),this._comments)this._comments.hasOwnProperty(t)&&elBySelAll(".jsCommentResponse",this._comments[t][0],function(e){var s,o=$(e).removeClass("jsCommentResponse"),i=o.data("responseID");this._responses[i]=o,e.id="comment"+t+"response"+i,this._initResponse(i,o),this._initPermalinkResponse(t,e,i,n),(s=elBySel(".jsEnableResponse",e))&&s.addEventListener("click",this._enableCommentResponse.bind(this))}.bind(this))},_enableCommentResponse:function(e){e.preventDefault();var t=e.currentTarget.closest(".commentResponse");this._proxy.setOption("data",{actionName:"enableResponse",className:"wcf\\data\\comment\\CommentAction",parameters:{data:{responseID:elData(t,"object-id")}}}),this._proxy.sendRequest()},_initPermalinkResponse:function(e,t,n,s){var o,i=elCreate("a");i.href=s+(-1===s.indexOf("#")?"#":"/")+"comment"+e+"/response"+n,(o=elBySel(".commentResponseContent .containerHeadline time",t)).parentNode.insertBefore(i,o),i.appendChild(o)},_initResponse:function(e,t){var n,s;t.data("canEdit")&&$('
  • ").data("responseID",e).appendTo(t.find("ul.buttonList:eq(0)")),t.data("canDelete")&&(n=$('
  • "),s=this,n.data("responseID",e).appendTo(t.find("ul.buttonList:eq(0)")).click((function(e){s._delete(e,!0)})))},_initAddResponse:function(e,t){$('
  • '+WCF.Language.get("wcf.comment.button.response.add")+"
  • ").data("commentID",e).click($.proxy(this._showAddResponse,this)).appendTo(this._commentButtonList[e]);this._commentButtonList[e].parent().show()},_showAddResponse:function(e){var t,n,s;e.preventDefault(),null===this._onResponsesLoaded&&(null!==this._responseAdd?null!==(t=this._responseAdd.getContainer())&&(null!==this._responseRevert&&(this._responseRevert(),this._responseRevert=null),n=$(e.currentTarget),s=n.data("commentID"),this._onResponsesLoaded=function(){n.hide(),t.parentNode&&t.parentNode.classList.contains("jsCommentResponseAddContainer")&&elRemove(t.parentNode);var e=this._commentButtonList[s][0].closest(".commentOptionContainer");e.parentNode.insertBefore(t,e.nextSibling),"string"==typeof this._responseCache[s]?this._responseAdd.setContent(this._responseCache[s]):this._responseAdd.setContent(""),this._responseRevert=function(){this._responseCache[s]=this._responseAdd.getContent(),elRemove(t),n.show()}.bind(this),this._onResponsesLoaded=null}.bind(this),n.prev().hasClass("jsCommentLoadNextResponses")?(this._loadResponsesExecute(s,!0),n.parent().children(".button").disable()):this._onResponsesLoaded()):console.error("Missing response API."))},_delete:function(e,t){e.preventDefault(),WCF.System.Confirmation.show(WCF.Language.get("wcf.comment.delete.confirmMessage"),$.proxy((function(n){if("confirm"===n){var s={objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};!0!==t?s.commentID=$(e.currentTarget).data("commentID"):s.responseID=$(e.currentTarget).data("responseID"),this._proxy.setOption("data",{actionName:"remove",className:"wcf\\data\\comment\\CommentAction",parameters:{data:s}}),this._proxy.sendRequest()}}),this))},_success:function(e,t,n){switch(e.actionName){case"enable":this._enable(e);break;case"enableResponse":this._enableResponse(e);break;case"loadComment":this._insertComment(e);break;case"loadComments":this._insertComments(e);break;case"loadResponse":this._insertResponse(e);break;case"loadResponses":this._insertResponses(e);break;case"remove":this._remove(e)}WCF.DOMNodeInsertedHandler.execute()},_enable:function(e){var t,n,s;e.returnValues.commentID&&(t=elBySel('.comment[data-object-id="'+e.returnValues.commentID+'"]',this._container[0]))&&(elData(t,"is-disabled",0),(n=elBySel(".jsIconDisabled",t))&&elRemove(n),(s=elBySel(".jsEnableComment",t))&&elRemove(s.parentNode))},_enableResponse:function(e){var t,n,s;e.returnValues.responseID&&(t=elBySel('.commentResponse[data-object-id="'+e.returnValues.responseID+'"]',this._container[0]))&&(elData(t,"is-disabled",0),(n=elBySel(".jsIconDisabled",t))&&elRemove(n),(s=elBySel(".jsEnableResponse",t))&&elRemove(s.parentNode))},_insertComment:function(e){var t,n;""!==e.returnValues.template?($(e.returnValues.template).insertBefore(this._permalinkComment),(t=this._permalinkComment.previousElementSibling).classList.add("commentPermalinkContainer"),elRemove(this._permalinkComment),this._permalinkComment=t,e.returnValues.response?(this._permalinkResponse=elCreate("li"),this._permalinkResponse.className="commentResponsePermalinkContainer loading",this._permalinkResponse.innerHTML='',(n=elBySel(".commentResponseList",t)).insertBefore(this._permalinkResponse,n.firstChild),this._insertResponse({returnValues:{template:e.returnValues.response}})):this._scrollTo(t,!0)):elRemove(this._permalinkComment)},_insertResponse:function(e){if(""!==e.returnValues.template){$(e.returnValues.template).insertBefore(this._permalinkResponse);var t=this._permalinkResponse.previousElementSibling;t.classList.add("commentResponsePermalinkContainer"),elRemove(this._permalinkResponse),this._permalinkResponse=t,this._scrollTo(t,!0)}else elRemove(this._permalinkResponse)},_insertComments:function(e){if($(e.returnValues.template).insertBefore(this._loadNextComments),this._container.data("lastCommentTime",e.returnValues.lastCommentTime),this._permalinkComment){var t=elData(this._permalinkComment,"object-id");null!==elBySel('.comment[data-object-id="'+t+'"]:not(.commentPermalinkContainer)',this._container[0])&&(elRemove(this._permalinkComment),this._permalinkComment=null)}this._initComments()},_insertResponses:function(e){var t,n=this._comments[e.returnValues.commentID];$(e.returnValues.template).appendTo(n.find("ul.commentResponseList")),n.data("lastResponseTime",e.returnValues.lastResponseTime),this._handleLoadNextResponses(e.returnValues.commentID),this._permalinkResponse&&(t=elData(this._permalinkResponse,"object-id"),null!==elBySel('.commentResponse[data-object-id="'+t+'"]:not(.commentPermalinkContainer)',this._container[0])&&(elRemove(this._permalinkResponse),this._permalinkResponse=null)),null!==this._onResponsesLoaded&&this._onResponsesLoaded()},_remove:function(e){var t,n,s;e.returnValues.commentID?(this._comments[e.returnValues.commentID].remove(),delete this._comments[e.returnValues.commentID]):(t=this._responses[e.returnValues.responseID],(n=this._comments[t.parents("li.comment:eq(0)").data("commentID")]).data("responses",parseInt(n.data("responses"))-1),s=t.parent(),t.remove(),s.children().length||s.empty(),delete this._responses[e.returnValues.responseID])},_prepareEdit:function(){console.warn("This method is no longer supported.")},_keyUp:function(){console.warn("This method is no longer supported.")},_save:function(){console.warn("This method is no longer supported.")},_failure:function(){console.warn("This method is no longer supported.")},_edit:function(){console.warn("This method is no longer supported.")},_update:function(){console.warn("This method is no longer supported.")},_createGuestDialog:function(){console.warn("This method is no longer supported.")},_keyDown:function(){console.warn("This method is no longer supported.")},_submit:function(){console.warn("This method is no longer supported.")},_keyUpEdit:function(){console.warn("This method is no longer supported.")},_saveEdit:function(){console.warn("This method is no longer supported.")},_cancelEdit:function(){console.warn("This method is no longer supported.")}}),WCF.Comment.Response={}; })(this); // WCF.ImageViewer.js -(function (window, undefined) { "use strict";WCF.ImageViewer=Class.extend({_triggerElement:null,init:function(){this._triggerElement=$('').data("disableSlideshow",!0).hide().appendTo(document.body),this._triggerElement.wcfImageViewer({enableSlideshow:0,imageSelector:".jsImageViewerEnabled",staticViewer:!0}),WCF.DOMNodeInsertedHandler.addCallback("WCF.ImageViewer",$.proxy(this._domNodeInserted,this)),WCF.DOMNodeInsertedHandler.execute()},_domNodeInserted:function(){this._initImageSizeCheck(),this._rebuildImageViewer()},_rebuildImageViewer:function(){var i=$("a.jsImageViewer");i.length&&i.removeClass("jsImageViewer").addClass("jsImageViewerEnabled").click($.proxy(this._click,this))},_click:function(i){i.ctrlKey||(i.preventDefault(),i.stopPropagation(),$(i.currentTarget).closest(".popover").length||this._triggerElement.wcfImageViewer("open",null,$(i.currentTarget).wcfIdentify()))},_initImageSizeCheck:function(){$(".jsResizeImage").each($.proxy((function(i,e){e.complete&&this._checkImageSize({currentTarget:e})}),this)),$(".jsResizeImage").on("load",$.proxy(this._checkImageSize,this))},_checkImageSize:function(i){var e,t=$(i.currentTarget);t.is(":visible")?(t.removeClass("jsResizeImage"),t.closest(".messageSignature").length||((e=new Image).src=t.attr("src"),t.closest("div.messageText, div.messageTextPreview").width()'),t.parent().click($.proxy(this._click,this)),"right"==t.css("float")?t.parent().addClass("messageFloatObjectRight"):"left"==t.css("float")&&t.parent().addClass("messageFloatObjectLeft"),t[0].style.removeProperty("float"),t[0].style.removeProperty("margin")):t.removeClass("embeddedAttachmentLink"))):t.off("load")}}),$.widget("ui.wcfImageViewer",{_active:-1,_activeImage:null,_container:null,_didInit:!1,_disableSlideshow:!1,_eventNamespace:"",_images:[],_isMobile:!1,_isOpen:!1,_messageSignature:null,_items:-1,_maxDimensions:{height:0,width:0},_proxy:null,_slideshowEnabled:!1,_thumbnailContainerWidth:0,_thumbnailMarginRight:0,_thumbnailOffset:0,_thumbnailWidth:0,_timer:null,_ui:{buttonNext:null,buttonPrevious:null,header:null,image:null,imageContainer:null,imageList:null,slideshow:{container:null,enlarge:null,next:null,previous:null,toggle:null}},options:{shiftBy:5,enableSlideshow:1,speed:5,className:"",imageSelector:"",staticViewer:!1},_create:function(){this._active=-1,this._activeImage=null,this._container=null,this._didInit=!1,this._disableSlideshow=this.element.data("disableSlideshow"),this._eventNamespace=this.element.wcfIdentify(),this._images=[],this._isMobile=!1,this._isOpen=!1,this._items=-1,this._maxDimensions={height:document.documentElement.clientHeight,width:document.documentElement.clientWidth},this._messageSignature=null,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._slideshowEnabled=!1,this._thumbnailContainerWidth=0,this._thumbnailMarginRight=0,this._thumbnailOffset=0,this._thumbnaiLWidth=0,this._timer=null,this._ui={},this.element.click($.proxy(this.open,this)),window.addEventListener("popstate",function(i){if(null!=i.state&&"imageViewer"===i.state.name&&i.state.container===this._eventNamespace)return this.open(i),void this.showImage(i.state.image);this.close(i)}.bind(this))},open:function(i,e){if(i&&i.preventDefault(),this._isOpen)return!1;if(i&&"popstate"===i.type||window.history.pushState({name:"imageViewer"},"",""),this._messageSignature=null,this.options.staticViewer){e&&(this._messageSignature=document.getElementById(e).closest(".messageSignature")),this._active=-1,null!==this._activeImage&&this._ui.images[this._activeImage].removeClass("active"),this._activeImage=null;var t=this._getStaticImages();this._initUI(),this._createThumbnails(t,!0),this._render(!0,void 0,e),this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable(),$.browser.touch&&setTimeout($.proxy((function(){this._isMobile&&!this._container.hasClass("maximized")&&this._toggleView()}),this),500)}else 0===this._images.length?this._loadNextImages(!0):(this._render(!1,this.element.data("targetImageID")),this._items>1&&this._slideshowEnabled&&this.startSlideshow(),this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable());return this._bindListener(),require(["Ui/Screen"],(function(i){i.pageOverlayOpen()})),!0},close:function(i){if(i&&i.preventDefault(),i&&"popstate"===i.type)return!!this._isOpen&&(this._container.removeClass("open"),null!==this._timer&&this._timer.stop(),this._unbindListener(),this._isOpen=!1,WCF.System.DisableScrolling.enable(),WCF.System.DisableZoom.enable(),require(["Ui/Screen"],(function(i){i.pageOverlayClose()})),!0);window.history.back()},startSlideshow:function(){return!this._disableSlideshow&&!this._slideshowEnabled&&(null===this._timer?this._timer=new WCF.PeriodicalExecuter($.proxy((function(){var i=this._active+1;i==this._items&&(i=0),this.showImage(i)}),this),1e3*this.options.speed):this._timer.resume(),this._slideshowEnabled=!0,this._ui.slideshow.toggle.children("span").removeClass("fa-play").addClass("fa-pause"),!0)},stopSlideshow:function(i){return!!this._slideshowEnabled&&(this._timer.stop(),i&&this._ui.slideshow.toggle.children("span").removeClass("fa-pause").addClass("fa-play"),this._slideshowEnabled=!1,!0)},_bindListener:function(){$(document).on("keydown."+this._eventNamespace,$.proxy(this._keyDown,this)),$(window).on("resize."+this._eventNamespace,(()=>{window.setTimeout((()=>this._renderImage()),0)}))},_unbindListener:function(){$(document).off("keydown."+this._eventNamespace),$(window).off("resize."+this._eventNamespace)},_keyDown:function(i){switch(i.which){case $.ui.keyCode.ESCAPE:this.close();break;case $.ui.keyCode.LEFT:this._previousImage();break;case $.ui.keyCode.RIGHT:this._nextImage();break;case $.ui.keyCode.UP:this._container.hasClass("maximized")||this._toggleView();break;case $.ui.keyCode.DOWN:this._container.hasClass("maximized")&&this._toggleView();break;case $.ui.keyCode.ENTER:var e=this._ui.header.find("h1 > a");1==e.length?window.location=e.prop("href"):this._ui.slideshow.full.trigger("click");break;case 80:this._ui.slideshow.toggle.trigger("click");break;default:return!0}return!1},_render:function(i,e,t){var s,a,n,h,o;this._container.addClass("open"),s=null,i&&(s=this._ui.imageList.children("li:eq(0)"),this._thumbnailMarginRight=parseInt(s.css("marginRight").replace(/px$/,""))||0,this._thumbnailWidth=s.outerWidth(!0),this._thumbnailContainerWidth=this._ui.imageList.parent().innerWidth(),this._items>1&&this.options.enableSlideshow&&!e&&!t&&this.startSlideshow()),e?this._ui.imageList.children("li").each($.proxy((function(i,t){var s=$(t);if(s.data("objectID")==e)return s.trigger("click"),this.moveToImage(s.data("index")),!1}),this)):t?(a=[],$(this.options.imageSelector).each(function(i,e){e.closest(".messageSignature")===this._messageSignature&&a.push(e)}.bind(this)),n=0,a.forEach((function(i,e){i.id===t&&(n=e)})),h=this._ui.imageList.children("li:eq("+n+")"),-1!==this._active&&(o=!1,this._active!=h.data("index")&&(o=!0),this._ui.images[this._activeImage].prop("src")!=this._images[this._active].image.url&&(o=!0),o&&(this._active=-1)),h.trigger("click"),this.moveToImage(h.data("index"))):null!==s&&s.trigger("click"),this._toggleButtons(),this._preload()},_preload:function(){this._images.length div > a").prop("href",t.user.link).prop("title",t.user.username).children("img").prop("src",t.user.avatarURL),h=WCF.String.escapeHTML(t.image.title),t.image.link&&(h=''+h+""),this._ui.header.find("h1").html(h),this.options.staticViewer||(o=t.series&&t.series.title?WCF.String.escapeHTML(t.series.title):"",t.series.link&&(o=''+o+""),this._ui.header.find("h2").html(o)),this._ui.header.find("h3").text(WCF.Language.get("wcf.imageViewer.seriesIndex").replace(/{x}/,t.listItem.data("index")+1).replace(/{y}/,this._items)),this._ui.slideshow.full.data("link",t.image.fullURL?t.image.fullURL:t.image.url),this.moveToImage(t.listItem.data("index")),this._toggleButtons(),!0)},_imageOnLoad:function(i,e){i==this._active&&(this._ui.imageContainer.removeClass("loading"),this._ui.images[e].addClass("active"),this.options.staticViewer&&this._renderImage(e,null),this.startSlideshow())},_renderImage:function(i,e,t){var s,a,n,h,o,l,r=!0;e||(i=this._activeImage,e=this._images[this._active],t={height:$(window).height()-(this._container.hasClass("maximized")||this._container.hasClass("wcfImageViewerMobile")?0:200),width:this._ui.imageContainer.innerWidth()},r=!1),t.height-=22,t.width-=20,(s=this._ui.images[i]).prop("src")!==e.image.url&&s.prop("src",e.image.url),r&&s[0].complete&&s.trigger("load"),this.options.staticViewer&&!e.image.height&&s[0].complete&&($.browser.mozilla||$.browser.safari?((a=new Image).src=e.image.url,e.image.height=a.height||s[0].naturalHeight,e.image.width=a.width||s[0].naturalWidth):(s.css({height:"auto",width:"auto"}),e.image.height=s[0].height,e.image.width=s[0].width)),n=e.image.height,h=e.image.width,o=0,n>t.height&&(o=t.height/n,n=t.height,h=Math.floor(h*o)),h>t.width&&(o=t.width/h,h=t.width,n=Math.floor(n*o)),l=Math.floor((t.width-h)/2),this._ui.images[i].css({height:n+"px",left:l+10+"px",marginTop:-1*Math.round(n/2)+"px",width:h+"px"})},_initUI:function(){var i,e,t,s,a,n,h,o;return!this._didInit&&(this._didInit=!0,this._container=$('
    ').appendTo(document.body),i=$("
    ").appendTo(this._container),e=$('
      ').appendTo(this._container),t=$("
        ").appendTo(i),s=$('
      • ').appendTo(t),a=$('
      • ').appendTo(t),n=$('
      • ').appendTo(t),h=$('
      • ').appendTo(t),o=$('
      • ').appendTo(t),this._ui={buttonNext:e.children("span.wcfImageViewerButtonNext"),buttonPrevious:e.children("span.wcfImageViewerButtonPrevious"),header:$("
        ":' class="box64">')+"

      ").appendTo(this._container),imageContainer:i,images:[i.children("img:eq(0)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",(function(){$(this).removeClass("animateTransformation")})),i.children("img:eq(1)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",(function(){$(this).removeClass("animateTransformation")}))],imageList:e.find("> div > ul"),slideshow:{container:t,enlarge:h,full:o,next:n,previous:s,toggle:a}},this._ui.buttonNext.click($.proxy(this._next,this)),this._ui.buttonPrevious.click($.proxy(this._previous,this)),n.click($.proxy(this._nextImage,this)),s.click($.proxy(this._previousImage,this)),h.click($.proxy(this._toggleView,this)),a.click($.proxy((function(){this._items<2||(this._slideshowEnabled?this.stopSlideshow(!0):(this._disableSlideshow=!1,this.startSlideshow()))}),this)),o.click((function(i){window.location=$(i.currentTarget).data("link")})),$('').appendTo(this._ui.header).click($.proxy(this.close,this)),$.browser.mobile||i.click(function(e){e.target===i[0]&&this.close()}.bind(this)),WCF.DOMNodeInsertedHandler.execute(),require(["Ui/Screen"],function(i){i.on("screen-sm-down",{match:$.proxy(this._enableMobileView,this),unmatch:$.proxy(this._disableMobileView,this)})}.bind(this)),!0)},_enableMobileView:function(){this._container.addClass("wcfImageViewerMobile");var i=this;this._ui.imageContainer.swipe({swipeLeft:function(e){i._container.hasClass("maximized")&&i._nextImage(e)},swipeRight:function(e){i._container.hasClass("maximized")&&i._previousImage(e)},tap:function(e,t){switch(t.tagName){case"DIV":case"IMG":i._toggleView()}}}),this._isMobile=!0},_disableMobileView:function(){this._container.removeClass("wcfImageViewerMobile"),this._ui.imageContainer.swipe("destroy"),this._isMobile=!1},_toggleView:function(){this._ui.images[this._activeImage].addClass("animateTransformation"),this._container.toggleClass("maximized"),this._ui.slideshow.enlarge.toggleClass("active").children("span").toggleClass("fa-expand").toggleClass("fa-compress"),this._renderImage(null,void 0,null)},_next:function(i,e){if(this._ui.buttonNext.hasClass("pointer")){null==e&&this.stopSlideshow(!0);var t=Math.max(this._items*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight,0);this._thumbnailOffset=Math.min(this._thumbnailOffset+this._thumbnailWidth*(e||this.options.shiftBy),t),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)}this._preload(),this._toggleButtons()},_previous:function(i,e){this._ui.buttonPrevious.hasClass("pointer")&&(null==e&&this.stopSlideshow(!0),this._thumbnailOffset=Math.max(this._thumbnailOffset-this._thumbnailWidth*(e||this.options.shiftBy),0),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)),this._toggleButtons()},_nextImage:function(i){this._ui.slideshow.next.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active+1),i&&(i.preventDefault(),i.stopPropagation()))},_previousImage:function(i){this._ui.slideshow.previous.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active-1),i&&(i.preventDefault(),i.stopPropagation()))},moveToImage:function(i){var e,t=(i-3)*this._thumbnailWidth,s=t+5*this._thumbnailWidth,a=this._thumbnailOffset,n=this._thumbnailOffset+this._thumbnailContainerWidth,h=!1;if((tn)&&(h=!0),h)if(e=0,tn;)e++,n+=this._thumbnailWidth;this._next(null,e)}},_toggleButtons:function(){this._thumbnailOffset>0?this._ui.buttonPrevious.addClass("pointer"):this._ui.buttonPrevious.removeClass("pointer");var i=this._images.length*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight;this._thumbnailOffset>=i?this._ui.buttonNext.removeClass("pointer"):this._ui.buttonNext.addClass("pointer"),this._active>0?this._ui.slideshow.previous.addClass("pointer"):this._ui.slideshow.previous.removeClass("pointer"),this._active+1').appendTo(this._ui.imageList)).data("index",this._images.length).data("objectID",s.objectID).click($.proxy(this._showImage,this)),(n=a.children("img")).get(0).complete?(a.removeClass("loading"),this.options.staticViewer&&this._fixThumbnailDimensions(n)):(h=this,n.on("load",(function(){var i=$(this);i.parent().removeClass("loading"),h.options.staticViewer&&h._fixThumbnailDimensions(i)}))),s.listItem=a,this._images.push(s)},_fixThumbnailDimensions:function(i){var e,t,s,a=new Image;a.src=i.prop("src"),(e=a.height)==(t=a.width)?e=t=80:e img, .attachmentThumbnailImage > img").first()).length||(a=s.parentsUntil(".formAttachmentList").last().find(".attachmentTinyThumbnail")),i.push({image:{fullURL:a.data("source")?a.data("source").replace(/\\\//g,"/"):s.prop("href"),link:"",title:s.prop("title"),url:s.prop("href")},series:null,thumbnail:{url:a.prop("src")},user:null}))}.bind(this)),this._items=i.length,i},_success:function(i,e,t){var s,a;i.returnValues.items&&(this._items=i.returnValues.items),s=this._initUI(),this._createThumbnails(i.returnValues.images),a=i.returnValues.targetImageID?i.returnValues.targetImageID:0,this._render(s,a),this._isOpen||(this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable())}}); })(this); +(function (window, undefined) { "use strict";WCF.ImageViewer=Class.extend({_triggerElement:null,init:function(){this._triggerElement=$('').data("disableSlideshow",!0).hide().appendTo(document.body),this._triggerElement.wcfImageViewer({enableSlideshow:0,imageSelector:".jsImageViewerEnabled",staticViewer:!0}),WCF.DOMNodeInsertedHandler.addCallback("WCF.ImageViewer",$.proxy(this._domNodeInserted,this)),WCF.DOMNodeInsertedHandler.execute()},_domNodeInserted:function(){this._initImageSizeCheck(),this._rebuildImageViewer()},_rebuildImageViewer:function(){var i=$("a.jsImageViewer");i.length&&i.removeClass("jsImageViewer").addClass("jsImageViewerEnabled").click($.proxy(this._click,this))},_click:function(i){i.ctrlKey||(i.preventDefault(),i.stopPropagation(),$(i.currentTarget).closest(".popover").length||this._triggerElement.wcfImageViewer("open",null,$(i.currentTarget).wcfIdentify()))},_initImageSizeCheck:function(){$(".jsResizeImage").each($.proxy((function(i,e){e.complete&&this._checkImageSize({currentTarget:e})}),this)),$(".jsResizeImage").on("load",$.proxy(this._checkImageSize,this))},_checkImageSize:function(i){var e,t=$(i.currentTarget);t.is(":visible")?(t.removeClass("jsResizeImage"),t.closest(".messageSignature").length||((e=new Image).src=t.attr("src"),t.closest("div.messageText, div.messageTextPreview").width()'),t.parent().click($.proxy(this._click,this)),"right"==t.css("float")?t.parent().addClass("messageFloatObjectRight"):"left"==t.css("float")&&t.parent().addClass("messageFloatObjectLeft"),t[0].style.removeProperty("float"),t[0].style.removeProperty("margin")):t.removeClass("embeddedAttachmentLink"))):t.off("load")}}),$.widget("ui.wcfImageViewer",{_active:-1,_activeImage:null,_container:null,_didInit:!1,_disableSlideshow:!1,_eventNamespace:"",_images:[],_isMobile:!1,_isOpen:!1,_messageSignature:null,_items:-1,_maxDimensions:{height:0,width:0},_proxy:null,_slideshowEnabled:!1,_thumbnailContainerWidth:0,_thumbnailMarginRight:0,_thumbnailOffset:0,_thumbnailWidth:0,_timer:null,_ui:{buttonNext:null,buttonPrevious:null,header:null,image:null,imageContainer:null,imageList:null,slideshow:{container:null,enlarge:null,next:null,previous:null,toggle:null}},options:{shiftBy:5,enableSlideshow:1,speed:5,className:"",imageSelector:"",staticViewer:!1},_create:function(){this._active=-1,this._activeImage=null,this._container=null,this._didInit=!1,this._disableSlideshow=this.element.data("disableSlideshow"),this._eventNamespace=this.element.wcfIdentify(),this._images=[],this._isMobile=!1,this._isOpen=!1,this._items=-1,this._maxDimensions={height:document.documentElement.clientHeight,width:document.documentElement.clientWidth},this._messageSignature=null,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._slideshowEnabled=!1,this._thumbnailContainerWidth=0,this._thumbnailMarginRight=0,this._thumbnailOffset=0,this._thumbnaiLWidth=0,this._timer=null,this._ui={},this.element.click($.proxy(this.open,this)),window.addEventListener("popstate",function(i){if(null!=i.state&&"imageViewer"===i.state.name&&i.state.container===this._eventNamespace)return this.open(i),void this.showImage(i.state.image);this.close(i)}.bind(this))},open:function(i,e){if(i&&i.preventDefault(),this._isOpen)return!1;if(i&&"popstate"===i.type||window.history.pushState({name:"imageViewer"},"",""),this._messageSignature=null,this.options.staticViewer){e&&(this._messageSignature=document.getElementById(e).closest(".messageSignature")),this._active=-1,null!==this._activeImage&&this._ui.images[this._activeImage].removeClass("active"),this._activeImage=null;var t=this._getStaticImages();this._initUI(),this._createThumbnails(t,!0),this._render(!0,void 0,e),this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable(),$.browser.touch&&setTimeout($.proxy((function(){this._isMobile&&!this._container.hasClass("maximized")&&this._toggleView()}),this),500)}else 0===this._images.length?this._loadNextImages(!0):(this._render(!1,this.element.data("targetImageID")),this._items>1&&this._slideshowEnabled&&this.startSlideshow(),this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable());return this._bindListener(),require(["Ui/Screen"],(function(i){i.pageOverlayOpen()})),!0},close:function(i){if(i&&i.preventDefault(),i&&"popstate"===i.type)return!!this._isOpen&&(this._container.removeClass("open"),null!==this._timer&&this._timer.stop(),this._unbindListener(),this._isOpen=!1,WCF.System.DisableScrolling.enable(),WCF.System.DisableZoom.enable(),require(["Ui/Screen"],(function(i){i.pageOverlayClose()})),!0);window.history.back()},startSlideshow:function(){return!this._disableSlideshow&&!this._slideshowEnabled&&(null===this._timer?this._timer=new WCF.PeriodicalExecuter($.proxy((function(){var i=this._active+1;i==this._items&&(i=0),this.showImage(i)}),this),1e3*this.options.speed):this._timer.resume(),this._slideshowEnabled=!0,this._ui.slideshow.toggle.children("span").removeClass("fa-play").addClass("fa-pause"),!0)},stopSlideshow:function(i){return!!this._slideshowEnabled&&(this._timer.stop(),i&&this._ui.slideshow.toggle.children("span").removeClass("fa-pause").addClass("fa-play"),this._slideshowEnabled=!1,!0)},_bindListener:function(){$(document).on("keydown."+this._eventNamespace,$.proxy(this._keyDown,this)),$(window).on("resize."+this._eventNamespace,(()=>{window.setTimeout((()=>this._renderImage()),0)}))},_unbindListener:function(){$(document).off("keydown."+this._eventNamespace),$(window).off("resize."+this._eventNamespace)},_keyDown:function(i){switch(i.which){case $.ui.keyCode.ESCAPE:this.close();break;case $.ui.keyCode.LEFT:this._previousImage();break;case $.ui.keyCode.RIGHT:this._nextImage();break;case $.ui.keyCode.UP:this._container.hasClass("maximized")||this._toggleView();break;case $.ui.keyCode.DOWN:this._container.hasClass("maximized")&&this._toggleView();break;case $.ui.keyCode.ENTER:var e=this._ui.header.find("h1 > a");1==e.length?window.location=e.prop("href"):this._ui.slideshow.full.trigger("click");break;case 80:this._ui.slideshow.toggle.trigger("click");break;default:return!0}return!1},_render:function(i,e,t){var s,a,n,h,o;this._container.addClass("open"),s=null,i&&(s=this._ui.imageList.children("li:eq(0)"),this._thumbnailMarginRight=parseInt(s.css("marginRight").replace(/px$/,""))||0,this._thumbnailWidth=s.outerWidth(!0),this._thumbnailContainerWidth=this._ui.imageList.parent().innerWidth(),this._items>1&&this.options.enableSlideshow&&!e&&!t&&this.startSlideshow()),e?this._ui.imageList.children("li").each($.proxy((function(i,t){var s=$(t);if(s.data("objectID")==e)return s.trigger("click"),this.moveToImage(s.data("index")),!1}),this)):t?(a=[],$(this.options.imageSelector).each(function(i,e){e.closest(".messageSignature")===this._messageSignature&&a.push(e)}.bind(this)),n=0,a.forEach((function(i,e){i.id===t&&(n=e)})),h=this._ui.imageList.children("li:eq("+n+")"),-1!==this._active&&(o=!1,this._active!=h.data("index")&&(o=!0),this._ui.images[this._activeImage].prop("src")!=this._images[this._active].image.url&&(o=!0),o&&(this._active=-1)),h.trigger("click"),this.moveToImage(h.data("index"))):null!==s&&s.trigger("click"),this._toggleButtons(),this._preload()},_preload:function(){this._images.length div > a").prop("href",t.user.link).prop("title",t.user.username).children("img").prop("src",t.user.avatarURL),h=WCF.String.escapeHTML(t.image.title),t.image.link&&(h=''+h+""),this._ui.header.find("h1").html(h),this.options.staticViewer||(o=t.series&&t.series.title?WCF.String.escapeHTML(t.series.title):"",t.series.link&&(o=''+o+""),this._ui.header.find("h2").html(o)),this._ui.header.find("h3").text(WCF.Language.get("wcf.imageViewer.seriesIndex").replace(/{x}/,t.listItem.data("index")+1).replace(/{y}/,this._items)),this._ui.slideshow.full[0].querySelector("a").href=t.image.fullURL?t.image.fullURL:t.image.url,this.moveToImage(t.listItem.data("index")),this._toggleButtons(),!0)},_imageOnLoad:function(i,e){i==this._active&&(this._ui.imageContainer.removeClass("loading"),this._ui.images[e].addClass("active"),this.options.staticViewer&&this._renderImage(e,null),this.startSlideshow())},_renderImage:function(i,e,t){var s,a,n,h,o,l,r=!0;e||(i=this._activeImage,e=this._images[this._active],t={height:$(window).height()-(this._container.hasClass("maximized")||this._container.hasClass("wcfImageViewerMobile")?0:200),width:this._ui.imageContainer.innerWidth()},r=!1),t.height-=22,t.width-=20,(s=this._ui.images[i]).prop("src")!==e.image.url&&s.prop("src",e.image.url),r&&s[0].complete&&s.trigger("load"),this.options.staticViewer&&!e.image.height&&s[0].complete&&($.browser.mozilla||$.browser.safari?((a=new Image).src=e.image.url,e.image.height=a.height||s[0].naturalHeight,e.image.width=a.width||s[0].naturalWidth):(s.css({height:"auto",width:"auto"}),e.image.height=s[0].height,e.image.width=s[0].width)),n=e.image.height,h=e.image.width,o=0,n>t.height&&(o=t.height/n,n=t.height,h=Math.floor(h*o)),h>t.width&&(o=t.width/h,h=t.width,n=Math.floor(n*o)),l=Math.floor((t.width-h)/2),this._ui.images[i].css({height:n+"px",left:l+10+"px",marginTop:-1*Math.round(n/2)+"px",width:h+"px"})},_initUI:function(){var i,e,t,s,a,n,h,o;return!this._didInit&&(this._didInit=!0,this._container=$('
      ').appendTo(document.body),i=$("
      ").appendTo(this._container),e=$('
        ').appendTo(this._container),t=$("
          ").appendTo(i),s=$('
        • ').appendTo(t),a=$('
        • ').appendTo(t),n=$('
        • ').appendTo(t),h=$('
        • ').appendTo(t),o=$('
        • ').appendTo(t),this._ui={buttonNext:e.children("span.wcfImageViewerButtonNext"),buttonPrevious:e.children("span.wcfImageViewerButtonPrevious"),header:$("
          ":' class="box64">')+"

        ").appendTo(this._container),imageContainer:i,images:[i.children("img:eq(0)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",(function(){$(this).removeClass("animateTransformation")})),i.children("img:eq(1)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",(function(){$(this).removeClass("animateTransformation")}))],imageList:e.find("> div > ul"),slideshow:{container:t,enlarge:h,full:o,next:n,previous:s,toggle:a}},this._ui.buttonNext.click($.proxy(this._next,this)),this._ui.buttonPrevious.click($.proxy(this._previous,this)),n.click($.proxy(this._nextImage,this)),s.click($.proxy(this._previousImage,this)),h.click($.proxy(this._toggleView,this)),a.click($.proxy((function(){this._items<2||(this._slideshowEnabled?this.stopSlideshow(!0):(this._disableSlideshow=!1,this.startSlideshow()))}),this)),$('').appendTo(this._ui.header).click($.proxy(this.close,this)),$.browser.mobile||i.click(function(e){e.target===i[0]&&this.close()}.bind(this)),WCF.DOMNodeInsertedHandler.execute(),require(["Ui/Screen"],function(i){i.on("screen-sm-down",{match:$.proxy(this._enableMobileView,this),unmatch:$.proxy(this._disableMobileView,this)})}.bind(this)),!0)},_enableMobileView:function(){this._container.addClass("wcfImageViewerMobile");var i=this;this._ui.imageContainer.swipe({swipeLeft:function(e){i._container.hasClass("maximized")&&i._nextImage(e)},swipeRight:function(e){i._container.hasClass("maximized")&&i._previousImage(e)},tap:function(e,t){switch(t.tagName){case"DIV":case"IMG":i._toggleView()}}}),this._isMobile=!0},_disableMobileView:function(){this._container.removeClass("wcfImageViewerMobile"),this._ui.imageContainer.swipe("destroy"),this._isMobile=!1},_toggleView:function(){this._ui.images[this._activeImage].addClass("animateTransformation"),this._container.toggleClass("maximized"),this._ui.slideshow.enlarge.toggleClass("active").children("span").toggleClass("fa-expand").toggleClass("fa-compress"),this._renderImage(null,void 0,null)},_next:function(i,e){if(this._ui.buttonNext.hasClass("pointer")){null==e&&this.stopSlideshow(!0);var t=Math.max(this._items*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight,0);this._thumbnailOffset=Math.min(this._thumbnailOffset+this._thumbnailWidth*(e||this.options.shiftBy),t),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)}this._preload(),this._toggleButtons()},_previous:function(i,e){this._ui.buttonPrevious.hasClass("pointer")&&(null==e&&this.stopSlideshow(!0),this._thumbnailOffset=Math.max(this._thumbnailOffset-this._thumbnailWidth*(e||this.options.shiftBy),0),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)),this._toggleButtons()},_nextImage:function(i){this._ui.slideshow.next.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active+1),i&&(i.preventDefault(),i.stopPropagation()))},_previousImage:function(i){this._ui.slideshow.previous.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active-1),i&&(i.preventDefault(),i.stopPropagation()))},moveToImage:function(i){var e,t=(i-3)*this._thumbnailWidth,s=t+5*this._thumbnailWidth,a=this._thumbnailOffset,n=this._thumbnailOffset+this._thumbnailContainerWidth,h=!1;if((tn)&&(h=!0),h)if(e=0,tn;)e++,n+=this._thumbnailWidth;this._next(null,e)}},_toggleButtons:function(){this._thumbnailOffset>0?this._ui.buttonPrevious.addClass("pointer"):this._ui.buttonPrevious.removeClass("pointer");var i=this._images.length*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight;this._thumbnailOffset>=i?this._ui.buttonNext.removeClass("pointer"):this._ui.buttonNext.addClass("pointer"),this._active>0?this._ui.slideshow.previous.addClass("pointer"):this._ui.slideshow.previous.removeClass("pointer"),this._active+1').appendTo(this._ui.imageList)).data("index",this._images.length).data("objectID",s.objectID).click($.proxy(this._showImage,this)),(n=a.children("img")).get(0).complete?(a.removeClass("loading"),this.options.staticViewer&&this._fixThumbnailDimensions(n)):(h=this,n.on("load",(function(){var i=$(this);i.parent().removeClass("loading"),h.options.staticViewer&&h._fixThumbnailDimensions(i)}))),s.listItem=a,this._images.push(s)},_fixThumbnailDimensions:function(i){var e,t,s,a=new Image;a.src=i.prop("src"),(e=a.height)==(t=a.width)?e=t=80:e img, .attachmentThumbnailImage > img").first()).length||(a=s.parentsUntil(".formAttachmentList").last().find(".attachmentTinyThumbnail")),i.push({image:{fullURL:a.data("source")?a.data("source").replace(/\\\//g,"/"):s.prop("href"),link:"",title:s.prop("title"),url:s.prop("href")},series:null,thumbnail:{url:a.prop("src")},user:null}))}.bind(this)),this._items=i.length,i},_success:function(i,e,t){var s,a;i.returnValues.items&&(this._items=i.returnValues.items),s=this._initUI(),this._createThumbnails(i.returnValues.images),a=i.returnValues.targetImageID?i.returnValues.targetImageID:0,this._render(s,a),this._isOpen||(this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable())}}); })(this); // WCF.Label.js (function (window, undefined) { "use strict";WCF.Label={},WCF.Label.ACPList=Class.extend({_labelInput:{},_labelList:{},init:function(){},_keyPressed:function(){}}),WCF.Label.ACPList.Connect=Class.extend({init:function(){var t=$("#connect .structuredList li");t.length&&t.each($.proxy((function(t,e){$(e).find('input[type="checkbox"]').click($.proxy(this._click,this))}),this))},_click:function(t){var e,i=$(t.currentTarget);if(i.is(":checked"))for(e=(i=i.parents("li")).data("depth");;){if(!(i=i.next()).length)return!0;if(i.data("depth")<=e)return!0;i.find('input[type="checkbox"]').prop("checked","checked")}}}),WCF.Label.Chooser=Class.extend({_container:null,_groups:{},_showWithoutSelection:!1,init:function(t,e,i,n){var o,a,s,l;if(this._container=null,this._groups={},this._showWithoutSelection=!0===n,this._initContainers(e),$.getLength(t))for(o in t)(a=this._groups[o])&&WCF.Dropdown.getDropdownMenu(a.wcfIdentify()).find("> ul > li:not(.dropdownDivider)").each($.proxy((function(e,i){var n=$(i),a=n.data("labelID")||0;a&&t[o]==a&&this._selectLabel(n,!0)}),this));for(s in this._containers)void 0===(l=this._containers[s]).data("labelID")&&l.data("labelID",0);this._container=$(e),i?$(i).click($.proxy(this._submit,this)):this._container.is("form")&&this._container.submit($.proxy(this._submit,this))},_initContainers:function(t){function e(t){t.addEventListener("wheel",(function(t){t.preventDefault()}),{passive:!1})}$(t).find(".labelChooser").each($.proxy((function(t,i){var n,o,a,s,l=$(i),r=l.data("groupID");this._groups[r]||(n=l.wcfIdentify(),null===(o=WCF.Dropdown.getDropdownMenu(n))&&(WCF.Dropdown.initDropdown(l.find(".dropdownToggle")),o=WCF.Dropdown.getDropdownMenu(n)),a=o,"div"==o.getTagName()&&o.children(".scrollableDropdownMenu").length&&(a=$("
          ").appendTo(o),o=o.children(".scrollableDropdownMenu")),this._groups[r]=l,o.children("li").data("groupID",r).click($.proxy(this._click,this)),l.data("forceSelection")&&!this._showWithoutSelection||$('
        • '+WCF.Language.get("wcf.label.withoutSelection")+"
        • ").data("groupID",r).appendTo(a).click($.proxy(this._click,this))[0]),l.data("forceSelection")||((s=$('
        • '+WCF.Language.get("wcf.label.none")+"
        • ").data("groupID",r).appendTo(a)).click($.proxy(this._click,this)),e(s[0])))}),this))},_click:function(t){this._selectLabel($(t.currentTarget),!1)},_selectLabel:function(t,e){var i=this._groups[t.data("groupID")];e&&void 0!==i.data("labelID")||(t.data("labelID")?i.data("labelID",t.data("labelID")):i.data("labelID",0),t=t.find("span > span"),i.find(".dropdownToggle > span").removeClass().addClass(t.attr("class")).text(t.text()),!e&&this._container[0]&&"FORM"===this._container[0].nodeName&&null===elBySel('input:not([type="hidden"]):not([type="submit"]):not([type="reset"]), select, textarea',this._container[0])&&setTimeout(function(){this._container.trigger("submit")}.bind(this),100))},_submit:function(){var t,e,i=this._container.find(".formSubmit");for(t in i.find('input[type="hidden"]').each((function(t,e){var i=$(e);0===i.attr("name").indexOf("labelIDs[")&&i.remove()})),this._groups)(e=this._groups[t]).data("labelID")&&$('').appendTo(i)},destroy:function(){for(var t in this._groups)WCF.Dropdown.destroy(this._groups[t].wcfIdentify())}}),WCF.Label.ArticleLabelChooser=WCF.Label.Chooser.extend({_labelGroupsToCategories:null,init:function(t,e,i,n,o){this._super(e,i,n,o),this._labelGroupsToCategories=t,this._updateLabelGroups(),$("#categoryID").change($.proxy(this._updateLabelGroups,this))},_updateLabelGroups:function(){var t,e,i;if($(".labelChooser").each((function(t,e){$(e).parents("dl:eq(0)").hide()})),[],t=parseInt($("#categoryID").val()),this._labelGroupsToCategories[t])for(e=0,i=this._labelGroupsToCategories[t].length;e").appendTo(this._container),this._loadNextComments.children("button").click($.proxy(this._loadComments,this))),this._loadNextComments.children("button").enable()):null!==this._loadNextComments&&this._loadNextComments.remove()},_handleLoadNextResponses:function(e){var t,n=this._comments[e];n.data("displayedResponses",n.find("ul.commentResponseList > li").length),n.data("displayedResponses")'+WCF.Language.get("wcf.comment.response.more",{count:t})+"").appendTo(this._commentButtonList[e]),this._loadNextResponses[e].children("a").data("commentID",e).click($.proxy(this._loadResponses,this)),this._commentButtonList[e].parent().show()):(t=n.data("responses")-n.data("displayedResponses"),this._loadNextResponses[e][0].querySelector("a").textContent=WCF.Language.get(WCF.Language.get("wcf.comment.response.more",{count:t}))):void 0!==this._loadNextResponses[e]&&this._loadNextResponses[e].remove()},_loadComments:function(){this._loadNextComments.children("button").disable(),this._proxy.setOption("data",{actionName:"loadComments",className:"wcf\\data\\comment\\CommentAction",parameters:{data:{objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID"),lastCommentTime:this._container.data("lastCommentTime")}}}),this._proxy.sendRequest()},_loadResponses:function(e){this._loadResponsesExecute($(e.currentTarget).disable().data("commentID"),!1)},_loadResponsesExecute:function(e,t){this._proxy.setOption("data",{actionName:"loadResponses",className:"wcf\\data\\comment\\response\\CommentResponseAction",parameters:{data:{commentID:e,lastResponseTime:this._comments[e].data("lastResponseTime"),loadAllResponses:t?1:0}}}),this._proxy.sendRequest()},_domNodeInserted:function(){this._initComments(),this._initResponses()},_initComments:function(){var e,t,n,s=elBySel('link[rel="canonical"]');s=s?s.href:window.location.toString().replace(/#.+$/,""),(e=this._container[0].closest(".tabMenuContent"))&&(s+="#"+elData(e,"name")),t=this,n=!1,this._container.find(".jsComment").each((function(e,o){var i,a,l=$(o).removeClass("jsComment"),m=l.data("commentID");t._comments[m]=l,l[0].id="comment"+m,(i=l.find("ul.commentResponseList")).length||(i=l.find(".commentContent")),a=$('
          ').hide().insertAfter(i),t._commentButtonList[m]=$('
            ').appendTo(a),t._handleLoadNextResponses(m),t._initComment(m,l),t._initPermalink(l[0],s),t._displayedComments++,n=!0})),n&&this._handleLoadNextComments()},_initComment:function(e,t){var n;this._container.data("canAdd")&&this._initAddResponse(e,t),t.data("canEdit")&&$('
          • ").appendTo(t.find("ul.buttonList:eq(0)")),t.data("canDelete")&&$('
          • ").data("commentID",e).appendTo(t.find("ul.buttonList:eq(0)")).click($.proxy(this._delete,this)),(n=elBySel(".jsEnableComment",t[0]))&&n.addEventListener("click",this._enableComment.bind(this))},_enableComment:function(e){e.preventDefault();var t=e.currentTarget.closest(".comment");this._proxy.setOption("data",{actionName:"enable",className:"wcf\\data\\comment\\CommentAction",objectIDs:[elData(t,"object-id")]}),this._proxy.sendRequest()},_initPermalink:function(e,t){var n,s=elCreate("a");s.href=t+(-1===t.indexOf("#")?"#":"/")+"comment"+elData(e,"object-id"),(n=elBySel(".commentContent:not(.commentResponseContent) .containerHeadline time",e)).parentNode.insertBefore(s,n),s.appendChild(n)},_initResponses:function(){var e,t,n=elBySel('link[rel="canonical"]');for(t in n=n?n.href:window.location.toString().replace(/#.+$/,""),(e=this._container[0].closest(".tabMenuContent"))&&(n+="#"+elData(e,"name")),this._comments)this._comments.hasOwnProperty(t)&&elBySelAll(".jsCommentResponse",this._comments[t][0],function(e){var s,o=$(e).removeClass("jsCommentResponse"),i=o.data("responseID");this._responses[i]=o,e.id="comment"+t+"response"+i,this._initResponse(i,o),this._initPermalinkResponse(t,e,i,n),(s=elBySel(".jsEnableResponse",e))&&s.addEventListener("click",this._enableCommentResponse.bind(this))}.bind(this))},_enableCommentResponse:function(e){e.preventDefault();var t=e.currentTarget.closest(".commentResponse");this._proxy.setOption("data",{actionName:"enableResponse",className:"wcf\\data\\comment\\CommentAction",parameters:{data:{responseID:elData(t,"object-id")}}}),this._proxy.sendRequest()},_initPermalinkResponse:function(e,t,n,s){var o,i=elCreate("a");i.href=s+(-1===s.indexOf("#")?"#":"/")+"comment"+e+"/response"+n,(o=elBySel(".commentResponseContent .containerHeadline time",t)).parentNode.insertBefore(i,o),i.appendChild(o)},_initResponse:function(e,t){var n,s;t.data("canEdit")&&$('
          • ").data("responseID",e).appendTo(t.find("ul.buttonList:eq(0)")),t.data("canDelete")&&(n=$('
          • "),s=this,n.data("responseID",e).appendTo(t.find("ul.buttonList:eq(0)")).click((function(e){s._delete(e,!0)})))},_initAddResponse:function(e,t){$('
          • '+WCF.Language.get("wcf.comment.button.response.add")+"
          • ").data("commentID",e).click($.proxy(this._showAddResponse,this)).appendTo(this._commentButtonList[e]);this._commentButtonList[e].parent().show()},_showAddResponse:function(e){var t,n,s;e.preventDefault(),null===this._onResponsesLoaded&&(null!==this._responseAdd?null!==(t=this._responseAdd.getContainer())&&(null!==this._responseRevert&&(this._responseRevert(),this._responseRevert=null),n=$(e.currentTarget),s=n.data("commentID"),this._onResponsesLoaded=function(){n.hide(),t.parentNode&&t.parentNode.classList.contains("jsCommentResponseAddContainer")&&elRemove(t.parentNode);var e=this._commentButtonList[s][0].closest(".commentOptionContainer");e.parentNode.insertBefore(t,e.nextSibling),"string"==typeof this._responseCache[s]?this._responseAdd.setContent(this._responseCache[s]):this._responseAdd.setContent(""),this._responseRevert=function(){this._responseCache[s]=this._responseAdd.getContent(),elRemove(t),n.show()}.bind(this),this._onResponsesLoaded=null}.bind(this),n.prev().hasClass("jsCommentLoadNextResponses")?(this._loadResponsesExecute(s,!0),n.parent().children(".button").disable()):this._onResponsesLoaded()):console.error("Missing response API."))},_delete:function(e,t){e.preventDefault(),WCF.System.Confirmation.show(WCF.Language.get("wcf.comment.delete.confirmMessage"),$.proxy((function(n){if("confirm"===n){var s={objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};!0!==t?s.commentID=$(e.currentTarget).data("commentID"):s.responseID=$(e.currentTarget).data("responseID"),this._proxy.setOption("data",{actionName:"remove",className:"wcf\\data\\comment\\CommentAction",parameters:{data:s}}),this._proxy.sendRequest()}}),this))},_success:function(e,t,n){switch(e.actionName){case"enable":this._enable(e);break;case"enableResponse":this._enableResponse(e);break;case"loadComment":this._insertComment(e);break;case"loadComments":this._insertComments(e);break;case"loadResponse":this._insertResponse(e);break;case"loadResponses":this._insertResponses(e);break;case"remove":this._remove(e)}WCF.DOMNodeInsertedHandler.execute()},_enable:function(e){var t,n,s;e.returnValues.commentID&&(t=elBySel('.comment[data-object-id="'+e.returnValues.commentID+'"]',this._container[0]))&&(elData(t,"is-disabled",0),(n=elBySel(".jsIconDisabled",t))&&elRemove(n),(s=elBySel(".jsEnableComment",t))&&elRemove(s.parentNode))},_enableResponse:function(e){var t,n,s;e.returnValues.responseID&&(t=elBySel('.commentResponse[data-object-id="'+e.returnValues.responseID+'"]',this._container[0]))&&(elData(t,"is-disabled",0),(n=elBySel(".jsIconDisabled",t))&&elRemove(n),(s=elBySel(".jsEnableResponse",t))&&elRemove(s.parentNode))},_insertComment:function(e){var t,n;""!==e.returnValues.template?($(e.returnValues.template).insertBefore(this._permalinkComment),(t=this._permalinkComment.previousElementSibling).classList.add("commentPermalinkContainer"),elRemove(this._permalinkComment),this._permalinkComment=t,e.returnValues.response?(this._permalinkResponse=elCreate("li"),this._permalinkResponse.className="commentResponsePermalinkContainer loading",this._permalinkResponse.innerHTML='',(n=elBySel(".commentResponseList",t)).insertBefore(this._permalinkResponse,n.firstChild),this._insertResponse({returnValues:{template:e.returnValues.response}})):this._scrollTo(t,!0)):elRemove(this._permalinkComment)},_insertResponse:function(e){if(""!==e.returnValues.template){$(e.returnValues.template).insertBefore(this._permalinkResponse);var t=this._permalinkResponse.previousElementSibling;t.classList.add("commentResponsePermalinkContainer"),elRemove(this._permalinkResponse),this._permalinkResponse=t,this._scrollTo(t,!0)}else elRemove(this._permalinkResponse)},_insertComments:function(e){if($(e.returnValues.template).insertBefore(this._loadNextComments),this._container.data("lastCommentTime",e.returnValues.lastCommentTime),this._permalinkComment){var t=elData(this._permalinkComment,"object-id");null!==elBySel('.comment[data-object-id="'+t+'"]:not(.commentPermalinkContainer)',this._container[0])&&(elRemove(this._permalinkComment),this._permalinkComment=null)}this._initComments()},_insertResponses:function(e){var t,n=this._comments[e.returnValues.commentID];$(e.returnValues.template).appendTo(n.find("ul.commentResponseList")),n.data("lastResponseTime",e.returnValues.lastResponseTime),this._handleLoadNextResponses(e.returnValues.commentID),this._permalinkResponse&&(t=elData(this._permalinkResponse,"object-id"),null!==elBySel('.commentResponse[data-object-id="'+t+'"]:not(.commentPermalinkContainer)',this._container[0])&&(elRemove(this._permalinkResponse),this._permalinkResponse=null)),null!==this._onResponsesLoaded&&this._onResponsesLoaded()},_remove:function(e){var t,n,s;e.returnValues.commentID?(this._comments[e.returnValues.commentID].remove(),delete this._comments[e.returnValues.commentID]):(t=this._responses[e.returnValues.responseID],(n=this._comments[t.parents("li.comment:eq(0)").data("commentID")]).data("responses",parseInt(n.data("responses"))-1),s=t.parent(),t.remove(),s.children().length||s.empty(),delete this._responses[e.returnValues.responseID])},_prepareEdit:function(){console.warn("This method is no longer supported.")},_keyUp:function(){console.warn("This method is no longer supported.")},_save:function(){console.warn("This method is no longer supported.")},_failure:function(){console.warn("This method is no longer supported.")},_edit:function(){console.warn("This method is no longer supported.")},_update:function(){console.warn("This method is no longer supported.")},_createGuestDialog:function(){console.warn("This method is no longer supported.")},_keyDown:function(){console.warn("This method is no longer supported.")},_submit:function(){console.warn("This method is no longer supported.")},_keyUpEdit:function(){console.warn("This method is no longer supported.")},_saveEdit:function(){console.warn("This method is no longer supported.")},_cancelEdit:function(){console.warn("This method is no longer supported.")}}),WCF.Comment.Response={}; })(this); // WCF.ImageViewer.js -(function (window, undefined) { "use strict";WCF.ImageViewer=Class.extend({_triggerElement:null,init:function(){this._triggerElement=$('').data("disableSlideshow",!0).hide().appendTo(document.body),this._triggerElement.wcfImageViewer({enableSlideshow:0,imageSelector:".jsImageViewerEnabled",staticViewer:!0}),WCF.DOMNodeInsertedHandler.addCallback("WCF.ImageViewer",$.proxy(this._domNodeInserted,this)),WCF.DOMNodeInsertedHandler.execute()},_domNodeInserted:function(){this._initImageSizeCheck(),this._rebuildImageViewer()},_rebuildImageViewer:function(){var i=$("a.jsImageViewer");i.length&&i.removeClass("jsImageViewer").addClass("jsImageViewerEnabled").click($.proxy(this._click,this))},_click:function(i){i.ctrlKey||(i.preventDefault(),i.stopPropagation(),$(i.currentTarget).closest(".popover").length||this._triggerElement.wcfImageViewer("open",null,$(i.currentTarget).wcfIdentify()))},_initImageSizeCheck:function(){$(".jsResizeImage").each($.proxy((function(i,e){e.complete&&this._checkImageSize({currentTarget:e})}),this)),$(".jsResizeImage").on("load",$.proxy(this._checkImageSize,this))},_checkImageSize:function(i){var e,t=$(i.currentTarget);t.is(":visible")?(t.removeClass("jsResizeImage"),t.closest(".messageSignature").length||((e=new Image).src=t.attr("src"),t.closest("div.messageText, div.messageTextPreview").width()'),t.parent().click($.proxy(this._click,this)),"right"==t.css("float")?t.parent().addClass("messageFloatObjectRight"):"left"==t.css("float")&&t.parent().addClass("messageFloatObjectLeft"),t[0].style.removeProperty("float"),t[0].style.removeProperty("margin")):t.removeClass("embeddedAttachmentLink"))):t.off("load")}}),$.widget("ui.wcfImageViewer",{_active:-1,_activeImage:null,_container:null,_didInit:!1,_disableSlideshow:!1,_eventNamespace:"",_images:[],_isMobile:!1,_isOpen:!1,_messageSignature:null,_items:-1,_maxDimensions:{height:0,width:0},_proxy:null,_slideshowEnabled:!1,_thumbnailContainerWidth:0,_thumbnailMarginRight:0,_thumbnailOffset:0,_thumbnailWidth:0,_timer:null,_ui:{buttonNext:null,buttonPrevious:null,header:null,image:null,imageContainer:null,imageList:null,slideshow:{container:null,enlarge:null,next:null,previous:null,toggle:null}},options:{shiftBy:5,enableSlideshow:1,speed:5,className:"",imageSelector:"",staticViewer:!1},_create:function(){this._active=-1,this._activeImage=null,this._container=null,this._didInit=!1,this._disableSlideshow=this.element.data("disableSlideshow"),this._eventNamespace=this.element.wcfIdentify(),this._images=[],this._isMobile=!1,this._isOpen=!1,this._items=-1,this._maxDimensions={height:document.documentElement.clientHeight,width:document.documentElement.clientWidth},this._messageSignature=null,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._slideshowEnabled=!1,this._thumbnailContainerWidth=0,this._thumbnailMarginRight=0,this._thumbnailOffset=0,this._thumbnaiLWidth=0,this._timer=null,this._ui={},this.element.click($.proxy(this.open,this)),window.addEventListener("popstate",function(i){if(null!=i.state&&"imageViewer"===i.state.name&&i.state.container===this._eventNamespace)return this.open(i),void this.showImage(i.state.image);this.close(i)}.bind(this))},open:function(i,e){if(i&&i.preventDefault(),this._isOpen)return!1;if(i&&"popstate"===i.type||window.history.pushState({name:"imageViewer"},"",""),this._messageSignature=null,this.options.staticViewer){e&&(this._messageSignature=document.getElementById(e).closest(".messageSignature")),this._active=-1,null!==this._activeImage&&this._ui.images[this._activeImage].removeClass("active"),this._activeImage=null;var t=this._getStaticImages();this._initUI(),this._createThumbnails(t,!0),this._render(!0,void 0,e),this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable(),$.browser.touch&&setTimeout($.proxy((function(){this._isMobile&&!this._container.hasClass("maximized")&&this._toggleView()}),this),500)}else 0===this._images.length?this._loadNextImages(!0):(this._render(!1,this.element.data("targetImageID")),this._items>1&&this._slideshowEnabled&&this.startSlideshow(),this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable());return this._bindListener(),require(["Ui/Screen"],(function(i){i.pageOverlayOpen()})),!0},close:function(i){if(i&&i.preventDefault(),i&&"popstate"===i.type)return!!this._isOpen&&(this._container.removeClass("open"),null!==this._timer&&this._timer.stop(),this._unbindListener(),this._isOpen=!1,WCF.System.DisableScrolling.enable(),WCF.System.DisableZoom.enable(),require(["Ui/Screen"],(function(i){i.pageOverlayClose()})),!0);window.history.back()},startSlideshow:function(){return!this._disableSlideshow&&!this._slideshowEnabled&&(null===this._timer?this._timer=new WCF.PeriodicalExecuter($.proxy((function(){var i=this._active+1;i==this._items&&(i=0),this.showImage(i)}),this),1e3*this.options.speed):this._timer.resume(),this._slideshowEnabled=!0,this._ui.slideshow.toggle.children("span").removeClass("fa-play").addClass("fa-pause"),!0)},stopSlideshow:function(i){return!!this._slideshowEnabled&&(this._timer.stop(),i&&this._ui.slideshow.toggle.children("span").removeClass("fa-pause").addClass("fa-play"),this._slideshowEnabled=!1,!0)},_bindListener:function(){$(document).on("keydown."+this._eventNamespace,$.proxy(this._keyDown,this)),$(window).on("resize."+this._eventNamespace,(()=>{window.setTimeout((()=>this._renderImage()),0)}))},_unbindListener:function(){$(document).off("keydown."+this._eventNamespace),$(window).off("resize."+this._eventNamespace)},_keyDown:function(i){switch(i.which){case $.ui.keyCode.ESCAPE:this.close();break;case $.ui.keyCode.LEFT:this._previousImage();break;case $.ui.keyCode.RIGHT:this._nextImage();break;case $.ui.keyCode.UP:this._container.hasClass("maximized")||this._toggleView();break;case $.ui.keyCode.DOWN:this._container.hasClass("maximized")&&this._toggleView();break;case $.ui.keyCode.ENTER:var e=this._ui.header.find("h1 > a");1==e.length?window.location=e.prop("href"):this._ui.slideshow.full.trigger("click");break;case 80:this._ui.slideshow.toggle.trigger("click");break;default:return!0}return!1},_render:function(i,e,t){var s,a,n,h,o;this._container.addClass("open"),s=null,i&&(s=this._ui.imageList.children("li:eq(0)"),this._thumbnailMarginRight=parseInt(s.css("marginRight").replace(/px$/,""))||0,this._thumbnailWidth=s.outerWidth(!0),this._thumbnailContainerWidth=this._ui.imageList.parent().innerWidth(),this._items>1&&this.options.enableSlideshow&&!e&&!t&&this.startSlideshow()),e?this._ui.imageList.children("li").each($.proxy((function(i,t){var s=$(t);if(s.data("objectID")==e)return s.trigger("click"),this.moveToImage(s.data("index")),!1}),this)):t?(a=[],$(this.options.imageSelector).each(function(i,e){e.closest(".messageSignature")===this._messageSignature&&a.push(e)}.bind(this)),n=0,a.forEach((function(i,e){i.id===t&&(n=e)})),h=this._ui.imageList.children("li:eq("+n+")"),-1!==this._active&&(o=!1,this._active!=h.data("index")&&(o=!0),this._ui.images[this._activeImage].prop("src")!=this._images[this._active].image.url&&(o=!0),o&&(this._active=-1)),h.trigger("click"),this.moveToImage(h.data("index"))):null!==s&&s.trigger("click"),this._toggleButtons(),this._preload()},_preload:function(){this._images.length div > a").prop("href",t.user.link).prop("title",t.user.username).children("img").prop("src",t.user.avatarURL),h=WCF.String.escapeHTML(t.image.title),t.image.link&&(h=''+h+""),this._ui.header.find("h1").html(h),this.options.staticViewer||(o=t.series&&t.series.title?WCF.String.escapeHTML(t.series.title):"",t.series.link&&(o=''+o+""),this._ui.header.find("h2").html(o)),this._ui.header.find("h3").text(WCF.Language.get("wcf.imageViewer.seriesIndex").replace(/{x}/,t.listItem.data("index")+1).replace(/{y}/,this._items)),this._ui.slideshow.full.data("link",t.image.fullURL?t.image.fullURL:t.image.url),this.moveToImage(t.listItem.data("index")),this._toggleButtons(),!0)},_imageOnLoad:function(i,e){i==this._active&&(this._ui.imageContainer.removeClass("loading"),this._ui.images[e].addClass("active"),this.options.staticViewer&&this._renderImage(e,null),this.startSlideshow())},_renderImage:function(i,e,t){var s,a,n,h,o,l,r=!0;e||(i=this._activeImage,e=this._images[this._active],t={height:$(window).height()-(this._container.hasClass("maximized")||this._container.hasClass("wcfImageViewerMobile")?0:200),width:this._ui.imageContainer.innerWidth()},r=!1),t.height-=22,t.width-=20,(s=this._ui.images[i]).prop("src")!==e.image.url&&s.prop("src",e.image.url),r&&s[0].complete&&s.trigger("load"),this.options.staticViewer&&!e.image.height&&s[0].complete&&($.browser.mozilla||$.browser.safari?((a=new Image).src=e.image.url,e.image.height=a.height||s[0].naturalHeight,e.image.width=a.width||s[0].naturalWidth):(s.css({height:"auto",width:"auto"}),e.image.height=s[0].height,e.image.width=s[0].width)),n=e.image.height,h=e.image.width,o=0,n>t.height&&(o=t.height/n,n=t.height,h=Math.floor(h*o)),h>t.width&&(o=t.width/h,h=t.width,n=Math.floor(n*o)),l=Math.floor((t.width-h)/2),this._ui.images[i].css({height:n+"px",left:l+10+"px",marginTop:-1*Math.round(n/2)+"px",width:h+"px"})},_initUI:function(){var i,e,t,s,a,n,h,o;return!this._didInit&&(this._didInit=!0,this._container=$('
            ').appendTo(document.body),i=$("
            ").appendTo(this._container),e=$('
              ').appendTo(this._container),t=$("
                ").appendTo(i),s=$('
              • ').appendTo(t),a=$('
              • ').appendTo(t),n=$('
              • ').appendTo(t),h=$('
              • ').appendTo(t),o=$('
              • ').appendTo(t),this._ui={buttonNext:e.children("span.wcfImageViewerButtonNext"),buttonPrevious:e.children("span.wcfImageViewerButtonPrevious"),header:$("
                ":' class="box64">')+"

              ").appendTo(this._container),imageContainer:i,images:[i.children("img:eq(0)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",(function(){$(this).removeClass("animateTransformation")})),i.children("img:eq(1)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",(function(){$(this).removeClass("animateTransformation")}))],imageList:e.find("> div > ul"),slideshow:{container:t,enlarge:h,full:o,next:n,previous:s,toggle:a}},this._ui.buttonNext.click($.proxy(this._next,this)),this._ui.buttonPrevious.click($.proxy(this._previous,this)),n.click($.proxy(this._nextImage,this)),s.click($.proxy(this._previousImage,this)),h.click($.proxy(this._toggleView,this)),a.click($.proxy((function(){this._items<2||(this._slideshowEnabled?this.stopSlideshow(!0):(this._disableSlideshow=!1,this.startSlideshow()))}),this)),o.click((function(i){window.location=$(i.currentTarget).data("link")})),$('').appendTo(this._ui.header).click($.proxy(this.close,this)),$.browser.mobile||i.click(function(e){e.target===i[0]&&this.close()}.bind(this)),WCF.DOMNodeInsertedHandler.execute(),require(["Ui/Screen"],function(i){i.on("screen-sm-down",{match:$.proxy(this._enableMobileView,this),unmatch:$.proxy(this._disableMobileView,this)})}.bind(this)),!0)},_enableMobileView:function(){this._container.addClass("wcfImageViewerMobile");var i=this;this._ui.imageContainer.swipe({swipeLeft:function(e){i._container.hasClass("maximized")&&i._nextImage(e)},swipeRight:function(e){i._container.hasClass("maximized")&&i._previousImage(e)},tap:function(e,t){switch(t.tagName){case"DIV":case"IMG":i._toggleView()}}}),this._isMobile=!0},_disableMobileView:function(){this._container.removeClass("wcfImageViewerMobile"),this._ui.imageContainer.swipe("destroy"),this._isMobile=!1},_toggleView:function(){this._ui.images[this._activeImage].addClass("animateTransformation"),this._container.toggleClass("maximized"),this._ui.slideshow.enlarge.toggleClass("active").children("span").toggleClass("fa-expand").toggleClass("fa-compress"),this._renderImage(null,void 0,null)},_next:function(i,e){if(this._ui.buttonNext.hasClass("pointer")){null==e&&this.stopSlideshow(!0);var t=Math.max(this._items*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight,0);this._thumbnailOffset=Math.min(this._thumbnailOffset+this._thumbnailWidth*(e||this.options.shiftBy),t),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)}this._preload(),this._toggleButtons()},_previous:function(i,e){this._ui.buttonPrevious.hasClass("pointer")&&(null==e&&this.stopSlideshow(!0),this._thumbnailOffset=Math.max(this._thumbnailOffset-this._thumbnailWidth*(e||this.options.shiftBy),0),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)),this._toggleButtons()},_nextImage:function(i){this._ui.slideshow.next.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active+1),i&&(i.preventDefault(),i.stopPropagation()))},_previousImage:function(i){this._ui.slideshow.previous.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active-1),i&&(i.preventDefault(),i.stopPropagation()))},moveToImage:function(i){var e,t=(i-3)*this._thumbnailWidth,s=t+5*this._thumbnailWidth,a=this._thumbnailOffset,n=this._thumbnailOffset+this._thumbnailContainerWidth,h=!1;if((tn)&&(h=!0),h)if(e=0,tn;)e++,n+=this._thumbnailWidth;this._next(null,e)}},_toggleButtons:function(){this._thumbnailOffset>0?this._ui.buttonPrevious.addClass("pointer"):this._ui.buttonPrevious.removeClass("pointer");var i=this._images.length*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight;this._thumbnailOffset>=i?this._ui.buttonNext.removeClass("pointer"):this._ui.buttonNext.addClass("pointer"),this._active>0?this._ui.slideshow.previous.addClass("pointer"):this._ui.slideshow.previous.removeClass("pointer"),this._active+1').appendTo(this._ui.imageList)).data("index",this._images.length).data("objectID",s.objectID).click($.proxy(this._showImage,this)),(n=a.children("img")).get(0).complete?(a.removeClass("loading"),this.options.staticViewer&&this._fixThumbnailDimensions(n)):(h=this,n.on("load",(function(){var i=$(this);i.parent().removeClass("loading"),h.options.staticViewer&&h._fixThumbnailDimensions(i)}))),s.listItem=a,this._images.push(s)},_fixThumbnailDimensions:function(i){var e,t,s,a=new Image;a.src=i.prop("src"),(e=a.height)==(t=a.width)?e=t=80:e img, .attachmentThumbnailImage > img").first()).length||(a=s.parentsUntil(".formAttachmentList").last().find(".attachmentTinyThumbnail")),i.push({image:{fullURL:a.data("source")?a.data("source").replace(/\\\//g,"/"):s.prop("href"),link:"",title:s.prop("title"),url:s.prop("href")},series:null,thumbnail:{url:a.prop("src")},user:null}))}.bind(this)),this._items=i.length,i},_success:function(i,e,t){var s,a;i.returnValues.items&&(this._items=i.returnValues.items),s=this._initUI(),this._createThumbnails(i.returnValues.images),a=i.returnValues.targetImageID?i.returnValues.targetImageID:0,this._render(s,a),this._isOpen||(this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable())}}); })(this); +(function (window, undefined) { "use strict";WCF.ImageViewer=Class.extend({_triggerElement:null,init:function(){this._triggerElement=$('').data("disableSlideshow",!0).hide().appendTo(document.body),this._triggerElement.wcfImageViewer({enableSlideshow:0,imageSelector:".jsImageViewerEnabled",staticViewer:!0}),WCF.DOMNodeInsertedHandler.addCallback("WCF.ImageViewer",$.proxy(this._domNodeInserted,this)),WCF.DOMNodeInsertedHandler.execute()},_domNodeInserted:function(){this._initImageSizeCheck(),this._rebuildImageViewer()},_rebuildImageViewer:function(){var i=$("a.jsImageViewer");i.length&&i.removeClass("jsImageViewer").addClass("jsImageViewerEnabled").click($.proxy(this._click,this))},_click:function(i){i.ctrlKey||(i.preventDefault(),i.stopPropagation(),$(i.currentTarget).closest(".popover").length||this._triggerElement.wcfImageViewer("open",null,$(i.currentTarget).wcfIdentify()))},_initImageSizeCheck:function(){$(".jsResizeImage").each($.proxy((function(i,e){e.complete&&this._checkImageSize({currentTarget:e})}),this)),$(".jsResizeImage").on("load",$.proxy(this._checkImageSize,this))},_checkImageSize:function(i){var e,t=$(i.currentTarget);t.is(":visible")?(t.removeClass("jsResizeImage"),t.closest(".messageSignature").length||((e=new Image).src=t.attr("src"),t.closest("div.messageText, div.messageTextPreview").width()'),t.parent().click($.proxy(this._click,this)),"right"==t.css("float")?t.parent().addClass("messageFloatObjectRight"):"left"==t.css("float")&&t.parent().addClass("messageFloatObjectLeft"),t[0].style.removeProperty("float"),t[0].style.removeProperty("margin")):t.removeClass("embeddedAttachmentLink"))):t.off("load")}}),$.widget("ui.wcfImageViewer",{_active:-1,_activeImage:null,_container:null,_didInit:!1,_disableSlideshow:!1,_eventNamespace:"",_images:[],_isMobile:!1,_isOpen:!1,_messageSignature:null,_items:-1,_maxDimensions:{height:0,width:0},_proxy:null,_slideshowEnabled:!1,_thumbnailContainerWidth:0,_thumbnailMarginRight:0,_thumbnailOffset:0,_thumbnailWidth:0,_timer:null,_ui:{buttonNext:null,buttonPrevious:null,header:null,image:null,imageContainer:null,imageList:null,slideshow:{container:null,enlarge:null,next:null,previous:null,toggle:null}},options:{shiftBy:5,enableSlideshow:1,speed:5,className:"",imageSelector:"",staticViewer:!1},_create:function(){this._active=-1,this._activeImage=null,this._container=null,this._didInit=!1,this._disableSlideshow=this.element.data("disableSlideshow"),this._eventNamespace=this.element.wcfIdentify(),this._images=[],this._isMobile=!1,this._isOpen=!1,this._items=-1,this._maxDimensions={height:document.documentElement.clientHeight,width:document.documentElement.clientWidth},this._messageSignature=null,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._slideshowEnabled=!1,this._thumbnailContainerWidth=0,this._thumbnailMarginRight=0,this._thumbnailOffset=0,this._thumbnaiLWidth=0,this._timer=null,this._ui={},this.element.click($.proxy(this.open,this)),window.addEventListener("popstate",function(i){if(null!=i.state&&"imageViewer"===i.state.name&&i.state.container===this._eventNamespace)return this.open(i),void this.showImage(i.state.image);this.close(i)}.bind(this))},open:function(i,e){if(i&&i.preventDefault(),this._isOpen)return!1;if(i&&"popstate"===i.type||window.history.pushState({name:"imageViewer"},"",""),this._messageSignature=null,this.options.staticViewer){e&&(this._messageSignature=document.getElementById(e).closest(".messageSignature")),this._active=-1,null!==this._activeImage&&this._ui.images[this._activeImage].removeClass("active"),this._activeImage=null;var t=this._getStaticImages();this._initUI(),this._createThumbnails(t,!0),this._render(!0,void 0,e),this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable(),$.browser.touch&&setTimeout($.proxy((function(){this._isMobile&&!this._container.hasClass("maximized")&&this._toggleView()}),this),500)}else 0===this._images.length?this._loadNextImages(!0):(this._render(!1,this.element.data("targetImageID")),this._items>1&&this._slideshowEnabled&&this.startSlideshow(),this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable());return this._bindListener(),require(["Ui/Screen"],(function(i){i.pageOverlayOpen()})),!0},close:function(i){if(i&&i.preventDefault(),i&&"popstate"===i.type)return!!this._isOpen&&(this._container.removeClass("open"),null!==this._timer&&this._timer.stop(),this._unbindListener(),this._isOpen=!1,WCF.System.DisableScrolling.enable(),WCF.System.DisableZoom.enable(),require(["Ui/Screen"],(function(i){i.pageOverlayClose()})),!0);window.history.back()},startSlideshow:function(){return!this._disableSlideshow&&!this._slideshowEnabled&&(null===this._timer?this._timer=new WCF.PeriodicalExecuter($.proxy((function(){var i=this._active+1;i==this._items&&(i=0),this.showImage(i)}),this),1e3*this.options.speed):this._timer.resume(),this._slideshowEnabled=!0,this._ui.slideshow.toggle.children("span").removeClass("fa-play").addClass("fa-pause"),!0)},stopSlideshow:function(i){return!!this._slideshowEnabled&&(this._timer.stop(),i&&this._ui.slideshow.toggle.children("span").removeClass("fa-pause").addClass("fa-play"),this._slideshowEnabled=!1,!0)},_bindListener:function(){$(document).on("keydown."+this._eventNamespace,$.proxy(this._keyDown,this)),$(window).on("resize."+this._eventNamespace,(()=>{window.setTimeout((()=>this._renderImage()),0)}))},_unbindListener:function(){$(document).off("keydown."+this._eventNamespace),$(window).off("resize."+this._eventNamespace)},_keyDown:function(i){switch(i.which){case $.ui.keyCode.ESCAPE:this.close();break;case $.ui.keyCode.LEFT:this._previousImage();break;case $.ui.keyCode.RIGHT:this._nextImage();break;case $.ui.keyCode.UP:this._container.hasClass("maximized")||this._toggleView();break;case $.ui.keyCode.DOWN:this._container.hasClass("maximized")&&this._toggleView();break;case $.ui.keyCode.ENTER:var e=this._ui.header.find("h1 > a");1==e.length?window.location=e.prop("href"):this._ui.slideshow.full.trigger("click");break;case 80:this._ui.slideshow.toggle.trigger("click");break;default:return!0}return!1},_render:function(i,e,t){var s,a,n,h,o;this._container.addClass("open"),s=null,i&&(s=this._ui.imageList.children("li:eq(0)"),this._thumbnailMarginRight=parseInt(s.css("marginRight").replace(/px$/,""))||0,this._thumbnailWidth=s.outerWidth(!0),this._thumbnailContainerWidth=this._ui.imageList.parent().innerWidth(),this._items>1&&this.options.enableSlideshow&&!e&&!t&&this.startSlideshow()),e?this._ui.imageList.children("li").each($.proxy((function(i,t){var s=$(t);if(s.data("objectID")==e)return s.trigger("click"),this.moveToImage(s.data("index")),!1}),this)):t?(a=[],$(this.options.imageSelector).each(function(i,e){e.closest(".messageSignature")===this._messageSignature&&a.push(e)}.bind(this)),n=0,a.forEach((function(i,e){i.id===t&&(n=e)})),h=this._ui.imageList.children("li:eq("+n+")"),-1!==this._active&&(o=!1,this._active!=h.data("index")&&(o=!0),this._ui.images[this._activeImage].prop("src")!=this._images[this._active].image.url&&(o=!0),o&&(this._active=-1)),h.trigger("click"),this.moveToImage(h.data("index"))):null!==s&&s.trigger("click"),this._toggleButtons(),this._preload()},_preload:function(){this._images.length div > a").prop("href",t.user.link).prop("title",t.user.username).children("img").prop("src",t.user.avatarURL),h=WCF.String.escapeHTML(t.image.title),t.image.link&&(h=''+h+""),this._ui.header.find("h1").html(h),this.options.staticViewer||(o=t.series&&t.series.title?WCF.String.escapeHTML(t.series.title):"",t.series.link&&(o=''+o+""),this._ui.header.find("h2").html(o)),this._ui.header.find("h3").text(WCF.Language.get("wcf.imageViewer.seriesIndex").replace(/{x}/,t.listItem.data("index")+1).replace(/{y}/,this._items)),this._ui.slideshow.full[0].querySelector("a").href=t.image.fullURL?t.image.fullURL:t.image.url,this.moveToImage(t.listItem.data("index")),this._toggleButtons(),!0)},_imageOnLoad:function(i,e){i==this._active&&(this._ui.imageContainer.removeClass("loading"),this._ui.images[e].addClass("active"),this.options.staticViewer&&this._renderImage(e,null),this.startSlideshow())},_renderImage:function(i,e,t){var s,a,n,h,o,l,r=!0;e||(i=this._activeImage,e=this._images[this._active],t={height:$(window).height()-(this._container.hasClass("maximized")||this._container.hasClass("wcfImageViewerMobile")?0:200),width:this._ui.imageContainer.innerWidth()},r=!1),t.height-=22,t.width-=20,(s=this._ui.images[i]).prop("src")!==e.image.url&&s.prop("src",e.image.url),r&&s[0].complete&&s.trigger("load"),this.options.staticViewer&&!e.image.height&&s[0].complete&&($.browser.mozilla||$.browser.safari?((a=new Image).src=e.image.url,e.image.height=a.height||s[0].naturalHeight,e.image.width=a.width||s[0].naturalWidth):(s.css({height:"auto",width:"auto"}),e.image.height=s[0].height,e.image.width=s[0].width)),n=e.image.height,h=e.image.width,o=0,n>t.height&&(o=t.height/n,n=t.height,h=Math.floor(h*o)),h>t.width&&(o=t.width/h,h=t.width,n=Math.floor(n*o)),l=Math.floor((t.width-h)/2),this._ui.images[i].css({height:n+"px",left:l+10+"px",marginTop:-1*Math.round(n/2)+"px",width:h+"px"})},_initUI:function(){var i,e,t,s,a,n,h,o;return!this._didInit&&(this._didInit=!0,this._container=$('
              ').appendTo(document.body),i=$("
              ").appendTo(this._container),e=$('
                ').appendTo(this._container),t=$("
                  ").appendTo(i),s=$('
                • ').appendTo(t),a=$('
                • ').appendTo(t),n=$('
                • ').appendTo(t),h=$('
                • ').appendTo(t),o=$('
                • ').appendTo(t),this._ui={buttonNext:e.children("span.wcfImageViewerButtonNext"),buttonPrevious:e.children("span.wcfImageViewerButtonPrevious"),header:$("
                  ":' class="box64">')+"

                ").appendTo(this._container),imageContainer:i,images:[i.children("img:eq(0)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",(function(){$(this).removeClass("animateTransformation")})),i.children("img:eq(1)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",(function(){$(this).removeClass("animateTransformation")}))],imageList:e.find("> div > ul"),slideshow:{container:t,enlarge:h,full:o,next:n,previous:s,toggle:a}},this._ui.buttonNext.click($.proxy(this._next,this)),this._ui.buttonPrevious.click($.proxy(this._previous,this)),n.click($.proxy(this._nextImage,this)),s.click($.proxy(this._previousImage,this)),h.click($.proxy(this._toggleView,this)),a.click($.proxy((function(){this._items<2||(this._slideshowEnabled?this.stopSlideshow(!0):(this._disableSlideshow=!1,this.startSlideshow()))}),this)),$('').appendTo(this._ui.header).click($.proxy(this.close,this)),$.browser.mobile||i.click(function(e){e.target===i[0]&&this.close()}.bind(this)),WCF.DOMNodeInsertedHandler.execute(),require(["Ui/Screen"],function(i){i.on("screen-sm-down",{match:$.proxy(this._enableMobileView,this),unmatch:$.proxy(this._disableMobileView,this)})}.bind(this)),!0)},_enableMobileView:function(){this._container.addClass("wcfImageViewerMobile");var i=this;this._ui.imageContainer.swipe({swipeLeft:function(e){i._container.hasClass("maximized")&&i._nextImage(e)},swipeRight:function(e){i._container.hasClass("maximized")&&i._previousImage(e)},tap:function(e,t){switch(t.tagName){case"DIV":case"IMG":i._toggleView()}}}),this._isMobile=!0},_disableMobileView:function(){this._container.removeClass("wcfImageViewerMobile"),this._ui.imageContainer.swipe("destroy"),this._isMobile=!1},_toggleView:function(){this._ui.images[this._activeImage].addClass("animateTransformation"),this._container.toggleClass("maximized"),this._ui.slideshow.enlarge.toggleClass("active").children("span").toggleClass("fa-expand").toggleClass("fa-compress"),this._renderImage(null,void 0,null)},_next:function(i,e){if(this._ui.buttonNext.hasClass("pointer")){null==e&&this.stopSlideshow(!0);var t=Math.max(this._items*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight,0);this._thumbnailOffset=Math.min(this._thumbnailOffset+this._thumbnailWidth*(e||this.options.shiftBy),t),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)}this._preload(),this._toggleButtons()},_previous:function(i,e){this._ui.buttonPrevious.hasClass("pointer")&&(null==e&&this.stopSlideshow(!0),this._thumbnailOffset=Math.max(this._thumbnailOffset-this._thumbnailWidth*(e||this.options.shiftBy),0),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)),this._toggleButtons()},_nextImage:function(i){this._ui.slideshow.next.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active+1),i&&(i.preventDefault(),i.stopPropagation()))},_previousImage:function(i){this._ui.slideshow.previous.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active-1),i&&(i.preventDefault(),i.stopPropagation()))},moveToImage:function(i){var e,t=(i-3)*this._thumbnailWidth,s=t+5*this._thumbnailWidth,a=this._thumbnailOffset,n=this._thumbnailOffset+this._thumbnailContainerWidth,h=!1;if((tn)&&(h=!0),h)if(e=0,tn;)e++,n+=this._thumbnailWidth;this._next(null,e)}},_toggleButtons:function(){this._thumbnailOffset>0?this._ui.buttonPrevious.addClass("pointer"):this._ui.buttonPrevious.removeClass("pointer");var i=this._images.length*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight;this._thumbnailOffset>=i?this._ui.buttonNext.removeClass("pointer"):this._ui.buttonNext.addClass("pointer"),this._active>0?this._ui.slideshow.previous.addClass("pointer"):this._ui.slideshow.previous.removeClass("pointer"),this._active+1').appendTo(this._ui.imageList)).data("index",this._images.length).data("objectID",s.objectID).click($.proxy(this._showImage,this)),(n=a.children("img")).get(0).complete?(a.removeClass("loading"),this.options.staticViewer&&this._fixThumbnailDimensions(n)):(h=this,n.on("load",(function(){var i=$(this);i.parent().removeClass("loading"),h.options.staticViewer&&h._fixThumbnailDimensions(i)}))),s.listItem=a,this._images.push(s)},_fixThumbnailDimensions:function(i){var e,t,s,a=new Image;a.src=i.prop("src"),(e=a.height)==(t=a.width)?e=t=80:e img, .attachmentThumbnailImage > img").first()).length||(a=s.parentsUntil(".formAttachmentList").last().find(".attachmentTinyThumbnail")),i.push({image:{fullURL:a.data("source")?a.data("source").replace(/\\\//g,"/"):s.prop("href"),link:"",title:s.prop("title"),url:s.prop("href")},series:null,thumbnail:{url:a.prop("src")},user:null}))}.bind(this)),this._items=i.length,i},_success:function(i,e,t){var s,a;i.returnValues.items&&(this._items=i.returnValues.items),s=this._initUI(),this._createThumbnails(i.returnValues.images),a=i.returnValues.targetImageID?i.returnValues.targetImageID:0,this._render(s,a),this._isOpen||(this._isOpen=!0,WCF.System.DisableScrolling.disable(),WCF.System.DisableZoom.disable())}}); })(this); // WCF.Label.js (function (window, undefined) { "use strict";WCF.Label={},WCF.Label.ACPList=Class.extend({_labelInput:{},_labelList:{},init:function(){},_keyPressed:function(){}}),WCF.Label.ACPList.Connect=Class.extend({init:function(){},_click:function(){}}),WCF.Label.Chooser=Class.extend({_container:null,_groups:{},_showWithoutSelection:!1,init:function(t,e,n,i){var a,o,s,l;if(this._container=null,this._groups={},this._showWithoutSelection=!0===i,this._initContainers(e),$.getLength(t))for(a in t)(o=this._groups[a])&&WCF.Dropdown.getDropdownMenu(o.wcfIdentify()).find("> ul > li:not(.dropdownDivider)").each($.proxy((function(e,n){var i=$(n),o=i.data("labelID")||0;o&&t[a]==o&&this._selectLabel(i,!0)}),this));for(s in this._containers)void 0===(l=this._containers[s]).data("labelID")&&l.data("labelID",0);this._container=$(e),n?$(n).click($.proxy(this._submit,this)):this._container.is("form")&&this._container.submit($.proxy(this._submit,this))},_initContainers:function(t){function e(t){t.addEventListener("wheel",(function(t){t.preventDefault()}),{passive:!1})}$(t).find(".labelChooser").each($.proxy((function(t,n){var i,a,o,s,l=$(n),r=l.data("groupID");this._groups[r]||(i=l.wcfIdentify(),null===(a=WCF.Dropdown.getDropdownMenu(i))&&(WCF.Dropdown.initDropdown(l.find(".dropdownToggle")),a=WCF.Dropdown.getDropdownMenu(i)),o=a,"div"==a.getTagName()&&a.children(".scrollableDropdownMenu").length&&(o=$("
                  ").appendTo(a),a=a.children(".scrollableDropdownMenu")),this._groups[r]=l,a.children("li").data("groupID",r).click($.proxy(this._click,this)),l.data("forceSelection")&&!this._showWithoutSelection||$('
                • '+WCF.Language.get("wcf.label.withoutSelection")+"
                • ").data("groupID",r).appendTo(o).click($.proxy(this._click,this))[0]),l.data("forceSelection")||((s=$('
                • '+WCF.Language.get("wcf.label.none")+"
                • ").data("groupID",r).appendTo(o)).click($.proxy(this._click,this)),e(s[0])))}),this))},_click:function(t){this._selectLabel($(t.currentTarget),!1)},_selectLabel:function(t,e){var n=this._groups[t.data("groupID")];e&&void 0!==n.data("labelID")||(t.data("labelID")?n.data("labelID",t.data("labelID")):n.data("labelID",0),t=t.find("span > span"),n.find(".dropdownToggle > span").removeClass().addClass(t.attr("class")).text(t.text()),!e&&this._container[0]&&"FORM"===this._container[0].nodeName&&null===elBySel('input:not([type="hidden"]):not([type="submit"]):not([type="reset"]), select, textarea',this._container[0])&&setTimeout(function(){this._container.trigger("submit")}.bind(this),100))},_submit:function(){var t,e,n=this._container.find(".formSubmit");for(t in n.find('input[type="hidden"]').each((function(t,e){var n=$(e);0===n.attr("name").indexOf("labelIDs[")&&n.remove()})),this._groups)(e=this._groups[t]).data("labelID")&&$('').appendTo(n)},destroy:function(){for(var t in this._groups)WCF.Dropdown.destroy(this._groups[t].wcfIdentify())}}),WCF.Label.ArticleLabelChooser=WCF.Label.Chooser.extend({_labelGroupsToCategories:{},init:function(){},_updateLabelGroups:function(){},_submit:function(){}}); })(this); -- 2.20.1