r1062 - in branches/experimental: a11y tabbable

r1062 - in branches/experimental: a11y tabbable


Author: scott.gonzalez
Date: Mon Dec 8 18:38:36 2008
New Revision: 1062
Added:
branches/experimental/a11y/
branches/experimental/a11y/aria.js
Modified:
branches/experimental/tabbable/ui.core.js
Log:
Moved ARIA helper methods out of tabbable code.
Added: branches/experimental/a11y/aria.js
==============================================================================
--- (empty file)
+++ branches/experimental/a11y/aria.js    Mon Dec 8 18:38:36 2008
@@ -0,0 +1,23 @@
+(function($) {
+
+function getID(label){
+    label = $(label);
+    var id = label.attr('id');
+    if(!id){
+        id = 'labelID-'+ new Date().getTime();
+        label.attr({'id': id});
+    }
+    return id;
+}
+
+$.fn.labelWith = function(label) {
+    var id = getID(label);
+    return this.attr({'aria-labelledby': id});
+};
+
+$.fn.describeWith = function(label) {
+    var id = getID(label);
+    return this.attr({'aria-describedby': id});
+};
+
+})(jQuery);
Modified: branches/experimental/tabbable/ui.core.js
==============================================================================
--- branches/experimental/tabbable/ui.core.js    (original)
+++ branches/experimental/tabbable/ui.core.js    Mon Dec 8 18:38:36 2008
@@ -53,25 +53,4 @@
    return this;
};
-//labelledby and describedby
-function getID(label){
-    label = $(label);
-    var id = label.attr('id');
-    if(!id){
-        id = 'labelID-'+ new Date().getTime();
-        label.attr({'id': id});
-    }
-    return id;
-}
-
-$.fn.labelWith = function(label) {
-    var id = getID(label);
-    return this.attr({'aria-labelledby': id});
-};
-
-$.fn.describeWith = function(label) {
-    var id = getID(label);
-    return this.attr({'aria-describedby': id});
-};
-
})(jQuery);