29 lines
No EOL
977 B
JavaScript
29 lines
No EOL
977 B
JavaScript
$(document).ready(function() {
|
|
$.getJSON("data/chat.json", function(data) {
|
|
$(".chat .total .crapauds").text(data.crapauds.total);
|
|
$(".chat .total .canaux").text(data.canaux.total);
|
|
$(".chat .total .messages").text(data.messages.total);
|
|
$(".chat .recent .crapauds").text(data.crapauds.recent);
|
|
$(".chat .recent .canaux").text(data.canaux.recent);
|
|
$(".chat .recent .messages").text(data.messages.recent);
|
|
$(".chat ul").text("");
|
|
$.each(data.canaux.liste, function(i, canal) {
|
|
var link = $("<a>")
|
|
.attr("href", "https://coa.crapaud-fou.org/channel/" + canal)
|
|
.attr("class", "list-item")
|
|
.text(canal);
|
|
var li = $("<li>").append(link);
|
|
$(".chat ul").append(li);
|
|
});
|
|
console.log(data);
|
|
});
|
|
|
|
$(".chat").click(function(e) {
|
|
console.log(e.currentTarget);
|
|
// window.location = "https://coa.crapaud-fou.org";
|
|
});
|
|
$(".chat button").click(function(e) {
|
|
e.preventDefault();
|
|
});
|
|
|
|
}); |