Skip to content

Commit

Permalink
rename all references from "srOnly" to "visuallyHidden" for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
vrozkovec committed Dec 4, 2023
1 parent 62e2049 commit f41c6ad
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel><span wicket:id="srOnly"></span></wicket:panel>
<wicket:panel><span wicket:id="visuallyHidden"></span></wicket:panel>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Stack extends GenericPanel<Integer> {
/**
* A label for the stack's progress
*/
private Label srOnly;
private Label visuallyHidden;

/**
* The color type of the stack
Expand Down Expand Up @@ -58,9 +58,9 @@ public Stack(String id, IModel<Integer> model) {
protected void onInitialize() {
super.onInitialize();

srOnly = new Label("srOnly", createLabelModel());
srOnly.add(AttributeModifier.append("class", Helper.screenReaderOnly));
add(srOnly);
visuallyHidden = new Label("visuallyHidden", createLabelModel());
visuallyHidden.add(AttributeModifier.append("class", Helper.visuallyHidden));
add(visuallyHidden);
}

public BackgroundColorBehavior.Color color() {
Expand Down Expand Up @@ -108,7 +108,7 @@ protected void onConfigure() {
super.onConfigure();

if (labeled()) {
srOnly.setRenderBodyOnly(true);
visuallyHidden.setRenderBodyOnly(true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public boolean contains(final String className) {
@SuppressWarnings("UnusedDeclaration")
public static final class Helper {
public static final String clearfix = "clearfix";
public static final String screenReaderOnly = "visually-hidden";
public static final String visuallyHidden = "visually-hidden";
}

@SuppressWarnings("UnusedDeclaration")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void progressBarWithDefaultStackMarkup() {
assertEquals("" + ProgressBar.MIN, stackTester.getAttribute("aria-valuemin"));
assertEquals("" + ProgressBar.MAX, stackTester.getAttribute("aria-valuemax"));

TagTester stackLabelTester = stackTester.getChild("class", Helper.screenReaderOnly);
TagTester stackLabelTester = stackTester.getChild("class", Helper.visuallyHidden);
assertEquals("" + progress + "%", stackLabelTester.getValue());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected void onConfigure() {
super.onConfigure();
Component label = get("label");
if (Strings.isEmpty(label.getDefaultModelObjectAsString())) {
label.add(AttributeModifier.append("class", Helper.screenReaderOnly));
label.add(AttributeModifier.append("class", Helper.visuallyHidden));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected void onConfigure() {
super.onConfigure();
Component label = get("label");
if (Strings.isEmpty(label.getDefaultModelObjectAsString())) {
label.add(AttributeModifier.append("class", Helper.screenReaderOnly));
label.add(AttributeModifier.append("class", Helper.visuallyHidden));
}
}
}

0 comments on commit f41c6ad

Please sign in to comment.