diff --git a/api/js/jquery/blueimp/js/blueimp-gallery.min.js b/api/js/jquery/blueimp/js/blueimp-gallery.min.js index 7f52910727..7312261f1b 100644 --- a/api/js/jquery/blueimp/js/blueimp-gallery.min.js +++ b/api/js/jquery/blueimp/js/blueimp-gallery.min.js @@ -1,2 +1,2 @@ -(function(){(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["./blueimp-helper"],factory)}else{window.blueimp=window.blueimp||{};window.blueimp.Gallery=factory(window.blueimp.helper||window.jQuery)}})(function($){"use strict";function Gallery(list,options){if(document.body.style.maxHeight===undefined){return null}if(!this||this.options!==Gallery.prototype.options){return new Gallery(list,options)}if(!list||!list.length){this.console.log("blueimp Gallery: No or empty list provided as first argument.",list);return}this.list=list;this.num=list.length;this.initOptions(options);this.initialize()}$.extend(Gallery.prototype,{options:{container:"#blueimp-gallery",slidesContainer:"div",titleElement:"h3",displayClass:"blueimp-gallery-display",controlsClass:"blueimp-gallery-controls",singleClass:"blueimp-gallery-single",leftEdgeClass:"blueimp-gallery-left",rightEdgeClass:"blueimp-gallery-right",playingClass:"blueimp-gallery-playing",slideClass:"slide",slideLoadingClass:"slide-loading",slideErrorClass:"slide-error",slideContentClass:"slide-content",toggleClass:"toggle",prevClass:"prev",nextClass:"next",closeClass:"close",playPauseClass:"play-pause",fullscreenClass:"fullscreen",downloadClass:"download",typeProperty:"type",titleProperty:"title",urlProperty:"href",displayTransition:true,clearSlides:true,stretchImages:false,toggleControlsOnReturn:true,toggleSlideshowOnSpace:true,toggleFullscreenOnSlideShow:false,enableKeyboardNavigation:true,closeOnEscape:true,hideControlsOnSlideshow:false,closeOnSlideClick:true,closeOnSwipeUpOrDown:true,emulateTouchEvents:true,stopTouchEventsPropagation:false,hidePageScrollbars:true,disableScroll:true,carousel:false,continuous:true,unloadElements:true,startSlideshow:false,slideshowInterval:5e3,index:0,preloadRange:2,transitionSpeed:400,slideshowTransitionSpeed:undefined,event:undefined,onopen:undefined,onopened:undefined,onslide:undefined,onslideend:undefined,onslidecomplete:undefined,onclose:undefined,onclosed:undefined},carouselOptions:{hidePageScrollbars:false,toggleControlsOnReturn:false,toggleSlideshowOnSpace:false,enableKeyboardNavigation:false,closeOnEscape:false,closeOnSlideClick:false,closeOnSwipeUpOrDown:false,disableScroll:false,startSlideshow:true},console:window.console&&typeof window.console.log==="function"?window.console:{log:function(){}},support:function(element){var support={touch:window.ontouchstart!==undefined||window.DocumentTouch&&document instanceof DocumentTouch},transitions={webkitTransition:{end:"webkitTransitionEnd",prefix:"-webkit-"},MozTransition:{end:"transitionend",prefix:"-moz-"},OTransition:{end:"otransitionend",prefix:"-o-"},transition:{end:"transitionend",prefix:""}},elementTests=function(){var transition=support.transition,prop,translateZ;document.body.appendChild(element);if(transition){prop=transition.name.slice(0,-9)+"ransform";if(element.style[prop]!==undefined){element.style[prop]="translateZ(0)";translateZ=window.getComputedStyle(element).getPropertyValue(transition.prefix+"transform");support.transform={prefix:transition.prefix,name:prop,translate:true,translateZ:!!translateZ&&translateZ!=="none"}}}if(element.style.backgroundSize!==undefined){support.backgroundSize={};element.style.backgroundSize="contain";support.backgroundSize.contain=window.getComputedStyle(element).getPropertyValue("background-size")==="contain";element.style.backgroundSize="cover";support.backgroundSize.cover=window.getComputedStyle(element).getPropertyValue("background-size")==="cover"}document.body.removeChild(element)};(function(support,transitions){var prop;for(prop in transitions){if(transitions.hasOwnProperty(prop)&&element.style[prop]!==undefined){support.transition=transitions[prop];support.transition.name=prop;break}}})(support,transitions);if(document.body){elementTests()}else{$(document).on("DOMContentLoaded",elementTests)}return support}(document.createElement("div")),requestAnimationFrame:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,initialize:function(){this.initStartIndex();if(this.initWidget()===false){return false}this.initEventListeners();this.onslide(this.index);this.ontransitionend();if(this.options.startSlideshow){this.play()}},slide:function(to,speed){window.clearTimeout(this.timeout);var index=this.index,direction,naturalDirection,diff;if(index===to||this.num===1){return}if(!speed){speed=this.options.transitionSpeed}if(this.support.transform){if(!this.options.continuous){to=this.circle(to)}direction=Math.abs(index-to)/(index-to);if(this.options.continuous){naturalDirection=direction;direction=-this.positions[this.circle(to)]/this.slideWidth;if(direction!==naturalDirection){to=-direction*this.num+to}}diff=Math.abs(index-to)-1;while(diff){diff-=1;this.move(this.circle((to>index?to:index)-diff-1),this.slideWidth*direction,0)}to=this.circle(to);this.move(index,this.slideWidth*direction,speed);this.move(to,0,speed);if(this.options.continuous){this.move(this.circle(to-direction),-(this.slideWidth*direction),0)}}else{to=this.circle(to);this.animate(index*-this.slideWidth,to*-this.slideWidth,speed)}this.onslide(to)},getIndex:function(){return this.index},getNumber:function(){return this.num},prev:function(){if(this.options.continuous||this.index){this.slide(this.index-1)}},next:function(){if(this.options.continuous||this.index1){this.timeout=this.setTimeout(!this.requestAnimationFrame&&this.slide||function(to,speed){that.animationFrameId=that.requestAnimationFrame.call(window,function(){that.slide(to,speed)})},[this.index+1,this.options.slideshowTransitionSpeed],this.interval)}this.container.addClass(this.options.playingClass)},pause:function(){window.clearTimeout(this.timeout);this.interval=null;this.container.removeClass(this.options.playingClass)},add:function(list){var i;if(!list.concat){list=Array.prototype.slice.call(list)}if(!this.list.concat){this.list=Array.prototype.slice.call(this.list)}this.list=this.list.concat(list);this.num=this.list.length;if(this.num>2&&this.options.continuous===null){this.options.continuous=true;this.container.removeClass(this.options.leftEdgeClass)}this.container.removeClass(this.options.rightEdgeClass).removeClass(this.options.singleClass);for(i=this.num-list.length;ispeed){that.slidesContainer[0].style.left=to+"px";that.ontransitionend();window.clearInterval(timer);return}that.slidesContainer[0].style.left=(to-from)*(Math.floor(timeElap/speed*100)/100)+from+"px"},4)},preventDefault:function(event){if(event.preventDefault){event.preventDefault()}else{event.returnValue=false}},stopPropagation:function(event){if(event.stopPropagation){event.stopPropagation()}else{event.cancelBubble=true}},onresize:function(){this.initSlides(true)},onmousedown:function(event){if(event.which&&event.which===1&&event.target.nodeName!=="VIDEO"){event.preventDefault();(event.originalEvent||event).touches=[{pageX:event.pageX,pageY:event.pageY}];this.ontouchstart(event)}},onmousemove:function(event){if(this.touchStart){(event.originalEvent||event).touches=[{pageX:event.pageX,pageY:event.pageY}];this.ontouchmove(event)}},onmouseup:function(event){if(this.touchStart){this.ontouchend(event);delete this.touchStart}},onmouseout:function(event){if(this.touchStart){var target=event.target,related=event.relatedTarget;if(!related||related!==target&&!$.contains(target,related)){this.onmouseup(event)}}},ontouchstart:function(event){if(this.options.stopTouchEventsPropagation){this.stopPropagation(event)}var touches=(event.originalEvent||event).touches[0];this.touchStart={x:touches.pageX,y:touches.pageY,time:Date.now()};this.isScrolling=undefined;this.touchDelta={}},ontouchmove:function(event){if(this.options.stopTouchEventsPropagation){this.stopPropagation(event)}var touches=(event.originalEvent||event).touches[0],scale=(event.originalEvent||event).scale,index=this.index,touchDeltaX,indices;if(touches.length>1||scale&&scale!==1){return}if(this.options.disableScroll){event.preventDefault()}this.touchDelta={x:touches.pageX-this.touchStart.x,y:touches.pageY-this.touchStart.y};touchDeltaX=this.touchDelta.x;if(this.isScrolling===undefined){this.isScrolling=this.isScrolling||Math.abs(touchDeltaX)0||index===this.num-1&&touchDeltaX<0?Math.abs(touchDeltaX)/this.slideWidth+1:1);indices=[index];if(index){indices.push(index-1)}if(index20||Math.abs(this.touchDelta.x)>slideWidth/2,isPastBounds=!index&&this.touchDelta.x>0||index===this.num-1&&this.touchDelta.x<0,isValidClose=!isValidSlide&&this.options.closeOnSwipeUpOrDown&&(isShortDuration&&Math.abs(this.touchDelta.y)>20||Math.abs(this.touchDelta.y)>this.slideHeight/2),direction,indexForward,indexBackward,distanceForward,distanceBackward;if(this.options.continuous){isPastBounds=false}direction=this.touchDelta.x<0?-1:1;if(!this.isScrolling){if(isValidSlide&&!isPastBounds){indexForward=index+direction;indexBackward=index-direction;distanceForward=slideWidth*direction;distanceBackward=-slideWidth*direction;if(this.options.continuous){this.move(this.circle(indexForward),distanceForward,0);this.move(this.circle(index-2*direction),distanceBackward,0)}else if(indexForward>=0&&indexForwardthis.container[0].clientHeight){target.style.maxHeight=this.container[0].clientHeight}if(this.interval&&this.slides[this.index]===parent){this.play()}this.setTimeout(this.options.onslidecomplete,[index,parent])},onload:function(event){this.oncomplete(event)},onerror:function(event){this.oncomplete(event)},onkeydown:function(event){switch(event.which||event.keyCode){case 13:if(this.options.toggleControlsOnReturn){this.preventDefault(event);this.toggleControls()}break;case 27:if(this.options.closeOnEscape){this.close()}break;case 32:if(this.options.toggleSlideshowOnSpace){this.preventDefault(event);this.toggleSlideshow()}break;case 37:if(this.options.enableKeyboardNavigation){this.preventDefault(event);this.prev()}break;case 39:if(this.options.enableKeyboardNavigation){this.preventDefault(event);this.next()}break}},handleClick:function(event){var options=this.options,target=event.target||event.srcElement,parent=target.parentNode,isTarget=function(className){return $(target).hasClass(className)||$(parent).hasClass(className)};if(isTarget(options.toggleClass)){this.preventDefault(event);this.toggleControls()}else if(isTarget(options.prevClass)){this.preventDefault(event);this.prev()}else if(isTarget(options.nextClass)){this.preventDefault(event);this.next()}else if(isTarget(options.closeClass)){this.preventDefault(event);this.close()}else if(isTarget(options.playPauseClass)){this.preventDefault(event);this.toggleSlideshow()}else if(isTarget(options.fullscreenClass)){this.preventDefault(event);this.toggleFullscreen()}else if(isTarget(options.downloadClass)){if(this.list[this.getIndex()]&&typeof this.list[this.getIndex()].download_href!="undefined"){event.target.href=this.list[this.getIndex()].download_href}else{event.target.href=this.list[this.getIndex()].href}if(typeof event.target.download!="undefined"){event.target.download=this.list[this.getIndex()].title};}else if(parent===this.slidesContainer[0]){this.preventDefault(event);if(options.closeOnSlideClick){this.close()}else{this.toggleControls()}}else if(parent.parentNode&&parent.parentNode===this.slidesContainer[0]){this.preventDefault(event);this.toggleControls()}},onclick:function(event){if(this.options.emulateTouchEvents&&this.touchDelta&&(Math.abs(this.touchDelta.x)>20||Math.abs(this.touchDelta.y)>20)){delete this.touchDelta;return}return this.handleClick(event)},updateEdgeClasses:function(index){if(!index){this.container.addClass(this.options.leftEdgeClass)}else{this.container.removeClass(this.options.leftEdgeClass)}if(index===this.num-1){this.container.addClass(this.options.rightEdgeClass)}else{this.container.removeClass(this.options.rightEdgeClass)}},handleSlide:function(index){if(!this.options.continuous){this.updateEdgeClasses(index)}this.loadElements(index);if(this.options.unloadElements){this.unloadElements(index)}this.setTitle(index)},onslide:function(index){this.index=index;this.handleSlide(index);this.setTimeout(this.options.onslide,[index,this.slides[index]])},setTitle:function(index){var text=this.slides[index].firstChild.title,titleElement=this.titleElement;if(titleElement.length){this.titleElement.empty();if(text){titleElement[0].appendChild(document.createTextNode(text))}}},setTimeout:function(func,args,wait){var that=this;return func&&window.setTimeout(function(){func.apply(that,args||[])},wait||0)},imageFactory:function(obj,callback){var that=this,img=this.imagePrototype.cloneNode(false),url=obj,backgroundSize=this.options.stretchImages,called,element,callbackWrapper=function(event){if(!called){event={type:event.type,target:element};if(!element.parentNode){return that.setTimeout(callbackWrapper,[event])}called=true;$(img).off("load error",callbackWrapper);if(backgroundSize){if(event.type==="load"){element.style.background='url("'+url+'") center no-repeat';element.style.backgroundSize=backgroundSize}}callback(event)}},title;if(typeof url!=="string"){url=this.getItemProperty(obj,this.options.urlProperty);title=this.getItemProperty(obj,this.options.titleProperty)}if(backgroundSize===true){backgroundSize="contain"}backgroundSize=this.support.backgroundSize&&this.support.backgroundSize[backgroundSize]&&backgroundSize;if(backgroundSize){element=this.elementPrototype.cloneNode(false)}else{element=img;img.draggable=false}if(title){element.title=title}$(img).on("load error",callbackWrapper);img.src=url;return element},createElement:function(obj,callback){var type=obj&&this.getItemProperty(obj,this.options.typeProperty),factory=type&&this[type.split("/")[0]+"Factory"]||this.imageFactory,element=obj&&factory.call(this,obj,callback);if(!element){element=this.elementPrototype.cloneNode(false);this.setTimeout(callback,[{type:"error",target:element}])}$(element).addClass(this.options.slideContentClass);return element},loadElement:function(index){if(!this.elements[index]){if(this.slides[index].firstChild){this.elements[index]=$(this.slides[index]).hasClass(this.options.slideErrorClass)?3:2}else{this.elements[index]=1;$(this.slides[index]).addClass(this.options.slideLoadingClass);this.slides[index].appendChild(this.createElement(this.list[index],this.proxyListener))}}},loadElements:function(index){var limit=Math.min(this.num,this.options.preloadRange*2+1),j=index,i;for(i=0;ithis.options.preloadRange&&diff+this.options.preloadRangeindex?-this.slideWidth:this.indexindex?to:index)-diff-1),this.slideWidth*direction,0)}to=this.circle(to);this.move(index,this.slideWidth*direction,speed);this.move(to,0,speed);if(this.options.continuous){this.move(this.circle(to-direction),-(this.slideWidth*direction),0)}}else{to=this.circle(to);this.animate(index*-this.slideWidth,to*-this.slideWidth,speed)}this.onslide(to)},getIndex:function(){return this.index},getNumber:function(){return this.num},prev:function(){if(this.options.continuous||this.index){this.slide(this.index-1)}},next:function(){if(this.options.continuous||this.index1){this.timeout=this.setTimeout(!this.requestAnimationFrame&&this.slide||function(to,speed){that.animationFrameId=that.requestAnimationFrame.call(window,function(){that.slide(to,speed)})},[this.index+1,this.options.slideshowTransitionSpeed],this.interval)}this.container.addClass(this.options.playingClass)},pause:function(){window.clearTimeout(this.timeout);this.interval=null;this.container.removeClass(this.options.playingClass)},add:function(list){var i;if(!list.concat){list=Array.prototype.slice.call(list)}if(!this.list.concat){this.list=Array.prototype.slice.call(this.list)}this.list=this.list.concat(list);this.num=this.list.length;if(this.num>2&&this.options.continuous===null){this.options.continuous=true;this.container.removeClass(this.options.leftEdgeClass)}this.container.removeClass(this.options.rightEdgeClass).removeClass(this.options.singleClass);for(i=this.num-list.length;ispeed){that.slidesContainer[0].style.left=to+"px";that.ontransitionend();window.clearInterval(timer);return}that.slidesContainer[0].style.left=(to-from)*(Math.floor(timeElap/speed*100)/100)+from+"px"},4)},preventDefault:function(event){if(event.preventDefault){event.preventDefault()}else{event.returnValue=false}},stopPropagation:function(event){if(event.stopPropagation){event.stopPropagation()}else{event.cancelBubble=true}},onresize:function(){this.initSlides(true)},onmousedown:function(event){if(event.which&&event.which===1&&event.target.nodeName!=="VIDEO"){event.preventDefault();(event.originalEvent||event).touches=[{pageX:event.pageX,pageY:event.pageY}];this.ontouchstart(event)}},onmousemove:function(event){if(this.touchStart){(event.originalEvent||event).touches=[{pageX:event.pageX,pageY:event.pageY}];this.ontouchmove(event)}},onmouseup:function(event){if(this.touchStart){this.ontouchend(event);delete this.touchStart}},onmouseout:function(event){if(this.touchStart){var target=event.target,related=event.relatedTarget;if(!related||related!==target&&!$.contains(target,related)){this.onmouseup(event)}}},ontouchstart:function(event){if(this.options.stopTouchEventsPropagation){this.stopPropagation(event)}var touches=(event.originalEvent||event).touches[0];this.touchStart={x:touches.pageX,y:touches.pageY,time:Date.now()};this.isScrolling=undefined;this.touchDelta={}},ontouchmove:function(event){if(this.options.stopTouchEventsPropagation){this.stopPropagation(event)}var touches=(event.originalEvent||event).touches[0],scale=(event.originalEvent||event).scale,index=this.index,touchDeltaX,indices;if(touches.length>1||scale&&scale!==1){return}if(this.options.disableScroll){event.preventDefault()}this.touchDelta={x:touches.pageX-this.touchStart.x,y:touches.pageY-this.touchStart.y};touchDeltaX=this.touchDelta.x;if(this.isScrolling===undefined){this.isScrolling=this.isScrolling||Math.abs(touchDeltaX)0||index===this.num-1&&touchDeltaX<0?Math.abs(touchDeltaX)/this.slideWidth+1:1);indices=[index];if(index){indices.push(index-1)}if(index20||Math.abs(this.touchDelta.x)>slideWidth/2,isPastBounds=!index&&this.touchDelta.x>0||index===this.num-1&&this.touchDelta.x<0,isValidClose=!isValidSlide&&this.options.closeOnSwipeUpOrDown&&(isShortDuration&&Math.abs(this.touchDelta.y)>20||Math.abs(this.touchDelta.y)>this.slideHeight/2),direction,indexForward,indexBackward,distanceForward,distanceBackward;if(this.options.continuous){isPastBounds=false}direction=this.touchDelta.x<0?-1:1;if(!this.isScrolling){if(isValidSlide&&!isPastBounds){indexForward=index+direction;indexBackward=index-direction;distanceForward=slideWidth*direction;distanceBackward=-slideWidth*direction;if(this.options.continuous){this.move(this.circle(indexForward),distanceForward,0);this.move(this.circle(index-2*direction),distanceBackward,0)}else if(indexForward>=0&&indexForwardthis.container[0].clientHeight){target.style.maxHeight=this.container[0].clientHeight}if(this.interval&&this.slides[this.index]===parent){this.play()}this.setTimeout(this.options.onslidecomplete,[index,parent])},onload:function(event){this.oncomplete(event)},onerror:function(event){this.oncomplete(event)},onkeydown:function(event){switch(event.which||event.keyCode){case 13:if(this.options.toggleControlsOnReturn){this.preventDefault(event);this.toggleControls()}break;case 27:if(this.options.closeOnEscape){this.close()}break;case 32:if(this.options.toggleSlideshowOnSpace){this.preventDefault(event);this.toggleSlideshow()}break;case 37:if(this.options.enableKeyboardNavigation){this.preventDefault(event);this.prev()}break;case 39:if(this.options.enableKeyboardNavigation){this.preventDefault(event);this.next()}break}},handleClick:function(event){var options=this.options,target=event.target||event.srcElement,parent=target.parentNode,isTarget=function(className){return $(target).hasClass(className)||$(parent).hasClass(className)};if(isTarget(options.toggleClass)){this.preventDefault(event);this.toggleControls()}else if(isTarget(options.prevClass)){this.preventDefault(event);this.prev()}else if(isTarget(options.nextClass)){this.preventDefault(event);this.next()}else if(isTarget(options.closeClass)){this.preventDefault(event);this.close()}else if(isTarget(options.playPauseClass)){this.preventDefault(event);this.toggleSlideshow()}else if(isTarget(options.fullscreenClass)){this.preventDefault(event);this.toggleFullscreen()}else if(isTarget(options.downloadClass)){if(this.list[this.getIndex()]&&typeof this.list[this.getIndex()].download_href!="undefined"){event.target.href=this.list[this.getIndex()].download_href}else{event.target.href=this.list[this.getIndex()].href}if(typeof event.target.download!="undefined"){event.target.download=this.list[this.getIndex()].title};}else if(parent===this.slidesContainer[0]){this.preventDefault(event);if(options.closeOnSlideClick){this.close()}else{this.toggleControls()}}else if(parent.parentNode&&parent.parentNode===this.slidesContainer[0]){this.preventDefault(event);this.toggleControls()}},onclick:function(event){if(this.options.emulateTouchEvents&&this.touchDelta&&(Math.abs(this.touchDelta.x)>20||Math.abs(this.touchDelta.y)>20)){delete this.touchDelta;return}return this.handleClick(event)},updateEdgeClasses:function(index){if(!index){this.container.addClass(this.options.leftEdgeClass)}else{this.container.removeClass(this.options.leftEdgeClass)}if(index===this.num-1){this.container.addClass(this.options.rightEdgeClass)}else{this.container.removeClass(this.options.rightEdgeClass)}},handleSlide:function(index){if(!this.options.continuous){this.updateEdgeClasses(index)}this.loadElements(index);if(this.options.unloadElements){this.unloadElements(index)}this.setTitle(index)},onslide:function(index){this.index=index;this.handleSlide(index);this.setTimeout(this.options.onslide,[index,this.slides[index]])},setTitle:function(index){var text=this.slides[index].firstChild.title,titleElement=this.titleElement;if(titleElement.length){this.titleElement.empty();if(text){titleElement[0].appendChild(document.createTextNode(text))}}},setTimeout:function(func,args,wait){var that=this;return func&&window.setTimeout(function(){func.apply(that,args||[])},wait||0)},imageFactory:function(obj,callback){var that=this,img=this.imagePrototype.cloneNode(false),url=obj,backgroundSize=this.options.stretchImages,called,element,callbackWrapper=function(event){if(!called){event={type:event.type,target:element};if(!element.parentNode){return that.setTimeout(callbackWrapper,[event])}called=true;$(img).off("load error",callbackWrapper);if(backgroundSize){if(event.type==="load"){element.style.background='url("'+url+'") center no-repeat';element.style.backgroundSize=backgroundSize}}callback(event)}},title;if(typeof url!=="string"){url=this.getItemProperty(obj,this.options.urlProperty);title=this.getItemProperty(obj,this.options.titleProperty)}if(backgroundSize===true){backgroundSize="contain"}backgroundSize=this.support.backgroundSize&&this.support.backgroundSize[backgroundSize]&&backgroundSize;if(backgroundSize){element=this.elementPrototype.cloneNode(false)}else{element=img;img.draggable=false}if(title){element.title=title}$(img).on("load error",callbackWrapper);img.src=url;return element},createElement:function(obj,callback){var type=obj&&this.getItemProperty(obj,this.options.typeProperty),factory=type&&this[type.split("/")[0]+"Factory"]||this.imageFactory,element=obj&&factory.call(this,obj,callback);if(!element){element=this.elementPrototype.cloneNode(false);this.setTimeout(callback,[{type:"error",target:element}])}$(element).addClass(this.options.slideContentClass);return element},loadElement:function(index){if(!this.elements[index]){if(this.slides[index].firstChild){this.elements[index]=$(this.slides[index]).hasClass(this.options.slideErrorClass)?3:2}else{this.elements[index]=1;$(this.slides[index]).addClass(this.options.slideLoadingClass);this.slides[index].appendChild(this.createElement(this.list[index],this.proxyListener))}}},loadElements:function(index){var limit=Math.min(this.num,this.options.preloadRange*2+1),j=index,i;for(i=0;ithis.options.preloadRange&&diff+this.options.preloadRangeindex?-this.slideWidth:this.index $GLOBALS['egw_info']['user']['account_lid'], - 'pass' => urlencode($GLOBALS['egw_info']['user']['passwd']), - 'host' => $GLOBALS['egw_info']['user']['domain'], - 'home' => str_replace(array('\\\\', '\\'), array('', '/'), $GLOBALS['egw_info']['user']['homedirectory']), + '$user' => $GLOBALS['egw_info']['user']['account_lid'], + '$pass' => urlencode($GLOBALS['egw_info']['user']['passwd']), + '$host' => $GLOBALS['egw_info']['user']['domain'], + '$home' => str_replace(array('\\\\', '\\'), array('', '/'), $GLOBALS['egw_info']['user']['homedirectory']), ]); } diff --git a/composer.json b/composer.json index 93063657bb..582a064f7a 100644 --- a/composer.json +++ b/composer.json @@ -54,6 +54,10 @@ "type": "vcs", "url": "https://github.com/egroupware/Compress" }, + { + "type": "vcs", + "url": "https://github.com/egroupware/Imap_Client" + }, { "type": "vcs", "url": "https://github.com/IMSGlobal/lti-1-3-php-library" @@ -93,6 +97,7 @@ "egroupware/crypt": "^2.7.13", "egroupware/guzzlestream": "dev-master", "egroupware/icalendar": "^2.1.9", + "egroupware/imap-client": "2.30.4", "egroupware/magicsuggest": "^2.1", "egroupware/news_admin": "self.version", "egroupware/openid": "self.version", @@ -109,7 +114,6 @@ "npm-asset/as-jqplot": "1.0.*", "npm-asset/gridster": "0.5.*", "oomphinc/composer-installers-extender": "^1.1", - "pear-pear.horde.org/horde_imap_client": "^2.30.3", "pear-pear.horde.org/horde_mail": "^2.1.2", "pear-pear.horde.org/horde_managesieve": "^1.0.2", "pear-pear.horde.org/horde_mapi": "^1.0.9", diff --git a/composer.lock b/composer.lock index 14487ac361..afed282afd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c413807814d716c0662b69272da98ba2", + "content-hash": "5a9ac5a19bb28961cbb8215f95ea72b9", "packages": [ { "name": "adldap2/adldap2", @@ -207,7 +207,7 @@ "version": "v2.3.4", "source": { "type": "git", - "url": "git@github.com:fengyuanchen/cropper.git", + "url": "https://github.com/fengyuanchen/cropper.git", "reference": "30c58b29ee21010e17e58ebab165fbd84285c685" }, "dist": { @@ -305,7 +305,7 @@ "version": "1.12.4", "source": { "type": "git", - "url": "git@github.com:jquery/jquery-dist.git", + "url": "https://github.com/jquery/jquery-dist.git", "reference": "5e89585e0121e72ff47de177c5ef604f3089a53d" }, "dist": { @@ -1211,16 +1211,16 @@ }, { "name": "egroupware/imap-client", - "version": "2.30.2", + "version": "2.30.4", "source": { "type": "git", "url": "https://github.com/EGroupware/Imap_Client.git", - "reference": "8d80312313188082733e45e6d674ecfe15b7eb8e" + "reference": "f7dd50133871e34a5a7560ac08626ee11e9ccc3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EGroupware/Imap_Client/zipball/8d80312313188082733e45e6d674ecfe15b7eb8e", - "reference": "8d80312313188082733e45e6d674ecfe15b7eb8e", + "url": "https://api.github.com/repos/EGroupware/Imap_Client/zipball/f7dd50133871e34a5a7560ac08626ee11e9ccc3e", + "reference": "f7dd50133871e34a5a7560ac08626ee11e9ccc3e", "shasum": "" }, "require": { @@ -1261,7 +1261,6 @@ "Horde_Imap_Client": "lib/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-2.1" ], @@ -1274,6 +1273,9 @@ ], "description": "IMAP client library", "homepage": "https://www.horde.org/libraries/Horde_Imap_Client", + "support": { + "source": "https://github.com/EGroupware/Imap_Client/tree/2.30.4" + }, "time": "2019-09-29T00:00:00+00:00" }, { diff --git a/filemanager/inc/class.filemanager_admin.inc.php b/filemanager/inc/class.filemanager_admin.inc.php index f66baf8ccb..a554c67653 100644 --- a/filemanager/inc/class.filemanager_admin.inc.php +++ b/filemanager/inc/class.filemanager_admin.inc.php @@ -154,9 +154,9 @@ class filemanager_admin extends filemanager_ui throw new Api\Exception\NoPermission(); } $url = $content['mounts']['url']['scheme'] . '://'; - if (in_array($content['mounts']['url']['scheme'], ['smb', 'webdavs', 'vfs'])) + if (in_array($content['mounts']['url']['scheme'], ['smb', 'vfs']) || !empty(trim($content['mounts']['url']['user']))) { - if (empty(trim($content['mounts']['url']['user']))) + if (in_array($content['mounts']['url']['scheme'], ['smb', 'vfs']) && empty(trim($content['mounts']['url']['user']))) { throw new Api\Exception\WrongUserinput(lang('SMB, WebDAVs and VFS require a username!')); } diff --git a/importexport/inc/class.importexport_arrayxml.inc.php b/importexport/inc/class.importexport_arrayxml.inc.php index 7247eceb5c..23f041eeec 100644 --- a/importexport/inc/class.importexport_arrayxml.inc.php +++ b/importexport/inc/class.importexport_arrayxml.inc.php @@ -74,15 +74,26 @@ class importexport_arrayxml { * @param string $_xml * @return array */ - public static function xml2array( $_xml ) { - if ( $_xml instanceof DOMElement ) { + public static function xml2array( $_xml ) + { + if($_xml instanceof DOMElement) + { $n = &$_xml; - } else { + } + elseif($_xml) + { $n = new DOMDocument; $loaded = $n->loadXML($_xml); - if(!$loaded) return array(); + if(!$loaded) + { + return array(); + } } $xml_array = array(); + if(!$_xml || !$n) + { + return $xml_array; + } foreach($n->childNodes as $nc) {