Add locked header and mosuetrap binding for '/'

This commit is contained in:
Dave Gallant
2022-08-19 17:37:48 +00:00
parent 4df9bb1044
commit 5e40b36232
6 changed files with 130 additions and 6 deletions

43
package-lock.json generated
View File

@@ -14,12 +14,15 @@
"core-js": "^3.8.3",
"jquery": "^3.6.0",
"moment": "^2.29.4",
"mousetrap": "^1.6.5",
"vue": "^3.2.13",
"vue-loading-overlay": "^5.0.3"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@types/bootstrap": "^5.2.2",
"@types/mousetrap": "^1.6.9",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
@@ -2200,6 +2203,15 @@
"@types/node": "*"
}
},
"node_modules/@types/bootstrap": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.2.2.tgz",
"integrity": "sha512-Vzsa2RWFE9emGSlbFp9zgIhzBQ0gsWHD6oD0Qy/N1mPmMbm2yumAYfcaTMj3iHJhWBAshJWHJsscY3KbkKEu5w==",
"dev": true,
"dependencies": {
"@popperjs/core": "^2.9.2"
}
},
"node_modules/@types/connect": {
"version": "3.4.35",
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
@@ -2313,6 +2325,12 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/mousetrap": {
"version": "1.6.9",
"resolved": "https://registry.npmjs.org/@types/mousetrap/-/mousetrap-1.6.9.tgz",
"integrity": "sha512-HUAiN65VsRXyFCTicolwb5+I7FM6f72zjMWr+ajGk+YTvzBgXqa2A5U7d+rtsouAkunJ5U4Sb5lNJjo9w+nmXg==",
"dev": true
},
"node_modules/@types/node": {
"version": "18.6.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.3.tgz",
@@ -7682,6 +7700,11 @@
"node": "*"
}
},
"node_modules/mousetrap": {
"version": "1.6.5",
"resolved": "https://registry.npmjs.org/mousetrap/-/mousetrap-1.6.5.tgz",
"integrity": "sha512-QNo4kEepaIBwiT8CDhP98umTetp+JNfQYBWvC1pc6/OAibuXtRcxZ58Qz8skvEHYvURne/7R8T5VoOI7rDsEUA=="
},
"node_modules/mrmime": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz",
@@ -12942,6 +12965,15 @@
"@types/node": "*"
}
},
"@types/bootstrap": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.2.2.tgz",
"integrity": "sha512-Vzsa2RWFE9emGSlbFp9zgIhzBQ0gsWHD6oD0Qy/N1mPmMbm2yumAYfcaTMj3iHJhWBAshJWHJsscY3KbkKEu5w==",
"dev": true,
"requires": {
"@popperjs/core": "^2.9.2"
}
},
"@types/connect": {
"version": "3.4.35",
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
@@ -13043,6 +13075,12 @@
"integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==",
"dev": true
},
"@types/mousetrap": {
"version": "1.6.9",
"resolved": "https://registry.npmjs.org/@types/mousetrap/-/mousetrap-1.6.9.tgz",
"integrity": "sha512-HUAiN65VsRXyFCTicolwb5+I7FM6f72zjMWr+ajGk+YTvzBgXqa2A5U7d+rtsouAkunJ5U4Sb5lNJjo9w+nmXg==",
"dev": true
},
"@types/node": {
"version": "18.6.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.3.tgz",
@@ -16809,6 +16847,11 @@
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
},
"mousetrap": {
"version": "1.6.5",
"resolved": "https://registry.npmjs.org/mousetrap/-/mousetrap-1.6.5.tgz",
"integrity": "sha512-QNo4kEepaIBwiT8CDhP98umTetp+JNfQYBWvC1pc6/OAibuXtRcxZ58Qz8skvEHYvURne/7R8T5VoOI7rDsEUA=="
},
"mrmime": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz",

View File

@@ -11,15 +11,19 @@
"@popperjs/core": "^2.11.5",
"axios": "^0.27.2",
"bootstrap": "^5.2.0",
"bootstrap-vue": "^2.22.0",
"core-js": "^3.8.3",
"jquery": "^3.6.0",
"moment": "^2.29.4",
"vue": "^3.2.13",
"mousetrap": "^1.6.5",
"vue": "^3.2.37",
"vue-loading-overlay": "^5.0.3"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@types/bootstrap": "^5.2.2",
"@types/mousetrap": "^1.6.9",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",

View File

@@ -5,9 +5,10 @@
type="text"
placeholder="Search"
v-model="filter"
ref="search"
/>
<table class="table table-dark table-hover">
<thead>
<thead class="thead thead-light text-muted">
<tr>
<th scope="col">Deal</th>
<th scope="col">Views</th>
@@ -47,6 +48,8 @@
import axios from "axios";
import moment from "moment";
import Loading from "vue-loading-overlay";
import Mousetrap from "mousetrap";
import "vue-loading-overlay/dist/vue-loading.css";
export default {
@@ -68,6 +71,12 @@ export default {
.catch((err) => {
console.log(err.response);
});
Mousetrap.bind("/", this.focusSearch);
},
methods: {
focusSearch() {
this.$refs.search.focus();
},
},
props: ["date"],
computed: {

View File

@@ -3,6 +3,7 @@ import App from "./App.vue";
import "bootstrap/dist/css/bootstrap.min.css";
import "bootstrap/dist/js/bootstrap.min.js";
import "mousetrap/mousetrap.min.js";
import "./style.css";
import "./xess.css";

View File

@@ -1,3 +1,8 @@
body {
background-color: black;
}
.thead {
position: sticky;
top: 0;
}

View File

@@ -1080,12 +1080,21 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"
"@nuxt/opencollective@^0.3.2":
version "0.3.3"
resolved "https://registry.yarnpkg.com/@nuxt/opencollective/-/opencollective-0.3.3.tgz#80ff0eb8f6fca1d0ed5a089b9688f41bff2dd8ab"
integrity sha512-6IKCd+gP0HliixqZT/p8nW3tucD6Sv/u/eR2A9X4rxT/6hXlMzA4GZQzq4d2qnBAwSwGpmKyzkyTjNjrhaA25A==
dependencies:
chalk "^4.1.0"
consola "^2.15.0"
node-fetch "^2.6.7"
"@polka/url@^1.0.0-next.20":
version "1.0.0-next.21"
resolved "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz"
integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==
"@popperjs/core@^2.11.5":
"@popperjs/core@^2.11.5", "@popperjs/core@^2.9.2":
version "2.11.5"
resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz"
integrity sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==
@@ -1142,6 +1151,13 @@
dependencies:
"@types/node" "*"
"@types/bootstrap@^5.2.2":
version "5.2.2"
resolved "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.2.2.tgz"
integrity sha512-Vzsa2RWFE9emGSlbFp9zgIhzBQ0gsWHD6oD0Qy/N1mPmMbm2yumAYfcaTMj3iHJhWBAshJWHJsscY3KbkKEu5w==
dependencies:
"@popperjs/core" "^2.9.2"
"@types/connect-history-api-fallback@^1.3.5":
version "1.3.5"
resolved "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz"
@@ -1229,6 +1245,11 @@
resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz"
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
"@types/mousetrap@^1.6.9":
version "1.6.9"
resolved "https://registry.npmjs.org/@types/mousetrap/-/mousetrap-1.6.9.tgz"
integrity sha512-HUAiN65VsRXyFCTicolwb5+I7FM6f72zjMWr+ajGk+YTvzBgXqa2A5U7d+rtsouAkunJ5U4Sb5lNJjo9w+nmXg==
"@types/node@*":
version "18.6.3"
resolved "https://registry.npmjs.org/@types/node/-/node-18.6.3.tgz"
@@ -2093,9 +2114,25 @@ boolbase@^1.0.0:
resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz"
integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==
bootstrap-vue@^2.22.0:
version "2.22.0"
resolved "https://registry.yarnpkg.com/bootstrap-vue/-/bootstrap-vue-2.22.0.tgz#2b3d7926d24af0bd289ddce7ba76b07000aab3e5"
integrity sha512-denjR/ae0K7Jrcqud3TrZWw0p/crtyigeGUNunWQ4t+KFi+7rzJ6j6lx1W5/gpUtSSUgNbWrXcHH4lIWXzXOOQ==
dependencies:
"@nuxt/opencollective" "^0.3.2"
bootstrap "^4.6.1"
popper.js "^1.16.1"
portal-vue "^2.1.7"
vue-functional-data-merge "^3.1.0"
bootstrap@^4.6.1:
version "4.6.2"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.6.2.tgz#8e0cd61611728a5bf65a3a2b8d6ff6c77d5d7479"
integrity sha512-51Bbp/Uxr9aTuy6ca/8FbFloBUJZLHwnhTcnjIeRn2suQWsWzcuJhGjKDB5eppVte/8oCdOL3VuwxvZDUggwGQ==
bootstrap@^5.2.0:
version "5.2.0"
resolved "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.0.tgz"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.2.0.tgz#838727fb60f1630db370fe57c63cbcf2962bb3d3"
integrity sha512-qlnS9GL6YZE6Wnef46GxGv1UpGGzAwO0aPL1yOjzDIJpeApeMvqV24iL+pjr2kU4dduoBA9fINKWKgMToobx9A==
brace-expansion@^1.1.7:
@@ -2408,6 +2445,11 @@ connect-history-api-fallback@^2.0.0:
resolved "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz"
integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==
consola@^2.15.0:
version "2.15.3"
resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.3.tgz#2e11f98d6a4be71ff72e0bdf07bd23e12cb61550"
integrity sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==
consolidate@^0.15.1:
version "0.15.1"
resolved "https://registry.npmjs.org/consolidate/-/consolidate-0.15.1.tgz"
@@ -4212,6 +4254,11 @@ moment@^2.29.4:
resolved "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz"
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
mousetrap@^1.6.5:
version "1.6.5"
resolved "https://registry.npmjs.org/mousetrap/-/mousetrap-1.6.5.tgz"
integrity sha512-QNo4kEepaIBwiT8CDhP98umTetp+JNfQYBWvC1pc6/OAibuXtRcxZ58Qz8skvEHYvURne/7R8T5VoOI7rDsEUA==
mrmime@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz"
@@ -4598,6 +4645,16 @@ pkg-dir@^4.1.0:
dependencies:
find-up "^4.0.0"
popper.js@^1.16.1:
version "1.16.1"
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b"
integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==
portal-vue@^2.1.7:
version "2.1.7"
resolved "https://registry.yarnpkg.com/portal-vue/-/portal-vue-2.1.7.tgz#ea08069b25b640ca08a5b86f67c612f15f4e4ad4"
integrity sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g==
portfinder@^1.0.26:
version "1.0.28"
resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz"
@@ -5826,6 +5883,11 @@ vue-eslint-parser@^8.0.1:
lodash "^4.17.21"
semver "^7.3.5"
vue-functional-data-merge@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/vue-functional-data-merge/-/vue-functional-data-merge-3.1.0.tgz#08a7797583b7f35680587f8a1d51d729aa1dc657"
integrity sha512-leT4kdJVQyeZNY1kmnS1xiUlQ9z1B/kdBFCILIjYYQDqZgLqCLa0UhjSSeRX6c3mUe6U5qYeM8LrEqkHJ1B4LA==
vue-hot-reload-api@^2.3.0:
version "2.3.4"
resolved "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz"
@@ -5858,9 +5920,9 @@ vue-template-es2015-compiler@^1.9.0:
resolved "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz"
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==
vue@^3.2.13:
vue@^3.2.37:
version "3.2.37"
resolved "https://registry.npmjs.org/vue/-/vue-3.2.37.tgz"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.37.tgz#da220ccb618d78579d25b06c7c21498ca4e5452e"
integrity sha512-bOKEZxrm8Eh+fveCqS1/NkG/n6aMidsI6hahas7pa0w/l7jkbssJVsRhVDs07IdDq7h9KHswZOgItnwJAgtVtQ==
dependencies:
"@vue/compiler-dom" "3.2.37"