Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit adbc2b1

Browse files
committed
chore(docs-app): remove obsolete directives
Most of the directives in bootstrap.js haven't been in use since 389d487: Dropdown-related directives were moved to dropdown-toggle.js, and for foldout, popover and syntax, the uses and tests were removed, but not the directives themselves. The last use of tabbable was removed in 6b7a1b8
1 parent ea6c247 commit adbc2b1

File tree

8 files changed

+62
-448
lines changed

8 files changed

+62
-448
lines changed

docs/app/assets/js/angular-bootstrap/bootstrap.js

-442
This file was deleted.

docs/app/src/app.js

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ angular.module('docsApp', [
1313
'search',
1414
'tutorials',
1515
'versions',
16-
'bootstrap',
1716
'ui.bootstrap.dropdown'
1817
])
1918

docs/app/src/directives.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,15 @@ angular.module('directives', [])
3434
return function(scope, element) {
3535
$anchorScroll.yOffset = element;
3636
};
37-
}]);
37+
}])
38+
39+
.directive('table', function() {
40+
return {
41+
restrict: 'E',
42+
link: function(scope, element, attrs) {
43+
if (!attrs['class']) {
44+
element.addClass('table table-bordered table-striped code-table');
45+
}
46+
}
47+
};
48+
});

docs/app/src/examples.js

+50
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,55 @@
11
angular.module('examples', [])
22

3+
.directive('runnableExample', ['$templateCache', '$document', function($templateCache, $document) {
4+
var exampleClassNameSelector = '.runnable-example-file';
5+
var doc = $document[0];
6+
var tpl =
7+
'<nav class="runnable-example-tabs" ng-if="tabs">' +
8+
' <a ng-class="{active:$index==activeTabIndex}"' +
9+
'ng-repeat="tab in tabs track by $index" ' +
10+
'href="" ' +
11+
'class="btn"' +
12+
'ng-click="setTab($index)">' +
13+
' {{ tab }}' +
14+
' </a>' +
15+
'</nav>';
16+
17+
return {
18+
restrict: 'C',
19+
scope : true,
20+
controller : ['$scope', function($scope) {
21+
$scope.setTab = function(index) {
22+
var tab = $scope.tabs[index];
23+
$scope.activeTabIndex = index;
24+
$scope.$broadcast('tabChange', index, tab);
25+
};
26+
}],
27+
compile : function(element) {
28+
element.html(tpl + element.html());
29+
return function(scope, element) {
30+
var node = element[0];
31+
var examples = node.querySelectorAll(exampleClassNameSelector);
32+
var tabs = [], now = Date.now();
33+
angular.forEach(examples, function(child, index) {
34+
tabs.push(child.getAttribute('name'));
35+
});
36+
37+
if(tabs.length > 0) {
38+
scope.tabs = tabs;
39+
scope.$on('tabChange', function(e, index, title) {
40+
angular.forEach(examples, function(child) {
41+
child.style.display = 'none';
42+
});
43+
var selected = examples[index];
44+
selected.style.display = 'block';
45+
});
46+
scope.setTab(0);
47+
}
48+
};
49+
}
50+
};
51+
}])
52+
353
.factory('formPostData', ['$document', function($document) {
454
return function(url, newWindow, fields) {
555
/**

docs/config/services/deployments/debug.js

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = function debugDeployment(getVersion) {
1818
'../angular-touch.js',
1919
'../angular-animate.js',
2020
'components/marked-' + getVersion('marked', 'node_modules', 'package.json') + '/lib/marked.js',
21-
'js/angular-bootstrap/bootstrap.js',
2221
'js/angular-bootstrap/dropdown-toggle.js',
2322
'components/lunr.js-' + getVersion('lunr.js') + '/lunr.js',
2423
'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js',

docs/config/services/deployments/default.js

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = function defaultDeployment(getVersion) {
1818
'../angular-touch.min.js',
1919
'../angular-animate.min.js',
2020
'components/marked-' + getVersion('marked', 'node_modules', 'package.json') + '/lib/marked.js',
21-
'js/angular-bootstrap/bootstrap.min.js',
2221
'js/angular-bootstrap/dropdown-toggle.min.js',
2322
'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js',
2423
'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js',

docs/config/services/deployments/jquery.js

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ module.exports = function jqueryDeployment(getVersion) {
2222
'../angular-touch.min.js',
2323
'../angular-animate.min.js',
2424
'components/marked-' + getVersion('marked', 'node_modules', 'package.json') + '/lib/marked.js',
25-
'js/angular-bootstrap/bootstrap.min.js',
2625
'js/angular-bootstrap/dropdown-toggle.min.js',
2726
'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js',
2827
'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js',

docs/config/services/deployments/production.js

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module.exports = function productionDeployment(getVersion) {
2121
cdnUrl + '/angular-touch.min.js',
2222
cdnUrl + '/angular-animate.min.js',
2323
'components/marked-' + getVersion('marked', 'node_modules', 'package.json') + '/lib/marked.js',
24-
'js/angular-bootstrap/bootstrap.min.js',
2524
'js/angular-bootstrap/dropdown-toggle.min.js',
2625
'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js',
2726
'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js',

0 commit comments

Comments
 (0)