From 389fde5d9381b82d2c939eb9b0258876f7e69712 Mon Sep 17 00:00:00 2001 From: kazuhitonakayama Date: Sun, 20 Dec 2020 17:16:39 +0900 Subject: [PATCH 01/10] Place a scrollable button to the top of the page When a site is viewed from a smartphone or other device, the absence of the relevant button may cause difficulty for users. --- includes/scroll-button.html | 4 ++++ javascripts/index.js | 2 ++ javascripts/scroll-up.js | 20 ++++++++++++++++ layouts/default.html | 1 + stylesheets/index.scss | 3 ++- stylesheets/scroll-button.scss | 44 ++++++++++++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 includes/scroll-button.html create mode 100644 javascripts/scroll-up.js create mode 100644 stylesheets/scroll-button.scss diff --git a/includes/scroll-button.html b/includes/scroll-button.html new file mode 100644 index 0000000000..ca18da66f9 --- /dev/null +++ b/includes/scroll-button.html @@ -0,0 +1,4 @@ +
+ +
+{% include scripts %} diff --git a/javascripts/index.js b/javascripts/index.js index 034701bdfd..496242bb62 100644 --- a/javascripts/index.js +++ b/javascripts/index.js @@ -2,6 +2,7 @@ import '../stylesheets/index.scss' import displayPlatformSpecificContent from './display-platform-specific-content' import explorer from './explorer' +import scrollUp from './scroll-up' import search from './search' import nav from './nav' import browserDateFormatter from 'browser-date-formatter' @@ -21,6 +22,7 @@ import devToc from './dev-toc' document.addEventListener('DOMContentLoaded', async () => { displayPlatformSpecificContent() explorer() + scrollUp() search() nav() browserDateFormatter() diff --git a/javascripts/scroll-up.js b/javascripts/scroll-up.js new file mode 100644 index 0000000000..2a1a04f567 --- /dev/null +++ b/javascripts/scroll-up.js @@ -0,0 +1,20 @@ +export default function () { + // function to scroll up to page top + const PageTopBtn = document.getElementById('js-scroll-top') + PageTopBtn.addEventListener('click', (e) => { + window.scrollTo({ + top: 0, + behavior: 'smooth' + }) + }) + + // show scroll button only when display is scroll down + window.addEventListener('scroll', function () { + const y = document.documentElement.scrollTop // get the height from page top + if (y < 100) { + PageTopBtn.classList.remove('show') + } else if (y >= 100) { + PageTopBtn.classList.add('show') + } + }) +} diff --git a/layouts/default.html b/layouts/default.html index 59179cf802..337b89f287 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -15,6 +15,7 @@ {% endif %} {% include support %} {% include small-footer %} + {% include scroll-button %} diff --git a/stylesheets/index.scss b/stylesheets/index.scss index 21702f86c3..44422da18e 100644 --- a/stylesheets/index.scss +++ b/stylesheets/index.scss @@ -47,6 +47,7 @@ $marketing-font-path: "/dist/fonts/"; @import "search.scss"; @import "overrides.scss"; @import "sidebar.scss"; +@import "scroll-button.scss"; @import "explorer.scss"; // from https://unpkg.com/highlight.js@9.15.8/styles/github.css @import "syntax-highlighting.scss"; @@ -57,4 +58,4 @@ $marketing-font-path: "/dist/fonts/"; @import "product-landing.scss"; @import "dev-toc.scss"; @import "release-notes.scss"; -@import "gradients.scss"; \ No newline at end of file +@import "gradients.scss"; diff --git a/stylesheets/scroll-button.scss b/stylesheets/scroll-button.scss new file mode 100644 index 0000000000..cd990fbbec --- /dev/null +++ b/stylesheets/scroll-button.scss @@ -0,0 +1,44 @@ +div.arrow-for-scrolling-top { + opacity: 0; + transition: 1s; + -webkit-transition:1s; + -moz-transition:1s; + -ms-transition:1s; + -o-transition:1s; + background-color: #0367d6; + color: #fff; + position: fixed; + bottom: 10px; + right: 10px; + display: block; + width: 40px; + height: 40px; + border-radius: 50%; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + -ms-border-radius: 50%; + -o-border-radius: 50%; + &.show { + opacity: 1; + transition: 1s; + -webkit-transition: 1s; + -moz-transition: 1s; + -ms-transition: 1s; + -o-transition: 1s; + } + span.arrow { + width: 10px; + display: inline-block; + height: 10px; + border-top: 1px solid #fff; + border-left: 1px solid #fff; + position: absolute; + top: 56%; + left: 50%; + transform: translate(-50%, -50%) rotate(45deg); + -webkit-transform: translate(-50%, -50%) rotate(45deg); + -moz-transform: translate(-50%, -50%) rotate(45deg); + -ms-transform: translate(-50%, -50%) rotate(45deg); + -o-transform: translate(-50%, -50%) rotate(45deg); + } +} From 521ce8b2b09e2870b6b7509122ba4bbe264bd9ab Mon Sep 17 00:00:00 2001 From: kazuhitonakayama Date: Thu, 11 Feb 2021 19:30:45 +0900 Subject: [PATCH 02/10] change div element to button element --- includes/scroll-button.html | 4 ++-- stylesheets/scroll-button.scss | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/scroll-button.html b/includes/scroll-button.html index ca18da66f9..2a73037017 100644 --- a/includes/scroll-button.html +++ b/includes/scroll-button.html @@ -1,4 +1,4 @@ -
+
+ {% include scripts %} diff --git a/stylesheets/scroll-button.scss b/stylesheets/scroll-button.scss index cd990fbbec..9e180502f5 100644 --- a/stylesheets/scroll-button.scss +++ b/stylesheets/scroll-button.scss @@ -1,4 +1,4 @@ -div.arrow-for-scrolling-top { +button.arrow-for-scrolling-top { opacity: 0; transition: 1s; -webkit-transition:1s; From b66cf972ac871b8a1091baa22ec92d65a02d56e5 Mon Sep 17 00:00:00 2001 From: kazuhitonakayama Date: Thu, 11 Feb 2021 19:36:55 +0900 Subject: [PATCH 03/10] omit the border of scroll-top-button --- stylesheets/scroll-button.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/stylesheets/scroll-button.scss b/stylesheets/scroll-button.scss index 9e180502f5..25528b85d3 100644 --- a/stylesheets/scroll-button.scss +++ b/stylesheets/scroll-button.scss @@ -20,6 +20,7 @@ button.arrow-for-scrolling-top { -o-border-radius: 50%; &.show { opacity: 1; + border: none; transition: 1s; -webkit-transition: 1s; -moz-transition: 1s; From c810d795e6cbaee2b9c14e2c6be528c7d7ceab20 Mon Sep 17 00:00:00 2001 From: kazuhitonakayama Date: Thu, 11 Feb 2021 19:38:48 +0900 Subject: [PATCH 04/10] omit the compatibility prefixes --- stylesheets/scroll-button.scss | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/stylesheets/scroll-button.scss b/stylesheets/scroll-button.scss index 25528b85d3..a3d6155ee5 100644 --- a/stylesheets/scroll-button.scss +++ b/stylesheets/scroll-button.scss @@ -1,10 +1,6 @@ button.arrow-for-scrolling-top { opacity: 0; transition: 1s; - -webkit-transition:1s; - -moz-transition:1s; - -ms-transition:1s; - -o-transition:1s; background-color: #0367d6; color: #fff; position: fixed; @@ -14,18 +10,10 @@ button.arrow-for-scrolling-top { width: 40px; height: 40px; border-radius: 50%; - -webkit-border-radius: 50%; - -moz-border-radius: 50%; - -ms-border-radius: 50%; - -o-border-radius: 50%; &.show { opacity: 1; border: none; transition: 1s; - -webkit-transition: 1s; - -moz-transition: 1s; - -ms-transition: 1s; - -o-transition: 1s; } span.arrow { width: 10px; @@ -37,9 +25,5 @@ button.arrow-for-scrolling-top { top: 56%; left: 50%; transform: translate(-50%, -50%) rotate(45deg); - -webkit-transform: translate(-50%, -50%) rotate(45deg); - -moz-transform: translate(-50%, -50%) rotate(45deg); - -ms-transform: translate(-50%, -50%) rotate(45deg); - -o-transform: translate(-50%, -50%) rotate(45deg); } } From 2230da65dea1e2ae30940a1955d6abb234c5ff62 Mon Sep 17 00:00:00 2001 From: kazuhitonakayama Date: Thu, 11 Feb 2021 19:50:05 +0900 Subject: [PATCH 05/10] use octicon for scroll-top-button --- includes/scroll-button.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/scroll-button.html b/includes/scroll-button.html index 2a73037017..3bd630a3ae 100644 --- a/includes/scroll-button.html +++ b/includes/scroll-button.html @@ -1,4 +1,4 @@ {% include scripts %} From 3d3ade8c16f1945c74b9d689c26cd8989026209e Mon Sep 17 00:00:00 2001 From: kazuhitonakayama Date: Thu, 11 Feb 2021 22:25:57 +0900 Subject: [PATCH 06/10] remove includes scripts --- includes/scroll-button.html | 1 - 1 file changed, 1 deletion(-) diff --git a/includes/scroll-button.html b/includes/scroll-button.html index 3bd630a3ae..c081bcb6ad 100644 --- a/includes/scroll-button.html +++ b/includes/scroll-button.html @@ -1,4 +1,3 @@ -{% include scripts %} From ef7748faceb6c74bc91857d1ac061f15e43e1efb Mon Sep 17 00:00:00 2001 From: kazuhitonakayama Date: Thu, 11 Feb 2021 23:41:38 +0900 Subject: [PATCH 07/10] Erase href and remove unwanted styles --- includes/scroll-button.html | 2 +- stylesheets/scroll-button.scss | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/includes/scroll-button.html b/includes/scroll-button.html index c081bcb6ad..e6d5d14b70 100644 --- a/includes/scroll-button.html +++ b/includes/scroll-button.html @@ -1,3 +1,3 @@ - diff --git a/stylesheets/scroll-button.scss b/stylesheets/scroll-button.scss index a3d6155ee5..d59a2d30bf 100644 --- a/stylesheets/scroll-button.scss +++ b/stylesheets/scroll-button.scss @@ -15,15 +15,4 @@ button.arrow-for-scrolling-top { border: none; transition: 1s; } - span.arrow { - width: 10px; - display: inline-block; - height: 10px; - border-top: 1px solid #fff; - border-left: 1px solid #fff; - position: absolute; - top: 56%; - left: 50%; - transform: translate(-50%, -50%) rotate(45deg); - } } From bae890e9b3040dba8c05f24c0b2b01f4bdf2c1a2 Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Tue, 23 Feb 2021 08:51:46 -0800 Subject: [PATCH 08/10] Update scroll-up.js --- javascripts/scroll-up.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/javascripts/scroll-up.js b/javascripts/scroll-up.js index 2a1a04f567..db1aaba0a7 100644 --- a/javascripts/scroll-up.js +++ b/javascripts/scroll-up.js @@ -1,6 +1,8 @@ export default function () { // function to scroll up to page top const PageTopBtn = document.getElementById('js-scroll-top') + if (!PageTopBtn) return + PageTopBtn.addEventListener('click', (e) => { window.scrollTo({ top: 0, From 3ea7737a9b5da8665391871bc0a3b3103b5c5edd Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Tue, 23 Feb 2021 08:55:01 -0800 Subject: [PATCH 09/10] Update scroll-up.js --- javascripts/scroll-up.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascripts/scroll-up.js b/javascripts/scroll-up.js index db1aaba0a7..3a28db997c 100644 --- a/javascripts/scroll-up.js +++ b/javascripts/scroll-up.js @@ -2,7 +2,7 @@ export default function () { // function to scroll up to page top const PageTopBtn = document.getElementById('js-scroll-top') if (!PageTopBtn) return - + PageTopBtn.addEventListener('click', (e) => { window.scrollTo({ top: 0, From 6f46483715295a37ad0a7ed1d0bab3824877d7b8 Mon Sep 17 00:00:00 2001 From: Mario Campos Date: Tue, 23 Feb 2021 11:35:52 -0600 Subject: [PATCH 10/10] Document ghe-config command to enable/disable Code Scanning (#2932) --- ...guring-code-scanning-for-your-appliance.md | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/content/admin/configuration/configuring-code-scanning-for-your-appliance.md b/content/admin/configuration/configuring-code-scanning-for-your-appliance.md index 8dad550cab..7b579bfe1d 100644 --- a/content/admin/configuration/configuring-code-scanning-for-your-appliance.md +++ b/content/admin/configuration/configuring-code-scanning-for-your-appliance.md @@ -42,7 +42,6 @@ For the users of {% data variables.product.product_location %} to be able to ena ![Checkbox to enable or disable {% data variables.product.prodname_code_scanning %}](/assets/images/enterprise/management-console/enable-code-scanning-checkbox.png) {% data reusables.enterprise_management_console.save-settings %} - ### Running {% data variables.product.prodname_code_scanning %} using {% data variables.product.prodname_actions %} #### Setting up a self-hosted runner @@ -89,3 +88,25 @@ The {% data variables.product.prodname_codeql_runner %} is a command-line tool t 1. Under "{% data variables.product.prodname_advanced_security %}", unselect **{% data variables.product.prodname_code_scanning_capc %}**. ![Checkbox to enable or disable {% data variables.product.prodname_code_scanning %}](/assets/images/enterprise/management-console/code-scanning-disable.png) {% data reusables.enterprise_management_console.save-settings %} + +### Enabling or disabling {% data variables.product.prodname_code_scanning %} via the administrative shell (SSH) + +You can enable or disable {% data variables.product.prodname_code_scanning %} programmatically on {% data variables.product.product_location %}. For example, you can enable {% data variables.product.prodname_code_scanning %} with your infrastructure-as-code tooling when you deploy an instance for staging or disaster recovery. + +For more information about the administrative shell and command-line utilities for {% data variables.product.prodname_ghe_server %}, see "[Accessing the administrative shell (SSH)](/admin/configuration/accessing-the-administrative-shell-ssh)" and "[Command-line utilities](/admin/configuration/command-line-utilities#ghe-config)." + +1. SSH into {% data variables.product.product_location %}. +1. Enable {% data variables.product.prodname_code_scanning %}. + ```shell + ghe-config app.minio.enabled true + ghe-config app.code-scanning.enabled true + ``` +2. Optionally, disable {% data variables.product.prodname_code_scanning %}. + ```shell + ghe-config app.minio.enabled false + ghe-config app.code-scanning.enabled false + ``` +3. Apply the configuration. + ```shell + ghe-config-apply + ```