Skip to content

Commit 78e8fc4

Browse files
committed
added target 7 example
1 parent fcdc4ad commit 78e8fc4

15 files changed

+10891
-0
lines changed

web/target07/drseuss/build.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import 'package:web_ui/component_build.dart';
2+
import 'dart:io';
3+
4+
void main() {
5+
build(new Options().arguments, ['web/drseuss.html']);
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import 'package:web_ui/component_build.dart';
2+
import 'dart:io';
3+
4+
void main() {
5+
build(new Options().arguments, ['web/convertThis.html']);
6+
}

web/target07/drseuss/pubspec.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: drseuss
2+
description: Rhymer of word, artist of cat, Dr. Theodor Geisel, he is all that
3+
4+
dependencies:
5+
web_ui: any
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<title>Convert This!</title>
6+
<link rel="stylesheet" href="drseuss.css">
7+
<link rel="components" href="converter-element.html">
8+
</head>
9+
10+
<body>
11+
<div>
12+
<x-converter ratio="0.62">
13+
<label class="label-one"> miles </label>
14+
<label class="label-two"> kilometers </label>
15+
</x-converter>
16+
<x-converter ratio="2.2">
17+
<label class="label-one"> pounds </label>
18+
<label class="label-two"> kilograms </label>
19+
</x-converter>
20+
<x-converter ratio="17.06">
21+
<label class="label-one"> jiggers </label>
22+
<label class="label-two"> fifths </label>
23+
</x-converter>
24+
</div>
25+
<script type="application/dart" src="drseuss.dart"></script>
26+
<script type="text/javascript" src="https://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
27+
</body>
28+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<title>Dr. Seuss</title>
6+
<link rel="stylesheet" href="drseuss.css">
7+
</head>
8+
9+
<body>
10+
<element extends="div" name="x-converter" constructor="ConverterComponent">
11+
<template>
12+
<div class="x-converter">
13+
<span> <content select=".label-one"></content> </span>
14+
<input type="text" bind-value="thing_one" on-change="convertOnetoTwo()" style="text-align:right">
15+
&lt; &gt;
16+
<input type="text" bind-value="thing_two" on-change="convertTwotoOne()">
17+
<span> <content select=".label-two"></content> </span>
18+
</div>
19+
</template>
20+
<script type="application/dart" src="converter_component.dart"> </script>
21+
</element>
22+
</body>
23+
</html>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:web_ui/web_ui.dart';
2+
3+
class ConverterComponent extends WebComponent {
4+
5+
double ratio = 0.5;
6+
String thing_one = '0';
7+
String thing_two = '0';
8+
9+
void convertOnetoTwo() {
10+
var one = double.parse(thing_one);
11+
var two = one/ratio;
12+
thing_two = two.toStringAsFixed(2);
13+
}
14+
15+
void convertTwotoOne() {
16+
var two = double.parse(thing_two);
17+
var one = two*ratio;
18+
thing_one = one.toStringAsFixed(2);
19+
}
20+
}
21+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
body {
3+
background-color: WhiteSmoke;
4+
font-family: 'Open Sans', sans-serif;
5+
font-size: 14px;
6+
font-weight: normal;
7+
line-height: 1.2em;
8+
margin: 20px;
9+
}
10+
11+
.x-converter {
12+
text-align: center;
13+
background-color: LemonChiffon;
14+
margin: 10px;
15+
padding: 10px;
16+
border: inset;
17+
}
18+
19+
input {
20+
width: 72px;
21+
font-size: 14px;
22+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
void main() {
3+
4+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<title>Dr. Seuss</title>
6+
<link rel="stylesheet" href="drseuss.css">
7+
<link rel="components" href="converter-element.html">
8+
</head>
9+
10+
<body>
11+
<div>
12+
13+
<x-converter ratio="0.5">
14+
<label class="label-one"> Thing 1 </label>
15+
<label class="label-two"> Thing 2 </label>
16+
</x-converter>
17+
18+
</div>
19+
<script type="application/dart" src="drseuss.dart"></script>
20+
<script type="text/javascript" src="https://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
21+
</body>
22+
</html>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<!-- This file was auto-generated from template web/convertThis.html. -->
3+
<html><head>
4+
<title>Convert This!</title>
5+
<link rel="stylesheet" href="../drseuss.css">
6+
7+
</head>
8+
9+
<body>
10+
<div>
11+
<x-converter ratio="0.62" id="__e-0">
12+
<label class="label-one"> miles </label>
13+
<label class="label-two"> kilometers </label>
14+
</x-converter>
15+
<x-converter ratio="2.2" id="__e-1">
16+
<label class="label-one"> pounds </label>
17+
<label class="label-two"> kilograms </label>
18+
</x-converter>
19+
<x-converter ratio="17.06" id="__e-2">
20+
<label class="label-one"> jiggers </label>
21+
<label class="label-two"> fifths </label>
22+
</x-converter>
23+
</div>
24+
25+
<script type="text/javascript" src="https://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
26+
27+
<script type="application/dart" src="convertThis.html_bootstrap.dart"></script></body></html>

0 commit comments

Comments
 (0)