From 0403c70ed431b963b0043e0e9e60775cadb8cad2 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 14 Oct 2015 05:12:02 -0400 Subject: [PATCH 01/22] Better styling of blockquote elements Blockquote elements that call out a new feature are given a "pink" background, whereas all others are given a "blue" background. This is to help avoid cases where users expect a feature to work for their version when they are several versions behind when a feature was introduced. --- docs/assets/style.css | 10 ++++++++++ docs/template.html | 20 ++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/assets/style.css b/docs/assets/style.css index b32ae7297..efd2d0c4d 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -228,6 +228,16 @@ pre { color: #4d4d4c; margin: 2em 0; } +blockquote { + border-left: 4px solid #5bc0de; + background-color: #f4f8fa; + padding: 15px 15px 1px; + margin-bottom: 30px; +} +blockquote.new-as-of { + border-left: 4px solid #ef5b58; + background-color: #f9ad76; +} @media (min-width: 768px) { .quickstart-code { font-size: 14px; diff --git a/docs/template.html b/docs/template.html index 6a9e3ce2c..bf31af6dc 100644 --- a/docs/template.html +++ b/docs/template.html @@ -17,6 +17,16 @@ word-break: normal; word-wrap: normal; } + blockquote { + border-left: 4px solid #5bc0de; + background-color: #f4f8fa; + padding: 15px 15px 1px; + margin-bottom: 30px; + } + blockquote.new-as-of { + border-left: 4px solid #ef5b58; + background-color: #f9ad76; + } @@ -79,7 +89,8 @@ anchors.options.visible = 'always'; anchors.add('.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4'); - var elements = document.querySelectorAll('table'), + var tables = document.querySelectorAll('table'), + blockquotes = document.querySelectorAll('blockquote'), classNames = ['table', 'table-striped', 'table-hover', 'table-condensed'], addClass = function (el, className) { if (el.classList) { @@ -89,8 +100,13 @@ } } + Array.prototype.forEach.call(blockquotes, function (el, i) { + if (el.innerHTML.indexOf('New as of') !== -1) { + addClass(el, 'new-as-of'); + } + }); Array.prototype.forEach.call(classNames, function (className, i) { - Array.prototype.forEach.call(elements, function (el, i) { + Array.prototype.forEach.call(tables, function (el, i) { addClass(el, className); }); }); From 1424df5697884dffefd3e040bc112df658bcf911 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 14 Oct 2015 05:12:14 -0400 Subject: [PATCH 02/22] Support anchors for all header elements --- docs/template.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/template.html b/docs/template.html index bf31af6dc..5a04bd5e4 100644 --- a/docs/template.html +++ b/docs/template.html @@ -87,7 +87,7 @@