[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /interface loncommon.pm /xml londefdef.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 25 Jul 2003 10:44:36 -0000


www		Fri Jul 25 06:44:36 2003 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
    /loncom/interface	loncommon.pm 
    /loncom/xml	londefdef.pm 
  Log:
  Accessibility features work as advertised.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.198 loncom/homework/structuretags.pm:1.199
--- loncom/homework/structuretags.pm:1.198	Thu Jul 17 14:42:13 2003
+++ loncom/homework/structuretags.pm	Fri Jul 25 06:44:36 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.198 2003/07/17 18:42:13 sakharuk Exp $
+# $Id: structuretags.pm,v 1.199 2003/07/25 10:44:36 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -94,6 +94,7 @@
 	    'onUnload="'.&Apache::lonmenu::unloadevents().'" ';
 	my $background=&Apache::lonxml::get_param('background',$parstack,
 						  $safeeval);
+	if ($ENV{'browser.imagesuppress'} eq 'on') { $background=''; }
 	if ($background) {
 	    $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
 		$background;
@@ -101,11 +102,14 @@
 	} else {
 	    my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack,
 						   $safeeval);
-	    if ($bgcolor) {
+	    if (($bgcolor) && ($ENV{'browser.blackwhite'} ne 'on')) {
 		$body_tag_start.='bgcolor="'.$bgcolor.'" ';
 	    } else {
 		$body_tag_start.='bgcolor="#ffffff"';
 	    }
+	}
+	if ($ENV{'browser.fontenhance'} eq 'on') {
+	    $body_tag_start.=' style="font-size: x-large;" ';
 	}
 	$body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target,1);
 	if ($target eq 'web' && $ENV{'request.state'} ne 'construct') {
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.109 loncom/interface/loncommon.pm:1.110
--- loncom/interface/loncommon.pm:1.109	Thu Jul 17 14:10:53 2003
+++ loncom/interface/loncommon.pm	Fri Jul 25 06:44:36 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.109 2003/07/17 18:10:53 matthew Exp $
+# $Id: loncommon.pm,v 1.110 2003/07/25 10:44:36 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1721,6 +1721,17 @@
 ##############################################
 sub designparm {
     my ($which,$domain)=@_;
+    if ($ENV{'browser.blackwhite'} eq 'on') {
+	if ($which=~/\.(font|alink|vlink|link)$/) {
+	    return '#000000';
+	}
+	if ($which=~/\.(pgbg|sidebg)$/) {
+	    return '#FFFFFF';
+	}
+	if ($which=~/\.tabbg$/) {
+	    return '#CCCCCC';
+	}
+    }
     if ($ENV{'environment.color.'.$which}) {
 	return $ENV{'environment.color.'.$which};
     }
@@ -1785,7 +1796,11 @@
     my $alink=&designparm($function.'.alink',$domain);
     my $vlink=&designparm($function.'.vlink',$domain);
     my $sidebg=&designparm($function.'.sidebg',$domain);
-
+# Accessibility font enhance
+    unless ($addentries) { $addentries=''; }
+    if ($ENV{'browser.fontenhance'} eq 'on') {
+	$addentries.=' style="font-size: x-large"';
+    }
  # role and realm
     my ($role,$realm)
        =&Apache::lonnet::plaintext((split(/\./,$ENV{'request.role'}))[0]);
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.154 loncom/xml/londefdef.pm:1.155
--- loncom/xml/londefdef.pm:1.154	Tue Jul 15 16:47:24 2003
+++ loncom/xml/londefdef.pm	Fri Jul 25 06:44:36 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.154 2003/07/15 20:47:24 www Exp $
+# $Id: londefdef.pm,v 1.155 2003/07/25 10:44:36 www Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -464,6 +464,29 @@
 	    $currentstring.='<head>'.
 		&Apache::lonmenu::registerurl(undef,$target).'</head>';
 	}
+# Accessibility
+	if ($ENV{'browser.imagesuppress'} eq 'on') {
+	    delete($token->[2]->{'background'});
+	}
+	if ($ENV{'browser.fontenhance'} eq 'on') {
+	    my $style='';
+	    foreach my $key (keys(%{$token->[2]})) {
+		if ($key =~ /^style$/i) {
+		    $style.=$token->[2]->{$key}.';';
+		    delete($token->[2]->{$key});
+		}
+	    }
+	    $token->[2]->{'style'}=$style.'; font-size: x-large;';
+	}
+	if ($ENV{'browser.blackwhite'} eq 'on') {
+	    delete($token->[2]->{'font'});
+	    delete($token->[2]->{'link'});
+	    delete($token->[2]->{'alink'});
+	    delete($token->[2]->{'vlink'});
+	    delete($token->[2]->{'bgcolor'});
+	    delete($token->[2]->{'background'});
+	}
+# Overload loads
 	my $onLoad='';
 	foreach my $key (keys(%{$token->[2]})) {
 	    if ($key =~ /^onload$/i) {
@@ -1179,7 +1202,12 @@
     my $currentstring = '';
     if ($target eq 'web') {
 	my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval);
-	if ($face=~/symbol/i) {$Apache::lonxml::prevent_entity_encode++;}
+	if ($face=~/symbol/i) {
+	    $Apache::lonxml::prevent_entity_encode++;
+	} else {
+	    if (($ENV{'browser.fontenhance'} eq 'on') || 
+		($ENV{'browser.blackwhite'} eq 'on')) { return ''; }
+	}
 	$currentstring = $token->[4];     
     }  elsif ($target eq 'tex') {
 	my $fontsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval);