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

Unified Diff: src/site/docs/tutorials/forms/examples/slambook/out/web/tute_slambookform.dart

Issue 26922002: removing Web UI tutorials, updating remaining 4 to current release, + review pass (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: merge with master Created 7 years, 2 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/forms/examples/slambook/out/web/tute_slambookform.dart
diff --git a/src/site/docs/tutorials/forms/examples/slambook/out/web/xslambookform.dart b/src/site/docs/tutorials/forms/examples/slambook/out/web/tute_slambookform.dart
similarity index 55%
rename from src/site/docs/tutorials/forms/examples/slambook/out/web/xslambookform.dart
rename to src/site/docs/tutorials/forms/examples/slambook/out/web/tute_slambookform.dart
index 2bb91308ae360852c6c0ffa582bc793172188932..a8e7a6a03ff40deaf9277335419c55f1cccb6bdc 100644
--- a/src/site/docs/tutorials/forms/examples/slambook/out/web/xslambookform.dart
+++ b/src/site/docs/tutorials/forms/examples/slambook/out/web/tute_slambookform.dart
@@ -1,52 +1,32 @@
import 'dart:html';
-import 'dart:json' as json;
+import 'dart:convert';
import 'package:polymer/polymer.dart';
-@CustomTag('x-slambook-form')
-class SlamBookComponent extends PolymerElement with ChangeNotifierMixin {
-
- String __$firstName = "mem";
- String get firstName => __$firstName;
- set firstName(String value) {
- __$firstName = notifyPropertyChange(const Symbol('firstName'), __$firstName, value);
- }
+@CustomTag('tute-slambook-form')
+class TuteSlamBookForm extends PolymerElement {
+ @observable String get firstName => __$firstName; String __$firstName = "mem"; set firstName(String value) { __$firstName = notifyPropertyChange(#firstName, __$firstName, value); }
// Set up the maps for the form and give initial values.
// Boolean values in this map are bound with bind-checked to checkboxes.
- Map<String, bool> __$favoriteThings = toObservable({
- 'kittens': true, 'raindrops': false,
- 'mittens': true, 'kettles': false});
- Map<String, bool> get favoriteThings => __$favoriteThings;
- set favoriteThings(Map<String, bool> value) {
- __$favoriteThings = notifyPropertyChange(const Symbol('favoriteThings'), __$favoriteThings, value);
- }
-
+ @observable Map<String, bool> get favoriteThings => __$favoriteThings; Map<String, bool> __$favoriteThings = toObservable({
+ 'kittens': true, 'raindrops': false,
+ 'mittens': true, 'kettles': false}); set favoriteThings(Map<String, bool> value) { __$favoriteThings = notifyPropertyChange(#favoriteThings, __$favoriteThings, value); }
// This map contains the rest of the forma data.
- Map __$theData = toObservable({
- 'firstName': 'mem',
- 'favoriteQuote': 'Enjoy all your meals.',
- 'favoriteColor': '#4169E1',
- 'birthday': '1963-08-30',
- 'volume': '11', //I want this to be bound to an integer!
- 'catOrDog': 'dog',
- 'music': 2,
- 'zombies': true
- // Add favoriteThings later...can't do it here...there is no this.
- });
- Map get theData => __$theData;
- set theData(Map value) {
- __$theData = notifyPropertyChange(const Symbol('theData'), __$theData, value);
- }
-
+ @observable Map get theData => __$theData; Map __$theData = toObservable({
+ 'firstName': 'mem',
+ 'favoriteQuote': 'Enjoy all your meals.',
+ 'favoriteColor': '#4169E1',
+ 'birthday': '1963-08-30',
+ 'volume': '11', //I want this to be bound to an integer!
+ 'catOrDog': 'dog',
+ 'music': 2,
+ 'zombies': true
+ // Add favoriteThings later...can't do it here...there is no this.
+ }); set theData(Map value) { __$theData = notifyPropertyChange(#theData, __$theData, value); }
- String __$serverResponse = '';
- String get serverResponse => __$serverResponse;
- set serverResponse(String value) {
- __$serverResponse = notifyPropertyChange(const Symbol('serverResponse'), __$serverResponse, value);
- }
-
+ @observable String get serverResponse => __$serverResponse; String __$serverResponse = ''; set serverResponse(String value) { __$serverResponse = notifyPropertyChange(#serverResponse, __$serverResponse, value); }
HttpRequest request;
void submitForm(Event e, var detail, Node target) {
@@ -95,12 +75,12 @@ class SlamBookComponent extends PolymerElement with ChangeNotifierMixin {
theData['catOrDog'] = 'cat';
theData['music'] = 0;
theData['zombies'] = false;
- serverResponse = 'Data cleared.';
+ serverResponse = 'Data reset.';
}
String _slambookAsJsonData() {
// Put favoriteThings in the map.
theData['favoriteThings'] = favoriteThings;
- return json.stringify(theData);
+ return JSON.encode(theData);
}
}

Powered by Google App Engine
This is Rietveld 408576698