From bfb24d9e9bafb0e8ce4f7c58b5659cd819800d23 Mon Sep 17 00:00:00 2001 From: "woltlab.com" Date: Tue, 11 Feb 2014 01:00:52 +0100 Subject: [PATCH] Updating minified JavaScript files --- wcfsetup/install/files/js/WCF.ImageViewer.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.min.js b/wcfsetup/install/files/js/WCF.ImageViewer.min.js index 0f86323297..0826cbc055 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()}}}}); \ No newline at end of file +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,_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._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(){if(this._isOpen){return false}if(this._images.length===0){this._loadNextImages()}else{this._render();if(this._items>1&&this._slideshowEnabled){this.startSlideshow()}}this._isOpen=true;return true},close:function(){if(!this._isOpen){return false}this._container.removeClass("open");if(this._timer!==null){this._timer.stop()}this._isOpen=false;return true},startSlideshow:function(){if(this._slideshowEnabled){return false}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);this._slideshowEnabled=true;this._ui.slideshow.toggle.children("span").removeClass("icon-play").addClass("icon-pause");return true},stopSlideshow:function(){if(!this._slideshowEnabled){return false}this._timer.stop();this._ui.slideshow.toggle.children("span").removeClass("icon-pause").addClass("icon-play");this._slideshowEnabled=false;return true},_render:function(b){this._container.addClass("open");if(b){var a=this._ui.imageList.children("li:eq(0)");this._thumbnailMarginRight=parseInt(a.css("marginRight").replace(/px$/,""))||0;this._thumbnailWidth=a.outerWidth(true);this._thumbnailContainerWidth=this._ui.imageList.parent().innerWidth();a.trigger("click");if(this._items>1&&this.options.enableSlideshow){this.startSlideshow()}}this._toggleButtons();this._preload()},_preload:function(){if(this._images.length div > a").prop("href",f.user.link).prop("title",f.user.username);b.children("img").prop("src",f.user.avatarURL);var g=WCF.String.escapeHTML(f.image.title);if(f.image.link){g=''+f.image.title+""}this._ui.header.find("> div > h1").html(g);var a=(f.series&&f.series.title?WCF.String.escapeHTML(f.series.title):"");if(f.series.link){a=''+a+""}this._ui.header.find("> div > h2").html(a);this._ui.header.find("> div > h3").text((f.listItem.data("index")+1)+" von "+this._items);this._ui.slideshow.full.data("link",(f.image.fullURL?f.image.fullURL:f.image.url));this.moveToImage(f.listItem.data("index"));this._toggleButtons();return true},_renderImage:function(c,h,e){if(!h){c=this._activeImage;h=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",h.image.url);var d=h.image.height;var b=h.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);var g=Math.floor((e.height-d)/2);this._ui.images[c].css({height:d+"px",left:f+"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=$("
      ").appendTo(c);var d=$('
    • ').appendTo(e);var f=$('
    • ').appendTo(e);var b=$('
    • ').appendTo(e);var h=$('
    • ').appendTo(e);var a=$('
    • ').appendTo(e);this._ui={buttonNext:g.children("span.wcfImageViewerButtonNext"),buttonPrevious:g.children("span.wcfImageViewerButtonPrevious"),header:$('

      ').appendTo(this._container),imageContainer:c,images:[c.children("img:eq(0)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){$(this).removeClass("animateTransformation")}),c.children("img:eq(1)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){$(this).removeClass("animateTransformation")})],imageList:g.find("> div > ul"),slideshow:{container:e,enlarge:h,full:a,next:b,previous:d,toggle:f}};this._ui.buttonNext.click($.proxy(this._next,this));this._ui.buttonPrevious.click($.proxy(this._previous,this));b.click($.proxy(this._nextImage,this));d.click($.proxy(this._previousImage,this));h.click($.proxy(this._toggleView,this));f.click($.proxy(function(){if(this._slideshowEnabled){this.stopSlideshow()}else{this.startSlideshow()}},this));a.click(function(i){window.location=$(i.currentTarget).data("link")});$('').appendTo(this._ui.header).click($.proxy(this.close,this));return true},_toggleView:function(){this._ui.images[this._activeImage].addClass("animateTransformation");this._container.toggleClass("maximized");this._ui.slideshow.enlarge.toggleClass("active").children("span").toggleClass("icon-resize-full").toggleClass("icon-resize-small");this._renderImage(null,undefined,null)},_next:function(c,b){if(this._ui.buttonNext.hasClass("pointer")){if(b==undefined){this.stopSlideshow()}var a=Math.max((this._items*this._thumbnailWidth)-this._thumbnailContainerWidth-this._thumbnailMarginRight,0);this._thumbnailOffset=Math.min(this._thumbnailOffset+(this._thumbnailWidth*(b?b:this.options.shiftBy)),a);this._ui.imageList.css("marginLeft",(this._thumbnailOffset*-1))}this._preload();this._toggleButtons()},_previous:function(b,a){if(this._ui.buttonPrevious.hasClass("pointer")){if(a==undefined){this.stopSlideshow()}this._thumbnailOffset=Math.max(this._thumbnailOffset-(this._thumbnailWidth*(a?a:this.options.shiftBy)),0);this._ui.imageList.css("marginLeft",(this._thumbnailOffset*-1))}this._toggleButtons()},_nextImage:function(a){if(this._ui.slideshow.next.hasClass("pointer")){this.stopSlideshow();this.showImage(this._active+1)}},_previousImage:function(a){if(this._ui.slideshow.previous.hasClass("pointer")){this.stopSlideshow();this.showImage(this._active-1)}},moveToImage:function(b){var f=(b-3)*this._thumbnailWidth;var d=f+(this._thumbnailWidth*5);var e=this._thumbnailOffset;var a=this._thumbnailOffset+this._thumbnailContainerWidth;var g=false;if(fa){g=true}if(g){var c=0;if(fa){c++;a+=this._thumbnailWidth}this._next(null,c)}}},_toggleButtons:function(){if(this._thumbnailOffset>0){this._ui.buttonPrevious.addClass("pointer")}else{this._ui.buttonPrevious.removeClass("pointer")}var a=(this._images.length*this._thumbnailWidth)-this._thumbnailContainerWidth-this._thumbnailMarginRight;if(this._thumbnailOffset>=a){this._ui.buttonNext.removeClass("pointer")}else{this._ui.buttonNext.addClass("pointer")}if(this._active>0){this._ui.slideshow.previous.addClass("pointer")}else{this._ui.slideshow.previous.removeClass("pointer")}if(this._active+1').appendTo(this._ui.imageList);b.data("index",this._images.length).click($.proxy(this._showImage,this));c.listItem=b;this._images.push(c)}},_loadNextImages:function(){this._proxy.setOption("data",{actionName:"loadNextImages",className:this.options.className,interfaceName:"wcf\\data\\IImageViewerAction",objectIDs:[this.element.data("objectID")],parameters:{maximumHeight:this._maxDimensions.height,maximumWidth:this._maxDimensions.width,offset:this._images.length}});this._proxy.sendRequest()},_success:function(c,d,b){if(c.returnValues.items){this._items=c.returnValues.items}var a=this._initUI();this._createThumbnails(c.returnValues.images);this._render(a)}}); \ No newline at end of file -- 2.20.1