File "ion-gallery.min.js"

Full Path: /srv/www/www.cadoro.it/app/lib/ion-gallery/dist/ion-gallery.min.js
File size: 6.78 KB
MIME-type: text/plain
Charset: utf-8

!function(){"use strict";function n(n,e,i){function o(n){var o=parseInt(n.ionGalleryRowSize),t=function(){n.ionGalleryRowSize=e.getRowSize(o||i.row_size,n.ionGalleryItems.length),n.actionLabel=i.action_label,n.items=e.buildGallery(n.ionGalleryItems,n.ionGalleryRowSize),n.responsiveGrid=parseInt(1/n.ionGalleryRowSize*100)};t(),function(){n.$watch(function(){return n.ionGalleryItems.length},function(n,e){n!==e&&t()})}()}function t(n,e,o){n.customItemAction=angular.isFunction(n.ionItemAction)&&o.hasOwnProperty("ionItemAction"),n.ionSliderToggle="false"===o.ionGalleryToggle?!1:i.toggle}return o.$inject=["$scope"],{restrict:"AE",scope:{ionGalleryItems:"=ionGalleryItems",ionGalleryRowSize:"=?ionGalleryRow",ionItemAction:"&?ionItemAction",ionZoomEvents:"=?ionZoomEvents"},controller:o,link:t,replace:!0,templateUrl:i.template_gallery}}angular.module("ion-gallery",["templates"]).directive("ionGallery",n),n.$inject=["$ionicPlatform","ionGalleryHelper","ionGalleryConfig"]}(),function(){"use strict";function n(){this.config={action_label:"Done",template_gallery:"gallery.html",template_slider:"slider.html",toggle:!0,row_size:3,fixed_row_size:!0,zoom_events:!0},this.$get=function(){return this.config},this.setGalleryConfig=function(n){angular.extend(this.config,this.config,n)}}angular.module("ion-gallery").provider("ionGalleryConfig",n),n.$inject=[]}(),function(){"use strict";function n(n){this.getRowSize=function(e,i){var o;return o=isNaN(e)===!0||0>=e?n.row_size:e>i&&!n.fixed_row_size?i:e},this.buildGallery=function(n,e){for(var i=[],o=-1,t=0,l=0;l<n.length;l++)l%e===0&&(o++,i[o]=[],t=0),n[l].position=l,i[o][t]=n[l],t++;return i}}angular.module("ion-gallery").service("ionGalleryHelper",n),n.$inject=["ionGalleryConfig"]}(),function(){"use strict";function n(){function n(n,e,i){var o=function(n,i){i>0&&(n.naturalHeight>=n.naturalWidth?e.attr("width","100%"):e.attr("height",e.parent()[0].offsetHeight+"px"))};e.bind("load",function(i){var t=this;e.parent()[0].offsetHeight>0&&o(this,e.parent()[0].offsetHeight),n.$watch(function(){return e.parent()[0].offsetHeight},function(n){o(t,n)})})}return{restrict:"A",link:n}}angular.module("ion-gallery").directive("ionImageScale",n),n.$inject=[]}(),function(){"use strict";function n(n){function e(n,e,i){n.$watch(function(){return n.ionGalleryRowSize},function(i,o){i>0&&e.css("height",e[0].offsetWidth*parseInt(n.responsiveGrid)/100+"px")})}return{restrict:"A",link:e}}angular.module("ion-gallery").directive("ionRowHeight",n),n.$inject=["ionGalleryConfig"]}(),function(){"use strict";function n(n,e){function i(i,o,t){var l=!1,r=function(){i.$emit("ZoomStarted")},s=function(n){l=!0,e(function(){l=!1,i.$emit("DoubleTapEvent",{x:n.gesture.touches[0].pageX,y:n.gesture.touches[0].pageY})},200)},a=function(n){l!==!0&&e(function(){l!==!0&&i.$emit("TapEvent")},200)},c=n.on("pinch",r,o),u=n.on("doubletap",function(n){s(n)},o),d=n.on("tap",a,o);i.$on("$destroy",function(){n.off(u,"doubletap",s),n.off(d,"tap",a),n.off(c,"pinch",r)})}return{restrict:"A",link:i}}angular.module("ion-gallery").directive("ionSlideAction",n),n.$inject=["$ionicGesture","$timeout"]}(),function(){"use strict";function n(n,e,i,o,t){function l(n){function t(){s=!1,a()}var l,r,s=(n.ionGalleryRowSize,!1);n.selectedSlide=1,n.hideAll=!1,n.ionZoomEvents=o.setZoomEvents(n.ionZoomEvents),n.openSlider=function(e){n.slides=[],r=e;var i=n.ionGalleryItems.length,o=0>e-1?i-1:e-1,t=e+1>=i?0:e+1;n.slides[0]=n.ionGalleryItems[o],n.slides[1]=n.ionGalleryItems[e],n.slides[2]=n.ionGalleryItems[t],l=1,n.openModal()},n.slideChanged=function(e){if(e!==l){var o,t=n.slides.length-l-e,s=n.ionGalleryItems.length,a=l+">"+e;"0>1"===a||"1>2"===a||"2>0"===a?(r++,r>=s&&(r=0),o=r+1,o>=s&&(o=0)):"0>2"!==a&&"1>0"!==a&&"2>1"!==a||(r--,0>r&&(r=s-1),o=r-1,0>o&&(o=s-1)),n.ionZoomEvents===!0&&i.$getByHandle("slide-"+t).zoomTo(1),n.slides[t]=n.ionGalleryItems[o],l=e}},n.$on("ZoomStarted",function(i){e(function(){s=!0,n.hideAll=!0})}),n.$on("TapEvent",function(n){e(function(){a()})}),n.$on("DoubleTapEvent",function(n,i){e(function(){c(i)})});var a=function(){return s===!0?(n.ionZoomEvents===!0&&i.$getByHandle("slide-"+l).zoomTo(1,!0),void e(function(){t()},300)):void(n.hasOwnProperty("ionSliderToggle")&&n.ionSliderToggle===!1&&n.hideAll===!1||s===!0||(n.hideAll=!n.hideAll))},c=function(e){s===!1?(n.ionZoomEvents===!0&&i.$getByHandle("slide-"+l).zoomTo(3,!0,e.x,e.y),s=!0,n.hideAll=!0):a()}}function r(e,i,o){var l;n.fromTemplateUrl(t.template_slider,{scope:e,animation:"fade-in"}).then(function(n){l=n}),e.openModal=function(){l.show()},e.closeModal=function(){l.hide()},e.$on("$destroy",function(){try{l.remove()}catch(n){}})}return l.$inject=["$scope"],{restrict:"A",controller:l,link:r}}angular.module("ion-gallery").directive("ionSlider",n),n.$inject=["$ionicModal","$timeout","$ionicScrollDelegate","ionSliderHelper","ionGalleryConfig"]}(),function(){"use strict";function n(n){this.setZoomEvents=function(e){return e===!1&&(n.zoom_events=!1),n.zoom_events}}angular.module("ion-gallery").service("ionSliderHelper",n),n.$inject=["ionGalleryConfig"]}(),angular.module("templates",[]).run(["$templateCache",function(n){n.put("gallery.html",'<div class="gallery-view">\n  <div class="row" ng-repeat="item in items track by $index" ion-row-height>\n    <div ng-repeat="photo in item track by $index"\n         class="col col-{{responsiveGrid}} image-container">\n\n      <img ion-image-scale\n           ng-src="{{photo.thumb || photo.src}}"\n           ng-click="customItemAction ? ionItemAction({item: photo}) : openSlider(photo.position)">\n\n    </div>\n  </div>\n  <div ion-slider></div>\n</div>\n'),n.put("slider.html",'<ion-modal-view class="imageView">\n  <ion-header-bar class="headerView" ng-show="!hideAll">\n    <button class="button button-outline button-light close-btn" ng-click="closeModal()">{{::actionLabel}}</button>\n  </ion-header-bar>\n\n  <ion-content class="has-no-header" scroll="false">\n    <ion-slide-box does-continue="true" active-slide="selectedSlide" show-pager="false" class="listContainer" on-slide-changed="slideChanged($index)">\n      <ion-slide ng-repeat="single in slides track by $index">\n        <ion-scroll direction="xy"\n                    locking="false"\n                    zooming="{{ionZoomEvents}}"\n                    min-zoom="1"\n                    scrollbar-x="false"\n                    scrollbar-y="false"\n                    ion-slide-action\n                    delegate-handle="slide-{{$index}}"\n                    overflow-scroll="false"\n                    >\n        <div class="item item-image gallery-slide-view">\n          <img ng-src="{{single.src}}">\n        </div>\n        <div ng-if="single.sub && single.sub.length > 0" class="image-subtitle" ng-show="!hideAll">\n            <span ng-bind-html=\'single.sub\'></span>\n        </div>\n        </ion-scroll>\n      </ion-slide>\n    </ion-slide-box>\n  </ion-content>\n</ion-modal-view>\n')}]);