angular-gem 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +8 -8
  2. data/lib/angular-gem/version.rb +1 -1
  3. data/vendor/assets/javascripts/1.3.1/angular-animate.js +2136 -0
  4. data/vendor/assets/javascripts/1.3.1/angular-aria.js +250 -0
  5. data/vendor/assets/javascripts/1.3.1/angular-cookies.js +206 -0
  6. data/vendor/assets/javascripts/1.3.1/angular-loader.js +422 -0
  7. data/vendor/assets/javascripts/1.3.1/angular-messages.js +400 -0
  8. data/vendor/assets/javascripts/1.3.1/angular-mocks.js +2289 -0
  9. data/vendor/assets/javascripts/1.3.1/angular-resource.js +667 -0
  10. data/vendor/assets/javascripts/1.3.1/angular-route.js +978 -0
  11. data/vendor/assets/javascripts/1.3.1/angular-sanitize.js +678 -0
  12. data/vendor/assets/javascripts/1.3.1/angular-scenario.js +36979 -0
  13. data/vendor/assets/javascripts/1.3.1/angular-touch.js +622 -0
  14. data/vendor/assets/javascripts/1.3.1/angular.js +25625 -0
  15. data/vendor/assets/javascripts/angular-animate.js +78 -54
  16. data/vendor/assets/javascripts/angular-aria.js +5 -5
  17. data/vendor/assets/javascripts/angular-cookies.js +4 -4
  18. data/vendor/assets/javascripts/angular-loader.js +6 -6
  19. data/vendor/assets/javascripts/angular-messages.js +15 -15
  20. data/vendor/assets/javascripts/angular-mocks.js +34 -32
  21. data/vendor/assets/javascripts/angular-resource.js +22 -22
  22. data/vendor/assets/javascripts/angular-route.js +8 -8
  23. data/vendor/assets/javascripts/angular-sanitize.js +94 -63
  24. data/vendor/assets/javascripts/angular-scenario.js +532 -497
  25. data/vendor/assets/javascripts/angular-touch.js +3 -3
  26. data/vendor/assets/javascripts/angular.js +516 -475
  27. metadata +14 -2
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.3.0
2
+ * @license AngularJS v1.3.1
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -245,12 +245,12 @@ angular.module('ngMessages', [])
245
245
 
246
246
  var messages = [];
247
247
  this.registerMessage = function(index, message) {
248
- for(var i = 0; i < messages.length; i++) {
249
- if(messages[i].type == message.type) {
250
- if(index != i) {
248
+ for (var i = 0; i < messages.length; i++) {
249
+ if (messages[i].type == message.type) {
250
+ if (index != i) {
251
251
  var temp = messages[index];
252
252
  messages[index] = messages[i];
253
- if(index < messages.length) {
253
+ if (index < messages.length) {
254
254
  messages[i] = temp;
255
255
  } else {
256
256
  messages.splice(0, i); //remove the old one (and shift left)
@@ -267,7 +267,7 @@ angular.module('ngMessages', [])
267
267
 
268
268
  var found;
269
269
  angular.forEach(messages, function(message) {
270
- if((!found || multiple) && truthyVal(values[message.type])) {
270
+ if ((!found || multiple) && truthyVal(values[message.type])) {
271
271
  message.attach();
272
272
  found = true;
273
273
  } else {
@@ -300,7 +300,7 @@ angular.module('ngMessages', [])
300
300
  });
301
301
 
302
302
  var tpl = $attrs.ngMessagesInclude || $attrs.include;
303
- if(tpl) {
303
+ if (tpl) {
304
304
  $templateRequest(tpl)
305
305
  .then(function processTemplate(html) {
306
306
  var after, container = angular.element('<div/>').html(html);
@@ -364,10 +364,10 @@ angular.module('ngMessages', [])
364
364
 
365
365
  var commentNode = $element[0];
366
366
  var parentNode = commentNode.parentNode;
367
- for(var i = 0, j = 0; i < parentNode.childNodes.length; i++) {
367
+ for (var i = 0, j = 0; i < parentNode.childNodes.length; i++) {
368
368
  var node = parentNode.childNodes[i];
369
- if(node.nodeType == COMMENT_NODE && node.nodeValue.indexOf('ngMessage') >= 0) {
370
- if(node === commentNode) {
369
+ if (node.nodeType == COMMENT_NODE && node.nodeValue.indexOf('ngMessage') >= 0) {
370
+ if (node === commentNode) {
371
371
  index = j;
372
372
  break;
373
373
  }
@@ -376,17 +376,17 @@ angular.module('ngMessages', [])
376
376
  }
377
377
 
378
378
  ngMessages.registerMessage(index, {
379
- type : $attrs.ngMessage || $attrs.when,
380
- attach : function() {
381
- if(!element) {
379
+ type: $attrs.ngMessage || $attrs.when,
380
+ attach: function() {
381
+ if (!element) {
382
382
  $transclude($scope, function(clone) {
383
383
  $animate.enter(clone, null, $element);
384
384
  element = clone;
385
385
  });
386
386
  }
387
387
  },
388
- detach : function(now) {
389
- if(element) {
388
+ detach: function(now) {
389
+ if (element) {
390
390
  $animate.leave(element);
391
391
  element = null;
392
392
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.3.0
2
+ * @license AngularJS v1.3.1
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -74,7 +74,7 @@ angular.mock.$Browser = function() {
74
74
  self.defer = function(fn, delay) {
75
75
  delay = delay || 0;
76
76
  self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId});
77
- self.deferredFns.sort(function(a,b){ return a.time - b.time;});
77
+ self.deferredFns.sort(function(a, b) { return a.time - b.time;});
78
78
  return self.deferredNextId++;
79
79
  };
80
80
 
@@ -142,7 +142,7 @@ angular.mock.$Browser.prototype = {
142
142
  * run all fns in pollFns
143
143
  */
144
144
  poll: function poll() {
145
- angular.forEach(this.pollFns, function(pollFn){
145
+ angular.forEach(this.pollFns, function(pollFn) {
146
146
  pollFn();
147
147
  });
148
148
  },
@@ -258,7 +258,7 @@ angular.mock.$ExceptionHandlerProvider = function() {
258
258
  * {@link ngMock.$log#reset reset()}
259
259
  */
260
260
  this.mode = function(mode) {
261
- switch(mode) {
261
+ switch (mode) {
262
262
  case 'rethrow':
263
263
  handler = function(e) {
264
264
  throw e;
@@ -316,7 +316,7 @@ angular.mock.$LogProvider = function() {
316
316
  }
317
317
  };
318
318
 
319
- this.$get = function () {
319
+ this.$get = function() {
320
320
  var $log = {
321
321
  log: function() { $log.log.logs.push(concat([], arguments, 0)); },
322
322
  warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },
@@ -336,7 +336,7 @@ angular.mock.$LogProvider = function() {
336
336
  * @description
337
337
  * Reset all of the logging arrays to empty.
338
338
  */
339
- $log.reset = function () {
339
+ $log.reset = function() {
340
340
  /**
341
341
  * @ngdoc property
342
342
  * @name $log#log.logs
@@ -421,7 +421,7 @@ angular.mock.$LogProvider = function() {
421
421
  var errors = [];
422
422
  angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) {
423
423
  angular.forEach($log[logLevel].logs, function(log) {
424
- angular.forEach(log, function (logItem) {
424
+ angular.forEach(log, function(logItem) {
425
425
  errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' +
426
426
  (logItem.stack || ''));
427
427
  });
@@ -504,7 +504,7 @@ angular.mock.$IntervalProvider = function() {
504
504
  id: nextRepeatId,
505
505
  deferred: deferred
506
506
  });
507
- repeatFns.sort(function(a,b){ return a.nextTime - b.nextTime;});
507
+ repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});
508
508
 
509
509
  nextRepeatId++;
510
510
  return promise;
@@ -520,7 +520,7 @@ angular.mock.$IntervalProvider = function() {
520
520
  * @returns {boolean} Returns `true` if the task was successfully cancelled.
521
521
  */
522
522
  $interval.cancel = function(promise) {
523
- if(!promise) return false;
523
+ if (!promise) return false;
524
524
  var fnIndex;
525
525
 
526
526
  angular.forEach(repeatFns, function(fn, index) {
@@ -553,7 +553,7 @@ angular.mock.$IntervalProvider = function() {
553
553
  var task = repeatFns[0];
554
554
  task.fn();
555
555
  task.nextTime += task.delay;
556
- repeatFns.sort(function(a,b){ return a.nextTime - b.nextTime;});
556
+ repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});
557
557
  }
558
558
  return millis;
559
559
  };
@@ -601,7 +601,7 @@ function padNumber(num, digits, trim) {
601
601
  num = -num;
602
602
  }
603
603
  num = '' + num;
604
- while(num.length < digits) num = '0' + num;
604
+ while (num.length < digits) num = '0' + num;
605
605
  if (trim)
606
606
  num = num.substr(num.length - digits);
607
607
  return neg + num;
@@ -645,7 +645,7 @@ function padNumber(num, digits, trim) {
645
645
  * ```
646
646
  *
647
647
  */
648
- angular.mock.TzDate = function (offset, timestamp) {
648
+ angular.mock.TzDate = function(offset, timestamp) {
649
649
  var self = new Date(0);
650
650
  if (angular.isString(timestamp)) {
651
651
  var tsStr = timestamp;
@@ -788,20 +788,20 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
788
788
  $provide.decorator('$animate', ['$delegate', '$$asyncCallback', '$timeout', '$browser',
789
789
  function($delegate, $$asyncCallback, $timeout, $browser) {
790
790
  var animate = {
791
- queue : [],
792
- cancel : $delegate.cancel,
793
- enabled : $delegate.enabled,
794
- triggerCallbackEvents : function() {
791
+ queue: [],
792
+ cancel: $delegate.cancel,
793
+ enabled: $delegate.enabled,
794
+ triggerCallbackEvents: function() {
795
795
  $$asyncCallback.flush();
796
796
  },
797
- triggerCallbackPromise : function() {
797
+ triggerCallbackPromise: function() {
798
798
  $timeout.flush(0);
799
799
  },
800
- triggerCallbacks : function() {
800
+ triggerCallbacks: function() {
801
801
  this.triggerCallbackEvents();
802
802
  this.triggerCallbackPromise();
803
803
  },
804
- triggerReflow : function() {
804
+ triggerReflow: function() {
805
805
  angular.forEach(reflowQueue, function(fn) {
806
806
  fn();
807
807
  });
@@ -813,10 +813,10 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
813
813
  ['animate','enter','leave','move','addClass','removeClass','setClass'], function(method) {
814
814
  animate[method] = function() {
815
815
  animate.queue.push({
816
- event : method,
817
- element : arguments[0],
818
- options : arguments[arguments.length-1],
819
- args : arguments
816
+ event: method,
817
+ element: arguments[0],
818
+ options: arguments[arguments.length-1],
819
+ args: arguments
820
820
  });
821
821
  return $delegate[method].apply($delegate, arguments);
822
822
  };
@@ -883,13 +883,13 @@ angular.mock.dump = function(object) {
883
883
  function serializeScope(scope, offset) {
884
884
  offset = offset || ' ';
885
885
  var log = [offset + 'Scope(' + scope.$id + '): {'];
886
- for ( var key in scope ) {
886
+ for (var key in scope) {
887
887
  if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\$|this)/)) {
888
888
  log.push(' ' + key + ': ' + angular.toJson(scope[key]));
889
889
  }
890
890
  }
891
891
  var child = scope.$$childHead;
892
- while(child) {
892
+ while (child) {
893
893
  log.push(serializeScope(child, offset + ' '));
894
894
  child = child.$$nextSibling;
895
895
  }
@@ -1386,7 +1386,7 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {
1386
1386
  $httpBackend.expect = function(method, url, data, headers) {
1387
1387
  var expectation = new MockHttpExpectation(method, url, data, headers),
1388
1388
  chain = {
1389
- respond: function (status, data, headers, statusText) {
1389
+ respond: function(status, data, headers, statusText) {
1390
1390
  expectation.response = createResponse(status, data, headers, statusText);
1391
1391
  return chain;
1392
1392
  }
@@ -1636,7 +1636,9 @@ function MockHttpExpectation(method, url, data, headers) {
1636
1636
  if (angular.isUndefined(data)) return true;
1637
1637
  if (data && angular.isFunction(data.test)) return data.test(d);
1638
1638
  if (data && angular.isFunction(data)) return data(d);
1639
- if (data && !angular.isString(data)) return angular.equals(data, angular.fromJson(d));
1639
+ if (data && !angular.isString(data)) {
1640
+ return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d));
1641
+ }
1640
1642
  return data == d;
1641
1643
  };
1642
1644
 
@@ -1709,7 +1711,7 @@ function MockXhr() {
1709
1711
  * that adds a "flush" and "verifyNoPendingTasks" methods.
1710
1712
  */
1711
1713
 
1712
- angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function ($delegate, $browser) {
1714
+ angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $browser) {
1713
1715
 
1714
1716
  /**
1715
1717
  * @ngdoc method
@@ -1763,12 +1765,12 @@ angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
1763
1765
  rafFn.supported = $delegate.supported;
1764
1766
 
1765
1767
  rafFn.flush = function() {
1766
- if(queue.length === 0) {
1768
+ if (queue.length === 0) {
1767
1769
  throw new Error('No rAF callbacks present');
1768
1770
  }
1769
1771
 
1770
1772
  var length = queue.length;
1771
- for(var i=0;i<length;i++) {
1773
+ for (var i=0;i<length;i++) {
1772
1774
  queue[i]();
1773
1775
  }
1774
1776
 
@@ -2036,7 +2038,7 @@ angular.mock.e2e.$httpBackendDecorator =
2036
2038
  ['$rootScope', '$delegate', '$browser', createHttpBackendMock];
2037
2039
 
2038
2040
 
2039
- if(window.jasmine || window.mocha) {
2041
+ if (window.jasmine || window.mocha) {
2040
2042
 
2041
2043
  var currentSpec = null,
2042
2044
  isSpecRunning = function() {
@@ -2244,7 +2246,7 @@ if(window.jasmine || window.mocha) {
2244
2246
  injector = currentSpec.$injector = angular.injector(modules, strictDi);
2245
2247
  currentSpec.$injectorStrict = strictDi;
2246
2248
  }
2247
- for(var i = 0, ii = blockFns.length; i < ii; i++) {
2249
+ for (var i = 0, ii = blockFns.length; i < ii; i++) {
2248
2250
  if (currentSpec.$injectorStrict) {
2249
2251
  // If the injector is strict / strictDi, and the spec wants to inject using automatic
2250
2252
  // annotation, then annotate the function here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.3.0
2
+ * @license AngularJS v1.3.1
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -35,7 +35,7 @@ function lookupDottedPath(obj, path) {
35
35
  function shallowClearAndCopy(src, dst) {
36
36
  dst = dst || {};
37
37
 
38
- angular.forEach(dst, function(value, key){
38
+ angular.forEach(dst, function(value, key) {
39
39
  delete dst[key];
40
40
  });
41
41
 
@@ -84,7 +84,7 @@ function shallowClearAndCopy(src, dst) {
84
84
  * this:
85
85
  *
86
86
  * ```js
87
- app.config(['$resourceProvider', function ($resourceProvider) {
87
+ app.config(['$resourceProvider', function($resourceProvider) {
88
88
  // Don't strip trailing slashes from calculated URLs
89
89
  $resourceProvider.defaults.stripTrailingSlashes = false;
90
90
  }]);
@@ -350,7 +350,7 @@ function shallowClearAndCopy(src, dst) {
350
350
  * ```
351
351
  */
352
352
  angular.module('ngResource', ['ng']).
353
- provider('$resource', function () {
353
+ provider('$resource', function() {
354
354
  var provider = this;
355
355
 
356
356
  this.defaults = {
@@ -367,7 +367,7 @@ angular.module('ngResource', ['ng']).
367
367
  }
368
368
  };
369
369
 
370
- this.$get = ['$http', '$q', function ($http, $q) {
370
+ this.$get = ['$http', '$q', function($http, $q) {
371
371
 
372
372
  var noop = angular.noop,
373
373
  forEach = angular.forEach,
@@ -421,14 +421,14 @@ angular.module('ngResource', ['ng']).
421
421
  }
422
422
 
423
423
  Route.prototype = {
424
- setUrlParams: function (config, params, actionUrl) {
424
+ setUrlParams: function(config, params, actionUrl) {
425
425
  var self = this,
426
426
  url = actionUrl || self.template,
427
427
  val,
428
428
  encodedVal;
429
429
 
430
430
  var urlParams = self.urlParams = {};
431
- forEach(url.split(/\W/), function (param) {
431
+ forEach(url.split(/\W/), function(param) {
432
432
  if (param === 'hasOwnProperty') {
433
433
  throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
434
434
  }
@@ -440,15 +440,15 @@ angular.module('ngResource', ['ng']).
440
440
  url = url.replace(/\\:/g, ':');
441
441
 
442
442
  params = params || {};
443
- forEach(self.urlParams, function (_, urlParam) {
443
+ forEach(self.urlParams, function(_, urlParam) {
444
444
  val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
445
445
  if (angular.isDefined(val) && val !== null) {
446
446
  encodedVal = encodeUriSegment(val);
447
- url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function (match, p1) {
447
+ url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
448
448
  return encodedVal + p1;
449
449
  });
450
450
  } else {
451
- url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function (match,
451
+ url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
452
452
  leadingSlashes, tail) {
453
453
  if (tail.charAt(0) == '/') {
454
454
  return tail;
@@ -472,7 +472,7 @@ angular.module('ngResource', ['ng']).
472
472
 
473
473
 
474
474
  // set params - delegate param encoding to $http
475
- forEach(params, function (value, key) {
475
+ forEach(params, function(value, key) {
476
476
  if (!self.urlParams[key]) {
477
477
  config.params = config.params || {};
478
478
  config.params[key] = value;
@@ -490,7 +490,7 @@ angular.module('ngResource', ['ng']).
490
490
  function extractParams(data, actionParams) {
491
491
  var ids = {};
492
492
  actionParams = extend({}, paramDefaults, actionParams);
493
- forEach(actionParams, function (value, key) {
493
+ forEach(actionParams, function(value, key) {
494
494
  if (isFunction(value)) { value = value(); }
495
495
  ids[key] = value && value.charAt && value.charAt(0) == '@' ?
496
496
  lookupDottedPath(data, value.substr(1)) : value;
@@ -506,17 +506,17 @@ angular.module('ngResource', ['ng']).
506
506
  shallowClearAndCopy(value || {}, this);
507
507
  }
508
508
 
509
- Resource.prototype.toJSON = function () {
509
+ Resource.prototype.toJSON = function() {
510
510
  var data = extend({}, this);
511
511
  delete data.$promise;
512
512
  delete data.$resolved;
513
513
  return data;
514
514
  };
515
515
 
516
- forEach(actions, function (action, name) {
516
+ forEach(actions, function(action, name) {
517
517
  var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
518
518
 
519
- Resource[name] = function (a1, a2, a3, a4) {
519
+ Resource[name] = function(a1, a2, a3, a4) {
520
520
  var params = {}, data, success, error;
521
521
 
522
522
  /* jshint -W086 */ /* (purposefully fall through case statements) */
@@ -564,7 +564,7 @@ angular.module('ngResource', ['ng']).
564
564
  var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||
565
565
  undefined;
566
566
 
567
- forEach(action, function (value, key) {
567
+ forEach(action, function(value, key) {
568
568
  if (key != 'params' && key != 'isArray' && key != 'interceptor') {
569
569
  httpConfig[key] = copy(value);
570
570
  }
@@ -575,7 +575,7 @@ angular.module('ngResource', ['ng']).
575
575
  extend({}, extractParams(data, action.params || {}), params),
576
576
  action.url);
577
577
 
578
- var promise = $http(httpConfig).then(function (response) {
578
+ var promise = $http(httpConfig).then(function(response) {
579
579
  var data = response.data,
580
580
  promise = value.$promise;
581
581
 
@@ -591,7 +591,7 @@ angular.module('ngResource', ['ng']).
591
591
  // jshint +W018
592
592
  if (action.isArray) {
593
593
  value.length = 0;
594
- forEach(data, function (item) {
594
+ forEach(data, function(item) {
595
595
  if (typeof item === "object") {
596
596
  value.push(new Resource(item));
597
597
  } else {
@@ -612,7 +612,7 @@ angular.module('ngResource', ['ng']).
612
612
  response.resource = value;
613
613
 
614
614
  return response;
615
- }, function (response) {
615
+ }, function(response) {
616
616
  value.$resolved = true;
617
617
 
618
618
  (error || noop)(response);
@@ -621,7 +621,7 @@ angular.module('ngResource', ['ng']).
621
621
  });
622
622
 
623
623
  promise = promise.then(
624
- function (response) {
624
+ function(response) {
625
625
  var value = responseInterceptor(response);
626
626
  (success || noop)(value, response.headers);
627
627
  return value;
@@ -643,7 +643,7 @@ angular.module('ngResource', ['ng']).
643
643
  };
644
644
 
645
645
 
646
- Resource.prototype['$' + name] = function (params, success, error) {
646
+ Resource.prototype['$' + name] = function(params, success, error) {
647
647
  if (isFunction(params)) {
648
648
  error = success; success = params; params = {};
649
649
  }
@@ -652,7 +652,7 @@ angular.module('ngResource', ['ng']).
652
652
  };
653
653
  });
654
654
 
655
- Resource.bind = function (additionalParamDefaults) {
655
+ Resource.bind = function(additionalParamDefaults) {
656
656
  return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);
657
657
  };
658
658