angularjs-rails 1.4.4 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.4.4
2
+ * @license AngularJS v1.4.7
3
3
  * (c) 2010-2015 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -57,6 +57,16 @@
57
57
  var ngAriaModule = angular.module('ngAria', ['ng']).
58
58
  provider('$aria', $AriaProvider);
59
59
 
60
+ /**
61
+ * Internal Utilities
62
+ */
63
+ var nodeBlackList = ['BUTTON', 'A', 'INPUT', 'TEXTAREA', 'SELECT', 'DETAILS', 'SUMMARY'];
64
+
65
+ var isNodeOneOf = function(elem, nodeTypeArray) {
66
+ if (nodeTypeArray.indexOf(elem[0].nodeName) !== -1) {
67
+ return true;
68
+ }
69
+ };
60
70
  /**
61
71
  * @ngdoc provider
62
72
  * @name $ariaProvider
@@ -118,10 +128,10 @@ function $AriaProvider() {
118
128
  config = angular.extend(config, newConfig);
119
129
  };
120
130
 
121
- function watchExpr(attrName, ariaAttr, negate) {
131
+ function watchExpr(attrName, ariaAttr, nodeBlackList, negate) {
122
132
  return function(scope, elem, attr) {
123
133
  var ariaCamelName = attr.$normalize(ariaAttr);
124
- if (config[ariaCamelName] && !attr[ariaCamelName]) {
134
+ if (config[ariaCamelName] && !isNodeOneOf(elem, nodeBlackList) && !attr[ariaCamelName]) {
125
135
  scope.$watch(attr[attrName], function(boolVal) {
126
136
  // ensure boolean value
127
137
  boolVal = negate ? !boolVal : !!boolVal;
@@ -130,7 +140,6 @@ function $AriaProvider() {
130
140
  }
131
141
  };
132
142
  }
133
-
134
143
  /**
135
144
  * @ngdoc service
136
145
  * @name $aria
@@ -189,10 +198,10 @@ function $AriaProvider() {
189
198
 
190
199
 
191
200
  ngAriaModule.directive('ngShow', ['$aria', function($aria) {
192
- return $aria.$$watchExpr('ngShow', 'aria-hidden', true);
201
+ return $aria.$$watchExpr('ngShow', 'aria-hidden', [], true);
193
202
  }])
194
203
  .directive('ngHide', ['$aria', function($aria) {
195
- return $aria.$$watchExpr('ngHide', 'aria-hidden', false);
204
+ return $aria.$$watchExpr('ngHide', 'aria-hidden', [], false);
196
205
  }])
197
206
  .directive('ngModel', ['$aria', function($aria) {
198
207
 
@@ -266,6 +275,9 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
266
275
  scope.$watch(ngAriaWatchModelValue, shape === 'radio' ?
267
276
  getRadioReaction() : ngAriaCheckboxReaction);
268
277
  }
278
+ if (needsTabIndex) {
279
+ elem.attr('tabindex', 0);
280
+ }
269
281
  break;
270
282
  case 'range':
271
283
  if (shouldAttachRole(shape, elem)) {
@@ -294,6 +306,9 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
294
306
  });
295
307
  }
296
308
  }
309
+ if (needsTabIndex) {
310
+ elem.attr('tabindex', 0);
311
+ }
297
312
  break;
298
313
  case 'multiline':
299
314
  if (shouldAttachAttr('aria-multiline', 'ariaMultiline', elem)) {
@@ -302,10 +317,6 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
302
317
  break;
303
318
  }
304
319
 
305
- if (needsTabIndex) {
306
- elem.attr('tabindex', 0);
307
- }
308
-
309
320
  if (ngModel.$validators.required && shouldAttachAttr('aria-required', 'ariaRequired', elem)) {
310
321
  scope.$watch(function ngAriaRequiredWatch() {
311
322
  return ngModel.$error.required;
@@ -327,7 +338,7 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
327
338
  };
328
339
  }])
329
340
  .directive('ngDisabled', ['$aria', function($aria) {
330
- return $aria.$$watchExpr('ngDisabled', 'aria-disabled');
341
+ return $aria.$$watchExpr('ngDisabled', 'aria-disabled', []);
331
342
  }])
332
343
  .directive('ngMessages', function() {
333
344
  return {
@@ -347,35 +358,28 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
347
358
  var fn = $parse(attr.ngClick, /* interceptorFn */ null, /* expensiveChecks */ true);
348
359
  return function(scope, elem, attr) {
349
360
 
350
- var nodeBlackList = ['BUTTON', 'A', 'INPUT', 'TEXTAREA'];
361
+ if (!isNodeOneOf(elem, nodeBlackList)) {
351
362
 
352
- function isNodeOneOf(elem, nodeTypeArray) {
353
- if (nodeTypeArray.indexOf(elem[0].nodeName) !== -1) {
354
- return true;
363
+ if ($aria.config('bindRoleForClick') && !elem.attr('role')) {
364
+ elem.attr('role', 'button');
355
365
  }
356
- }
357
366
 
358
- if ($aria.config('bindRoleForClick')
359
- && !elem.attr('role')
360
- && !isNodeOneOf(elem, nodeBlackList)) {
361
- elem.attr('role', 'button');
362
- }
363
-
364
- if ($aria.config('tabindex') && !elem.attr('tabindex')) {
365
- elem.attr('tabindex', 0);
366
- }
367
+ if ($aria.config('tabindex') && !elem.attr('tabindex')) {
368
+ elem.attr('tabindex', 0);
369
+ }
367
370
 
368
- if ($aria.config('bindKeypress') && !attr.ngKeypress && !isNodeOneOf(elem, nodeBlackList)) {
369
- elem.on('keypress', function(event) {
370
- var keyCode = event.which || event.keyCode;
371
- if (keyCode === 32 || keyCode === 13) {
372
- scope.$apply(callback);
373
- }
371
+ if ($aria.config('bindKeypress') && !attr.ngKeypress) {
372
+ elem.on('keypress', function(event) {
373
+ var keyCode = event.which || event.keyCode;
374
+ if (keyCode === 32 || keyCode === 13) {
375
+ scope.$apply(callback);
376
+ }
374
377
 
375
- function callback() {
376
- fn(scope, { $event: event });
377
- }
378
- });
378
+ function callback() {
379
+ fn(scope, { $event: event });
380
+ }
381
+ });
382
+ }
379
383
  }
380
384
  };
381
385
  }
@@ -383,7 +387,7 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
383
387
  }])
384
388
  .directive('ngDblclick', ['$aria', function($aria) {
385
389
  return function(scope, elem, attr) {
386
- if ($aria.config('tabindex') && !elem.attr('tabindex')) {
390
+ if ($aria.config('tabindex') && !elem.attr('tabindex') && !isNodeOneOf(elem, nodeBlackList)) {
387
391
  elem.attr('tabindex', 0);
388
392
  }
389
393
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.4.4
2
+ * @license AngularJS v1.4.7
3
3
  * (c) 2010-2015 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -278,7 +278,7 @@ function $$CookieWriter($document, $log, $browser) {
278
278
  options = options || {};
279
279
  expires = options.expires;
280
280
  path = angular.isDefined(options.path) ? options.path : cookiePath;
281
- if (value === undefined) {
281
+ if (angular.isUndefined(value)) {
282
282
  expires = 'Thu, 01 Jan 1970 00:00:00 GMT';
283
283
  value = '';
284
284
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.4.4
2
+ * @license AngularJS v1.4.7
3
3
  * (c) 2010-2015 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -59,7 +59,7 @@ function minErr(module, ErrorConstructor) {
59
59
  return match;
60
60
  });
61
61
 
62
- message += '\nhttp://errors.angularjs.org/1.4.4/' +
62
+ message += '\nhttp://errors.angularjs.org/1.4.7/' +
63
63
  (module ? module + '/' : '') + code;
64
64
 
65
65
  for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.4.4
2
+ * @license AngularJS v1.4.7
3
3
  * (c) 2010-2015 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.4.4
2
+ * @license AngularJS v1.4.7
3
3
  * (c) 2010-2015 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -330,6 +330,9 @@ angular.module('ngMessages', [])
330
330
  controller: ['$element', '$scope', '$attrs', function($element, $scope, $attrs) {
331
331
  var ctrl = this;
332
332
  var latestKey = 0;
333
+ var nextAttachId = 0;
334
+
335
+ this.getAttachId = function getAttachId() { return nextAttachId++; };
333
336
 
334
337
  var messages = this.messages = {};
335
338
  var renderLater, cachedCollection;
@@ -641,11 +644,15 @@ function ngMessageDirectiveFactory(restrict) {
641
644
  $animate.enter(elm, null, element);
642
645
  currentElement = elm;
643
646
 
647
+ // Each time we attach this node to a message we get a new id that we can match
648
+ // when we are destroying the node later.
649
+ var $$attachId = currentElement.$$attachId = ngMessagesCtrl.getAttachId();
650
+
644
651
  // in the event that the parent element is destroyed
645
652
  // by any other structural directive then it's time
646
653
  // to deregister the message from the controller
647
654
  currentElement.on('$destroy', function() {
648
- if (currentElement) {
655
+ if (currentElement && currentElement.$$attachId === $$attachId) {
649
656
  ngMessagesCtrl.deregister(commentNode);
650
657
  messageCtrl.detach();
651
658
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.4.4
2
+ * @license AngularJS v1.4.7
3
3
  * (c) 2010-2015 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -94,7 +94,7 @@ angular.mock.$Browser = function() {
94
94
  if (fn.id === deferId) fnIndex = index;
95
95
  });
96
96
 
97
- if (fnIndex !== undefined) {
97
+ if (angular.isDefined(fnIndex)) {
98
98
  self.deferredFns.splice(fnIndex, 1);
99
99
  return true;
100
100
  }
@@ -469,7 +469,7 @@ angular.mock.$IntervalProvider = function() {
469
469
  if (fn.id === promise.$$intervalId) fnIndex = index;
470
470
  });
471
471
 
472
- if (fnIndex !== undefined) {
472
+ if (angular.isDefined(fnIndex)) {
473
473
  repeatFns.splice(fnIndex, 1);
474
474
  }
475
475
  }
@@ -511,7 +511,7 @@ angular.mock.$IntervalProvider = function() {
511
511
  if (fn.id === promise.$$intervalId) fnIndex = index;
512
512
  });
513
513
 
514
- if (fnIndex !== undefined) {
514
+ if (angular.isDefined(fnIndex)) {
515
515
  repeatFns[fnIndex].deferred.reject('canceled');
516
516
  repeatFns.splice(fnIndex, 1);
517
517
  return true;
@@ -770,25 +770,62 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
770
770
  return reflowFn;
771
771
  });
772
772
 
773
- $provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF', '$$forceReflow',
774
- function($delegate, $timeout, $browser, $$rAF, $$forceReflow) {
773
+ $provide.factory('$$animateAsyncRun', function() {
774
+ var queue = [];
775
+ var queueFn = function() {
776
+ return function(fn) {
777
+ queue.push(fn);
778
+ };
779
+ };
780
+ queueFn.flush = function() {
781
+ if (queue.length === 0) return false;
775
782
 
783
+ for (var i = 0; i < queue.length; i++) {
784
+ queue[i]();
785
+ }
786
+ queue = [];
787
+
788
+ return true;
789
+ };
790
+ return queueFn;
791
+ });
792
+
793
+ $provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF',
794
+ '$$forceReflow', '$$animateAsyncRun', '$rootScope',
795
+ function($delegate, $timeout, $browser, $$rAF,
796
+ $$forceReflow, $$animateAsyncRun, $rootScope) {
776
797
  var animate = {
777
798
  queue: [],
778
799
  cancel: $delegate.cancel,
800
+ on: $delegate.on,
801
+ off: $delegate.off,
802
+ pin: $delegate.pin,
779
803
  get reflows() {
780
804
  return $$forceReflow.totalReflows;
781
805
  },
782
806
  enabled: $delegate.enabled,
783
- triggerCallbackEvents: function() {
784
- $$rAF.flush();
785
- },
786
- triggerCallbackPromise: function() {
787
- $timeout.flush(0);
788
- },
789
- triggerCallbacks: function() {
790
- this.triggerCallbackEvents();
791
- this.triggerCallbackPromise();
807
+ flush: function() {
808
+ $rootScope.$digest();
809
+
810
+ var doNextRun, somethingFlushed = false;
811
+ do {
812
+ doNextRun = false;
813
+
814
+ if ($$rAF.queue.length) {
815
+ $$rAF.flush();
816
+ doNextRun = somethingFlushed = true;
817
+ }
818
+
819
+ if ($$animateAsyncRun.flush()) {
820
+ doNextRun = somethingFlushed = true;
821
+ }
822
+ } while (doNextRun);
823
+
824
+ if (!somethingFlushed) {
825
+ throw new Error('No pending animations ready to be closed or flushed');
826
+ }
827
+
828
+ $rootScope.$digest();
792
829
  }
793
830
  };
794
831
 
@@ -1005,7 +1042,7 @@ angular.mock.dump = function(object) {
1005
1042
  $http.post('/add-msg.py', message, { headers: headers } ).success(function(response) {
1006
1043
  $scope.status = '';
1007
1044
  }).error(function() {
1008
- $scope.status = 'ERROR!';
1045
+ $scope.status = 'Failed...';
1009
1046
  });
1010
1047
  };
1011
1048
  }
@@ -1740,28 +1777,28 @@ angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $
1740
1777
  }];
1741
1778
 
1742
1779
  angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
1743
- var queue = [];
1744
1780
  var rafFn = function(fn) {
1745
- var index = queue.length;
1746
- queue.push(fn);
1781
+ var index = rafFn.queue.length;
1782
+ rafFn.queue.push(fn);
1747
1783
  return function() {
1748
- queue.splice(index, 1);
1784
+ rafFn.queue.splice(index, 1);
1749
1785
  };
1750
1786
  };
1751
1787
 
1788
+ rafFn.queue = [];
1752
1789
  rafFn.supported = $delegate.supported;
1753
1790
 
1754
1791
  rafFn.flush = function() {
1755
- if (queue.length === 0) {
1792
+ if (rafFn.queue.length === 0) {
1756
1793
  throw new Error('No rAF callbacks present');
1757
1794
  }
1758
1795
 
1759
- var length = queue.length;
1796
+ var length = rafFn.queue.length;
1760
1797
  for (var i = 0; i < length; i++) {
1761
- queue[i]();
1798
+ rafFn.queue[i]();
1762
1799
  }
1763
1800
 
1764
- queue = queue.slice(i);
1801
+ rafFn.queue = rafFn.queue.slice(i);
1765
1802
  };
1766
1803
 
1767
1804
  return rafFn;
@@ -1809,7 +1846,7 @@ angular.mock.$RootElementProvider = function() {
1809
1846
  *
1810
1847
  * describe('myDirectiveController', function() {
1811
1848
  * it('should write the bound name to the log', inject(function($controller, $log) {
1812
- * var ctrl = $controller('MyDirective', { /* no locals &#42;/ }, { name: 'Clark Kent' });
1849
+ * var ctrl = $controller('MyDirectiveController', { /* no locals &#42;/ }, { name: 'Clark Kent' });
1813
1850
  * expect(ctrl.name).toEqual('Clark Kent');
1814
1851
  * expect($log.info.logs).toEqual(['Clark Kent']);
1815
1852
  * });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.4.4
2
+ * @license AngularJS v1.4.7
3
3
  * (c) 2010-2015 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -22,7 +22,7 @@ function lookupDottedPath(obj, path) {
22
22
  throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path);
23
23
  }
24
24
  var keys = path.split('.');
25
- for (var i = 0, ii = keys.length; i < ii && obj !== undefined; i++) {
25
+ for (var i = 0, ii = keys.length; i < ii && angular.isDefined(obj); i++) {
26
26
  var key = keys[i];
27
27
  obj = (obj !== null) ? obj[key] : undefined;
28
28
  }
@@ -353,6 +353,7 @@ function shallowClearAndCopy(src, dst) {
353
353
  */
354
354
  angular.module('ngResource', ['ng']).
355
355
  provider('$resource', function() {
356
+ var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\/\/[^\/]*/;
356
357
  var provider = this;
357
358
 
358
359
  this.defaults = {
@@ -427,7 +428,8 @@ angular.module('ngResource', ['ng']).
427
428
  var self = this,
428
429
  url = actionUrl || self.template,
429
430
  val,
430
- encodedVal;
431
+ encodedVal,
432
+ protocolAndDomain = '';
431
433
 
432
434
  var urlParams = self.urlParams = {};
433
435
  forEach(url.split(/\W/), function(param) {
@@ -440,6 +442,10 @@ angular.module('ngResource', ['ng']).
440
442
  }
441
443
  });
442
444
  url = url.replace(/\\:/g, ':');
445
+ url = url.replace(PROTOCOL_AND_DOMAIN_REGEX, function(match) {
446
+ protocolAndDomain = match;
447
+ return '';
448
+ });
443
449
 
444
450
  params = params || {};
445
451
  forEach(self.urlParams, function(_, urlParam) {
@@ -470,7 +476,7 @@ angular.module('ngResource', ['ng']).
470
476
  // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
471
477
  url = url.replace(/\/\.(?=\w+($|\?))/, '.');
472
478
  // replace escaped `/\.` with `/.`
473
- config.url = url.replace(/\/\\\./, '/.');
479
+ config.url = protocolAndDomain + url.replace(/\/\\\./, '/.');
474
480
 
475
481
 
476
482
  // set params - delegate param encoding to $http
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.4.4
2
+ * @license AngularJS v1.4.7
3
3
  * (c) 2010-2015 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -796,7 +796,6 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
796
796
  }
797
797
 
798
798
  .view-animate.ng-enter, .view-animate.ng-leave {
799
- -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
800
799
  transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
801
800
 
802
801
  display:block;