You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2012/04/02 13:28:59 UTC

git commit: WICKET-4472 Modal window accessibility - add role and aria attributes to outer div for assitive technologies

Updated Branches:
  refs/heads/master c8e0d1153 -> 1a6fc633c


WICKET-4472 Modal window accessibility - add role and aria attributes to outer div for assitive technologies

Add role and aria-labelledby attributes to the modalwindow.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/1a6fc633
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/1a6fc633
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/1a6fc633

Branch: refs/heads/master
Commit: 1a6fc633c639293967a8295a7de5e8c7cbc76ad6
Parents: c8e0d11
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Apr 2 13:28:13 2012 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Apr 2 13:28:13 2012 +0200

----------------------------------------------------------------------
 .../extensions/ajax/markup/html/modal/res/modal.js |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/1a6fc633/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
----------------------------------------------------------------------
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
index f26265a..a3556c6 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
@@ -679,9 +679,11 @@ Wicket.Window.prototype = {
 		this.bindInit();
 
 		// if the title is specified set it
-		if (this.settings.title != null)
+		if (this.settings.title != null) {
 			this.captionText.innerHTML = this.settings.title;
-
+			// http://www.w3.org/TR/wai-aria/states_and_properties#aria-labelledby
+			this.window.setAttribute('aria-labelledBy', this.settings.title);
+		}
 
 		// initial width and height
 		this.window.style.width = this.settings.width + (this.settings.resizable ? "px" : this.settings.widthUnit);
@@ -891,6 +893,8 @@ Wicket.Window.prototype = {
 			if (this.content.contentWindow.document.title != null) {
 				if (this.captionText.innerHTML != this.content.contentWindow.document.title) {													
 					this.captionText.innerHTML = this.content.contentWindow.document.title;
+					// http://www.w3.org/TR/wai-aria/states_and_properties#aria-labelledby
+					this.window.setAttribute('aria-labelledBy', this.content.contentWindow.document.title);
 					
 					// konqueror doesn't refresh caption text properly
 					if (Wicket.Browser.isKHTML()) {
@@ -1170,7 +1174,7 @@ Wicket.Window.idCounter = 0;
  */
 Wicket.Window.getMarkup = function(idWindow, idClassElement, idCaption, idContent, idTop, idTopLeft, idTopRight, idLeft, idRight, idBottomLeft, idBottomRight, idBottom, idCaptionText, isFrame) {
 	var s =
-			"<div class=\"wicket-modal\" id=\""+idWindow+"\" style=\"top: 10px; left: 10px; width: 100px;\"><form style='background-color:transparent;padding:0px;margin:0px;border-width:0px;position:static'>"+
+			"<div class=\"wicket-modal\" id=\""+idWindow+"\" role=\"dialog\" style=\"top: 10px; left: 10px; width: 100px;\"><form style='background-color:transparent;padding:0px;margin:0px;border-width:0px;position:static'>"+
 			"<div id=\""+idClassElement+"\">"+
 				
 				"<div class=\"w_top_1\">"+