portail/site/crapaud-fou.js

68 lines
2.5 KiB
JavaScript
Raw Normal View History

2019-08-16 21:39:08 +00:00
$(document).ready(function() {
2019-08-17 14:27:32 +00:00
// chat
2019-08-16 21:39:08 +00:00
$.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);
});
2019-08-20 15:38:55 +00:00
$.each(data.cohortes, function(i, canal) {
var links = $("<a>")
.attr("href", "https://coa.crapaud-fou.org/channel/cohorte-" + canal)
.attr("class", "badge badge-success mr-1")
.text(canal);
$(".cohortes").append(links);
});
2019-08-16 21:39:08 +00:00
});
2019-08-17 14:27:32 +00:00
// idees
$.getJSON("data/idees.json", function(data) {
$(".idees .total .crapauds").text(data.crapauds.total);
$(".idees .total .idees").text(data.idees.total);
$(".idees .total .commentaires").text(data.commentaires.total);
$(".idees .recent .crapauds").text(data.crapauds.recent);
$(".idees .recent .idees").text(data.idees.recent);
$(".idees .recent .commentaires").text(data.commentaires.recent);
$(".idees ul").text("");
$.each(data.idees.liste, function(index, idee) {
var link = $("<a>")
.attr("href", "https://idees.crapaud-fou.org/" + index)
.attr("class", "list-item")
2019-08-18 06:33:08 +00:00
.attr("title", idee)
2019-08-17 14:27:32 +00:00
.text(idee);
var li = $("<li>").append(link);
$(".idees ul").append(li);
});
2019-08-16 21:39:08 +00:00
});
2019-08-17 14:27:32 +00:00
// tiki
$.getJSON("data/wiki.json", function(data) {
$(".wiki .total .crapauds").text(data.crapauds.total);
$(".wiki .total .pages").text(data.pages.total);
$(".wiki .total .photos").text(data.photos.total);
$(".wiki .recent .crapauds").text(data.crapauds.recent);
$(".wiki .recent .pages").text(data.pages.recent);
$(".wiki .recent .photos").text(data.photos.recent);
$(".wiki ul").text("");
2019-08-20 15:38:55 +00:00
$.each(data.pages.liste, function(index, page) {
var link = $("<a>")
.attr("href", "https://wiki.crapaud-fou.org/" + index)
.attr("class", "list-item")
2019-08-20 15:38:55 +00:00
.attr("title", page)
.text(page);
var li = $("<li>").append(link);
$(".wiki ul").append(li);
});
});
2019-08-16 21:39:08 +00:00
});