possible accessibility bugfix to make JAWS read the help texts
This commit is contained in:
		
							parent
							
								
									548d947a57
								
							
						
					
					
						commit
						7dd2eb3efc
					
				
					 18 changed files with 32 additions and 30 deletions
				
			
		|  | @ -97,7 +97,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.ActionCenter | |||
| 
 | ||||
| 			Text.Text = layout.CultureName; | ||||
| 			Button.ToolTip = tooltip; | ||||
| 			AutomationProperties.SetHelpText(Button, tooltip); | ||||
| 			AutomationProperties.SetName(Button, tooltip); | ||||
| 		} | ||||
| 
 | ||||
| 		private void Popup_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) | ||||
|  |  | |||
|  | @ -121,7 +121,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.ActionCenter | |||
| 		{ | ||||
| 			Button.ToolTip = text; | ||||
| 			Text.Text = text; | ||||
| 			Button.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text); | ||||
| 			Button.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text); | ||||
| 		} | ||||
| 
 | ||||
| 		private UIElement GetWirelessIcon(int signalStrength) | ||||
|  |  | |||
|  | @ -87,7 +87,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.ActionCenter | |||
| 			PowerPlug.Visibility = status.IsOnline ? Visibility.Visible : Visibility.Collapsed; | ||||
| 			Text.Text = tooltip; | ||||
| 			Warning.Visibility = status.BatteryChargeStatus == BatteryChargeStatus.Critical ? Visibility.Visible : Visibility.Collapsed; | ||||
| 			this.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, tooltip); | ||||
| 			this.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, tooltip); | ||||
| 		} | ||||
| 
 | ||||
| 		private void RenderCharge(double charge, BatteryChargeStatus status) | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ | |||
|             <RowDefinition Height="1*" /> | ||||
|             <RowDefinition Height="1*" /> | ||||
|         </Grid.RowDefinitions> | ||||
|         <TextBlock x:Name="TimeTextBlock" Grid.Row="0" Text="{Binding Path=Time}" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Bottom" Focusable="True" AutomationProperties.HelpText="{Binding Path=Time}" /> | ||||
|         <TextBlock x:Name="DateTextBlock" Grid.Row="1" Text="{Binding Path=Date}" HorizontalAlignment="Center" VerticalAlignment="Top" Focusable="True" AutomationProperties.HelpText="{Binding Path=Date}" /> | ||||
|         <TextBlock x:Name="TimeTextBlock" Grid.Row="0" Text="{Binding Path=Time}" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Bottom" Focusable="True" AutomationProperties.Name="{Binding Path=Time}" /> | ||||
|         <TextBlock x:Name="DateTextBlock" Grid.Row="1" Text="{Binding Path=Date}" HorizontalAlignment="Center" VerticalAlignment="Top" Focusable="True" AutomationProperties.Name="{Binding Path=Date}" /> | ||||
|     </Grid> | ||||
| </UserControl> | ||||
|  |  | |||
|  | @ -43,7 +43,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.Taskbar | |||
| 			CultureCodeTextBlock.Text = layout.CultureCode; | ||||
| 			CultureNameTextBlock.Text = layout.CultureName; | ||||
| 			LayoutNameTextBlock.Text = layout.LayoutName; | ||||
| 			System.Windows.Automation.AutomationProperties.SetHelpText(Button, layout.LayoutName); | ||||
| 			System.Windows.Automation.AutomationProperties.SetName(Button, layout.LayoutName); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  |  | |||
|  | @ -121,7 +121,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.Taskbar | |||
| 
 | ||||
| 			LayoutCultureCode.Text = layout.CultureCode; | ||||
| 			Button.ToolTip = tooltip; | ||||
| 			AutomationProperties.SetHelpText(Button, tooltip); | ||||
| 			AutomationProperties.SetName(Button, tooltip); | ||||
| 		} | ||||
| 
 | ||||
| 		private void Popup_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) | ||||
|  |  | |||
|  | @ -88,7 +88,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.Taskbar | |||
| 				{ | ||||
| 					WirelessIcon.Child = GetWirelessIcon(network.SignalStrength); | ||||
| 					Button.ToolTip = text.Get(TextKey.SystemControl_NetworkWirelessConnected).Replace("%%NAME%%", network.Name); | ||||
| 					Button.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, Button.ToolTip as string); | ||||
| 					Button.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, Button.ToolTip as string); | ||||
| 				} | ||||
| 
 | ||||
| 				WirelessNetworksStackPanel.Children.Add(button); | ||||
|  |  | |||
|  | @ -101,7 +101,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.Taskbar | |||
| 			Button.ToolTip = tooltip; | ||||
| 			PowerPlug.Visibility = status.IsOnline ? Visibility.Visible : Visibility.Collapsed; | ||||
| 			Warning.Visibility = status.BatteryChargeStatus == BatteryChargeStatus.Critical ? Visibility.Visible : Visibility.Collapsed; | ||||
| 			this.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, tooltip); | ||||
| 			this.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, tooltip); | ||||
| 		} | ||||
| 
 | ||||
| 		private void RenderCharge(double charge, BatteryChargeStatus status) | ||||
|  |  | |||
|  | @ -244,8 +244,8 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows | |||
| 			Dispatcher.Invoke(() => | ||||
| 			{ | ||||
| 				ZoomLevel.Text = $"{value}%"; | ||||
| 				var zoomButtonHelpText = text.Get(TextKey.BrowserWindow_ZoomLevelReset).Replace("%%ZOOM%%", value.ToString("0")); | ||||
| 				ZoomResetButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, zoomButtonHelpText); | ||||
| 				var zoomButtonName = text.Get(TextKey.BrowserWindow_ZoomLevelReset).Replace("%%ZOOM%%", value.ToString("0")); | ||||
| 				ZoomResetButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, zoomButtonName); | ||||
| 			}); | ||||
| 		} | ||||
| 
 | ||||
|  | @ -511,6 +511,8 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows | |||
| 			var javascript = @"
 | ||||
| if (typeof __SEB_focusElement === 'undefined') { | ||||
|   __SEB_focusElement = function (forward) { | ||||
|     if (!document.body) | ||||
| 		return; | ||||
| 	var items = [].map | ||||
| 	  .call(document.body.querySelectorAll(['input', 'select', 'a[href]', 'textarea', 'button', '[tabindex]']), function(el, i) { return { el, i } }) | ||||
| 	  .filter(function(e) { return e.el.tabIndex >= 0 && !e.el.disabled && e.el.offsetParent; }) | ||||
|  | @ -638,13 +640,13 @@ if (typeof __SEB_focusElement === 'undefined') { | |||
| 		private void LoadText() | ||||
| 		{ | ||||
| 			DeveloperConsoleText.Text = text.Get(TextKey.BrowserWindow_DeveloperConsoleMenuItem); | ||||
| 			DeveloperConsoleButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text.Get(TextKey.BrowserWindow_DeveloperConsoleMenuItem)); | ||||
| 			DeveloperConsoleButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_DeveloperConsoleMenuItem)); | ||||
| 			FindCaseSensitiveCheckBox.Content = text.Get(TextKey.BrowserWindow_FindCaseSensitive); | ||||
| 			FindMenuText.Text = text.Get(TextKey.BrowserWindow_FindMenuItem); | ||||
| 			FindMenuButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text.Get(TextKey.BrowserWindow_FindMenuItem)); | ||||
| 			FindMenuButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_FindMenuItem)); | ||||
| 			ZoomText.Text = text.Get(TextKey.BrowserWindow_ZoomMenuItem); | ||||
| 			ZoomInButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text.Get(TextKey.BrowserWindow_ZoomMenuPlus)); | ||||
| 			ZoomOutButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text.Get(TextKey.BrowserWindow_ZoomMenuMinus)); | ||||
| 			ZoomInButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_ZoomMenuPlus)); | ||||
| 			ZoomOutButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_ZoomMenuMinus)); | ||||
| 			ReloadButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_ReloadButton)); | ||||
| 			BackwardButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_BackwardButton)); | ||||
| 			ForwardButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_ForwardButton)); | ||||
|  |  | |||
|  | @ -97,7 +97,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.ActionCenter | |||
| 
 | ||||
| 			Text.Text = layout.CultureName; | ||||
| 			Button.ToolTip = tooltip; | ||||
| 			AutomationProperties.SetHelpText(Button, tooltip); | ||||
| 			AutomationProperties.SetName(Button, tooltip); | ||||
| 		} | ||||
| 
 | ||||
| 		private void Popup_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) | ||||
|  |  | |||
|  | @ -121,7 +121,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.ActionCenter | |||
| 		{ | ||||
| 			Button.ToolTip = text; | ||||
| 			Text.Text = text; | ||||
| 			Button.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text); | ||||
| 			Button.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text); | ||||
| 		} | ||||
| 
 | ||||
| 		private UIElement GetWirelessIcon(int signalStrength) | ||||
|  |  | |||
|  | @ -87,7 +87,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.ActionCenter | |||
| 			PowerPlug.Visibility = status.IsOnline ? Visibility.Visible : Visibility.Collapsed; | ||||
| 			Text.Text = tooltip; | ||||
| 			Warning.Visibility = status.BatteryChargeStatus == BatteryChargeStatus.Critical ? Visibility.Visible : Visibility.Collapsed; | ||||
| 			this.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, tooltip); | ||||
| 			this.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, tooltip); | ||||
| 		} | ||||
| 
 | ||||
| 		private void RenderCharge(double charge, BatteryChargeStatus status) | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ | |||
|             <RowDefinition Height="1*" /> | ||||
|             <RowDefinition Height="1*" /> | ||||
|         </Grid.RowDefinitions> | ||||
|         <TextBlock x:Name="TimeTextBlock" Grid.Row="0" Text="{Binding Path=Time}" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Bottom" Focusable="True" AutomationProperties.HelpText="{Binding Path=Time}" /> | ||||
|         <TextBlock x:Name="DateTextBlock" Grid.Row="1" Text="{Binding Path=Date}" HorizontalAlignment="Center" VerticalAlignment="Top" Focusable="True" AutomationProperties.HelpText="{Binding Path=Date}" /> | ||||
|         <TextBlock x:Name="TimeTextBlock" Grid.Row="0" Text="{Binding Path=Time}" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Bottom" Focusable="True" AutomationProperties.Name="{Binding Path=Time}" /> | ||||
|         <TextBlock x:Name="DateTextBlock" Grid.Row="1" Text="{Binding Path=Date}" HorizontalAlignment="Center" VerticalAlignment="Top" Focusable="True" AutomationProperties.Name="{Binding Path=Date}" /> | ||||
|     </Grid> | ||||
| </UserControl> | ||||
|  |  | |||
|  | @ -43,7 +43,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.Taskbar | |||
| 			CultureCodeTextBlock.Text = layout.CultureCode; | ||||
| 			CultureNameTextBlock.Text = layout.CultureName; | ||||
| 			LayoutNameTextBlock.Text = layout.LayoutName; | ||||
| 			System.Windows.Automation.AutomationProperties.SetHelpText(Button, layout.LayoutName); | ||||
| 			System.Windows.Automation.AutomationProperties.SetName(Button, layout.LayoutName); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  |  | |||
|  | @ -121,7 +121,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.Taskbar | |||
| 
 | ||||
| 			LayoutCultureCode.Text = layout.CultureCode; | ||||
| 			Button.ToolTip = tooltip; | ||||
| 			AutomationProperties.SetHelpText(Button, tooltip); | ||||
| 			AutomationProperties.SetName(Button, tooltip); | ||||
| 		} | ||||
| 
 | ||||
| 		private void Popup_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) | ||||
|  |  | |||
|  | @ -88,7 +88,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.Taskbar | |||
| 				{ | ||||
| 					WirelessIcon.Child = GetWirelessIcon(network.SignalStrength); | ||||
| 					Button.ToolTip = text.Get(TextKey.SystemControl_NetworkWirelessConnected).Replace("%%NAME%%", network.Name); | ||||
| 					Button.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, Button.ToolTip as string); | ||||
| 					Button.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, Button.ToolTip as string); | ||||
| 				} | ||||
| 
 | ||||
| 				WirelessNetworksStackPanel.Children.Add(button); | ||||
|  |  | |||
|  | @ -101,7 +101,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.Taskbar | |||
| 			Button.ToolTip = tooltip; | ||||
| 			PowerPlug.Visibility = status.IsOnline ? Visibility.Visible : Visibility.Collapsed; | ||||
| 			Warning.Visibility = status.BatteryChargeStatus == BatteryChargeStatus.Critical ? Visibility.Visible : Visibility.Collapsed; | ||||
| 			this.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, tooltip); | ||||
| 			this.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, tooltip); | ||||
| 		} | ||||
| 
 | ||||
| 		private void RenderCharge(double charge, BatteryChargeStatus status) | ||||
|  |  | |||
|  | @ -244,8 +244,8 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows | |||
| 			Dispatcher.Invoke(() => | ||||
| 			{ | ||||
| 				ZoomLevel.Text = $"{value}%"; | ||||
| 				var zoomButtonHelpText = text.Get(TextKey.BrowserWindow_ZoomLevelReset).Replace("%%ZOOM%%", value.ToString("0")); | ||||
| 				ZoomResetButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, zoomButtonHelpText); | ||||
| 				var zoomButtonName = text.Get(TextKey.BrowserWindow_ZoomLevelReset).Replace("%%ZOOM%%", value.ToString("0")); | ||||
| 				ZoomResetButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, zoomButtonName); | ||||
| 			}); | ||||
| 		} | ||||
| 
 | ||||
|  | @ -644,13 +644,13 @@ if (typeof __SEB_focusElement === 'undefined') { | |||
| 		private void LoadText() | ||||
| 		{ | ||||
| 			DeveloperConsoleText.Text = text.Get(TextKey.BrowserWindow_DeveloperConsoleMenuItem); | ||||
| 			DeveloperConsoleButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text.Get(TextKey.BrowserWindow_DeveloperConsoleMenuItem)); | ||||
| 			DeveloperConsoleButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_DeveloperConsoleMenuItem)); | ||||
| 			FindCaseSensitiveCheckBox.Content = text.Get(TextKey.BrowserWindow_FindCaseSensitive); | ||||
| 			FindMenuText.Text = text.Get(TextKey.BrowserWindow_FindMenuItem); | ||||
| 			FindMenuButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text.Get(TextKey.BrowserWindow_FindMenuItem)); | ||||
| 			FindMenuButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_FindMenuItem)); | ||||
| 			ZoomText.Text = text.Get(TextKey.BrowserWindow_ZoomMenuItem); | ||||
| 			ZoomInButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text.Get(TextKey.BrowserWindow_ZoomMenuPlus)); | ||||
| 			ZoomOutButton.SetValue(System.Windows.Automation.AutomationProperties.HelpTextProperty, text.Get(TextKey.BrowserWindow_ZoomMenuMinus)); | ||||
| 			ZoomInButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_ZoomMenuPlus)); | ||||
| 			ZoomOutButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_ZoomMenuMinus)); | ||||
| 			ReloadButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_ReloadButton)); | ||||
| 			BackwardButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_BackwardButton)); | ||||
| 			ForwardButton.SetValue(System.Windows.Automation.AutomationProperties.NameProperty, text.Get(TextKey.BrowserWindow_ForwardButton)); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Jonas Sourlier
						Jonas Sourlier