| Index: appengine/sheriff_o_matic/ui/ct-test-output.html
|
| diff --git a/appengine/sheriff_o_matic/ui/ct-test-output.html b/appengine/sheriff_o_matic/ui/ct-test-output.html
|
| index 0dd0fee69030646c8ef5275040be466522bc509c..8c8d717e88aa26f9b7a8747a1163055326d824bb 100644
|
| --- a/appengine/sheriff_o_matic/ui/ct-test-output.html
|
| +++ b/appengine/sheriff_o_matic/ui/ct-test-output.html
|
| @@ -2,13 +2,29 @@
|
| Copyright 2014 The Chromium Authors. All rights reserved.
|
| Use of this source code is governed by a BSD-style license that can be
|
| found in the LICENSE file.
|
| --->
|
| -
|
| -<link rel="import" href="ct-popout-iframe.html">
|
| +--><html><head><link rel="import" href="ct-popout-iframe.html">
|
| <link rel="import" href="ct-user-prefs.html">
|
| -<polymer-element name="ct-test-output" attributes="type url">
|
| - <template>
|
| - <style>
|
| + <!--
|
| + TODO(polyup): unable to infer path to components
|
| + directory. This import path is probably incomplete.
|
| + -->
|
| + <link rel="import" href="iron-flex-layout/iron-flex-layout.html">
|
| +<dom-module id="ct-test-output">
|
| + <style>
|
| + /* TODO(polyup): For speed, consider reworking these styles with .classes
|
| + and #ids rather than [attributes].
|
| + */
|
| + [layout] {
|
| + @apply(--layout);
|
| + }
|
| + [layout][vertical] {
|
| + @apply(--layout-vertical);
|
| + }
|
| + [layout][flex] {
|
| + @apply(--layout-flex);
|
| + }
|
| + </style>
|
| + <style>
|
| .result {
|
| border: 1px solid gray;
|
| line-height: 0;
|
| @@ -20,35 +36,62 @@ found in the LICENSE file.
|
| height: 400px;
|
| }
|
| </style>
|
| + <template>
|
|
|
| <ct-user-prefs id="userPrefs"></ct-user-prefs>
|
| - <div class="result" flex layout vertical>
|
| - <template if="{{url}}">
|
| - <template if="{{type == _kImageType}}">
|
| + <div class="result" flex="" layout="" vertical="">
|
| + <template is="dom-if" if="{{url}}">
|
| + <template is="dom-if" if="{{computeIf(_kImageType, type)}}">
|
| <img src="{{url}}">
|
| </template>
|
| - <template if="{{type == _kTextType}}">
|
| - <ct-popout-iframe src="{{ {url: url, useUber: $.userPrefs.values.useUberchromegw} | rewriteUrl }}" flex></ct-popout-iframe>
|
| + <template is="dom-if" if="{{computeIf2(_kTextType, type)}}">
|
| + <ct-popout-iframe src="{{computeSrc($, url)}}" flex=""></ct-popout-iframe>
|
| </template>
|
| - <template if="{{type == _kAudioType}}">
|
| - <audio controls src="{{url}}"></audio>
|
| + <template is="dom-if" if="{{computeIf3(_kAudioType, type)}}">
|
| + <audio controls="" src="{{url}}"></audio>
|
| </template>
|
| </template>
|
| </div>
|
| </template>
|
| - <script>
|
| - Polymer({
|
| - type: '',
|
| - url: '',
|
| - rewriteUrl: function(props) {
|
| - if (this.$ && this.$.userPrefs) {
|
| - return this.$.userPrefs.rewriteUrl(props.url);
|
| - }
|
| - return props.url;
|
| - },
|
| - _kAudioType: results.kAudioType,
|
| - _kImageType: results.kImageType,
|
| - _kTextType: results.kTextType,
|
| + <script>
|
| + Polymer({
|
| + is: 'ct-test-output',
|
| + properties: {
|
| + type: {
|
| + type: String,
|
| + value: '',
|
| + notify: true
|
| + },
|
| + url: {
|
| + type: String,
|
| + value: '',
|
| + notify: true
|
| + }
|
| + },
|
| + rewriteUrl: function (props) {
|
| + if (this.$ && this.$.userPrefs) {
|
| + return this.$.userPrefs.rewriteUrl(props.url);
|
| + }
|
| + return props.url;
|
| + },
|
| + _kAudioType: results.kAudioType,
|
| + _kImageType: results.kImageType,
|
| + _kTextType: results.kTextType,
|
| + computeIf: function (_kImageType, type) {
|
| + return type == _kImageType;
|
| + },
|
| + computeIf2: function (_kTextType, type) {
|
| + return type == _kTextType;
|
| + },
|
| + computeIf3: function (_kAudioType, type) {
|
| + return type == _kAudioType;
|
| + },
|
| + computeSrc: function ($, url) {
|
| + return this.rewriteUrl({
|
| + url: url,
|
| + useUber: $.userPrefs.values.useUberchromegw
|
| });
|
| - </script>
|
| -</polymer-element>
|
| + }
|
| + });
|
| + </script>
|
| +</dom-module>
|
|
|