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

Side by Side Diff: golden/res/imp/commit-panel.html

Issue 1200343002: gold: ByBlame WIP (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: rebase Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « golden/go/skiacorrectness/main2.go ('k') | golden/res/imp/testsummarydetails.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!-- The <commits-panel-sk> custom element declaration.
2
3 An element to display information on one or more commits.
4
5 Attributes:
6 mailbox - The sk.Mailbox name to listen for the data to populate
7 the element. The mailbox data needs to be a serialized slice
8 of []*types.Commit.
9
10 Events:
11 None.
12
13 Methods:
14 None.
15
16
17 -->
18 <polymer-element name="commits-panel-sk">
19 <template>
20 <table>
21 <template repeat="{{c in commitinfo}}">
22 <tr>
23 <td>{{c.author}}</td>
24 <td>{{c.commit_time | humanize}}</td>
25 <td><a href="https://skia.googlesource.com/skia/+/{{c.hash}}">{{c.hash | trunc}}</a></td>
26 <td>{{c.message}}</td>
27 </tr>
28 </template>
29 </table>
30 </template>
31 <script>
32 Polymer({
33 publish: {
34 mailbox: {
35 value: "",
36 reflect: true,
37 },
38 },
39
40 ready: function() {
41 sk.Mailbox.subscribe(this.mailbox, function(info) {
42 this.commitinfo = info;
43 this.populateCommitMessage();
44 }.bind(this));
45 },
46
47 populateCommitMessage: function() {
48 if (this.commitinfo && this.commitinfo.length && this.commitinfo[0].mess age == undefined) {
49 var lastHash = this.commitinfo[0].hash;
50 var url = "https://skia.googlesource.com/skia/+log/" + lastHash + "~" + this.commitinfo.length + ".." + lastHash + "?format=json";
51 sk.get(url).then(this.removeSecurityHeader).then(JSON.parse).then(func tion(json) {
52 var len = this.commitinfo.length;
53 for (var i=0; i<json.log.length; i++) {
54 this.commitinfo[i].message = json.log[i].message.slice(0, 60);
55 }
56 }.bind(this));
57 }
58 },
59
60 // removeSecurityHeader strips the first 4 chars from the input. Needed
61 // since googlesource.com prefixes all JSON responses with )]}' as an
62 // XSS defense.
63 removeSecurityHeader: function(s) {
64 return s.slice(4, s.length);
65 },
66
67 humanize: function(s) {
68 return sk.human.diffDate(s*1000);
69 },
70
71 trunc: function(s) {
72 return s.slice(0, 7);
73 }
74
75 });
76 </script>
77 </polymer-element>
OLDNEW
« no previous file with comments | « golden/go/skiacorrectness/main2.go ('k') | golden/res/imp/testsummarydetails.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698