aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.core.js27
-rw-r--r--ui/ui.dialog.js2
2 files changed, 29 insertions, 0 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index 2cf48d11f..be0caa920 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -437,4 +437,31 @@ $.ui.mouse.defaults = {
delay: 0
};
+
+// WAI-ARIA Semantics
+var isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
+$.fn.extend({
+ ariaRole : function(role) {
+ // setter?
+ if (role) {
+ return this.each(function(i, el) {
+ $(el).attr("role", isFF2 ? "wairole:" + role : role);
+ });
+ }
+ // getter just returns first jquery member's role string
+ return (this.eq(0).attr("role") || "").replace(/^wairole:/, "");
+ },
+
+ ariaState : function(state, value) {
+ // setter?
+ if (value)
+ return this.each(function(i, el) {
+ isFF2? el.setAttributeNS("http://www.w3.org/2005/07/aaa", "aaa:" + state, value) :
+ $(el).attr("aria-" + state, value);
+ });
+ // getter
+ return this.attr(isFF2? "aaa:"+state : "aria-" + state);
+ }
+});
+
})(jQuery);
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js
index c0a99494c..c856af5ce 100644
--- a/ui/ui.dialog.js
+++ b/ui/ui.dialog.js
@@ -84,6 +84,8 @@ $.widget("ui.dialog", {
(options.closeOnEscape && ev.keyCode
&& ev.keyCode == $.keyCode.ESCAPE && self.close());
})
+ .ariaRole("dialog")
+ .ariaState("labelledby", titleId)
.mousedown(function() {
self._moveToTop();
}),