Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: src/site/docs/tutorials/polymer-intro/examples/stopwatch/out/web/tute_stopwatch.dart

Issue 275613002: Update polymer tutorial; make directory paths match new sample structure (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: probably nothing (oh app engine you joker) Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/site/docs/tutorials/polymer-intro/examples/stopwatch/out/web/tute_stopwatch.dart
diff --git a/src/site/docs/tutorials/polymer-intro/examples/stopwatch/out/web/tute_stopwatch.dart b/src/site/docs/tutorials/polymer-intro/examples/stopwatch/out/web/tute_stopwatch.dart
deleted file mode 100644
index 5e5f0617e97d75dd549b22d41b09abb5f04e8151..0000000000000000000000000000000000000000
--- a/src/site/docs/tutorials/polymer-intro/examples/stopwatch/out/web/tute_stopwatch.dart
+++ /dev/null
@@ -1,64 +0,0 @@
-import 'dart:html';
-import 'dart:async';
-import 'package:polymer/polymer.dart';
-
-@CustomTag('tute-stopwatch')
-class TuteStopwatch extends PolymerElement {
- @observable String get counter => __$counter; String __$counter='00:00'; set counter(String value) { __$counter = notifyPropertyChange(#counter, __$counter, value); }
-
- Stopwatch mywatch = new Stopwatch();
- Timer mytimer;
-
- ButtonElement stopButton;
- ButtonElement startButton;
- ButtonElement resetButton;
-
- void inserted() {
- super.inserted();
- startButton = $['startButton'];
- stopButton = $['stopButton'];
- resetButton = $['resetButton'];
-
- stopButton.disabled = true;
- resetButton.disabled = true;
- }
-
- void removed() {
- super.removed();
- mytimer.cancel();
- }
-
- void start(Event e, var detail, Node target) {
- mywatch.start();
- var oneSecond = new Duration(seconds:1);
- mytimer = new Timer.periodic(oneSecond, updateTime);
- startButton.disabled = true;
- stopButton.disabled = false;
- resetButton.disabled = true;
- }
-
- void stop(Event e, var detail, Node target) {
- mywatch.stop();
- mytimer.cancel();
- startButton.disabled = false;
- resetButton.disabled = false;
- stopButton.disabled = true;
- }
-
- void reset(Event e, var detail, Node target) {
- mywatch.reset();
- counter = '00:00';
- resetButton.disabled = true;
- }
-
- void updateTime(Timer _) {
- var s = mywatch.elapsedMilliseconds~/1000;
- var m = 0;
-
- if (s >= 60) { m = s ~/ 60; s = s % 60; }
-
- String minute = (m <= 9) ? '0$m' : '$m';
- String second = (s <= 9) ? '0$s' : '$s';
- counter = '$minute:$second';
- }
-}

Powered by Google App Engine
This is Rietveld 408576698