Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions plugins/find-and-replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ codeInput.plugins.FindAndReplace = class extends codeInput.Plugin {
const findPreviousButton = document.createElement('button');
const replaceButton = document.createElement('button');
const replaceAllButton = document.createElement('button');

// TODO: Make a button element (semantic HTML for accessibility) in next major version
const cancel = document.createElement('span');
cancel.setAttribute("role", "button");
cancel.setAttribute("aria-label", this.instructions.closeDialog);
cancel.setAttribute("tabindex", 0); // Visible to keyboard navigation
cancel.setAttribute("title", this.instructions.closeDialog);

Expand Down Expand Up @@ -243,8 +247,10 @@ codeInput.plugins.FindAndReplace = class extends codeInput.Plugin {
replaceInput.placeholder = this.instructions.replacePlaceholder;
findNextButton.innerText = "↓";
findNextButton.title = this.instructions.findNext;
findNextButton.setAttribute("aria-label", this.instructions.findNext);
findPreviousButton.innerText = "↑";
findPreviousButton.title = this.instructions.findPrevious;
findNextButton.setAttribute("aria-label", this.instructions.findPrevious);
replaceButton.className = 'code-input_find-and-replace_button-hidden';
replaceButton.innerText = this.instructions.replaceActionShort;
replaceButton.title = this.instructions.replaceAction;
Expand Down
4 changes: 4 additions & 0 deletions plugins/go-to-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ codeInput.plugins.GoToLine = class extends codeInput.Plugin {

const dialog = document.createElement('div');
const input = document.createElement('input');

// TODO: Make a button element (semantic HTML for accessibility) in next major version
const cancel = document.createElement('span');
cancel.setAttribute("role", "button");
cancel.setAttribute("aria-label", this.instructions.closeDialog);
cancel.setAttribute("tabindex", 0); // Visible to keyboard navigation
cancel.setAttribute("title", this.instructions.closeDialog);

Expand Down
2 changes: 1 addition & 1 deletion tests/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ console.log("I've got another line!", 2 < 3, "should be true.");
addText(textarea, `function printTriples(max) {\nfor(let i = 0; i < max-2; i++) {\nfor(let j = 0; j < max-1; j++) {\nfor(let k = 0; k < max; k++) {\nconsole.log(i,j,k);\n}\n//Hmmm...\n}//Test auto-unindent\n{`, true);
move(textarea, 1); // Move after created closing bracket
backspace(textarea); // Remove created closing bracket
}, 'function printTriples(max) {\n for(let i = 0; i < max-2; i++) {\n for(let j = 0; j < max-1; j++) {\n for(let k = 0; k < max; k++) {\n console.log(i,j,k);\n }\n //Hmmm...\n }//Test auto-unindent\n {\n }\n }\n }\n}', 221, 211);
}, 'function printTriples(max) {\n for(let i = 0; i < max-2; i++) {\n for(let j = 0; j < max-1; j++) {\n for(let k = 0; k < max; k++) {\n console.log(i,j,k);\n }\n //Hmmm...\n }//Test auto-unindent\n {\n }\n }\n }\n}', 221, 221);

// SelectTokenCallbacks
if(isHLJS) {
Expand Down