OLD | NEW |
| (Empty) |
1 <link rel="import" href="../../../../packages/polymer/polymer.html"> | |
2 <link rel="import" href="instance_ref.html"> | |
3 <link rel="import" href="error_ref.html"> | |
4 <link rel="import" href="observatory_element.html"> | |
5 | |
6 <polymer-element name="eval-box" extends="observatory-element"> | |
7 <template> | |
8 <style> | |
9 .textbox { | |
10 flex-grow: 1; | |
11 font: 400 16px 'Montserrat', sans-serif; | |
12 } | |
13 .bigtextbox { | |
14 font: 400 16px 'Montserrat', sans-serif; | |
15 } | |
16 .button { | |
17 font: 400 16px 'Montserrat', sans-serif; | |
18 } | |
19 .radios { | |
20 display: inline; | |
21 padding-right: 30px; | |
22 } | |
23 .radios label{ | |
24 padding-left: 10px; | |
25 } | |
26 .historyExpr, .historyValue { | |
27 vertical-align: text-top; | |
28 font: 400 14px 'Montserrat', sans-serif; | |
29 } | |
30 .historyExpr a { | |
31 display: block; | |
32 color: black; | |
33 text-decoration: none; | |
34 padding: 6px 6px; | |
35 cursor: pointer; | |
36 white-space: pre-line; | |
37 } | |
38 .historyExpr a:hover { | |
39 background-color: #fff3e3; | |
40 } | |
41 .historyValue { | |
42 display: block; | |
43 padding: 6px 6px; | |
44 } | |
45 </style> | |
46 <form style="display:flex; flex-direction:row; align-items:flex-end"> | |
47 <template if="{{ lineMode == '1-line' }}"> | |
48 <input class="textbox" type="text" value="{{ text }}"> | |
49 </template> | |
50 <template if="{{ lineMode == 'N-line' }}"> | |
51 <textarea class="bigtextbox" rows="5" cols="80" | |
52 value="{{ text }}"></textarea> | |
53 </template> | |
54 | |
55 <input class="button" type="submit" value="Evaluate" on-click="{{ eval }}"
> | |
56 <div class="radios" on-change="{{ updateLineMode }}"> | |
57 <label for="1-line"> | |
58 <input type="radio" name="lineMode" value="1-line" checked> | |
59 1-line | |
60 </label> | |
61 <label for="N-line"> | |
62 <input type="radio" name="lineMode" value="N-line"> | |
63 N-line | |
64 </label> | |
65 </div> | |
66 </form> | |
67 | |
68 <br> | |
69 <template if="{{ results.isNotEmpty }}"> | |
70 <table> | |
71 <tr template repeat="{{ result in results }}"> | |
72 <td class="historyExpr"> | |
73 <a class="expr" on-click="{{ selectExpr }}" | |
74 expr="{{ result['expr'] }}">{{ result['expr'] }}</a> | |
75 </td> | |
76 <td class="historyValue"> | |
77 <template if="{{ result['value'] == null }}"> | |
78 <div style="color:#aaa;cursor:wait;"><pending></div> | |
79 </template> | |
80 <template if="{{ result['value'] != null }}"> | |
81 <any-service-ref ref="{{ result['value'] }}"></any-service-ref> | |
82 </template> | |
83 </td> | |
84 </tr> | |
85 </table> | |
86 </template> | |
87 </template> | |
88 </polymer-element> | |
89 | |
90 <script type="application/dart" src="eval_box.dart"></script> | |
OLD | NEW |