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
@@ -0,0 +1,250 @@
1
+ /**
2
+ * @license AngularJS v1.3.1
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
+ * License: MIT
5
+ */
6
+ (function(window, angular, undefined) {'use strict';
7
+
8
+ /**
9
+ * @ngdoc module
10
+ * @name ngAria
11
+ * @description
12
+ *
13
+ * The `ngAria` module provides support for adding <abbr title="Accessible Rich Internet Applications">ARIA</abbr>
14
+ * attributes that convey state or semantic information about the application in order to allow assistive technologies
15
+ * to convey appropriate information to persons with disabilities.
16
+ *
17
+ * <div doc-module-components="ngAria"></div>
18
+ *
19
+ * # Usage
20
+ * To enable the addition of the ARIA tags, just require the module into your application and the tags will
21
+ * hook into your ng-show/ng-hide, input, textarea, button, select and ng-required directives and adds the
22
+ * appropriate ARIA attributes.
23
+ *
24
+ * Currently, the following ARIA attributes are implemented:
25
+ *
26
+ * + aria-hidden
27
+ * + aria-checked
28
+ * + aria-disabled
29
+ * + aria-required
30
+ * + aria-invalid
31
+ * + aria-multiline
32
+ * + aria-valuenow
33
+ * + aria-valuemin
34
+ * + aria-valuemax
35
+ * + tabindex
36
+ *
37
+ * You can disable individual ARIA attributes by using the {@link ngAria.$ariaProvider#config config} method.
38
+ */
39
+
40
+ /* global -ngAriaModule */
41
+ var ngAriaModule = angular.module('ngAria', ['ng']).
42
+ provider('$aria', $AriaProvider);
43
+
44
+ /**
45
+ * @ngdoc provider
46
+ * @name $ariaProvider
47
+ *
48
+ * @description
49
+ *
50
+ * Used for configuring ARIA attributes.
51
+ *
52
+ * ## Dependencies
53
+ * Requires the {@link ngAria} module to be installed.
54
+ */
55
+ function $AriaProvider() {
56
+ var config = {
57
+ ariaHidden: true,
58
+ ariaChecked: true,
59
+ ariaDisabled: true,
60
+ ariaRequired: true,
61
+ ariaInvalid: true,
62
+ ariaMultiline: true,
63
+ ariaValue: true,
64
+ tabindex: true
65
+ };
66
+
67
+ /**
68
+ * @ngdoc method
69
+ * @name $ariaProvider#config
70
+ *
71
+ * @param {object} config object to enable/disable specific ARIA attributes
72
+ *
73
+ * - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags
74
+ * - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags
75
+ * - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags
76
+ * - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags
77
+ * - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags
78
+ * - **ariaMultiline** – `{boolean}` – Enables/disables aria-multiline tags
79
+ * - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and aria-valuenow tags
80
+ * - **tabindex** – `{boolean}` – Enables/disables tabindex tags
81
+ *
82
+ * @description
83
+ * Enables/disables various ARIA attributes
84
+ */
85
+ this.config = function(newConfig) {
86
+ config = angular.extend(config, newConfig);
87
+ };
88
+
89
+ function camelCase(input) {
90
+ return input.replace(/-./g, function(letter, pos) {
91
+ return letter[1].toUpperCase();
92
+ });
93
+ }
94
+
95
+
96
+ function watchExpr(attrName, ariaAttr, negate) {
97
+ var ariaCamelName = camelCase(ariaAttr);
98
+ return function(scope, elem, attr) {
99
+ if (config[ariaCamelName] && !attr[ariaCamelName]) {
100
+ scope.$watch(attr[attrName], function(boolVal) {
101
+ if (negate) {
102
+ boolVal = !boolVal;
103
+ }
104
+ elem.attr(ariaAttr, boolVal);
105
+ });
106
+ }
107
+ };
108
+ }
109
+
110
+ /**
111
+ * @ngdoc service
112
+ * @name $aria
113
+ *
114
+ * @description
115
+ *
116
+ * Contains helper methods for applying ARIA attributes to HTML
117
+ *
118
+ * ## Dependencies
119
+ * Requires the {@link ngAria} module to be installed.
120
+ */
121
+ this.$get = function() {
122
+ return {
123
+ config: function(key) {
124
+ return config[camelCase(key)];
125
+ },
126
+ $$watchExpr: watchExpr
127
+ };
128
+ };
129
+ }
130
+
131
+ var ngAriaTabindex = ['$aria', function($aria) {
132
+ return function(scope, elem, attr) {
133
+ if ($aria.config('tabindex') && !elem.attr('tabindex')) {
134
+ elem.attr('tabindex', 0);
135
+ }
136
+ };
137
+ }];
138
+
139
+ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
140
+ return $aria.$$watchExpr('ngShow', 'aria-hidden', true);
141
+ }])
142
+ .directive('ngHide', ['$aria', function($aria) {
143
+ return $aria.$$watchExpr('ngHide', 'aria-hidden', false);
144
+ }])
145
+ .directive('ngModel', ['$aria', function($aria) {
146
+
147
+ function shouldAttachAttr(attr, elem) {
148
+ return $aria.config(attr) && !elem.attr(attr);
149
+ }
150
+
151
+ function getShape(attr, elem) {
152
+ var type = attr.type,
153
+ role = attr.role;
154
+
155
+ return ((type || role) === 'checkbox' || role === 'menuitemcheckbox') ? 'checkbox' :
156
+ ((type || role) === 'radio' || role === 'menuitemradio') ? 'radio' :
157
+ (type === 'range' || role === 'progressbar' || role === 'slider') ? 'range' :
158
+ (type || role) === 'textbox' || elem[0].nodeName === 'TEXTAREA' ? 'multiline' : '';
159
+ }
160
+
161
+ return {
162
+ restrict: 'A',
163
+ require: '?ngModel',
164
+ link: function(scope, elem, attr, ngModel) {
165
+ var shape = getShape(attr, elem);
166
+ var needsTabIndex = shouldAttachAttr('tabindex', elem);
167
+
168
+ function ngAriaWatchModelValue() {
169
+ return ngModel.$modelValue;
170
+ }
171
+
172
+ function getRadioReaction() {
173
+ if (needsTabIndex) {
174
+ needsTabIndex = false;
175
+ return function ngAriaRadioReaction(newVal) {
176
+ var boolVal = newVal === attr.value;
177
+ elem.attr('aria-checked', boolVal);
178
+ elem.attr('tabindex', 0 - !boolVal);
179
+ };
180
+ } else {
181
+ return function ngAriaRadioReaction(newVal) {
182
+ elem.attr('aria-checked', newVal === attr.value);
183
+ };
184
+ }
185
+ }
186
+
187
+ function ngAriaCheckboxReaction(newVal) {
188
+ elem.attr('aria-checked', !!newVal);
189
+ }
190
+
191
+ switch (shape) {
192
+ case 'radio':
193
+ case 'checkbox':
194
+ if (shouldAttachAttr('aria-checked', elem)) {
195
+ scope.$watch(ngAriaWatchModelValue, shape === 'radio' ?
196
+ getRadioReaction() : ngAriaCheckboxReaction);
197
+ }
198
+ break;
199
+ case 'range':
200
+ if ($aria.config('ariaValue')) {
201
+ if (attr.min && !elem.attr('aria-valuemin')) {
202
+ elem.attr('aria-valuemin', attr.min);
203
+ }
204
+ if (attr.max && !elem.attr('aria-valuemax')) {
205
+ elem.attr('aria-valuemax', attr.max);
206
+ }
207
+ if (!elem.attr('aria-valuenow')) {
208
+ scope.$watch(ngAriaWatchModelValue, function ngAriaValueNowReaction(newVal) {
209
+ elem.attr('aria-valuenow', newVal);
210
+ });
211
+ }
212
+ }
213
+ break;
214
+ case 'multiline':
215
+ if (shouldAttachAttr('aria-multiline', elem)) {
216
+ elem.attr('aria-multiline', true);
217
+ }
218
+ break;
219
+ }
220
+
221
+ if (needsTabIndex) {
222
+ elem.attr('tabindex', 0);
223
+ }
224
+
225
+ if (ngModel.$validators.required && shouldAttachAttr('aria-required', elem)) {
226
+ scope.$watch(function ngAriaRequiredWatch() {
227
+ return ngModel.$error.required;
228
+ }, function ngAriaRequiredReaction(newVal) {
229
+ elem.attr('aria-required', !!newVal);
230
+ });
231
+ }
232
+
233
+ if (shouldAttachAttr('aria-invalid', elem)) {
234
+ scope.$watch(function ngAriaInvalidWatch() {
235
+ return ngModel.$invalid;
236
+ }, function ngAriaInvalidReaction(newVal) {
237
+ elem.attr('aria-invalid', !!newVal);
238
+ });
239
+ }
240
+ }
241
+ };
242
+ }])
243
+ .directive('ngDisabled', ['$aria', function($aria) {
244
+ return $aria.$$watchExpr('ngDisabled', 'aria-disabled');
245
+ }])
246
+ .directive('ngClick', ngAriaTabindex)
247
+ .directive('ngDblclick', ngAriaTabindex);
248
+
249
+
250
+ })(window, window.angular);
@@ -0,0 +1,206 @@
1
+ /**
2
+ * @license AngularJS v1.3.1
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
+ * License: MIT
5
+ */
6
+ (function(window, angular, undefined) {'use strict';
7
+
8
+ /**
9
+ * @ngdoc module
10
+ * @name ngCookies
11
+ * @description
12
+ *
13
+ * # ngCookies
14
+ *
15
+ * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.
16
+ *
17
+ *
18
+ * <div doc-module-components="ngCookies"></div>
19
+ *
20
+ * See {@link ngCookies.$cookies `$cookies`} and
21
+ * {@link ngCookies.$cookieStore `$cookieStore`} for usage.
22
+ */
23
+
24
+
25
+ angular.module('ngCookies', ['ng']).
26
+ /**
27
+ * @ngdoc service
28
+ * @name $cookies
29
+ *
30
+ * @description
31
+ * Provides read/write access to browser's cookies.
32
+ *
33
+ * Only a simple Object is exposed and by adding or removing properties to/from this object, new
34
+ * cookies are created/deleted at the end of current $eval.
35
+ * The object's properties can only be strings.
36
+ *
37
+ * Requires the {@link ngCookies `ngCookies`} module to be installed.
38
+ *
39
+ * @example
40
+ *
41
+ * ```js
42
+ * angular.module('cookiesExample', ['ngCookies'])
43
+ * .controller('ExampleController', ['$cookies', function($cookies) {
44
+ * // Retrieving a cookie
45
+ * var favoriteCookie = $cookies.myFavorite;
46
+ * // Setting a cookie
47
+ * $cookies.myFavorite = 'oatmeal';
48
+ * }]);
49
+ * ```
50
+ */
51
+ factory('$cookies', ['$rootScope', '$browser', function($rootScope, $browser) {
52
+ var cookies = {},
53
+ lastCookies = {},
54
+ lastBrowserCookies,
55
+ runEval = false,
56
+ copy = angular.copy,
57
+ isUndefined = angular.isUndefined;
58
+
59
+ //creates a poller fn that copies all cookies from the $browser to service & inits the service
60
+ $browser.addPollFn(function() {
61
+ var currentCookies = $browser.cookies();
62
+ if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl
63
+ lastBrowserCookies = currentCookies;
64
+ copy(currentCookies, lastCookies);
65
+ copy(currentCookies, cookies);
66
+ if (runEval) $rootScope.$apply();
67
+ }
68
+ })();
69
+
70
+ runEval = true;
71
+
72
+ //at the end of each eval, push cookies
73
+ //TODO: this should happen before the "delayed" watches fire, because if some cookies are not
74
+ // strings or browser refuses to store some cookies, we update the model in the push fn.
75
+ $rootScope.$watch(push);
76
+
77
+ return cookies;
78
+
79
+
80
+ /**
81
+ * Pushes all the cookies from the service to the browser and verifies if all cookies were
82
+ * stored.
83
+ */
84
+ function push() {
85
+ var name,
86
+ value,
87
+ browserCookies,
88
+ updated;
89
+
90
+ //delete any cookies deleted in $cookies
91
+ for (name in lastCookies) {
92
+ if (isUndefined(cookies[name])) {
93
+ $browser.cookies(name, undefined);
94
+ }
95
+ }
96
+
97
+ //update all cookies updated in $cookies
98
+ for (name in cookies) {
99
+ value = cookies[name];
100
+ if (!angular.isString(value)) {
101
+ value = '' + value;
102
+ cookies[name] = value;
103
+ }
104
+ if (value !== lastCookies[name]) {
105
+ $browser.cookies(name, value);
106
+ updated = true;
107
+ }
108
+ }
109
+
110
+ //verify what was actually stored
111
+ if (updated) {
112
+ updated = false;
113
+ browserCookies = $browser.cookies();
114
+
115
+ for (name in cookies) {
116
+ if (cookies[name] !== browserCookies[name]) {
117
+ //delete or reset all cookies that the browser dropped from $cookies
118
+ if (isUndefined(browserCookies[name])) {
119
+ delete cookies[name];
120
+ } else {
121
+ cookies[name] = browserCookies[name];
122
+ }
123
+ updated = true;
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }]).
129
+
130
+
131
+ /**
132
+ * @ngdoc service
133
+ * @name $cookieStore
134
+ * @requires $cookies
135
+ *
136
+ * @description
137
+ * Provides a key-value (string-object) storage, that is backed by session cookies.
138
+ * Objects put or retrieved from this storage are automatically serialized or
139
+ * deserialized by angular's toJson/fromJson.
140
+ *
141
+ * Requires the {@link ngCookies `ngCookies`} module to be installed.
142
+ *
143
+ * @example
144
+ *
145
+ * ```js
146
+ * angular.module('cookieStoreExample', ['ngCookies'])
147
+ * .controller('ExampleController', ['$cookieStore', function($cookieStore) {
148
+ * // Put cookie
149
+ * $cookieStore.put('myFavorite','oatmeal');
150
+ * // Get cookie
151
+ * var favoriteCookie = $cookieStore.get('myFavorite');
152
+ * // Removing a cookie
153
+ * $cookieStore.remove('myFavorite');
154
+ * }]);
155
+ * ```
156
+ */
157
+ factory('$cookieStore', ['$cookies', function($cookies) {
158
+
159
+ return {
160
+ /**
161
+ * @ngdoc method
162
+ * @name $cookieStore#get
163
+ *
164
+ * @description
165
+ * Returns the value of given cookie key
166
+ *
167
+ * @param {string} key Id to use for lookup.
168
+ * @returns {Object} Deserialized cookie value.
169
+ */
170
+ get: function(key) {
171
+ var value = $cookies[key];
172
+ return value ? angular.fromJson(value) : value;
173
+ },
174
+
175
+ /**
176
+ * @ngdoc method
177
+ * @name $cookieStore#put
178
+ *
179
+ * @description
180
+ * Sets a value for given cookie key
181
+ *
182
+ * @param {string} key Id for the `value`.
183
+ * @param {Object} value Value to be stored.
184
+ */
185
+ put: function(key, value) {
186
+ $cookies[key] = angular.toJson(value);
187
+ },
188
+
189
+ /**
190
+ * @ngdoc method
191
+ * @name $cookieStore#remove
192
+ *
193
+ * @description
194
+ * Remove given cookie
195
+ *
196
+ * @param {string} key Id of the key-value pair to delete.
197
+ */
198
+ remove: function(key) {
199
+ delete $cookies[key];
200
+ }
201
+ };
202
+
203
+ }]);
204
+
205
+
206
+ })(window, window.angular);