Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 879b7af

Browse files
committed
docs: share 'styles.css' across all samples all langs; fix styles
1 parent 4452163 commit 879b7af

File tree

82 files changed

+396
-151
lines changed

Some content is hidden

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

82 files changed

+396
-151
lines changed

gulpfile.js

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,16 @@ var _excludeMatchers = _excludePatterns.map(function(excludePattern){
6767
return new Minimatch(excludePattern)
6868
});
6969

70-
var _exampleBoilerplateFiles = ['package.json', 'tsconfig.json', 'typings.json', 'karma.conf.js', 'karma-test-shim.js' ];
70+
var _exampleBoilerplateFiles = [
71+
'karma.conf.js',
72+
'karma-test-shim.js',
73+
'package.json',
74+
'styles.css',
75+
'tsconfig.json',
76+
'typings.json'
77+
];
78+
79+
var _exampleDartWebBoilerPlateFiles = ['styles.css'];
7180

7281
// --filter may be passed in to filter/select _example app subdir names
7382
// i.e. gulp run-e2e-tests --filter=foo ; would select all example apps with
@@ -241,24 +250,35 @@ gulp.task('add-example-boilerplate', function() {
241250
fsUtils.addSymlink(realPath, linkPath);
242251
});
243252

244-
copyExampleBoilerplate();
253+
return copyExampleBoilerplate();
245254
});
246255

247256
// copies boilerplate files to locations
248257
// where an example app is found
258+
// also copies certain web files (e.g., styles.css) to ~/_examples/**/dart/**/web
249259
// also copies protractor.config.js file
250260
function copyExampleBoilerplate() {
251261
var sourceFiles = _exampleBoilerplateFiles.map(function(fn) {
252262
return path.join(EXAMPLES_PATH, fn);
253263
});
254264
var examplePaths = getExamplePaths(EXAMPLES_PATH);
255-
// copies protractor.config.js from _examples dir to each subdir that
256-
// contains a e2e-spec file.
257-
return copyFiles(sourceFiles, examplePaths).then(function() {
258-
var sourceFiles = [ path.join(EXAMPLES_PATH, 'protractor.config.js') ];
259-
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
260-
return copyFiles(sourceFiles, e2eSpecPaths);
265+
266+
var dartWebSourceFiles = _exampleDartWebBoilerPlateFiles.map(function(fn){
267+
return path.join(EXAMPLES_PATH, fn);
261268
});
269+
var dartExampleWebPaths = getDartExampleWebPaths(EXAMPLES_PATH);
270+
271+
return copyFiles(sourceFiles, examplePaths)
272+
.then(function() {
273+
return copyFiles(dartWebSourceFiles, dartExampleWebPaths);
274+
})
275+
// copy protractor.config.js from _examples dir to each subdir that
276+
// contains a e2e-spec file.
277+
.then(function() {
278+
var sourceFiles = [ path.join(EXAMPLES_PATH, 'protractor.config.js') ];
279+
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
280+
return copyFiles(sourceFiles, e2eSpecPaths);
281+
});
262282
}
263283

264284
gulp.task('remove-example-boilerplate', function() {
@@ -273,10 +293,16 @@ gulp.task('remove-example-boilerplate', function() {
273293
});
274294

275295
var examplePaths = getExamplePaths(EXAMPLES_PATH);
276-
return deleteFiles(_exampleBoilerplateFiles, examplePaths).then(function() {
277-
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
278-
return deleteFiles(['protractor.config.js'], e2eSpecPaths);
279-
})
296+
var dartExampleWebPaths = getDartExampleWebPaths(EXAMPLES_PATH);
297+
298+
return deleteFiles(_exampleBoilerplateFiles, examplePaths)
299+
.then(function() {
300+
return deleteFiles(_exampleDartWebBoilerPlateFiles, dartExampleWebPaths);
301+
})
302+
.then(function() {
303+
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
304+
return deleteFiles(['protractor.config.js'], e2eSpecPaths);
305+
})
280306
});
281307

282308
gulp.task('serve-and-sync', ['build-docs'], function (cb) {
@@ -317,7 +343,10 @@ gulp.task('build-js-api-docs', ['_shred-api-examples'], function() {
317343
});
318344

319345
gulp.task('build-plunkers', function() {
320-
return plunkerBuilder.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log });
346+
return copyExampleBoilerplate()
347+
.then(function() {
348+
return plunkerBuilder.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log });
349+
});
321350
});
322351

323352
gulp.task('build-dart-cheatsheet', [], function() {
@@ -557,6 +586,11 @@ function getExamplePaths(basePath, includeBase) {
557586
return getPaths(basePath, "example-config.json", includeBase)
558587
}
559588

589+
function getDartExampleWebPaths(basePath) {
590+
var paths = globby.sync([path.join(basePath,"**/dart/**/web")])
591+
return paths;
592+
}
593+
560594
function getPaths(basePath, filename, includeBase) {
561595
var filenames = getFilenames(basePath, filename, includeBase);
562596
var paths = filenames.map(function(fileName) {

public/docs/_examples/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
styles.css
12
typings
23
typings.json
34
*.js.map

public/docs/_examples/architecture/dart/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<title>Intro to Angular 2</title>
5+
<link rel="stylesheet" href="styles.css">
56
<script defer src="main.dart" type="application/dart"></script>
67
<script defer src="packages/browser/dart.js"></script>
78
</head>

public/docs/_examples/architecture/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<title>Intro to Angular 2</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<link rel="stylesheet" href="styles.css">
67

78
<!-- IE required polyfills, in this exact order -->
89
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/attribute-directives/dart/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<html>
44
<head>
55
<title>Attribute Directives</title>
6+
<link rel="stylesheet" href="styles.css">
67
<script defer src="main.dart" type="application/dart"></script>
78
<script defer src="packages/browser/dart.js"></script>
89
</head>

public/docs/_examples/attribute-directives/ts/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<head>
55
<title>Attribute Directives</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
7+
<link rel="stylesheet" href="styles.css">
8+
89
<!-- IE required polyfills, in this exact order -->
910
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
1011
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/* route-link anchor tags */
2-
nav a {padding: 5px; text-decoration: none; font-family: Arial, Helvetica, sans-serif; }
3-
nav a:visited, a:link {color: #444;}
4-
nav a:hover {color: white; background-color: #1171a3; }
5-
nav a.router-link-active {color: white; background-color: #52b9e9; }
6-
71
.active {font-style: italic;}
82
.shazam {font-weight: bold;}
93

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ table {
77
font-family:Arial, Helvetica, sans-serif;
88
color:#666;
99
font-size:14px;
10-
text-shadow: 1px 1px 0px #fff;
10+
text-shadow: 1px 1px 0 #fff;
1111
margin:20px;
1212
border:#ccc 1px solid;
1313

public/docs/_examples/cb-a1-a2-quick-reference/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<base href="/">
55
<title>Angular 1 to Angular 2 Quick Reference</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="stylesheet" href="styles.css">
78

89
<!-- IE required polyfills, in this exact order -->
910
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/cb-component-communication/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<style>
77
.to-top {margin-top: 8px; display: block;}
88
</style>
9+
<link rel="stylesheet" href="styles.css">
910

1011
<!-- IE required polyfills, in this exact order -->
1112
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/dependency-injection/dart/web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<title>Dependency Injection</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
7+
<link rel="stylesheet" href="styles.css">
88
<script type="application/dart" src="main.dart"></script>
99
</head>
1010
<body>

public/docs/_examples/dependency-injection/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<head>
55
<title>Dependency Injection</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="stylesheet" href="styles.css">
78

89
<!-- IE required polyfills, in this exact order -->
910
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/displaying-data/dart/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<html>
44
<head>
55
<title>Displaying Data</title>
6+
<link rel="stylesheet" href="styles.css">
67
<script defer src="main.dart" type="application/dart"></script>
78
<script defer src="packages/browser/dart.js"></script>
89
</head>

public/docs/_examples/displaying-data/ts/index.1.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<title>Displaying Data</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<link rel="stylesheet" href="styles.css">
67

78
<!-- IE required polyfills, in this exact order -->
89
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/displaying-data/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<title>Displaying Data</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<link rel="stylesheet" href="styles.css">
67

78
<!-- IE required polyfills, in this exact order -->
89
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/forms/dart/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<link rel="stylesheet" href="bootstrap.min.css">
1212
<!-- #enddocregion bootstrap-and-script -->
1313
<link rel="stylesheet" href="styles.css">
14+
<link rel="stylesheet" href="forms.css">
1415
<!-- #enddocregion styles -->
1516
<!-- #docregion initial -->
1617
<!-- #docregion bootstrap-and-script -->

public/docs/_examples/forms/dart/web/styles.css

Lines changed: 0 additions & 7 deletions
This file was deleted.

public/docs/_examples/forms/js/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<!-- #enddocregion bootstrap -->
1212
<!-- #docregion styles -->
1313
<link rel="stylesheet" href="styles.css">
14+
<link rel="stylesheet" href="form.css">
1415
<!-- #enddocregion styles -->
1516

1617
<!-- IE required polyfill -->
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* #docregion */
2+
.ng-valid[required] {
3+
border-left: 5px solid #42A948; /* green */
4+
}
5+
6+
.ng-invalid {
7+
border-left: 5px solid #a94442; /* red */
8+
}
9+
/* #enddocregion */

public/docs/_examples/forms/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<!-- #enddocregion bootstrap -->
1111
<!-- #docregion styles -->
1212
<link rel="stylesheet" href="styles.css">
13+
<link rel="stylesheet" href="forms.css">
1314
<!-- #enddocregion styles -->
1415

1516
<!-- IE required polyfills, in this exact order -->

public/docs/_examples/hierarchical-dependency-injection/dart/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
<title>Hierarchical Injector</title>
9+
<link rel="stylesheet" href="styles.css">
910
<script defer src="main.dart" type="application/dart"></script>
1011
<script defer src="packages/browser/dart.js"></script>
1112
</head>

public/docs/_examples/hierarchical-dependency-injection/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<title>Hierarchical Injectors</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<link rel="stylesheet" href="styles.css">
67

78
<!-- IE required polyfills, in this exact order -->
89
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/homepage-hello-world/ts/index.1.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<head>
55
<title>Angular 2 Hello World</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="stylesheet" href="styles.css">
78

89
<!-- 1. Load libraries -->
910
<!-- IE required polyfills (from CDN), in this exact order -->

public/docs/_examples/homepage-hello-world/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<head>
55
<title>Angular 2 Hello World</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="stylesheet" href="styles.css">
78

89
<!-- IE required polyfills, in this exact order -->
910
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/homepage-tabs/ts/index.1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<head>
55
<title>Angular 2 Tabs</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
87
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
8+
<link rel="stylesheet" href="styles.css">
99

1010
<!-- 1. Load libraries -->
1111
<!-- IE required polyfills (from CDN), in this exact order -->

public/docs/_examples/homepage-tabs/ts/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<head>
55
<title>Angular 2 Tabs</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
87
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
8+
<link rel="stylesheet" href="styles.css">
99

1010
<!-- IE required polyfills, in this exact order -->
1111
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/homepage-todo/ts/index.1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<head>
55
<title>Angular 2 Todos</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
87
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
8+
<link rel="stylesheet" href="styles.css">
99

1010
<!-- 1. Load libraries -->
1111
<!-- IE required polyfills (from CDN), in this exact order -->

public/docs/_examples/homepage-todo/ts/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<head>
55
<title>Angular 2 Todos</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
87
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
9-
8+
<link rel="stylesheet" href="styles.css">
9+
1010
<!-- IE required polyfills, in this exact order -->
1111
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
1212
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>

public/docs/_examples/lifecycle-hooks/dart/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
<head>
66
<title>Angular 2 Lifecycle Hooks</title>
7+
<link rel="stylesheet" href="styles.css">
78
<script defer src="main.dart" type="application/dart"></script>
89
<script defer src="packages/browser/dart.js"></script>
910
</head>

public/docs/_examples/lifecycle-hooks/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<head>
55
<title>Angular 2 Lifecycle Hooks</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="stylesheet" href="styles.css">
78

89
<!-- IE required polyfills, in this exact order -->
910
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/pipes/dart/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<title>Pipes Example</title>
5+
<link rel="stylesheet" href="styles.css">
56
<script defer src="main.dart" type="application/dart"></script>
67
<script defer src="packages/browser/dart.js"></script>
78
</head>

public/docs/_examples/pipes/ts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<title>Pipes</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<link rel="stylesheet" href="styles.css">
67

78
<!-- IE required polyfills, in this exact order -->
89
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

public/docs/_examples/quickstart/dart/ex1/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<html>
44
<head>
55
<title>Getting Started</title>
6+
<link rel="stylesheet" href="styles.css">
67

78
<!-- #docregion loaddart -->
89
<script async src="main.dart" type="application/dart"></script>

public/docs/_examples/quickstart/dart/ex2/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<html>
44
<head>
55
<title>Getting Started</title>
6+
<link rel="stylesheet" href="styles.css">
67

78
<!-- #docregion loaddart -->
89
<script async src="main.dart" type="application/dart"></script>

public/docs/_examples/quickstart/js/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<head>
55
<title>Angular 2 QuickStart</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
7+
<link rel="stylesheet" href="styles.css">
8+
89
<!-- 1. Load libraries -->
910
<!-- #docregion libraries -->
1011
<!-- #docregion ie-polyfills -->

0 commit comments

Comments
 (0)