@@ -10,7 +10,7 @@ import { OnCanvasTextBox } from "./OnCanvasTextBox.js";
1010// import { localize } from "./app-localization.js";
1111import { default_palette } from "./color-data.js" ;
1212import { image_formats } from "./file-format-data.js" ;
13- import { $G , E , TAU , debounce , from_canvas_coords , get_help_folder_icon , get_icon_for_tool , get_rgba_from_color , is_discord_embed , is_pride_month , make_canvas , to_canvas_coords } from "./helpers.js" ;
13+ import { $G , E , TAU , debounce , from_canvas_coords , get_help_folder_icon , get_icon_for_tool , get_rgba_from_color , is_discord_embed , is_pride_month , make_canvas , render_access_key , to_canvas_coords } from "./helpers.js" ;
1414import { apply_image_transformation , draw_grid , draw_selection_box , flip_horizontal , flip_vertical , invert_monochrome , invert_rgb , rotate , stretch_and_skew , threshold_black_and_white } from "./image-manipulation.js" ;
1515import { show_imgur_uploader } from "./imgur.js" ;
1616import { showMessageBox } from "./msgbox.js" ;
@@ -450,11 +450,11 @@ function show_custom_zoom_window() {
450450 $fieldset . append ( `
451451 <legend>${ localize ( "Zoom to" ) } </legend>
452452 <div class="fieldset-body">
453- <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-1" aria-keyshortcuts="Alt+1 1" value="1"/><label for="zoom-option-1">${ AccessKeys . toHTML ( "&100%" ) } </label></div>
454- <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-2" aria-keyshortcuts="Alt+2 2" value="2"/><label for="zoom-option-2">${ AccessKeys . toHTML ( "&200%" ) } </label></div>
455- <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-4" aria-keyshortcuts="Alt+4 4" value="4"/><label for="zoom-option-4">${ AccessKeys . toHTML ( "&400%" ) } </label></div>
456- <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-6" aria-keyshortcuts="Alt+6 6" value="6"/><label for="zoom-option-6">${ AccessKeys . toHTML ( "&600%" ) } </label></div>
457- <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-8" aria-keyshortcuts="Alt+8 8" value="8"/><label for="zoom-option-8">${ AccessKeys . toHTML ( "&800%" ) } </label></div>
453+ <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-1" aria-keyshortcuts="Alt+1 1" value="1"/><label for="zoom-option-1">${ render_access_key ( "&100%" ) } </label></div>
454+ <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-2" aria-keyshortcuts="Alt+2 2" value="2"/><label for="zoom-option-2">${ render_access_key ( "&200%" ) } </label></div>
455+ <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-4" aria-keyshortcuts="Alt+4 4" value="4"/><label for="zoom-option-4">${ render_access_key ( "&400%" ) } </label></div>
456+ <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-6" aria-keyshortcuts="Alt+6 6" value="6"/><label for="zoom-option-6">${ render_access_key ( "&600%" ) } </label></div>
457+ <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-8" aria-keyshortcuts="Alt+8 8" value="8"/><label for="zoom-option-8">${ render_access_key ( "&800%" ) } </label></div>
458458 <div class="radio-field"><input type="radio" name="custom-zoom-radio" id="zoom-option-really-custom" value="really-custom"/><label for="zoom-option-really-custom"><input type="number" min="10" max="1000" name="really-custom-zoom-input" class="inset-deep no-spinner" value=""/>%</label></div>
459459 </div>
460460 ` ) ;
@@ -3175,8 +3175,8 @@ function image_attributes() {
31753175 let width_in_px = main_canvas . width ;
31763176 let height_in_px = main_canvas . height ;
31773177
3178- const $width_label = $ ( E ( "label" ) ) . appendTo ( $main ) . html ( AccessKeys . toHTML ( localize ( "&Width:" ) ) ) ;
3179- const $height_label = $ ( E ( "label" ) ) . appendTo ( $main ) . html ( AccessKeys . toHTML ( localize ( "&Height:" ) ) ) ;
3178+ const $width_label = $ ( E ( "label" ) ) . appendTo ( $main ) . html ( render_access_key ( localize ( "&Width:" ) ) ) ;
3179+ const $height_label = $ ( E ( "label" ) ) . appendTo ( $main ) . html ( render_access_key ( localize ( "&Height:" ) ) ) ;
31803180 const $width = $ ( E ( "input" ) ) . attr ( { type : "number" , min : 1 , "aria-keyshortcuts" : "Alt+W W W" } ) . addClass ( "no-spinner inset-deep" ) . appendTo ( $width_label ) ;
31813181 const $height = $ ( E ( "input" ) ) . attr ( { type : "number" , min : 1 , "aria-keyshortcuts" : "Alt+H H H" } ) . addClass ( "no-spinner inset-deep" ) . appendTo ( $height_label ) ;
31823182
@@ -3192,9 +3192,9 @@ function image_attributes() {
31923192 const $units = $ ( E ( "fieldset" ) ) . appendTo ( $main ) . append ( `
31933193 <legend>${ localize ( "Units" ) } </legend>
31943194 <div class="fieldset-body">
3195- <div class="radio-field"><input type="radio" name="units" id="unit-in" value="in" aria-keyshortcuts="Alt+I I"><label for="unit-in">${ AccessKeys . toHTML ( localize ( "&Inches" ) ) } </label></div>
3196- <div class="radio-field"><input type="radio" name="units" id="unit-cm" value="cm" aria-keyshortcuts="Alt+M M"><label for="unit-cm">${ AccessKeys . toHTML ( localize ( "C&m" ) ) } </label></div>
3197- <div class="radio-field"><input type="radio" name="units" id="unit-px" value="px" aria-keyshortcuts="Alt+P P"><label for="unit-px">${ AccessKeys . toHTML ( localize ( "&Pixels" ) ) } </label></div>
3195+ <div class="radio-field"><input type="radio" name="units" id="unit-in" value="in" aria-keyshortcuts="Alt+I I"><label for="unit-in">${ render_access_key ( localize ( "&Inches" ) ) } </label></div>
3196+ <div class="radio-field"><input type="radio" name="units" id="unit-cm" value="cm" aria-keyshortcuts="Alt+M M"><label for="unit-cm">${ render_access_key ( localize ( "C&m" ) ) } </label></div>
3197+ <div class="radio-field"><input type="radio" name="units" id="unit-px" value="px" aria-keyshortcuts="Alt+P P"><label for="unit-px">${ render_access_key ( localize ( "&Pixels" ) ) } </label></div>
31983198 </div>
31993199 ` ) ;
32003200 $units . find ( `[value=${ current_unit } ]` ) . attr ( { checked : true } ) ;
@@ -3208,8 +3208,8 @@ function image_attributes() {
32083208 const $colors = $ ( E ( "fieldset" ) ) . appendTo ( $main ) . append ( `
32093209 <legend>${ localize ( "Colors" ) } </legend>
32103210 <div class="fieldset-body">
3211- <div class="radio-field"><input type="radio" name="colors" id="attribute-monochrome" value="monochrome" aria-keyshortcuts="Alt+B B"><label for="attribute-monochrome">${ AccessKeys . toHTML ( localize ( "&Black and white" ) ) } </label></div>
3212- <div class="radio-field"><input type="radio" name="colors" id="attribute-polychrome" value="polychrome" aria-keyshortcuts="Alt+L L"><label for="attribute-polychrome">${ AccessKeys . toHTML ( localize ( "Co&lors" ) ) } </label></div>
3211+ <div class="radio-field"><input type="radio" name="colors" id="attribute-monochrome" value="monochrome" aria-keyshortcuts="Alt+B B"><label for="attribute-monochrome">${ render_access_key ( localize ( "&Black and white" ) ) } </label></div>
3212+ <div class="radio-field"><input type="radio" name="colors" id="attribute-polychrome" value="polychrome" aria-keyshortcuts="Alt+L L"><label for="attribute-polychrome">${ render_access_key ( localize ( "Co&lors" ) ) } </label></div>
32133213 </div>
32143214 ` ) ;
32153215 $colors . find ( `[value=${ monochrome ? "monochrome" : "polychrome" } ]` ) . attr ( { checked : true } ) ;
@@ -3290,7 +3290,7 @@ function image_attributes() {
32903290 } ) ;
32913291
32923292 // Parsing HTML with jQuery; $Button takes text (not HTML) or Node/DocumentFragment
3293- $w . $Button ( $ . parseHTML ( AccessKeys . toHTML ( localize ( "&Default" ) ) ) [ 0 ] , ( ) => {
3293+ $w . $Button ( $ . parseHTML ( render_access_key ( localize ( "&Default" ) ) ) [ 0 ] , ( ) => {
32943294 width_in_px = default_canvas_width ;
32953295 height_in_px = default_canvas_height ;
32963296 $width . val ( width_in_px / unit_sizes_in_px [ current_unit ] ) ;
@@ -3376,7 +3376,7 @@ function image_flip_and_rotate() {
33763376 value="flip-horizontal"
33773377 aria-keyshortcuts="Alt+F"
33783378 checked
3379- /><label for="flip-horizontal">${ AccessKeys . toHTML ( localize ( "&Flip horizontal" ) ) } </label>
3379+ /><label for="flip-horizontal">${ render_access_key ( localize ( "&Flip horizontal" ) ) } </label>
33803380 </div>
33813381 <div class="radio-wrapper">
33823382 <input
@@ -3385,7 +3385,7 @@ function image_flip_and_rotate() {
33853385 id="flip-vertical"
33863386 value="flip-vertical"
33873387 aria-keyshortcuts="Alt+V"
3388- /><label for="flip-vertical">${ AccessKeys . toHTML ( localize ( "Flip &vertical" ) ) } </label>
3388+ /><label for="flip-vertical">${ render_access_key ( localize ( "Flip &vertical" ) ) } </label>
33893389 </div>
33903390 <div class="radio-wrapper">
33913391 <input
@@ -3394,7 +3394,7 @@ function image_flip_and_rotate() {
33943394 id="rotate-by-angle"
33953395 value="rotate-by-angle"
33963396 aria-keyshortcuts="Alt+R"
3397- /><label for="rotate-by-angle">${ AccessKeys . toHTML ( localize ( "&Rotate by angle" ) ) } </label>
3397+ /><label for="rotate-by-angle">${ render_access_key ( localize ( "&Rotate by angle" ) ) } </label>
33983398 </div>
33993399 ` ) ;
34003400
@@ -3416,7 +3416,7 @@ function image_flip_and_rotate() {
34163416 aria-keyshortcuts="Alt+${ AccessKeys . get ( label_with_hotkey ) . toUpperCase ( ) } "
34173417 /><label
34183418 for="rotate-${ degrees } "
3419- >${ AccessKeys . toHTML ( label_with_hotkey ) } </label>
3419+ >${ render_access_key ( label_with_hotkey ) } </label>
34203420 </div>
34213421 ` ) ;
34223422 }
@@ -3538,7 +3538,7 @@ function image_stretch_and_skew() {
35383538 width : "40px"
35393539 } ) . addClass ( "no-spinner inset-deep" ) ;
35403540 $ ( E ( "td" ) ) . appendTo ( $tr ) . append ( $img ) ;
3541- $ ( E ( "td" ) ) . appendTo ( $tr ) . append ( $ ( E ( "label" ) ) . html ( AccessKeys . toHTML ( label_with_hotkey ) ) . attr ( "for" , input_id ) ) ;
3541+ $ ( E ( "td" ) ) . appendTo ( $tr ) . append ( $ ( E ( "label" ) ) . html ( render_access_key ( label_with_hotkey ) ) . attr ( "for" , input_id ) ) ;
35423542 $ ( E ( "td" ) ) . appendTo ( $tr ) . append ( $input ) ;
35433543 $ ( E ( "td" ) ) . appendTo ( $tr ) . text ( label_unit ) ;
35443544
0 commit comments