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

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

Issue 2269643002: Extract shared filters and aliasing code (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: Address nit Created 4 years, 3 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
32 Properties: 21 Properties:
33 auth_headers: Object, Use this in iron-ajax to set oauth2 headers. 22 auth_headers: Object, Use this in iron-ajax to set oauth2 headers.
34 busy: Boolean, If the busy spinner should be active. 23 busy: Boolean, If the busy spinner should be active.
35 name: String, the name of the app to be displayed. 24 name: String, the name of the app to be displayed.
36 25
37 Methods: 26 Methods:
38 None. 27 None.
39 28
40 Events: 29 Events:
41 None. 30 None.
42 --> 31 -->
43 32
44 <link rel="import" href="/res/imp/bower_components/app-layout/app-layout.html"> 33 <link rel="import" href="/res/imp/bower_components/app-layout/app-layout.html">
45 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la yout-classes.html"> 34 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la yout-classes.html">
46 <link rel="import" href="/res/imp/bower_components/paper-spinner/paper-spinner-l ite.html"> 35 <link rel="import" href="/res/imp/bower_components/paper-spinner/paper-spinner-l ite.html">
47 36
48 <link rel="import" href="/res/imp/common/auth-signin.html"> 37 <link rel="import" href="auth-signin.html">
49 38
50 <dom-module id="swarming-app"> 39 <dom-module id="swarming-app">
51 <template> 40 <template>
52 <style include="iron-flex"> 41 <style include="iron-flex">
53 :host { 42 :host {
54 position: absolute; 43 position: absolute;
55 top: 0; 44 top: 0;
56 bottom: 0; 45 bottom: 0;
57 left: 0; 46 left: 0;
58 right: 0; 47 right: 0;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 <style> 130 <style>
142 * { 131 * {
143 font-family: sans-serif; 132 font-family: sans-serif;
144 } 133 }
145 /* Only style anchor tags that are actually linking somewhere.*/ 134 /* Only style anchor tags that are actually linking somewhere.*/
146 a[href] { 135 a[href] {
147 color: #1F78B4; 136 color: #1F78B4;
148 } 137 }
149 </style> 138 </style>
150 </dom-module> 139 </dom-module>
151
152 <script>
153 window.SwarmingBehaviors = window.SwarmingBehaviors || {};
154 (function(){
155 // This behavior wraps up all the shared swarming functionality.
156 SwarmingBehaviors.SwarmingBehavior = {
157
158 _not: function(a) {
159 return !a;
160 },
161
162 _or: function() {
163 var result = false;
164 // can't use .foreach, as arguments isn't really an Array.
165 for (var i = 0; i < arguments.length; i++) {
166 result = result || arguments[i];
167 }
168 return result;
169 },
170 };
171 })();
172 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698