Skip to content

Commit

Permalink
eclipse-ditto#11: excluded incubation image from api documentation, r…
Browse files Browse the repository at this point in the history
…eordered nav, replaced navbar toggle with printstyle

Signed-off-by: Johannes Schneider <johannes.schneider@bosch-si.com>
  • Loading branch information
Johannes Schneider committed Nov 9, 2017
1 parent 9a505c9 commit b547764
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 37 deletions.
2 changes: 1 addition & 1 deletion documentation/README.md
Expand Up @@ -21,7 +21,7 @@ In order to edit the documentation
Use that if you are on a UNIX system (or have the Ubuntu bash subsystem for Windows 10).

```bash
sudo apt-get install ruby-dev
sudo apt-get install build-essential ruby-dev
sudo gem install --http-proxy http://localhost:3128 jekyll
```

Expand Down
2 changes: 1 addition & 1 deletion documentation/src/main/resources/_config.yml
Expand Up @@ -97,7 +97,7 @@ defaults:
sidebars:
- ditto_sidebar

description: "Here be dragons"
description: "Eclipse Ditto Blog"
# the description is used in the feed.xml file

# needed for sitemap.xml file only
Expand Down
8 changes: 4 additions & 4 deletions documentation/src/main/resources/_data/topnav.yml
Expand Up @@ -2,14 +2,14 @@
topnav:
- title: Topnav
items:
- title: GitHub
external_url: https://github.com/eclipse/ditto
- title: Blog
url: /blog.html
- title: Documentation
url: /intro-overview.html
- title: HTTP API Doc
- title: HTTP API
url: /http-api-doc.html
- title: GitHub
external_url: https://github.com/eclipse/ditto

#Topnav dropdowns
topnav_dropdowns:
Expand All @@ -26,4 +26,4 @@ topnav_dropdowns:
- title: Mailing list archives
external_url: https://dev.eclipse.org/mhonarc/lists/ditto-dev/
- title: Gitter.im chat
external_url: https://gitter.im/eclipse/ditto
external_url: https://gitter.im/eclipse/ditto
@@ -0,0 +1,3 @@
<span class="incubation-logo">
<img src="images/eclipse_incubation.png" style="position: fixed; top: 50px; right: 10px;"/>
</span>
5 changes: 1 addition & 4 deletions documentation/src/main/resources/_includes/topnav.html
Expand Up @@ -13,7 +13,7 @@
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<!-- toggle sidebar button -->
<li><a id="tg-sb-link" href="#"><i id="tg-sb-icon" class="fa fa-toggle-on"></i> Nav</a></li>
<!--<li><a id="tg-sb-link" href="#"><i id="tg-sb-icon" class="fa fa-toggle-on"></i> Nav</a></li>-->
<!-- entries without drop-downs appear here -->

{% assign topnav = site.data[page.topnav] %}
Expand Down Expand Up @@ -76,9 +76,6 @@
</li>
</ul>
</div>
<span class="incubation-logo">
<img src="images/eclipse_incubation.png" style="position: fixed; top: 50px; right: 10px;" />
</span>
</div>
<!-- /.container -->
</nav>
2 changes: 2 additions & 0 deletions documentation/src/main/resources/_layouts/page.html
Expand Up @@ -2,6 +2,8 @@
layout: default
---

{% include incubation_image.html %}

<div class="post-header">
<h1 class="post-title-main">{{ page.title }}</h1>
</div>
Expand Down
1 change: 1 addition & 0 deletions documentation/src/main/resources/_layouts/start.html
Expand Up @@ -10,6 +10,7 @@
</head>
<body>
{% include topnav.html %}
{% include incubation_image.html %}

<div class="startpage">
{{ content }}
Expand Down
Expand Up @@ -59,7 +59,12 @@
</svg>

<!-- Page Content -->
<div id="swagger-ui"></div>
<div id="swagger-ui">
</div>

<div style="width: 100%; max-width: 1460px; margin: 0 auto; padding: 0 20px;">
{% include footer.html %}
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.4.3/swagger-ui-bundle.js"> </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.4.3/swagger-ui-standalone-preset.js"> </script>
Expand Down
6 changes: 6 additions & 0 deletions documentation/src/main/resources/css/customstyles.css
Expand Up @@ -1262,3 +1262,9 @@ h4.panel-title {
display:block !important;
}
}

@media print {
footer, #tg-sb-sidebar, .incubation-logo {
display: none !important;
}
}
3 changes: 0 additions & 3 deletions documentation/src/main/resources/css/printstyles.css
@@ -1,6 +1,3 @@

/*body.print .container {max-width: 650px;}*/

body {
font-size:14px;
}
Expand Down
40 changes: 17 additions & 23 deletions documentation/src/main/resources/js/customscripts.js
@@ -1,32 +1,22 @@
$('#mysidebar').height($(".nav").height());
$(function () {
$('#mysidebar').height($(".nav").height());


$( document ).ready(function() {

//this script says, if the height of the viewport is greater than 800px, then insert affix class, which makes the nav bar float in a fixed
// position as your scroll. if you have a lot of nav items, this height may not work for you.
// var h = $(window).height();
//console.log (h);
// if (h > 800) {
// $( "#mysidebar" ).attr("class", "nav affix");
// }
//this script says, if the height of the viewport is greater than 800px, then insert affix class, which makes the
// nav bar float in a fixed position as your scroll. if you have a lot of nav items, this height may not work for
// you. var h = $(window).height(); console.log (h); if (h > 800) { $( "#mysidebar" ).attr("class", "nav affix"); }
// activate tooltips. although this is a bootstrap js function, it must be activated this way in your theme.
$('[data-toggle="tooltip"]').tooltip({
placement : 'top'
});
$('[data-toggle="tooltip"]').tooltip({ placement: 'top' });

/**
* AnchorJS
*/
anchors.add('h2,h3,h4,h5');

});

// needed for nav tabs on pages. See Formatting > Nav tabs for more details.
// script from http://stackoverflow.com/questions/10523433/how-do-i-keep-the-current-tab-active-with-twitter-bootstrap-after-a-page-reload
$(function() {
// needed for nav tabs on pages. See Formatting > Nav tabs for more details.
// script from
// http://stackoverflow.com/questions/10523433/how-do-i-keep-the-current-tab-active-with-twitter-bootstrap-after-a-page-reload
var json, tabsState;
$('a[data-toggle="pill"], a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
$('a[data-toggle="pill"], a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var href, json, parentId, tabsState;

tabsState = localStorage.getItem("tabs-state");
Expand All @@ -41,14 +31,18 @@ $(function() {
tabsState = localStorage.getItem("tabs-state");
json = JSON.parse(tabsState || "{}");

$.each(json, function(containerId, href) {
$.each(json, function (containerId, href) {
return $("#" + containerId + " a[href=" + href + "]").tab('show');
});

$("ul.nav.nav-pills, ul.nav.nav-tabs").each(function() {
$("ul.nav.nav-pills, ul.nav.nav-tabs").each(function () {
var $this = $(this);
if (!json[$this.attr("id")]) {
return $this.find("a[data-toggle=tab]:first, a[data-toggle=pill]:first").tab("show");
}
});
});

$('nav li').on('click', {
$(this).removeClass('hidden')
})
});

0 comments on commit b547764

Please sign in to comment.