Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create updated tests for APG design pattern example: Date Picker Spin Button #696

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion tests/datepicker-spin-button/data/references.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ refId,value
author,Isabel Del Castillo
authorEmail,isa.delcastillo5@gmail.com
title,Date Picker Spin Button Example
reference,reference/2021-10-15_93728/datepicker-spinbuttons.html
reference,reference/2022-4-19_94552/datepicker-spinbuttons.html
designPattern,https://w3c.github.io/aria-practices/#spinbutton
example,https://w3c.github.io/aria-practices/examples/spinbutton/datepicker-spinbuttons.html
group,https://w3c.github.io/aria/#group
Expand Down
Original file line number Diff line number Diff line change
@@ -1,119 +1,119 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Date Picker Spin Button Example</title>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">

<link href="css/datepicker-spinbuttons.css" rel="stylesheet">
<script src="js/spinbutton-date.js" type="text/javascript"></script>
<script src="js/datepicker-spinbuttons.js" type="text/javascript"></script>
</head>
<body>
<main>
<h1>Date Picker Spin Button Example</h1>
<p>
The following example uses the <a href="https://w3c.github.io/aria-practices/#spinbutton">Spin Button Design Pattern</a> to implement a date picker.
It includes three spin buttons: one for setting the day, a second for month, and a third for year.
</p>
<section>
<div class="example-header">
<h2 id="ex_label">Example</h2>
</div>
<div role="separator" id="ex_start_sep" aria-labelledby="ex_start_sep ex_label" aria-label="Start of"></div>
<div id="example">

<a id="beforelink" href="#beforelink">Navigate forwards from here</a>
<div id="example-group"
class="datepicker-spinbuttons"
role="group"
aria-labelledby="myDatepickerLabel myDatepickerDate">

<div id="myDatepickerLabel">Choose a Date</div>
<div class="date" hidden id="myDatepickerDate">current value is Friday, June 30th, 2019</div>

<div class="day spinbutton"
> <button type="button" class="decrease"
tabindex="-1"
aria-label="previous day">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,18 18,18 10,4"></polygon>
</svg>
</button>
<div class="previous" aria-hidden="true">30</div>
<div role="spinbutton"
tabindex="0"
aria-valuenow="1"
aria-valuetext="first"
aria-valuemin="1"
aria-valuemax="31"
aria-label="Day">1</div>
<div class="next" aria-hidden="true">2</div>
<button type="button" class="increase"
tabindex="-1"
aria-label="next day">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,4 18,4 10,18"></polygon>
</svg>
</button>
</div>

<div class="month spinbutton">
<button type="button" class="decrease"
tabindex="-1"
aria-label="previous month">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,18 18,18 10,4"></polygon>
</svg>
</button>
<div class="previous" aria-hidden="true">May</div>
<div role="spinbutton"
tabindex="0"
aria-valuenow="5"
aria-valuetext="June"
aria-valuemin="0"
aria-valuemax="11"
aria-label="Month">June</div>
<div class="next" aria-hidden="true">July</div>
<button type="button" class="increase"
tabindex="-1"
aria-label="next month">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,4 18,4 10,18"></polygon>
</svg>
</button>
</div>

<div class="year spinbutton">
<button type="button" class="decrease"
tabindex="-1"
aria-label="previous year">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,18 18,18 10,4"></polygon>
</svg>
</button>
<div class="previous" aria-hidden="true">2018</div>
<div role="spinbutton"
tabindex="0"
aria-valuenow="2019"
aria-valuemin="2019"
aria-valuemax="2040"
aria-label="Year">2019</div>
<div class="next" aria-hidden="true">2020</div>
<button type="button" class="increase"
tabindex="-1"
aria-label="next year">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,4 18,4 10,18"></polygon>
</svg>
</button>
</div>
</div>
<a id="afterlink" href="#afterlink">Navigate backwards from here</a>
</div>
<div role="separator" id="ex_end_sep" aria-labelledby="ex_end_sep ex_label" aria-label="End of"></div>
</section>
</main>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Date Picker Spin Button Example</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<link href="css/datepicker-spinbuttons.css" rel="stylesheet">
<script src="js/spinbutton-date.js" type="text/javascript"></script>
<script src="js/datepicker-spinbuttons.js" type="text/javascript"></script>
</head>
<body>
<main>
<h1>Date Picker Spin Button Example</h1>
<p>
The following example uses the <a href="https://w3c.github.io/aria-practices/#spinbutton">Spin Button Design Pattern</a> to implement a date picker.
It includes three spin buttons: one for setting the day, a second for month, and a third for year.
</p>
<section>
<div class="example-header">
<h2 id="ex_label">Example</h2>
</div>
<div role="separator" id="ex_start_sep" aria-labelledby="ex_start_sep ex_label" aria-label="Start of"></div>
<div id="example">
<a id="beforelink" href="#beforelink">Navigate forwards from here</a>
<div id="example-group"
class="datepicker-spinbuttons"
role="group"
aria-labelledby="myDatepickerLabel myDatepickerDate">
<div id="myDatepickerLabel">Choose a Date</div>
<div class="date" hidden id="myDatepickerDate">current value is Friday, June 30th, 2019</div>
<div class="day spinbutton"
> <button type="button" class="decrease"
tabindex="-1"
aria-label="previous day">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,18 18,18 10,4"></polygon>
</svg>
</button>
<div class="previous" aria-hidden="true">30</div>
<div role="spinbutton"
tabindex="0"
aria-valuenow="1"
aria-valuetext="first"
aria-valuemin="1"
aria-valuemax="31"
aria-label="Day">1</div>
<div class="next" aria-hidden="true">2</div>
<button type="button" class="increase"
tabindex="-1"
aria-label="next day">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,4 18,4 10,18"></polygon>
</svg>
</button>
</div>
<div class="month spinbutton">
<button type="button" class="decrease"
tabindex="-1"
aria-label="previous month">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,18 18,18 10,4"></polygon>
</svg>
</button>
<div class="previous" aria-hidden="true">May</div>
<div role="spinbutton"
tabindex="0"
aria-valuenow="5"
aria-valuetext="June"
aria-valuemin="0"
aria-valuemax="11"
aria-label="Month">June</div>
<div class="next" aria-hidden="true">July</div>
<button type="button" class="increase"
tabindex="-1"
aria-label="next month">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,4 18,4 10,18"></polygon>
</svg>
</button>
</div>
<div class="year spinbutton">
<button type="button" class="decrease"
tabindex="-1"
aria-label="previous year">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,18 18,18 10,4"></polygon>
</svg>
</button>
<div class="previous" aria-hidden="true">2018</div>
<div role="spinbutton"
tabindex="0"
aria-valuenow="2019"
aria-valuemin="2019"
aria-valuemax="2040"
aria-label="Year">2019</div>
<div class="next" aria-hidden="true">2020</div>
<button type="button" class="increase"
tabindex="-1"
aria-label="next year">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
<polygon points="2,4 18,4 10,18"></polygon>
</svg>
</button>
</div>
</div>
<a id="afterlink" href="#afterlink">Navigate backwards from here</a>
</div>
<div role="separator" id="ex_end_sep" aria-labelledby="ex_end_sep ex_label" aria-label="End of"></div>
</section>
</main>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<title>Date Picker Spin Button Example</title>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<title>Date Picker Spin Button Example</title>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<title>Date Picker Spin Button Example</title>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,5 @@ window.addEventListener('load', function () {
spinButtons.forEach(function (spinButton) {
var datepicker = new DatePickerSpinButtons(spinButton);
datepicker.init();
document.defaultView.datepicker = datepicker;
});
});