Title: [201370] trunk/Tools
- Revision
- 201370
- Author
- [email protected]
- Date
- 2016-05-24 18:21:45 -0700 (Tue, 24 May 2016)
Log Message
Reorganize dashboard code: move code from _timeIntervalString to base class
https://bugs.webkit.org/show_bug.cgi?id=158047
rdar://problem/26457274
Reviewed by Alexey Proskuryakov and Dean Johnson.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js:
(BubbleQueueView.prototype._timeIntervalString): Moved core logic to base class so as to make it re-usable.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js:
(QueueView.prototype._readableTimeString): Same.
Modified Paths
Diff
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js (201369 => 201370)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js 2016-05-25 00:55:13 UTC (rev 201369)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js 2016-05-25 01:21:45 UTC (rev 201370)
@@ -97,20 +97,8 @@
_timeIntervalString: function(time)
{
- var secondsInHour = 60 * 60;
var timeDifference = (Date.now() - time.getTime()) / 1000;
- var hours = Math.floor(timeDifference / secondsInHour);
- var minutes = Math.floor((timeDifference - hours * secondsInHour) / 60);
- var hoursPart = "";
- if (hours === 1)
- hoursPart = "1\xa0hour and ";
- else if (hours > 0)
- hoursPart = hours + "\xa0hours and ";
- if (!minutes)
- return "less than a minute";
- if (minutes === 1)
- return hoursPart + "1\xa0minute";
- return hoursPart + minutes + "\xa0minutes";
+ return this._readableTimeString(timeDifference)
},
_popoverContentForBubbleQueue: function(queue)
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js (201369 => 201370)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js 2016-05-25 00:55:13 UTC (rev 201369)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js 2016-05-25 01:21:45 UTC (rev 201370)
@@ -227,5 +227,22 @@
return "r" + revision;
// Truncating for display. Git traditionally uses seven characters for a short hash.
return revision.substr(0, 7);
+ },
+
+ _readableTimeString: function(seconds)
+ {
+ var secondsInHour = 60 * 60;
+ var hours = Math.floor(seconds / secondsInHour);
+ var minutes = Math.floor((seconds - hours * secondsInHour) / 60);
+ var hoursPart = "";
+ if (hours === 1)
+ hoursPart = "1\xa0hour and ";
+ else if (hours > 0)
+ hoursPart = hours + "\xa0hours and ";
+ if (!minutes)
+ return "less than a minute";
+ if (minutes === 1)
+ return hoursPart + "1\xa0minute";
+ return hoursPart + minutes + "\xa0minutes";
}
};
Modified: trunk/Tools/ChangeLog (201369 => 201370)
--- trunk/Tools/ChangeLog 2016-05-25 00:55:13 UTC (rev 201369)
+++ trunk/Tools/ChangeLog 2016-05-25 01:21:45 UTC (rev 201370)
@@ -1,3 +1,16 @@
+2016-05-24 Aakash Jain <[email protected]>
+
+ Reorganize dashboard code: move code from _timeIntervalString to base class
+ https://bugs.webkit.org/show_bug.cgi?id=158047
+ rdar://problem/26457274
+
+ Reviewed by Alexey Proskuryakov and Dean Johnson.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueView.js:
+ (BubbleQueueView.prototype._timeIntervalString): Moved core logic to base class so as to make it re-usable.
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js:
+ (QueueView.prototype._readableTimeString): Same.
+
2016-05-24 Yusuke Suzuki <[email protected]>
[JSC][GTK][EFL] Allow run-jsc-benchmark to use WebKitTestRunner in EFL / GTK ports
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes