Commit 1acc27f1 authored by cgeek's avatar cgeek

Add web sources

parent 8004d52b
{"now":"31/10/2017 07:46:00","dates":[
{"precision":"at","date":"01/11/2017 15:44:29","names":[
{"name":"Azimut","proba":" 17"},
{"name":"ClaraLefort","proba":" 17"},
{"name":"DaphneSvanias","proba":" 17"},
{"name":"HgO","proba":" 17"},
{"name":"Lionel","proba":" 17"},
{"name":"MarcLefort","proba":" 17"}
]},
{"precision":"at","date":"01/11/2017 18:37:12","names":[
{"name":"Rikiki","proba":"100"}
]},
{"precision":"at","date":"02/11/2017 11:02:44","names":[
{"name":"Lwayz","proba":"100"}
]},
{"precision":"at","date":"02/11/2017 19:18:59","names":[
{"name":"RomainR","proba":"100"}
]},
{"precision":"at","date":"03/11/2017 14:51:47","names":[
{"name":"Sebbaz","proba":"100"}
]},
{"precision":"at","date":"03/11/2017 15:09:02","names":[
{"name":"evechat","proba":" 33"},
{"name":"jeromesabin","proba":" 33"},
{"name":"KatyHeteau","proba":" 33"}
]},
{"precision":"at","date":"03/11/2017 17:42:26","names":[
{"name":"Clement","proba":"100"},
{"name":"deudeuch","proba":" 67"}
]},
{"precision":"at","date":"04/11/2017 00:26:23","names":[
{"name":"DamageCo","proba":"100"}
]},
{"precision":"at","date":"04/11/2017 12:09:26","names":[
{"name":"VirginieDeleu","proba":"100"}
]},
{"precision":"at","date":"04/11/2017 13:06:29","names":[
{"name":"ama","proba":" 20"},
{"name":"cerato","proba":" 20"},
{"name":"claudia","proba":" 20"},
{"name":"Juliette","proba":" 20"},
{"name":"lia","proba":" 20"}
]},
{"precision":"at","date":"06/11/2017 15:44:29","names":[
{"name":"Azimut","proba":" 17"},
{"name":"ClaraLefort","proba":" 17"},
{"name":"DaphneSvanias","proba":" 17"},
{"name":"HgO","proba":" 17"},
{"name":"Lionel","proba":" 17"},
{"name":"MarcLefort","proba":" 17"}
]},
{"precision":"at","date":"06/11/2017 18:37:12","names":[
{"name":"lili","proba":"100"}
]},
{"precision":"at","date":"08/11/2017 15:09:02","names":[
{"name":"deudeuch","proba":" 25"},
{"name":"evechat","proba":" 46"},
{"name":"jeromesabin","proba":" 46"},
{"name":"nicolemoreau","proba":" 8"}
]},
{"precision":"at","date":"09/11/2017 13:06:29","names":[
{"name":"ama","proba":" 20"},
{"name":"cerato","proba":" 20"},
{"name":"claudia","proba":" 20"},
{"name":"Juliette","proba":" 20"},
{"name":"lia","proba":" 20"}
]},
{"precision":"at","date":"11/11/2017 15:44:29","names":[
{"name":"Azimut","proba":" 17"},
{"name":"ClaraLefort","proba":" 17"},
{"name":"DaphneSvanias","proba":" 17"},
{"name":"HgO","proba":" 17"},
{"name":"Lionel","proba":" 17"},
{"name":"MarcLefort","proba":" 17"}
]},
{"precision":"at","date":"13/11/2017 14:51:47","names":[
{"name":"KatyHeteau","proba":" 33"}
]},
{"precision":"at","date":"13/11/2017 15:09:02","names":[
{"name":"deudeuch","proba":" 8"},
{"name":"evechat","proba":" 21"},
{"name":"jeromesabin","proba":" 21"},
{"name":"KatyHeteau","proba":" 17"},
{"name":"nicolemoreau","proba":" 92"}
]},
{"precision":"not_before_or_never","date":"13/11/2017 17:42:26","names":[
{"name":"GuillaumeDesplatz","proba":"100"}
]},
{"precision":"not_before_or_never","date":"14/11/2017 13:06:29","names":[
{"name":"ama","proba":" 60"},
{"name":"cerato","proba":" 60"},
{"name":"claudia","proba":" 60"},
{"name":"Juliette","proba":" 60"},
{"name":"lia","proba":" 60"}
]},
{"precision":"not_before_or_never","date":"15/11/2017 19:38:32","names":[
{"name":"damzaza","proba":"100"},
{"name":"Veronika","proba":"100"}
]},
{"precision":"not_before_or_never","date":"16/11/2017 15:44:29","names":[
{"name":"Azimut","proba":" 50"},
{"name":"ClaraLefort","proba":" 50"},
{"name":"DaphneSvanias","proba":" 50"},
{"name":"HgO","proba":" 50"},
{"name":"Lionel","proba":" 50"},
{"name":"MarcLefort","proba":" 50"}
]},
{"precision":"not_before_or_never","date":"17/11/2017 05:07:57","names":[
{"name":"annelaure","proba":"100"}
]},
{"precision":"at","date":"Never","names":[
{"name":"KatyHeteau","proba":" 17"}
]}
]}
\ No newline at end of file
<html>
<head>
<title>WotWizard</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,minimal-ui">
<style>
body {
font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace;
}
p {
padding-left: 30px;
}
.definitions {
font-style: italic;
border-top: 1px solid #d8d8d8;
padding: 0;
margin-left: 30px;
padding-top: 10px;
padding-bottom: 10px;
}
.miseengarde {
font-style: italic;
}
blockquote {
margin-bottom: 20px;
}
blockquote h2 {
font-size: 18px;
margin-bottom: 15px;
}
blockquote p {
border-left: 1px solid #D1D1D1;
margin-left: 15px;
padding-left: 10px;
margin-top: 0px;
margin-bottom: 0px;
padding-top: 3px;
padding-bottom: 3px;
}
.sure {
color: green
}
.possible {
color: orange
}
.never {
color: red
}
h2.not_before_or_never:before {
content: "À partir du ";
}
h2.not_before_or_never:after {
content: "";
}
p.not_before_or_never:before {
content: "À partir du ";
}
p.not_before_or_never:after {
content: "";
}
</style>
<script src="./jquery.js"></script>
<script type="text/javascript">
function getURLParameter(name) {
var search = String(location.search)
var result = decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(search) || [null, ''])[1].replace(/\+/g, '%20')) || null
return result
}
function showByName(params) {
$('#contentName').show()
$('#contentDate').hide()
}
function showByDate(params) {
$('#contentDate').show()
$('#contentName').hide()
}
$( document ).ready(function() {
$('#radioByDate').change(function (e) {
showByDate()
})
$('#radioByName').change(function (e) {
showByName()
})
var byName = getURLParameter('s') == 'byName'
if (byName) {
$('#contentName').show()
$('#contentDate').hide()
} else {
$('#contentDate').show()
$('#contentName').hide()
}
})
$( document ).ready(function() {
$.getJSON('./WWByDate.json', function (jsonByDate) {
var jsonByName = toJsonByName(jsonByDate)
console.log('Données WotWizard : ', jsonByDate)
$('#nbFolders').text(jsonByName.names.length)
$('#timeBCT').text(jsonByDate.now + ' BCT¹')
// By date
for (var i = 0; i < jsonByDate.dates.length; i++) {
var entry = jsonByDate.dates[i]
var html = '<blockquote>'
html += '<h2 class="' + entry.precision + '">' + entry.date + '</h2>'
for (var j = 0; j < entry.names.length; j++) {
var name = entry.names[j]
var proba = parseInt(name.proba.replace(' ', ''))
var probaClass = proba == 100 ? 'sure' : (isNaN(proba) ? 'never' : 'possible')
html += '<p>' + name.name + ' (<span class="' + probaClass + '">' + proba + '%</span>)</p>'
}
html += '</blockquote>'
$('#contentDate').append(html)
}
// By names
for (var i = 0; i < jsonByName.names.length; i++) {
var entry = jsonByName.names[i]
var html = '<blockquote>'
html += '<h2>' + entry.name + '</h2>'
for (var j = 0; j < entry.dates.length; j++) {
var date = entry.dates[j]
var proba = parseInt(date.proba.replace(' ', ''))
var probaClass = proba == 100 ? 'sure' : (isNaN(proba) ? 'never' : 'possible')
html += '<p class="' + date.precision + '">' + date.date + ' (<span class="' + probaClass + '">' + proba + '%</span>)</p>'
}
html += '</blockquote>'
$('#contentName').append(html)
}
})
})
function toJsonByName(jsonByDate) {
var jsonByName = {
now: jsonByDate.now,
names: []
}
var names = {}
for (var i = 0; i < jsonByDate.dates.length; i++) {
var entry = jsonByDate.dates[i]
for (var j = 0; j < entry.names.length; j++) {
var name = entry.names[j]
names[name.name] = names[name.name] || { name: name.name, dates: [] }
names[name.name].dates.push({
precision: entry.precision,
date: entry.date,
proba: name.proba
})
}
}
for (var name of Object.keys(names)) {
jsonByName.names.push(names[name])
}
jsonByName.names.sort(function (a, b) {
if (a.name.toLowerCase() < b.name.toLowerCase()) return -1
if (a.name.toLowerCase() > b.name.toLowerCase()) return 1
return 0
})
return jsonByName
}
</script>
</head>
<body>
<h2>Dossiers en attente : <span id="nbFolders"></span></h2>
<h3>Heure actuelle : <span id="timeBCT"></span></h3>
<div class="groups">
<p>
<input type="radio" name="sort" id="radioByDate" checked>
<label for="radioByDate">Grouper par date</label>
</p>
<p>
<input type="radio" name="sort" id="radioByName">
<label for="radioByName">Grouper par UID</label>
</p>
</div>
<div id="contentDate"></div>
<div id="contentName"></div>
<p class="miseengarde">Ces prévisions sont sujettes à modifications à mesure que de nouveaux dossiers ou de nouvelles certifications internes (de membre à membre) ou externes (de membre à nouveau venu) apparaissent. Cette page est mise à jour toutes les 5 minutes, rafraîchissez la page pour voir les modifications.</p>
<p class="miseengarde">Note 1 : la mention « À partir du » indique une date lointaine à partir de laquelle les probabilités sont trop difficiles à obtenir. Un dossier présent sous ce libellé à des chances de ne jamais passer.</p>
<p class="miseengarde">Note 2 : toutes les dates/heures sont exprimées ici en référence BCT.</p>
<p class="definitions">¹ : BCT signifie « BlockChain Time », ou heure blockchain. Équivalent à UTC+0 avec un retard d'une heure en moyenne.</p>
</body>
</html>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment