From 304321ad11ac310b643234e1910a22196b55aa1f Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 7 Apr 2019 14:46:25 +0200 Subject: [PATCH] [9.0.17] simpleLightBox update + css setup small screens --- CHANGES.md | 6 ++++++ core/core.php | 2 +- core/layout/common.css | 1 + core/vendor/simplelightbox/inc.json | 2 +- core/vendor/simplelightbox/simple-lightbox.min.js | 7 +++++++ core/vendor/simplelightbox/simplelightbox.min.css | 2 +- core/vendor/simplelightbox/simplelightbox.min.js | 8 -------- 7 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 core/vendor/simplelightbox/simple-lightbox.min.js delete mode 100644 core/vendor/simplelightbox/simplelightbox.min.js diff --git a/CHANGES.md b/CHANGES.md index c71a3e63..2d7f2424 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # ChangeLog + +## Version 9.0.16 +- Correction : + - Marges pour les petits écrans en mode connecté + - Mise à jour simpleLightBox 1.17.0 + ## Version 9.0.16 - Corrections : - Nom de page constitué de caractères filtrés empếchant la création d'un Id valide. diff --git a/core/core.php b/core/core.php index 59ba2fd7..f0c6006d 100644 --- a/core/core.php +++ b/core/core.php @@ -28,7 +28,7 @@ class common { const GROUP_ADMIN = 3; // Numéro de version stable - const ZWII_VERSION = '9.0.16'; + const ZWII_VERSION = '9.0.17'; public static $actions = []; public static $coreModuleIds = [ diff --git a/core/layout/common.css b/core/layout/common.css index ed4333eb..b1e15b53 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -310,6 +310,7 @@ td > .col12 { #bar { text-align: center; padding: 0; + margin: 0; } #bar ul { float: none !important; diff --git a/core/vendor/simplelightbox/inc.json b/core/vendor/simplelightbox/inc.json index 1bada2b0..fe8cd580 100644 --- a/core/vendor/simplelightbox/inc.json +++ b/core/vendor/simplelightbox/inc.json @@ -1,5 +1,5 @@ [ - "simplelightbox.min.js", + "simple-lightbox.min.js", "simplelightbox.min.css", "init.css", "init.js" diff --git a/core/vendor/simplelightbox/simple-lightbox.min.js b/core/vendor/simplelightbox/simple-lightbox.min.js new file mode 100644 index 00000000..0e2c1dd5 --- /dev/null +++ b/core/vendor/simplelightbox/simple-lightbox.min.js @@ -0,0 +1,7 @@ +/* + By André Rinas, www.andrerinas.de + Documentation, www.simplelightbox.de + Available for use under the MIT License + 1.17.0 +*/ +!function(st,lt,rt,t){"use strict";st.fn.simpleLightbox=function(P){P=st.extend({sourceAttr:"href",overlay:!0,spinner:!0,nav:!0,navText:["‹","›"],captions:!0,captionDelay:0,captionSelector:"img",captionType:"attr",captionsData:"title",captionPosition:"bottom",captionClass:"",close:!0,closeText:"×",swipeClose:!0,showCounter:!0,fileExt:"png|jpg|jpeg|gif",animationSlide:!0,animationSpeed:250,preloading:!0,enableKeyboard:!0,loop:!0,rel:!1,docClose:!0,swipeTolerance:50,className:"simple-lightbox",widthRatio:.8,heightRatio:.9,scaleImageToRatio:!1,disableRightClick:!1,disableScroll:!0,alertError:!0,alertErrorMessage:"Image not found, next image will be loaded",additionalHtml:!1,history:!0,throttleInterval:0,doubleTapZoom:2,maxZoom:10,htmlClass:"has-lightbox"},P);var h,t,Z="ontouchstart"in lt,z=(lt.navigator.pointerEnabled||lt.navigator.msPointerEnabled,0),H=0,L=st(),i=function(){var t=rt.body||rt.documentElement;return""===(t=t.style).WebkitTransition?"-webkit-":""===t.MozTransition?"-moz-":""===t.OTransition?"-o-":""===t.transition&&""},N=!1,p=[],j=P.rel&&!1!==P.rel?(t=P.rel,st(this).filter(function(){return st(this).attr("rel")===t})):this,d=(i=i(),0),K=!1!==i,a="pushState"in history,u=!1,n=lt.location,$=function(){return n.hash.substring(1)},B=$(),f=function(){$();var t="pid="+(J+1),e=n.href.split("#")[0]+"#"+t;a?history[u?"replaceState":"pushState"]("",rt.title,e):u?n.replace(e):n.hash=t,u=!0},Q=function(e,a){var n;return function(){var t=arguments;n||(e.apply(this,t),n=!0,setTimeout(function(){return n=!1},a))}},U="simplelb",e=st("
").addClass("sl-overlay"),o=st(""),s=st("
").addClass("sl-counter").html('/'),m=!1,J=0,v=0,l=st("
").addClass("sl-caption "+P.captionClass+" pos-"+P.captionPosition),V=st("
").addClass("sl-image"),r=st("
").addClass("sl-wrapper").addClass(P.className),c=function(t){t.trigger(st.Event("show.simplelightbox")),P.disableScroll&&(d=C("hide")),P.htmlClass&&""!=P.htmlClass&&st("html").addClass(P.htmlClass),r.appendTo("body"),V.appendTo(r),P.overlay&&e.appendTo(st("body")),m=!0,J=j.index(t),L=st("").hide().attr("src",t.attr(P.sourceAttr)).attr("data-scale",1).attr("data-translate-x",0).attr("data-translate-y",0),-1==p.indexOf(t.attr(P.sourceAttr))&&p.push(t.attr(P.sourceAttr)),V.html("").attr("style",""),L.appendTo(V),b(),e.fadeIn("fast"),st(".sl-close").fadeIn("fast"),g.show(),G.fadeIn("fast"),st(".sl-wrapper .sl-counter .sl-current").text(J+1),s.fadeIn("fast"),_(),P.preloading&&y(),setTimeout(function(){t.trigger(st.Event("shown.simplelightbox"))},P.animationSpeed)},_=function(s){if(L.length){var l=new Image,r=lt.innerWidth*P.widthRatio,c=lt.innerHeight*P.heightRatio;l.src=L.attr("src"),L.data("scale",1),L.data("translate-x",0),L.data("translate-y",0),et(0,0,1),st(l).on("error",function(t){j.eq(J).trigger(st.Event("error.simplelightbox")),N=!(m=!1),g.hide();var e=1==s||-1==s;v===J&&e?ot():(P.alertError&&alert(P.alertErrorMessage),it(e?s:1))}),l.onload=function(){void 0!==s&&j.eq(J).trigger(st.Event("changed.simplelightbox")).trigger(st.Event((1===s?"nextDone":"prevDone")+".simplelightbox")),P.history&&(u?h=setTimeout(f,800):f()),-1==p.indexOf(L.attr("src"))&&p.push(L.attr("src"));var t=l.width,e=l.height;if(P.scaleImageToRatio||r=j.length-1&&st(".sl-next").hide(),0").html(P.additionalHtml).addClass("sl-additional-html").appendTo(st(".sl-image"))}}},x=function(t,e){""!==t&&void 0!==t&&P.captions&&l.html(t).css({width:e+"px"}).hide().appendTo(st(".sl-image")).delay(P.captionDelay).fadeIn("fast")},tt=function(t,e){var a={};a[i+"transform"]="translateX("+e+")",a[i+"transition"]=i+"transform "+t+"s linear",st(".sl-image").css(a)},et=function(t,e,a){var n={};n[i+"transform"]="translate("+t+","+e+") scale("+a+")",L.css(n)},at=function(t,e,a){return t=j.length-1&&0P.swipeTolerance&&e?it(0=j.length-1?0:J+1,e=J-1<0?j.length-1:J-1>=j.length-1?0:J-1;st("").attr("src",j.eq(t).attr(P.sourceAttr)).on("load",function(){-1==p.indexOf(st(this).attr("src"))&&p.push(st(this).attr("src")),j.eq(J).trigger(st.Event("nextImageLoaded.simplelightbox"))}),st("").attr("src",j.eq(e).attr(P.sourceAttr)).on("load",function(){-1==p.indexOf(st(this).attr("src"))&&p.push(st(this).attr("src")),j.eq(J).trigger(st.Event("prevImageLoaded.simplelightbox"))})},it=function(e){j.eq(J).trigger(st.Event("change.simplelightbox")).trigger(st.Event((1===e?"next":"prev")+".simplelightbox"));var t=J+e;if(!(m||(t<0||t>=j.length)&&!1===P.loop)){J=t<0?j.length-1:t>j.length-1?0:t,st(".sl-wrapper .sl-counter .sl-current").text(J+1);var a={opacity:0};P.animationSlide&&(K?tt(P.animationSpeed/1e3,-100*e-z+"px"):a.left=parseInt(st(".sl-image").css("left"))+-100*e+"px"),st(".sl-image").animate(a,P.animationSpeed,function(){setTimeout(function(){var t=j.eq(J);L.attr("src",t.attr(P.sourceAttr)),-1==p.indexOf(t.attr(P.sourceAttr))&&g.show(),st(".sl-caption").remove(),_(e),P.preloading&&y()},100)})}},ot=function(){if(!m){var t=j.eq(J),e=!1;t.trigger(st.Event("close.simplelightbox")),P.history&&(a?history.pushState("",rt.title,n.pathname+n.search):n.hash="",clearTimeout(h)),st(".sl-image img, .sl-overlay, .sl-close, .sl-navigation, .sl-image .sl-caption, .sl-counter").fadeOut("fast",function(){P.disableScroll&&C("show"),P.htmlClass&&""!=P.htmlClass&&st("html").removeClass(P.htmlClass),st(".sl-wrapper, .sl-overlay").remove(),G.off("click","button"),st(rt).off("click."+U,".sl-close"),st(lt).off("resize."+U),st(lt).off("hashchange."+U),e||t.trigger(st.Event("closed.simplelightbox")),e=!0}),L=st(),m=N=!1}},C=function(t){var e=0;if("hide"==t){var a=lt.innerWidth;if(!a){var n=rt.documentElement.getBoundingClientRect();a=n.right-Math.abs(n.left)}if(rt.body.clientWidth").addClass("sl-overlay"),T=t(""),I=t("
").addClass("sl-counter").html('/'),q=!1,D=0,M=t("
").addClass("sl-caption "+n.captionClass+" pos-"+n.captionPosition),A=t("
").addClass("sl-image"),R=t("
").addClass("sl-wrapper").addClass(n.className),O=function(e){if(!n.fileExt)return!0;var i=/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim,a=t(e).attr(n.sourceAttr).match(i);return a&&"a"==t(e).prop("tagName").toLowerCase()&&new RegExp(".("+n.fileExt+")$","i").test(a)},P=function(e){e.trigger(t.Event("show.simplelightbox")),n.disableScroll&&(h=K("hide")),R.appendTo("body"),A.appendTo(R),n.overlay&&C.appendTo(t("body")),q=!0,D=d.index(e),l=t("").hide().attr("src",e.attr(n.sourceAttr)),-1==p.indexOf(e.attr(n.sourceAttr))&&p.push(e.attr(n.sourceAttr)),A.html("").attr("style",""),l.appendTo(A),X(),C.fadeIn("fast"),t(".sl-close").fadeIn("fast"),S.show(),k.fadeIn("fast"),t(".sl-wrapper .sl-counter .sl-current").text(D+1),I.fadeIn("fast"),z(),n.preloading&&Y(),setTimeout(function(){e.trigger(t.Event("shown.simplelightbox"))},n.animationSpeed)},z=function(i){if(l.length){var a=new Image,o=t(e).width()*n.widthRatio,s=t(e).height()*n.heightRatio;a.src=l.attr("src"),t(a).on("error",function(e){d.eq(D).trigger(t.Event("error.simplelightbox")),q=!1,c=!0,S.hide(),n.alertError&&alert(n.alertErrorMessage),j(1==i||-1==i?i:1)}),a.onload=function(){void 0!==i&&d.eq(D).trigger(t.Event("changed.simplelightbox")).trigger(t.Event((1===i?"nextDone":"prevDone")+".simplelightbox")),n.history&&w(),-1==p.indexOf(l.attr("src"))&&p.push(l.attr("src"));var r=a.width,u=a.height;if(r>o||u>s){var f=r/u>o/s?r/o:u/s;r/=f,u/=f}t(".sl-image").css({top:(t(e).height()-u)/2+"px",left:(t(e).width()-r-h)/2+"px"}),S.hide(),l.css({width:r+"px",height:u+"px"}).fadeIn("fast"),c=!0;var m,v="self"==n.captionSelector?d.eq(D):d.eq(D).find(n.captionSelector);if(m="data"==n.captionType?v.data(n.captionsData):"text"==n.captionType?v.html():v.prop(n.captionsData),n.loop||(0===D&&t(".sl-prev").hide(),D>=d.length-1&&t(".sl-next").hide(),D>0&&t(".sl-prev").show(),D").html(n.additionalHtml).addClass("sl-additional-html").appendTo(t(".sl-image"))}}},L=function(e){""!==e&&void 0!==e&&n.captions&&M.html(e).hide().appendTo(t(".sl-image")).delay(n.captionDelay).fadeIn("fast")},W=function(e,i){var n={};n[r+"transform"]="translateX("+i+")",n[r+"transition"]=r+"transform "+e+"s linear",t(".sl-image").css(n)},X=function(){t(e).on("resize."+E,z),t(i).on("click.simplelb touchstart."+E,".sl-close",function(t){t.preventDefault(),c&&H()}),n.history&&setTimeout(function(){t(e).on("hashchange."+E,function(){c&&v()===b&&H()})},40),k.on("click."+E,"button",function(e){e.preventDefault(),o=0,j(t(this).hasClass("sl-next")?1:-1)});var a=0,l=0,r=0,p=0,h=!1,u=0;A.on("touchstart.simplelb mousedown."+E,function(t){return!!h||(g&&(u=parseInt(A.css("left"))),h=!0,o=0,s=0,a=t.originalEvent.pageX||t.originalEvent.touches[0].pageX,r=t.originalEvent.pageY||t.originalEvent.touches[0].pageY,!1)}).on("touchmove.simplelb mousemove.simplelb pointermove MSPointerMove",function(t){if(!h)return!0;t.preventDefault(),l=t.originalEvent.pageX||t.originalEvent.touches[0].pageX,p=t.originalEvent.pageY||t.originalEvent.touches[0].pageY,o=a-l,s=r-p,n.animationSlide&&(g?W(0,-o+"px"):A.css("left",u-o+"px"))}).on("touchend.simplelb mouseup.simplelb touchcancel.simplelb mouseleave.simplelb pointerup pointercancel MSPointerUp MSPointerCancel",function(t){if(h){h=!1;var e=!0;n.loop||(0===D&&o<0&&(e=!1),D>=d.length-1&&o>0&&(e=!1)),Math.abs(o)>n.swipeTolerance&&e?j(o>0?1:-1):n.animationSlide&&(g?W(n.animationSpeed/1e3,"0px"):A.animate({left:u+"px"},n.animationSpeed/2)),n.swipeClose&&Math.abs(s)>50&&Math.abs(o)=d.length-1?0:D+1,i=D-1<0?d.length-1:D-1>=d.length-1?0:D-1;t("").attr("src",d.eq(e).attr(n.sourceAttr)).on("load",function(){-1==p.indexOf(t(this).attr("src"))&&p.push(t(this).attr("src")),d.eq(D).trigger(t.Event("nextImageLoaded.simplelightbox"))}),t("").attr("src",d.eq(i).attr(n.sourceAttr)).on("load",function(){-1==p.indexOf(t(this).attr("src"))&&p.push(t(this).attr("src")),d.eq(D).trigger(t.Event("prevImageLoaded.simplelightbox"))})},j=function(e){d.eq(D).trigger(t.Event("change.simplelightbox")).trigger(t.Event((1===e?"next":"prev")+".simplelightbox"));var i=D+e;if(!(q||(i<0||i>=d.length)&&!1===n.loop)){D=i<0?d.length-1:i>d.length-1?0:i,t(".sl-wrapper .sl-counter .sl-current").text(D+1);var a={opacity:0};n.animationSlide&&(g?W(n.animationSpeed/1e3,-100*e-o+"px"):a.left=parseInt(t(".sl-image").css("left"))+-100*e+"px"),t(".sl-image").animate(a,n.animationSpeed,function(){setTimeout(function(){var i=d.eq(D);l.attr("src",i.attr(n.sourceAttr)),-1==p.indexOf(i.attr(n.sourceAttr))&&S.show(),t(".sl-caption").remove(),z(e),n.preloading&&Y()},100)})}},H=function(){if(!q){var e=d.eq(D),i=!1;e.trigger(t.Event("close.simplelightbox")),n.history&&y(),t(".sl-image img, .sl-overlay, .sl-close, .sl-navigation, .sl-image .sl-caption, .sl-counter").fadeOut("fast",function(){n.disableScroll&&K("show"),t(".sl-wrapper, .sl-overlay").remove(),N(),i||e.trigger(t.Event("closed.simplelightbox")),i=!0}),l=t(),c=!1,q=!1}},K=function(n){var a=0;if("hide"==n){var o=e.innerWidth;if(!o){var s=i.documentElement.getBoundingClientRect();o=s.right-Math.abs(s.left)}if(i.body.clientWidth0&&t("body").addClass("hidden-scroll").css({"padding-right":r+a})}}else t("body").removeClass("hidden-scroll").css({"padding-right":t("body").data("padding")});return a};return n.close&&T.appendTo(R),n.showCounter&&d.length>1&&(I.appendTo(R),I.find(".sl-total").text(d.length)),n.nav&&k.appendTo(R),n.spinner&&S.appendTo(R),d.on("click."+E,function(e){if(O(this)){if(e.preventDefault(),q)return!1;P(t(this))}}),t(i).on("click.simplelb touchstart."+E,function(e){c&&n.docClose&&0===t(e.target).closest(".sl-image").length&&0===t(e.target).closest(".sl-navigation").length&&H()}),n.disableRightClick&&t(i).on("contextmenu",".sl-image img",function(t){return!1}),n.enableKeyboard&&t(i).on("keyup."+E,function(t){if(o=0,c){t.preventDefault();var e=t.keyCode;27==e&&H(),37!=e&&39!=t.keyCode||j(39==t.keyCode?1:-1)}}),this.open=function(e){e=e||t(this[0]),P(e)},this.next=function(){j(1)},this.prev=function(){j(-1)},this.close=function(){H()},this.destroy=function(){t(i).off("click."+E).off("keyup."+E),H(),t(".sl-overlay, .sl-wrapper").remove(),this.off("click")},this.refresh=function(){this.destroy(),t(this).simpleLightbox(n)},this}}(jQuery,window,document);