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

Side by Side Diff: appengine/swarming/elements/res/imp/common/common-behavior.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, 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
(Empty)
1 <!--
2 Copyright 2016 The LUCI Authors. All rights reserved.
3 Use of this source code is governed under the Apache License, Version 2.0
4 that can be found in the LICENSE file.
5
6 It contains the definition of the following Behaviors:
7
8 SwarmingBehaviors.CommonBehavior
9
10 To use it, include
11 behaviors: [SwarmingBehaviors.CommonBehavior]
12 in the creation of any Polymer element.
13
14 SwarmingBehaviors.CommonBehavior contains shared functions to ease
15 templating, such as _or() and _not().
16 -->
17
18 <script>
19 window.SwarmingBehaviors = window.SwarmingBehaviors || {};
20 (function(){
21 // This behavior wraps up all the shared swarming functionality.
22 SwarmingBehaviors.CommonBehavior = {
23
24 _not: function(a) {
25 return !a;
26 },
27
28 _or: function() {
29 var result = false;
30 // can't use .foreach, as arguments isn't really an Array.
31 for (var i = 0; i < arguments.length; i++) {
32 result = result || arguments[i];
33 }
34 return result;
35 },
36 };
37 })();
38 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698