Skip to content

Commit

Permalink
Merge branch 'keyboard-shortcut-animation' into command-palette
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Nov 20, 2023
2 parents 5fa1ed0 + 3996dc0 commit e475abe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/hudson/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,10 @@ public static String generateItemId() {
return String.valueOf(Math.floor(Math.random() * 3000));
}

/**
* @param keyboardShortcut the shortcut to be translated
* @return the translated shortcut, e.g. CMD+K -> ⌘+K for macOS, CTRL+K for Windows
*/
@Restricted(NoExternalUse.class)
public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) {
StaplerRequest currentRequest = Stapler.getCurrentRequest();
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/resources/lib/layout/keyboard-shortcut.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ THE SOFTWARE.
Optional suffix to the shortcut
</st:attribute>
Displays a keyboard shortcut chip based on the component's body.
CMD/CTRL will automatically be translated to the user's operating system's appropriate variant.
CMD will automatically be translated to the user's operating system's appropriate variant.
</st:documentation>

<div class="jenkins-tooltip__keyboard-shortcut">
<j:if test="${attrs.prefix != null}">
<j:if test="${attrs.containsKey('prefix')}">
<span>
${attrs.prefix}
</span>
Expand All @@ -47,7 +47,7 @@ THE SOFTWARE.
</j:set>
<j:out value="${h.translateModifierKeysForUsersPlatform(body)}" />
</div>
<j:if test="${attrs.suffix != null}">
<j:if test="${attrs.containsKey('suffix')}">
<span>
${attrs.suffix}
</span>
Expand Down
1 change: 0 additions & 1 deletion war/src/main/scss/components/_tooltips.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
transparent 60%
);
mask-size: 200% 200%;
mask-position: center;
animation: shortcut-glow-animation 1.25s forwards linear;
}

Expand Down

0 comments on commit e475abe

Please sign in to comment.