summaryrefslogtreecommitdiffstats
path: root/common/html-coverpage/static/rtems/js/catalogue.js
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-01-12 12:55:15 +1100
committerChris Johns <chrisj@rtems.org>2017-01-12 12:56:13 +1100
commit049097fc804b7f0b2fdf54b9ba6a0c2aeae17725 (patch)
treecc525b8b55cbb6fd4dd37ae03573e957429f2555 /common/html-coverpage/static/rtems/js/catalogue.js
parentconf.py: Fix build_date() to append correct suffix on all days. (diff)
downloadrtems-docs-049097fc804b7f0b2fdf54b9ba6a0c2aeae17725.tar.bz2
coverpage: Update the coverpage to have the table collapse.
Add each doc's conf.py as a dependence to catalogue.xml.
Diffstat (limited to '')
-rw-r--r--common/coverpage/static/rtems/js/catalogue.js (renamed from common/html-coverpage/static/rtems/js/catalogue.js)49
1 files changed, 39 insertions, 10 deletions
diff --git a/common/html-coverpage/static/rtems/js/catalogue.js b/common/coverpage/static/rtems/js/catalogue.js
index ae32aed..ec52794 100644
--- a/common/html-coverpage/static/rtems/js/catalogue.js
+++ b/common/coverpage/static/rtems/js/catalogue.js
@@ -19,14 +19,35 @@ function parseCatalogue(xml) {
return xmlDoc;
}
-function catalogueHeader(date) {
- return '<table class="table table-condensed table-nonfluid">\n' +
- ' <tbody>\n' +
- ' <thead><tr><th>Built: ' + date + '</th><th>PDF</th><th>Single Page</th></tr></thead>\n';
+function catalogueHeader(id, title, date) {
+ return '' +
+ ' <div class="table-responsive">' +
+ ' <table class="table table-hover table-condensed table-nonfluid">' +
+ ' <tbody>' +
+ ' <thead>' +
+ ' <tr id="' + id + '" class="accordion-toggle" data-toggle="collapse"' +
+ ' data-parent="#rtems-catalogue" data-target=".' + id + 'Details">' +
+ ' <th><span class="label label-default">' + date + '</span> ' + title + '</th>\n' +
+ ' <th><i class="indicator glyphicon glyphicon-chevron-up pull-right"></i></th>' +
+ ' </tr>' +
+ ' </thead>' +
+ ' <tr>' +
+ ' <td colspan="3" class="hiddenRow">' +
+ ' <div class="accordion-body collapse ' + id + 'Details" id="' + id + '1">' +
+ ' <table class="table table-condensed table-nonfluid">' +
+ ' <tbody>' +
+ ' <thead><tr><th>Online</th><th>PDF</th><th>Single Page</th><tr></thead>';
}
function catalogueFooter() {
- return ' </tbody>\n' +
- '</table>\n';
+ return '' +
+ ' </tbody>' +
+ ' </table>' +
+ ' </div>' +
+ ' </td>' +
+ ' </tr>' +
+ ' </tbody>' +
+ ' </table>' +
+ ' </dev/>';
}
function paintCatalogue(xml) {
@@ -40,7 +61,8 @@ function paintCatalogue(xml) {
var docs = $(xml).find('rtems-docs');
var date = $(docs).attr('date');
var title = $(docs).find('catalogue');
- var table = catalogueHeader(date);
+ var id = 'xxx';
+ var table = catalogueHeader(id, title.text(), date);
$(docs).find('doc').each(function() {
var name = $(this).find('name').text();
var title = $(this).find('title').text();
@@ -56,20 +78,27 @@ function paintCatalogue(xml) {
else
table += empty;
if (pdf)
- table += '<td><a href="' + '/' + pdf + '">' +
+ table += '<td><a href="' + pdf + '">' +
'<img src="' + pdfIcon + '" width="20" height="20"></a></td>\n';
else
table += empty;
if (singlehtml)
- table += '<td><a href="' + '/' + singlehtml + '">' +
+ table += '<td><a href="' + singlehtml + '">' +
'<img src="' + htmlIcon + '" width="20" height="20"></a></td>\n';
else
table += empty;
table += '</tr>\n';
});
table += catalogueFooter();
- el_cat_title.html('<h3>' + $(title).text() + '</h3>');
+ //el_cat_title.html('<h3>' + $(title).text() + '</h3>');
el_cat.html(table);
+ $('#' + id + '1').on('shown.bs.collapse', function () {
+ $("#" + id + " i.indicator").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down");
+ });
+ $('#' + id + '1').on('hidden.bs.collapse', function () {
+ $("#" + id + " i.indicator").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up");
+ });
+ $('#' + id + '1').collapse('show');
}
function loadCatalogue(path) {