This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yvonne Yip
committed
Sep 10, 2013
1 parent
ea1b46b
commit 52edfe2
Showing
5 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<link href="../../../polymer-elements/polymer-ajax/polymer-ajax.html" rel="import"> | ||
<polymer-element name="buildbot-ajax" extends="polymer-ajax" attributes="response builder" on-polymer-response="responseAction"> | ||
<script> | ||
Polymer('buildbot-ajax', { | ||
handleAs: 'json', | ||
response: null, | ||
builderChanged: function() { | ||
if (this.builder) { | ||
this.url = 'http://build.chromium.org/p/client.polymer/json/builders/' + this.builder + '/builds/-1'; | ||
this.go(); | ||
} | ||
}, | ||
responseAction: function(e, response) { | ||
console.log(response.response); | ||
var result = { | ||
success: response.response.results ? false : true, | ||
browsers: [] | ||
}; | ||
var foundTest = false; | ||
for (var i = 0, s; s = response.response.steps[i]; i++) { | ||
if (foundTest) { | ||
var match = String(s.text).match(/([a-zA-Z]+) ([0-9]+)/); | ||
result.browsers.push({ | ||
browser: match[1], | ||
version: match[2], | ||
success: s.results[0] ? false : true | ||
}); | ||
} | ||
if (s.name === 'test') { | ||
foundTest = true; | ||
} | ||
} | ||
this.response = result; | ||
console.log(this.response); | ||
} | ||
}); | ||
</script> | ||
</polymer-element> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<link href="test-dashboard.html" rel="import"> | ||
<script src="../../../polymer/polymer.js"></script> | ||
<link href="../../../polymer-ui-elements/basic.css" rel="stylesheet"> | ||
</head> | ||
<body class="polymer-ui-body-text"> | ||
<h1>Polymer!</h1> | ||
<test-dashboard></test-dashboard> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<link href="../../../polymer-elements/polymer-flex-layout/polymer-flex-layout.html" rel="import"> | ||
<link href="buildbot-ajax.html" rel="import"> | ||
<polymer-element name="test-dashboard-cell" attributes="builder response"> | ||
<template> | ||
<style> | ||
span { | ||
background-color: #e88; | ||
border-radius: 3px; | ||
margin: 1px; | ||
padding: 3px 10px; | ||
} | ||
span.passed { | ||
background-color: #8d4; | ||
} | ||
</style> | ||
<buildbot-ajax builder="{{builder}}" response="{{response}}"></buildbot-ajax> | ||
<template repeat="{{browser in response.browsers}}"> | ||
<span class="{{passed: browser.success}}">{{browser.browser}} {{browser.version}}</span> | ||
</template> | ||
<template if="{{!response.success && response.browsers.length == 0}}"> | ||
<span>failing :(</span> | ||
</template> | ||
</template> | ||
<script> | ||
Polymer('test-dashboard-cell'); | ||
</script> | ||
</polymer-element> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<link href="../../../polymer-elements/polymer-flex-layout/polymer-flex-layout.html" rel="import"> | ||
<link href="test-dashboard-cell.html" rel="import"> | ||
<polymer-element name="test-dashboard-row" attributes="project"> | ||
<template> | ||
<style> | ||
:host { | ||
display: block; | ||
margin: 5px; | ||
} | ||
.label { | ||
display: inline-block; | ||
width: 160px; | ||
background-color: #eee; | ||
padding: 3px 10px; | ||
} | ||
</style> | ||
<div class="label">{{project}}</div> | ||
<template repeat="{{plat in platforms}}"> | ||
{{plat}} <test-dashboard-cell builder="{{project}} {{plat}}"></test-dashboard-cell> | ||
</template> | ||
</template> | ||
<script> | ||
Polymer('test-dashboard-row', { | ||
platforms: ['Mac', 'Win', 'Linux'] | ||
}); | ||
</script> | ||
</polymer-element> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<link href="test-dashboard-row.html" rel="import"> | ||
<polymer-element name="test-dashboard" attributes="projects"> | ||
<template> | ||
<template repeat="{{projects}}"> | ||
<test-dashboard-row project="{{}}"></test-dashboard-row> | ||
</template> | ||
</template> | ||
<script> | ||
Polymer('test-dashboard', { | ||
projects: [ | ||
'polymer', | ||
'platform', | ||
'CustomElements', | ||
'HTMLImports', | ||
'ShadowDOM', | ||
'TemplateBinding', | ||
'NodeBind', | ||
'observe-js', | ||
'polymer-expressions', | ||
'PointerEvents', | ||
'PointerGestures', | ||
// 'WeakMap' | ||
] | ||
}); | ||
</script> | ||
</polymer-element> |