From 4147bac0944a73823420e21b6dfd78adbf190c9f Mon Sep 17 00:00:00 2001 From: NBTX Date: Mon, 2 Sep 2019 11:27:24 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20and=20Revert=20"Revert=20"=E2=8C=A8?= =?UTF-8?q?=EF=B8=8FAdd=20autocomplete=20widget=20with=20command=20line=20?= =?UTF-8?q?completion""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dd5dfdbabd107a00052d26f6764be53a2659f2ab. --- assets/css/styles.scss | 21 +- assets/css/themes.scss | 6 +- components/autocomplete.vue | 190 ++++++ components/history.vue | 2 +- package-lock.json | 5 + package.json | 1 + pages/index.vue | 1173 ++++++++++++++++++----------------- 7 files changed, 828 insertions(+), 570 deletions(-) create mode 100644 components/autocomplete.vue diff --git a/assets/css/styles.scss b/assets/css/styles.scss index f1634f000..d544fdf05 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -86,20 +86,20 @@ button { font-weight: 700; font-size: 16px; cursor: pointer; - transition: all .2s; + transition: all 0.2s ease-in-out; - &[disabled], - &.disabled { + &[disabled], &.disabled { opacity: 0.7; cursor: default; } - &:hover, - &:focus { - background-color: var(--act-color); - box-shadow: inset 0 0 0 2px var(--ac-color); - color: var(--ac-color); - } + // Only show hover and focus if the button is *not* + // disabled. + &:not([disabled]):hover, &:not(.disabled):focus { + background-color: transparent; + box-shadow: inset 0 0 0 2px var(--ac-color); + color: var(--ac-color); + } } fieldset { @@ -237,7 +237,8 @@ input[type="checkbox"] { } .disabled, -input[disabled] { +input[disabled], +button[disabled] { background-color: var(--err-color); color: #b2b2b2; } diff --git a/assets/css/themes.scss b/assets/css/themes.scss index 11606549b..d611740f3 100644 --- a/assets/css/themes.scss +++ b/assets/css/themes.scss @@ -10,6 +10,8 @@ --bg-dark-color: #000000; // Background color --bg-color: #121212; + // Auto-complete color + --atc-color: #212121; // Text color --fg-color: #FFF; @@ -26,6 +28,8 @@ --bg-dark-color: #ffffff; // Background color --bg-color: #F6F8FA; + // Auto-complete color + --atc-color: #F1F1F1; // Text color --fg-color: #121212; @@ -36,4 +40,4 @@ --ac-color: #51FF0D; // Active text color --act-color: #121212; -} \ No newline at end of file +} diff --git a/components/autocomplete.vue b/components/autocomplete.vue new file mode 100644 index 000000000..0ec662627 --- /dev/null +++ b/components/autocomplete.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/components/history.vue b/components/history.vue index e3ef9a010..cc132fca5 100644 --- a/components/history.vue +++ b/components/history.vue @@ -46,7 +46,7 @@