0f386985fe
On the PTGbot web page, display a table showing what track is running in which room, as well as a table for additional rooms scheduling. Change-Id: Ib3916cc60b827c54249b9a1e98710b5fcebe807b
27 lines
832 B
JavaScript
27 lines
832 B
JavaScript
// sets variable source to the animalTemplate id in index.html
|
|
var source = document.getElementById("PTGtemplate").innerHTML;
|
|
|
|
// Handlebars compiles the above source into a template
|
|
var template = Handlebars.compile(source);
|
|
|
|
Handlebars.registerHelper('hashtag', function(options) {
|
|
var words = options.fn(this).split(" ");
|
|
var sentence = "";
|
|
for (var i = 0; i < words.length; i++) {
|
|
if (words[i].startsWith("#")) {
|
|
sentence += '<span class="label label-info">'
|
|
+ words[i].substring(1) + '</span> ';
|
|
} else {
|
|
sentence += words[i] + " ";
|
|
}
|
|
}
|
|
return new Handlebars.SafeString(sentence);
|
|
});
|
|
|
|
$.getJSON("ptg.json", function(json) {
|
|
console.log(json);
|
|
document.getElementById("PTGsessions").innerHTML = template(json);
|
|
$('#stMonday').tab('show');
|
|
$('#atMonday').tab('show');
|
|
});
|