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

Unified Diff: Tools/GardeningServer/model/ct-commit.html

Issue 402603007: Get sheriff-o-matic data from auto-sheriff.appspot.com. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update and delete old code Created 6 years, 5 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: Tools/GardeningServer/model/ct-commit.html
diff --git a/Tools/GardeningServer/model/ct-commit.html b/Tools/GardeningServer/model/ct-commit.html
index f23e821404997b68e2e2c47c9c108b8c362d88c9..836f15e636cb52af0731d4f81dc2bd2d2ca76e6a 100644
--- a/Tools/GardeningServer/model/ct-commit.html
+++ b/Tools/GardeningServer/model/ct-commit.html
@@ -5,11 +5,29 @@ found in the LICENSE file.
-->
<script>
-function CTCommit(author, message) {
+function CTCommit(author, message, baseUrl) {
ojan 2014/07/21 00:44:56 I can split these changes out to a different patch
this.author = author;
this.message = message.trim();
this.revision = this._findRevision();
this.summary = this.message.split('\n')[0];
+ this._baseUrl = baseUrl;
+}
+
+CTCommit.prototype.url = function() {
abarth-chromium 2014/07/21 06:44:17 Getter?
ojan 2014/07/21 22:46:13 I really dislike getters. They make for surprising
+ var queryParameters = {
+ view: 'rev',
+ revision: this.revision,
+ };
+ return this._baseUrl + '?' + CTCommit._queryParam(queryParameters);
+}
+
+// FIXME: This should live somewhere better so it can be reused.
+CTCommit._queryParam = function(params) {
abarth-chromium 2014/07/21 06:44:17 Object.toQueryString from sugar
ojan 2014/07/21 22:46:13 Not sure how I missed that.
+ var result = []
+ Object.keys(params, function(key, value) {
+ result.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
+ });
+ return result.join('&');
}
CTCommit.prototype._findRevision = function(message) {
@@ -19,4 +37,4 @@ CTCommit.prototype._findRevision = function(message) {
return parseInt(match[1], 10);
return null;
}
-</script>
+</script>
« no previous file with comments | « no previous file | Tools/GardeningServer/model/ct-commit-log.html » ('j') | Tools/GardeningServer/ui/ct-builder-grid.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698