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

Side by Side Diff: appengine/swarming/elements/res/imp/common/swarming-app.html

Issue 2241413002: Refactor out reusable pieces from new Botlist (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 Copyright 2016 The LUCI Authors. All rights reserved. 2 Copyright 2016 The LUCI Authors. All rights reserved.
3 Use of this source code is governed under the Apache License, Version 2.0 3 Use of this source code is governed under the Apache License, Version 2.0
4 that can be found in the LICENSE file. 4 that can be found in the LICENSE file.
5 5
6 This in an HTML Import-able file that contains the definition 6 This in an HTML Import-able file that contains the definition
7 of the following elements: 7 of the following elements:
8 8
9 <swarming-app> 9 <swarming-app>
10 10
11 <swarming-app> is meant to be used in top level elements to provide the header 11 <swarming-app> is meant to be used in top level elements to provide the header
12 toolbar and authentication. 12 toolbar and authentication.
13 13
14 It contains the definition of the following style modules: 14 It contains the definition of the following style modules:
15 15
16 swarming-app-style 16 swarming-app-style
17 17
18 <style include="shared-style"> contains styles to be shared among all 18 <style include="shared-style"> contains styles to be shared among all
19 apps, such as colors. 19 apps, such as colors.
20 20
21 It contains the definition of the following Behaviors:
22
23 SwarmingBehaviors.SwarmingBehavior
24
25 To use it, include
26 behaviors: [SwarmingBehaviors.SwarmingBehavior]
27 in the creation of any Polymer element.
28
29 SwarmingBehaviors.SwarmingBehavior contains shared functions to ease
30 templating, such as _or() and _not().
31
21 Properties: 32 Properties:
22 auth_headers: Object, Use this in iron-ajax to set oauth2 headers. 33 auth_headers: Object, Use this in iron-ajax to set oauth2 headers.
23 busy: Boolean, If the busy spinner should be active. 34 busy: Boolean, If the busy spinner should be active.
24 name: String, the name of the app to be displayed. 35 name: String, the name of the app to be displayed.
25 36
26 Methods: 37 Methods:
27 None. 38 None.
28 39
29 Events: 40 Events:
30 None. 41 None.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 <dom-module id="swarming-app-style"> 139 <dom-module id="swarming-app-style">
129 <style> 140 <style>
130 * { 141 * {
131 font-family: sans-serif; 142 font-family: sans-serif;
132 } 143 }
133 /* Only style anchor tags that are actually linking somewhere.*/ 144 /* Only style anchor tags that are actually linking somewhere.*/
134 a[href] { 145 a[href] {
135 color: #1F78B4; 146 color: #1F78B4;
136 } 147 }
137 </style> 148 </style>
138 </dom-module> 149 </dom-module>
150
151 <script>
152 window.SwarmingBehaviors = window.SwarmingBehaviors || {};
153 (function(){
154 // This behavior wraps up all the shared swarming functionality.
155 SwarmingBehaviors.SwarmingBehavior = {
156
157 _not: function(a) {
158 return !a;
159 },
160
161 _or: function() {
162 var result = false;
163 // can't use .foreach, as arguments isn't really a function.
jcgregorio 2016/08/16 12:09:27 isn't really an Array.
kjlubick 2016/08/16 12:29:46 Fixed.
164 for (var i = 0; i < arguments.length; i++) {
165 result = result || arguments[i];
166 }
167 return result;
168 },
169 };
170 })();
171 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698