diff options
author | Chris Johns <chrisj@rtems.org> | 2017-01-12 12:55:15 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2017-01-12 12:56:13 +1100 |
commit | 049097fc804b7f0b2fdf54b9ba6a0c2aeae17725 (patch) | |
tree | cc525b8b55cbb6fd4dd37ae03573e957429f2555 /common/coverpage/static/rtems | |
parent | conf.py: Fix build_date() to append correct suffix on all days. (diff) | |
download | rtems-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 'common/coverpage/static/rtems')
-rw-r--r-- | common/coverpage/static/rtems/css/rtems.css | 77 | ||||
-rw-r--r-- | common/coverpage/static/rtems/image/rtemslogo.png | bin | 0 -> 21424 bytes | |||
-rw-r--r-- | common/coverpage/static/rtems/js/catalogue.js | 108 |
3 files changed, 185 insertions, 0 deletions
diff --git a/common/coverpage/static/rtems/css/rtems.css b/common/coverpage/static/rtems/css/rtems.css new file mode 100644 index 0000000..2a4f6f7 --- /dev/null +++ b/common/coverpage/static/rtems/css/rtems.css @@ -0,0 +1,77 @@ +@font-face { + font-family: "Glyphicons Halflings"; + src: url("../../fonts/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("../../fonts/glyphicons-halflings-regular.woff") format("woff"), url("../../fonts/glyphicons-halflings-regular.ttf") format("truetype"), url("../../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular") format("svg"); +} + +header { + background: #38532f; +} + +.h1, h1 { + font-size: 28px; +} + +.h3, h3 { + font-size: 25px; + line-height: 0.5; +} + +.navbar-default { + background-color: #dbe5c6; + border-color: #b2baa1; +} + +.navbar-inverse .navbar-brand { + color: #333; +} + +.navbar-inverse .navbar-text { + color: #333; +} +.navbar-inverse .navbar-nav > li > a { + color: #333; +} + +.navbar-default .navbar-nav > li > a { + color: 333; +} + +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #333; + background-color: #b2baa1; +} + +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + color: #fcfcfc; + background-color: #38532f; +} + +.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, +.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #333; + background-color: #b2baa1; +} + +.navbar-inverse .navbar-link { + color: #333; +} + +col-md-3 { + background: #38532f; + color: #333; +} + +col-md-9, h1 { + color: #fcfcfc; +} + +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 2px; + border-collapse: separate !important; + border-spacing: 0; +} diff --git a/common/coverpage/static/rtems/image/rtemslogo.png b/common/coverpage/static/rtems/image/rtemslogo.png Binary files differnew file mode 100644 index 0000000..2bc7af6 --- /dev/null +++ b/common/coverpage/static/rtems/image/rtemslogo.png diff --git a/common/coverpage/static/rtems/js/catalogue.js b/common/coverpage/static/rtems/js/catalogue.js new file mode 100644 index 0000000..ec52794 --- /dev/null +++ b/common/coverpage/static/rtems/js/catalogue.js @@ -0,0 +1,108 @@ +/*! + * Catalogue 0.1 + * Copyright 2017 Chris Johns <chrisj@rtems.org> + * Licensed under the MIT license + */ + +function parseCatalogue(xml) { + if (window.DOMParser) + { + parser = new DOMParser(); + xmlDoc = parser.parseFromString(xml, "text/xml"); + } + else // Internet Explorer + { + xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); + xmlDoc.async = false; + xmlDoc.loadXML(xml); + } + return xmlDoc; +} + +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>' + + ' </table>' + + ' </div>' + + ' </td>' + + ' </tr>' + + ' </tbody>' + + ' </table>' + + ' </dev/>'; +} + +function paintCatalogue(xml) { + var el_cat_title = $('#rtems-catalogue-title'); + var el_cat = $('#rtems-catalogue'); + /* + * Use jquery as XMLDocument is consider not stable on Firefox's web site. + */ + var pdfIcon = 'static/images/Adobe_PDF_file_icon_32x32.png'; + var htmlIcon = 'static/images/html-xxl.png'; + var docs = $(xml).find('rtems-docs'); + var date = $(docs).attr('date'); + var title = $(docs).find('catalogue'); + 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(); + var release = $(this).find('release').text(); + var version = $(this).find('version').text(); + var html = $(this).find('html').text(); + var pdf = $(this).find('pdf').text(); + var singlehtml = $(this).find('singlehtml').text(); + var empty = '<td></a></td>\n'; + table += '<tr>\n'; + if (html) + table += '<td><a href="' + html + '">' + title + '</a></td>\n'; + else + table += empty; + if (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 + '">' + + '<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.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) { + var f = $.get(path, function(xml) { + paintCatalogue(xml); + }, 'xml'); +} |