New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-jk-carousel-fork

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-jk-carousel-fork - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

2

dist/jk-carousel.js

@@ -324,2 +324,2 @@ (function() {

(function(){angular.module("jkAngularCarousel.templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("carousel-directive.html","<div class=\"jk-carousel\" >\n\n <div class=\"slides-container\" layout=\"row\" >\n <div\n ng-repeat=\"slideItem in ctrl.cloneData\"\n class=\"slide\"\n >\n <div ng-include=\"ctrl.itemTemplateUrl\" ></div>\n </div>\n </div>\n\n\n <md-button ng-click=\"ctrl.navigateLeft()\">\n <md-icon md-font-icon=\"fa-arrow-left\" class=\"fa fa-2x md-primary left-arrow-button\" style=\"white\"></md-icon>\n </md-button>\n <md-button ng-click=\"ctrl.navigateRight()\">\n <md-icon md-font-icon=\"fa-arrow-right\" class=\"fa fa-2x md-primary right-arrow-button\" style=\"white\"></md-icon>\n </md-button>\n\n <md-radio-group\n class=\"radio-buttons-container\"\n layout=\"row\"\n ng-model=\"ctrl.radioButtonIndex\"\n layout-align=\"center center\"\n ng-change=\"ctrl.onRadioButtonClick()\" >\n <md-radio-button\n ng-repeat=\"item in ctrl.data\"\n ng-value=\"$index\"\n aria-label=\"$index\" >\n </md-radio-button>\n </md-radio-group>\n\n</div>\n");}]);})();
(function(){angular.module("jkAngularCarousel.templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("carousel-directive.html","<div class=\"jk-carousel\" >\n\n <div class=\"slides-container\" layout=\"row\" >\n <div\n ng-repeat=\"slideItem in ctrl.cloneData\"\n class=\"slide\"\n >\n <div ng-include=\"ctrl.itemTemplateUrl\" ></div>\n </div>\n </div>\n <md-button class=\"left-arrow-button\" ng-click=\"ctrl.navigateLeft()\">\n <md-icon md-font-icon=\"fa-arrow-left\" class=\"fa fa-2x md-primary\" style=\"color:white\"></md-icon>\n </md-button>\n <md-button class=\"right-arrow-button\" ng-click=\"ctrl.navigateRight()\">\n <md-icon md-font-icon=\"fa-arrow-right\" class=\"fa fa-2x md-primary\" style=\"color:white\"></md-icon>\n </md-button>\n\n <md-radio-group\n class=\"radio-buttons-container\"\n layout=\"row\"\n ng-model=\"ctrl.radioButtonIndex\"\n layout-align=\"center center\"\n ng-change=\"ctrl.onRadioButtonClick()\" >\n <md-radio-button\n ng-repeat=\"item in ctrl.data\"\n ng-value=\"$index\"\n aria-label=\"$index\" >\n </md-radio-button>\n </md-radio-group>\n\n</div>\n");}]);})();

@@ -1,1 +0,1 @@

!function(){"use strict";angular.module("jkAngularCarousel",["jkAngularCarousel.templates"])}(),function(){"use strict";function CarouselController($timeout,$attrs,$interval,$window){var that=this;that.currentIndex=0,that.currentMarginLeftValue=0,that.radioButtonIndex=0,that.transitionsTime=500,that.transitionsEnabled=!0,$attrs.$observe("data",function(){that.onDataChange()}),that.registerElement=function(element){that.element=element,that.elementParent=that.element.parent(),that.slidesContainer=angular.element(that.element.find("div")[0]),$window.addEventListener("resize",function(){that.updateSlidesContainerWidth()})},that.onDataChange=function(){that.data&&0!==that.data.length&&(that.executeCloneData(),$timeout(function(){that.updateSlidesContainerWidth(),that.restartFromFirstItem()}))},that.updateSlidesContainerWidth=function(){that.scaleContent(),that.currentWidth=that.element.prop("offsetWidth"),that.currentHeight=that.element.prop("offsetHeight"),that.resizeSlides();var newSlidesContainerWidth=that.currentWidth*that.cloneData.length;that.slidesContainer.css("width",newSlidesContainerWidth+"px"),that.scaleMarginLeft(newSlidesContainerWidth),that.currentSlidesContainerWidth=newSlidesContainerWidth},that.scaleContent=function(){that.maxWidth=that.maxWidth?parseInt(that.maxWidth):0,0===that.maxWidth&&(that.maxWidth=that.element.prop("offsetWidth")),that.maxHeight=that.maxHeight?parseInt(that.maxHeight):0,0===that.maxHeight&&(that.maxHeight=that.element.prop("offsetHeight"));var currentElementParentWidth=that.elementParent.prop("offsetWidth");if(currentElementParentWidth<that.maxWidth){var newHeight=that.maxHeight*currentElementParentWidth/that.maxWidth;that.element.css("width",currentElementParentWidth+"px"),that.element.css("height",newHeight+"px")}else currentElementParentWidth>=that.maxWidth&&(that.element.css("width",that.maxWidth+"px"),that.element.css("height",that.maxHeight+"px"))},that.resizeSlides=function(){for(var slides=$window.document.getElementsByClassName("slide"),index=0;index<slides.length;index++){var slide=angular.element(slides[index]);slide.css("width",that.currentWidth+"px"),slide.css("height",that.currentHeight+"px")}},that.scaleMarginLeft=function(newSlidesContainerWidth){that.currentSlidesContainerWidth&&that.currentSlidesContainerWidth!==newSlidesContainerWidth&&(that.currentMarginLeftValue=that.currentMarginLeftValue*newSlidesContainerWidth,that.currentMarginLeftValue=that.currentMarginLeftValue/that.currentSlidesContainerWidth,that.disableTransitions(),that.applyMarginLeft(),that.enableTransitions())},that.restartFromFirstItem=function(){that.currentWidth&&(that.disableTransitions(),that.currentMarginLeftValue=-1*that.currentWidth,that.applyMarginLeft(),that.currentIndex=0,that.radioButtonIndex=that.currentIndex,that.enableTransitions())},that.executeCloneData=function(){for(var cloneArray=[],index=0;index<that.data.length;index++){var item=that.data[index];cloneArray.push(item)}that.cloneFirstItem(cloneArray),that.cloneLastItem(cloneArray),that.cloneData=cloneArray},that.cloneFirstItem=function(cloneArray){var firstItem=cloneArray[0],firstItemClone=angular.copy(firstItem);cloneArray.push(firstItemClone)},that.cloneLastItem=function(cloneArray){var lastItem=cloneArray[that.data.length-1],lastItemClone=angular.copy(lastItem);cloneArray.unshift(lastItemClone)},that.validateAutoSlide=function(){"string"==typeof that.autoSlide&&(that.autoSlide="true"===that.autoSlide?!0:!1),that.autoSlide?that.startAutoSlide():that.stopAutoSlide()},that.restartAutoSlide=function(){that.autoSlide&&(that.transitionsEnabled?$timeout(function(){that.stopAutoSlide(),that.startAutoSlide()},that.transitionsTime):(that.stopAutoSlide(),that.startAutoSlide()))},that.startAutoSlide=function(){angular.isDefined(that.autoSlideInterval)||(that.autoSlideInterval=$interval(function(){that.navigateRight()},that.autoSlideTime))},that.stopAutoSlide=function(){angular.isDefined(that.autoSlideInterval)&&($interval.cancel(that.autoSlideInterval),that.autoSlideInterval=void 0)},that.onNavigateLeft=function(){that.navigateLeft(),that.restartAutoSlide()},that.navigateLeft=function(){that.isDataInvalidOrTooSmall()||(that.currentIndex--,that.radioButtonIndex=that.currentIndex,that.currentMarginLeftValue+=that.currentWidth,that.applyMarginLeft(),that.restartAutoSlide(),-1===that.currentIndex&&that.restartFromLastItem())},that.restartFromLastItem=function(){$timeout(function(){that.disableTransitions(),that.currentMarginLeftValue=that.currentWidth*that.data.length*-1,that.applyMarginLeft(),that.currentIndex=that.data.length-1,that.radioButtonIndex=that.currentIndex,that.enableTransitions()},that.transitionsTime)},that.onNavigateRight=function(){that.navigateRight(),that.restartAutoSlide()},that.navigateRight=function(){that.isDataInvalidOrTooSmall()||(that.currentIndex++,that.radioButtonIndex=that.currentIndex,that.currentMarginLeftValue-=that.currentWidth,that.applyMarginLeft(),that.restartAutoSlide(),that.currentIndex===that.data.length&&$timeout(function(){that.restartFromFirstItem()},that.transitionsTime))},that.applyMarginLeft=function(){that.slidesContainer.css("margin-left",that.currentMarginLeftValue+"px")},that.disableTransitions=function(){that.slidesContainer.css("transition","none"),that.transitionsEnabled=!1},that.enableTransitions=function(){$timeout(function(){that.slidesContainer.css("transition","margin 0.5s ease-in-out"),that.transitionsEnabled=!0},200)},that.onRadioButtonClick=function(){var multiplier;that.radioButtonIndex>that.currentIndex?(multiplier=that.radioButtonIndex-that.currentIndex,that.currentMarginLeftValue-=that.currentWidth*multiplier):(multiplier=that.currentIndex-that.radioButtonIndex,that.currentMarginLeftValue+=that.currentWidth*multiplier),that.currentIndex=that.radioButtonIndex,that.applyMarginLeft(),that.restartAutoSlide()},that.isDataInvalidOrTooSmall=function(){return!that.data||that.data.length<=1?!0:!1}}angular.module("jkAngularCarousel").controller("JKCarouselController",["$timeout","$attrs","$interval","$window",CarouselController])}(),function(){"use strict";function CarouselDirective(){function link(scope,element,attrs,ctrl){void 0===attrs.autoSlide&&(ctrl.autoSlide=!1),void 0===attrs.autoSlideTime&&(ctrl.autoSlideTime=5e3),ctrl.registerElement(element),scope.$on("$destroy",function(){ctrl.stopAutoSlide()}),scope.$watch("ctrl.autoSlide",function(){ctrl.validateAutoSlide()}),scope.$watch("ctrl.autoSlideTime",function(){ctrl.restartAutoSlide()})}return{restrict:"E",replace:!0,templateUrl:"carousel-directive.html",scope:{},controller:"JKCarouselController",controllerAs:"ctrl",bindToController:{data:"=",itemTemplateUrl:"=",maxWidth:"@?",maxHeight:"@?",autoSlide:"@?",autoSlideTime:"@?"},link:link}}angular.module("jkAngularCarousel").directive("jkCarousel",[CarouselDirective])}(),function(){angular.module("jkAngularCarousel.templates",[]).run(["$templateCache",function($templateCache){$templateCache.put("carousel-directive.html",'<div class="jk-carousel" >\n\n <div class="slides-container" layout="row" >\n <div\n ng-repeat="slideItem in ctrl.cloneData"\n class="slide"\n >\n <div ng-include="ctrl.itemTemplateUrl" ></div>\n </div>\n </div>\n\n\n <md-button ng-click="ctrl.navigateLeft()">\n <md-icon md-font-icon="fa-arrow-left" class="fa fa-2x md-primary left-arrow-button" style="white"></md-icon>\n </md-button>\n <md-button ng-click="ctrl.navigateRight()">\n <md-icon md-font-icon="fa-arrow-right" class="fa fa-2x md-primary right-arrow-button" style="white"></md-icon>\n </md-button>\n\n <md-radio-group\n class="radio-buttons-container"\n layout="row"\n ng-model="ctrl.radioButtonIndex"\n layout-align="center center"\n ng-change="ctrl.onRadioButtonClick()" >\n <md-radio-button\n ng-repeat="item in ctrl.data"\n ng-value="$index"\n aria-label="$index" >\n </md-radio-button>\n </md-radio-group>\n\n</div>\n')}])}();
!function(){"use strict";angular.module("jkAngularCarousel",["jkAngularCarousel.templates"])}(),function(){"use strict";function CarouselController($timeout,$attrs,$interval,$window){var that=this;that.currentIndex=0,that.currentMarginLeftValue=0,that.radioButtonIndex=0,that.transitionsTime=500,that.transitionsEnabled=!0,$attrs.$observe("data",function(){that.onDataChange()}),that.registerElement=function(element){that.element=element,that.elementParent=that.element.parent(),that.slidesContainer=angular.element(that.element.find("div")[0]),$window.addEventListener("resize",function(){that.updateSlidesContainerWidth()})},that.onDataChange=function(){that.data&&0!==that.data.length&&(that.executeCloneData(),$timeout(function(){that.updateSlidesContainerWidth(),that.restartFromFirstItem()}))},that.updateSlidesContainerWidth=function(){that.scaleContent(),that.currentWidth=that.element.prop("offsetWidth"),that.currentHeight=that.element.prop("offsetHeight"),that.resizeSlides();var newSlidesContainerWidth=that.currentWidth*that.cloneData.length;that.slidesContainer.css("width",newSlidesContainerWidth+"px"),that.scaleMarginLeft(newSlidesContainerWidth),that.currentSlidesContainerWidth=newSlidesContainerWidth},that.scaleContent=function(){that.maxWidth=that.maxWidth?parseInt(that.maxWidth):0,0===that.maxWidth&&(that.maxWidth=that.element.prop("offsetWidth")),that.maxHeight=that.maxHeight?parseInt(that.maxHeight):0,0===that.maxHeight&&(that.maxHeight=that.element.prop("offsetHeight"));var currentElementParentWidth=that.elementParent.prop("offsetWidth");if(currentElementParentWidth<that.maxWidth){var newHeight=that.maxHeight*currentElementParentWidth/that.maxWidth;that.element.css("width",currentElementParentWidth+"px"),that.element.css("height",newHeight+"px")}else currentElementParentWidth>=that.maxWidth&&(that.element.css("width",that.maxWidth+"px"),that.element.css("height",that.maxHeight+"px"))},that.resizeSlides=function(){for(var slides=$window.document.getElementsByClassName("slide"),index=0;index<slides.length;index++){var slide=angular.element(slides[index]);slide.css("width",that.currentWidth+"px"),slide.css("height",that.currentHeight+"px")}},that.scaleMarginLeft=function(newSlidesContainerWidth){that.currentSlidesContainerWidth&&that.currentSlidesContainerWidth!==newSlidesContainerWidth&&(that.currentMarginLeftValue=that.currentMarginLeftValue*newSlidesContainerWidth,that.currentMarginLeftValue=that.currentMarginLeftValue/that.currentSlidesContainerWidth,that.disableTransitions(),that.applyMarginLeft(),that.enableTransitions())},that.restartFromFirstItem=function(){that.currentWidth&&(that.disableTransitions(),that.currentMarginLeftValue=-1*that.currentWidth,that.applyMarginLeft(),that.currentIndex=0,that.radioButtonIndex=that.currentIndex,that.enableTransitions())},that.executeCloneData=function(){for(var cloneArray=[],index=0;index<that.data.length;index++){var item=that.data[index];cloneArray.push(item)}that.cloneFirstItem(cloneArray),that.cloneLastItem(cloneArray),that.cloneData=cloneArray},that.cloneFirstItem=function(cloneArray){var firstItem=cloneArray[0],firstItemClone=angular.copy(firstItem);cloneArray.push(firstItemClone)},that.cloneLastItem=function(cloneArray){var lastItem=cloneArray[that.data.length-1],lastItemClone=angular.copy(lastItem);cloneArray.unshift(lastItemClone)},that.validateAutoSlide=function(){"string"==typeof that.autoSlide&&(that.autoSlide="true"===that.autoSlide?!0:!1),that.autoSlide?that.startAutoSlide():that.stopAutoSlide()},that.restartAutoSlide=function(){that.autoSlide&&(that.transitionsEnabled?$timeout(function(){that.stopAutoSlide(),that.startAutoSlide()},that.transitionsTime):(that.stopAutoSlide(),that.startAutoSlide()))},that.startAutoSlide=function(){angular.isDefined(that.autoSlideInterval)||(that.autoSlideInterval=$interval(function(){that.navigateRight()},that.autoSlideTime))},that.stopAutoSlide=function(){angular.isDefined(that.autoSlideInterval)&&($interval.cancel(that.autoSlideInterval),that.autoSlideInterval=void 0)},that.onNavigateLeft=function(){that.navigateLeft(),that.restartAutoSlide()},that.navigateLeft=function(){that.isDataInvalidOrTooSmall()||(that.currentIndex--,that.radioButtonIndex=that.currentIndex,that.currentMarginLeftValue+=that.currentWidth,that.applyMarginLeft(),that.restartAutoSlide(),-1===that.currentIndex&&that.restartFromLastItem())},that.restartFromLastItem=function(){$timeout(function(){that.disableTransitions(),that.currentMarginLeftValue=that.currentWidth*that.data.length*-1,that.applyMarginLeft(),that.currentIndex=that.data.length-1,that.radioButtonIndex=that.currentIndex,that.enableTransitions()},that.transitionsTime)},that.onNavigateRight=function(){that.navigateRight(),that.restartAutoSlide()},that.navigateRight=function(){that.isDataInvalidOrTooSmall()||(that.currentIndex++,that.radioButtonIndex=that.currentIndex,that.currentMarginLeftValue-=that.currentWidth,that.applyMarginLeft(),that.restartAutoSlide(),that.currentIndex===that.data.length&&$timeout(function(){that.restartFromFirstItem()},that.transitionsTime))},that.applyMarginLeft=function(){that.slidesContainer.css("margin-left",that.currentMarginLeftValue+"px")},that.disableTransitions=function(){that.slidesContainer.css("transition","none"),that.transitionsEnabled=!1},that.enableTransitions=function(){$timeout(function(){that.slidesContainer.css("transition","margin 0.5s ease-in-out"),that.transitionsEnabled=!0},200)},that.onRadioButtonClick=function(){var multiplier;that.radioButtonIndex>that.currentIndex?(multiplier=that.radioButtonIndex-that.currentIndex,that.currentMarginLeftValue-=that.currentWidth*multiplier):(multiplier=that.currentIndex-that.radioButtonIndex,that.currentMarginLeftValue+=that.currentWidth*multiplier),that.currentIndex=that.radioButtonIndex,that.applyMarginLeft(),that.restartAutoSlide()},that.isDataInvalidOrTooSmall=function(){return!that.data||that.data.length<=1?!0:!1}}angular.module("jkAngularCarousel").controller("JKCarouselController",["$timeout","$attrs","$interval","$window",CarouselController])}(),function(){"use strict";function CarouselDirective(){function link(scope,element,attrs,ctrl){void 0===attrs.autoSlide&&(ctrl.autoSlide=!1),void 0===attrs.autoSlideTime&&(ctrl.autoSlideTime=5e3),ctrl.registerElement(element),scope.$on("$destroy",function(){ctrl.stopAutoSlide()}),scope.$watch("ctrl.autoSlide",function(){ctrl.validateAutoSlide()}),scope.$watch("ctrl.autoSlideTime",function(){ctrl.restartAutoSlide()})}return{restrict:"E",replace:!0,templateUrl:"carousel-directive.html",scope:{},controller:"JKCarouselController",controllerAs:"ctrl",bindToController:{data:"=",itemTemplateUrl:"=",maxWidth:"@?",maxHeight:"@?",autoSlide:"@?",autoSlideTime:"@?"},link:link}}angular.module("jkAngularCarousel").directive("jkCarousel",[CarouselDirective])}(),function(){angular.module("jkAngularCarousel.templates",[]).run(["$templateCache",function($templateCache){$templateCache.put("carousel-directive.html",'<div class="jk-carousel" >\n\n <div class="slides-container" layout="row" >\n <div\n ng-repeat="slideItem in ctrl.cloneData"\n class="slide"\n >\n <div ng-include="ctrl.itemTemplateUrl" ></div>\n </div>\n </div>\n <md-button class="left-arrow-button" ng-click="ctrl.navigateLeft()">\n <md-icon md-font-icon="fa-arrow-left" class="fa fa-2x md-primary" style="color:white"></md-icon>\n </md-button>\n <md-button class="right-arrow-button" ng-click="ctrl.navigateRight()">\n <md-icon md-font-icon="fa-arrow-right" class="fa fa-2x md-primary" style="color:white"></md-icon>\n </md-button>\n\n <md-radio-group\n class="radio-buttons-container"\n layout="row"\n ng-model="ctrl.radioButtonIndex"\n layout-align="center center"\n ng-change="ctrl.onRadioButtonClick()" >\n <md-radio-button\n ng-repeat="item in ctrl.data"\n ng-value="$index"\n aria-label="$index" >\n </md-radio-button>\n </md-radio-group>\n\n</div>\n')}])}();
{
"name": "angular-jk-carousel-fork",
"version": "0.1.6",
"version": "0.1.7",
"description": "Amazing carousel for angular material",

@@ -5,0 +5,0 @@ "main": "dist/jk-carousel.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc