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

Unified Diff: runtime/bin/vmservice/observatory/lib/src/elements/eval_box.dart

Issue 810623005: Build Observatory with runtime (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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: runtime/bin/vmservice/observatory/lib/src/elements/eval_box.dart
diff --git a/runtime/bin/vmservice/observatory/lib/src/elements/eval_box.dart b/runtime/bin/vmservice/observatory/lib/src/elements/eval_box.dart
deleted file mode 100644
index f8285f22cfbec302152d8503a3d3159619e61dab..0000000000000000000000000000000000000000
--- a/runtime/bin/vmservice/observatory/lib/src/elements/eval_box.dart
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library eval_box_element;
-
-import 'dart:async';
-import 'dart:html';
-import 'observatory_element.dart';
-import 'package:polymer/polymer.dart';
-
-
-typedef Future evalType(String text);
-
-
-@CustomTag('eval-box')
-class EvalBoxElement extends ObservatoryElement {
- @observable String text;
- @observable String lineMode = "1-line";
-
- @published evalType callback;
- @observable ObservableList results = toObservable([]);
-
- void updateLineMode(Event e, var detail, Node target) {
- lineMode = (e.target as InputElement).value;
- if (lineMode == '1-line') {
- text = text.replaceAll('\n', ' ');
- }
- }
-
- void eval(Event e, var detail, Node target) {
- // Prevent any form action.
- e.preventDefault();
-
- // Clear the text box.
- var expr = text;
- text = '';
-
- // Use provided callback to eval the expression.
- if (callback != null) {
- var map = toObservable({});
- map['expr'] = expr;
- results.insert(0, map);
- callback(expr).then((result) {
- map['value'] = result;
- });
- }
- }
-
- void selectExpr(MouseEvent e) {
- assert(e.target is Element);
- Element targetElement = e.target;
- text = targetElement.getAttribute('expr');
- }
-
- EvalBoxElement.created() : super.created();
-}

Powered by Google App Engine
This is Rietveld 408576698