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

Unified Diff: appengine/swarming/elements/build/js/common.js

Issue 2204483002: Add UI to new botlist to show summary (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@bot-summary-api
Patch Set: Add docs 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
« no previous file with comments | « appengine/swarming/elements/build/elements.html ('k') | appengine/swarming/elements/package.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/elements/build/js/common.js
diff --git a/appengine/swarming/elements/build/js/common.js b/appengine/swarming/elements/build/js/common.js
index 0222686f2ceec2ad6e2b6d2fdc7c04ae1b7ff7a3..201745ec772a4264a6e3020c349abc0346189160 100644
--- a/appengine/swarming/elements/build/js/common.js
+++ b/appengine/swarming/elements/build/js/common.js
@@ -1,53 +1 @@
-// Copyright 2016 The LUCI Authors. All rights reserved.
-// Use of this source code is governed under the Apache License, Version 2.0
-// that can be found in the LICENSE file.
-
-window.swarming = window.swarming || function() {
- var swarming = {};
-
- swarming.stableSort = function(arr, comp) {
- if (!arr || !comp) {
- console.log("missing arguments to stableSort", arr, comp);
- return;
- }
- // We can guarantee a potential non-stable sort (like V8's
- // Array.prototype.sort()) to be stable by first storing the index in the
- // original sorting and using that if the original compare was 0.
- arr.forEach(function(e, i){
- if (e !== undefined && e !== null) {
- e.__sortIdx = i;
- }
- });
-
- arr.sort(function(a, b){
- // undefined and null elements always go last.
- if (a === undefined || a === null) {
- if (b === undefined || b === null) {
- return 0;
- }
- return 1;
- }
- if (b === undefined || b === null) {
- return -1;
- }
- var c = comp(a, b);
- if (c === 0) {
- return a.__sortIdx - b.__sortIdx;
- }
- return c;
- });
- }
-
- // naturalCompare tries to use natural sorting (e.g. sort ints by value).
- swarming.naturalCompare = function(a, b) {
- // Try numeric, aka "natural" sort and use it if ns is not NaN.
- // Javascript will try to corece these to numbers or return NaN.
- var ns = a - b;
- if (ns) {
- return ns;
- }
- return a.localeCompare(b);
- }
-
- return swarming;
-}();
+window.swarming=window.swarming||function(){var swarming={};swarming.stableSort=function(arr,comp){if(!arr||!comp){console.log("missing arguments to stableSort",arr,comp);return}arr.forEach(function(e,i){if(e!==undefined&&e!==null){e.__sortIdx=i}});arr.sort(function(a,b){if(a===undefined||a===null){if(b===undefined||b===null){return 0}return 1}if(b===undefined||b===null){return-1}var c=comp(a,b);if(c===0){return a.__sortIdx-b.__sortIdx}return c})};swarming.naturalCompare=function(a,b){var ns=a-b;if(ns){return ns}return a.localeCompare(b)};return swarming}();
« no previous file with comments | « appengine/swarming/elements/build/elements.html ('k') | appengine/swarming/elements/package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698