forked from jenkinsci/jenkins
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add-search-keyboard-shortcut' into new-search-bar-compo…
…nent
- Loading branch information
Showing
14 changed files
with
11,310 additions
and
7,917 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"extends": [ | ||
"config:base", | ||
":disableDependencyDashboard", | ||
":semanticCommitsDisabled" | ||
], | ||
"enabledManagers": [ | ||
"npm" | ||
], | ||
"packageRules": [ | ||
{ | ||
"matchDatasources": ["npm"], | ||
"addLabels": ["javascript"], | ||
"stabilityDays": 3, | ||
"reviewers": ["team:sig-ux"] | ||
}, | ||
{ | ||
"matchPackageNames": ["handlebars"], | ||
"allowedVersions": "<=3.0.8", | ||
"description": "https://issues.jenkins.io/browse/JENKINS-68926", | ||
"enabled": false | ||
}, | ||
{ | ||
"matchPackageNames": ["jest"], | ||
"allowedVersions": "<=26.0.1", | ||
"description": "https://issues.jenkins.io/browse/JENKINS-68975", | ||
"enabled": false | ||
} | ||
], | ||
"labels": ["dependencies"], | ||
"rebaseWhen": "conflicted" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Defines what linker should be used for installing Node packages (useful to | ||
# enable the node-modules plugin), one of: pnp, pnpm and node-modules. | ||
nodeLinker: node-modules | ||
|
||
# The yarnPath setting is currently the preferred way to install Yarn within a | ||
# project, as it ensures that your whole team will use the exact same Yarn | ||
# version, without having to individually keep it up-to-date. | ||
yarnPath: .yarn/releases/yarn-3.2.0.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import hotkeys from "hotkeys-js" | ||
|
||
window.addEventListener("load", () => { | ||
const searchBar = document.querySelector("#search-box") | ||
searchBar.placeholder = searchBar.placeholder + ` (${translateModifierKeysForUsersPlatform("CMD+K") | ||
.replace("CMD", "⌘")})` | ||
|
||
hotkeys(translateModifierKeysForUsersPlatform("CMD+K"), () => { | ||
searchBar.focus() | ||
|
||
// Returning false stops the event and prevents default browser events | ||
return false | ||
}) | ||
}) | ||
|
||
/** | ||
* Given a keyboard shortcut, e.g. CMD+K, replace any included modifier keys for the user's | ||
* platform e.g. output will be CMD+K for macOS/iOS, CTRL+K for Windows/Linux | ||
* @param {string} keyboardShortcut The shortcut to translate | ||
*/ | ||
function translateModifierKeysForUsersPlatform(keyboardShortcut) { | ||
const useCmdKey = navigator.platform.toUpperCase().indexOf("MAC") >= 0 || | ||
navigator.platform.toUpperCase() === "IPHONE" || | ||
navigator.platform.toUpperCase() === "IPAD" | ||
return keyboardShortcut.replaceAll(/CMD|CTRL/ig, useCmdKey ? "CMD" : "CTRL") | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.