| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>commit-detail-picker-sk</title> |
| <meta charset="utf-8" /> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <style type="text/css" media="screen"> |
| commit-detail-picker-sk { |
| margin: 2em; |
| display: block; |
| } |
| </style> |
| </head> |
| <body> |
| <h1>Commits</h1> |
| |
| <commit-detail-picker-sk></commit-detail-picker-sk> |
| |
| <div> |
| Event: <pre id=evt></pre> |
| </div> |
| |
| <script type="text/javascript" charset="utf-8"> |
| const commitinfo = [ |
| { |
| ts: 1439649751, |
| author: "foo (foo@example.org)", |
| url: "skia.googlesource.com/bar", |
| message: "Commit from foo.", |
| }, |
| { |
| ts: 1439648914, |
| author: "bar (bar@example.org)", |
| url: "skia.googlesource.com/foo", |
| message: "Commit from bar", |
| }, |
| { |
| ts: 1439649951, |
| author: "foo (foo@example.org)", |
| url: "https://codereview.chromium.org/1490543002", |
| message: "Whitespace change", |
| }, |
| { |
| ts: 1439699951, |
| author: "foo (foo@example.org)", |
| url: "https://codereview.chromium.org/1490543002", |
| message: "Another whitespace change", |
| }, |
| ]; |
| let picker = document.querySelector('commit-detail-picker-sk'); |
| let evt = document.querySelector('#evt'); |
| picker.details = commitinfo; |
| picker.addEventListener('commit-selected', function(e) { |
| evt.textContent = JSON.stringify(e.detail, null, ' '); |
| }); |
| </script> |
| </body> |
| </html> |