From e07c55f3d1004a2f49448feabe30cd90187df134 Mon Sep 17 00:00:00 2001 From: Rodrigo Ferreira de Souza Date: Tue, 7 Feb 2017 17:01:46 -0200 Subject: [PATCH] Fix next/prev buttons when nitf id is not a good css selector --- CHANGES.rst | 4 + src/collective/nitf/browser/__init__.py | 3 - .../nitf/browser/templates/slideshow.pt | 10 +- .../nitf/static/images/next-arrow.png | Bin 171 -> 0 bytes .../nitf/static/images/prev-arrow.png | Bin 161 -> 0 bytes src/collective/nitf/static/nitf.css | 2 +- src/collective/nitf/static/nitf.js | 2 +- src/collective/nitf/static/nitf.js.map | 2 +- webpack/app/images/next-arrow.png | Bin 215 -> 0 bytes webpack/app/images/next-arrow.svg | 91 ++++++++++++++++++ webpack/app/images/prev-arrow.png | Bin 223 -> 0 bytes webpack/app/images/prev-arrow.svg | 91 ++++++++++++++++++ webpack/app/nitf.js | 30 +----- webpack/app/nitf.less | 87 +++++++++++++---- 14 files changed, 266 insertions(+), 56 deletions(-) delete mode 100644 src/collective/nitf/static/images/next-arrow.png delete mode 100644 src/collective/nitf/static/images/prev-arrow.png delete mode 100644 webpack/app/images/next-arrow.png create mode 100644 webpack/app/images/next-arrow.svg delete mode 100644 webpack/app/images/prev-arrow.png create mode 100644 webpack/app/images/prev-arrow.svg diff --git a/CHANGES.rst b/CHANGES.rst index 47fd7816..3b263da2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,10 @@ There's a frood who really knows where his towel is. 2.0b5 (unreleased) ^^^^^^^^^^^^^^^^^^ +- Simplify slideshow template to avoid depending on context id; + this solves an issue when id ends with ".html". + [rodfersou] + - Refactor static resources. [rodfersou] diff --git a/src/collective/nitf/browser/__init__.py b/src/collective/nitf/browser/__init__.py index 10cb4c27..4a05858b 100644 --- a/src/collective/nitf/browser/__init__.py +++ b/src/collective/nitf/browser/__init__.py @@ -42,9 +42,6 @@ class Slideshow(DefaultView): """Slideshow view of a News Article.""" - def id(self): - return id(self) - def js_resources(self): """Return a list of JS resources that are not available in the registry, but need to be loaded anyway. This way the slideshow diff --git a/src/collective/nitf/browser/templates/slideshow.pt b/src/collective/nitf/browser/templates/slideshow.pt index 0282e495..3dfebe3c 100644 --- a/src/collective/nitf/browser/templates/slideshow.pt +++ b/src/collective/nitf/browser/templates/slideshow.pt @@ -1,7 +1,7 @@ -
+ tal:condition="images">
+ data-cycle-prev="#nitf-slideshow .cycle-prev" + data-cycle-next="#nitf-slideshow .cycle-next">
diff --git a/src/collective/nitf/static/images/next-arrow.png b/src/collective/nitf/static/images/next-arrow.png deleted file mode 100644 index 65ecf2bd9c5572531b6c1abfba32d981e44ebdc3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^fXUwSj`ho-U3d8t0P}5)x7zm~(tGoO*obC_8pA$9A+%mJMy0 rI(f3BZ$s(|E`!C~49aq`46;BsOlD%M@u(^XYG?3t^>bP0l+XkKeu+az diff --git a/src/collective/nitf/static/images/prev-arrow.png b/src/collective/nitf/static/images/prev-arrow.png deleted file mode 100644 index 6b46d61285cf13b3dc2e33ae0e221f5f27f66647..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^fz&V$k5ZpF+}71-3uE984P$1Iq>w|tbcsvp;2RKo#um;0;1{% p*Q{mOmE8D7*#F9J56@hb!HtiUBna{line-height:0}.portaltype-collective-nitf-content.template-slideshow_view .cycle-next,.portaltype-collective-nitf-content.template-slideshow_view .cycle-prev{position:absolute;z-index:110;top:0;width:25%;height:79%;cursor:pointer;opacity:.7;border:none}.portaltype-collective-nitf-content.template-slideshow_view .cycle-prev{left:0;background:url(++resource++collective.nitf/images/prev-arrow.png) no-repeat scroll 10% 50% transparent}.portaltype-collective-nitf-content.template-slideshow_view .cycle-next{right:0;background:url(++resource++collective.nitf/images/next-arrow.png) no-repeat scroll 90% 50% transparent}.portaltype-collective-nitf-content.template-slideshow_view .cycle-next:hover,.portaltype-collective-nitf-content.template-slideshow_view .cycle-prev:hover{opacity:1}.portaltype-collective-nitf-content.template-slideshow_view .cycle-carrossel .thumb-itens{cursor:pointer}.portaltype-collective-nitf-content.template-slideshow_view a.edit-tile-link{z-index:150}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container{position:absolute;z-index:110;top:0;width:100%;text-align:center}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager{display:inline-block;margin:0 auto;padding:8px}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager>span{cursor:pointer}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager .cycle-pager-active{opacity:1}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container.thumbnails_square .cycle-pager{background:#fff}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container.thumbnails_square .cycle-pager a:last-child img{margin-right:0}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container.thumbnails_square .cycle-pager img{margin-right:8px;border-radius:5px}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container.numbers .cycle-pager{opacity:.6;background-color:#222}.portaltype-collective-nitf-content.template-slideshow_view #content .cycle-pager-container.numbers a:link{font-size:1.25em;padding:0 .25em;color:#fff}.portaltype-collective-nitf-content.template-slideshow_view .cycle-caption{position:absolute;z-index:120;top:15px;right:15px;color:#fff}.portaltype-collective-nitf-content.template-slideshow_view .cycle-overlay{position:absolute;z-index:120;bottom:0;width:100%;padding:15px 0;opacity:.5;color:#fff;background:none repeat scroll 0 0 #000}.portaltype-collective-nitf-content.template-slideshow_view .cycle-overlay>div{padding:0 15px}.portaltype-collective-nitf-content.template-slideshow_view .slide.cycle-sentinel{min-height:6em}.portaltype-collective-nitf-content.template-slideshow_view .wrapper-slideshow{float:left;min-width:100%}.portaltype-collective-nitf-content.template-slideshow_view .cycle-slideshow{max-width:65%;margin:0 auto}.portaltype-collective-nitf-content.template-slideshow_view .cycle-slideshow .slide,.portaltype-collective-nitf-content.template-slideshow_view .cycle-slideshow .slide img{min-width:100%}.portaltype-collective-nitf-content.template-slideshow_view .cycle-slideshow .cycle-slide img{position:relative;top:0;left:0;display:block;padding:0}.portaltype-collective-nitf-content.template-slideshow_view .cycle-slideshow .slide{display:none} +.sortable-media{margin:0!important;padding:0;list-style-type:none!important}.sortable-media li{position:relative;float:left;width:128px;height:128px;margin:0 10px 10px 0;padding:4px;border:1px solid silver;background-color:#fff}.sortable-media li:hover .button{visibility:visible}.sortable-media .draggable-item{display:block;overflow:hidden;height:90px;cursor:move;border:medium none}.sortable-media .button{right:0;visibility:hidden}.sortable-media .button,.sortable-media .button:hover{float:right;margin-top:6px;padding:3px 10px 3px 5px;color:#fff!important;background-color:#999}.sortable-media .button .icon{float:left;width:13px;height:15px}.sortable-media .button.edit{background:none repeat scroll 0 0 #75ad0a}.sortable-media .button.edit .icon{line-height:50px;margin-top:4px;margin-right:5px;background:url(++resource++collective.nitf/images/icons-media.png) no-repeat scroll 0 top transparent}.sortable-media .button.delete{position:absolute;top:0;right:0;background-color:#c43c35}.sortable-media .button.delete .icon{line-height:50px;margin-right:5px;background:url(++resource++collective.nitf/images/icons-media.png) no-repeat scroll -15px top transparent}.portaltype-collective-nitf-content.template-slideshow_view .slide.cycle-slide{overflow:hidden;max-width:100%}.portaltype-collective-nitf-content.template-slideshow_view .slide.cycle-slide>a{line-height:0}.portaltype-collective-nitf-content.template-slideshow_view #content a.cycle-next,.portaltype-collective-nitf-content.template-slideshow_view #content a.cycle-prev{position:absolute;z-index:110;top:0;bottom:0;overflow:hidden;width:15%;cursor:pointer;white-space:nowrap;text-indent:101%;opacity:.7;border:none}.portaltype-collective-nitf-content.template-slideshow_view .cycle-prev{left:0;background:url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8' standalone='no'?%3E %3C!-- Created with Inkscape (http://www.inkscape.org/) --%3E %3Csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' version='1.1' id='svg2' width='24.259726' height='39.594162' viewBox='0 0 24.259726 39.594162' sodipodi:docname='prev-arrow.svg' inkscape:version='0.92.0 r'%3E %3Cmetadata id='metadata8'%3E %3Crdf:RDF%3E %3Ccc:Work rdf:about=''%3E %3Cdc:format%3Eimage/svg+xml%3C/dc:format%3E %3Cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage' /%3E %3Cdc:title%3E%3C/dc:title%3E %3C/cc:Work%3E %3C/rdf:RDF%3E %3C/metadata%3E %3Cdefs id='defs6'%3E %3Cfilter inkscape:collect='always' style='color-interpolation-filters:sRGB' id='filter5240' x='-0.32709837' width='1.6541969' y='-0.15990271' height='1.3198054'%3E %3CfeGaussianBlur inkscape:collect='always' stdDeviation='1.9987839' id='feGaussianBlur5242' /%3E %3C/filter%3E %3C/defs%3E %3Csodipodi:namedview pagecolor='%23ffffff' bordercolor='%23666666' borderopacity='1' objecttolerance='10' gridtolerance='10' guidetolerance='10' inkscape:pageopacity='0' inkscape:pageshadow='2' inkscape:window-width='1916' inkscape:window-height='1037' id='namedview4' showgrid='false' inkscape:measure-start='0,0' inkscape:measure-end='0,0' showguides='true' inkscape:guide-bbox='true' fit-margin-top='0' fit-margin-left='0' fit-margin-right='0' fit-margin-bottom='0' inkscape:zoom='15.225806' inkscape:cx='0.88098368' inkscape:cy='14.90903' inkscape:window-x='0' inkscape:window-y='20' inkscape:window-maximized='0' inkscape:current-layer='svg2' /%3E %3Cg id='g5246' transform='matrix(-1,0,0,1,22.142578,2.1171477)'%3E %3Cpath sodipodi:nodetypes='ccc' inkscape:connector-curvature='0' id='path4491' d='m 2.6799337,2.6799336 14.6655613,15.0000004 -14.6084176,15' style='fill:none;fill-opacity:1;fill-rule:evenodd;stroke:%234d4d4d;stroke-width:3.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(%23filter5240)' /%3E %3Cpath style='fill:none;fill-opacity:1;fill-rule:evenodd;stroke:%23ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1' d='m 2.6799334,2.6799336 14.6655616,15.0000004 -14.6084176,15' id='path4516' inkscape:connector-curvature='0' sodipodi:nodetypes='ccc' /%3E %3C/g%3E %3C/svg%3E") no-repeat scroll 20% 50% transparent}.portaltype-collective-nitf-content.template-slideshow_view .cycle-next{right:0;background:url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8' standalone='no'?%3E %3C!-- Created with Inkscape (http://www.inkscape.org/) --%3E %3Csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' version='1.1' id='svg2' width='24.259726' height='39.594162' viewBox='0 0 24.259726 39.594162' sodipodi:docname='next-arrow.svg' inkscape:version='0.92.0 r'%3E %3Cmetadata id='metadata8'%3E %3Crdf:RDF%3E %3Ccc:Work rdf:about=''%3E %3Cdc:format%3Eimage/svg+xml%3C/dc:format%3E %3Cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage' /%3E %3Cdc:title%3E%3C/dc:title%3E %3C/cc:Work%3E %3C/rdf:RDF%3E %3C/metadata%3E %3Cdefs id='defs6'%3E %3Cfilter inkscape:collect='always' style='color-interpolation-filters:sRGB' id='filter5240' x='-0.32709837' width='1.6541969' y='-0.15990271' height='1.3198054'%3E %3CfeGaussianBlur inkscape:collect='always' stdDeviation='1.9987839' id='feGaussianBlur5242' /%3E %3C/filter%3E %3C/defs%3E %3Csodipodi:namedview pagecolor='%23ffffff' bordercolor='%23666666' borderopacity='1' objecttolerance='10' gridtolerance='10' guidetolerance='10' inkscape:pageopacity='0' inkscape:pageshadow='2' inkscape:window-width='1916' inkscape:window-height='1037' id='namedview4' showgrid='false' inkscape:measure-start='0,0' inkscape:measure-end='0,0' showguides='true' inkscape:guide-bbox='true' fit-margin-top='0' fit-margin-left='0' fit-margin-right='0' fit-margin-bottom='0' inkscape:zoom='15.225806' inkscape:cx='0.88098368' inkscape:cy='14.90903' inkscape:window-x='0' inkscape:window-y='20' inkscape:window-maximized='0' inkscape:current-layer='svg2' /%3E %3Cg id='g5246' transform='translate(2.1171475,2.1171477)'%3E %3Cpath sodipodi:nodetypes='ccc' inkscape:connector-curvature='0' id='path4491' d='m 2.6799337,2.6799336 14.6655613,15.0000004 -14.6084176,15' style='fill:none;fill-opacity:1;fill-rule:evenodd;stroke:%234d4d4d;stroke-width:3.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(%23filter5240)' /%3E %3Cpath style='fill:none;fill-opacity:1;fill-rule:evenodd;stroke:%23ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1' d='m 2.6799334,2.6799336 14.6655616,15.0000004 -14.6084176,15' id='path4516' inkscape:connector-curvature='0' sodipodi:nodetypes='ccc' /%3E %3C/g%3E %3C/svg%3E") no-repeat scroll 80% 50% transparent}.portaltype-collective-nitf-content.template-slideshow_view .cycle-next:hover,.portaltype-collective-nitf-content.template-slideshow_view .cycle-prev:hover{opacity:1}.portaltype-collective-nitf-content.template-slideshow_view .cycle-carrossel .thumb-itens{min-width:128px;margin-right:5px;cursor:pointer}.portaltype-collective-nitf-content.template-slideshow_view a.edit-tile-link{z-index:150}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container{position:absolute;z-index:110;top:0;width:100%;text-align:center}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager{display:inline-block;margin:0 auto;padding:8px}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager>span{cursor:pointer}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager .cycle-pager-active{opacity:1}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container.thumbnails_square .cycle-pager{background:#fff}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container.thumbnails_square .cycle-pager a:last-child img{margin-right:0}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container.thumbnails_square .cycle-pager img{margin-right:8px;border-radius:5px}.portaltype-collective-nitf-content.template-slideshow_view .cycle-pager-container.numbers .cycle-pager{opacity:.6;background-color:#222}.portaltype-collective-nitf-content.template-slideshow_view #content .cycle-pager-container.numbers a:link{font-size:1.25em;padding:0 .25em;color:#fff}.portaltype-collective-nitf-content.template-slideshow_view .cycle-caption{position:absolute;z-index:120;top:15px;right:15px;color:#fff}.portaltype-collective-nitf-content.template-slideshow_view .cycle-overlay{position:absolute;z-index:120;bottom:0;width:100%;padding:15px 0;opacity:.5;color:#fff;background:none repeat scroll 0 0 #000}.portaltype-collective-nitf-content.template-slideshow_view .cycle-overlay>div{padding:0 15px}.portaltype-collective-nitf-content.template-slideshow_view .slide.cycle-sentinel{min-height:6em}.portaltype-collective-nitf-content.template-slideshow_view .wrapper-slideshow{float:left;min-width:100%}.portaltype-collective-nitf-content.template-slideshow_view .cycle-slideshow .cycle-slide{position:absolute;top:0;right:0;bottom:0;left:0}.portaltype-collective-nitf-content.template-slideshow_view .cycle-slideshow .cycle-slide img{position:relative;top:0;left:0;display:block;width:auto;max-width:100%;height:auto;max-height:100%;padding:0}.portaltype-collective-nitf-content.template-slideshow_view .cycle-slideshow .slide{display:none;min-width:100%}.portaltype-collective-nitf-content.template-slideshow_view .cycle-slideshow .slide img{min-width:100%}.portaltype-collective-nitf-content.template-slideshow_view .slideshow-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:768px;max-width:100%;margin:0 auto}.portaltype-collective-nitf-content.template-slideshow_view .slideshow-player{position:relative}.portaltype-collective-nitf-content.template-slideshow_view .slideshow-carrossel .cycle-slide,.portaltype-collective-nitf-content.template-slideshow_view .slideshow-player .cycle-slide{display:-ms-flexbox!important;display:flex!important;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.portaltype-collective-nitf-content.template-slideshow_view .cycle-carousel-wrap{position:absolute;top:0;right:0;bottom:0;left:0;display:-ms-flexbox;display:flex} /*# sourceMappingURL=nitf.css.map*/ \ No newline at end of file diff --git a/src/collective/nitf/static/nitf.js b/src/collective/nitf/static/nitf.js index b356ac2e..2fac0f70 100644 --- a/src/collective/nitf/static/nitf.js +++ b/src/collective/nitf/static/nitf.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["collective.nitf"]=t():e["collective.nitf"]=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="++resource++collective.nitf/",t(t.s=3)}([function(e,t){},function(e,t,n){e.exports=n.p+"nitf_icon.png"},function(e,t,n){e.exports=n.p+"tile-nitf.png"},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;nl.width()?(l.css("width","auto"),l.height(e)):(l.width(t),l.height(e))}},{key:"sync_slideshows",value:function(e,t){var n;n=this.$(".cycle-slideshow"),n.cycle("goto",t.currSlide)}},{key:"thumbs_click",value:function(e){var t,n,i;e.preventDefault(),n=this.$(".cycle-carrossel"),t=n.data("cycle.API").getSlideIndex(this),i=this.$(".cycle-slideshow"),i.cycle("goto",t)}}]),e}();$(window).load(function(){$(".portaltype-collective-nitf-content.template-slideshow_view").length>0&&new r($(".slideshow-container"))}),e.exports=r}])}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["collective.nitf"]=t():e["collective.nitf"]=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="++resource++collective.nitf/",t(t.s=3)}([function(e,t){},function(e,t,n){e.exports=n.p+"nitf_icon.png"},function(e,t,n){e.exports=n.p+"tile-nitf.png"},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n0&&new i($(".slideshow-container"))}),e.exports=i}])}); //# sourceMappingURL=nitf.js.map \ No newline at end of file diff --git a/src/collective/nitf/static/nitf.js.map b/src/collective/nitf/static/nitf.js.map index 5ec91265..55ebc6b1 100644 --- a/src/collective/nitf/static/nitf.js.map +++ b/src/collective/nitf/static/nitf.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///nitf.js","webpack:///webpack/bootstrap 7737c23487848d7bc79f","webpack:///./app/nitf_icon.png","webpack:///./app/tile-nitf.png","webpack:///./app/nitf.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","length","descriptor","writable","key","protoProps","staticProps","SlideShow","el","$el","$","proportion","bind_events","fix_image_size","_$","_x","apply","arguments","toString","selector","on","proxy","sync_slideshows","thumbs_click","max_height","max_width","len","ref","img","$player","$img","width","height","css","e","opts","$slideshows","cycle","currSlide","index","$thumbs","preventDefault","data","getSlideIndex","window","load"],"mappings":"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","file":"nitf.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"collective.nitf\"] = factory();\n\telse\n\t\troot[\"collective.nitf\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"collective.nitf\"] = factory();\n\telse\n\t\troot[\"collective.nitf\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"++resource++collective.nitf/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__.p + \"nitf_icon.png\";\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__.p + \"tile-nitf.png\";\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\n__webpack_require__(0);\n\n__webpack_require__(1);\n\n__webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SlideShow = function () {\n function SlideShow(el) {\n _classCallCheck(this, SlideShow);\n\n this.$el = $(el);\n this.proportion = 3 / 2;\n this.bind_events();\n this.fix_image_size();\n }\n\n _createClass(SlideShow, [{\n key: '$',\n value: function (_$) {\n function $(_x) {\n return _$.apply(this, arguments);\n }\n\n $.toString = function () {\n return _$.toString();\n };\n\n return $;\n }(function (selector) {\n return $(selector, this.$el);\n })\n }, {\n key: 'bind_events',\n value: function bind_events() {\n this.$('.cycle-player').on('cycle-next cycle-prev', $.proxy(this.sync_slideshows, this));\n this.$('.cycle-carrossel .thumb-itens').on('click', $.proxy(this.thumbs_click, this));\n }\n }, {\n key: 'fix_image_size',\n value: function fix_image_size() {\n var max_height, max_width, i, len, ref, img, $player, $img;\n\n // Calc max_with and max_height\n $player = this.$('.cycle-player');\n max_width = $player.width();\n max_height = max_width / this.proportion;\n // Calc max_with and max_height\n\n // Update properties when necessary\n ref = this.$('.cycle-player img');\n for (i = 0, len = ref.length; i < len; i++) {\n img = ref[i];\n $img = $(img);\n if ($img.height() > $img.width()) {\n $img.css('width', 'auto');\n $img.height(max_height);\n } else {\n $img.width(max_width);\n $img.height(max_height);\n }\n }\n }\n }, {\n key: 'sync_slideshows',\n value: function sync_slideshows(e, opts) {\n var index, $player, $slideshows;\n $slideshows = this.$('.cycle-slideshow');\n $slideshows.cycle('goto', opts.currSlide);\n }\n }, {\n key: 'thumbs_click',\n value: function thumbs_click(e) {\n var index, $thumbs, $slideshows;\n e.preventDefault();\n $thumbs = this.$('.cycle-carrossel');\n index = $thumbs.data('cycle.API').getSlideIndex(this);\n $slideshows = this.$('.cycle-slideshow');\n $slideshows.cycle('goto', index);\n }\n }]);\n\n return SlideShow;\n}();\n\n$(window).load(function () {\n if ($('.portaltype-collective-nitf-content.template-slideshow_view').length > 0) {\n new SlideShow($('.slideshow-container'));\n }\n});\n\nmodule.exports = SlideShow;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// nitf.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"++resource++collective.nitf/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 7737c23487848d7bc79f","module.exports = __webpack_public_path__ + \"nitf_icon.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/nitf_icon.png\n// module id = 1\n// module chunks = 0","module.exports = __webpack_public_path__ + \"tile-nitf.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/tile-nitf.png\n// module id = 2\n// module chunks = 0","import './nitf.less';\nimport './nitf_icon.png';\nimport './tile-nitf.png';\n\nclass SlideShow {\n constructor(el) {\n this.$el = $(el);\n this.proportion = 3 / 2;\n this.bind_events();\n this.fix_image_size();\n }\n\n $(selector) {\n return $(selector, this.$el);\n }\n\n bind_events() {\n this.$('.cycle-player').on('cycle-next cycle-prev', $.proxy(this.sync_slideshows, this));\n this.$('.cycle-carrossel .thumb-itens').on('click', $.proxy(this.thumbs_click, this));\n }\n\n fix_image_size() {\n var max_height, max_width, i, len, ref, img, $player, $img;\n\n // Calc max_with and max_height\n $player = this.$('.cycle-player');\n max_width = $player.width();\n max_height = max_width / this.proportion;\n // Calc max_with and max_height\n\n // Update properties when necessary\n ref = this.$('.cycle-player img');\n for (i = 0, len = ref.length; i < len; i++) {\n img = ref[i];\n $img = $(img);\n if ($img.height() > $img.width()) {\n $img.css('width', 'auto');\n $img.height(max_height);\n } else {\n $img.width(max_width);\n $img.height(max_height);\n }\n }\n }\n\n sync_slideshows(e, opts) {\n var index, $player, $slideshows;\n $slideshows = this.$('.cycle-slideshow');\n $slideshows.cycle('goto', opts.currSlide);\n }\n\n thumbs_click(e) {\n var index, $thumbs, $slideshows;\n e.preventDefault();\n $thumbs = this.$('.cycle-carrossel');\n index = $thumbs.data('cycle.API').getSlideIndex(this);\n $slideshows = this.$('.cycle-slideshow');\n $slideshows.cycle('goto', index);\n }\n}\n\n$(window).load(() => {\n if ($('.portaltype-collective-nitf-content.template-slideshow_view').length > 0) {\n new SlideShow($('.slideshow-container'));\n }\n});\n\nmodule.exports = SlideShow;\n\n\n\n// WEBPACK FOOTER //\n// ./app/nitf.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///nitf.js","webpack:///webpack/bootstrap 2bfbafa0be8425a43881","webpack:///./app/nitf_icon.png","webpack:///./app/tile-nitf.png","webpack:///./app/nitf.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","length","descriptor","writable","key","protoProps","staticProps","SlideShow","el","$el","$","proportion","bind_events","_$","_x","apply","arguments","toString","selector","on","proxy","sync_slideshows","thumbs_click","e","opts","$slideshows","cycle","currSlide","index","$thumbs","api","preventDefault","data","getSlideIndex","parentElement","window","load"],"mappings":"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","file":"nitf.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"collective.nitf\"] = factory();\n\telse\n\t\troot[\"collective.nitf\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"collective.nitf\"] = factory();\n\telse\n\t\troot[\"collective.nitf\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"++resource++collective.nitf/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__.p + \"nitf_icon.png\";\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__.p + \"tile-nitf.png\";\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\n__webpack_require__(0);\n\n__webpack_require__(1);\n\n__webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SlideShow = function () {\n function SlideShow(el) {\n _classCallCheck(this, SlideShow);\n\n this.$el = $(el);\n this.proportion = 3 / 2;\n this.bind_events();\n }\n\n _createClass(SlideShow, [{\n key: '$',\n value: function (_$) {\n function $(_x) {\n return _$.apply(this, arguments);\n }\n\n $.toString = function () {\n return _$.toString();\n };\n\n return $;\n }(function (selector) {\n return $(selector, this.$el);\n })\n }, {\n key: 'bind_events',\n value: function bind_events() {\n this.$('.cycle-player').on('cycle-next cycle-prev', $.proxy(this.sync_slideshows, this));\n this.$('.cycle-carrossel .thumb-itens').on('click', $.proxy(this.thumbs_click, this));\n }\n }, {\n key: 'sync_slideshows',\n value: function sync_slideshows(e, opts) {\n var index, $player, $slideshows;\n $slideshows = this.$('.cycle-slideshow');\n $slideshows.cycle('goto', opts.currSlide);\n }\n }, {\n key: 'thumbs_click',\n value: function thumbs_click(e) {\n var index, $thumbs, api, $slideshows;\n e.preventDefault();\n $thumbs = this.$('.cycle-carrossel');\n api = $thumbs.data('cycle.API');\n index = api.getSlideIndex(e.target.parentElement);\n $slideshows = this.$('.cycle-slideshow');\n $slideshows.cycle('goto', index);\n }\n }]);\n\n return SlideShow;\n}();\n\n$(window).load(function () {\n if ($('.portaltype-collective-nitf-content.template-slideshow_view').length > 0) {\n new SlideShow($('.slideshow-container'));\n }\n});\n\nmodule.exports = SlideShow;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// nitf.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"++resource++collective.nitf/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2bfbafa0be8425a43881","module.exports = __webpack_public_path__ + \"nitf_icon.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/nitf_icon.png\n// module id = 1\n// module chunks = 0","module.exports = __webpack_public_path__ + \"tile-nitf.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/tile-nitf.png\n// module id = 2\n// module chunks = 0","import './nitf.less';\nimport './nitf_icon.png';\nimport './tile-nitf.png';\n\nclass SlideShow {\n constructor(el) {\n this.$el = $(el);\n this.proportion = 3 / 2;\n this.bind_events();\n }\n\n $(selector) {\n return $(selector, this.$el);\n }\n\n bind_events() {\n this.$('.cycle-player').on('cycle-next cycle-prev', $.proxy(this.sync_slideshows, this));\n this.$('.cycle-carrossel .thumb-itens').on('click', $.proxy(this.thumbs_click, this));\n }\n\n sync_slideshows(e, opts) {\n var index, $player, $slideshows;\n $slideshows = this.$('.cycle-slideshow');\n $slideshows.cycle('goto', opts.currSlide);\n }\n\n thumbs_click(e) {\n var index, $thumbs, api, $slideshows;\n e.preventDefault();\n $thumbs = this.$('.cycle-carrossel');\n api = $thumbs.data('cycle.API');\n index = api.getSlideIndex(e.target.parentElement);\n $slideshows = this.$('.cycle-slideshow');\n $slideshows.cycle('goto', index);\n }\n}\n\n$(window).load(() => {\n if ($('.portaltype-collective-nitf-content.template-slideshow_view').length > 0) {\n new SlideShow($('.slideshow-container'));\n }\n});\n\nmodule.exports = SlideShow;\n\n\n\n// WEBPACK FOOTER //\n// ./app/nitf.js"],"sourceRoot":""} \ No newline at end of file diff --git a/webpack/app/images/next-arrow.png b/webpack/app/images/next-arrow.png deleted file mode 100644 index 95ac0ce0a36beff13f1315dfbb500bf9f4306e9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^fjA5L~c#`DCC7XMsm# zF#`j)FbFd;%$g$s6l5>)^mS#w$0^ItBI=nJBL@^p@pN$v@i_kW%tGD<0}1P>g)rm-&o-9Bdtqj6M#GMY#fvQ)i1j)n9zcZHi5m z>&o7Y;Kg?rEj62|YtiV)$+zJ1f#&~gdqr#(1#*Rm8>*hXpTO&I3uqsMr>mdKI;Vst E0KWG>@Bjb+ diff --git a/webpack/app/images/next-arrow.svg b/webpack/app/images/next-arrow.svg new file mode 100644 index 00000000..1403df02 --- /dev/null +++ b/webpack/app/images/next-arrow.svg @@ -0,0 +1,91 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/webpack/app/images/prev-arrow.png b/webpack/app/images/prev-arrow.png deleted file mode 100644 index a5fe4429750541ab26b6e52186e01a55e4041427..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^fjA5L~c#`DCC7XMsm# zF#`j)FbFd;%$g$s6l5>)^mS#w$0^ItY<}6l+ZHI4%M`_TlnDvCF>0g%s<)kQkLvid-az|PPn(jaDkA&1B=mx>V_kM`}V$IQBn9O zz;U1Xkagop?lWl)69XHMvS?gln(fs5Ts|v7H=vQLgf(kVfV%%SW=pk`*SdZS&Ia1c N;OXk;vd$@?2>>yIMnnJr diff --git a/webpack/app/images/prev-arrow.svg b/webpack/app/images/prev-arrow.svg new file mode 100644 index 00000000..09d58d9a --- /dev/null +++ b/webpack/app/images/prev-arrow.svg @@ -0,0 +1,91 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/webpack/app/nitf.js b/webpack/app/nitf.js index 6d1e1ea9..8e10e95f 100644 --- a/webpack/app/nitf.js +++ b/webpack/app/nitf.js @@ -7,7 +7,6 @@ class SlideShow { this.$el = $(el); this.proportion = 3 / 2; this.bind_events(); - this.fix_image_size(); } $(selector) { @@ -19,30 +18,6 @@ class SlideShow { this.$('.cycle-carrossel .thumb-itens').on('click', $.proxy(this.thumbs_click, this)); } - fix_image_size() { - var max_height, max_width, i, len, ref, img, $player, $img; - - // Calc max_with and max_height - $player = this.$('.cycle-player'); - max_width = $player.width(); - max_height = max_width / this.proportion; - // Calc max_with and max_height - - // Update properties when necessary - ref = this.$('.cycle-player img'); - for (i = 0, len = ref.length; i < len; i++) { - img = ref[i]; - $img = $(img); - if ($img.height() > $img.width()) { - $img.css('width', 'auto'); - $img.height(max_height); - } else { - $img.width(max_width); - $img.height(max_height); - } - } - } - sync_slideshows(e, opts) { var index, $player, $slideshows; $slideshows = this.$('.cycle-slideshow'); @@ -50,10 +25,11 @@ class SlideShow { } thumbs_click(e) { - var index, $thumbs, $slideshows; + var index, $thumbs, api, $slideshows; e.preventDefault(); $thumbs = this.$('.cycle-carrossel'); - index = $thumbs.data('cycle.API').getSlideIndex(this); + api = $thumbs.data('cycle.API'); + index = api.getSlideIndex(e.target.parentElement); $slideshows = this.$('.cycle-slideshow'); $slideshows.cycle('goto', index); } diff --git a/webpack/app/nitf.less b/webpack/app/nitf.less index 0db0b17b..52f4ee7a 100644 --- a/webpack/app/nitf.less +++ b/webpack/app/nitf.less @@ -101,16 +101,20 @@ } /* Prev/Next arrows */ - .cycle-prev, - .cycle-next { + #content a.cycle-prev, + #content a.cycle-next { position: absolute; z-index: 110; top: 0; + bottom: 0; + + overflow: hidden; - width: 25%; - height: 79%; + width: 15%; cursor: pointer; + white-space: nowrap; + text-indent: 101%; opacity: .7; border: none; @@ -119,13 +123,13 @@ .cycle-prev { left: 0; - background: url(images/prev-arrow.png) no-repeat scroll 10% 50% rgba(0, 0, 0, 0); + background: url(images/prev-arrow.svg) no-repeat scroll 20% 50% rgba(0, 0, 0, 0); } .cycle-next { right: 0; - background: url(images/next-arrow.png) no-repeat scroll 90% 50% rgba(0, 0, 0, 0); + background: url(images/next-arrow.svg) no-repeat scroll 80% 50% rgba(0, 0, 0, 0); } .cycle-prev:hover, @@ -134,6 +138,9 @@ } .cycle-carrossel .thumb-itens { + min-width: 128px; + margin-right: 5px; + cursor: pointer; } @@ -228,26 +235,70 @@ } .cycle-slideshow { - max-width: 65%; - margin: 0 auto; - .slide { - min-width: 100%; - img { - min-width: 100%; - } - } - .cycle-slide img { - position: relative; + .cycle-slide { + position: absolute; top: 0; + right: 0; + bottom: 0; left: 0; + img { + position: relative; + top: 0; + left: 0; - display: block; + display: block; - padding: 0; + width: auto; + max-width: 100%; + height: auto; + max-height: 100%; + padding: 0; + } } /* Stop Flash of unstyled content */ .slide { display: none; + min-width: 100%; + img { + min-width: 100%; + } } } + + .slideshow-container { + display: flex; + flex-direction: column; + + width: 768px; + max-width: 100%; + margin: 0 auto; + } + + .slideshow-player { + position: relative; + .cycle-slide { + display: flex !important; + + align-items: center; + justify-content: center; + } + } + + .slideshow-carrossel .cycle-slide { + display: flex !important; + + align-items: center; + justify-content: center; + } + + .cycle-carousel-wrap { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + + display: flex; + } } +