Permalink
Browse files

Added script to autoload participants (won't work till W3C enables CORS)

  • Loading branch information...
1 parent 212510a commit 339c1891b1a5d763f9dd01b4c7c346508506155e Marcos Caceres committed Oct 27, 2012
Showing with 37 additions and 3 deletions.
  1. +37 −3 index.html
View
@@ -263,10 +263,44 @@ <h1>Open Issues</h1>
<h1>Reference implementations</h1>
<p>We have a list of <a href="https://github.com/Wilto/draft-prop/wiki/Current-users,-polyfills,-prototypes,-and-implementations">current users, polyfills, prototypes, and implementations</a> on Github. </p>
<h1>Acknowledgements</h1>
- <p>TODO: add thanks</p>
+
+<p id="participants">A list of <a href="http://www.w3.org/community/respimg/participants">participants</a> is avialble at the W3C Community Group Website.</p>
</section>
<script src="https://raw.github.com/ResponsiveImagesCG/meta/master/scripts/show_issues.js"></script>
<script src="https://api.github.com/repos/ResponsiveImagesCG/picture-element/issues?state=open&amp;callback=processResponse"></script>
<script src="https://raw.github.com/ResponsiveImagesCG/meta/master/scripts/ga.js"></script>
-</body>
-</html>
+<script>
+//This script dynamically loads the participants of the CG and shows them in the spec.
+window.addEventListener("DOMContentLoaded", function requestParticipants(){
+ var xhr = new XMLHttpRequest(),
+ output = document.querySelector("#participants"),
+ participantsURL = output.querySelector("a").getAttribute("href"),
+ tempElem = document.createElement("temp"),
+ participants;
+ xhr.open("GET", participantsURL,true);
+ xhr.onreadystatechange= processParticipants;
+ xhr.send(null);
+
+ function processParticipants(){
+ if (xhr.readyState==4) {
+ //participants are in a table on the other website
+ tempElem.innerHTML = xhr.responseText;
+ participants = tempElem.querySelectorAll("td > h3");
+ if(participants.length > 0){
+ showParticipants(participants)
+ }
+ }
+ }
+
+ function showParticipants(){
+ var names = [],
+ prefix = "Participants of the Responsive Images Community Group are: ";
+ if(participants.length){
+ for(var i = 0; i < participants.length; i++){
+ names.push(participants.item(i).textContent);
+ }
+ output.innerHTML = prefix + names.join(", ") + ".";
+ }
+ }
+ }, false);
+</script>

5 comments on commit 339c189

Owner

Wilto replied Oct 27, 2012

Woah; is this gonna show all 166 people?

Owner

marcoscaceres replied Oct 27, 2012

Yes sir. But at the very bottom of the spec.

Owner

marcoscaceres replied Oct 27, 2012

It's actually just a paragraph of text.

Owner

Wilto replied Oct 27, 2012

Ah, okay. No complaints in either case; it should have the whole list represented. I was just worried we’d have to find a clever way to format it so it didn’t overwhelm the page.

Owner

marcoscaceres replied Oct 27, 2012

We can also add that if it gets too silly :) E.g., we can put a max height and then overflow:auto.

Please sign in to comment.