angular-gem 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license AngularJS v1.2.2
3
- * (c) 2010-2012 Google, Inc. http://angularjs.org
2
+ * @license AngularJS v1.2.3
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
6
6
  (function(window, angular, undefined) {'use strict';
@@ -269,9 +269,16 @@ angular.module('ngAnimate', ['ng'])
269
269
 
270
270
  $rootElement.data(NG_ANIMATE_STATE, rootAnimateState);
271
271
 
272
- // disable animations during bootstrap, but once we bootstrapped, enable animations
272
+ // disable animations during bootstrap, but once we bootstrapped, wait again
273
+ // for another digest until enabling animations. The reason why we digest twice
274
+ // is because all structural animations (enter, leave and move) all perform a
275
+ // post digest operation before animating. If we only wait for a single digest
276
+ // to pass then the structural animation would render its animation on page load.
277
+ // (which is what we're trying to avoid when the application first boots up.)
273
278
  $rootScope.$$postDigest(function() {
274
- rootAnimateState.running = false;
279
+ $rootScope.$$postDigest(function() {
280
+ rootAnimateState.running = false;
281
+ });
275
282
  });
276
283
 
277
284
  function lookup(name) {
@@ -1038,7 +1045,10 @@ angular.module('ngAnimate', ['ng'])
1038
1045
  }
1039
1046
 
1040
1047
  function unblockKeyframeAnimations(element) {
1041
- element[0].style[ANIMATION_PROP] = '';
1048
+ var node = element[0], prop = ANIMATION_PROP;
1049
+ if(node.style[prop] && node.style[prop].length > 0) {
1050
+ element[0].style[prop] = '';
1051
+ }
1042
1052
  }
1043
1053
 
1044
1054
  function animateRun(element, className, activeAnimationComplete) {
@@ -1069,8 +1079,6 @@ angular.module('ngAnimate', ['ng'])
1069
1079
  appliedStyles.push(CSS_PREFIX + 'transition-property');
1070
1080
  appliedStyles.push(CSS_PREFIX + 'transition-duration');
1071
1081
  }
1072
- } else {
1073
- unblockKeyframeAnimations(element);
1074
1082
  }
1075
1083
 
1076
1084
  if(ii > 0) {
@@ -1173,6 +1181,7 @@ angular.module('ngAnimate', ['ng'])
1173
1181
  var cancel = preReflowCancellation;
1174
1182
  afterReflow(function() {
1175
1183
  unblockTransitions(element);
1184
+ unblockKeyframeAnimations(element);
1176
1185
  //once the reflow is complete then we point cancel to
1177
1186
  //the new cancellation function which will remove all of the
1178
1187
  //animation properties from the active animation
@@ -1238,6 +1247,7 @@ angular.module('ngAnimate', ['ng'])
1238
1247
  if(cancellationMethod) {
1239
1248
  afterReflow(function() {
1240
1249
  unblockTransitions(element);
1250
+ unblockKeyframeAnimations(element);
1241
1251
  animationCompleted();
1242
1252
  });
1243
1253
  return cancellationMethod;
@@ -1254,6 +1264,7 @@ angular.module('ngAnimate', ['ng'])
1254
1264
  if(cancellationMethod) {
1255
1265
  afterReflow(function() {
1256
1266
  unblockTransitions(element);
1267
+ unblockKeyframeAnimations(element);
1257
1268
  animationCompleted();
1258
1269
  });
1259
1270
  return cancellationMethod;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license AngularJS v1.2.2
3
- * (c) 2010-2012 Google, Inc. http://angularjs.org
2
+ * @license AngularJS v1.2.3
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
6
6
  (function(window, angular, undefined) {'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license AngularJS v1.2.2
3
- * (c) 2010-2012 Google, Inc. http://angularjs.org
2
+ * @license AngularJS v1.2.3
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
6
6
 
@@ -69,7 +69,7 @@ function minErr(module) {
69
69
  return match;
70
70
  });
71
71
 
72
- message = message + '\nhttp://errors.angularjs.org/1.2.2/' +
72
+ message = message + '\nhttp://errors.angularjs.org/1.2.3/' +
73
73
  (module ? module + '/' : '') + code;
74
74
  for (i = 2; i < arguments.length; i++) {
75
75
  message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -1,12 +1,11 @@
1
- 'use strict';
2
-
3
1
  /**
4
- * @license AngularJS v1.2.2
5
- * (c) 2010-2012 Google, Inc. http://angularjs.org
2
+ * @license AngularJS v1.2.3
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
6
4
  * License: MIT
7
- *
8
- * TODO(vojta): wrap whole file into closure during build
9
5
  */
6
+ (function(window, angular, undefined) {
7
+
8
+ 'use strict';
10
9
 
11
10
  /**
12
11
  * @ngdoc overview
@@ -560,210 +559,208 @@ angular.mock.$IntervalProvider = function() {
560
559
  * This directive should go inside the anonymous function but a bug in JSHint means that it would
561
560
  * not be enacted early enough to prevent the warning.
562
561
  */
563
- (function() {
564
- var R_ISO8061_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/;
565
-
566
- function jsonStringToDate(string) {
567
- var match;
568
- if (match = string.match(R_ISO8061_STR)) {
569
- var date = new Date(0),
570
- tzHour = 0,
571
- tzMin = 0;
572
- if (match[9]) {
573
- tzHour = int(match[9] + match[10]);
574
- tzMin = int(match[9] + match[11]);
575
- }
576
- date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3]));
577
- date.setUTCHours(int(match[4]||0) - tzHour,
578
- int(match[5]||0) - tzMin,
579
- int(match[6]||0),
580
- int(match[7]||0));
581
- return date;
562
+ var R_ISO8061_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/;
563
+
564
+ function jsonStringToDate(string) {
565
+ var match;
566
+ if (match = string.match(R_ISO8061_STR)) {
567
+ var date = new Date(0),
568
+ tzHour = 0,
569
+ tzMin = 0;
570
+ if (match[9]) {
571
+ tzHour = int(match[9] + match[10]);
572
+ tzMin = int(match[9] + match[11]);
582
573
  }
583
- return string;
574
+ date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3]));
575
+ date.setUTCHours(int(match[4]||0) - tzHour,
576
+ int(match[5]||0) - tzMin,
577
+ int(match[6]||0),
578
+ int(match[7]||0));
579
+ return date;
584
580
  }
581
+ return string;
582
+ }
583
+
584
+ function int(str) {
585
+ return parseInt(str, 10);
586
+ }
585
587
 
586
- function int(str) {
587
- return parseInt(str, 10);
588
+ function padNumber(num, digits, trim) {
589
+ var neg = '';
590
+ if (num < 0) {
591
+ neg = '-';
592
+ num = -num;
588
593
  }
594
+ num = '' + num;
595
+ while(num.length < digits) num = '0' + num;
596
+ if (trim)
597
+ num = num.substr(num.length - digits);
598
+ return neg + num;
599
+ }
589
600
 
590
- function padNumber(num, digits, trim) {
591
- var neg = '';
592
- if (num < 0) {
593
- neg = '-';
594
- num = -num;
595
- }
596
- num = '' + num;
597
- while(num.length < digits) num = '0' + num;
598
- if (trim)
599
- num = num.substr(num.length - digits);
600
- return neg + num;
601
+
602
+ /**
603
+ * @ngdoc object
604
+ * @name angular.mock.TzDate
605
+ * @description
606
+ *
607
+ * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`.
608
+ *
609
+ * Mock of the Date type which has its timezone specified via constructor arg.
610
+ *
611
+ * The main purpose is to create Date-like instances with timezone fixed to the specified timezone
612
+ * offset, so that we can test code that depends on local timezone settings without dependency on
613
+ * the time zone settings of the machine where the code is running.
614
+ *
615
+ * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored)
616
+ * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC*
617
+ *
618
+ * @example
619
+ * !!!! WARNING !!!!!
620
+ * This is not a complete Date object so only methods that were implemented can be called safely.
621
+ * To make matters worse, TzDate instances inherit stuff from Date via a prototype.
622
+ *
623
+ * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is
624
+ * incomplete we might be missing some non-standard methods. This can result in errors like:
625
+ * "Date.prototype.foo called on incompatible Object".
626
+ *
627
+ * <pre>
628
+ * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');
629
+ * newYearInBratislava.getTimezoneOffset() => -60;
630
+ * newYearInBratislava.getFullYear() => 2010;
631
+ * newYearInBratislava.getMonth() => 0;
632
+ * newYearInBratislava.getDate() => 1;
633
+ * newYearInBratislava.getHours() => 0;
634
+ * newYearInBratislava.getMinutes() => 0;
635
+ * newYearInBratislava.getSeconds() => 0;
636
+ * </pre>
637
+ *
638
+ */
639
+ angular.mock.TzDate = function (offset, timestamp) {
640
+ var self = new Date(0);
641
+ if (angular.isString(timestamp)) {
642
+ var tsStr = timestamp;
643
+
644
+ self.origDate = jsonStringToDate(timestamp);
645
+
646
+ timestamp = self.origDate.getTime();
647
+ if (isNaN(timestamp))
648
+ throw {
649
+ name: "Illegal Argument",
650
+ message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string"
651
+ };
652
+ } else {
653
+ self.origDate = new Date(timestamp);
601
654
  }
602
655
 
656
+ var localOffset = new Date(timestamp).getTimezoneOffset();
657
+ self.offsetDiff = localOffset*60*1000 - offset*1000*60*60;
658
+ self.date = new Date(timestamp + self.offsetDiff);
603
659
 
604
- /**
605
- * @ngdoc object
606
- * @name angular.mock.TzDate
607
- * @description
608
- *
609
- * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`.
610
- *
611
- * Mock of the Date type which has its timezone specified via constructor arg.
612
- *
613
- * The main purpose is to create Date-like instances with timezone fixed to the specified timezone
614
- * offset, so that we can test code that depends on local timezone settings without dependency on
615
- * the time zone settings of the machine where the code is running.
616
- *
617
- * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored)
618
- * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC*
619
- *
620
- * @example
621
- * !!!! WARNING !!!!!
622
- * This is not a complete Date object so only methods that were implemented can be called safely.
623
- * To make matters worse, TzDate instances inherit stuff from Date via a prototype.
624
- *
625
- * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is
626
- * incomplete we might be missing some non-standard methods. This can result in errors like:
627
- * "Date.prototype.foo called on incompatible Object".
628
- *
629
- * <pre>
630
- * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');
631
- * newYearInBratislava.getTimezoneOffset() => -60;
632
- * newYearInBratislava.getFullYear() => 2010;
633
- * newYearInBratislava.getMonth() => 0;
634
- * newYearInBratislava.getDate() => 1;
635
- * newYearInBratislava.getHours() => 0;
636
- * newYearInBratislava.getMinutes() => 0;
637
- * newYearInBratislava.getSeconds() => 0;
638
- * </pre>
639
- *
640
- */
641
- angular.mock.TzDate = function (offset, timestamp) {
642
- var self = new Date(0);
643
- if (angular.isString(timestamp)) {
644
- var tsStr = timestamp;
645
-
646
- self.origDate = jsonStringToDate(timestamp);
647
-
648
- timestamp = self.origDate.getTime();
649
- if (isNaN(timestamp))
650
- throw {
651
- name: "Illegal Argument",
652
- message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string"
653
- };
654
- } else {
655
- self.origDate = new Date(timestamp);
656
- }
660
+ self.getTime = function() {
661
+ return self.date.getTime() - self.offsetDiff;
662
+ };
657
663
 
658
- var localOffset = new Date(timestamp).getTimezoneOffset();
659
- self.offsetDiff = localOffset*60*1000 - offset*1000*60*60;
660
- self.date = new Date(timestamp + self.offsetDiff);
664
+ self.toLocaleDateString = function() {
665
+ return self.date.toLocaleDateString();
666
+ };
661
667
 
662
- self.getTime = function() {
663
- return self.date.getTime() - self.offsetDiff;
664
- };
668
+ self.getFullYear = function() {
669
+ return self.date.getFullYear();
670
+ };
665
671
 
666
- self.toLocaleDateString = function() {
667
- return self.date.toLocaleDateString();
668
- };
672
+ self.getMonth = function() {
673
+ return self.date.getMonth();
674
+ };
669
675
 
670
- self.getFullYear = function() {
671
- return self.date.getFullYear();
672
- };
676
+ self.getDate = function() {
677
+ return self.date.getDate();
678
+ };
673
679
 
674
- self.getMonth = function() {
675
- return self.date.getMonth();
676
- };
680
+ self.getHours = function() {
681
+ return self.date.getHours();
682
+ };
677
683
 
678
- self.getDate = function() {
679
- return self.date.getDate();
680
- };
684
+ self.getMinutes = function() {
685
+ return self.date.getMinutes();
686
+ };
681
687
 
682
- self.getHours = function() {
683
- return self.date.getHours();
684
- };
688
+ self.getSeconds = function() {
689
+ return self.date.getSeconds();
690
+ };
685
691
 
686
- self.getMinutes = function() {
687
- return self.date.getMinutes();
688
- };
692
+ self.getMilliseconds = function() {
693
+ return self.date.getMilliseconds();
694
+ };
689
695
 
690
- self.getSeconds = function() {
691
- return self.date.getSeconds();
692
- };
696
+ self.getTimezoneOffset = function() {
697
+ return offset * 60;
698
+ };
693
699
 
694
- self.getMilliseconds = function() {
695
- return self.date.getMilliseconds();
696
- };
700
+ self.getUTCFullYear = function() {
701
+ return self.origDate.getUTCFullYear();
702
+ };
697
703
 
698
- self.getTimezoneOffset = function() {
699
- return offset * 60;
700
- };
704
+ self.getUTCMonth = function() {
705
+ return self.origDate.getUTCMonth();
706
+ };
701
707
 
702
- self.getUTCFullYear = function() {
703
- return self.origDate.getUTCFullYear();
704
- };
708
+ self.getUTCDate = function() {
709
+ return self.origDate.getUTCDate();
710
+ };
705
711
 
706
- self.getUTCMonth = function() {
707
- return self.origDate.getUTCMonth();
708
- };
712
+ self.getUTCHours = function() {
713
+ return self.origDate.getUTCHours();
714
+ };
709
715
 
710
- self.getUTCDate = function() {
711
- return self.origDate.getUTCDate();
712
- };
716
+ self.getUTCMinutes = function() {
717
+ return self.origDate.getUTCMinutes();
718
+ };
713
719
 
714
- self.getUTCHours = function() {
715
- return self.origDate.getUTCHours();
716
- };
720
+ self.getUTCSeconds = function() {
721
+ return self.origDate.getUTCSeconds();
722
+ };
717
723
 
718
- self.getUTCMinutes = function() {
719
- return self.origDate.getUTCMinutes();
720
- };
724
+ self.getUTCMilliseconds = function() {
725
+ return self.origDate.getUTCMilliseconds();
726
+ };
721
727
 
722
- self.getUTCSeconds = function() {
723
- return self.origDate.getUTCSeconds();
724
- };
728
+ self.getDay = function() {
729
+ return self.date.getDay();
730
+ };
725
731
 
726
- self.getUTCMilliseconds = function() {
727
- return self.origDate.getUTCMilliseconds();
732
+ // provide this method only on browsers that already have it
733
+ if (self.toISOString) {
734
+ self.toISOString = function() {
735
+ return padNumber(self.origDate.getUTCFullYear(), 4) + '-' +
736
+ padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' +
737
+ padNumber(self.origDate.getUTCDate(), 2) + 'T' +
738
+ padNumber(self.origDate.getUTCHours(), 2) + ':' +
739
+ padNumber(self.origDate.getUTCMinutes(), 2) + ':' +
740
+ padNumber(self.origDate.getUTCSeconds(), 2) + '.' +
741
+ padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z';
728
742
  };
743
+ }
729
744
 
730
- self.getDay = function() {
731
- return self.date.getDay();
745
+ //hide all methods not implemented in this mock that the Date prototype exposes
746
+ var unimplementedMethods = ['getUTCDay',
747
+ 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',
748
+ 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',
749
+ 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds',
750
+ 'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString',
751
+ 'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];
752
+
753
+ angular.forEach(unimplementedMethods, function(methodName) {
754
+ self[methodName] = function() {
755
+ throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock");
732
756
  };
757
+ });
733
758
 
734
- // provide this method only on browsers that already have it
735
- if (self.toISOString) {
736
- self.toISOString = function() {
737
- return padNumber(self.origDate.getUTCFullYear(), 4) + '-' +
738
- padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' +
739
- padNumber(self.origDate.getUTCDate(), 2) + 'T' +
740
- padNumber(self.origDate.getUTCHours(), 2) + ':' +
741
- padNumber(self.origDate.getUTCMinutes(), 2) + ':' +
742
- padNumber(self.origDate.getUTCSeconds(), 2) + '.' +
743
- padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z';
744
- };
745
- }
746
-
747
- //hide all methods not implemented in this mock that the Date prototype exposes
748
- var unimplementedMethods = ['getUTCDay',
749
- 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',
750
- 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',
751
- 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds',
752
- 'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString',
753
- 'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];
754
-
755
- angular.forEach(unimplementedMethods, function(methodName) {
756
- self[methodName] = function() {
757
- throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock");
758
- };
759
- });
760
-
761
- return self;
762
- };
759
+ return self;
760
+ };
763
761
 
764
- //make "tzDateInstance instanceof Date" return true
765
- angular.mock.TzDate.prototype = Date.prototype;
766
- })();
762
+ //make "tzDateInstance instanceof Date" return true
763
+ angular.mock.TzDate.prototype = Date.prototype;
767
764
  /* jshint +W101 */
768
765
 
769
766
  angular.mock.animate = angular.module('mock.animate', ['ng'])
@@ -1919,9 +1916,13 @@ angular.mock.clearDataCache = function() {
1919
1916
 
1920
1917
 
1921
1918
 
1922
- (window.jasmine || window.mocha) && (function(window) {
1919
+ if(window.jasmine || window.mocha) {
1920
+
1921
+ var currentSpec = null,
1922
+ isSpecRunning = function() {
1923
+ return currentSpec && (window.mocha || currentSpec.queue.running);
1924
+ };
1923
1925
 
1924
- var currentSpec = null;
1925
1926
 
1926
1927
  beforeEach(function() {
1927
1928
  currentSpec = this;
@@ -1954,10 +1955,6 @@ angular.mock.clearDataCache = function() {
1954
1955
  angular.callbacks.counter = 0;
1955
1956
  });
1956
1957
 
1957
- function isSpecRunning() {
1958
- return currentSpec && (window.mocha || currentSpec.queue.running);
1959
- }
1960
-
1961
1958
  /**
1962
1959
  * @ngdoc function
1963
1960
  * @name angular.mock.module
@@ -2112,4 +2109,7 @@ angular.mock.clearDataCache = function() {
2112
2109
  }
2113
2110
  }
2114
2111
  };
2115
- })(window);
2112
+ }
2113
+
2114
+
2115
+ })(window, window.angular);
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license AngularJS v1.2.2
3
- * (c) 2010-2012 Google, Inc. http://angularjs.org
2
+ * @license AngularJS v1.2.3
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
6
6
  (function(window, angular, undefined) {'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license AngularJS v1.2.2
3
- * (c) 2010-2012 Google, Inc. http://angularjs.org
2
+ * @license AngularJS v1.2.3
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
6
6
  (function(window, angular, undefined) {'use strict';