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

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

Issue 2227803002: Mirror filters and sort preferences to url-params (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@use-dimensions
Patch Set: Tweak 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/build/js/js.js » ('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
deleted file mode 100644
index 1c17ee57a431c00bd7e939edd0623fd720089501..0000000000000000000000000000000000000000
--- a/appengine/swarming/elements/build/js/common.js
+++ /dev/null
@@ -1 +0,0 @@
-this.swarming=this.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(!isNaN(ns)){return ns}return a.localeCompare(b)};var TIME_DELTAS=[{units:"w",delta:7*24*60*60},{units:"d",delta:24*60*60},{units:"h",delta:60*60},{units:"m",delta:60},{units:"s",delta:1}];swarming.diffDate=function(s,now){var ms=typeof s=="number"?s:Date.parse(s);now=now||Date.now();var diff=(ms-now)/1e3;if(diff<0){diff=-1*diff}return humanize(diff,TIME_DELTAS)};swarming.KB=1024;swarming.MB=swarming.KB*1024;swarming.GB=swarming.MB*1024;var BYTES_DELTAS=[{units:" TB",delta:1024*swarming.GB},{units:" GB",delta:swarming.GB},{units:" MB",delta:swarming.MB},{units:" KB",delta:swarming.KB},{units:" B",delta:1}];swarming.humanBytes=function(b,unit){if(Number.isInteger(unit)){b=b*unit}return humanize(b,BYTES_DELTAS)};function humanize(n,deltas){for(var i=0;i<deltas.length-1;i++){var nextDeltaRounded=Math.round(n/deltas[i+1].delta)*deltas[i+1].delta;if(nextDeltaRounded/deltas[i].delta>=1){return Math.round(n/deltas[i].delta)+deltas[i].units}}var i=DELTAS.length-1;return Math.round(n/DELTAS[i].delta)+DELTAS[i].units}return swarming}();
« no previous file with comments | « appengine/swarming/elements/build/elements.html ('k') | appengine/swarming/elements/build/js/js.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698