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

Unified Diff: appengine/swarming/elements/res/imp/botlist/bot-list-shared.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: Address comments 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 side-by-side diff with in-line comments
Download patch
Index: appengine/swarming/elements/res/imp/botlist/bot-list-shared.html
diff --git a/appengine/swarming/elements/res/imp/botlist/bot-list-shared.html b/appengine/swarming/elements/res/imp/botlist/bot-list-shared.html
index 0ab9945e0cb2d73629f37291fa300f683b60aade..5a4bb89cc0a718e30ecb8f4b82f470f0850f5097 100644
--- a/appengine/swarming/elements/res/imp/botlist/bot-list-shared.html
+++ b/appengine/swarming/elements/res/imp/botlist/bot-list-shared.html
@@ -10,9 +10,8 @@
behaviors: [SwarmingBehaviors.BotListBehavior]
in the creation of your Polymer element.
-->
+<link rel="import" href="/res/imp/common/swarming-app.html">
<script>
-
- window.SwarmingBehaviors = window.SwarmingBehaviors || {};
(function(){
var ANDROID_ALIASES = {
"bullhead": "Nexus 5X",
@@ -68,8 +67,9 @@
// This regex matches a string like "ALIAS (ORIG)", with ORIG as group 1.
var ALIAS_REGEXP = /.+ \((.*)\)/;
- // This behavior wraps up all the shared bot-list functionality.
- SwarmingBehaviors.BotListBehavior = {
+ // This behavior wraps up all the shared bot-list functionality by
+ // extending SwarmingBehaviors.SwarmingBehavior
+ SwarmingBehaviors.BotListBehavior = [SwarmingBehaviors.SwarmingBehavior, {
properties: {
DIMENSIONS_WITH_ALIASES: {
@@ -144,19 +144,6 @@
return GPU_ALIASES[gpu] || UNKNOWN;
},
- _not: function(a) {
- return !a;
- },
-
- _or: function() {
- var result = false;
- // can't use .foreach, as arguments isn't really a function.
- for (var i = 0; i < arguments.length; i++) {
- result = result || arguments[i];
- }
- return result;
- },
-
// _state returns the requested attribute from a bot's state.
// For consistency with _dimension, if the attribute is not an array,
// it is put as the only element in an array.
@@ -187,6 +174,6 @@
}
return str;
},
- }
+ }];
})()
</script>

Powered by Google App Engine
This is Rietveld 408576698