From: woltlab.com Date: Fri, 20 Jun 2014 19:46:16 +0000 (+0200) Subject: Updating minified JavaScript files X-Git-Tag: 2.0.8~30 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f280ee8e1a25bc53a1ab595e0d5df427e9e77013;p=GitHub%2FWoltLab%2FWCF.git Updating minified JavaScript files --- diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.min.js b/wcfsetup/install/files/js/WCF.ImageViewer.min.js index c1d476a63c..a0554ac562 100755 --- a/wcfsetup/install/files/js/WCF.ImageViewer.min.js +++ b/wcfsetup/install/files/js/WCF.ImageViewer.min.js @@ -1 +1 @@ -WCF.ImageViewer=Class.extend({init:function(){$('').appendTo($("#lbPrevLink"));$('').appendTo($("#lbNextLink"));$('').appendTo($("#lbCloseLink"));var a=$('').insertAfter($("#lbCloseLink"));a.click($.proxy(this._enlarge,this));this._initImageViewer();WCF.DOMNodeInsertedHandler.addCallback("WCF.ImageViewer",$.proxy(this._domNodeInserted,this));WCF.DOMNodeInsertedHandler.execute()},_domNodeInserted:function(){this._initImageSizeCheck();this._initImageViewer()},_initImageViewer:function(){if($.browser.touch&&/[Mm]obile/.test(navigator.userAgent)){if(!/iPad/.test(navigator.userAgent)){return}}var a=$("a.jsImageViewer");if(a.length){a.removeClass("jsImageViewer").slimbox({counterText:WCF.Language.get("wcf.imageViewer.counter"),loop:true})}},_enlarge:function(){var a=$("#lbImage").css("backgroundImage");if(a){a=a.replace(/^url\((["']?)(.*)\1\)$/,"$2");window.location=a}},_initImageSizeCheck:function(){$(".jsResizeImage").each($.proxy(function(a,b){if(b.complete){this._checkImageSize({currentTarget:b})}},this));$(".jsResizeImage").on("load",$.proxy(this._checkImageSize,this))},_checkImageSize:function(d){var c=$(d.currentTarget);if(!c.is(":visible")){c.off("load");return}c.removeClass("jsResizeImage");var b=c.getDimensions();var a=c.parents("div").innerWidth();if(b.width>a){c.css({height:Math.round(b.height*(a/b.width))+"px",width:a+"px"});if(!c.parents("a").length){c.wrap('');c.parent().slimbox()}}}});$.widget("ui.wcfImageViewer",{_active:-1,_activeImage:null,_container:null,_didInit:false,_disableSlideshow:false,_eventNamespace:"",_images:[],_isOpen:false,_items:-1,_maxDimensions:{height:0,width:0},_proxy:null,_slideshowEnabled:false,_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:""},_create:function(){this._active=-1;this._activeImage=null;this._container=null;this._didInit=false;this._disableSlideshow=(this.element.data("disableSlideshow"));this._eventNamespace=this.element.wcfIdentify();this._images=[];this._isOpen=false;this._items=-1;this._maxDimensions={height:document.documentElement.clientHeight,width:document.documentElement.clientWidth};this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._slideshowEnabled=false;this._thumbnailContainerWidth=0;this._thumbnailMarginRight=0;this._thumbnailOffset=0;this._thumbnaiLWidth=0;this._timer=null;this._ui={};this.element.click($.proxy(this.open,this))},open:function(a){if(a){a.preventDefault()}if(this._isOpen){return false}if(this._images.length===0){this._loadNextImages(true)}else{this._render(false,this.element.data("targetImageID"));if(this._items>1&&this._slideshowEnabled){this.startSlideshow()}}this._bindListener();this._isOpen=true;WCF.System.DisableScrolling.disable();return true},close:function(a){if(a){a.preventDefault()}if(!this._isOpen){return false}this._container.removeClass("open");if(this._timer!==null){this._timer.stop()}this._unbindListener();this._isOpen=false;WCF.System.DisableScrolling.enable();return true},startSlideshow:function(){if(this._disableSlideshow||this._slideshowEnabled){return false}if(this._timer===null){this._timer=new WCF.PeriodicalExecuter($.proxy(function(){var a=this._active+1;if(a==this._items){a=0}this.showImage(a)},this),this.options.speed*1000)}else{this._timer.resume()}this._slideshowEnabled=true;this._ui.slideshow.toggle.children("span").removeClass("icon-play").addClass("icon-pause");return true},stopSlideshow:function(a){if(!this._slideshowEnabled){return false}this._timer.stop();if(a){this._ui.slideshow.toggle.children("span").removeClass("icon-pause").addClass("icon-play")}this._slideshowEnabled=false;return true},_bindListener:function(){$(document).on("keydown."+this._eventNamespace,$.proxy(this._keyDown,this));$(window).on("resize."+this._eventNamespace,$.proxy(this._renderImage,this))},_unbindListener:function(){$(document).off("keydown."+this._eventNamespace);$(window).off("resize."+this._eventNamespace)},_keyDown:function(b){switch(b.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:if(!this._container.hasClass("maximized")){this._toggleView()}break;case $.ui.keyCode.DOWN:if(this._container.hasClass("maximized")){this._toggleView()}break;case $.ui.keyCode.ENTER:var a=this._ui.header.find("> div > h1 > a");if(a.length==1){window.location=a.prop("href")}else{this._ui.slideshow.full.trigger("click")}break;case 80:this._ui.slideshow.toggle.trigger("click");break;default:return true;break}return false},_render:function(c,a){this._container.addClass("open");var b=null;if(c){b=this._ui.imageList.children("li:eq(0)");this._thumbnailMarginRight=parseInt(b.css("marginRight").replace(/px$/,""))||0;this._thumbnailWidth=b.outerWidth(true);this._thumbnailContainerWidth=this._ui.imageList.parent().innerWidth();if(this._items>1&&this.options.enableSlideshow&&!a){this.startSlideshow()}}if(a){this._ui.imageList.children("li").each($.proxy(function(e,f){var d=$(f);if(d.data("objectID")==a){d.trigger("click");this.moveToImage(d.data("index"));return false}},this))}else{if(b!==null){b.trigger("click")}}this._toggleButtons();this._preload()},_preload:function(){if(this._images.length div > a").prop("href",b.user.link).prop("title",b.user.username);f.children("img").prop("src",b.user.avatarURL);var h=WCF.String.escapeHTML(b.image.title);if(b.image.link){h=''+b.image.title+""}this._ui.header.find("> div > h1").html(h);var d=(b.series&&b.series.title?WCF.String.escapeHTML(b.series.title):"");if(b.series.link){d=''+d+""}this._ui.header.find("> div > h2").html(d);this._ui.header.find("> div > h3").text(WCF.Language.get("wcf.imageViewer.seriesIndex").replace(/{x}/,b.listItem.data("index")+1).replace(/{y}/,this._items));this._ui.slideshow.full.data("link",(b.image.fullURL?b.image.fullURL:b.image.url));this.moveToImage(b.listItem.data("index"));this._toggleButtons();return true},_imageOnLoad:function(b,a){if(b!=this._active){return}this._ui.imageContainer.removeClass("loading");this._ui.images[a].addClass("active");this.startSlideshow()},_renderImage:function(c,g,e){if(!g){c=this._activeImage;g=this._images[this._active];e={height:$(window).height()-(this._container.hasClass("maximized")?0:200),width:this._ui.imageContainer.innerWidth()}}e.height-=22;e.width-=20;this._ui.images[c].prop("src",g.image.url);var d=g.image.height;var b=g.image.width;var a=0;if(d>e.height){a=e.height/d;d=e.height;b=Math.floor(b*a)}if(b>e.width){a=e.width/b;b=e.width;d=Math.floor(d*a)}var f=Math.floor((e.width-b)/2);this._ui.images[c].css({height:d+"px",left:(f+10)+"px",marginTop:(Math.round(d/2)*-1)+"px",width:b+"px"})},_initUI:function(){if(this._didInit){return false}this._didInit=true;this._container=$('
').appendTo(document.body);var c=$('
').appendTo(this._container);var g=$('
    ').appendTo(this._container);var e=$("