diff --git a/src/collective/nitf/static/nitf.js b/src/collective/nitf/static/nitf.js index 1d501039..026427c0 100644 --- a/src/collective/nitf/static/nitf.js +++ b/src/collective/nitf/static/nitf.js @@ -1,2 +1,2 @@ -!function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.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="",t(t.s=3)}([function(e,t){},function(e,t){e.exports="++resource++collective.nitf/nitf_icon.png"},function(e,t){e.exports="++resource++collective.nitf/tile-nitf.png"},function(e,t,n){"use strict";n(0),n(1),n(2),function(e){var t=function(){function t(t){var n=this;n.$el=e(t),n.proportion=1.5,n.bind_events(),n.fix_image_size()}return t.prototype.$=function(t){var n=this;return e(t,n.$el)},t.prototype.bind_events=function(){var e=this;e.$(".cycle-player").on("cycle-next cycle-prev",e,e.sync_slideshows),e.$(".cycle-carrossel .thumb-itens").on("click",e,e.thumbs_click)},t.prototype.fix_image_size=function(){var t,n,o,i,c,r,l,a,s;for(t=this,a=t.$(".cycle-player"),o=a.width(),n=o/t.proportion,r=t.$(".cycle-player img"),i=0,c=r.length;is.width()?(s.css("width","auto"),s.height(n)):(s.width(o),s.height(n))},t.prototype.sync_slideshows=function(e,t){var n,o;n=e.data,o=n.$(".cycle-slideshow"),o.cycle("goto",t.currSlide)},t.prototype.thumbs_click=function(e){var t,n,o,i;t=e.data,e.preventDefault(),o=t.$(".cycle-carrossel"),n=o.data("cycle.API").getSlideIndex(this),i=t.$(".cycle-slideshow"),i.cycle("goto",n)},t}();e(document).ready(function(){var n=e("body.portaltype-collective-nitf-content.template-view").length>0,o=n&&e(".newsImageContainer").length>0,i=e("body.portaltype-collective-nitf-content.template-slideshow").length>0;if(o){var c=e("#parent-fieldname-image");c.append(''),/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?c.attr("href",c.attr("href").replace("@@slideshow","@@slideshow?ajax_include_head=1&ajax_load=1")):c.prepOverlay({subtype:"ajax",filter:"#content > *",width:.95*e(document).width()+"px",config:{onLoad:function(n){e(".cycle-slideshow").cycle(),new t(e(".slideshow-container"))}}})}else if(i){var r=function(){window.location.hash||(document.height0&&new t(e(".slideshow-container"))})}(jQuery)}]); +!function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.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="",t(t.s=3)}([function(e,t){},function(e,t){e.exports="++resource++collective.nitf/nitf_icon.png"},function(e,t){e.exports="++resource++collective.nitf/tile-nitf.png"},function(e,t,n){"use strict";n(0),n(1),n(2),function(e){var t=function(){function t(t){var n=this;n.$el=e(t),n.proportion=1.5,n.bind_events()}return t.prototype.$=function(t){var n=this;return e(t,n.$el)},t.prototype.bind_events=function(){var e=this;e.$(".cycle-player").on("cycle-next cycle-prev",e,e.sync_slideshows),e.$(".cycle-carrossel .thumb-itens").on("click",e,e.thumbs_click)},t.prototype.sync_slideshows=function(e,t){var n,o;n=e.data,o=n.$(".cycle-slideshow"),o.cycle("goto",t.currSlide)},t.prototype.thumbs_click=function(e){var t,n,o,i;t=e.data,e.preventDefault(),o=t.$(".cycle-carrossel"),n=o.data("cycle.API").getSlideIndex(this),i=t.$(".cycle-slideshow"),i.cycle("goto",n)},t}();e(document).ready(function(){var n=e("body.portaltype-collective-nitf-content.template-view").length>0,o=n&&e(".newsImageContainer").length>0,i=e("body.portaltype-collective-nitf-content.template-slideshow").length>0;if(o){var c=e("#parent-fieldname-image");c.append(''),/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?c.attr("href",c.attr("href").replace("@@slideshow","@@slideshow?ajax_include_head=1&ajax_load=1")):c.prepOverlay({subtype:"ajax",filter:"#content > *",width:.95*e(document).width()+"px",config:{onLoad:function(n){e(".cycle-slideshow").cycle(),new t(e(".slideshow-container"))}}})}else if(i){var r=function(){window.location.hash||(document.height0&&new t(e(".slideshow-container"))})}(jQuery)}]); //# 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 5c7889ae..6bac6a94 100644 --- a/src/collective/nitf/static/nitf.js.map +++ b/src/collective/nitf/static/nitf.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///nitf.js","webpack:///webpack/bootstrap e1f900dec5f74becf764","webpack:///./app/nitf_icon.png","webpack:///./app/tile-nitf.png","webpack:///./app/main.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","$","SlideShow","el","self","this","$el","proportion","bind_events","fix_image_size","selector","on","sync_slideshows","thumbs_click","max_height","max_width","len","ref","img","$player","$img","width","length","height","css","e","opts","$slideshows","data","cycle","currSlide","index","$thumbs","preventDefault","getSlideIndex","document","ready","nitf_view","nitf_with_image","slideshow","link","append","test","navigator","userAgent","attr","replace","prepOverlay","subtype","filter","config","onLoad","hideAddressBar","window","location","hash","outerHeight","body","style","setTimeout","scrollTo","addEventListener","pageYOffset","load","jQuery"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,E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KO,aACHC,QAAS,OACTC,OAAQ,eACR5B,MAA8B,IAAtBpB,EAAEkC,UAAUd,QAAkB,KACtC6B,QACEC,OAAQ,SAAU1B,GAEhBxB,EAAE,oBAAoB4B,QACtB,GAAI3B,GAAUD,EAAE,iCAKnB,IAAIsC,EAAW,CAIpB,GAAIa,GAAiB,WACdC,OAAOC,SAASC,OACfpB,SAASZ,OAAS8B,OAAOG,cAC3BrB,SAASsB,KAAKC,MAAMnC,OAAU8B,OAAOG,YAAc,GAAM,MAG3DG,WAAW,WACTN,OAAOO,SAAS,EAAG,IAClB,KAIPP,QAAOQ,iBAAiB,OAAQ,WACzBR,OAAOS,aACVV,IAEF,GAAIlD,GAAUD,EAAE,2BAElBoD,OAAOQ,iBAAiB,oBAAqBT,MAGjDnD,EAAEoD,QAAQU,KAAK,WACT9D,EAAE,mEAAmEqB,OAAS,GAChF,GAAIpB,GAAUD,EAAE,4BAGnB+D","file":"nitf.js","sourcesContent":["/******/ (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 = \"\";\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) {\n\nmodule.exports = \"++resource++collective.nitf/nitf_icon.png\";\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"++resource++collective.nitf/tile-nitf.png\";\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(1);\n\n__webpack_require__(2);\n\n(function ($) {\n \"use strict\";\n\n var SlideShow = function () {\n function SlideShow(el) {\n var self = this;\n self.$el = $(el);\n self.proportion = 3 / 2;\n self.bind_events();\n self.fix_image_size();\n }\n SlideShow.prototype.$ = function (selector) {\n var self = this;\n return $(selector, self.$el);\n };\n SlideShow.prototype.bind_events = function () {\n var self = this;\n self.$('.cycle-player').on('cycle-next cycle-prev', self, self.sync_slideshows);\n self.$('.cycle-carrossel .thumb-itens').on('click', self, self.thumbs_click);\n };\n SlideShow.prototype.fix_image_size = function () {\n var self, max_height, max_width, i, len, ref, img, $player, $img;\n self = this;\n\n // Calc max_with and max_height\n $player = self.$('.cycle-player');\n max_width = $player.width();\n max_height = max_width / self.proportion;\n // Calc max_with and max_height\n\n // Update properties when necessary\n ref = self.$('.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 SlideShow.prototype.sync_slideshows = function (e, opts) {\n var self, index, $player, $slideshows;\n self = e.data;\n $slideshows = self.$('.cycle-slideshow');\n $slideshows.cycle('goto', opts.currSlide);\n };\n\n SlideShow.prototype.thumbs_click = function (e) {\n var self, index, $thumbs, $slideshows;\n self = e.data;\n e.preventDefault();\n $thumbs = self.$('.cycle-carrossel');\n index = $thumbs.data('cycle.API').getSlideIndex(this);\n $slideshows = self.$('.cycle-slideshow');\n $slideshows.cycle('goto', index);\n };\n return SlideShow;\n }();\n\n $(document).ready(function () {\n // If this is a NITF content with an image\n var nitf_view = $('body.portaltype-collective-nitf-content.template-view').length > 0;\n var nitf_with_image = nitf_view && $('.newsImageContainer').length > 0;\n var slideshow = $('body.portaltype-collective-nitf-content.template-slideshow').length > 0;\n if (nitf_with_image) {\n // Turn image link into something special\n var link = $('#parent-fieldname-image');\n // Add a magnify icon over the image\n link.append('');\n // For mobile devices, link will open slideshow\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {\n link.attr('href', link.attr('href').replace('@@slideshow', '@@slideshow?ajax_include_head=1&ajax_load=1'));\n } else {\n // For other devices open a slideshow in an overlay\n link.prepOverlay({\n subtype: 'ajax',\n filter: '#content > *',\n width: $(document).width() * 0.95 + 'px',\n config: {\n onLoad: function onLoad(e) {\n // Start cycle2\n $('.cycle-slideshow').cycle();\n new SlideShow($('.slideshow-container'));\n }\n }\n });\n }\n } else if (slideshow) {\n // For slideshow template, hide address bar after page load\n // in mobile devices\n /* To hide address bar after page load */\n var hideAddressBar = function hideAddressBar() {\n if (!window.location.hash) {\n if (document.height < window.outerHeight) {\n document.body.style.height = window.outerHeight + 50 + 'px';\n }\n\n setTimeout(function () {\n window.scrollTo(0, 1);\n }, 50);\n }\n };\n\n window.addEventListener(\"load\", function () {\n if (!window.pageYOffset) {\n hideAddressBar();\n }\n new SlideShow($('.slideshow-container'));\n });\n window.addEventListener(\"orientationchange\", hideAddressBar);\n }\n });\n $(window).load(function () {\n if ($('body.portaltype-collective-nitf-content.template-slideshow_view').length > 0) {\n new SlideShow($('.slideshow-container'));\n }\n });\n})(jQuery);\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 = \"\";\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 e1f900dec5f74becf764","module.exports = \"++resource++collective.nitf/nitf_icon.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/nitf_icon.png\n// module id = 1\n// module chunks = 0","module.exports = \"++resource++collective.nitf/tile-nitf.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/tile-nitf.png\n// module id = 2\n// module chunks = 0","import './main.css';\nimport './nitf_icon.png';\nimport './tile-nitf.png';\n\n(function ($) {\n \"use strict\";\n\n var SlideShow = (function() {\n function SlideShow(el) {\n var self = this;\n self.$el = $(el);\n self.proportion = 3 / 2;\n self.bind_events();\n self.fix_image_size();\n }\n SlideShow.prototype.$ = function(selector) {\n var self = this;\n return $(selector, self.$el);\n };\n SlideShow.prototype.bind_events = function() {\n var self = this;\n self.$('.cycle-player').on('cycle-next cycle-prev', self, self.sync_slideshows);\n self.$('.cycle-carrossel .thumb-itens').on('click', self, self.thumbs_click);\n };\n SlideShow.prototype.fix_image_size = function() {\n var self, max_height, max_width, i, len, ref, img, $player, $img;\n self = this;\n\n // Calc max_with and max_height\n $player = self.$('.cycle-player');\n max_width = $player.width();\n max_height = max_width / self.proportion;\n // Calc max_with and max_height\n\n // Update properties when necessary\n ref = self.$('.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 SlideShow.prototype.sync_slideshows = function(e, opts) {\n var self, index, $player, $slideshows;\n self = e.data;\n $slideshows = self.$('.cycle-slideshow');\n $slideshows.cycle('goto', opts.currSlide);\n };\n\n SlideShow.prototype.thumbs_click = function(e) {\n var self, index, $thumbs, $slideshows;\n self = e.data;\n e.preventDefault();\n $thumbs = self.$('.cycle-carrossel');\n index = $thumbs.data('cycle.API').getSlideIndex(this);\n $slideshows = self.$('.cycle-slideshow');\n $slideshows.cycle('goto', index);\n };\n return SlideShow;\n })();\n\n $(document).ready(function () {\n // If this is a NITF content with an image\n var nitf_view = $('body.portaltype-collective-nitf-content.template-view').length > 0;\n var nitf_with_image = nitf_view && $('.newsImageContainer').length > 0;\n var slideshow = $('body.portaltype-collective-nitf-content.template-slideshow').length > 0;\n if (nitf_with_image) {\n // Turn image link into something special\n var link = $('#parent-fieldname-image');\n // Add a magnify icon over the image\n link.append('');\n // For mobile devices, link will open slideshow\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {\n link.attr('href', link.attr('href').replace('@@slideshow', '@@slideshow?ajax_include_head=1&ajax_load=1'));\n } else {\n // For other devices open a slideshow in an overlay\n link.prepOverlay({\n subtype: 'ajax',\n filter: '#content > *',\n width: ($(document).width() * 0.95) + 'px',\n config: {\n onLoad: function (e) {\n // Start cycle2\n $('.cycle-slideshow').cycle();\n new SlideShow($('.slideshow-container'));\n }\n }\n });\n }\n } else if (slideshow) {\n // For slideshow template, hide address bar after page load\n // in mobile devices\n /* To hide address bar after page load */\n var hideAddressBar = function() {\n if (!window.location.hash) {\n if (document.height < window.outerHeight) {\n document.body.style.height = (window.outerHeight + 50) + 'px';\n }\n\n setTimeout(function () {\n window.scrollTo(0, 1);\n }, 50);\n }\n };\n\n window.addEventListener(\"load\", function () {\n if (!window.pageYOffset) {\n hideAddressBar();\n }\n new SlideShow($('.slideshow-container'));\n });\n window.addEventListener(\"orientationchange\", hideAddressBar);\n }\n });\n $(window).load(function() {\n if ($('body.portaltype-collective-nitf-content.template-slideshow_view').length > 0) {\n new SlideShow($('.slideshow-container'));\n }\n });\n})(jQuery);\n\n\n\n// WEBPACK FOOTER //\n// ./app/main.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///nitf.js","webpack:///webpack/bootstrap 6f91924ad42ff5f5efc8","webpack:///./app/nitf_icon.png","webpack:///./app/tile-nitf.png","webpack:///./app/main.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","$","SlideShow","el","self","this","$el","proportion","bind_events","selector","on","sync_slideshows","thumbs_click","e","opts","$slideshows","data","cycle","currSlide","index","$thumbs","preventDefault","getSlideIndex","document","ready","nitf_view","length","nitf_with_image","slideshow","link","append","test","navigator","userAgent","attr","replace","prepOverlay","subtype","filter","width","config","onLoad","hideAddressBar","window","location","hash","height","outerHeight","body","style","setTimeout","scrollTo","addEventListener","pageYOffset","load","jQuery"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA+DA,OAnCAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAK,EA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C,GAAIT,GAAMe,EAAOC,EAASL,CAC1BX,GAAOS,EAAEG,KACTH,EAAEQ,iBACFD,EAAUhB,EAAKH,EAAE,oBACjBkB,EAAQC,EAAQJ,KAAK,aAAaM,cAAcjB,MAChDU,EAAcX,EAAKH,EAAE,oBACrBc,EAAYE,MAAM,OAAQE,IAErBjB,IAGTD,GAAEsB,UAAUC,MAAM,WAEhB,GAAIC,GAAYxB,EAAE,yDAAyDyB,OAAS,EAChFC,EAAkBF,GAAaxB,EAAE,uBAAuByB,OAAS,EACjEE,EAAY3B,EAAE,8DAA8DyB,OAAS,CACzF,IAAIC,EAAiB,CAEnB,GAAIE,GAAO5B,EAAE,0BAEb4B,GAAKC,OAAO,iCAER,6CAA6CC,KAAKC,UAAUC,WAC9DJ,EAAKK,KAAK,OAAQL,EAAKK,KAAK,QAAQC,QAAQ,cAAe,oDAG3DN,EAAKO,aACHC,QAAS,OACTC,OAAQ,eACRC,MAA8B,IAAtBtC,EAAEsB,UAAUgB,QAAkB,KACtCC,QACEC,OAAQ,SAAU5B,GAEhBZ,EAAE,oBAAoBgB,QACtB,GAAIf,GAAUD,EAAE,iCAKnB,IAAI2B,EAAW,CAIpB,GAAIc,GAAiB,WACdC,OAAOC,SAASC,OACftB,SAASuB,OAASH,OAAOI,cAC3BxB,SAASyB,KAAKC,MAAMH,OAAUH,OAAOI,YAAc,GAAM,MAG3DG,WAAW,WACTP,OAAOQ,SAAS,EAAG,IAClB,KAIPR,QAAOS,iBAAiB,OAAQ,WACzBT,OAAOU,aACVX,IAEF,GAAIxC,GAAUD,EAAE,2BAElB0C,OAAOS,iBAAiB,oBAAqBV,MAGjDzC,EAAE0C,QAAQW,KAAK,WACTrD,EAAE,mEAAmEyB,OAAS,GAChF,GAAIxB,GAAUD,EAAE,4BAGnBsD","file":"nitf.js","sourcesContent":["/******/ (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 = \"\";\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) {\n\nmodule.exports = \"++resource++collective.nitf/nitf_icon.png\";\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = \"++resource++collective.nitf/tile-nitf.png\";\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(1);\n\n__webpack_require__(2);\n\n(function ($) {\n \"use strict\";\n\n var SlideShow = function () {\n function SlideShow(el) {\n var self = this;\n self.$el = $(el);\n self.proportion = 3 / 2;\n self.bind_events();\n }\n SlideShow.prototype.$ = function (selector) {\n var self = this;\n return $(selector, self.$el);\n };\n SlideShow.prototype.bind_events = function () {\n var self = this;\n self.$('.cycle-player').on('cycle-next cycle-prev', self, self.sync_slideshows);\n self.$('.cycle-carrossel .thumb-itens').on('click', self, self.thumbs_click);\n };\n SlideShow.prototype.sync_slideshows = function (e, opts) {\n var self, index, $player, $slideshows;\n self = e.data;\n $slideshows = self.$('.cycle-slideshow');\n $slideshows.cycle('goto', opts.currSlide);\n };\n\n SlideShow.prototype.thumbs_click = function (e) {\n var self, index, $thumbs, $slideshows;\n self = e.data;\n e.preventDefault();\n $thumbs = self.$('.cycle-carrossel');\n index = $thumbs.data('cycle.API').getSlideIndex(this);\n $slideshows = self.$('.cycle-slideshow');\n $slideshows.cycle('goto', index);\n };\n return SlideShow;\n }();\n\n $(document).ready(function () {\n // If this is a NITF content with an image\n var nitf_view = $('body.portaltype-collective-nitf-content.template-view').length > 0;\n var nitf_with_image = nitf_view && $('.newsImageContainer').length > 0;\n var slideshow = $('body.portaltype-collective-nitf-content.template-slideshow').length > 0;\n if (nitf_with_image) {\n // Turn image link into something special\n var link = $('#parent-fieldname-image');\n // Add a magnify icon over the image\n link.append('');\n // For mobile devices, link will open slideshow\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {\n link.attr('href', link.attr('href').replace('@@slideshow', '@@slideshow?ajax_include_head=1&ajax_load=1'));\n } else {\n // For other devices open a slideshow in an overlay\n link.prepOverlay({\n subtype: 'ajax',\n filter: '#content > *',\n width: $(document).width() * 0.95 + 'px',\n config: {\n onLoad: function onLoad(e) {\n // Start cycle2\n $('.cycle-slideshow').cycle();\n new SlideShow($('.slideshow-container'));\n }\n }\n });\n }\n } else if (slideshow) {\n // For slideshow template, hide address bar after page load\n // in mobile devices\n /* To hide address bar after page load */\n var hideAddressBar = function hideAddressBar() {\n if (!window.location.hash) {\n if (document.height < window.outerHeight) {\n document.body.style.height = window.outerHeight + 50 + 'px';\n }\n\n setTimeout(function () {\n window.scrollTo(0, 1);\n }, 50);\n }\n };\n\n window.addEventListener(\"load\", function () {\n if (!window.pageYOffset) {\n hideAddressBar();\n }\n new SlideShow($('.slideshow-container'));\n });\n window.addEventListener(\"orientationchange\", hideAddressBar);\n }\n });\n $(window).load(function () {\n if ($('body.portaltype-collective-nitf-content.template-slideshow_view').length > 0) {\n new SlideShow($('.slideshow-container'));\n }\n });\n})(jQuery);\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 = \"\";\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 6f91924ad42ff5f5efc8","module.exports = \"++resource++collective.nitf/nitf_icon.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/nitf_icon.png\n// module id = 1\n// module chunks = 0","module.exports = \"++resource++collective.nitf/tile-nitf.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/tile-nitf.png\n// module id = 2\n// module chunks = 0","import './main.css';\nimport './nitf_icon.png';\nimport './tile-nitf.png';\n\n(function ($) {\n \"use strict\";\n\n var SlideShow = (function() {\n function SlideShow(el) {\n var self = this;\n self.$el = $(el);\n self.proportion = 3 / 2;\n self.bind_events();\n }\n SlideShow.prototype.$ = function(selector) {\n var self = this;\n return $(selector, self.$el);\n };\n SlideShow.prototype.bind_events = function() {\n var self = this;\n self.$('.cycle-player').on('cycle-next cycle-prev', self, self.sync_slideshows);\n self.$('.cycle-carrossel .thumb-itens').on('click', self, self.thumbs_click);\n };\n SlideShow.prototype.sync_slideshows = function(e, opts) {\n var self, index, $player, $slideshows;\n self = e.data;\n $slideshows = self.$('.cycle-slideshow');\n $slideshows.cycle('goto', opts.currSlide);\n };\n\n SlideShow.prototype.thumbs_click = function(e) {\n var self, index, $thumbs, $slideshows;\n self = e.data;\n e.preventDefault();\n $thumbs = self.$('.cycle-carrossel');\n index = $thumbs.data('cycle.API').getSlideIndex(this);\n $slideshows = self.$('.cycle-slideshow');\n $slideshows.cycle('goto', index);\n };\n return SlideShow;\n })();\n\n $(document).ready(function () {\n // If this is a NITF content with an image\n var nitf_view = $('body.portaltype-collective-nitf-content.template-view').length > 0;\n var nitf_with_image = nitf_view && $('.newsImageContainer').length > 0;\n var slideshow = $('body.portaltype-collective-nitf-content.template-slideshow').length > 0;\n if (nitf_with_image) {\n // Turn image link into something special\n var link = $('#parent-fieldname-image');\n // Add a magnify icon over the image\n link.append('');\n // For mobile devices, link will open slideshow\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {\n link.attr('href', link.attr('href').replace('@@slideshow', '@@slideshow?ajax_include_head=1&ajax_load=1'));\n } else {\n // For other devices open a slideshow in an overlay\n link.prepOverlay({\n subtype: 'ajax',\n filter: '#content > *',\n width: ($(document).width() * 0.95) + 'px',\n config: {\n onLoad: function (e) {\n // Start cycle2\n $('.cycle-slideshow').cycle();\n new SlideShow($('.slideshow-container'));\n }\n }\n });\n }\n } else if (slideshow) {\n // For slideshow template, hide address bar after page load\n // in mobile devices\n /* To hide address bar after page load */\n var hideAddressBar = function() {\n if (!window.location.hash) {\n if (document.height < window.outerHeight) {\n document.body.style.height = (window.outerHeight + 50) + 'px';\n }\n\n setTimeout(function () {\n window.scrollTo(0, 1);\n }, 50);\n }\n };\n\n window.addEventListener(\"load\", function () {\n if (!window.pageYOffset) {\n hideAddressBar();\n }\n new SlideShow($('.slideshow-container'));\n });\n window.addEventListener(\"orientationchange\", hideAddressBar);\n }\n });\n $(window).load(function() {\n if ($('body.portaltype-collective-nitf-content.template-slideshow_view').length > 0) {\n new SlideShow($('.slideshow-container'));\n }\n });\n})(jQuery);\n\n\n\n// WEBPACK FOOTER //\n// ./app/main.js"],"sourceRoot":""} \ No newline at end of file diff --git a/src/collective/nitf/static/styles.css b/src/collective/nitf/static/styles.css index b9dbe4ac..4487f35d 100644 --- a/src/collective/nitf/static/styles.css +++ b/src/collective/nitf/static/styles.css @@ -1,2 +1,2 @@ -.newsImage.nitf{cursor:pointer}.portaltype-collective-nitf-content .newsImageContainer{position:relative}.portaltype-collective-nitf-content .newsImageContainer .magnify{position:absolute;top:5px;right:5px;display:block;width:13px;height:13px;background:transparent url(++resource++collective.nitf/images/search-ico.png) no-repeat}.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,.sortable-media .button:hover{float:right;margin-top:6px;padding:3px 10px 3px 5px;color:#fff!important;background-color:#999}.sortable-media .button{right:0;visibility:hidden}.button .icon{float:left;width:13px;height:15px}.button.edit{background:none repeat scroll 0 0 #75ad0a}.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}.button.delete{position:absolute;top:0;right:0;background-color:#c43c35}.button.delete .icon{line-height:50px;margin-right:5px;background:url(++resource++collective.nitf/images/icons-media.png) no-repeat scroll -15px top transparent}.slide.cycle-slide{overflow:hidden;max-width:100%}.slide.cycle-slide>a{line-height:0}.cycle-next,.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}.cycle-prev{left:0;background:url(++resource++collective.nitf/images/prev-arrow.png) no-repeat scroll 20% 50% transparent}.cycle-next{right:0;background:url(++resource++collective.nitf/images/next-arrow.png) no-repeat scroll 80% 50% transparent}.cycle-next:hover,.cycle-prev:hover{opacity:1}.cycle-carrossel .thumb-itens{cursor:pointer}a.edit-tile-link{z-index:150}.cycle-pager-container{position:absolute;z-index:110;top:0;width:100%;text-align:center}.cycle-pager{display:inline-block;margin:0 auto;padding:8px}.cycle-pager>span{cursor:pointer}.cycle-pager .cycle-pager-active{opacity:1}.cycle-pager-container.thumbnails_square .cycle-pager{background:#fff}.cycle-pager-container.thumbnails_square .cycle-pager img{margin-right:8px;border-radius:5px}.cycle-pager-container.thumbnails_square .cycle-pager a:last-child img{margin-right:0}.cycle-pager-container.numbers .cycle-pager{opacity:.6;background-color:#222}#content .cycle-pager-container.numbers a:link{font-size:1.25em;padding:0 .25em;color:#fff}.cycle-caption{top:15px;right:15px}.cycle-caption,.cycle-overlay{position:absolute;z-index:120;color:#fff}.cycle-overlay{bottom:0;width:100%;padding:15px 0;opacity:.5;background:none repeat scroll 0 0 #000}.cycle-overlay>div{padding:0 15px}.slide.cycle-sentinel{min-height:6em}.contentActions{z-index:130}#covertile-cycle2-carousel-image-imgsize+span,#covertile-cycle2-carousel-image-position,#formfield-covertile-cycle2-carousel-image .visibility-box{display:none}.wrapper-slideshow{float:left;min-width:100%}.cycle-slideshow .slide,.cycle-slideshow .slide img{min-width:100%}.slideshow-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-width:65%;margin:0 auto}.slideshow-player{position:relative}.cycle-slideshow .cycle-slide img{position:relative;top:0;left:0;display:block;padding:0}.cycle-slideshow .slide{display:none}.slideshow-container,.tile{position:relative} +.newsImage.nitf{cursor:pointer}.portaltype-collective-nitf-content .newsImageContainer{position:relative}.portaltype-collective-nitf-content .newsImageContainer .magnify{position:absolute;top:5px;right:5px;display:block;width:13px;height:13px;background:transparent url(++resource++collective.nitf/images/search-ico.png) no-repeat}.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,.sortable-media .button:hover{float:right;margin-top:6px;padding:3px 10px 3px 5px;color:#fff!important;background-color:#999}.sortable-media .button{right:0;visibility:hidden}.button .icon{float:left;width:13px;height:15px}.button.edit{background:none repeat scroll 0 0 #75ad0a}.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}.button.delete{position:absolute;top:0;right:0;background-color:#c43c35}.button.delete .icon{line-height:50px;margin-right:5px;background:url(++resource++collective.nitf/images/icons-media.png) no-repeat scroll -15px top transparent}.slide.cycle-slide{overflow:hidden;max-width:100%}.slide.cycle-slide>a{line-height:0}.cycle-next,.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}#content a.cycle-next,#content a.cycle-prev{border:none}.cycle-prev{left:0;background:url(++resource++collective.nitf/images/prev-arrow.png) no-repeat scroll 20% 50% transparent}.cycle-next{right:0;background:url(++resource++collective.nitf/images/next-arrow.png) no-repeat scroll 80% 50% transparent}.cycle-next:hover,.cycle-prev:hover{opacity:1}.cycle-carrossel .thumb-itens{cursor:pointer;margin-right:5px;min-width:128px}a.edit-tile-link{z-index:150}.cycle-pager-container{position:absolute;z-index:110;top:0;width:100%;text-align:center}.cycle-pager{display:inline-block;margin:0 auto;padding:8px}.cycle-pager>span{cursor:pointer}.cycle-pager .cycle-pager-active{opacity:1}.cycle-pager-container.thumbnails_square .cycle-pager{background:#fff}.cycle-pager-container.thumbnails_square .cycle-pager img{margin-right:8px;border-radius:5px}.cycle-pager-container.thumbnails_square .cycle-pager a:last-child img{margin-right:0}.cycle-pager-container.numbers .cycle-pager{opacity:.6;background-color:#222}#content .cycle-pager-container.numbers a:link{font-size:1.25em;padding:0 .25em;color:#fff}.cycle-caption{top:15px;right:15px}.cycle-caption,.cycle-overlay{position:absolute;z-index:120;color:#fff}.cycle-overlay{bottom:0;width:100%;padding:15px 0;opacity:.5;background:none repeat scroll 0 0 #000}.cycle-overlay>div{padding:0 15px}.slide.cycle-sentinel{min-height:6em}.contentActions{z-index:130}#covertile-cycle2-carousel-image-imgsize+span,#covertile-cycle2-carousel-image-position,#formfield-covertile-cycle2-carousel-image .visibility-box{display:none}.wrapper-slideshow{float:left;min-width:100%}.cycle-slideshow .slide,.cycle-slideshow .slide img{min-width:100%}.slideshow-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-width:65%;margin:0 auto}.slideshow-player{position:relative}.cycle-slideshow .cycle-slide{position:absolute;top:0;left:0;right:0;bottom:0}.slideshow-carrossel .cycle-slide,.slideshow-player .cycle-slide{display:-ms-flexbox!important;display:flex!important;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.cycle-slideshow .cycle-slide img{position:relative;top:0;left:0;display:block;padding:0;max-width:100%;max-height:100%;width:auto;height:auto}.cycle-carousel-wrap{display:-ms-flexbox;display:flex;position:absolute;top:0;left:0;right:0;bottom:0}.cycle-slideshow .slide{display:none}.slideshow-container,.tile{position:relative} /*# sourceMappingURL=styles.css.map*/ \ No newline at end of file diff --git a/src/collective/nitf/webpack/app/main.css b/src/collective/nitf/webpack/app/main.css index e3c548ed..f11d61e0 100644 --- a/src/collective/nitf/webpack/app/main.css +++ b/src/collective/nitf/webpack/app/main.css @@ -147,6 +147,10 @@ text-indent: 101%; opacity: .7; +} +#content a.cycle-prev, +#content a.cycle-next +{ border: none; } .cycle-prev @@ -169,6 +173,8 @@ .cycle-carrossel .thumb-itens { cursor: pointer; + margin-right: 5px; + min-width: 128px; } a.edit-tile-link { @@ -293,6 +299,21 @@ a.edit-tile-link { position: relative; } +.cycle-slideshow .cycle-slide +{ + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} +.slideshow-player .cycle-slide, +.slideshow-carrossel .cycle-slide +{ + display: flex !important; + justify-content: center; + align-items: center; +} .cycle-slideshow .cycle-slide img { position: relative; @@ -302,6 +323,19 @@ a.edit-tile-link display: block; padding: 0; + max-width: 100%; + max-height: 100%; + width: auto; + height: auto; +} +.cycle-carousel-wrap +{ + display: flex; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; } /* Stop Flash of unstyled content */ diff --git a/src/collective/nitf/webpack/app/main.js b/src/collective/nitf/webpack/app/main.js index 3b94a489..6cf40d2a 100644 --- a/src/collective/nitf/webpack/app/main.js +++ b/src/collective/nitf/webpack/app/main.js @@ -11,7 +11,6 @@ import './tile-nitf.png'; self.$el = $(el); self.proportion = 3 / 2; self.bind_events(); - self.fix_image_size(); } SlideShow.prototype.$ = function(selector) { var self = this; @@ -22,31 +21,6 @@ import './tile-nitf.png'; self.$('.cycle-player').on('cycle-next cycle-prev', self, self.sync_slideshows); self.$('.cycle-carrossel .thumb-itens').on('click', self, self.thumbs_click); }; - SlideShow.prototype.fix_image_size = function() { - var self, max_height, max_width, i, len, ref, img, $player, $img; - self = this; - - // Calc max_with and max_height - $player = self.$('.cycle-player'); - max_width = $player.width(); - max_height = max_width / self.proportion; - // Calc max_with and max_height - - // Update properties when necessary - ref = self.$('.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); - } - } - }; - SlideShow.prototype.sync_slideshows = function(e, opts) { var self, index, $player, $slideshows; self = e.data;