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

Commit 48f0957

Browse files
committed
revert: chore(docs-app): load example files based on active deployment
This reverts commit d91a6bd. The runnable examples cannot rely on the CDN for loading the common files, because the CDN push does not happen at the same time as the docs are generated, which means the doc examples are non-functional for an unforeseeable time.
1 parent 6d2ff0a commit 48f0957

File tree

9 files changed

+3
-34
lines changed

9 files changed

+3
-34
lines changed

docs/app/src/app.js

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ angular.module('docsApp', [
1414
'search',
1515
'tutorials',
1616
'versions',
17-
'deployment',
1817
'ui.bootstrap.dropdown'
1918
])
2019

docs/app/src/examples.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ angular.module('examples', [])
1818
return {
1919
restrict: 'C',
2020
scope : true,
21-
controller : ['$scope', 'DEPLOYMENT', function($scope, DEPLOYMENT) {
22-
var exampleIndexFile = (DEPLOYMENT === 'default' ? 'index' : 'index-' + DEPLOYMENT) + '.html';
23-
24-
$scope.getExampleIndex = function(basePath) {
25-
return basePath + '/' + exampleIndexFile;
26-
};
27-
21+
controller : ['$scope', function($scope) {
2822
$scope.setTab = function(index) {
2923
var tab = $scope.tabs[index];
3024
$scope.activeTabIndex = index;

docs/config/index.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ module.exports = new Package('angularjs', [
112112
docTypes: ['indexPage'],
113113
pathTemplate: '.',
114114
outputPathTemplate: '${id}.html'
115-
}, {
116-
docTypes: ['deploymentData'],
117-
pathTemplate: '.',
118-
outputPathTemplate: 'js/${id}.js'
119115
});
120116

121117
computePathsProcessor.pathTemplates.push({
@@ -129,14 +125,8 @@ module.exports = new Package('angularjs', [
129125
outputPathTemplate: 'partials/${area}/${moduleName}/${groupType}.html'
130126
});
131127

132-
computePathsProcessor.pathTemplates.push({
133-
docTypes: ['example'],
134-
pathTemplate: 'examples/${example.id}',
135-
outputPathTemplate: 'examples/${example.id}/index${deploymentQualifier}.html'
136-
});
137-
138128
computeIdsProcessor.idTemplates.push({
139-
docTypes: ['overview', 'tutorial', 'e2e-test', 'indexPage', 'deploymentData'],
129+
docTypes: ['overview', 'tutorial', 'e2e-test', 'indexPage'],
140130
getId: function(doc) { return doc.fileInfo.baseName; },
141131
getAliases: function(doc) { return [doc.id]; }
142132
});

docs/config/processors/index-page.js

-10
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,7 @@ module.exports = function generateIndexPagesProcessor() {
3535

3636
indexDoc.id = 'index' + (deployment.name === 'default' ? '' : '-' + deployment.name);
3737

38-
var deploymentDoc = {
39-
docType: 'deploymentData',
40-
id: 'deployment-data-' + deployment.name,
41-
template: 'angular-service.template.js',
42-
ngModuleName: 'deployment',
43-
serviceName: 'DEPLOYMENT',
44-
serviceValue: deployment.name
45-
};
46-
4738
docs.push(indexDoc);
48-
docs.push(deploymentDoc);
4939
});
5040
}
5141
};

docs/config/services/deployments/debug.js

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module.exports = function debugDeployment(getVersion) {
2626
'js/all-versions-data.js',
2727
'js/pages-data.js',
2828
'js/nav-data.js',
29-
'js/deployment-data-debug.js',
3029
'js/docs.js'
3130
],
3231
stylesheets: [

docs/config/services/deployments/default.js

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module.exports = function defaultDeployment(getVersion) {
2626
'js/all-versions-data.js',
2727
'js/pages-data.js',
2828
'js/nav-data.js',
29-
'js/deployment-data-default.js',
3029
'js/docs.min.js'
3130
],
3231
stylesheets: [

docs/config/services/deployments/jquery.js

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ module.exports = function jqueryDeployment(getVersion) {
3030
'js/all-versions-data.js',
3131
'js/pages-data.js',
3232
'js/nav-data.js',
33-
'js/deployment-data-jquery.js',
3433
'js/docs.min.js'
3534
],
3635
stylesheets: [

docs/config/services/deployments/production.js

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ module.exports = function productionDeployment(getVersion) {
4343
'https://code.angularjs.org/snapshot/docs/js/all-versions-data.js',
4444
'js/pages-data.js',
4545
'js/nav-data.js',
46-
'js/deployment-data-production.js',
4746
'js/docs.min.js'
4847
],
4948
stylesheets: [

docs/config/templates/examples/runnableExample.template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</div>
1919
{% endfor %}
2020

21-
<iframe class="runnable-example-frame" ng-src="{{getExampleIndex('{$ doc.example.deployments.default.path $}')}}" name="{$ doc.example.id $}"></iframe>
21+
<iframe class="runnable-example-frame" src="{$ doc.example.deployments.default.outputPath $}" name="{$ doc.example.id $}"></iframe>
2222
</div>
2323
</div>
2424

0 commit comments

Comments
 (0)