angular-gem 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.6
2
+ * @license AngularJS v1.2.7
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.6
2
+ * @license AngularJS v1.2.7
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -68,7 +68,7 @@ function minErr(module) {
68
68
  return match;
69
69
  });
70
70
 
71
- message = message + '\nhttp://errors.angularjs.org/1.2.6/' +
71
+ message = message + '\nhttp://errors.angularjs.org/1.2.7/' +
72
72
  (module ? module + '/' : '') + code;
73
73
  for (i = 2; i < arguments.length; i++) {
74
74
  message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -1038,7 +1038,9 @@ function fromJson(json) {
1038
1038
 
1039
1039
 
1040
1040
  function toBoolean(value) {
1041
- if (value && value.length !== 0) {
1041
+ if (typeof value === 'function') {
1042
+ value = true;
1043
+ } else if (value && value.length !== 0) {
1042
1044
  var v = lowercase("" + value);
1043
1045
  value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]');
1044
1046
  } else {
@@ -1831,11 +1833,11 @@ function setupModuleLoader(window) {
1831
1833
  * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
1832
1834
  */
1833
1835
  var version = {
1834
- full: '1.2.6', // all of these placeholder strings will be replaced by grunt's
1836
+ full: '1.2.7', // all of these placeholder strings will be replaced by grunt's
1835
1837
  major: 1, // package task
1836
1838
  minor: 2,
1837
- dot: 6,
1838
- codeName: 'taco-salsafication'
1839
+ dot: 7,
1840
+ codeName: 'emoji-clairvoyance'
1839
1841
  };
1840
1842
 
1841
1843
 
@@ -3663,6 +3665,11 @@ function createInjector(modulesToLoad) {
3663
3665
  path.unshift(serviceName);
3664
3666
  cache[serviceName] = INSTANTIATING;
3665
3667
  return cache[serviceName] = factory(serviceName);
3668
+ } catch (err) {
3669
+ if (cache[serviceName] === INSTANTIATING) {
3670
+ delete cache[serviceName];
3671
+ }
3672
+ throw err;
3666
3673
  } finally {
3667
3674
  path.shift();
3668
3675
  }
@@ -4197,8 +4204,9 @@ function Browser(window, document, $log, $sniffer) {
4197
4204
  * @param {boolean=} replace Should new url replace current history record ?
4198
4205
  */
4199
4206
  self.url = function(url, replace) {
4200
- // Android Browser BFCache causes location reference to become stale.
4207
+ // Android Browser BFCache causes location, history reference to become stale.
4201
4208
  if (location !== window.location) location = window.location;
4209
+ if (history !== window.history) history = window.history;
4202
4210
 
4203
4211
  // setter
4204
4212
  if (url) {
@@ -4250,7 +4258,7 @@ function Browser(window, document, $log, $sniffer) {
4250
4258
  * @description
4251
4259
  * Register callback function that will be called, when url changes.
4252
4260
  *
4253
- * It's only called when the url is changed by outside of angular:
4261
+ * It's only called when the url is changed from outside of angular:
4254
4262
  * - user types different url into address bar
4255
4263
  * - user clicks on history (forward/back) button
4256
4264
  * - user clicks on a link
@@ -4292,7 +4300,7 @@ function Browser(window, document, $log, $sniffer) {
4292
4300
  /**
4293
4301
  * @name ng.$browser#baseHref
4294
4302
  * @methodOf ng.$browser
4295
- *
4303
+ *
4296
4304
  * @description
4297
4305
  * Returns current <base href>
4298
4306
  * (always relative - without domain)
@@ -4301,7 +4309,7 @@ function Browser(window, document, $log, $sniffer) {
4301
4309
  */
4302
4310
  self.baseHref = function() {
4303
4311
  var href = baseElement.attr('href');
4304
- return href ? href.replace(/^https?\:\/\/[^\/]*/, '') : '';
4312
+ return href ? href.replace(/^(https?\:)?\/\/[^\/]*/, '') : '';
4305
4313
  };
4306
4314
 
4307
4315
  //////////////////////////////////////////////////////////////
@@ -4323,13 +4331,13 @@ function Browser(window, document, $log, $sniffer) {
4323
4331
  * It is not meant to be used directly, use the $cookie service instead.
4324
4332
  *
4325
4333
  * The return values vary depending on the arguments that the method was called with as follows:
4326
- *
4334
+ *
4327
4335
  * - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify
4328
4336
  * it
4329
4337
  * - cookies(name, value) -> set name to value, if value is undefined delete the cookie
4330
4338
  * - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that
4331
4339
  * way)
4332
- *
4340
+ *
4333
4341
  * @returns {Object} Hash of all cookies (if called without any parameter)
4334
4342
  */
4335
4343
  self.cookies = function(name, value) {
@@ -4707,7 +4715,7 @@ function $TemplateCacheProvider() {
4707
4715
  * @function
4708
4716
  *
4709
4717
  * @description
4710
- * Compiles a piece of HTML string or DOM into a template and produces a template function, which
4718
+ * Compiles an HTML string or DOM into a template and produces a template function, which
4711
4719
  * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.
4712
4720
  *
4713
4721
  * The compilation is a process of walking the DOM tree and matching DOM elements to
@@ -7049,7 +7057,7 @@ function $HttpProvider() {
7049
7057
  * will result in the success callback being called. Note that if the response is a redirect,
7050
7058
  * XMLHttpRequest will transparently follow it, meaning that the error callback will not be
7051
7059
  * called for such responses.
7052
- *
7060
+ *
7053
7061
  * # Calling $http from outside AngularJS
7054
7062
  * The `$http` service will not actually send the request until the next `$digest()` is
7055
7063
  * executed. Normally this is not an issue, since almost all the time your call to `$http` will
@@ -7236,19 +7244,20 @@ function $HttpProvider() {
7236
7244
  * return responseOrNewPromise
7237
7245
  * }
7238
7246
  * return $q.reject(rejection);
7239
- * };
7240
- * }
7247
+ * }
7248
+ * };
7241
7249
  * });
7242
7250
  *
7243
7251
  * $httpProvider.interceptors.push('myHttpInterceptor');
7244
7252
  *
7245
7253
  *
7246
- * // register the interceptor via an anonymous factory
7254
+ * // alternatively, register the interceptor via an anonymous factory
7247
7255
  * $httpProvider.interceptors.push(function($q, dependency1, dependency2) {
7248
7256
  * return {
7249
7257
  * 'request': function(config) {
7250
7258
  * // same as above
7251
7259
  * },
7260
+ *
7252
7261
  * 'response': function(response) {
7253
7262
  * // same as above
7254
7263
  * }
@@ -7864,13 +7873,13 @@ function $HttpProvider() {
7864
7873
  }];
7865
7874
  }
7866
7875
 
7867
- var XHR = window.XMLHttpRequest || function() {
7876
+ function createXhr(method) {
7877
+ // IE8 doesn't support PATCH method, but the ActiveX object does
7868
7878
  /* global ActiveXObject */
7869
- try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}
7870
- try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {}
7871
- try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {}
7872
- throw minErr('$httpBackend')('noxhr', "This browser does not support XMLHttpRequest.");
7873
- };
7879
+ return (msie <= 8 && lowercase(method) === 'patch')
7880
+ ? new ActiveXObject('Microsoft.XMLHTTP')
7881
+ : new window.XMLHttpRequest();
7882
+ }
7874
7883
 
7875
7884
 
7876
7885
  /**
@@ -7892,11 +7901,11 @@ var XHR = window.XMLHttpRequest || function() {
7892
7901
  */
7893
7902
  function $HttpBackendProvider() {
7894
7903
  this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) {
7895
- return createHttpBackend($browser, XHR, $browser.defer, $window.angular.callbacks, $document[0]);
7904
+ return createHttpBackend($browser, createXhr, $browser.defer, $window.angular.callbacks, $document[0]);
7896
7905
  }];
7897
7906
  }
7898
7907
 
7899
- function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument) {
7908
+ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {
7900
7909
  var ABORTED = -1;
7901
7910
 
7902
7911
  // TODO(vojta): fix the signature
@@ -7921,7 +7930,9 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument)
7921
7930
  delete callbacks[callbackId];
7922
7931
  });
7923
7932
  } else {
7924
- var xhr = new XHR();
7933
+
7934
+ var xhr = createXhr(method);
7935
+
7925
7936
  xhr.open(method, url, true);
7926
7937
  forEach(headers, function(value, key) {
7927
7938
  if (isDefined(value)) {
@@ -7933,7 +7944,14 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument)
7933
7944
  // response is in the cache. the promise api will ensure that to the app code the api is
7934
7945
  // always async
7935
7946
  xhr.onreadystatechange = function() {
7936
- if (xhr.readyState == 4) {
7947
+ // onreadystatechange might by called multiple times with readyState === 4 on mobile webkit caused by
7948
+ // xhrs that are resolved while the app is in the background (see #5426).
7949
+ // since calling completeRequest sets the `xhr` variable to null, we just check if it's not null before
7950
+ // continuing
7951
+ //
7952
+ // we can't set xhr.onreadystatechange to undefined or delete it because that breaks IE8 (method=PATCH) and
7953
+ // Safari respectively.
7954
+ if (xhr && xhr.readyState == 4) {
7937
7955
  var responseHeaders = null,
7938
7956
  response = null;
7939
7957
 
@@ -9180,16 +9198,17 @@ function $LocationProvider(){
9180
9198
  // update $location when $browser url changes
9181
9199
  $browser.onUrlChange(function(newUrl) {
9182
9200
  if ($location.absUrl() != newUrl) {
9183
- if ($rootScope.$broadcast('$locationChangeStart', newUrl,
9184
- $location.absUrl()).defaultPrevented) {
9185
- $browser.url($location.absUrl());
9186
- return;
9187
- }
9188
9201
  $rootScope.$evalAsync(function() {
9189
9202
  var oldUrl = $location.absUrl();
9190
9203
 
9191
9204
  $location.$$parse(newUrl);
9192
- afterLocationChange(oldUrl);
9205
+ if ($rootScope.$broadcast('$locationChangeStart', newUrl,
9206
+ oldUrl).defaultPrevented) {
9207
+ $location.$$parse(oldUrl);
9208
+ $browser.url(oldUrl);
9209
+ } else {
9210
+ afterLocationChange(oldUrl);
9211
+ }
9193
9212
  });
9194
9213
  if (!$rootScope.$$phase) $rootScope.$digest();
9195
9214
  }
@@ -11299,6 +11318,7 @@ function $RootScopeProvider(){
11299
11318
  this.$$asyncQueue = [];
11300
11319
  this.$$postDigestQueue = [];
11301
11320
  this.$$listeners = {};
11321
+ this.$$listenerCount = {};
11302
11322
  this.$$isolateBindings = {};
11303
11323
  }
11304
11324
 
@@ -11358,6 +11378,7 @@ function $RootScopeProvider(){
11358
11378
  }
11359
11379
  child['this'] = child;
11360
11380
  child.$$listeners = {};
11381
+ child.$$listenerCount = {};
11361
11382
  child.$parent = this;
11362
11383
  child.$$watchers = child.$$nextSibling = child.$$childHead = child.$$childTail = null;
11363
11384
  child.$$prevSibling = this.$$childTail;
@@ -11517,6 +11538,7 @@ function $RootScopeProvider(){
11517
11538
 
11518
11539
  return function() {
11519
11540
  arrayRemove(array, watcher);
11541
+ lastDirtyWatch = null;
11520
11542
  };
11521
11543
  },
11522
11544
 
@@ -11862,6 +11884,8 @@ function $RootScopeProvider(){
11862
11884
  this.$$destroyed = true;
11863
11885
  if (this === $rootScope) return;
11864
11886
 
11887
+ forEach(this.$$listenerCount, bind(null, decrementListenerCount, this));
11888
+
11865
11889
  if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
11866
11890
  if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
11867
11891
  if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
@@ -12051,8 +12075,18 @@ function $RootScopeProvider(){
12051
12075
  }
12052
12076
  namedListeners.push(listener);
12053
12077
 
12078
+ var current = this;
12079
+ do {
12080
+ if (!current.$$listenerCount[name]) {
12081
+ current.$$listenerCount[name] = 0;
12082
+ }
12083
+ current.$$listenerCount[name]++;
12084
+ } while ((current = current.$parent));
12085
+
12086
+ var self = this;
12054
12087
  return function() {
12055
12088
  namedListeners[indexOf(namedListeners, listener)] = null;
12089
+ decrementListenerCount(self, 1, name);
12056
12090
  };
12057
12091
  },
12058
12092
 
@@ -12164,8 +12198,7 @@ function $RootScopeProvider(){
12164
12198
  listeners, i, length;
12165
12199
 
12166
12200
  //down while you can, then up and next sibling or up and next sibling until back at root
12167
- do {
12168
- current = next;
12201
+ while ((current = next)) {
12169
12202
  event.currentScope = current;
12170
12203
  listeners = current.$$listeners[name] || [];
12171
12204
  for (i=0, length = listeners.length; i<length; i++) {
@@ -12187,12 +12220,14 @@ function $RootScopeProvider(){
12187
12220
  // Insanity Warning: scope depth-first traversal
12188
12221
  // yes, this code is a bit crazy, but it works and we have tests to prove it!
12189
12222
  // this piece should be kept in sync with the traversal in $digest
12190
- if (!(next = (current.$$childHead || (current !== target && current.$$nextSibling)))) {
12223
+ // (though it differs due to having the extra check for $$listenerCount)
12224
+ if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||
12225
+ (current !== target && current.$$nextSibling)))) {
12191
12226
  while(current !== target && !(next = current.$$nextSibling)) {
12192
12227
  current = current.$parent;
12193
12228
  }
12194
12229
  }
12195
- } while ((current = next));
12230
+ }
12196
12231
 
12197
12232
  return event;
12198
12233
  }
@@ -12221,6 +12256,16 @@ function $RootScopeProvider(){
12221
12256
  return fn;
12222
12257
  }
12223
12258
 
12259
+ function decrementListenerCount(current, count, name) {
12260
+ do {
12261
+ current.$$listenerCount[name] -= count;
12262
+
12263
+ if (current.$$listenerCount[name] === 0) {
12264
+ delete current.$$listenerCount[name];
12265
+ }
12266
+ } while ((current = current.$parent));
12267
+ }
12268
+
12224
12269
  /**
12225
12270
  * function used as an initial value for watchers.
12226
12271
  * because it's unique we can easily tell it apart from other values
@@ -13439,7 +13484,7 @@ function $SnifferProvider() {
13439
13484
  // http://code.google.com/p/android/issues/detail?id=17471
13440
13485
  // https://github.com/angular/angular.js/issues/904
13441
13486
 
13442
- // older webit browser (533.9) on Boxee box has exactly the same problem as Android has
13487
+ // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has
13443
13488
  // so let's not use the history API also
13444
13489
  // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined
13445
13490
  // jshint -W018
@@ -13861,21 +13906,21 @@ function $FilterProvider($provide) {
13861
13906
  * property of the object. That's equivalent to the simple substring match with a `string`
13862
13907
  * as described above.
13863
13908
  *
13864
- * - `function`: A predicate function can be used to write arbitrary filters. The function is
13909
+ * - `function(value)`: A predicate function can be used to write arbitrary filters. The function is
13865
13910
  * called for each element of `array`. The final result is an array of those elements that
13866
13911
  * the predicate returned true for.
13867
13912
  *
13868
- * @param {function(expected, actual)|true|undefined} comparator Comparator which is used in
13913
+ * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in
13869
13914
  * determining if the expected value (from the filter expression) and actual value (from
13870
13915
  * the object in the array) should be considered a match.
13871
13916
  *
13872
13917
  * Can be one of:
13873
13918
  *
13874
- * - `function(expected, actual)`:
13919
+ * - `function(actual, expected)`:
13875
13920
  * The function will be given the object value and the predicate value to compare and
13876
13921
  * should return true if the item should be included in filtered result.
13877
13922
  *
13878
- * - `true`: A shorthand for `function(expected, actual) { return angular.equals(expected, actual)}`.
13923
+ * - `true`: A shorthand for `function(actual, expected) { return angular.equals(expected, actual)}`.
13879
13924
  * this is essentially strict comparison of expected and actual.
13880
13925
  *
13881
13926
  * - `false|undefined`: A short hand for a function which will look for a substring match in case
@@ -15980,9 +16025,13 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
15980
16025
  }
15981
16026
 
15982
16027
  if (ctrl.$viewValue !== value) {
15983
- scope.$apply(function() {
16028
+ if (scope.$$phase) {
15984
16029
  ctrl.$setViewValue(value);
15985
- });
16030
+ } else {
16031
+ scope.$apply(function() {
16032
+ ctrl.$setViewValue(value);
16033
+ });
16034
+ }
15986
16035
  }
15987
16036
  };
15988
16037
 
@@ -19061,7 +19110,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
19061
19110
  $$tlb: true,
19062
19111
  link: function($scope, $element, $attr, ctrl, $transclude){
19063
19112
  var expression = $attr.ngRepeat;
19064
- var match = expression.match(/^\s*(.+)\s+in\s+([\r\n\s\S]*?)\s*(\s+track\s+by\s+(.+)\s*)?$/),
19113
+ var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),
19065
19114
  trackByExp, trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn,
19066
19115
  lhs, rhs, valueIdentifier, keyIdentifier,
19067
19116
  hashFnLocals = {$id: hashKey};
@@ -19073,7 +19122,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
19073
19122
 
19074
19123
  lhs = match[1];
19075
19124
  rhs = match[2];
19076
- trackByExp = match[4];
19125
+ trackByExp = match[3];
19077
19126
 
19078
19127
  if (trackByExp) {
19079
19128
  trackByExpGetter = $parse(trackByExp);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -802,6 +802,16 @@ files:
802
802
  - vendor/assets/javascripts/1.2.6/angular-scenario.js
803
803
  - vendor/assets/javascripts/1.2.6/angular-touch.js
804
804
  - vendor/assets/javascripts/1.2.6/angular.js
805
+ - vendor/assets/javascripts/1.2.7/angular-animate.js
806
+ - vendor/assets/javascripts/1.2.7/angular-cookies.js
807
+ - vendor/assets/javascripts/1.2.7/angular-loader.js
808
+ - vendor/assets/javascripts/1.2.7/angular-mocks.js
809
+ - vendor/assets/javascripts/1.2.7/angular-resource.js
810
+ - vendor/assets/javascripts/1.2.7/angular-route.js
811
+ - vendor/assets/javascripts/1.2.7/angular-sanitize.js
812
+ - vendor/assets/javascripts/1.2.7/angular-scenario.js
813
+ - vendor/assets/javascripts/1.2.7/angular-touch.js
814
+ - vendor/assets/javascripts/1.2.7/angular.js
805
815
  - vendor/assets/javascripts/angular-animate.js
806
816
  - vendor/assets/javascripts/angular-cookies.js
807
817
  - vendor/assets/javascripts/angular-loader.js