Skip to content

Commit 43aad28

Browse files
committed
add 1.0.6 universal-irreversibility
1 parent e6ad90c commit 43aad28

File tree

576 files changed

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

576 files changed

+110833
-0
lines changed

1.0.6/angular-1.0.6.zip

3.82 MB
Binary file not shown.

1.0.6/angular-bootstrap-prettify.js

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

1.0.6/angular-bootstrap-prettify.min.js

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

1.0.6/angular-bootstrap.js

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
/**
2+
* @license AngularJS v1.0.6
3+
* (c) 2010-2012 Google, Inc. http://angularjs.org
4+
* License: MIT
5+
*/
6+
(function(window, angular, undefined) {
7+
'use strict';
8+
9+
var directive = {};
10+
11+
directive.dropdownToggle =
12+
['$document', '$location', '$window',
13+
function ($document, $location, $window) {
14+
var openElement = null, close;
15+
return {
16+
restrict: 'C',
17+
link: function(scope, element, attrs) {
18+
scope.$watch(function dropdownTogglePathWatch(){return $location.path();}, function dropdownTogglePathWatchAction() {
19+
close && close();
20+
});
21+
22+
element.parent().bind('click', function(event) {
23+
close && close();
24+
});
25+
26+
element.bind('click', function(event) {
27+
event.preventDefault();
28+
event.stopPropagation();
29+
30+
var iWasOpen = false;
31+
32+
if (openElement) {
33+
iWasOpen = openElement === element;
34+
close();
35+
}
36+
37+
if (!iWasOpen){
38+
element.parent().addClass('open');
39+
openElement = element;
40+
41+
close = function (event) {
42+
event && event.preventDefault();
43+
event && event.stopPropagation();
44+
$document.unbind('click', close);
45+
element.parent().removeClass('open');
46+
close = null;
47+
openElement = null;
48+
}
49+
50+
$document.bind('click', close);
51+
}
52+
});
53+
}
54+
};
55+
}];
56+
57+
58+
directive.tabbable = function() {
59+
return {
60+
restrict: 'C',
61+
compile: function(element) {
62+
var navTabs = angular.element('<ul class="nav nav-tabs"></ul>'),
63+
tabContent = angular.element('<div class="tab-content"></div>');
64+
65+
tabContent.append(element.contents());
66+
element.append(navTabs).append(tabContent);
67+
},
68+
controller: ['$scope', '$element', function($scope, $element) {
69+
var navTabs = $element.contents().eq(0),
70+
ngModel = $element.controller('ngModel') || {},
71+
tabs = [],
72+
selectedTab;
73+
74+
ngModel.$render = function() {
75+
var $viewValue = this.$viewValue;
76+
77+
if (selectedTab ? (selectedTab.value != $viewValue) : $viewValue) {
78+
if(selectedTab) {
79+
selectedTab.paneElement.removeClass('active');
80+
selectedTab.tabElement.removeClass('active');
81+
selectedTab = null;
82+
}
83+
if($viewValue) {
84+
for(var i = 0, ii = tabs.length; i < ii; i++) {
85+
if ($viewValue == tabs[i].value) {
86+
selectedTab = tabs[i];
87+
break;
88+
}
89+
}
90+
if (selectedTab) {
91+
selectedTab.paneElement.addClass('active');
92+
selectedTab.tabElement.addClass('active');
93+
}
94+
}
95+
96+
}
97+
};
98+
99+
this.addPane = function(element, attr) {
100+
var li = angular.element('<li><a href></a></li>'),
101+
a = li.find('a'),
102+
tab = {
103+
paneElement: element,
104+
paneAttrs: attr,
105+
tabElement: li
106+
};
107+
108+
tabs.push(tab);
109+
110+
attr.$observe('value', update)();
111+
attr.$observe('title', function(){ update(); a.text(tab.title); })();
112+
113+
function update() {
114+
tab.title = attr.title;
115+
tab.value = attr.value || attr.title;
116+
if (!ngModel.$setViewValue && (!ngModel.$viewValue || tab == selectedTab)) {
117+
// we are not part of angular
118+
ngModel.$viewValue = tab.value;
119+
}
120+
ngModel.$render();
121+
}
122+
123+
navTabs.append(li);
124+
li.bind('click', function(event) {
125+
event.preventDefault();
126+
event.stopPropagation();
127+
if (ngModel.$setViewValue) {
128+
$scope.$apply(function() {
129+
ngModel.$setViewValue(tab.value);
130+
ngModel.$render();
131+
});
132+
} else {
133+
// we are not part of angular
134+
ngModel.$viewValue = tab.value;
135+
ngModel.$render();
136+
}
137+
});
138+
139+
return function() {
140+
tab.tabElement.remove();
141+
for(var i = 0, ii = tabs.length; i < ii; i++ ) {
142+
if (tab == tabs[i]) {
143+
tabs.splice(i, 1);
144+
}
145+
}
146+
};
147+
}
148+
}]
149+
};
150+
};
151+
152+
153+
directive.tabPane = function() {
154+
return {
155+
require: '^tabbable',
156+
restrict: 'C',
157+
link: function(scope, element, attrs, tabsCtrl) {
158+
element.bind('$remove', tabsCtrl.addPane(element, attrs));
159+
}
160+
};
161+
};
162+
163+
164+
angular.module('bootstrap', []).directive(directive);
165+
166+
167+
})(window, window.angular);

1.0.6/angular-bootstrap.min.js

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

1.0.6/angular-cookies.js

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

1.0.6/angular-cookies.min.js

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

0 commit comments

Comments
 (0)