[system] / trunk / pg / lib / Applet.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Applet.pm

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

Revision 5622 Revision 5624
1################################################################################ 1################################################################################
2# WeBWorK Online Homework Delivery System 2# WeBWorK Online Homework Delivery System
3# Copyright 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ 3# Copyright 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4# $CVSHeader: pg/lib/Applet.pm,v 1.5 2008/03/16 14:39:39 gage Exp $ 4# $CVSHeader: pg/lib/Applet.pm,v 1.6 2008/03/25 21:59:06 gage Exp $
5# 5#
6# This program is free software; you can redistribute it and/or modify it under 6# This program is free software; you can redistribute it and/or modify it under
7# the terms of either: (a) the GNU General Public License as published by the 7# the terms of either: (a) the GNU General Public License as published by the
8# Free Software Foundation; either version 2, or (at your option) any later 8# Free Software Foundation; either version 2, or (at your option) any later
9# version, or (b) the "Artistic License" which comes with this package. 9# version, or (b) the "Artistic License" which comes with this package.
90 90
91 91
92 92
93package Applet; 93package Applet;
94 94
95 95use URI::Escape;
96 96
97 97
98 98
99use MIME::Base64 qw( encode_base64 decode_base64); 99use MIME::Base64 qw( encode_base64 decode_base64);
100 100
371 my $appletId = $self->{appletName}; 371 my $appletId = $self->{appletName};
372 my $appletName = $self->{appletName}; 372 my $appletName = $self->{appletName};
373 my $archive = $self->{archive}; 373 my $archive = $self->{archive};
374 my $width = $self->{width}; 374 my $width = $self->{width};
375 my $height = $self->{height}; 375 my $height = $self->{height};
376 my $parameters = ''; 376 my $javaParameters = '';
377 my $parameters = ''; 377 my $flashParameters = '';
378 my %param_hash = %{$self->params()}; 378 my %param_hash = %{$self->params()};
379 foreach my $key (keys %param_hash) { 379 foreach my $key (keys %param_hash) {
380 $parameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n! 380 $javaParameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n!;
381 $flashParameters .= uri_escape($key).'='.uri_escape($param_hash{$key}).'&';
381 } 382 }
383 $flashParameters =~ s/\&$//; # trim last &
382 384
385
383 $objectText = $self->{objectText}; 386 $objectText = $self->{objectText};
384 $objectText =~ s/(\$\w+)/$1/gee; 387 $objectText =~ s/(\$\w+)/$1/gee;
385 return $objectText; 388 return $objectText;
386} 389}
387sub initialize { 390sub initialize {
512 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> 515 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
513 <param name="movie" value="$codebase/$appletName.swf" /> 516 <param name="movie" value="$codebase/$appletName.swf" />
514 <param name="quality" value="high" /> 517 <param name="quality" value="high" />
515 <param name="bgcolor" value="#869ca7" /> 518 <param name="bgcolor" value="#869ca7" />
516 <param name="allowScriptAccess" value="sameDomain" /> 519 <param name="allowScriptAccess" value="sameDomain" />
520 <param name="FlashVars" value="$flashParameters"/>
517 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" 521 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7"
518 width="$width" height="$height" name="$appletName" align="middle" id="$appletName" 522 width="$width" height="$height" name="$appletName" align="middle" id="$appletName"
519 play="true" loop="false" quality="high" allowScriptAccess="sameDomain" 523 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
520 type="application/x-shockwave-flash" 524 type="application/x-shockwave-flash"
521 pluginspage="http://www.macromedia.com/go/getflashplayer"> 525 pluginspage="http://www.macromedia.com/go/getflashplayer"
526 FlashVars="$flashParameters">
522 </embed> 527 </embed>
523 528
524 </object> 529 </object>
525END_OBJECT_TEXT 530END_OBJECT_TEXT
526 531
562 id = "$appletName" 567 id = "$appletName"
563 width = "$width" 568 width = "$width"
564 height = "$height" 569 height = "$height"
565 MAYSCRIPT 570 MAYSCRIPT
566 > 571 >
567 $parameters 572 $javaParameters
568 </applet> 573 </applet>
569 END_OBJECT_TEXT 574 END_OBJECT_TEXT
570 575
571=cut 576=cut
572 577
580 id = "$appletName" 585 id = "$appletName"
581 width = "$width" 586 width = "$width"
582 height = "$height" 587 height = "$height"
583 MAYSCRIPT 588 MAYSCRIPT
584 > 589 >
585 $parameters 590 $javaParameters
586 </applet> 591 </applet>
587END_OBJECT_TEXT 592END_OBJECT_TEXT
588 593
589sub new { 594sub new {
590 my $class = shift; 595 my $class = shift;

Legend:
Removed from v.5622  
changed lines
  Added in v.5624

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9