From 192dd4ea10c058f6222f48337f46597c981ffcd0 Mon Sep 17 00:00:00 2001 From: PeterBot Date: Tue, 28 Mar 2017 19:31:31 +0800 Subject: [PATCH] Add chocolat v0.4.18 --- ajax/libs/chocolat/0.4.18/css/chocolat.css | 190 +++++ .../libs/chocolat/0.4.18/css/chocolat.min.css | 1 + .../chocolat/0.4.18/css/chocolat.min.css.map | 1 + ajax/libs/chocolat/0.4.18/images/close.png | Bin 0 -> 806 bytes .../0.4.18/images/fullscreen-black.png | Bin 0 -> 573 bytes .../chocolat/0.4.18/images/fullscreen.png | Bin 0 -> 573 bytes ajax/libs/chocolat/0.4.18/images/left.png | Bin 0 -> 936 bytes ajax/libs/chocolat/0.4.18/images/loader.gif | Bin 0 -> 3208 bytes ajax/libs/chocolat/0.4.18/images/right.png | Bin 0 -> 936 bytes .../chocolat/0.4.18/js/jquery.chocolat.js | 737 ++++++++++++++++++ .../chocolat/0.4.18/js/jquery.chocolat.min.js | 1 + ajax/libs/chocolat/package.json | 2 +- 12 files changed, 931 insertions(+), 1 deletion(-) create mode 100644 ajax/libs/chocolat/0.4.18/css/chocolat.css create mode 100644 ajax/libs/chocolat/0.4.18/css/chocolat.min.css create mode 100644 ajax/libs/chocolat/0.4.18/css/chocolat.min.css.map create mode 100644 ajax/libs/chocolat/0.4.18/images/close.png create mode 100644 ajax/libs/chocolat/0.4.18/images/fullscreen-black.png create mode 100644 ajax/libs/chocolat/0.4.18/images/fullscreen.png create mode 100644 ajax/libs/chocolat/0.4.18/images/left.png create mode 100644 ajax/libs/chocolat/0.4.18/images/loader.gif create mode 100644 ajax/libs/chocolat/0.4.18/images/right.png create mode 100644 ajax/libs/chocolat/0.4.18/js/jquery.chocolat.js create mode 100644 ajax/libs/chocolat/0.4.18/js/jquery.chocolat.min.js diff --git a/ajax/libs/chocolat/0.4.18/css/chocolat.css b/ajax/libs/chocolat/0.4.18/css/chocolat.css new file mode 100644 index 00000000000000..7c8ae1e9a3ed07 --- /dev/null +++ b/ajax/libs/chocolat/0.4.18/css/chocolat.css @@ -0,0 +1,190 @@ +.chocolat-zoomable.chocolat-zoomed{ + cursor : zoom-out; +} +.chocolat-open{ + overflow: hidden; +} +.chocolat-overlay{ + height:100%; + width:100%; + position:fixed; + left:0; + top:0; + z-index:10; + background-color:#fff; + display: none; + opacity: 0.8; +} +.chocolat-wrapper{ + height:100%; + width:100%; + position:fixed; + display: none; + left:0; + top:0; + z-index:16; + color: #fff; +} +.chocolat-zoomable .chocolat-img{ + cursor : zoom-in; +} +.chocolat-loader{ + height:32px; + width:32px; + position:absolute; + left:50%; + top:50% ; + margin-left:-16px; + margin-top:-16px; + z-index:11; + background:url(../images/loader.gif); + display:none; +} +.chocolat-content{ + position:fixed; + width:0px; + height:0px; + left:50%; + top:50%; + z-index:14; + text-align: left; +} + +.chocolat-content .chocolat-img{ + position:absolute; + width:100%; + height:100%; +} +.chocolat-wrapper .chocolat-left{ + position:absolute; + left:0; + width:50px; + height:100px; + top: 50%; + margin-top: -50px; + cursor:pointer; + background:url(../images/left.png) 50% 50% no-repeat; + z-index: 17; + display: none; + +} +.chocolat-wrapper .chocolat-right{ + position:absolute; + right:0; + width:50px; + height:100px; + top: 50%; + margin-top: -50px; + cursor:pointer; + background:url(../images/right.png) 50% 50% no-repeat; + z-index: 17; + display: none; +} +.chocolat-wrapper .chocolat-right.active{ + display: block; +} +.chocolat-wrapper .chocolat-left.active{ + display: block; +} +.chocolat-wrapper .chocolat-top{ + position:absolute; + top:0px; + right: 0; + left: 0; + line-height:50px; + height:50px; + overflow: hidden; + z-index: 17; + margin-bottom: 10px; +} +.chocolat-wrapper .chocolat-close{ + width:50px; + height:50px; + cursor:pointer; + position: absolute; + top: 0; + right: 0; + background:url(../images/close.png) 50% 50% no-repeat; +} +.chocolat-wrapper .chocolat-bottom{ + position:absolute; + bottom:0; + left: 0; + right: 0; + line-height:40px; + height:40px; + font-size:12px; + z-index: 17; + padding-left: 15px; + padding-right: 15px; + background: rgba(0, 0, 0, 0.2); + text-align: right; + margin-top: 10px; +} +.chocolat-wrapper .chocolat-set-title{ + display: inline-block; + padding-right: 15px; + line-height: 1; + border-right: 1px solid rgba(255, 255, 255, 0.3); +} +.chocolat-wrapper .chocolat-pagination{ + float: right; + display: inline-block; + padding-left: 15px; + padding-right: 15px; + margin-right: 15px; + /*border-right: 1px solid rgba(255, 255, 255, 0.2);*/ +} +.chocolat-wrapper .chocolat-fullscreen{ + width: 16px; + height: 40px; + background: url(../images/fullscreen.png) 50% 50% no-repeat; + display: block; + margin:auto; + cursor: pointer; + float: right; +} +.chocolat-wrapper .chocolat-description{ + display: inline-block; + float: left; +} + +/* no container mode*/ +body.chocolat-open>.chocolat-overlay{ + z-index:15; +} +body.chocolat-open>.chocolat-loader{ + z-index:15; +} +body.chocolat-open>.chocolat-content{ + z-index:17; +} + +/* container mode*/ +.chocolat-in-container .chocolat-wrapper, +.chocolat-in-container .chocolat-content, +.chocolat-in-container .chocolat-overlay{ + position: absolute; +} +.chocolat-in-container{ + position: relative; +} + +/* uncomment to hide controls when zoomed-in*/ +/* +.chocolat-zoomable .chocolat-top, +.chocolat-zoomable .chocolat-bottom, +.chocolat-zoomable .chocolat-right, +.chocolat-zoomable .chocolat-left { + transition: opacity .3s ease, visibility 0s .3s; + opacity: 1; +} + +.chocolat-zoomable.chocolat-zoomed .chocolat-top, +.chocolat-zoomable.chocolat-zoomed .chocolat-bottom, +.chocolat-zoomable.chocolat-zoomed .chocolat-right, +.chocolat-zoomable.chocolat-zoomed .chocolat-left { + visibility: hidden; + opacity: 0; +} +*/ diff --git a/ajax/libs/chocolat/0.4.18/css/chocolat.min.css b/ajax/libs/chocolat/0.4.18/css/chocolat.min.css new file mode 100644 index 00000000000000..d091bc61c427a5 --- /dev/null +++ b/ajax/libs/chocolat/0.4.18/css/chocolat.min.css @@ -0,0 +1 @@ +.chocolat-zoomable.chocolat-zoomed{cursor:zoom-out}.chocolat-open{overflow:hidden}.chocolat-overlay{height:100%;width:100%;position:fixed;left:0;top:0;z-index:10;background-color:#fff;display:none;opacity:.8}.chocolat-wrapper{height:100%;width:100%;position:fixed;display:none;left:0;top:0;z-index:16;color:#fff}.chocolat-zoomable .chocolat-img{cursor:zoom-in}.chocolat-loader{height:32px;width:32px;position:absolute;left:50%;top:50%;margin-left:-16px;margin-top:-16px;z-index:11;background:url(../images/loader.gif);display:none}.chocolat-content{position:fixed;width:0;height:0;left:50%;top:50%;z-index:14;text-align:left}.chocolat-content .chocolat-img{position:absolute;width:100%;height:100%}.chocolat-wrapper .chocolat-left{position:absolute;left:0;width:50px;height:100px;top:50%;margin-top:-50px;cursor:pointer;background:url(../images/left.png) 50% 50% no-repeat;z-index:17;display:none}.chocolat-wrapper .chocolat-right{position:absolute;right:0;width:50px;height:100px;top:50%;margin-top:-50px;cursor:pointer;background:url(../images/right.png) 50% 50% no-repeat;z-index:17;display:none}.chocolat-wrapper .chocolat-right.active{display:block}.chocolat-wrapper .chocolat-left.active{display:block}.chocolat-wrapper .chocolat-top{position:absolute;top:0;right:0;left:0;line-height:50px;height:50px;overflow:hidden;z-index:17;margin-bottom:10px}.chocolat-wrapper .chocolat-close{width:50px;height:50px;cursor:pointer;position:absolute;top:0;right:0;background:url(../images/close.png) 50% 50% no-repeat}.chocolat-wrapper .chocolat-bottom{position:absolute;bottom:0;left:0;right:0;line-height:40px;height:40px;font-size:12px;z-index:17;padding-left:15px;padding-right:15px;background:rgba(0,0,0,.2);text-align:right;margin-top:10px}.chocolat-wrapper .chocolat-set-title{display:inline-block;padding-right:15px;line-height:1;border-right:1px solid rgba(255,255,255,.3)}.chocolat-wrapper .chocolat-pagination{float:right;display:inline-block;padding-left:15px;padding-right:15px;margin-right:15px}.chocolat-wrapper .chocolat-fullscreen{width:16px;height:40px;background:url(../images/fullscreen.png) 50% 50% no-repeat;display:block;margin:auto;cursor:pointer;float:right}.chocolat-wrapper .chocolat-description{display:inline-block;float:left}body.chocolat-open>.chocolat-overlay{z-index:15}body.chocolat-open>.chocolat-loader{z-index:15}body.chocolat-open>.chocolat-content{z-index:17}.chocolat-in-container .chocolat-content,.chocolat-in-container .chocolat-overlay,.chocolat-in-container .chocolat-wrapper{position:absolute}.chocolat-in-container{position:relative}/*# sourceMappingURL=chocolat.min.css.map */ \ No newline at end of file diff --git a/ajax/libs/chocolat/0.4.18/css/chocolat.min.css.map b/ajax/libs/chocolat/0.4.18/css/chocolat.min.css.map new file mode 100644 index 00000000000000..6d14c7c316fdba --- /dev/null +++ b/ajax/libs/chocolat/0.4.18/css/chocolat.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["chocolat.css"],"names":[],"mappings":"AAAA,mCACI,OAAS,SAEb,eACI,SAAU,OAEd,kBACI,OAAO,KACP,MAAM,KACN,SAAS,MACT,KAAK,EACL,IAAI,EACJ,QAAQ,GACR,iBAAiB,KACjB,QAAS,KACT,QAAS,GAEb,kBACI,OAAO,KACP,MAAM,KACN,SAAS,MACT,QAAS,KACT,KAAK,EACL,IAAI,EACJ,QAAQ,GACR,MAAO,KAEX,iCACI,OAAS,QAEb,iBACI,OAAO,KACP,MAAM,KACN,SAAS,SACT,KAAK,IACL,IAAI,IACJ,YAAY,MACZ,WAAW,MACX,QAAQ,GACR,WAAW,0BACX,QAAQ,KAEZ,kBACI,SAAS,MACT,MAAM,EACN,OAAO,EACP,KAAK,IACL,IAAI,IACJ,QAAQ,GACR,WAAY,KAGhB,gCACI,SAAS,SACT,MAAM,KACN,OAAO,KAEX,iCACI,SAAS,SACT,KAAK,EACL,MAAM,KACN,OAAO,MACP,IAAK,IACL,WAAY,MACZ,OAAO,QACP,WAAW,wBAAwB,IAAI,IAAI,UAC3C,QAAS,GACT,QAAS,KAGb,kCACI,SAAS,SACT,MAAM,EACN,MAAM,KACN,OAAO,MACP,IAAK,IACL,WAAY,MACZ,OAAO,QACP,WAAW,yBAA0B,IAAI,IAAI,UAC7C,QAAS,GACT,QAAS,KAEb,yCACI,QAAS,MAEb,wCACI,QAAS,MAEb,gCACI,SAAS,SACT,IAAI,EACJ,MAAO,EACP,KAAM,EACN,YAAY,KACZ,OAAO,KACP,SAAU,OACV,QAAS,GACT,cAAe,KAEnB,kCACI,MAAM,KACN,OAAO,KACP,OAAO,QACP,SAAU,SACV,IAAK,EACL,MAAO,EACP,WAAW,yBAAyB,IAAI,IAAI,UAEhD,mCACI,SAAS,SACT,OAAO,EACP,KAAM,EACN,MAAO,EACP,YAAY,KACZ,OAAO,KACP,UAAU,KACV,QAAS,GACT,aAAc,KACd,cAAe,KACf,WAAY,eACZ,WAAY,MACZ,WAAY,KAEhB,sCACI,QAAS,aACT,cAAe,KACf,YAAa,EACb,aAAc,IAAI,MAAM,qBAE5B,uCACI,MAAO,MACP,QAAS,aACT,aAAc,KACd,cAAe,KACf,aAAc,KAGlB,uCACI,MAAO,KACP,OAAQ,KACR,WAAY,8BAA8B,IAAI,IAAI,UAClD,QAAS,MACT,OAAO,KACP,OAAQ,QACR,MAAO,MAEX,wCACI,QAAS,aACT,MAAO,KAIX,qCACI,QAAQ,GAEZ,oCACI,QAAQ,GAEZ,qCACI,QAAQ,GAKZ,yCACA,yCAFA,yCAGI,SAAU,SAEd,uBACI,SAAU"} \ No newline at end of file diff --git a/ajax/libs/chocolat/0.4.18/images/close.png b/ajax/libs/chocolat/0.4.18/images/close.png new file mode 100644 index 0000000000000000000000000000000000000000..531e753089841203d722e67be0f438bfcf926771 GIT binary patch literal 806 zcmV+>1KIqEP)Y&48Ad&)5nt0XF`S}LlV%V zeWvHU42C1QP=9vRhzfhK+@1KeTJ!N9JpFLmcjFDbe|Y-tas{Zs$?cVl70>Usyk+CH z*&Gj_E-k$OpD)Tvzng*CGuEV$k$&Ow!bxRxTqIH%XXB_A_)68KTsmvBIRS<}3>HI5 zghAp{;K(U(NE8N5OhNMdi!%z^1@n2FvpwN;+AX<1K%=PwWJ=Fr(Zmk?(Bk{VO z{qqSX`#LM@j?bPHs*jU z!t1%>z`e(PexB00>(|ZXNupxc~qF07*qoM6N<$f*me&1^@s6 literal 0 HcmV?d00001 diff --git a/ajax/libs/chocolat/0.4.18/images/fullscreen-black.png b/ajax/libs/chocolat/0.4.18/images/fullscreen-black.png new file mode 100644 index 0000000000000000000000000000000000000000..e30c0d5505ad511b5afafddc526e024ee44e1279 GIT binary patch literal 573 zcmV-D0>b@?P)Y&48Ad&)5nt0XF`S}LlV%V zeWvHU42C1QP=9vRhzfhK+@1KeTJ!N9JpFLmcjFDbe|Y-tas{Zs$?cVl70>Usyk+CH z*&Gj_E-k$OpD)Tvzng*CGuEV$k$&Ow!bxRxTqIH%XXB_A_)68KTsmvBIRS<}3>HI5 zghAp{;K(U(NE8N5OhNMd&UZk-SwNus00000 LNkvXXu0mjfm0SsB literal 0 HcmV?d00001 diff --git a/ajax/libs/chocolat/0.4.18/images/fullscreen.png b/ajax/libs/chocolat/0.4.18/images/fullscreen.png new file mode 100644 index 0000000000000000000000000000000000000000..abf6f380bf856c0e80489a52e447448c13335870 GIT binary patch literal 573 zcmV-D0>b@?P)Y&48Ad&)5nt0XF`S}LlV%V zeWvHU42C1QP=9vRhzfhK+@1KeTJ!N9JpFLmcjFDbe|Y-tas{Zs$?cVl70>Usyk+CH z*&Gj_E-k$OpD)Tvzng*CGuEV$k$&Ow!bxRxTqIH%XXB_A_)68KTsmvBIRS<}3>HI5 zghAp{;K(U(NE8N5OhNMd@r literal 0 HcmV?d00001 diff --git a/ajax/libs/chocolat/0.4.18/images/left.png b/ajax/libs/chocolat/0.4.18/images/left.png new file mode 100644 index 0000000000000000000000000000000000000000..a4351e336d824db1554f924a4cb73458f764eb54 GIT binary patch literal 936 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 holderGlobalRatio) { + height = holderGlobalHeight; + width = height / imgRatio; + } + else { + width = holderGlobalWidth; + height = width * imgRatio; + } + if (this.settings.imageSize === 'default' && (width >= imgWidth || height >= imgHeight)) { + width = imgWidth; + height = imgHeight; + } + } + + return { + 'height' : height, + 'width' : width, + 'top' : (holderHeight - height)/2, + 'left' : (holderWidth - width)/2 + }; + }, + + change : function(signe) { + this.zoomOut(0); + this.zoomable(); + + var requestedImage = this.settings.currentImage + parseInt(signe); + if (requestedImage > this.settings.lastImage) { + if (this.settings.loop) { + return this.load(0); + } + } + else if (requestedImage < 0) { + if (this.settings.loop) { + return this.load(this.settings.lastImage); + } + } + else { + return this.load(requestedImage); + } + }, + + arrows: function() { + if (this.settings.loop) { + $([this.elems.left[0],this.elems.right[0]]) + .addClass('active'); + } + else if (this.settings.linkImages) { + // right + if (this.settings.currentImage == this.settings.lastImage) { + this.elems.right.removeClass('active'); + } + else { + this.elems.right.addClass('active'); + } + // left + if (this.settings.currentImage === 0) { + this.elems.left.removeClass('active'); + } + else { + this.elems.left.addClass('active'); + } + } + else { + $([this.elems.left[0],this.elems.right[0]]) + .removeClass('active'); + } + }, + + description : function() { + var that = this; + this.elems.description + .html(that.settings.images[that.settings.currentImage].title); + }, + + pagination : function() { + var that = this; + var last = this.settings.lastImage + 1; + var position = this.settings.currentImage + 1; + + this.elems.pagination + .html(position + ' ' + that.settings.separator2 + last); + }, + + storeImgSize : function(img, i) { + if (typeof img === 'undefined') { + return; + } + if (!this.settings.images[i].height || !this.settings.images[i].width) { + this.settings.images[i].height = img.height; + this.settings.images[i].width = img.width; + } + }, + + close : function() { + + if (this.settings.fullscreenOpen) { + this.exitFullScreen(); + return; + } + + var els = [ + this.elems.overlay[0], + this.elems.loader[0], + this.elems.wrapper[0] + ]; + var that = this; + var def = $.when($(els).fadeOut(200)).done(function () { + that.elems.domContainer.removeClass('chocolat-open'); + }); + this.settings.currentImage = false; + + return def; + }, + + destroy : function() { + this.element.removeData(); + this.element.find(this.settings.imageSelector).off('click.chocolat'); + + if (!this.settings.initialized) { + return; + } + if (this.settings.fullscreenOpen) { + this.exitFullScreen(); + } + this.settings.currentImage = false; + this.settings.initialized = false; + this.elems.domContainer.removeClass(this._cssClasses.join(' ')); + this.elems.wrapper.remove(); + }, + + getOutMarginW : function() { + var left = this.elems.left.outerWidth(true); + var right = this.elems.right.outerWidth(true); + return left + right; + }, + + getOutMarginH : function() { + return this.elems.top.outerHeight(true) + this.elems.bottom.outerHeight(true); + }, + + markup : function() { + this.elems.domContainer.addClass('chocolat-open ' + this.settings.className); + if (this.settings.imageSize == 'cover') { + this.elems.domContainer.addClass('chocolat-cover'); + } + if (this.settings.container !== window) { + this.elems.domContainer.addClass('chocolat-in-container'); + } + + this.elems.wrapper = $('
', { + 'class' : 'chocolat-wrapper', + 'id' : 'chocolat-content-' + this.settings.setIndex + }).appendTo(this.elems.domContainer); + + this.elems.overlay = $('
', { + 'class' : 'chocolat-overlay' + }).appendTo(this.elems.wrapper); + + this.elems.loader = $('
', { + 'class' : 'chocolat-loader' + }).appendTo(this.elems.wrapper); + + this.elems.content = $('
', { + 'class' : 'chocolat-content', + }).appendTo(this.elems.wrapper); + + this.elems.img = $('', { + 'class' : 'chocolat-img', + 'src' : '' + }).appendTo(this.elems.content); + + this.elems.top = $('
', { + 'class' : 'chocolat-top' + }).appendTo(this.elems.wrapper); + + this.elems.left = $('
', { + 'class' : 'chocolat-left' + }).appendTo(this.elems.wrapper); + + this.elems.right = $('
', { + 'class' : 'chocolat-right' + }).appendTo(this.elems.wrapper); + + this.elems.bottom = $('
', { + 'class' : 'chocolat-bottom' + }).appendTo(this.elems.wrapper); + + this.elems.close = $('', { + 'class' : 'chocolat-close' + }).appendTo(this.elems.top); + + this.elems.fullscreen = $('', { + 'class' : 'chocolat-fullscreen' + }).appendTo(this.elems.bottom); + + this.elems.description = $('', { + 'class' : 'chocolat-description' + }).appendTo(this.elems.bottom); + + this.elems.pagination = $('', { + 'class' : 'chocolat-pagination' + }).appendTo(this.elems.bottom); + + this.elems.setTitle = $('', { + 'class' : 'chocolat-set-title', + 'html' : this.settings.setTitle + }).appendTo(this.elems.bottom); + + this.settings.afterMarkup.call(this); + }, + + openFullScreen : function() { + var wrapper = this.elems.wrapper[0]; + + if (wrapper.requestFullscreen) { + this.settings.fullscreenOpen = true; + wrapper.requestFullscreen(); + } + else if (wrapper.mozRequestFullScreen) { + this.settings.fullscreenOpen = true; + wrapper.mozRequestFullScreen(); + } + else if (wrapper.webkitRequestFullscreen) { + this.settings.fullscreenOpen = true; + wrapper.webkitRequestFullscreen(); + } + else if (wrapper.msRequestFullscreen) { + wrapper.msRequestFullscreen(); + this.settings.fullscreenOpen = true; + } + else { + this.settings.fullscreenOpen = false; + } + }, + + exitFullScreen : function() { + if (document.exitFullscreen) { + document.exitFullscreen(); + this.settings.fullscreenOpen = false; + } + else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + this.settings.fullscreenOpen = false; + } + else if (document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + this.settings.fullscreenOpen = false; + } + else { + this.settings.fullscreenOpen = true; + } + }, + + events : function() { + var that = this; + + $(document).off('keydown.chocolat').on('keydown.chocolat', function(e) { + if (that.settings.initialized) { + if (e.keyCode == 37) { + that.change(-1); + } + else if (e.keyCode == 39) { + that.change(1); + } + else if (e.keyCode == 27) { + that.close(); + } + } + }); + // this.elems.wrapper.find('.chocolat-img') + // .off('click.chocolat') + // .on('click.chocolat', function(e) { + // var currentImage = that.settings.images[that.settings.currentImage]; + // if(currentImage.width > $(that.elems.wrapper).width() || currentImage.height > $(that.elems.wrapper).height() ){ + // that.toggleZoom(e); + // } + // }); + + this.elems.wrapper.find('.chocolat-right') + .off('click.chocolat') + .on('click.chocolat', function() { + that.change(+1); + }); + + this.elems.wrapper.find('.chocolat-left') + .off('click.chocolat') + .on('click.chocolat', function() { + return that.change(-1); + }); + + $([this.elems.overlay[0], this.elems.close[0]]) + .off('click.chocolat') + .on('click.chocolat', function() { + return that.close(); + }); + + this.elems.fullscreen + .off('click.chocolat') + .on('click.chocolat', function() { + if (that.settings.fullscreenOpen) { + that.exitFullScreen(); + return; + } + + that.openFullScreen(); + }); + + if (that.settings.backgroundClose) { + this.elems.overlay + .off('click.chocolat') + .on('click.chocolat', function() { + return that.close(); + }); + } + this.elems.wrapper + .off('click.chocolat') + .on('click.chocolat', function(e) { + return that.zoomOut(e); + }); + + this.elems.wrapper.find('.chocolat-img') + .off('click.chocolat') + .on('click.chocolat', function(e) { + if (that.settings.initialZoomState === null && that.elems.domContainer.hasClass('chocolat-zoomable')) { + e.stopPropagation(); + return that.zoomIn(e); + } + }); + + this.elems.wrapper.mousemove(function( e ) { + if (that.settings.initialZoomState === null) { + return; + } + if (that.elems.img.is(':animated')) { + return; + } + + var pos = $(this).offset(); + var height = $(this).height(); + var width = $(this).width(); + + var currentImage = that.settings.images[that.settings.currentImage]; + var imgWidth = currentImage.width; + var imgHeight = currentImage.height; + + var coord = [e.pageX - width/2 - pos.left, e.pageY - height/2 - pos.top]; + + var mvtX = 0; + if (imgWidth > width) { + var paddingX = that.settings.zoomedPaddingX(imgWidth, width); + mvtX = coord[0] / (width / 2); + mvtX = ((imgWidth - width)/ 2 + paddingX) * mvtX; + } + + var mvtY = 0; + if (imgHeight > height) { + var paddingY = that.settings.zoomedPaddingY(imgHeight, height); + mvtY = coord[1] / (height / 2); + mvtY = ((imgHeight - height) / 2 + paddingY) * mvtY; + } + + var animation = { + 'margin-left': - mvtX + 'px', + 'margin-top': - mvtY + 'px' + }; + if (typeof e.duration !== 'undefined') { + $(that.elems.img).stop(false, true).animate(animation, e.duration); + } + else { + $(that.elems.img).stop(false, true).css(animation); + } + + }); + $(window).on('resize', function() { + if (!that.settings.initialized) { + return; + } + that.debounce(50, function() { + var fitting = that.fit(that.settings.currentImage, that.elems.wrapper); + that.center(fitting.width, fitting.height, fitting.left, fitting.top, 0); + that.zoomable(); + }); + }); + }, + + zoomable : function () { + var currentImage = this.settings.images[this.settings.currentImage]; + var wrapperWidth = this.elems.wrapper.width(); + var wrapperHeight = this.elems.wrapper.height(); + + var isImageZoomable = ( this.settings.enableZoom && ( currentImage.width > wrapperWidth || currentImage.height > wrapperHeight)) ? true : false; + var isImageStretched = this.elems.img.width() > currentImage.width || this.elems.img.height() > currentImage.height; + + + if (isImageZoomable && !isImageStretched) { + this.elems.domContainer.addClass('chocolat-zoomable'); + } + else { + this.elems.domContainer.removeClass('chocolat-zoomable'); + } + }, + + zoomIn : function (e) { + this.settings.initialZoomState = this.settings.imageSize; + this.settings.imageSize = 'native'; + + var event = $.Event('mousemove'); + event.pageX = e.pageX; + event.pageY = e.pageY; + event.duration = this.settings.duration; + this.elems.wrapper.trigger(event); + + this.elems.domContainer.addClass('chocolat-zoomed'); + var fitting = this.fit(this.settings.currentImage, this.elems.wrapper); + return this.center(fitting.width, fitting.height, fitting.left, fitting.top, this.settings.duration); + }, + + zoomOut : function (e, duration) { + if (this.settings.initialZoomState === null) { + return; + } + duration = duration || this.settings.duration; + + this.settings.imageSize = this.settings.initialZoomState; + this.settings.initialZoomState = null; + this.elems.img.animate({'margin': 0}, duration); + + this.elems.domContainer.removeClass('chocolat-zoomed'); + var fitting = this.fit(this.settings.currentImage, this.elems.wrapper); + return this.center(fitting.width, fitting.height, fitting.left, fitting.top, duration); + }, + + setDomContainer : function() { + // if container == window + // domContainer = body + if ( this.settings.container === window) { + this.elems.domContainer = $('body'); + } + else { + this.elems.domContainer = $(this.settings.container); + } + }, + + debounce: function(duration, callback) { + clearTimeout(this.settings.timerDebounce); + this.settings.timerDebounce = setTimeout(function() { + callback(); + }, duration); + }, + + api: function() { + var that = this; + return { + open : function(i){ + i = parseInt(i) || 0; + return that.init(i); + }, + + close : function(){ + return that.close(); + }, + + next : function(){ + return that.change(1); + }, + + prev : function(){ + return that.change(-1); + }, + + goto : function(i){ // open alias + return that.open(i); + }, + current : function(){ + return that.settings.currentImage; + }, + + place : function(){ + return that.place(that.settings.currentImage, that.settings.duration); + }, + + destroy : function(){ + return that.destroy(); + }, + + set : function(property, value){ + that.settings[property] = value; + return value; + }, + + get : function(property){ + return that.settings[property]; + }, + + getElem : function(name){ + return that.elems[name]; + }, + }; + } + }); + + var defaults = { + container : window, // window or jquery object or jquery selector, or element + imageSelector : '.chocolat-image', + className : '', + imageSize : 'default', // 'default', 'contain', 'cover' or 'native' + initialZoomState : null, + fullScreen : false, + loop : false, + linkImages : true, + duration : 300, + setTitle : '', + separator2 : '/', + setIndex : 0, + firstImage : 0, + lastImage : false, + currentImage : false, + initialized : false, + timer : false, + timerDebounce : false, + images : [], + enableZoom : true, + imageSource : "href", + afterInitialize : function () {}, + afterMarkup : function () {}, + afterImageLoad : function () {}, + zoomedPaddingX : function (canvasWidth, imgWidth) { return 0; }, + zoomedPaddingY : function (canvasHeight, imgHeight) { return 0; }, + }; + + $.fn.Chocolat = function (options) { + return this.each(function() { + + calls++; + var settings = $.extend(true, {}, defaults, options, {setIndex:calls} ); + + if (!$.data(this, 'chocolat')) { + $.data(this, 'chocolat', + new Chocolat($(this), settings) + ); + } + }); + }; +})); diff --git a/ajax/libs/chocolat/0.4.18/js/jquery.chocolat.min.js b/ajax/libs/chocolat/0.4.18/js/jquery.chocolat.min.js new file mode 100644 index 00000000000000..82983196e07cc3 --- /dev/null +++ b/ajax/libs/chocolat/0.4.18/js/jquery.chocolat.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery"),window,document):t(jQuery,window,document)}(function(t,e,i,s){function n(e,i){var s=this;return this.settings=i,this.elems={},this.element=e,this._cssClasses=["chocolat-open","chocolat-in-container","chocolat-cover","chocolat-zoomable","chocolat-zoomed"],!this.settings.setTitle&&e.data("chocolat-title")&&(this.settings.setTitle=e.data("chocolat-title")),this.element.find(this.settings.imageSelector).each(function(){s.settings.images.push({title:t(this).attr("title"),src:t(this).attr(s.settings.imageSource),height:!1,width:!1})}),this.element.find(this.settings.imageSelector).each(function(e){t(this).off("click.chocolat").on("click.chocolat",function(t){s.init(e),t.preventDefault()})}),this}var o=0;t.extend(n.prototype,{init:function(t){return this.settings.initialized||(this.setDomContainer(),this.markup(),this.events(),this.settings.lastImage=this.settings.images.length-1,this.settings.initialized=!0),this.settings.afterInitialize.call(this),this.load(t)},preload:function(e){var i=t.Deferred();if("undefined"!=typeof this.settings.images[e]){var s=new Image;return s.onload=function(){i.resolve(s)},s.src=this.settings.images[e].src,i}},load:function(e){var i=this;if(this.settings.fullScreen&&this.openFullScreen(),this.settings.currentImage!==e){this.elems.overlay.fadeIn(this.settings.duration),this.elems.wrapper.fadeIn(this.settings.duration),this.elems.domContainer.addClass("chocolat-open"),this.settings.timer=setTimeout(function(){"undefined"!=typeof i.elems&&t.proxy(i.elems.loader.fadeIn(),i)},this.settings.duration);var s=this.preload(e).then(function(t){return i.place(e,t)}).then(function(t){return i.appear(e)}).then(function(t){i.zoomable(),i.settings.afterImageLoad.call(i)}),n=e+1;return"undefined"!=typeof this.settings.images[n]&&this.preload(n),s}},place:function(t,e){var i,s=this;return this.settings.currentImage=t,this.description(),this.pagination(),this.arrows(),this.storeImgSize(e,t),i=this.fit(t,s.elems.wrapper),this.center(i.width,i.height,i.left,i.top,0)},center:function(t,e,i,s,n){return this.elems.content.css("overflow","visible").animate({width:t,height:e,left:i,top:s},n).promise()},appear:function(t){var e=this;clearTimeout(this.settings.timer),this.elems.loader.stop().fadeOut(300,function(){e.elems.img.attr("src",e.settings.images[t].src)})},fit:function(e,i){var s,n,o=this.settings.images[e].height,a=this.settings.images[e].width,l=t(i).height(),r=t(i).width(),c=this.getOutMarginH(),h=this.getOutMarginW(),m=r-h,g=l-c,u=g/m,d=l/r,p=o/a;return"cover"==this.settings.imageSize?pu?(s=g,n=s/p):(n=m,s=n*p),"default"===this.settings.imageSize&&(n>=a||s>=o)&&(n=a,s=o)),{height:s,width:n,top:(l-s)/2,left:(r-n)/2}},change:function(t){this.zoomOut(0),this.zoomable();var e=this.settings.currentImage+parseInt(t);if(e>this.settings.lastImage){if(this.settings.loop)return this.load(0)}else{if(!(e<0))return this.load(e);if(this.settings.loop)return this.load(this.settings.lastImage)}},arrows:function(){this.settings.loop?t([this.elems.left[0],this.elems.right[0]]).addClass("active"):this.settings.linkImages?(this.settings.currentImage==this.settings.lastImage?this.elems.right.removeClass("active"):this.elems.right.addClass("active"),0===this.settings.currentImage?this.elems.left.removeClass("active"):this.elems.left.addClass("active")):t([this.elems.left[0],this.elems.right[0]]).removeClass("active")},description:function(){var t=this;this.elems.description.html(t.settings.images[t.settings.currentImage].title)},pagination:function(){var t=this,e=this.settings.lastImage+1,i=this.settings.currentImage+1;this.elems.pagination.html(i+" "+t.settings.separator2+e)},storeImgSize:function(t,e){"undefined"!=typeof t&&(this.settings.images[e].height&&this.settings.images[e].width||(this.settings.images[e].height=t.height,this.settings.images[e].width=t.width))},close:function(){if(this.settings.fullscreenOpen)return void this.exitFullScreen();var e=[this.elems.overlay[0],this.elems.loader[0],this.elems.wrapper[0]],i=this,s=t.when(t(e).fadeOut(200)).done(function(){i.elems.domContainer.removeClass("chocolat-open")});return this.settings.currentImage=!1,s},destroy:function(){this.element.removeData(),this.element.find(this.settings.imageSelector).off("click.chocolat"),this.settings.initialized&&(this.settings.fullscreenOpen&&this.exitFullScreen(),this.settings.currentImage=!1,this.settings.initialized=!1,this.elems.domContainer.removeClass(this._cssClasses.join(" ")),this.elems.wrapper.remove())},getOutMarginW:function(){var t=this.elems.left.outerWidth(!0),e=this.elems.right.outerWidth(!0);return t+e},getOutMarginH:function(){return this.elems.top.outerHeight(!0)+this.elems.bottom.outerHeight(!0)},markup:function(){this.elems.domContainer.addClass("chocolat-open "+this.settings.className),"cover"==this.settings.imageSize&&this.elems.domContainer.addClass("chocolat-cover"),this.settings.container!==e&&this.elems.domContainer.addClass("chocolat-in-container"),this.elems.wrapper=t("
",{"class":"chocolat-wrapper",id:"chocolat-content-"+this.settings.setIndex}).appendTo(this.elems.domContainer),this.elems.overlay=t("
",{"class":"chocolat-overlay"}).appendTo(this.elems.wrapper),this.elems.loader=t("
",{"class":"chocolat-loader"}).appendTo(this.elems.wrapper),this.elems.content=t("
",{"class":"chocolat-content"}).appendTo(this.elems.wrapper),this.elems.img=t("",{"class":"chocolat-img",src:""}).appendTo(this.elems.content),this.elems.top=t("
",{"class":"chocolat-top"}).appendTo(this.elems.wrapper),this.elems.left=t("
",{"class":"chocolat-left"}).appendTo(this.elems.wrapper),this.elems.right=t("
",{"class":"chocolat-right"}).appendTo(this.elems.wrapper),this.elems.bottom=t("
",{"class":"chocolat-bottom"}).appendTo(this.elems.wrapper),this.elems.close=t("",{"class":"chocolat-close"}).appendTo(this.elems.top),this.elems.fullscreen=t("",{"class":"chocolat-fullscreen"}).appendTo(this.elems.bottom),this.elems.description=t("",{"class":"chocolat-description"}).appendTo(this.elems.bottom),this.elems.pagination=t("",{"class":"chocolat-pagination"}).appendTo(this.elems.bottom),this.elems.setTitle=t("",{"class":"chocolat-set-title",html:this.settings.setTitle}).appendTo(this.elems.bottom),this.settings.afterMarkup.call(this)},openFullScreen:function(){var t=this.elems.wrapper[0];t.requestFullscreen?(this.settings.fullscreenOpen=!0,t.requestFullscreen()):t.mozRequestFullScreen?(this.settings.fullscreenOpen=!0,t.mozRequestFullScreen()):t.webkitRequestFullscreen?(this.settings.fullscreenOpen=!0,t.webkitRequestFullscreen()):t.msRequestFullscreen?(t.msRequestFullscreen(),this.settings.fullscreenOpen=!0):this.settings.fullscreenOpen=!1},exitFullScreen:function(){i.exitFullscreen?(i.exitFullscreen(),this.settings.fullscreenOpen=!1):i.mozCancelFullScreen?(i.mozCancelFullScreen(),this.settings.fullscreenOpen=!1):i.webkitExitFullscreen?(i.webkitExitFullscreen(),this.settings.fullscreenOpen=!1):this.settings.fullscreenOpen=!0},events:function(){var s=this;t(i).off("keydown.chocolat").on("keydown.chocolat",function(t){s.settings.initialized&&(37==t.keyCode?s.change(-1):39==t.keyCode?s.change(1):27==t.keyCode&&s.close())}),this.elems.wrapper.find(".chocolat-right").off("click.chocolat").on("click.chocolat",function(){s.change(1)}),this.elems.wrapper.find(".chocolat-left").off("click.chocolat").on("click.chocolat",function(){return s.change(-1)}),t([this.elems.overlay[0],this.elems.close[0]]).off("click.chocolat").on("click.chocolat",function(){return s.close()}),this.elems.fullscreen.off("click.chocolat").on("click.chocolat",function(){return s.settings.fullscreenOpen?void s.exitFullScreen():void s.openFullScreen()}),s.settings.backgroundClose&&this.elems.overlay.off("click.chocolat").on("click.chocolat",function(){return s.close()}),this.elems.wrapper.off("click.chocolat").on("click.chocolat",function(t){return s.zoomOut(t)}),this.elems.wrapper.find(".chocolat-img").off("click.chocolat").on("click.chocolat",function(t){if(null===s.settings.initialZoomState&&s.elems.domContainer.hasClass("chocolat-zoomable"))return t.stopPropagation(),s.zoomIn(t)}),this.elems.wrapper.mousemove(function(e){if(null!==s.settings.initialZoomState&&!s.elems.img.is(":animated")){var i=t(this).offset(),n=t(this).height(),o=t(this).width(),a=s.settings.images[s.settings.currentImage],l=a.width,r=a.height,c=[e.pageX-o/2-i.left,e.pageY-n/2-i.top],h=0;if(l>o){var m=s.settings.zoomedPaddingX(l,o);h=c[0]/(o/2),h=((l-o)/2+m)*h}var g=0;if(r>n){var u=s.settings.zoomedPaddingY(r,n);g=c[1]/(n/2),g=((r-n)/2+u)*g}var d={"margin-left":-h+"px","margin-top":-g+"px"};"undefined"!=typeof e.duration?t(s.elems.img).stop(!1,!0).animate(d,e.duration):t(s.elems.img).stop(!1,!0).css(d)}}),t(e).on("resize",function(){s.settings.initialized&&s.debounce(50,function(){var t=s.fit(s.settings.currentImage,s.elems.wrapper);s.center(t.width,t.height,t.left,t.top,0),s.zoomable()})})},zoomable:function(){var t=this.settings.images[this.settings.currentImage],e=this.elems.wrapper.width(),i=this.elems.wrapper.height(),s=!(!this.settings.enableZoom||!(t.width>e||t.height>i)),n=this.elems.img.width()>t.width||this.elems.img.height()>t.height;s&&!n?this.elems.domContainer.addClass("chocolat-zoomable"):this.elems.domContainer.removeClass("chocolat-zoomable")},zoomIn:function(e){this.settings.initialZoomState=this.settings.imageSize,this.settings.imageSize="native";var i=t.Event("mousemove");i.pageX=e.pageX,i.pageY=e.pageY,i.duration=this.settings.duration,this.elems.wrapper.trigger(i),this.elems.domContainer.addClass("chocolat-zoomed");var s=this.fit(this.settings.currentImage,this.elems.wrapper);return this.center(s.width,s.height,s.left,s.top,this.settings.duration)},zoomOut:function(t,e){if(null!==this.settings.initialZoomState){e=e||this.settings.duration,this.settings.imageSize=this.settings.initialZoomState,this.settings.initialZoomState=null,this.elems.img.animate({margin:0},e),this.elems.domContainer.removeClass("chocolat-zoomed");var i=this.fit(this.settings.currentImage,this.elems.wrapper);return this.center(i.width,i.height,i.left,i.top,e)}},setDomContainer:function(){this.settings.container===e?this.elems.domContainer=t("body"):this.elems.domContainer=t(this.settings.container)},debounce:function(t,e){clearTimeout(this.settings.timerDebounce),this.settings.timerDebounce=setTimeout(function(){e()},t)},api:function(){var t=this;return{open:function(e){return e=parseInt(e)||0,t.init(e)},close:function(){return t.close()},next:function(){return t.change(1)},prev:function(){return t.change(-1)},"goto":function(e){return t.open(e)},current:function(){return t.settings.currentImage},place:function(){return t.place(t.settings.currentImage,t.settings.duration)},destroy:function(){return t.destroy()},set:function(e,i){return t.settings[e]=i,i},get:function(e){return t.settings[e]},getElem:function(e){return t.elems[e]}}}});var a={container:e,imageSelector:".chocolat-image",className:"",imageSize:"default",initialZoomState:null,fullScreen:!1,loop:!1,linkImages:!0,duration:300,setTitle:"",separator2:"/",setIndex:0,firstImage:0,lastImage:!1,currentImage:!1,initialized:!1,timer:!1,timerDebounce:!1,images:[],enableZoom:!0,imageSource:"href",afterInitialize:function(){},afterMarkup:function(){},afterImageLoad:function(){},zoomedPaddingX:function(t,e){return 0},zoomedPaddingY:function(t,e){return 0}};t.fn.Chocolat=function(e){return this.each(function(){o++;var i=t.extend(!0,{},a,e,{setIndex:o});t.data(this,"chocolat")||t.data(this,"chocolat",new n(t(this),i))})}}); \ No newline at end of file diff --git a/ajax/libs/chocolat/package.json b/ajax/libs/chocolat/package.json index bb8700fe71553f..5b17b061c64cb5 100644 --- a/ajax/libs/chocolat/package.json +++ b/ajax/libs/chocolat/package.json @@ -1,7 +1,7 @@ { "name": "chocolat", "filename": "js/jquery.chocolat.min.js", - "version": "0.4.17", + "version": "0.4.18", "description": " Responsive jQuery Lightbox Plugin", "repository": { "type": "git",