diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5865673 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.json] +indent_style = space +indent_size = 2 diff --git a/bower.json b/bower.json index 958deea..5108206 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-waypoints", - "version": "1.0.1", + "version": "1.0.2", "description": "An AngularJS module for working with jQuery Waypoints", "main": "dist/angular-waypoints.js", "license": "MIT", diff --git a/dist/angular-waypoints.all.js b/dist/angular-waypoints.all.js index 83db304..ed62cbe 100644 --- a/dist/angular-waypoints.all.js +++ b/dist/angular-waypoints.all.js @@ -518,145 +518,147 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt // https://github.com/umdjs/umd (function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['angular'], factory); - } else { - // Browser globals - root.WaypointModule = factory(root.angular); - } + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['angular'], factory); + } else { + // Browser globals + root.WaypointModule = factory(root.angular); + } }(this, function (angular) { - - /** - * Zumba(r) Angular Waypoints v1.0.1 - 2014-10-13 - * An AngularJS module for working with jQuery Waypoints - * - * Copyright (c) 2014 Zumba (r) - * Licensed MIT - */ - /** - * Service for injecting a callback handler for the zumWaypoint Directive - * - * @param Function $timeout service - */ - var WaypointService = function WaypointService($timeout) { - this.$timeout = $timeout; - }; - - /** - * Get a waypoint handler that executes `callback` on next tick - * - * Callback will be passed the waypoint slug. - * - * @param Object scope - * @param Function callback - * @return mixed - */ - WaypointService.prototype.getHandlerSync = function getHandlerSync(scope, callback) { - var timeout = this.$timeout; - - return function(direction) { - var waypoint = scope[direction]; - if (waypoint) { - timeout($.proxy(callback, null, waypoint)); - } - }; - }; - - /** - * Waypoint slugs parsed into objects and stored by key: - * { - * 'example.point' : { namespace : 'example', waypoint : 'point' }, - * 'noNamespace' : { namespace : 'globals', waypoint : 'noNamespace' } - * } - * - * @type Object - */ - var parsedWaypoints = {}; - - /** - * Waypoint Controller - * - * @param Object $scope - */ - var WaypointController = function WaypointController($scope) { - $scope.waypoints = {}; - this.$scope = $scope; - }; - - /** - * Get a namespace for the waypoint - * - * @param String qualifiedWaypoint - * @return String - */ - var parseWaypoint = function parseWaypoint(qualifiedWaypoint) { - var parts; - if (!parsedWaypoints[qualifiedWaypoint]) { - parts = qualifiedWaypoint.split('.'); - if (parts.length === 1) { - parts.unshift('globals'); - } - parsedWaypoints[qualifiedWaypoint] = { - namespace : parts.shift(), - waypoint : parts.join('.') - }; - } - return parsedWaypoints[qualifiedWaypoint]; - }; - - /** - * Sets all waypoints in the colleciton to false, and sets the indicated waypoint to true. - * - * @param Object collection - * @param String waypoint - */ - var setWaypoint = function setWaypoint(collection, waypoint) { - $.each(collection, function clearWaypoints(waypoint) { - collection[waypoint] = false; - }); - collection[waypoint] = true; - }; - - /** - * Clear all waypoints in the same namespace as qualifiedWaypoint, - * and set qualifiedWaypoint. - * - * @param String qualifiedWaypoint - * @return void - */ - WaypointController.prototype.processWaypoint = function processWaypoint(qualifiedWaypoint) { - var waypoints = this.$scope.waypoints; - var data = parseWaypoint(qualifiedWaypoint); - var namespace = data.namespace; - - if (!waypoints[namespace]) { - waypoints[namespace] = {}; - } - - setWaypoint(waypoints[namespace], data.waypoint); - }; - var zumWaypoint = function zumWaypoint(WaypointService) { - return { - controller : 'WaypointController', - scope : { - up : '@', - down : '@', - offset : '@', - waypoints : '=?zumWaypoint' - }, - link : function zumWaypointLink(scope, element, attrs, ctrl) { - var callback = $.proxy(ctrl.processWaypoint, ctrl); - element.waypoint({ - handler : WaypointService.getHandlerSync(scope, callback), - offset : scope.offset || 0 - }); - } - }; - }; - - return angular.module('zumba.angular-waypoints', []) - .controller('WaypointController', ['$scope', WaypointController]) - .directive('zumWaypoint', ['WaypointService', zumWaypoint]) - .service('WaypointService', ['$timeout', WaypointService]); -})); \ No newline at end of file + + /** + * Zumba(r) Angular Waypoints v1.0.2 - 2015-12-04 + * An AngularJS module for working with jQuery Waypoints + * + * Copyright (c) 2015 Zumba (r) + * Licensed MIT + */ + /** + * Service for injecting a callback handler for the zumWaypoint Directive + * + * @param Function $timeout service + */ + var WaypointService = function WaypointService($timeout) { + this.$timeout = $timeout; + }; + + /** + * Get a waypoint handler that executes `callback` on next tick + * + * Callback will be passed the waypoint slug. + * + * @param Object scope + * @param Function callback + * @return mixed + */ + WaypointService.prototype.getHandlerSync = function getHandlerSync(scope, callback) { + var timeout = this.$timeout; + + return function(direction) { + var waypoint = scope[direction]; + if (waypoint) { + timeout($.proxy(callback, null, waypoint)); + } + }; + }; + + /** + * Waypoint slugs parsed into objects and stored by key: + * { + * 'example.point' : { namespace : 'example', waypoint : 'point' }, + * 'noNamespace' : { namespace : 'globals', waypoint : 'noNamespace' } + * } + * + * @type Object + */ + var parsedWaypoints = {}; + + /** + * Waypoint Controller + * + * @param Object $scope + */ + var WaypointController = function WaypointController($scope) { + $scope.waypoints = {}; + this.$scope = $scope; + }; + + /** + * Get a namespace for the waypoint + * + * @param String qualifiedWaypoint + * @return String + */ + var parseWaypoint = function parseWaypoint(qualifiedWaypoint) { + var parts; + if (!parsedWaypoints[qualifiedWaypoint]) { + parts = qualifiedWaypoint.split('.'); + if (parts.length === 1) { + parts.unshift('globals'); + } + parsedWaypoints[qualifiedWaypoint] = { + namespace : parts.shift(), + waypoint : parts.join('.') + }; + } + return parsedWaypoints[qualifiedWaypoint]; + }; + + /** + * Sets all waypoints in the colleciton to false, and sets the indicated waypoint to true. + * + * @param Object collection + * @param String waypoint + */ + var setWaypoint = function setWaypoint(collection, waypoint) { + $.each(collection, function clearWaypoints(waypoint) { + collection[waypoint] = false; + }); + collection[waypoint] = true; + }; + + /** + * Clear all waypoints in the same namespace as qualifiedWaypoint, + * and set qualifiedWaypoint. + * + * @param String qualifiedWaypoint + * @return void + */ + WaypointController.prototype.processWaypoint = function processWaypoint(qualifiedWaypoint) { + var waypoints = this.$scope.waypoints; + var data = parseWaypoint(qualifiedWaypoint); + var namespace = data.namespace; + + if (!waypoints[namespace]) { + waypoints[namespace] = {}; + } + + setWaypoint(waypoints[namespace], data.waypoint); + }; + + var zumWaypoint = function zumWaypoint(WaypointService) { + return { + controller : 'WaypointController', + scope : { + up : '@', + down : '@', + offset : '@', + waypoints : '=?zumWaypoint' + }, + link : function zumWaypointLink(scope, element, attrs, ctrl) { + var callback = $.proxy(ctrl.processWaypoint, ctrl); + element.waypoint({ + handler : WaypointService.getHandlerSync(scope, callback), + offset : scope.offset || 0 + }); + } + }; + }; + + + return angular.module('zumba.angular-waypoints', []) + .controller('WaypointController', ['$scope', WaypointController]) + .directive('zumWaypoint', ['WaypointService', zumWaypoint]) + .service('WaypointService', ['$timeout', WaypointService]); +})); diff --git a/dist/angular-waypoints.all.min.js b/dist/angular-waypoints.all.min.js index 9826f4b..34fe270 100644 --- a/dist/angular-waypoints.all.min.js +++ b/dist/angular-waypoints.all.min.js @@ -7,10 +7,10 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt */ (function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;c={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};this.element[u]=this.id;c[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||a)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(a&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete c[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=this.element[w])!=null?o:[];i.push(this.id);this.element[w]=i}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=t[w];if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;e=n.extend({},n.fn[g].defaults,e);if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=c[i[0][u]];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke.call(this,"disable")},enable:function(){return d._invoke.call(this,"enable")},destroy:function(){return d._invoke.call(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=c[n(t)[0][u]];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.on("load.waypoints",function(){return n[m]("refresh")})})}).call(this); /** - * Zumba(r) Angular Waypoints v1.0.1 - 2014-10-13 + * Zumba(r) Angular Waypoints v1.0.2 - 2015-12-04 * An AngularJS module for working with jQuery Waypoints * - * Copyright (c) 2014 Zumba (r) + * Copyright (c) 2015 Zumba (r) * Licensed MIT */ diff --git a/dist/angular-waypoints.js b/dist/angular-waypoints.js index b4ce3b7..52aaa49 100644 --- a/dist/angular-waypoints.js +++ b/dist/angular-waypoints.js @@ -1,144 +1,146 @@ // https://github.com/umdjs/umd (function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['angular'], factory); - } else { - // Browser globals - root.WaypointModule = factory(root.angular); - } + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['angular'], factory); + } else { + // Browser globals + root.WaypointModule = factory(root.angular); + } }(this, function (angular) { - - /** - * Zumba(r) Angular Waypoints v1.0.1 - 2014-10-13 - * An AngularJS module for working with jQuery Waypoints - * - * Copyright (c) 2014 Zumba (r) - * Licensed MIT - */ - /** - * Service for injecting a callback handler for the zumWaypoint Directive - * - * @param Function $timeout service - */ - var WaypointService = function WaypointService($timeout) { - this.$timeout = $timeout; - }; - - /** - * Get a waypoint handler that executes `callback` on next tick - * - * Callback will be passed the waypoint slug. - * - * @param Object scope - * @param Function callback - * @return mixed - */ - WaypointService.prototype.getHandlerSync = function getHandlerSync(scope, callback) { - var timeout = this.$timeout; - - return function(direction) { - var waypoint = scope[direction]; - if (waypoint) { - timeout($.proxy(callback, null, waypoint)); - } - }; - }; - - /** - * Waypoint slugs parsed into objects and stored by key: - * { - * 'example.point' : { namespace : 'example', waypoint : 'point' }, - * 'noNamespace' : { namespace : 'globals', waypoint : 'noNamespace' } - * } - * - * @type Object - */ - var parsedWaypoints = {}; - - /** - * Waypoint Controller - * - * @param Object $scope - */ - var WaypointController = function WaypointController($scope) { - $scope.waypoints = {}; - this.$scope = $scope; - }; - - /** - * Get a namespace for the waypoint - * - * @param String qualifiedWaypoint - * @return String - */ - var parseWaypoint = function parseWaypoint(qualifiedWaypoint) { - var parts; - if (!parsedWaypoints[qualifiedWaypoint]) { - parts = qualifiedWaypoint.split('.'); - if (parts.length === 1) { - parts.unshift('globals'); - } - parsedWaypoints[qualifiedWaypoint] = { - namespace : parts.shift(), - waypoint : parts.join('.') - }; - } - return parsedWaypoints[qualifiedWaypoint]; - }; - - /** - * Sets all waypoints in the colleciton to false, and sets the indicated waypoint to true. - * - * @param Object collection - * @param String waypoint - */ - var setWaypoint = function setWaypoint(collection, waypoint) { - $.each(collection, function clearWaypoints(waypoint) { - collection[waypoint] = false; - }); - collection[waypoint] = true; - }; - - /** - * Clear all waypoints in the same namespace as qualifiedWaypoint, - * and set qualifiedWaypoint. - * - * @param String qualifiedWaypoint - * @return void - */ - WaypointController.prototype.processWaypoint = function processWaypoint(qualifiedWaypoint) { - var waypoints = this.$scope.waypoints; - var data = parseWaypoint(qualifiedWaypoint); - var namespace = data.namespace; - - if (!waypoints[namespace]) { - waypoints[namespace] = {}; - } - - setWaypoint(waypoints[namespace], data.waypoint); - }; - var zumWaypoint = function zumWaypoint(WaypointService) { - return { - controller : 'WaypointController', - scope : { - up : '@', - down : '@', - offset : '@', - waypoints : '=?zumWaypoint' - }, - link : function zumWaypointLink(scope, element, attrs, ctrl) { - var callback = $.proxy(ctrl.processWaypoint, ctrl); - element.waypoint({ - handler : WaypointService.getHandlerSync(scope, callback), - offset : scope.offset || 0 - }); - } - }; - }; + + /** + * Zumba(r) Angular Waypoints v1.0.2 - 2015-12-04 + * An AngularJS module for working with jQuery Waypoints + * + * Copyright (c) 2015 Zumba (r) + * Licensed MIT + */ + /** + * Service for injecting a callback handler for the zumWaypoint Directive + * + * @param Function $timeout service + */ + var WaypointService = function WaypointService($timeout) { + this.$timeout = $timeout; + }; + + /** + * Get a waypoint handler that executes `callback` on next tick + * + * Callback will be passed the waypoint slug. + * + * @param Object scope + * @param Function callback + * @return mixed + */ + WaypointService.prototype.getHandlerSync = function getHandlerSync(scope, callback) { + var timeout = this.$timeout; + + return function(direction) { + var waypoint = scope[direction]; + if (waypoint) { + timeout($.proxy(callback, null, waypoint)); + } + }; + }; + + /** + * Waypoint slugs parsed into objects and stored by key: + * { + * 'example.point' : { namespace : 'example', waypoint : 'point' }, + * 'noNamespace' : { namespace : 'globals', waypoint : 'noNamespace' } + * } + * + * @type Object + */ + var parsedWaypoints = {}; + + /** + * Waypoint Controller + * + * @param Object $scope + */ + var WaypointController = function WaypointController($scope) { + $scope.waypoints = {}; + this.$scope = $scope; + }; + + /** + * Get a namespace for the waypoint + * + * @param String qualifiedWaypoint + * @return String + */ + var parseWaypoint = function parseWaypoint(qualifiedWaypoint) { + var parts; + if (!parsedWaypoints[qualifiedWaypoint]) { + parts = qualifiedWaypoint.split('.'); + if (parts.length === 1) { + parts.unshift('globals'); + } + parsedWaypoints[qualifiedWaypoint] = { + namespace : parts.shift(), + waypoint : parts.join('.') + }; + } + return parsedWaypoints[qualifiedWaypoint]; + }; + + /** + * Sets all waypoints in the colleciton to false, and sets the indicated waypoint to true. + * + * @param Object collection + * @param String waypoint + */ + var setWaypoint = function setWaypoint(collection, waypoint) { + $.each(collection, function clearWaypoints(waypoint) { + collection[waypoint] = false; + }); + collection[waypoint] = true; + }; + + /** + * Clear all waypoints in the same namespace as qualifiedWaypoint, + * and set qualifiedWaypoint. + * + * @param String qualifiedWaypoint + * @return void + */ + WaypointController.prototype.processWaypoint = function processWaypoint(qualifiedWaypoint) { + var waypoints = this.$scope.waypoints; + var data = parseWaypoint(qualifiedWaypoint); + var namespace = data.namespace; + + if (!waypoints[namespace]) { + waypoints[namespace] = {}; + } + + setWaypoint(waypoints[namespace], data.waypoint); + }; + + var zumWaypoint = function zumWaypoint(WaypointService) { + return { + controller : 'WaypointController', + scope : { + up : '@', + down : '@', + offset : '@', + waypoints : '=?zumWaypoint' + }, + link : function zumWaypointLink(scope, element, attrs, ctrl) { + var callback = $.proxy(ctrl.processWaypoint, ctrl); + element.waypoint({ + handler : WaypointService.getHandlerSync(scope, callback), + offset : scope.offset || 0 + }); + } + }; + }; + - return angular.module('zumba.angular-waypoints', []) - .controller('WaypointController', ['$scope', WaypointController]) - .directive('zumWaypoint', ['WaypointService', zumWaypoint]) - .service('WaypointService', ['$timeout', WaypointService]); -})); \ No newline at end of file + return angular.module('zumba.angular-waypoints', []) + .controller('WaypointController', ['$scope', WaypointController]) + .directive('zumWaypoint', ['WaypointService', zumWaypoint]) + .service('WaypointService', ['$timeout', WaypointService]); +})); diff --git a/dist/angular-waypoints.min.js b/dist/angular-waypoints.min.js index 0e788f9..d01fce9 100644 --- a/dist/angular-waypoints.min.js +++ b/dist/angular-waypoints.min.js @@ -1,8 +1,8 @@ /** - * Zumba(r) Angular Waypoints v1.0.1 - 2014-10-13 + * Zumba(r) Angular Waypoints v1.0.2 - 2015-12-04 * An AngularJS module for working with jQuery Waypoints * - * Copyright (c) 2014 Zumba (r) + * Copyright (c) 2015 Zumba (r) * Licensed MIT */ diff --git a/dist/angular-waypoints.min.js.map b/dist/angular-waypoints.min.js.map index 9e2b6ef..3b95e91 100644 --- a/dist/angular-waypoints.min.js.map +++ b/dist/angular-waypoints.min.js.map @@ -1 +1 @@ -{"version":3,"file":"angular-waypoints.min.js","sources":["angular-waypoints.js"],"names":["root","factory","define","amd","WaypointModule","angular","this","WaypointService","$timeout","prototype","getHandlerSync","scope","callback","timeout","direction","waypoint","$","proxy","parsedWaypoints","WaypointController","$scope","waypoints","parseWaypoint","qualifiedWaypoint","parts","split","length","unshift","namespace","shift","join","setWaypoint","collection","each","processWaypoint","data","zumWaypoint","controller","up","down","offset","link","element","attrs","ctrl","handler","module","directive","service"],"mappings":";;;;;;;;CACC,SAAUA,EAAMC,GACS,kBAAXC,SAAyBA,OAAOC,IAEvCD,QAAQ,WAAYD,GAGpBD,EAAKI,eAAiBH,EAAQD,EAAKK,UAEzCC,KAAM,SAAUD,GAcd,GAAIE,GAAkB,SAAyBC,GAC9CF,KAAKE,SAAWA,EAYjBD,GAAgBE,UAAUC,eAAiB,SAAwBC,EAAOC,GACzE,GAAIC,GAAUP,KAAKE,QAEnB,OAAO,UAASM,GACf,GAAIC,GAAWJ,EAAMG,EACjBC,IACHF,EAAQG,EAAEC,MAAML,EAAU,KAAMG,KAcnC,IAAIG,MAOAC,EAAqB,SAA4BC,GACpDA,EAAOC,aACPf,KAAKc,OAASA,GASXE,EAAgB,SAAuBC,GAC1C,GAAIC,EAWJ,OAVKN,GAAgBK,KACpBC,EAAQD,EAAkBE,MAAM,KACX,IAAjBD,EAAME,QACTF,EAAMG,QAAQ,WAEfT,EAAgBK,IACfK,UAAYJ,EAAMK,QAClBd,SAAWS,EAAMM,KAAK,OAGjBZ,EAAgBK,IASpBQ,EAAc,SAAqBC,EAAYjB,GAClDC,EAAEiB,KAAKD,EAAY,SAAwBjB,GAC1CiB,EAAWjB,IAAY,IAExBiB,EAAWjB,IAAY,EAUxBI,GAAmBV,UAAUyB,gBAAkB,SAAyBX,GACvE,GAAIF,GAAYf,KAAKc,OAAOC,UACxBc,EAAOb,EAAcC,GACrBK,EAAYO,EAAKP,SAEhBP,GAAUO,KACdP,EAAUO,OAGXG,EAAYV,EAAUO,GAAYO,EAAKpB,UAExC,IAAIqB,GAAc,SAAqB7B,GACtC,OACC8B,WAAa,qBACb1B,OACC2B,GAAK,IACLC,KAAO,IACPC,OAAS,IACTnB,UAAY,iBAEboB,KAAO,SAAyB9B,EAAO+B,EAASC,EAAOC,GACtD,GAAIhC,GAAWI,EAAEC,MAAM2B,EAAKV,gBAAiBU,EAC7CF,GAAQ3B,UACP8B,QAAUtC,EAAgBG,eAAeC,EAAOC,GAChD4B,OAAS7B,EAAM6B,QAAU,MAM7B,OAAOnC,GAAQyC,OAAO,8BACjBT,WAAW,sBAAuB,SAAUlB,IAC5C4B,UAAU,eAAgB,kBAAmBX,IAC7CY,QAAQ,mBAAoB,WAAYzC"} \ No newline at end of file +{"version":3,"sources":["angular-waypoints.js"],"names":["root","factory","define","amd","WaypointModule","angular","this","WaypointService","$timeout","prototype","getHandlerSync","scope","callback","timeout","direction","waypoint","$","proxy","parsedWaypoints","WaypointController","$scope","waypoints","parseWaypoint","qualifiedWaypoint","parts","split","length","unshift","namespace","shift","join","setWaypoint","collection","each","processWaypoint","data","zumWaypoint","controller","up","down","offset","link","element","attrs","ctrl","handler","module","directive","service"],"mappings":";;;;;;;;CACC,SAAUA,EAAMC,GACM,kBAAXC,SAAyBA,OAAOC,IAE1CD,QAAQ,WAAYD,GAGpBD,EAAKI,eAAiBH,EAAQD,EAAKK,UAEnCC,KAAM,SAAUD,GAcjB,GAAIE,GAAkB,SAAyBC,GAC9CF,KAAKE,SAAWA,EAYjBD,GAAgBE,UAAUC,eAAiB,SAAwBC,EAAOC,GACzE,GAAIC,GAAUP,KAAKE,QAEnB,OAAO,UAASM,GACf,GAAIC,GAAWJ,EAAMG,EACjBC,IACHF,EAAQG,EAAEC,MAAML,EAAU,KAAMG,KAcnC,IAAIG,MAOAC,EAAqB,SAA4BC,GACpDA,EAAOC,aACPf,KAAKc,OAASA,GASXE,EAAgB,SAAuBC,GAC1C,GAAIC,EAWJ,OAVKN,GAAgBK,KACpBC,EAAQD,EAAkBE,MAAM,KACX,IAAjBD,EAAME,QACTF,EAAMG,QAAQ,WAEfT,EAAgBK,IACfK,UAAYJ,EAAMK,QAClBd,SAAWS,EAAMM,KAAK,OAGjBZ,EAAgBK,IASpBQ,EAAc,SAAqBC,EAAYjB,GAClDC,EAAEiB,KAAKD,EAAY,SAAwBjB,GAC1CiB,EAAWjB,IAAY,IAExBiB,EAAWjB,IAAY,EAUxBI,GAAmBV,UAAUyB,gBAAkB,SAAyBX,GACvE,GAAIF,GAAYf,KAAKc,OAAOC,UACxBc,EAAOb,EAAcC,GACrBK,EAAYO,EAAKP,SAEhBP,GAAUO,KACdP,EAAUO,OAGXG,EAAYV,EAAUO,GAAYO,EAAKpB,UAGxC,IAAIqB,GAAc,SAAqB7B,GACtC,OACC8B,WAAa,qBACb1B,OACC2B,GAAK,IACLC,KAAO,IACPC,OAAS,IACTnB,UAAY,iBAEboB,KAAO,SAAyB9B,EAAO+B,EAASC,EAAOC,GACtD,GAAIhC,GAAWI,EAAEC,MAAM2B,EAAKV,gBAAiBU,EAC7CF,GAAQ3B,UACP8B,QAAUtC,EAAgBG,eAAeC,EAAOC,GAChD4B,OAAS7B,EAAM6B,QAAU,MAO7B,OAAOnC,GAAQyC,OAAO,8BACpBT,WAAW,sBAAuB,SAAUlB,IAC5C4B,UAAU,eAAgB,kBAAmBX,IAC7CY,QAAQ,mBAAoB,WAAYzC","file":"angular-waypoints.min.js"} \ No newline at end of file diff --git a/dist/angular-waypoints.raw.js b/dist/angular-waypoints.raw.js index 4039f71..98dc669 100644 --- a/dist/angular-waypoints.raw.js +++ b/dist/angular-waypoints.raw.js @@ -1,8 +1,8 @@ /** - * Zumba(r) Angular Waypoints v1.0.1 - 2014-10-13 + * Zumba(r) Angular Waypoints v1.0.2 - 2015-12-04 * An AngularJS module for working with jQuery Waypoints * - * Copyright (c) 2014 Zumba (r) + * Copyright (c) 2015 Zumba (r) * Licensed MIT */ /** @@ -107,6 +107,7 @@ WaypointController.prototype.processWaypoint = function processWaypoint(qualifie setWaypoint(waypoints[namespace], data.waypoint); }; + var zumWaypoint = function zumWaypoint(WaypointService) { return { controller : 'WaypointController', @@ -124,4 +125,4 @@ var zumWaypoint = function zumWaypoint(WaypointService) { }); } }; -}; \ No newline at end of file +}; diff --git a/grunt/config/grunt-contrib-clean.json b/grunt/config/grunt-contrib-clean.json index 74f03ad..e9ba1f5 100644 --- a/grunt/config/grunt-contrib-clean.json +++ b/grunt/config/grunt-contrib-clean.json @@ -1,5 +1,5 @@ { - "clean" : { - "dist" : ["dist/"] - } -} \ No newline at end of file + "clean" : { + "dist" : ["dist/"] + } +} diff --git a/grunt/config/grunt-contrib-concat.json b/grunt/config/grunt-contrib-concat.json index cc804ac..7bb4323 100644 --- a/grunt/config/grunt-contrib-concat.json +++ b/grunt/config/grunt-contrib-concat.json @@ -1,32 +1,32 @@ { - "concat" : { - "dist" : { - "options" : { - "stripBanners" : false, - "separator" : "\n", - "banner" : "/**\n * Zumba(r) Angular Waypoints v<%= pkg.version %> - <%= grunt.template.today('yyyy-mm-dd') %>\n * <%= pkg.description %>\n *\n * Copyright (c) <%= grunt.template.today('yyyy') %> Zumba (r)\n * Licensed <%= pkg.license %>\n */\n" - }, - "src" : [ - "src/Waypoint/Service.js", - "src/Waypoint/Controller.js", - "src/Waypoint/Directive.js", - "src/Waypoint/Module.js" - ], - "dest" : "dist/angular-waypoints.raw.js" - }, - "dependencies" : { - "src" : [ - "bower_components/jquery-waypoints/waypoints.js", - "dist/angular-waypoints.js" - ], - "dest" : "dist/angular-waypoints.all.js" - }, - "dependencies-min" : { - "src" : [ - "bower_components/jquery-waypoints/waypoints.min.js", - "dist/angular-waypoints.min.js" - ], - "dest" : "dist/angular-waypoints.all.min.js" - } + "concat" : { + "dist" : { + "options" : { + "stripBanners" : false, + "separator" : "\n", + "banner" : "/**\n * Zumba(r) Angular Waypoints v<%= pkg.version %> - <%= grunt.template.today('yyyy-mm-dd') %>\n * <%= pkg.description %>\n *\n * Copyright (c) <%= grunt.template.today('yyyy') %> Zumba (r)\n * Licensed <%= pkg.license %>\n */\n" + }, + "src" : [ + "src/Waypoint/Service.js", + "src/Waypoint/Controller.js", + "src/Waypoint/Directive.js", + "src/Waypoint/Module.js" + ], + "dest" : "dist/angular-waypoints.raw.js" + }, + "dependencies" : { + "src" : [ + "bower_components/jquery-waypoints/waypoints.js", + "dist/angular-waypoints.js" + ], + "dest" : "dist/angular-waypoints.all.js" + }, + "dependencies-min" : { + "src" : [ + "bower_components/jquery-waypoints/waypoints.min.js", + "dist/angular-waypoints.min.js" + ], + "dest" : "dist/angular-waypoints.all.min.js" } + } } diff --git a/grunt/config/grunt-contrib-jasmine.json b/grunt/config/grunt-contrib-jasmine.json index f27177f..892c788 100644 --- a/grunt/config/grunt-contrib-jasmine.json +++ b/grunt/config/grunt-contrib-jasmine.json @@ -1,16 +1,16 @@ { - "jasmine" : { - "tests" : { - "src" : "dist/angular-waypoints.min.js", - "options" : { - "specs" : "test/spec/*.spec.js", - "vendor" : [ - "bower_components/jquery/dist/jquery.js", - "bower_components/jquery-waypoints/waypoints.js", - "bower_components/angular/angular.js", - "bower_components/angular-mocks/angular-mocks.js" - ] - } - } + "jasmine" : { + "tests" : { + "src" : "dist/angular-waypoints.min.js", + "options" : { + "specs" : "test/spec/*.spec.js", + "vendor" : [ + "bower_components/jquery/dist/jquery.js", + "bower_components/jquery-waypoints/waypoints.js", + "bower_components/angular/angular.js", + "bower_components/angular-mocks/angular-mocks.js" + ] + } } -} \ No newline at end of file + } +} diff --git a/grunt/config/grunt-contrib-jshint.json b/grunt/config/grunt-contrib-jshint.json index aed3872..1293585 100644 --- a/grunt/config/grunt-contrib-jshint.json +++ b/grunt/config/grunt-contrib-jshint.json @@ -1,8 +1,8 @@ { - "jshint" : { - "options" : { - "jshintrc" : ".jshintrc" - }, - "source" : ["./gruntfile.js", "test/**/*.js", "dist/angular-waypoints.js"] - } -} \ No newline at end of file + "jshint" : { + "options" : { + "jshintrc" : ".jshintrc" + }, + "source" : ["./gruntfile.js", "test/**/*.js", "dist/angular-waypoints.js"] + } +} diff --git a/grunt/config/grunt-contrib-uglify.json b/grunt/config/grunt-contrib-uglify.json index 3edd783..3f3e846 100644 --- a/grunt/config/grunt-contrib-uglify.json +++ b/grunt/config/grunt-contrib-uglify.json @@ -1,22 +1,22 @@ { - "uglify" : { - "options" : { - "mangle" : true, - "compress" : { "drop_console": true }, - "sourceMap" : true, - "preserveComments" : false, - "banner" : "/**\n * Zumba(r) Angular Waypoints v<%= pkg.version %> - <%= grunt.template.today('yyyy-mm-dd') %>\n * <%= pkg.description %>\n *\n * Copyright (c) <%= grunt.template.today('yyyy') %> Zumba (r)\n * Licensed <%= pkg.license %>\n */\n" - }, - "dist" : { - "files" : [ - { - "expand" : true, - "cwd" : "dist/", - "src" : "angular-waypoints.js", - "dest": "dist/", - "rename" : null - } - ] + "uglify" : { + "options" : { + "mangle" : true, + "compress" : { "drop_console": true }, + "sourceMap" : true, + "preserveComments" : false, + "banner" : "/**\n * Zumba(r) Angular Waypoints v<%= pkg.version %> - <%= grunt.template.today('yyyy-mm-dd') %>\n * <%= pkg.description %>\n *\n * Copyright (c) <%= grunt.template.today('yyyy') %> Zumba (r)\n * Licensed <%= pkg.license %>\n */\n" + }, + "dist" : { + "files" : [ + { + "expand" : true, + "cwd" : "dist/", + "src" : "angular-waypoints.js", + "dest": "dist/", + "rename" : null } + ] } -} \ No newline at end of file + } +} diff --git a/grunt/config/grunt-wrap.json b/grunt/config/grunt-wrap.json index 9e4f170..6ed83da 100644 --- a/grunt/config/grunt-wrap.json +++ b/grunt/config/grunt-wrap.json @@ -1,13 +1,13 @@ { - "wrap" : { - "files" : { - "src" : ["dist/angular-waypoints.raw.js"], - "dest" : "dist/angular-waypoints.js", - "options" : { - "seperator" : "\n", - "indent" : " ", - "wrapper" : null - } - } + "wrap" : { + "files" : { + "src" : ["dist/angular-waypoints.raw.js"], + "dest" : "dist/angular-waypoints.js", + "options" : { + "seperator" : "\n", + "indent" : "\t", + "wrapper" : null + } } -} \ No newline at end of file + } +} diff --git a/gruntfile.js b/gruntfile.js index 9787c59..53563a2 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -3,35 +3,35 @@ var _ = require('lodash'); module.exports = function(grunt) { - "use strict"; - var gruntConfig = { pkg : grunt.file.readJSON('package.json') }; + "use strict"; + var gruntConfig = { pkg : grunt.file.readJSON('package.json') }; - grunt.file.recurse('grunt/config', function(config) { - _.merge(gruntConfig, grunt.file.readJSON(config)); - }); + grunt.file.recurse('grunt/config', function(config) { + _.merge(gruntConfig, grunt.file.readJSON(config)); + }); - gruntConfig.wrap.files.options.wrapper = grunt.file.read('src/umd.js').split('/** src files **/'); + gruntConfig.wrap.files.options.wrapper = grunt.file.read('src/umd.js').split('/** src files **/'); - var rename = function(dest, src) { - return dest + src.replace('.js', '.min.js'); - }; - _.each(gruntConfig.uglify, function(obj) { - if (obj.files) { - obj.files[0].rename = rename; - } - }); + var rename = function(dest, src) { + return dest + src.replace('.js', '.min.js'); + }; + _.each(gruntConfig.uglify, function(obj) { + if (obj.files) { + obj.files[0].rename = rename; + } + }); - // Project configuration. - grunt.initConfig(gruntConfig); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-jasmine'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-wrap'); + // Project configuration. + grunt.initConfig(gruntConfig); + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-jasmine'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-wrap'); - grunt.registerTask('build-src', ['clean', 'concat:dist', 'wrap']); - grunt.registerTask('build-dist', ['jshint', 'uglify', 'concat:dependencies', 'concat:dependencies-min']); - grunt.registerTask('test', ['build-src', 'build-dist', 'jasmine']); - grunt.registerTask('default', ['test']); -}; \ No newline at end of file + grunt.registerTask('build-src', ['clean', 'concat:dist', 'wrap']); + grunt.registerTask('build-dist', ['jshint', 'uglify', 'concat:dependencies', 'concat:dependencies-min']); + grunt.registerTask('test', ['build-src', 'build-dist', 'jasmine']); + grunt.registerTask('default', ['test']); +}; diff --git a/package.json b/package.json index 4005288..955ac4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-waypoints", - "version": "1.0.1", + "version": "1.0.2", "description": "An AngularJS module for working with jQuery Waypoints", "main": "dist/angular-waypoints.js", "scripts": { diff --git a/src/Waypoint/Controller.js b/src/Waypoint/Controller.js index 9104e61..a4c741d 100644 --- a/src/Waypoint/Controller.js +++ b/src/Waypoint/Controller.js @@ -70,4 +70,4 @@ WaypointController.prototype.processWaypoint = function processWaypoint(qualifie } setWaypoint(waypoints[namespace], data.waypoint); -}; \ No newline at end of file +}; diff --git a/src/Waypoint/Directive.js b/src/Waypoint/Directive.js index 3906083..814787e 100644 --- a/src/Waypoint/Directive.js +++ b/src/Waypoint/Directive.js @@ -15,4 +15,4 @@ var zumWaypoint = function zumWaypoint(WaypointService) { }); } }; -}; \ No newline at end of file +}; diff --git a/src/umd.js b/src/umd.js index e4eaf0d..14e2d22 100644 --- a/src/umd.js +++ b/src/umd.js @@ -1,16 +1,16 @@ // https://github.com/umdjs/umd (function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['angular'], factory); - } else { - // Browser globals - root.WaypointModule = factory(root.angular); - } + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['angular'], factory); + } else { + // Browser globals + root.WaypointModule = factory(root.angular); + } }(this, function (angular) { - /** src files **/ - return angular.module('zumba.angular-waypoints', []) - .controller('WaypointController', ['$scope', WaypointController]) - .directive('zumWaypoint', ['WaypointService', zumWaypoint]) - .service('WaypointService', ['$timeout', WaypointService]); -})); \ No newline at end of file + /** src files **/ + return angular.module('zumba.angular-waypoints', []) + .controller('WaypointController', ['$scope', WaypointController]) + .directive('zumWaypoint', ['WaypointService', zumWaypoint]) + .service('WaypointService', ['$timeout', WaypointService]); +})); diff --git a/test/spec/Controller.spec.js b/test/spec/Controller.spec.js index 7ef7bd6..fc6e953 100644 --- a/test/spec/Controller.spec.js +++ b/test/spec/Controller.spec.js @@ -76,4 +76,4 @@ }); }); }); -}()); \ No newline at end of file +}()); diff --git a/test/spec/Directive.spec.js b/test/spec/Directive.spec.js index 97e4a62..49f410f 100644 --- a/test/spec/Directive.spec.js +++ b/test/spec/Directive.spec.js @@ -78,4 +78,4 @@ expect(scope.waypoints).toBe(scope.$parent.testPoints); }); }); -}()); \ No newline at end of file +}());