From a6275ebcdb45b4b398efaf8231c986d6f3aca7df Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Mon, 12 Jun 2017 14:02:53 +0200 Subject: [PATCH 1/3] copying to clipboard no longer copies the compilation results from "play" --- src/theme/book.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/book.js b/src/theme/book.js index 86b47d09..8b1cdc15 100644 --- a/src/theme/book.js +++ b/src/theme/book.js @@ -201,7 +201,7 @@ $( document ).ready(function() { var clipboardSnippets = new Clipboard('.clip-button', { text: function(trigger) { hideTooltip(trigger); - return trigger.parentElement.parentElement.textContent; + return $(trigger).parents(".playpen").find("code.language-rust.hljs")[0].textContent; } }); clipboardSnippets.on('success', function(e) { From ee9fa8c86fd15c8257e4b12bffd59864a6a9e97b Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Tue, 13 Jun 2017 16:59:29 +0200 Subject: [PATCH 2/3] Fix for playpen buttons missing on mobile safari and chrome IOS --- src/theme/book.css | 5 +++++ src/theme/stylus/themes/base.styl | 1 + 2 files changed, 6 insertions(+) diff --git a/src/theme/book.css b/src/theme/book.css index 970ae36e..6d3db97f 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -408,6 +408,7 @@ table thead td { } .light pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #364149; @@ -527,6 +528,7 @@ table thead td { } .coal pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #a1adb8; @@ -646,6 +648,7 @@ table thead td { } .navy pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #c8c9db; @@ -765,6 +768,7 @@ table thead td { } .rust pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #c8c9db; @@ -884,6 +888,7 @@ table thead td { } .ayu pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #c8c9db; diff --git a/src/theme/stylus/themes/base.styl b/src/theme/stylus/themes/base.styl index 9bc90568..272a3f3f 100644 --- a/src/theme/stylus/themes/base.styl +++ b/src/theme/stylus/themes/base.styl @@ -117,6 +117,7 @@ & > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; From c1c06d6dc1f3745377940be6ab2d6ca8561b07bd Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Thu, 15 Jun 2017 21:12:28 +0200 Subject: [PATCH 3/3] Auto focus on content to allow keyboard navigation --- src/theme/book.css | 1 + src/theme/book.js | 5 +++-- src/theme/index.hbs | 2 +- src/theme/stylus/page.styl | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/theme/book.css b/src/theme/book.css index 6d3db97f..1dbd1ecd 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -137,6 +137,7 @@ table thead td { right: 0; left: 0; bottom: 0; + outline: 0; padding-right: 15px; overflow-y: auto; } diff --git a/src/theme/book.js b/src/theme/book.js index 8b1cdc15..c6161d91 100644 --- a/src/theme/book.js +++ b/src/theme/book.js @@ -52,8 +52,9 @@ $( document ).ready(function() { // Interesting DOM Elements var sidebar = $("#sidebar"); - var page_wrapper = $("#page-wrapper"); - var content = $("#content"); + + // Help keyboard navigation by always focusing on page content + $(".page").focus(); // Toggle sidebar $("#sidebar-toggle").click(sidebarToggle); diff --git a/src/theme/index.hbs b/src/theme/index.hbs index bf316f5f..81381b65 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -76,7 +76,7 @@
-
+