Skip to content

Commit 9c32fcc

Browse files
committed
adding all the samples
1 parent 3f2123f commit 9c32fcc

File tree

13 files changed

+175
-0
lines changed

13 files changed

+175
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

pubspec.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: tutorialsamples
2+
description: A sample application
3+
4+
#dependencies:
5+
# unittest: { sdk: unittest }

web/target01/clickme/clickme.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
body {
3+
background-color: #F8F8F8;
4+
font-family: 'Open Sans', sans-serif;
5+
font-size: 14px;
6+
font-weight: normal;
7+
line-height: 1.2em;
8+
margin: 15px;
9+
}
10+
11+
p {
12+
color: #333;
13+
}
14+
15+
#container {
16+
width: 100%;
17+
height: 400px;
18+
position: relative;
19+
border: 1px solid #ccc;
20+
background-color: #fff;
21+
}
22+
23+
#text {
24+
font-size: 24pt;
25+
text-align: center;
26+
margin-top: 140px;
27+
}

web/target01/clickme/clickme.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import 'dart:html';
2+
3+
void main() {
4+
query("#text")
5+
..text = "Click me!"
6+
..on.click.add(reverseText);
7+
}
8+
9+
void reverseText(Event event) {
10+
var text = query("#text").text;
11+
var buffer = new StringBuffer();
12+
for (int i = text.length - 1; i >= 0; i--) {
13+
buffer.add(text[i]);
14+
}
15+
query("#text").text = buffer.toString();
16+
}

web/target01/clickme/clickme.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<meta charset="utf-8">
6+
<title>Clickme</title>
7+
<link rel="stylesheet" href="clickme.css">
8+
</head>
9+
<body>
10+
<h1>Clickme</h1>
11+
12+
<p>Hello world from Dart!</p>
13+
14+
<div id="container">
15+
<p id="text"></p>
16+
</div>
17+
18+
<script type="application/dart" src="clickme.dart"></script>
19+
<script src="https://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
20+
</body>
21+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
void main() {
2+
print("Hello, World!");
3+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<title>A Minimalist App</title>
6+
<link rel="stylesheet" href="mini.css">
7+
</head>
8+
<body>
9+
<p id="RipVanWinkle"></p>
10+
<script type="application/dart" src="mini.dart"></script>
11+
<script src="http://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
12+
</body>
13+
</html>

web/target02/mini/mini.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#RipVanWinkle {
2+
font-size: 20px;
3+
font-family: 'Open Sans', sans-serif;
4+
text-align: center;
5+
margin-top: 20px;
6+
background-color: SlateBlue;
7+
color: Yellow;
8+
}

web/target02/mini/mini.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import 'dart:html';
2+
3+
void main() {
4+
query('#RipVanWinkle').text = "Wake up, sleepy head!";
5+
}

web/target02/mini/mini.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<title>A Minimalist App</title>
6+
</head>
7+
<body>
8+
<p id="RipVanWinkle"></p>
9+
<script type="application/dart" src="mini.dart"></script>
10+
<script src="https://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)