-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combobox Examples: Initial cut of ARIA 1.1 style with listbox and gri…
…d popups (pull #440) Issue #100 initial drop of the code for the listbox and grid popup examples. This includes only the js/css/html for the example itself, not the descriptive text for the example pages.
- Loading branch information
1 parent
7403702
commit 2bbebe9
Showing
9 changed files
with
968 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+220 Bytes
examples/combobox/aria1.1pattern/imgs/arrow_drop_down_grey_27x27.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/** | ||
* ARIA Combobox Examples | ||
*/ | ||
|
||
var FRUITS_AND_VEGGIES = [ | ||
['Apple', 'Fruit'], | ||
['Artichoke', 'Vegetable'], | ||
['Asparagus', 'Vegetable'], | ||
['Banana', 'Fruit'], | ||
['Beets', 'Vegetable'], | ||
['Bell pepper', 'Vegetable'], | ||
['Broccoli', 'Vegetable'], | ||
['Brussels sprout', 'Vegetable'], | ||
['Cabbage', 'Vegetable'], | ||
['Carrot', 'Vegetable'], | ||
['Cauliflower', 'Vegetable'], | ||
['Celery', 'Vegetable'], | ||
['Chard', 'Vegetable'], | ||
['Chicory', 'Vegetable'], | ||
['Corn', 'Vegetable'], | ||
['Cucumber', 'Vegetable'], | ||
['Daikon', 'Vegetable'], | ||
['Date', 'Fruit'], | ||
['Edamame', 'Vegetable'], | ||
['Eggplant', 'Vegetable'], | ||
['Elderberry', 'Fruit'], | ||
['Fennel', 'Vegetable'], | ||
['Fig', 'Fruit'], | ||
['Garlic', 'Vegetable'], | ||
['Grape', 'Fruit'], | ||
['Honeydew melon', 'Fruit'], | ||
['Iceberg lettuce', 'Vegetable'], | ||
['Jerusalem artichoke', 'Vegetable'], | ||
['Kale', 'Vegetable'], | ||
['Kiwi', 'Fruit'], | ||
['Leek', 'Vegetable'], | ||
['Lemon', 'Fruit'], | ||
['Mango', 'Fruit'], | ||
['Mangosteen', 'Fruit'], | ||
['Melon', 'Fruit'], | ||
['Mushroom', 'Fungus'], | ||
['Nectarine', 'Fruit'], | ||
['Okra', 'Vegetable'], | ||
['Olive', 'Vegetable'], | ||
['Onion', 'Vegetable'], | ||
['Orange', 'Fruit'], | ||
['Parship', 'Vegetable'], | ||
['Pea', 'Vegetable'], | ||
['Pear', 'Fruit'], | ||
['Pineapple', 'Fruit'], | ||
['Potato', 'Vegetable'], | ||
['Pumpkin', 'Fruit'], | ||
['Quince', 'Fruit'], | ||
['Radish', 'Vegetable'], | ||
['Rhubarb', 'Vegetable'], | ||
['Shallot', 'Vegetable'], | ||
['Spinach', 'Vegetable'], | ||
['Squash', 'Vegetable'], | ||
['Strawberry', 'Fruit'], | ||
['Sweet potato', 'Vegetable'], | ||
['Tomato', 'Fruit'], | ||
['Turnip', 'Vegetable'], | ||
['Ugli fruit', 'Fruit'], | ||
['Victoria plum', 'Fruit'], | ||
['Watercress', 'Vegetable'], | ||
['Watermelon', 'Fruit'], | ||
['Yam', 'Vegetable'], | ||
['Zucchini', 'Vegetable'] | ||
]; | ||
|
||
function searchVeggies (searchString) { | ||
var results = []; | ||
|
||
for (var i = 0; i < FRUITS_AND_VEGGIES.length; i++) { | ||
var veggie = FRUITS_AND_VEGGIES[i][0].toLowerCase(); | ||
if (veggie.indexOf(searchString.toLowerCase()) === 0) { | ||
results.push(FRUITS_AND_VEGGIES[i]); | ||
} | ||
} | ||
|
||
return results; | ||
} | ||
|
||
/** | ||
* @function onload | ||
* @desc Initialize the combobox examples once the page has loaded | ||
*/ | ||
window.addEventListener('load', function () { | ||
var ex1Combobox = new aria.GridCombobox( | ||
document.getElementById('ex1-combobox'), | ||
document.getElementById('ex1-input'), | ||
document.getElementById('ex1-grid'), | ||
searchVeggies | ||
); | ||
|
||
}); |
Oops, something went wrong.