Skip to content

Commit 8610b20

Browse files
committed
add 1.2.0-rc.2 barehand-atomsplitting
1 parent bf2866c commit 8610b20

File tree

639 files changed

+131179
-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.

639 files changed

+131179
-0
lines changed

1.2.0-rc.2/angular-1.2.0-rc.2.zip

4.53 MB
Binary file not shown.

1.2.0-rc.2/angular-animate.js

+708
Large diffs are not rendered by default.

1.2.0-rc.2/angular-animate.min.js

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

1.2.0-rc.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.2.0-rc.2/angular-cookies.js

+200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
/**
2+
* @license AngularJS v1.2.0-rc.2
3+
* (c) 2010-2012 Google, Inc. http://angularjs.org
4+
* License: MIT
5+
*/
6+
(function(window, angular, undefined) {'use strict';
7+
8+
/**
9+
* @ngdoc overview
10+
* @name ngCookies
11+
* @description
12+
*
13+
* # ngCookies
14+
*
15+
* Provides the {@link ngCookies.$cookies `$cookies`} and
16+
* {@link ngCookies.$cookieStore `$cookieStore`} services.
17+
*
18+
* {@installModule cookies}
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 object
28+
* @name ngCookies.$cookies
29+
* @requires $browser
30+
*
31+
* @description
32+
* Provides read/write access to browser's cookies.
33+
*
34+
* Only a simple Object is exposed and by adding or removing properties to/from
35+
* this object, new cookies are created/deleted at the end of current $eval.
36+
*
37+
* Requires the {@link ngCookies `ngCookies`} module to be installed.
38+
*
39+
* @example
40+
<doc:example>
41+
<doc:source>
42+
<script>
43+
function ExampleController($cookies) {
44+
// Retrieving a cookie
45+
var favoriteCookie = $cookies.myFavorite;
46+
// Setting a cookie
47+
$cookies.myFavorite = 'oatmeal';
48+
}
49+
</script>
50+
</doc:source>
51+
</doc:example>
52+
*/
53+
factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) {
54+
var cookies = {},
55+
lastCookies = {},
56+
lastBrowserCookies,
57+
runEval = false,
58+
copy = angular.copy,
59+
isUndefined = angular.isUndefined;
60+
61+
//creates a poller fn that copies all cookies from the $browser to service & inits the service
62+
$browser.addPollFn(function() {
63+
var currentCookies = $browser.cookies();
64+
if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl
65+
lastBrowserCookies = currentCookies;
66+
copy(currentCookies, lastCookies);
67+
copy(currentCookies, cookies);
68+
if (runEval) $rootScope.$apply();
69+
}
70+
})();
71+
72+
runEval = true;
73+
74+
//at the end of each eval, push cookies
75+
//TODO: this should happen before the "delayed" watches fire, because if some cookies are not
76+
// strings or browser refuses to store some cookies, we update the model in the push fn.
77+
$rootScope.$watch(push);
78+
79+
return cookies;
80+
81+
82+
/**
83+
* Pushes all the cookies from the service to the browser and verifies if all cookies were 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 object
136+
* @name ngCookies.$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 ngCookies.$cookieStore#get
154+
* @methodOf ngCookies.$cookieStore
155+
*
156+
* @description
157+
* Returns the value of given cookie key
158+
*
159+
* @param {string} key Id to use for lookup.
160+
* @returns {Object} Deserialized cookie value.
161+
*/
162+
get: function(key) {
163+
var value = $cookies[key];
164+
return value ? angular.fromJson(value) : value;
165+
},
166+
167+
/**
168+
* @ngdoc method
169+
* @name ngCookies.$cookieStore#put
170+
* @methodOf ngCookies.$cookieStore
171+
*
172+
* @description
173+
* Sets a value for given cookie key
174+
*
175+
* @param {string} key Id for the `value`.
176+
* @param {Object} value Value to be stored.
177+
*/
178+
put: function(key, value) {
179+
$cookies[key] = angular.toJson(value);
180+
},
181+
182+
/**
183+
* @ngdoc method
184+
* @name ngCookies.$cookieStore#remove
185+
* @methodOf ngCookies.$cookieStore
186+
*
187+
* @description
188+
* Remove given cookie
189+
*
190+
* @param {string} key Id of the key-value pair to delete.
191+
*/
192+
remove: function(key) {
193+
delete $cookies[key];
194+
}
195+
};
196+
197+
}]);
198+
199+
200+
})(window, window.angular);

1.2.0-rc.2/angular-cookies.min.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
AngularJS v1.2.0-rc.2
3+
(c) 2010-2012 Google, Inc. http://angularjs.org
4+
License: MIT
5+
*/
6+
(function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(d,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&d.$apply())})();k=!0;d.$watch(function(){var a,e,d;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)(e=c[a],f.isString(e))?e!==g[a]&&(b.cookies(a,e),d=!0):f.isDefined(g[a])?c[a]=g[a]:delete c[a];if(d)for(a in e=b.cookies(),c)c[a]!==e[a]&&(m(e[a])?delete c[a]:c[a]=e[a])});
7+
return c}]).factory("$cookieStore",["$cookies",function(d){return{get:function(b){return(b=d[b])?f.fromJson(b):b},put:function(b,c){d[b]=f.toJson(c)},remove:function(b){delete d[b]}}}])})(window,window.angular);
8+
/*
9+
//@ sourceMappingURL=angular-cookies.min.js.map
10+
*/

0 commit comments

Comments
 (0)