[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 5667 Revision 6009
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.10 2008/05/05 17:24:31 gage Exp $ 4# $CVSHeader: pg/lib/Applet.pm,v 1.15 2009/02/07 22:28:34 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.
99use MIME::Base64 qw( encode_base64 decode_base64); 99use MIME::Base64 qw( encode_base64 decode_base64);
100 100
101 101
102=head2 Default javaScript functions placed in header 102=head2 Default javaScript functions placed in header
103 103
104=pod
105
104These functions are automatically defined for use for 106These functions are automatically defined for use for
105any javaScript placed in the text of a PG question. 107any javaScript placed in the text of a PG question.
106 108
107 getApplet(appletName) -- finds the applet path in the DOM 109 getApplet(appletName) -- finds the applet path in the DOM
108 110
109 submitAction() -- calls the submit action of the applets 111 submitAction() -- calls the submit action of the applets
110
111 112
112 initializeAction() -- calls the initialize action of the applets 113 initializeWWquestion() -- calls the initialize action of the applets
113 114
114 getQE(name) -- gets an HTML element of the question by name 115 getQE(name) -- gets an HTML element of the question by name
115 or by id. Be sure to keep all names and ids 116 or by id. Be sure to keep all names and ids
116 unique within a given PG question. 117 unique within a given PG question.
117 118
118 getQuestionElement(name) -- long form of getQE(name) 119 getQuestionElement(name) -- long form of getQE(name)
119 120
120 listQuestionElements() -- for discovering the names of inputs in the 121 listQuestionElements() -- for discovering the names of inputs in the
121 PG question. An alert dialog will list all 122 PG question. An alert dialog will list all
122 of the elements. 123 of the elements.
123 Usage: Place this at the END of the question, 124 Usage: Place this at the END of the question, just before END_DOCUMENT():
124 just before END_DOCUMENT():
125 125
126 TEXT(qq!<script> listQuestionElements() </script>!); 126 TEXT(qq!<script> listQuestionElements() </script>!);
127 ENDDOCUMENT(); 127 ENDDOCUMENT();
128 to obtain a list of all of the HTML elements in the question
129
130 List of accessor methods made available by the FlashApplet class:
131 Usage: $current_value = $applet->method(new_value or empty)
132 These can also be set when creating the class -- for exampe:
133 $applet = new FlashApplet(
134 # can be replaced by $applet =FlashApplet() when using AppletObjects.pl
135 codebase => findAppletCodebase("$appletName.swf"),
136 appletName => $appletName,
137 appletId => $appletName,
138 submitActionAlias => 'checkAnswer',
139 );
128 140
129 list of accessor methods format: current_value = $self->method(new_value or empty)
130 141
131 appletId for simplicity and reliability appletId and appletName are always the same 142 appletId for simplicity and reliability appletId and appletName are always the same
132 appletName 143 appletName
133
134 archive the name of the .jar file containing the applet code 144 archive the name of the .jar file containing the applet code
135 code the name of the applet code in the .jar archive 145 code the name of the applet code in the .jar archive
136 codebase a prefix url used to find the archive and the applet itself 146 codebase a prefix url used to find the archive and the applet itself
137 147
138 height rectangle alloted in the html page for displaying the applet 148 height rectangle alloted in the html page for displaying the applet
139 width 149
140
141 params an anonymous array containing name/value pairs 150 params an anonymous array containing name/value pairs
142 to configure the applet [name =>'value, ...] 151 to configure the applet [name =>'value, ...]
143 152
144 header stores the text to be added to the header section of the html page 153 header stores the text to be added to the header section of the html page
145 object stores the text which places the applet on the html page 154 object stores the text which places the applet on the html page
146 155
147 debug in debug mode several alerts mark progress through the procedure of calling the applet 156 debug in debug mode several alerts mark progress through the procedure of calling the applet
148 157
149 config configuration are those customizable attributes of the applet which don't 158 config configuration are those customizable attributes of the applet which don't
150 change as it is used. When stored in hidden answer fields 159 change as it is used. When stored in hidden answer fields
151 it is usually stored in base64 encoded format. 160 it is usually stored in base64 encoded format.
152 base64_config base64 encode version of the contents of config 161 base64_config base64 encode version of the contents of config
153 162
154 configAlias (default: config ) names the applet command called with the contents of $self->config 163 configAlias (default: config ) names the applet command called with the contents of $self->config
155 to configure the applet. The parameters are passed to the applet in plain text using <xml> 164 to configure the applet. The parameters are passed to the applet in plain text using <xml>
156 The outer tags must be <xml> ..... </xml> 165 The outer tags must be <xml> ..... </xml>
157 state state consists of those customizable attributes of the applet which change 166 state state consists of those customizable attributes of the applet which change
158 as the applet is used. It is stored by the calling .pg question so that 167 as the applet is used. It is stored by the calling .pg question so that
159 when revisiting the question the applet 168 when revisiting the question the applet
160 will be restored to the same state it was left in when the question was last 169 will be restored to the same state it was left in when the question was last
161 viewed. 170 viewed.
162 171
163 getStateAlias (default: getState) alias for command called to read the current state of the applet. 172 getStateAlias (default: getState) alias for command called to read the current state of the applet.
164 The state is passed in plain text xml format with outer tags: <xml>....</xml> 173 The state is passed in plain text xml format with outer tags: <xml>....</xml>
165 setStateAlias (default: setState) alias for the command called to reset the state of the applet. 174 setStateAlias (default: setState) alias for the command called to reset the state of the applet.
166 The state is passed in plain text in xml format with outer tags: <xml>....</xml> 175 The state is passed in plain text in xml format with outer tags: <xml>....</xml>
167 176
168 base64_state returns the base64 encoded version of the state stored in the applet object. 177 base64_state returns the base64 encoded version of the state stored in the applet object.
169 178
170 initializeActionAlias -- (default: initializeAction) the name of the javaScript subroutine called to initialize the applet (some overlap with config/ and setState 179 initializeActionAlias -- (default: initializeAction) the name of the javaScript subroutine called to initialize the applet (some overlap with config/ and setState
171 submitActionAlias -- (default: submitAction)the name of the javaScript subroutine called when the submit button of the 180 submitActionAlias -- (default: submitAction)the name of the javaScript subroutine called when the submit button of the
172 .pg question is pressed. 181 .pg question is pressed.
182 answerBox -- name of answer box to return answer to: default defaultAnswerBox
183 getAnswer -- (formerly sendData) get student answer from applet and place in answerBox
184 returnFieldName -- (deprecated) synonmym for answerBox
173 185
174 returnFieldName
175
176
177
178
179 186
180=cut 187=cut
181 188
182 189
183 190
190 codebase=>'', 197 codebase=>'',
191# appletId =>'', #always use identical applet Id's and applet Names 198# appletId =>'', #always use identical applet Id's and applet Names
192 params =>undef, 199 params =>undef,
193 width => 550, 200 width => 550,
194 height => 400, 201 height => 400,
202 bgcolor => "#869ca7",
195 base64_state => undef, # this is an state to use for initializing the first occurence of the question. 203 base64_state => undef, # this is an state to use for initializing the first occurence of the question.
196 base64_config => undef, # this is the initial (and final?) configuration 204 base64_config => undef, # this is the initial (and final?) configuration
197 getStateAlias => 'getXML', 205 getStateAlias => 'getXML',
198 setStateAlias => 'setXML', 206 setStateAlias => 'setXML',
199 configAlias => 'config', 207 configAlias => 'config',
200 initializeActionAlias => 'setXML', 208 initializeActionAlias => 'setXML',
201 submitActionAlias => 'getXML', 209 submitActionAlias => 'getXML',
202 returnFieldName => 'receivedField', 210 submitActionScript => '', # script executed on submitting the WW question
211 answerBox => 'answerBox',
203 headerText => DEFAULT_HEADER_TEXT(), 212 headerText => DEFAULT_HEADER_TEXT(),
204 objectText => '', 213 objectText => '',
205 debug => 0, 214 debug => 0,
206 @_, 215 @_,
207 }; 216 };
250sub submitActionAlias { 259sub submitActionAlias {
251 my $self = shift; 260 my $self = shift;
252 $self->{submitActionAlias} = shift ||$self->{submitActionAlias}; # replace the current contents if non-empty 261 $self->{submitActionAlias} = shift ||$self->{submitActionAlias}; # replace the current contents if non-empty
253 $self->{submitActionAlias}; 262 $self->{submitActionAlias};
254} 263}
264sub submitActionScript {
265 my $self = shift;
266 $self->{submitActionScript} = shift ||$self->{submitActionScript}; # replace the current contents if non-empty
267 $self->{submitActionScript};
268}
255sub getStateAlias { 269sub getStateAlias {
256 my $self = shift; 270 my $self = shift;
257 $self->{getStateAlias} = shift ||$self->{getStateAlias}; # replace the current contents if non-empty 271 $self->{getStateAlias} = shift ||$self->{getStateAlias}; # replace the current contents if non-empty
258 $self->{getStateAlias}; 272 $self->{getStateAlias};
259} 273}
268 $self->{configAlias} = shift ||$self->{configAlias}; # replace the current contents if non-empty 282 $self->{configAlias} = shift ||$self->{configAlias}; # replace the current contents if non-empty
269 $self->{configAlias}; 283 $self->{configAlias};
270} 284}
271sub returnFieldName { 285sub returnFieldName {
272 my $self = shift; 286 my $self = shift;
273 $self->{returnFieldName} = shift ||$self->{returnFieldName}; # replace the current contents if non-empty 287 $self->{answerBox} = shift ||$self->{answerBox}; # replace the current contents if non-empty
274 $self->{returnFieldName}; 288 $self->{answerBox};
289}
290sub answerBox {
291 my $self = shift;
292 $self->{answerBox} = shift ||$self->{answerBox}; # replace the current contents if non-empty
293 $self->{answerBox};
275} 294}
276sub codebase { 295sub codebase {
277 my $self = shift; 296 my $self = shift;
278 $self->{codebase} = shift ||$self->{codebase}; # replace the current codebase if non-empty 297 $self->{codebase} = shift ||$self->{codebase}; # replace the current codebase if non-empty
279 $self->{codebase}; 298 $self->{codebase};
290} 309}
291sub width { 310sub width {
292 my $self = shift; 311 my $self = shift;
293 $self->{width} = shift ||$self->{width}; # replace the current width if non-empty 312 $self->{width} = shift ||$self->{width}; # replace the current width if non-empty
294 $self->{width}; 313 $self->{width};
314}
315sub bgcolor {
316 my $self = shift;
317 $self->{bgcolor} = shift ||$self->{bgcolor}; # replace the current background color if non-empty
318 $self->{bgcolor};
295} 319}
296sub archive { 320sub archive {
297 my $self = shift; 321 my $self = shift;
298 $self->{archive} = shift ||$self->{archive}; # replace the current archive if non-empty 322 $self->{archive} = shift ||$self->{archive}; # replace the current archive if non-empty
299 $self->{archive}; 323 $self->{archive};
341#FIXME 365#FIXME
342# need to be able to adjust header material 366# need to be able to adjust header material
343 367
344sub insertHeader { 368sub insertHeader {
345 my $self = shift; 369 my $self = shift;
346 my $codebase = $self->codebase; 370 my $codebase = $self->codebase;
347 my $appletId = $self->appletId; 371 my $appletId = $self->appletId;
348 my $appletName = $self->appletName; 372 my $appletName = $self->appletName;
349 my $base64_initialState = $self->base64_state; 373 my $base64_initialState = $self->base64_state;
350 my $initializeAction = $self->initializeActionAlias; 374 my $initializeAction = $self->initializeActionAlias;
351 my $submitAction = $self->submitActionAlias; 375 my $submitActionAlias = $self->submitActionAlias;
376 my $submitActionScript = $self->submitActionScript;
352 my $setState = $self->setStateAlias; 377 my $setStateAlias = $self->setStateAlias;
353 my $getState = $self->getStateAlias; 378 my $getStateAlias = $self->getStateAlias;
354 my $config = $self->configAlias; 379 my $configAlias = $self->configAlias;
355 my $base64_config = $self->base64_config; 380 my $base64_config = $self->base64_config;
356 my $debugMode = ($self->debug) ? "1": "0"; 381 my $debugMode = ($self->debug) ? "1": "0";
357 my $returnFieldName = $self->{returnFieldName}; 382 my $returnFieldName = $self->{returnFieldName};
358# my $encodeStateQ = ($self->debug)?'' : "state = Base64.encode(state);"; # in debug mode base64 encoding is not used. 383 my $answerBox = $self->{answerBox};
359# my $decodeStateQ = "if (!state.match(/<XML>*/i) ) {state = Base64.decode(state)}"; # decode if <XML> is not present
360 my $headerText = $self->header(); 384 my $headerText = $self->header();
385
386
387 $submitActionScript =~ s/"/\\"/g; # escape quotes for ActionScript
388 # other variables should not have quotes.
389
390 $submitActionScript =~ s/\n/ /g; # replace returns with spaces -- returns in the wrong spot can cause trouble with javaScript
391 $submitActionScript =~ s/\r/ /g; # replace returns with spaces -- returns can cause trouble
361 392
362 $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook 393 $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook
363 394
364 return $headerText; 395 return $headerText;
365 396
373 my $appletId = $self->{appletName}; 404 my $appletId = $self->{appletName};
374 my $appletName = $self->{appletName}; 405 my $appletName = $self->{appletName};
375 my $archive = $self->{archive}; 406 my $archive = $self->{archive};
376 my $width = $self->{width}; 407 my $width = $self->{width};
377 my $height = $self->{height}; 408 my $height = $self->{height};
409 my $applet_bgcolor = $self->{bgcolor};
378 my $javaParameters = ''; 410 my $javaParameters = '';
379 my $flashParameters = ''; 411 my $flashParameters = '';
380 my %param_hash = %{$self->params()}; 412 my %param_hash = %{$self->params()};
381 foreach my $key (keys %param_hash) { 413 foreach my $key (keys %param_hash) {
382 $javaParameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n!; 414 $javaParameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n!;
387 419
388 $objectText = $self->{objectText}; 420 $objectText = $self->{objectText};
389 $objectText =~ s/(\$\w+)/$1/gee; 421 $objectText =~ s/(\$\w+)/$1/gee;
390 return $objectText; 422 return $objectText;
391} 423}
392sub initialize { 424# sub initialize {
393 my $self = shift; 425# my $self = shift;
394 return q{ 426# return q{
395 <script> 427# <script>
396 initializeAction(); 428# initializeAllApplets();
397 // this should really be done in the <body> tag 429# // this should really be done in the <body> tag
398 </script> 430# </script>
399 }; 431# };
400 432#
401} 433# }
402######################################################## 434########################################################
403# HEADER material for one flash or java applet 435# HEADER material for one flash or java applet
404######################################################## 436########################################################
405 437
406use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT'; 438use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT';
407 439 <script src="/webwork2_files/js/Base64.js" language="javascript">
440 </script>
441 <script src="/webwork2_files/js/ww_applet_support.js" language="javascript">
442 //upload functions stored in /opt/webwork/webwork2/htdocs/js ...
443 </script>
408 <script language="JavaScript"> 444 <script language="JavaScript">
409 445
410 // set debug mode for this applet 446 // set debug mode for this applet
411 set_debug($debugMode); 447 set_debug($debugMode);
412 448
413 ////////////////////////////////////////////////////////// 449 //////////////////////////////////////////////////////////
414 //CONFIGURATIONS 450 //TEST code
415 // 451 //
416 // configurations are "permanent" 452 //
417 ////////////////////////////////////////////////////////// 453 //////////////////////////////////////////////////////////
454
455 ww_applet_list["$appletName"] = new ww_applet("$appletName");
418 456
419 applet_config_list["$appletName"] = function() {
420 debug_add("applet_config_list:\n attempt to configure $appletName . $config ( $base64_config ) if config function is defined: "
421 );
422 try {
423 if (( typeof(getApplet("$appletName").$config) == "function" ) ) {
424 debug_add("CONFIGURE $appletName");
425 getApplet("$appletName").$config(Base64.decode("$base64_config"));
426 }
427 } catch(e) {
428 alert("Error executing configuration command $config for $appletName: " + e );
429 }
430 }
431 ////////////////////////////////////////////////////////////
432 //
433 //STATE:
434 // state can vary as the applet is manipulated -- it is reset from the questions _state values
435 //
436 //////////////////////////////////////////////////////////
437 457
438 applet_setState_list["$appletName"] = function(state) { 458 ww_applet_list["$appletName"].code = "$code";
439 debug_add("Begin setState for applet $appletName"); 459 ww_applet_list["$appletName"].codebase = "$codebase";
440 debug_add("Obtain state from $appletName"+"_state"); 460 ww_applet_list["$appletName"].appletID = "$appletID";
441 state = state || getQE("$appletName"+"_state").value; 461 ww_applet_list["$appletName"].base64_state = "$base64_initializationState";
442 if ( base64Q(state) ) { 462 ww_applet_list["$appletName"].base64_config = "$base64_config";
443 state=Base64.decode(state); 463 ww_applet_list["$appletName"].getStateAlias = "$getStateAlias";
444 } 464 ww_applet_list["$appletName"].setStateAlias = "$setStateAlias";
445 if (state.match(/<xml/i) || state.match(/<?xml/i) ) { // if state starts with <?xml 465 ww_applet_list["$appletName"].configAlias = "$configAlias";
446 466 ww_applet_list["$appletName"].initializeActionAlias = "$initializeAction";
447 debug_add("applet_setState_list: \n set (decoded) state for $appletName to " + 467 ww_applet_list["$appletName"].submitActionAlias = "$submitActionAlias";
448 state +"\nfunction type is " +typeof(getApplet("$appletName").$setState) 468 ww_applet_list["$appletName"].submitActionScript = "$submitActionScript";
449 ); 469 ww_applet_list["$appletName"].answerBox = "$answerBox";
450 try { 470 ww_applet_list["$appletName"].debug = "$debugMode";
451 if (( typeof(getApplet("$appletName").$setState) =="function" ) ) {
452 debug_add("setState for $appletName");
453 getApplet("$appletName").$setState( state );
454 }
455 } catch(e) {
456 alert("Error in setting state of $appletName using command $setState : " + e );
457 }
458 } else if (debug) {
459 alert("new state was empty string or did not begin with <xml-- state was not reset");
460 }
461 };
462 applet_getState_list["$appletName"] = function () {
463 debug_add("get current state for applet $appletName and store it in $appletName"+"_state");
464 var applet = getApplet("$appletName");
465 try {
466 if (( typeof(applet.$getState) == "function" ) ) { // there may be no state function
467 state = applet.$getState(); // get state in xml format
468 }
469
470 if (!debug) {state = Base64.encode(state) }; // replace state by encoded version unless in debug mode
471 debug_add("state is "+state); // this should still be in plain text
472 getQE("$appletName"+"_state").value = state; //place state in input item (debug: textarea, otherwise: hidden)
473 } catch (e) {
474 alert("Error in getting state for $appletName " + e );
475 }
476 };
477
478 ////////////////////////////////////////////////////////////
479 //
480 //INITIALIZE
481 //
482 ////////////////////////////////////////////////////////////
483
484 471
485 applet_checkLoaded_list["$appletName"] = function() { // this function returns 0 unless:
486 // applet has already been flagged as ready in applet_isReady_list
487 // applet.config is defined (or alias for .config)
488 // applet.setState is defined
489 // applet.isActive is defined
490 // applet reported that it is loaded by calling loadQ()
491 var ready = 0;
492 var applet = getApplet("$appletName");
493 if (!debug && applet_isReady_list["$appletName"]) {return(1)}; // memorize readiness in non-debug mode
494 if ( typeof(applet.$config) == "function") {
495 debug_add( "applet.config is " + typeof(applet.$config) );
496 ready = 1;
497 }
498 if( typeof(applet.$getState) == "function") {
499 debug_add( "applet.getState is " + typeof(applet.$getState) );
500 ready =1;
501 }
502 if (typeof(applet.isActive) == "function" && applet.isActive ) {
503 debug_add( "applet.isActive is " + typeof(applet.isActive) );
504 ready =1;
505 }
506 if (typeof(applet_reportsLoaded_list["$appletName"]) !="undefined" && applet_reportsLoaded_list["$appletName"] != 0 ) {
507 debug_add( "applet reports that it is loaded " + applet_reportsLoaded_list["$appletName"] );
508 ready =1;
509 }
510 applet_isReady_list["$appletName"]= ready;
511 return(ready);
512 }
513
514 applet_initializeAction_list["$appletName"] = function (state) {
515 applet_setState_list["$appletName"](state);
516 };
517
518 applet_submitAction_list["$appletName"] = function () {
519 if (! applet_isReady_list["$appletName"] ) {
520 alert("$appletName is not ready");
521 }
522 applet_getState_list["$appletName"]();
523 //getQE("$returnFieldName").value = getApplet("$appletName").sendData(); //FIXME -- not needed in general?
524 };
525 </script> 472 </script>
526 473
527END_HEADER_SCRIPT 474END_HEADER_SCRIPT
528 475
529package FlashApplet; 476package FlashApplet;
530@ISA = qw(Applet); 477@ISA = qw(Applet);
531 478
532 479
480=head2 Insertion HTML code for FlashApplet
533 481
534=pod 482=pod
535 483
536The secret to making this applet work with IE in addition to normal browsers 484The secret to making this applet work with IE in addition to normal browsers
537is the addition of the C(<form></form>) construct just before the object. 485is the addition of the C(<form></form>) construct just before the object.
550 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 498 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
551 id="$appletName" width="500" height="375" 499 id="$appletName" width="500" height="375"
552 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> 500 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
553 <param name="movie" value="$codebase/$appletName.swf" /> 501 <param name="movie" value="$codebase/$appletName.swf" />
554 <param name="quality" value="high" /> 502 <param name="quality" value="high" />
555 <param name="bgcolor" value="#869ca7" /> 503 <param name="bgcolor" value="$applet_bgcolor" />
556 <param name="allowScriptAccess" value="sameDomain" /> 504 <param name="allowScriptAccess" value="sameDomain" />
557 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" 505 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="$applet_bgcolor"
558 width="$width" height="$height" name="$appletName" align="middle" id="$appletName" 506 width="$width" height="$height" name="$appletName" align="middle" id="$appletName"
559 play="true" loop="false" quality="high" allowScriptAccess="sameDomain" 507 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
560 type="application/x-shockwave-flash" 508 type="application/x-shockwave-flash"
561 pluginspage="http://www.macromedia.com/go/getflashplayer"> 509 pluginspage="http://www.macromedia.com/go/getflashplayer">
562 </embed> 510 </embed>
572 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 520 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
573 id="$appletName" width="500" height="375" 521 id="$appletName" width="500" height="375"
574 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> 522 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
575 <param name="movie" value="$codebase/$appletName.swf" /> 523 <param name="movie" value="$codebase/$appletName.swf" />
576 <param name="quality" value="high" /> 524 <param name="quality" value="high" />
577 <param name="bgcolor" value="#869ca7" /> 525 <param name="bgcolor" value="$applet_bgcolor" />
578 <param name="allowScriptAccess" value="sameDomain" /> 526 <param name="allowScriptAccess" value="sameDomain" />
579 <param name="FlashVars" value="$flashParameters"/> 527 <param name="FlashVars" value="$flashParameters"/>
580 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" 528 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="$applet_bgcolor"
581 width="$width" height="$height" name="$appletName" align="middle" id="$appletName" 529 width="$width" height="$height" name="$appletName" align="middle" id="$appletName"
582 play="true" loop="false" quality="high" allowScriptAccess="sameDomain" 530 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
583 type="application/x-shockwave-flash" 531 type="application/x-shockwave-flash"
584 pluginspage="http://www.macromedia.com/go/getflashplayer" 532 pluginspage="http://www.macromedia.com/go/getflashplayer"
585 FlashVars="$flashParameters"> 533 FlashVars="$flashParameters">
598 546
599 547
600package JavaApplet; 548package JavaApplet;
601@ISA = qw(Applet); 549@ISA = qw(Applet);
602 550
603 551=head2 Insertion HTML code for JavaApplet
604 552
605=pod 553=pod
606 554
607The secret to making this applet work with IE in addition to normal browsers 555The secret to making this applet work with IE in addition to normal browsers
608is the addition of the C(<form></form>) construct just before the object. 556is the addition of the C(<form></form>) construct just before the object.
642 archive = "$archive" 590 archive = "$archive"
643 name = "$appletName" 591 name = "$appletName"
644 id = "$appletName" 592 id = "$appletName"
645 width = "$width" 593 width = "$width"
646 height = "$height" 594 height = "$height"
595 bgcolor = "$applet_bgcolor"
647 MAYSCRIPT 596 MAYSCRIPT
648 > 597 >
649 $javaParameters 598 $javaParameters
650 599
651 Sorry, the Applet could not be started. Please make sure that 600 Sorry, the Applet could not be started. Please make sure that

Legend:
Removed from v.5667  
changed lines
  Added in v.6009

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9