MtF-wiki/layouts/shortcodes/github/contributors.html

3 lines
1017 B
HTML

<div style="padding: 0 1rem;margin: 0 0 1rem;margin-block-start: 1em;margin-block-end: 1em"><ul id="cons" style="list-style: none;"></ul><br></div>
<p style="float:none;clear:both;"></p>
<script>var getJSON = function(url, callback) {var xhr = new XMLHttpRequest();xhr.open('GET', url, true);xhr.responseType = 'json';xhr.onload = function() {var status = xhr.status;if (status === 200) {callback(null, xhr.response);} else {callback(status, xhr.response);}};xhr.send();};getJSON('https://api.github.com/repos/mtf-wiki/MtF-Wiki/contributors?per_page=100',function(err, data) {if (err === null) {for(i in data){var para = document.createElement("li");var node = document.createElement("a");var node2 = document.createElement("img");para.style="margin: 4px;float: left;";node2.style="width: 32px;height: 32px;border-radius: 50%;";node.href=data[i].html_url;node2.src=data[i].avatar_url;node.appendChild(node2);para.appendChild(node);var element = document.getElementById("cons");element.appendChild(para);}}});</script>