From c0831cc64bf9d2b77ecb5206c6ff98b46c5714cb Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sat, 26 Oct 2019 11:11:04 -0600 Subject: [PATCH 1/2] Carbon add on API docs --- .../jsdoc/api/template/static/scripts/main.js | 2 +- .../jsdoc/api/template/static/styles/site.css | 65 +++++++++++++++++++ config/jsdoc/api/template/tmpl/container.tmpl | 1 + config/jsdoc/api/template/tmpl/layout.tmpl | 1 + 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 config/jsdoc/api/template/static/styles/site.css diff --git a/config/jsdoc/api/template/static/scripts/main.js b/config/jsdoc/api/template/static/scripts/main.js index 64a36cd6e4..22bcad9dff 100644 --- a/config/jsdoc/api/template/static/scripts/main.js +++ b/config/jsdoc/api/template/static/scripts/main.js @@ -112,7 +112,7 @@ $(function () { var branchSearch = url.match(/\/([^\/]*)\/apidoc\//); var cookieText = 'dismissed=-' + latestVersion + '-'; var dismissed = document.cookie.indexOf(cookieText) != -1; - if (!dismissed && /^v[0-9\.]*$/.test(branchSearch[1]) && currentVersion != latestVersion) { + if (branchSearch && !dismissed && /^v[0-9\.]*$/.test(branchSearch[1]) && currentVersion != latestVersion) { var link = url.replace(branchSearch[0], '/latest/apidoc/'); fetch(link, {method: 'head'}).then(function(response) { var a = document.getElementById('latest-link'); diff --git a/config/jsdoc/api/template/static/styles/site.css b/config/jsdoc/api/template/static/styles/site.css new file mode 100644 index 0000000000..9b4991a55e --- /dev/null +++ b/config/jsdoc/api/template/static/styles/site.css @@ -0,0 +1,65 @@ +/* Carbon adds (see https://sell.buysellads.com) */ + +#carbonads { + font-family: "Quattrocento Sans", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; +} + +#carbonads { + display: flex; + max-width: 330px; + float: right; + margin-left: 1em; +} + +#carbonads a { + color: inherit; + text-decoration: none; +} + +#carbonads a:hover { + color: inherit; +} + +#carbonads span { + position: relative; + display: block; + overflow: hidden; +} + +#carbonads .carbon-wrap { + display: flex; +} + +.carbon-img { + display: block; + margin: 0; + line-height: 1; +} + +.carbon-img img { + display: block; +} + +.carbon-text { + font-size: 13px; + padding: 10px; + line-height: 1.5; + text-align: left; +} + +.carbon-poweredby { + display: block; + padding: 8px 10px; + text-align: center; + text-transform: uppercase; + letter-spacing: .5px; + font-weight: 600; + font-size: 9px; + line-height: 1; +} + +/* Clear the float after the advertisement. */ + +.container-overview { + clear: both; +} diff --git a/config/jsdoc/api/template/tmpl/container.tmpl b/config/jsdoc/api/template/tmpl/container.tmpl index baca743283..08b335d549 100644 --- a/config/jsdoc/api/template/tmpl/container.tmpl +++ b/config/jsdoc/api/template/tmpl/container.tmpl @@ -41,6 +41,7 @@
import  from '';
+
diff --git a/config/jsdoc/api/template/tmpl/layout.tmpl b/config/jsdoc/api/template/tmpl/layout.tmpl index 8d928fbe3e..5d257e5db6 100644 --- a/config/jsdoc/api/template/tmpl/layout.tmpl +++ b/config/jsdoc/api/template/tmpl/layout.tmpl @@ -73,6 +73,7 @@ var version = obj.packageInfo.version; + From 27cbbaf97b6b1e3166a0a2121f6bf4e741799bf4 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sat, 26 Oct 2019 11:31:17 -0600 Subject: [PATCH 2/2] Less jumpy --- .../jsdoc/api/template/static/styles/site.css | 18 +++++++++++++++--- config/jsdoc/api/template/tmpl/container.tmpl | 4 +++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/config/jsdoc/api/template/static/styles/site.css b/config/jsdoc/api/template/static/styles/site.css index 9b4991a55e..7628c8d674 100644 --- a/config/jsdoc/api/template/static/styles/site.css +++ b/config/jsdoc/api/template/static/styles/site.css @@ -1,14 +1,18 @@ /* Carbon adds (see https://sell.buysellads.com) */ +#ad { + margin-left: 1em; + float: right; + width: 330px; + min-height: 125px; +} + #carbonads { font-family: "Quattrocento Sans", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; } #carbonads { display: flex; - max-width: 330px; - float: right; - margin-left: 1em; } #carbonads a { @@ -58,8 +62,16 @@ line-height: 1; } +#carbonads a.carbon-poweredby { + color: #aaa; +} + /* Clear the float after the advertisement. */ .container-overview { clear: both; } + +pre.source { + clear: both; +} diff --git a/config/jsdoc/api/template/tmpl/container.tmpl b/config/jsdoc/api/template/tmpl/container.tmpl index 08b335d549..ad8c4f3e13 100644 --- a/config/jsdoc/api/template/tmpl/container.tmpl +++ b/config/jsdoc/api/template/tmpl/container.tmpl @@ -41,7 +41,9 @@
import  from '';
- +