Skip to content

Commit 2d6b256

Browse files
committed
v1.3.0-beta.2
1 parent 5114795 commit 2d6b256

File tree

1,919 files changed

+256853
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,919 files changed

+256853
-0
lines changed

1.3.0-beta.2/angular-1.3.0-beta.2.zip

8.54 MB
Binary file not shown.

1.3.0-beta.2/angular-animate.js

+1,613
Large diffs are not rendered by default.

1.3.0-beta.2/angular-animate.min.js

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

1.3.0-beta.2/angular-animate.min.js.map

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

1.3.0-beta.2/angular-cookies.js

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
/**
2+
* @license AngularJS v1.3.0-beta.2
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
34+
* this object, new cookies are created/deleted at the end of current $eval.
35+
*
36+
* Requires the {@link ngCookies `ngCookies`} module to be installed.
37+
*
38+
* @example
39+
<example>
40+
<file name="index.html">
41+
<script>
42+
function ExampleController($cookies) {
43+
// Retrieving a cookie
44+
var favoriteCookie = $cookies.myFavorite;
45+
// Setting a cookie
46+
$cookies.myFavorite = 'oatmeal';
47+
}
48+
</script>
49+
</file>
50+
</example>
51+
*/
52+
factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) {
53+
var cookies = {},
54+
lastCookies = {},
55+
lastBrowserCookies,
56+
runEval = false,
57+
copy = angular.copy,
58+
isUndefined = angular.isUndefined;
59+
60+
//creates a poller fn that copies all cookies from the $browser to service & inits the service
61+
$browser.addPollFn(function() {
62+
var currentCookies = $browser.cookies();
63+
if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl
64+
lastBrowserCookies = currentCookies;
65+
copy(currentCookies, lastCookies);
66+
copy(currentCookies, cookies);
67+
if (runEval) $rootScope.$apply();
68+
}
69+
})();
70+
71+
runEval = true;
72+
73+
//at the end of each eval, push cookies
74+
//TODO: this should happen before the "delayed" watches fire, because if some cookies are not
75+
// strings or browser refuses to store some cookies, we update the model in the push fn.
76+
$rootScope.$watch(push);
77+
78+
return cookies;
79+
80+
81+
/**
82+
* Pushes all the cookies from the service to the browser and verifies if all cookies were
83+
* stored.
84+
*/
85+
function push() {
86+
var name,
87+
value,
88+
browserCookies,
89+
updated;
90+
91+
//delete any cookies deleted in $cookies
92+
for (name in lastCookies) {
93+
if (isUndefined(cookies[name])) {
94+
$browser.cookies(name, undefined);
95+
}
96+
}
97+
98+
//update all cookies updated in $cookies
99+
for(name in cookies) {
100+
value = cookies[name];
101+
if (!angular.isString(value)) {
102+
if (angular.isDefined(lastCookies[name])) {
103+
cookies[name] = lastCookies[name];
104+
} else {
105+
delete cookies[name];
106+
}
107+
} else if (value !== lastCookies[name]) {
108+
$browser.cookies(name, value);
109+
updated = true;
110+
}
111+
}
112+
113+
//verify what was actually stored
114+
if (updated){
115+
updated = false;
116+
browserCookies = $browser.cookies();
117+
118+
for (name in cookies) {
119+
if (cookies[name] !== browserCookies[name]) {
120+
//delete or reset all cookies that the browser dropped from $cookies
121+
if (isUndefined(browserCookies[name])) {
122+
delete cookies[name];
123+
} else {
124+
cookies[name] = browserCookies[name];
125+
}
126+
updated = true;
127+
}
128+
}
129+
}
130+
}
131+
}]).
132+
133+
134+
/**
135+
* @ngdoc service
136+
* @name $cookieStore
137+
* @requires $cookies
138+
*
139+
* @description
140+
* Provides a key-value (string-object) storage, that is backed by session cookies.
141+
* Objects put or retrieved from this storage are automatically serialized or
142+
* deserialized by angular's toJson/fromJson.
143+
*
144+
* Requires the {@link ngCookies `ngCookies`} module to be installed.
145+
*
146+
* @example
147+
*/
148+
factory('$cookieStore', ['$cookies', function($cookies) {
149+
150+
return {
151+
/**
152+
* @ngdoc method
153+
* @name $cookieStore#get
154+
*
155+
* @description
156+
* Returns the value of given cookie key
157+
*
158+
* @param {string} key Id to use for lookup.
159+
* @returns {Object} Deserialized cookie value.
160+
*/
161+
get: function(key) {
162+
var value = $cookies[key];
163+
return value ? angular.fromJson(value) : value;
164+
},
165+
166+
/**
167+
* @ngdoc method
168+
* @name $cookieStore#put
169+
*
170+
* @description
171+
* Sets a value for given cookie key
172+
*
173+
* @param {string} key Id for the `value`.
174+
* @param {Object} value Value to be stored.
175+
*/
176+
put: function(key, value) {
177+
$cookies[key] = angular.toJson(value);
178+
},
179+
180+
/**
181+
* @ngdoc method
182+
* @name $cookieStore#remove
183+
*
184+
* @description
185+
* Remove given cookie
186+
*
187+
* @param {string} key Id of the key-value pair to delete.
188+
*/
189+
remove: function(key) {
190+
delete $cookies[key];
191+
}
192+
};
193+
194+
}]);
195+
196+
197+
})(window, window.angular);

1.3.0-beta.2/angular-cookies.min.js

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

1.3.0-beta.2/angular-cookies.min.js.map

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

1.3.0-beta.2/angular-csp.css

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* Include this file in your html if you are using the CSP mode. */
2+
3+
@charset "UTF-8";
4+
5+
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],
6+
.ng-cloak, .x-ng-cloak,
7+
.ng-hide {
8+
display: none !important;
9+
}
10+
11+
ng\:form {
12+
display: block;
13+
}
14+
15+
.ng-animate-block-transitions {
16+
transition:0s all!important;
17+
-webkit-transition:0s all!important;
18+
}

0 commit comments

Comments
 (0)