| OLD | NEW |
| (Empty) |
| 1 <link rel="import" href="../../../../packages/polymer/polymer.html"> | |
| 2 | |
| 3 <polymer-element name="eval-box"> | |
| 4 <template> | |
| 5 <style> | |
| 6 .textbox { | |
| 7 flex-grow: 1; | |
| 8 font: 400 16px 'Montserrat', sans-serif; | |
| 9 } | |
| 10 .bigtextbox { | |
| 11 flex-grow: 1; | |
| 12 font: 400 16px 'Montserrat', sans-serif; | |
| 13 } | |
| 14 .button { | |
| 15 font: 400 16px 'Montserrat', sans-serif; | |
| 16 margin-left: 0.5em; | |
| 17 margin-right: 0.5em; | |
| 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 a.boxclose { | |
| 46 margin-left: 20px; | |
| 47 valign: top; | |
| 48 display: block; | |
| 49 height: 18px; | |
| 50 width: 18px; | |
| 51 line-height: 16px; | |
| 52 border-radius: 9px; | |
| 53 color: black; | |
| 54 font-size: 18px; | |
| 55 cursor: pointer; | |
| 56 text-align: center; | |
| 57 } | |
| 58 a.boxclose:hover { | |
| 59 background: lightgray; | |
| 60 } | |
| 61 </style> | |
| 62 <form style="display:flex; flex-direction:row; align-items:flex-end"> | |
| 63 <template if="{{ lineMode == '1-line' }}"> | |
| 64 <input class="textbox" type="text" value="{{ text }}"> | |
| 65 </template> | |
| 66 <template if="{{ lineMode == 'N-line' }}"> | |
| 67 <textarea class="bigtextbox" | |
| 68 value="{{ text }}"></textarea> | |
| 69 </template> | |
| 70 | |
| 71 <input class="button" type="submit" value="Evaluate" on-click="{{ evaluate
}}"> | |
| 72 <div class="radios" on-change="{{ updateLineMode }}"> | |
| 73 <label for="1-line"> | |
| 74 <input type="radio" name="lineMode" value="1-line" checked> | |
| 75 1-line | |
| 76 </label> | |
| 77 <label for="N-line"> | |
| 78 <input type="radio" name="lineMode" value="N-line"> | |
| 79 N-line | |
| 80 </label> | |
| 81 </div> | |
| 82 </form> | |
| 83 | |
| 84 <br> | |
| 85 <template if="{{ results.isNotEmpty }}"> | |
| 86 <table> | |
| 87 <tr template repeat="{{ result in results }}"> | |
| 88 <td class="historyExpr"> | |
| 89 <a class="expr" on-click="{{ selectExpr }}" | |
| 90 expr="{{ result['expr'] }}">{{ result['expr'] }}</a> | |
| 91 </td> | |
| 92 <td class="historyValue"> | |
| 93 <template if="{{ result['error'] != null}}"> | |
| 94 <div style="color:red">{{ result['error'] }}</div> | |
| 95 </template> | |
| 96 <template if="{{ result['error'] == null}}"> | |
| 97 <template if="{{ result['value'] != null }}"> | |
| 98 <any-service-ref ref="{{ result['value'] }}"></any-service-ref> | |
| 99 </template> | |
| 100 <template if="{{ result['value'] == null }}"> | |
| 101 <div style="color:#aaa;cursor:wait;"><pending></div> | |
| 102 </template> | |
| 103 </template> | |
| 104 </td> | |
| 105 <td> | |
| 106 <a class="boxclose" on-click="{{ closeItem }}" | |
| 107 closeId="{{ result['id'] }}">×</a> | |
| 108 </td> | |
| 109 </tr> | |
| 110 </table> | |
| 111 </template> | |
| 112 </template> | |
| 113 </polymer-element> | |
| 114 | |
| 115 <script type="application/dart" src="eval_box.dart"></script> | |
| OLD | NEW |