[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 5994 Revision 6021
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.14 2009/01/28 17:07:08 gage Exp $ 4# $CVSHeader: pg/lib/Applet.pm,v 1.17 2009/02/19 16:35:26 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.
108 108
109 getApplet(appletName) -- finds the applet path in the DOM 109 getApplet(appletName) -- finds the applet path in the DOM
110 110
111 submitAction() -- calls the submit action of the applets 111 submitAction() -- calls the submit action of the applets
112 112
113 initializeWWquestion() -- calls the initialize action of the applets 113 initializeWWquestion() -- calls the initialize action of the applets
114 114
115 getQE(name) -- gets an HTML element of the question by name 115 getQE(name) -- gets an HTML element of the question by name
116 or by id. Be sure to keep all names and ids 116 or by id. Be sure to keep all names and ids
117 unique within a given PG question. 117 unique within a given PG question.
118 118
124 Usage: Place this at the END of the question, just before END_DOCUMENT(): 124 Usage: Place this at the END of the question, 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 128 to obtain a list of all of the HTML elements in the question
129 129
130 ----------------------------------------------------------------------------
131
132
130 List of accessor methods made available by the FlashApplet class: 133 List of accessor methods made available by the FlashApplet class:
131 Usage: $current_value = $applet->method(new_value or empty) 134 Usage: $current_value = $applet->method(new_value or empty)
132 These can also be set when creating the class -- for exampe: 135 These can also be set when creating the class -- for exampe:
133 $applet = new FlashApplet( 136 $applet = new FlashApplet(
134 # can be replaced by $applet =FlashApplet() when using AppletObjects.pl 137 # can be replaced by $applet =FlashApplet() when using AppletObjects.pl
158 config configuration are those customizable attributes of the applet which don't 161 config configuration are those customizable attributes of the applet which don't
159 change as it is used. When stored in hidden answer fields 162 change as it is used. When stored in hidden answer fields
160 it is usually stored in base64 encoded format. 163 it is usually stored in base64 encoded format.
161 base64_config base64 encode version of the contents of config 164 base64_config base64 encode version of the contents of config
162 165
163 configAlias (default: config ) names the applet command called with the contents of $self->config 166 configAlias (default: setConfig ) names the applet command called with the contents of $self->config
164 to configure the applet. The parameters are passed to the applet in plain text using <xml> 167 to configure the applet. The parameters are passed to the applet in plain text using <xml>
165 The outer tags must be <xml> ..... </xml> 168 The outer tags must be <xml> ..... </xml>
169 setConfigAlias (default: setConfig) -- a synonym for configAlias
170 getConfigAlias (default: getConfig) -- retrieves the configuration from the applet. This is used
171 mainly for debugging. In principal the configuration remains the same for a given instance
172 of the applet -- i.e. for the homework question for a single student. The state however
173 will change depending on the interactions between the student and the applet.
166 state state consists of those customizable attributes of the applet which change 174 initialState the state consists of those customizable attributes of the applet which change
167 as the applet is used. It is stored by the calling .pg question so that 175 as the applet is used by the student. It is stored by the calling .pg question so that
168 when revisiting the question the applet
169 will be restored to the same state it was left in when the question was last 176 when revisiting the question the applet will be restored to the same state it was left in when the question was last
170 viewed. 177 viewed.
171 178
172 getStateAlias (default: getState) alias for command called to read the current state of the applet. 179 getStateAlias (default: getState) alias for command called to read the current state of the applet.
173 The state is passed in plain text xml format with outer tags: <xml>....</xml> 180 The state is passed in plain text xml format with outer tags: <xml>....</xml>
174 setStateAlias (default: setState) alias for the command called to reset the state of the applet. 181 setStateAlias (default: setState) alias for the command called to reset the state of the applet.
184 returnFieldName -- (deprecated) synonmym for answerBox 191 returnFieldName -- (deprecated) synonmym for answerBox
185 192
186 193
187=cut 194=cut
188 195
196=head4 More details
189 197
198There are three different "images" of the applet. The first is the java or flash applet itself. The object that actually does the work.
199The second is a perl image of the applet -- henceforth the perlApplet -- which is configured in the .pg file and allows a WeBWorK question
200to communicate with the applet. The third image is a javaScript image of the applet -- henceforth the jsApplet which is a mirror of the perlApplet
201but is available to the javaScript code setup and executed in the virtual HTML page defined by the .pg file of the WeBWorK question. One can think of
202the jsApplet as a runtime version of the perlApplet since it can be accessed and modified after the virtual HTML page has been created by
203the PG rendering process.
190 204
205The perlApplet is initialized by $newApplet = new flashApplet( appletName=>'myApplet',..... ); The jsApplet is automatically defined in
206ww_applet_list["myApplet"] by copying the instance variables of $newApplet to a corresponding javaScript object. So $newApplet->{appletName}
207corresponds to ww_applet_list["myApplet"].appletName. (This paragraph is not yet fully implemented :-().
208
209Currently all messages read by the applet are xml text. If some of the code needs to be printed in the HTML header than it is converted
210to a base64 constant and then converted back to text form when it is read by an javaScript subroutine.
211
212=cut
213
214=head4 Requirements for applets
215
216The following methods are desirable in an applet that preserves state in a WW question. None of them are required.
217
218 setState(str) (default: setXML)
219 -- set the current state of the applet from an xml string
220 -- should be able to accept an empty string or a string of
221 the form <XML>.....</XML> without creating errors
222 -- can be designed to receive other forms of input if it is
223 coordinated with the WW question.
224 getState() (default: getXML)
225 -- return the current state of the applet in an xml string.
226 -- an empty string or a string of the form <XML>.....</XML>
227 are the standard responses.
228 -- can be designed to return other strings if it is
229 coordinated with the WW question.
230 setConfig(str) (default: setConfig)
231 -- If the applet allows configuration this configures the applet
232 from an xml string
233 -- should be able to accept an empty string or a string of the
234 form <XML>.....</XML> without creating errors
235 -- can be designed to receive other forms of input if it is
236 coordinated with the WW question.
237 getConfig (default: getConfig)
238 -- This returns a string defining the configuration of the
239 applet in an xml string
240 -- an empty string or a string of the form <XML>.....</XML>
241 are the standard responses.
242 -- can be designed to return other strings if it is
243 coordinated with the WW question.
244 -- this method is used for debugging to ensure that
245 the configuration was set as expected.
246 getAnswer (default: getAnswer)
247 -- Returns a string (usually NOT xml) which is the
248 response that the student is submitting to answer
249 the WW question.
250
251
252=cut
191 253
192sub new { 254sub new {
193 my $class = shift; 255 my $class = shift;
194 my $self = { 256 my $self = {
195 appletName =>'', 257 appletName =>'',
197 codebase=>'', 259 codebase=>'',
198# appletId =>'', #always use identical applet Id's and applet Names 260# appletId =>'', #always use identical applet Id's and applet Names
199 params =>undef, 261 params =>undef,
200 width => 550, 262 width => 550,
201 height => 400, 263 height => 400,
264 bgcolor => "#869ca7",
202 base64_state => undef, # this is an state to use for initializing the first occurence of the question. 265 base64_state => undef, # this is a state to use for initializing the first occurence of the question.
203 base64_config => undef, # this is the initial (and final?) configuration 266 base64_config => undef, # this is the initial (and final?) configuration
267# configuration => '', # configuration defining the applet
268 initialState => '', # initial state. (I'm considering storing everything as ascii and converting on the fly to base64 when needed.)
204 getStateAlias => 'getXML', 269 getStateAlias => 'getXML',
205 setStateAlias => 'setXML', 270 setStateAlias => 'setXML',
206 configAlias => 'config', 271 configAlias => '',
272 getConfigAlias => 'getConfig',
273 setConfigAlias => 'setConfig',
207 initializeActionAlias => 'setXML', 274 initializeActionAlias => 'setXML',
208 submitActionAlias => 'getXML', 275 submitActionAlias => 'getXML',
209 submitActionScript => '', # script executed on submitting the WW question 276 submitActionScript => '', # script executed on submitting the WW question
210 answerBox => 'answerBox', 277 answerBox => 'answerBox',
211 headerText => DEFAULT_HEADER_TEXT(), 278 headerText => DEFAULT_HEADER_TEXT(),
212 objectText => '', 279 objectText => '',
213 debug => 0, 280 debug => 0,
214 @_, 281 @_,
215 }; 282 };
216 bless $self, $class; 283 bless $self, $class;
217 $self->state('<xml></xml>'); 284 $self->initialState('<xml></xml>');
285 if ($self->{configAlias}) { # backward compatibility
286 warn "use setConfigAlias instead of configAlias";
287 $self->{configAlias}='';
288 }
218 $self->config('<xml></xml>'); 289 $self->config('<xml></xml>');
219 return $self; 290 return $self;
220} 291}
221 292
222sub header { 293sub header {
276 $self->{setStateAlias} = shift ||$self->{setStateAlias}; # replace the current contents if non-empty 347 $self->{setStateAlias} = shift ||$self->{setStateAlias}; # replace the current contents if non-empty
277 $self->{setStateAlias}; 348 $self->{setStateAlias};
278} 349}
279sub configAlias { 350sub configAlias {
280 my $self = shift; 351 my $self = shift;
281 $self->{configAlias} = shift ||$self->{configAlias}; # replace the current contents if non-empty 352 $self->{setConfigAlias} = shift ||$self->{setConfigAlias}; # replace the current contents if non-empty
282 $self->{configAlias}; 353 $self->{setConfigAlias};
283} 354}
284sub returnFieldName { 355sub setConfigAlias {
356 my $self = shift;
357 $self->{setConfigAlias} = shift ||$self->{setConfigAlias}; # replace the current contents if non-empty
358 $self->{setConfigAlias};
359}
360sub getConfigAlias {
361 my $self = shift;
362 $self->{getConfigAlias} = shift ||$self->{getConfigAlias}; # replace the current contents if non-empty
363 $self->{getConfigAlias};
364}
365
366sub answerBoxName {
285 my $self = shift; 367 my $self = shift;
286 $self->{answerBox} = shift ||$self->{answerBox}; # replace the current contents if non-empty 368 $self->{answerBox} = shift ||$self->{answerBox}; # replace the current contents if non-empty
287 $self->{answerBox}; 369 $self->{answerBox};
288} 370}
289sub answerBox {
290 my $self = shift;
291 $self->{answerBox} = shift ||$self->{answerBox}; # replace the current contents if non-empty
292 $self->{answerBox};
293}
294sub codebase { 371sub codebase {
295 my $self = shift; 372 my $self = shift;
296 $self->{codebase} = shift ||$self->{codebase}; # replace the current codebase if non-empty 373 $self->{codebase} = shift ||$self->{codebase}; # replace the current codebase if non-empty
297 $self->{codebase}; 374 $self->{codebase};
298} 375}
308} 385}
309sub width { 386sub width {
310 my $self = shift; 387 my $self = shift;
311 $self->{width} = shift ||$self->{width}; # replace the current width if non-empty 388 $self->{width} = shift ||$self->{width}; # replace the current width if non-empty
312 $self->{width}; 389 $self->{width};
390}
391sub bgcolor {
392 my $self = shift;
393 $self->{bgcolor} = shift ||$self->{bgcolor}; # replace the current background color if non-empty
394 $self->{bgcolor};
313} 395}
314sub archive { 396sub archive {
315 my $self = shift; 397 my $self = shift;
316 $self->{archive} = shift ||$self->{archive}; # replace the current archive if non-empty 398 $self->{archive} = shift ||$self->{archive}; # replace the current archive if non-empty
317 $self->{archive}; 399 $self->{archive};
328 $self->{debug}; 410 $self->{debug};
329} 411}
330sub appletId { 412sub appletId {
331 appletName(@_); 413 appletName(@_);
332} 414}
415
416sub initialState {
417 my $self = shift;
418 my $str = shift;
419 $self->{initialState} = $str ||$self->{initialState}; # replace the current string if non-empty
420 $self->{initialState};
421}
422
423sub config {
424 my $self = shift;
425 my $str = shift;
426 $self->{base64_config} = encode_base64($str) || $self->{base64_config}; # replace the current string if non-empty
427 $self->{base64_config} =~ s/\n//g;
428 decode_base64($self->{base64_config});
429}
430#######################
431# soon to be deprecated?
432#######################
333sub state { 433sub state {
334 my $self = shift; 434 my $self = shift;
335 my $str = shift; 435 my $str = shift;
336 $self->{base64_state} = encode_base64($str) ||$self->{base64_state}; # replace the current string if non-empty 436 $self->{base64_state} = encode_base64($str) ||$self->{base64_state}; # replace the current string if non-empty
337 $self->{base64_state} =~ s/\n//g; 437 $self->{base64_state} =~ s/\n//g;
338 decode_base64($self->{base64_state}); 438 decode_base64($self->{base64_state});
339} 439}
340
341sub base64_state{ 440sub base64_state{
342 my $self = shift; 441 my $self = shift;
343 $self->{base64_state} = shift ||$self->{base64_state}; # replace the current string if non-empty 442 $self->{base64_state} = shift ||$self->{base64_state}; # replace the current string if non-empty
344 $self->{base64_state}; 443 $self->{base64_state};
345} 444}
346sub config { 445
347 my $self = shift;
348 my $str = shift;
349 $self->{base64_config} = encode_base64($str) || $self->{base64_config}; # replace the current string if non-empty
350 $self->{base64_config} =~ s/\n//g;
351 decode_base64($self->{base64_config});
352}
353sub base64_config { 446sub base64_config {
354 my $self = shift; 447 my $self = shift;
355 $self->{base64_config} = shift ||$self->{base64_config}; # replace the current string if non-empty 448 $self->{base64_config} = shift ||$self->{base64_config}; # replace the current string if non-empty
356 $self->{base64_config} =$self->{base64_config}; 449 $self->{base64_config} =$self->{base64_config};
357 $self->{base64_config}; 450 $self->{base64_config};
358} 451}
452
453sub returnFieldName {
454 my $self = shift;
455 warn "use answerBoxName instead of returnFieldName";
456}
457sub answerBox {
458 my $self = shift;
459 warn "use answerBoxName instead of AnswerBox";
460}
461#########################
359#FIXME 462#FIXME
360# need to be able to adjust header material 463# need to be able to adjust header material
361 464
362sub insertHeader { 465sub insertHeader {
363 my $self = shift; 466 my $self = shift;
467
364 my $codebase = $self->codebase; 468 my $codebase = $self->codebase;
365 my $appletId = $self->appletId; 469 my $appletId = $self->appletId;
366 my $appletName = $self->appletName; 470 my $appletName = $self->appletName;
367 my $base64_initialState = $self->base64_state; 471 my $base64_initialState = $self->base64_state;
368 my $initializeAction = $self->initializeActionAlias; 472 my $initializeAction = $self->initializeActionAlias;
369 my $submitAction = $self->submitActionAlias; 473 my $submitActionAlias = $self->submitActionAlias;
370 my $submitActionScript = $self->submitActionScript; 474 my $submitActionScript = $self->submitActionScript;
371 my $setState = $self->setStateAlias; 475 my $setStateAlias = $self->setStateAlias;
372 my $getState = $self->getStateAlias; 476 my $getStateAlias = $self->getStateAlias;
477
373 my $config = $self->configAlias; 478 my $setConfigAlias = $self->setConfigAlias;
479 my $getConfigAlias = $self->getConfigAlias;
374 my $base64_config = $self->base64_config; 480 my $base64_config = $self->base64_config;
375 my $debugMode = ($self->debug) ? "1": "0"; 481 my $debugMode = ($self->debug) ? "1": "0";
376 my $returnFieldName = $self->{returnFieldName}; 482 my $returnFieldName = $self->{returnFieldName};
377 my $answerBox = $self->{answerBox}; 483 my $answerBox = $self->{answerBox};
378 my $headerText = $self->header(); 484 my $headerText = $self->header();
485
486
487 $submitActionScript =~ s/"/\\"/g; # escape quotes for ActionScript
488 # other variables should not have quotes.
489
490 $submitActionScript =~ s/\n/ /g; # replace returns with spaces -- returns in the wrong spot can cause trouble with javaScript
491 $submitActionScript =~ s/\r/ /g; # replace returns with spaces -- returns can cause trouble
379 492
380 $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook 493 $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook
381 494
382 return $headerText; 495 return $headerText;
383 496
391 my $appletId = $self->{appletName}; 504 my $appletId = $self->{appletName};
392 my $appletName = $self->{appletName}; 505 my $appletName = $self->{appletName};
393 my $archive = $self->{archive}; 506 my $archive = $self->{archive};
394 my $width = $self->{width}; 507 my $width = $self->{width};
395 my $height = $self->{height}; 508 my $height = $self->{height};
509 my $applet_bgcolor = $self->{bgcolor};
396 my $javaParameters = ''; 510 my $javaParameters = '';
397 my $flashParameters = ''; 511 my $flashParameters = '';
398 my %param_hash = %{$self->params()}; 512 my %param_hash = %{$self->params()};
399 foreach my $key (keys %param_hash) { 513 foreach my $key (keys %param_hash) {
400 $javaParameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n!; 514 $javaParameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n!;
422######################################################## 536########################################################
423 537
424use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT'; 538use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT';
425 <script src="/webwork2_files/js/Base64.js" language="javascript"> 539 <script src="/webwork2_files/js/Base64.js" language="javascript">
426 </script> 540 </script>
427 <script src="/webwork2_files/js/ww_applet_support.js"> 541 <script src="/webwork2_files/js/ww_applet_support.js" language="javascript">
428 //upload functions stored in /opt/webwork/webwork2/htdocs/js ... 542 //upload functions stored in /opt/webwork/webwork2/htdocs/js ...
543
429 </script> 544 </script>
430 <script language="JavaScript"> 545 <script language="JavaScript">
431 546
432 // set debug mode for this applet 547 // set debug mode for this applet
433 set_debug($debugMode); 548 set_debug($debugMode);
444 ww_applet_list["$appletName"].code = "$code"; 559 ww_applet_list["$appletName"].code = "$code";
445 ww_applet_list["$appletName"].codebase = "$codebase"; 560 ww_applet_list["$appletName"].codebase = "$codebase";
446 ww_applet_list["$appletName"].appletID = "$appletID"; 561 ww_applet_list["$appletName"].appletID = "$appletID";
447 ww_applet_list["$appletName"].base64_state = "$base64_initializationState"; 562 ww_applet_list["$appletName"].base64_state = "$base64_initializationState";
448 ww_applet_list["$appletName"].base64_config = "$base64_config"; 563 ww_applet_list["$appletName"].base64_config = "$base64_config";
449 ww_applet_list["$appletName"].getStateAlias = "$getState"; 564 ww_applet_list["$appletName"].getStateAlias = "$getStateAlias";
450 ww_applet_list["$appletName"].setStateAlias = "$setState"; 565 ww_applet_list["$appletName"].setStateAlias = "$setStateAlias";
451 ww_applet_list["$appletName"].configAlias = "$config"; 566 ww_applet_list["$appletName"].setConfigAlias = "$setConfigAlias";
567 ww_applet_list["$appletName"].getConfigAlias = "$getConfigAlias";
452 ww_applet_list["$appletName"].initializeActionAlias = "$initializeAction"; 568 ww_applet_list["$appletName"].initializeActionAlias = "$initializeAction";
453 ww_applet_list["$appletName"].submitActionAlias = "$submitAction"; 569 ww_applet_list["$appletName"].submitActionAlias = "$submitActionAlias";
454 ww_applet_list["$appletName"].submitActionScript = "$submitActionScript"; 570 ww_applet_list["$appletName"].submitActionScript = "$submitActionScript";
455 ww_applet_list["$appletName"].answerBox = "$answerBox"; 571 ww_applet_list["$appletName"].answerBox = "$answerBox";
456 ww_applet_list["$appletName"].debug = "$debugMode"; 572 ww_applet_list["$appletName"].debug = "$debugMode";
457 573
458
459 //////////////////////////////////////////////////////////
460 //CONFIGURATIONS
461 //
462 // configurations are "permanent"
463 //////////////////////////////////////////////////////////
464
465// applet_config_list["$appletName"] = function() {
466// debug_add("applet_config_list:\n attempt to configure $appletName . $config ( $base64_config ) if config function is defined: "
467// );
468// try {
469// if (( typeof(getApplet("$appletName").$config) == "function" ) ) {
470// debug_add("CONFIGURE $appletName");
471// getApplet("$appletName").$config(Base64.decode("$base64_config"));
472// }
473// } catch(e) {
474// alert("Error executing configuration command $config for $appletName: " + e );
475// }
476// }
477// ////////////////////////////////////////////////////////////
478// //
479// //STATE:
480// // state can vary as the applet is manipulated -- it is reset from the questions _state values
481// //
482// //////////////////////////////////////////////////////////
483//
484// applet_setState_list["$appletName"] = function(state) {
485// debug_add("Begin setState for applet $appletName");
486// debug_add("Obtain state from $appletName"+"_state");
487// state = state || getQE("$appletName"+"_state").value;
488// if ( base64Q(state) ) {
489// state=Base64.decode(state);
490// }
491// if (state.match(/<xml/i) || state.match(/<?xml/i) ) { // if state starts with <?xml
492//
493// debug_add("applet_setState_list: \n set (decoded) state for $appletName to " +
494// state +"\nfunction type is " +typeof(getApplet("$appletName").$setState)
495// );
496// try {
497// if (( typeof(getApplet("$appletName").$setState) =="function" ) ) {
498// debug_add("setState for $appletName");
499// getApplet("$appletName").$setState( state );
500// }
501// } catch(e) {
502// alert("Error in setting state of $appletName using command $setState : " + e );
503// }
504// } else if (debug) {
505// alert("new state was empty string or did not begin with <xml-- state was not reset");
506// }
507// };
508// applet_getState_list["$appletName"] = function () {
509// debug_add("get current state for applet $appletName and store it in $appletName"+"_state");
510// var applet = getApplet("$appletName");
511// try {
512// if (( typeof(applet.$getState) == "function" ) ) { // there may be no state function
513// state = applet.$getState(); // get state in xml format
514// debug_add("state has type " + typeof(state));
515// state = String(state); // geogebra returned an object type instead of a string type
516// debug_add("state converted to type " + typeof(state));
517// }
518//
519// if (!debug) {
520// state = Base64.encode(state);
521// }; // replace state by encoded version unless in debug mode
522//
523// debug_add("state is "+state); // this should still be in plain text
524// getQE("$appletName"+"_state").value = state; //place state in input item (debug: textarea, otherwise: hidden)
525// } catch (e) {
526// alert("Error in getting state for $appletName " + e );
527// }
528// };
529//
530// ////////////////////////////////////////////////////////////
531// //
532// //INITIALIZE
533// //
534// ////////////////////////////////////////////////////////////
535//
536//
537// applet_checkLoaded_list["$appletName"] = function() { // this function returns 0 unless:
538// // applet has already been flagged as ready in applet_isReady_list
539// // applet.config is defined (or alias for .config)
540// // applet.setState is defined
541// // applet.isActive is defined
542// // applet reported that it is loaded by calling loadQ()
543// var ready = 0;
544// var applet = getApplet("$appletName");
545// if (!debug && applet_isReady_list["$appletName"]) {return(1)}; // memorize readiness in non-debug mode
546// if ( typeof(applet.$config) == "function") {
547// debug_add( "applet.config is " + typeof(applet.$config) );
548// ready = 1;
549// }
550// if( typeof(applet.$getState) == "function") {
551// debug_add( "applet.getState is " + typeof(applet.$getState) );
552// ready =1;
553// }
554// if (typeof(applet.isActive) == "function" && applet.isActive ) {
555// debug_add( "applet.isActive is " + typeof(applet.isActive) );
556// ready =1;
557// }
558// if (typeof(applet_reportsLoaded_list["$appletName"]) !="undefined" && applet_reportsLoaded_list["$appletName"] != 0 ) {
559// debug_add( "applet reports that it is loaded " + applet_reportsLoaded_list["$appletName"] );
560// ready =1;
561// }
562// applet_isReady_list["$appletName"]= ready;
563// return(ready);
564// }
565//
566// applet_initializeAction_list["$appletName"] = function (state) {
567// applet_setState_list["$appletName"](state);
568// };
569//
570// applet_submitAction_list["$appletName"] = function () {
571// if (! applet_isReady_list["$appletName"] ) {
572// alert("$appletName is not ready");
573// }
574// applet_getState_list["$appletName"]();
575// $submitActionScript
576// //getQE("$answerBox").value = getApplet("$appletName").getAnswer(); //FIXME -- not needed in general?
577// };
578 </script> 574 </script>
579 575
580END_HEADER_SCRIPT 576END_HEADER_SCRIPT
581 577
582package FlashApplet; 578package FlashApplet;
604 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 600 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
605 id="$appletName" width="500" height="375" 601 id="$appletName" width="500" height="375"
606 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> 602 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
607 <param name="movie" value="$codebase/$appletName.swf" /> 603 <param name="movie" value="$codebase/$appletName.swf" />
608 <param name="quality" value="high" /> 604 <param name="quality" value="high" />
609 <param name="bgcolor" value="#869ca7" /> 605 <param name="bgcolor" value="$applet_bgcolor" />
610 <param name="allowScriptAccess" value="sameDomain" /> 606 <param name="allowScriptAccess" value="sameDomain" />
611 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" 607 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="$applet_bgcolor"
612 width="$width" height="$height" name="$appletName" align="middle" id="$appletName" 608 width="$width" height="$height" name="$appletName" align="middle" id="$appletName"
613 play="true" loop="false" quality="high" allowScriptAccess="sameDomain" 609 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
614 type="application/x-shockwave-flash" 610 type="application/x-shockwave-flash"
615 pluginspage="http://www.macromedia.com/go/getflashplayer"> 611 pluginspage="http://www.macromedia.com/go/getflashplayer">
616 </embed> 612 </embed>
626 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 622 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
627 id="$appletName" width="500" height="375" 623 id="$appletName" width="500" height="375"
628 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> 624 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
629 <param name="movie" value="$codebase/$appletName.swf" /> 625 <param name="movie" value="$codebase/$appletName.swf" />
630 <param name="quality" value="high" /> 626 <param name="quality" value="high" />
631 <param name="bgcolor" value="#869ca7" /> 627 <param name="bgcolor" value="$applet_bgcolor" />
632 <param name="allowScriptAccess" value="sameDomain" /> 628 <param name="allowScriptAccess" value="sameDomain" />
633 <param name="FlashVars" value="$flashParameters"/> 629 <param name="FlashVars" value="$flashParameters"/>
634 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" 630 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="$applet_bgcolor"
635 width="$width" height="$height" name="$appletName" align="middle" id="$appletName" 631 width="$width" height="$height" name="$appletName" align="middle" id="$appletName"
636 play="true" loop="false" quality="high" allowScriptAccess="sameDomain" 632 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
637 type="application/x-shockwave-flash" 633 type="application/x-shockwave-flash"
638 pluginspage="http://www.macromedia.com/go/getflashplayer" 634 pluginspage="http://www.macromedia.com/go/getflashplayer"
639 FlashVars="$flashParameters"> 635 FlashVars="$flashParameters">
696 archive = "$archive" 692 archive = "$archive"
697 name = "$appletName" 693 name = "$appletName"
698 id = "$appletName" 694 id = "$appletName"
699 width = "$width" 695 width = "$width"
700 height = "$height" 696 height = "$height"
697 bgcolor = "$applet_bgcolor"
701 MAYSCRIPT 698 MAYSCRIPT
702 > 699 >
703 $javaParameters 700 $javaParameters
704 701
705 Sorry, the Applet could not be started. Please make sure that 702 Sorry, the Applet could not be started. Please make sure that

Legend:
Removed from v.5994  
changed lines
  Added in v.6021

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9