[system] / trunk / pg / macros / PGbasicmacros.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/PGbasicmacros.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 3704 Revision 4088
1749 return htmlLink( $envir{'localHelpURL'}.$infoRef, $type1, 1749 return htmlLink( $envir{'localHelpURL'}.$infoRef, $type1,
1750'target="ww_help" onclick="window.open(this.href,this.target,\'width=550,height=350,scrollbars=yes,resizable=on\'); return false;"'); 1750'target="ww_help" onclick="window.open(this.href,this.target,\'width=550,height=350,scrollbars=yes,resizable=on\'); return false;"');
1751} 1751}
1752 1752
1753sub appletLink { 1753sub appletLink {
1754 my $url = $_[0];
1755 return oldAppletLink(@_) unless ref($url) ; # handle legacy where applet link completely defined
1756 # search for applet
1757 # get fileName of applet
1758 my $applet = shift;
1759 my $options = shift;
1760 my $archive = $applet ->{archive};
1761 my $codebase = $applet ->{codebase};
1762 my $appletHeader = '';
1763 # find location of applet
1764
1765 unless ( $archive ){
1766 warn "Must define the achive where the applet code is to be found";
1767 return;
1768 }
1769 $codebase = findAppletFile($archive ) unless defined($codebase);
1770 if ( $codebase =~/^Error/) {
1771 warn $codebase;
1772 return;
1773 } else {
1774
1775 }
1776 my $appletHeader = qq! archive = "$archive " codebase = "$codebase" !;
1777 foreach my $key ('name', 'code','width','height', ) {
1778 if ( defined($applet->{$key}) ) {
1779 $appletHeader .= qq! $key = "!.$applet->{$key}.q!" ! ;
1780 } else {
1781 warn " $key is not defined for applet ".$applet->{name};
1782 # technically name is not required, but all of the other parameters are
1783 }
1784 }
1785 # add parameters to options
1786 if (defined($applet->{params}) ) {
1787 foreach my $key (keys %{ $applet->{params} }) {
1788 my $value = $applet->{params}->{$key};
1789 $options .= qq{< PARAM NAME = $key VALUE = "$value" >\n};
1790 }
1791
1792
1793 }
1794 MODES( TeX => "{\\bf \\underline{APPLET} }".$applet->{name},
1795 Latex2HTML => "\\begin{rawhtml} <APPLET $appletHeader> $options </APPLET>\\end{rawhtml}",
1796 HTML => "<APPLET\n $appletHeader> \n $options \n </APPLET>",
1797 #HTML => qq!<OBJECT $appletHeader codetype="application/java"> $options </OBJECT>!
1798 );
1799}
1800
1801sub oldAppletLink {
1754 my $url = shift; 1802 my $url = shift;
1755 my $options = shift; 1803 my $options = shift;
1756 $options = "" unless defined($options); 1804 $options = "" unless defined($options);
1757 M3( "{\\bf \\underline{APPLET} }", 1805 MODES( TeX => "{\\bf \\underline{APPLET} }",
1758 "\\begin{rawhtml} <APPLET $url> $options </APPLET>\\end{rawhtml}", 1806 Latex2HTML => "\\begin{rawhtml} <APPLET $url> $options </APPLET>\\end{rawhtml}",
1759 "<APPLET $url> $options </APPLET>" 1807 HTML => "<APPLET $url> $options </APPLET>"
1760 ); 1808 );
1761} 1809}
1762sub spf { 1810sub spf {
1763 my($number,$format) = @_; # attention, the order of format and number are reversed 1811 my($number,$format) = @_; # attention, the order of format and number are reversed
1764 $format = "%4.3g" unless $format; # default value for format 1812 $format = "%4.3g" unless $format; # default value for format

Legend:
Removed from v.3704  
changed lines
  Added in v.4088

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9