[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 6023 Revision 6030
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.18 2009/03/10 12:10:36 gage Exp $ 4# $CVSHeader: pg/lib/Applet.pm,v 1.21 2009/03/15 19:25:03 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.
21=head1 SYNPOSIS 21=head1 SYNPOSIS
22 22
23 ################################### 23 ###################################
24 # Create link to applet 24 # Create link to applet
25 ################################### 25 ###################################
26 my $appletName = "LineThruPointsWW"; 26 $appletName = "PointGraph";
27 $applet = new FlashApplet( 27$applet = FlashApplet(
28 # can be replaced by $applet =FlashApplet() when using AppletObjects.pl
29 codebase => findAppletCodebase("$appletName.swf"), 28 codebase => findAppletCodebase("$appletName.swf"),
30 appletName => $appletName, 29 appletName => $appletName,
31 appletId => $appletName, 30 appletId => $appletName,
32 submitActionAlias => 'checkAnswer', 31 setStateAlias => 'setXML',
33 ); 32 getStateAlias => 'getXML',
34 33 setConfigAlias => 'config',
34 answerBoxAlias => 'answerBox',
35 submitActionScript => qq{ getQE('answerBox').value = getApplet("$appletName").getAnswer() },
36);
37
35 ################################### 38###################################
36 # Configure applet 39# Configure applet
37 ################################### 40###################################
38 41
39 #xml data to set up the problem-rac 42#data to set up the equation
40 $applet->config(qq{<XML> 43$applet->config(qq{<XML expr='(x - $a)^3 + $b/$a * x' />});
41 <point xval='$xval_1' yval='$yval_1' /> 44# initial points
42 <point xval='$xval_2' yval='$yval_2' /> 45$applet->state(qq{<XML>
43 </XML>}); 46</XML>});
44
45
46 ################################### 47###################################
47 # insert applet header material 48#insert applet into body
48 ################################### 49###################################
49 HEADER_TEXT($applet->insertHeader ); 50
50
51 ###################################
52 # Text section
53 #
54
55 ###################################
56 #insert applet into body
57 ###################################
58 TEXT( MODES(TeX=>'object code', HTML=>$applet->insertObject)); 51TEXT( MODES(TeX=>'object code', HTML=>$applet->insertAll(
52 includeAnswerBox => 1
53 debug=>0,
54 reinitialize_button=>1,
55 )));
59 56
60 57
61=head1 DESCRIPTION 58=head1 DESCRIPTION
62 59
63This file provides an object to store in one place 60This file provides an object to store in one place
154 to configure the applet [name =>'value, ...] 151 to configure the applet [name =>'value, ...]
155 152
156 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
157 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
158 155
159 debug in debug mode several alerts mark progress through the procedure of calling the applet 156 debugMode in debug mode several alerts mark progress through the procedure of calling the applet
160 157
161 config configuration are those customizable attributes of the applet which don't 158 configuration configuration contains those customizable attributes of the applet which don't
162 change as it is used. When stored in hidden answer fields 159 change as it is used. When stored in hidden answer fields
163 it is usually stored in base64 encoded format. 160 it is usually stored in base64 encoded format.
164 base64_config base64 encode version of the contents of config 161
165
166 configAlias (default: setConfig ) names the applet command called with the contents of $self->config 162 configAlias (default: setConfig ) names the applet command called with the contents of $self->config
167 to configure the applet. The parameters are passed to the applet in plain text using <xml> 163 to configure the applet. The parameters are passed to the applet in plain text using <xml>
168 The outer tags must be <xml> ..... </xml> 164 The outer tags must be <xml> ..... </xml>
169 setConfigAlias (default: setConfig) -- a synonym for configAlias 165 setConfigAlias (default: setConfig) -- a synonym for configAlias
170 getConfigAlias (default: getConfig) -- retrieves the configuration from the applet. This is used 166 getConfigAlias (default: getConfig) -- retrieves the configuration from the applet. This is used
179 getStateAlias (default: getState) alias for command called to read the current state of the applet. 175 getStateAlias (default: getState) alias for command called to read the current state of the applet.
180 The state is passed in plain text xml format with outer tags: <xml>....</xml> 176 The state is passed in plain text xml format with outer tags: <xml>....</xml>
181 setStateAlias (default: setState) alias for the command called to reset the state of the applet. 177 setStateAlias (default: setState) alias for the command called to reset the state of the applet.
182 The state is passed in plain text in xml format with outer tags: <xml>....</xml> 178 The state is passed in plain text in xml format with outer tags: <xml>....</xml>
183 179
184 base64_state returns the base64 encoded version of the state stored in the applet object.
185
186 initializeActionAlias -- (default: initializeAction) the name of the javaScript subroutine called to initialize the applet (some overlap with config/ and setState 180 initializeActionAlias -- (default: initializeAction) the name of the javaScript subroutine called to initialize the applet (some overlap with config/ and setState
187 submitActionAlias -- (default: submitAction)the name of the javaScript subroutine called when the submit button of the 181 submitActionAlias -- (default: submitAction)the name of the javaScript subroutine called when the submit button of the
188 .pg question is pressed. 182 .pg question is pressed.
189 answerBox -- name of answer box to return answer to: default defaultAnswerBox 183 answerBoxAlias -- name of answer box to return answer to: default defaultAnswerBox
190 getAnswer -- (formerly sendData) get student answer from applet and place in answerBox 184 getAnswer -- (formerly sendData) get student answer from applet and place in answerBox
191 returnFieldName -- (deprecated) synonmym for answerBox 185 returnFieldName -- (deprecated) synonmym for answerBoxAlias
192 186
193 187
194=cut 188=cut
195 189
196=head4 More details 190=head4 More details
205The perlApplet is initialized by $newApplet = new flashApplet( appletName=>'myApplet',..... ); The jsApplet is automatically defined in 199The 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} 200ww_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 :-(). 201corresponds to ww_applet_list["myApplet"].appletName. (This paragraph is not yet fully implemented :-().
208 202
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 203Currently 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. 204to a base64 constant and then converted back to text form when it is read by a javaScript subroutine.
205
206The perlApplet has methods that help place the jsApplet code on the HTML page and create the link to the applet itself.
207In particular instance variables such as "setStateAlias", "getStateAlias" connect the WW default of "setState" to subroutine
208name chosen by the applet designer. The aim is to make it easier to connect to applets previously designed to work
209with javaScript in an HTML page or other systems.
210
211
212The jsApplet acts as an intermediary for commands directed at the applet.
213It is not necessary for the minimal operations of
214configuring the applet and maintaining
215state from one viewing of the WW question to address the applet directly.
216The methods such as "setState", "getState", "setConfig" which are part of the jsApplet
217take care of the book keeping details.
218It is also possible to make direct calls to the applet from handcrafted javaScript subroutines,
219but it may be convenient to store these as additional methods in the
220jsApplet.
211 221
212=cut 222=cut
223
224=head4 Detecting that the applet is ready
225
226Timing issues are among the pitfalls awaiting when using flash or java applets in WW questions. It is important that the WW question
227does not issue any commands to the applet until the applet is fully loaded, including the uploading of any additional configuration
228information from XML files. This can be tricky since the timing issues usually don't arise when initiating the applet from an HTML page.
229
230The WW API performs the following actions to determine if the applet is loaded:
231
232 check the ww_applet_list[appletName].isReady flag (1== applet is ready)
233 -- this caches the readiness information so that it doesn't
234 have to be repeated within a given viewing of a WW question
235 If this is 1 then the applet is ready.
236 determine whether the applet's isActive subroutine is defined AND returns 1 when called.
237 -- if the return value is 1 the applet is ready, if it is zero or no response then the applet is NOT ready
238 -- If the applet has an isActive() subroutine -- there is no alias for this --
239 then it must return 1 as soon as the applet is ready. Otherwise
240 the applet will timeout.
241 determine whether the applet's setConfig subroutine is defined.
242 -- applet.{setConfigAlias}.
243 determine whether the applet's setState subroutine is defined.
244 determine whether the jsApplets ww_applet_list[appletName].reportsLoaded flag is set to 1
245 -- this can be set by the applet if it calls the javaScript function
246 "applet_loaded(appletName, loaded_status). The loaded_status is 1 or 0
247
248 Logic for determining applet status: if any one of the above checks succeeds (or returns 1) then the applet is
249 consdered to be ready UNLESS the isActive() exists and the call returns a 0 or no response. In this case
250 the applet is assumed to be loading additional data and is not yet ready.
251
252 For this reason if the isActive subroutine
253 is defined in the applet it must return a 1 once the applet is prepared to accept additional commands.
254 (Since there are some extent flashApplets with non-functioning isActive() subroutines a temporary workaround
255 assuems that after C<maxInitializationAttempts> -- 5 by default -- the applet is in fact ready but the
256 isActive() subroutine is non functioning. This can give rise to false "readiness" signals if the applet
257 takes a long time to load auxiliary files.)
258
259The applet itself can take measures to insure that the setConfig subroutine is prepared to respond immediately once the applet is loaded.
260It can include timers that delay execution of the configuring actions until all of the auxiliary files needed by the applet are loaded.
261
262
263=cut
264
265
266=head4 Initialization sequence
267
268When the WW question is loaded the C<initializeWWquestion> javaScript subroutine calls each of the applets used in the question asking them
269to initialize themselves.
270
271The applets initialization method is as follows:
272
273 -- wait until the applet is loaded and the applet has loaded all of its auxiliary files.
274 -- set the debugMode in the applet
275 -- call the setConfig method in the javaScript applet -- (configuration parameters are "permanent" for the life of the applet
276 -- call the setInitialization method in the javaScript applet -- this often calls the setState method in the applet
277
278=cut
279
280=head Methods defined for the javaScript applet ww_applet_list[appletName]
281
282This is not a comprehensive list
283
284 setConfig -- transmits the information for configuring the applet
285
286 getConfig -- retrieves the configuration information -- this is used mainly for debugging and may not be defined in most applets
287
288
289 setState -- sets the current state (1) from the appletName_state HTML element if this contains an <xml>...</xml> string
290 -- if the value contains <xml>restart_applet</xml> then set the current state to ww_applet_list[appletName].initialState
291 -- if the value is a blank string set the current state to ww_applet_list[appletName].initialState
292
293
294 getState -- retrieves the current state and stores in the appletName_state HTML element.
295
296
297
298
299
300
301
302=head Submit sequence
303
304When the WW question submit button is pressed the form containing the WW question calles the javaScript "submitAction()" which then asks
305each of the applets on the page to perform its submit action which consists of
306
307 -- if the applet is to be reinitialized (appletName_state contains <xml>restart_applet</xml>) then
308 the HTML elements appletName_state and previous_appletName_state are set to <xml>restart_applet</xml>
309 to be interpreted by the next setState command
310 -- Otherwise getState() from the applet and save it to the HTML input element appletName_state
311 -- Perform the javaScript commands in .submitActionScript (default: '' )
312 a typical submitActionScript looks like getQE(this.answerBox).value = getApplet(appletName).getAnswer() )
213 313
214=head4 Requirements for applets 314=head4 Requirements for applets
215 315
216The following methods are desirable in an applet that preserves state in a WW question. None of them are required. 316The following methods are desirable in an applet that preserves state in a WW question. None of them are required.
217 317
243 coordinated with the WW question. 343 coordinated with the WW question.
244 -- this method is used for debugging to ensure that 344 -- this method is used for debugging to ensure that
245 the configuration was set as expected. 345 the configuration was set as expected.
246 getAnswer (default: getAnswer) 346 getAnswer (default: getAnswer)
247 -- Returns a string (usually NOT xml) which is the 347 -- Returns a string (usually NOT xml) which is the
248 response that the student is submitting to answer 348 response that the student is effectvely submitting to answer
249 the WW question. 349 the WW question.
250 350
251 351
252=cut 352=cut
253 353
260# appletId =>'', #always use identical applet Id's and applet Names 360# appletId =>'', #always use identical applet Id's and applet Names
261 params =>undef, 361 params =>undef,
262 width => 550, 362 width => 550,
263 height => 400, 363 height => 400,
264 bgcolor => "#869ca7", 364 bgcolor => "#869ca7",
265 base64_state => undef, # this is a state to use for initializing the first occurence of the question. 365# base64_state => undef, # this is a state to use for initializing the first occurence of the question.
266 base64_config => undef, # this is the initial (and final?) configuration 366# base64_config => undef, # this is the initial (and final?) configuration
267# configuration => '', # configuration defining the applet 367 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.) 368 initialState => '', # initial state.
269 getStateAlias => 'getXML', 369 getStateAlias => 'getXML',
270 setStateAlias => 'setXML', 370 setStateAlias => 'setXML',
271 configAlias => '', # deprecated 371 configAlias => '', # deprecated
272 getConfigAlias => 'getConfig', 372 getConfigAlias => 'getConfig',
273 setConfigAlias => 'setConfig', 373 setConfigAlias => 'setConfig',
274 initializeActionAlias => 'setXML', 374 initializeActionAlias => 'setXML',
375 maxInitializationAttempts => 5, # number of attempts to initialize applet
275 submitActionAlias => 'getXML', 376 submitActionAlias => 'getXML',
276 submitActionScript => '', # script executed on submitting the WW question 377 submitActionScript => '', # script executed on submitting the WW question
277 answerBoxAlias => 'answerBox', 378 answerBoxAlias => 'answerBox',
278 answerBox => '', # deprecated 379 answerBox => '', # deprecated
279 returnFieldName => '', # deprecated 380 returnFieldName => '', # deprecated
280 headerText => DEFAULT_HEADER_TEXT(), 381 headerText => DEFAULT_HEADER_TEXT(),
281 objectText => '', 382 objectText => '',
282 debug => 0, 383 debugMode => 0,
283 @_, 384 @_,
284 }; 385 };
285 bless $self, $class; 386 bless $self, $class;
286 $self->initialState('<xml></xml>'); 387 $self->initialState('<xml></xml>');
287 if ($self->{returnFieldName}) or $self->{answerBox} ) { # backward compatibility 388 if ($self->{returnFieldName} or $self->{answerBox} ) { # backward compatibility
288 warn "use answerBoxAlias instead of returnFieldName or answerBox"; 389 warn "use answerBoxAlias instead of returnFieldName or answerBox";
289 $self->{answerBox}=''; 390 $self->{answerBox}='';
290 $self->{returnFieldName}=''; 391 $self->{returnFieldName}='';
291 } 392 }
292 if ($self->{configAlias}) { # backward compatibility 393 if ($self->{configAlias}) { # backward compatibility
293 warn "use setConfigAlias instead of configAlias"; 394 warn "use setConfigAlias instead of configAlias";
294 $self->{configAlias}=''; 395 $self->{configAlias}='';
295 } 396 }
296 $self->config('<xml></xml>'); 397 $self->configuration('<xml></xml>');
297 return $self; 398 return $self;
298} 399}
299 400
300sub header { 401sub header {
301 my $self = shift; 402 my $self = shift;
408sub appletName { 509sub appletName {
409 my $self = shift; 510 my $self = shift;
410 $self->{appletName} = shift ||$self->{appletName}; # replace the current appletName if non-empty 511 $self->{appletName} = shift ||$self->{appletName}; # replace the current appletName if non-empty
411 $self->{appletName}; 512 $self->{appletName};
412} 513}
413sub debug { 514sub debugMode {
414 my $self = shift; 515 my $self = shift;
415 my $new_flag = shift; 516 my $new_flag = shift;
416 $self->{debug} = $new_flag if defined($new_flag); 517 $self->{debugMode} = $new_flag if defined($new_flag);
417 $self->{debug}; 518 $self->{debugMode};
418} 519}
419sub appletId { 520sub appletId {
420 appletName(@_); 521 appletName(@_);
421} 522}
422 523sub maxInitializationAttempts {
524 my $self = shift;
525 $self->{maxInitializationAttempts} = shift || $self->{maxInitializationAttempts};
526 $self->{maxInitializationAttempts};
527}
423sub initialState { 528sub initialState {
424 my $self = shift; 529 my $self = shift;
425 my $str = shift; 530 my $str = shift;
426 $self->{initialState} = $str ||$self->{initialState}; # replace the current string if non-empty 531 $self->{initialState} = $str ||$self->{initialState}; # replace the current string if non-empty
427 $self->{initialState}; 532 $self->{initialState};
428} 533}
429
430sub config { 534sub configuration {
431 my $self = shift; 535 my $self = shift;
432 my $str = shift; 536 my $str = shift;
433 $self->{base64_config} = encode_base64($str) || $self->{base64_config}; # replace the current string if non-empty 537 $self->{configuration} = $str || $self->{configuration}; # replace the current string if non-empty
434 $self->{base64_config} =~ s/\n//g; 538 $self->{configuration} =~ s/\n//g;
435 decode_base64($self->{base64_config}); 539 $self->{configuration};
436} 540}
541
437####################### 542#######################
438# soon to be deprecated? 543# soon to be deprecated?
439####################### 544#######################
545
546sub config {
547 my $self = shift;
548 my $str = shift;
549 warn "use $self->configuration instead of $self->config. Internally this string is ascii, not base64 encoded", join(' ', caller());
550# $self->{base64_config} = encode_base64($str) || $self->{base64_config}; # replace the current string if non-empty
551# $self->{base64_config} =~ s/\n//g;
552# decode_base64($self->{base64_config});
553}
440sub state { 554sub state {
441 my $self = shift; 555 my $self = shift;
442 my $str = shift; 556 my $str = shift;
557 warn "use $self->initialState instead of $self->state. Internally this string is ascii, not base64 encoded", join(' ', caller());
443 $self->{base64_state} = encode_base64($str) ||$self->{base64_state}; # replace the current string if non-empty 558# $self->{base64_state} = encode_base64($str) ||$self->{base64_state}; # replace the current string if non-empty
444 $self->{base64_state} =~ s/\n//g; 559# $self->{base64_state} =~ s/\n//g;
445 decode_base64($self->{base64_state}); 560# decode_base64($self->{base64_state});
446} 561}
447sub base64_state{ 562sub base64_state{
448 my $self = shift; 563 my $self = shift;
449 $self->{base64_state} = shift ||$self->{base64_state}; # replace the current string if non-empty 564 warn "use $self->InitialState instead of $self->state. Internally this string is ascii, not base64 encoded", join(' ', caller());
450 $self->{base64_state}; 565
566
451} 567}
452 568
453sub base64_config { 569sub base64_config {
454 my $self = shift; 570 my $self = shift;
455 $self->{base64_config} = shift ||$self->{base64_config}; # replace the current string if non-empty 571 warn "use $self->configuration instead of $self->config. Internally this string is ascii, not base64 encoded";
456 $self->{base64_config} =$self->{base64_config};
457 $self->{base64_config};
458} 572}
459 573
460sub returnFieldName { 574sub returnFieldName {
461 my $self = shift; 575 my $self = shift;
462 warn "use answerBoxName instead of returnFieldName"; 576 warn "use answerBoxName instead of returnFieldName";
463} 577}
464sub answerBox { 578sub answerBox {
465 my $self = shift; 579 my $self = shift;
466 warn "use answerBoxName instead of AnswerBox"; 580 warn "use answerBoxAlias instead of AnswerBox";
467} 581}
468######################### 582#########################
469#FIXME 583#FIXME
470# need to be able to adjust header material 584# need to be able to adjust header material
471 585
473 my $self = shift; 587 my $self = shift;
474 588
475 my $codebase = $self->codebase; 589 my $codebase = $self->codebase;
476 my $appletId = $self->appletId; 590 my $appletId = $self->appletId;
477 my $appletName = $self->appletName; 591 my $appletName = $self->appletName;
478 my $base64_initialState = $self->base64_state;
479 my $initializeAction = $self->initializeActionAlias; 592 my $initializeActionAlias = $self->initializeActionAlias;
480 my $submitActionAlias = $self->submitActionAlias;
481 my $submitActionScript = $self->submitActionScript; 593 my $submitActionScript = $self->submitActionScript;
482 my $setStateAlias = $self->setStateAlias; 594 my $setStateAlias = $self->setStateAlias;
483 my $getStateAlias = $self->getStateAlias; 595 my $getStateAlias = $self->getStateAlias;
484 596
485 my $setConfigAlias = $self->setConfigAlias; 597 my $setConfigAlias = $self->setConfigAlias;
486 my $getConfigAlias = $self->getConfigAlias; 598 my $getConfigAlias = $self->getConfigAlias;
487 my $base64_config = $self->base64_config; 599 my $maxInitializationAttempts = $self->maxInitializationAttempts;
488 my $debugMode = ($self->debug) ? "1": "0"; 600 my $debugMode = ($self->debugMode) ? "1": "0";
489 my $returnFieldName = $self->{returnFieldName};
490 my $answerBox = $self->{answerBox}; 601 my $answerBoxAlias = $self->{answerBoxAlias};
491 my $headerText = $self->header(); 602 my $headerText = $self->header();
492 603
493 604
494 $submitActionScript =~ s/"/\\"/g; # escape quotes for ActionScript 605 #$submitActionScript =~ s/"/\\"/g; # escape quotes for ActionScript
495 # other variables should not have quotes. 606 # other variables should not have quotes.
496 607
497 $submitActionScript =~ s/\n/ /g; # replace returns with spaces -- returns in the wrong spot can cause trouble with javaScript 608 $submitActionScript =~ s/\n/ /g; # replace returns with spaces -- returns in the wrong spot can cause trouble with javaScript
498 $submitActionScript =~ s/\r/ /g; # replace returns with spaces -- returns can cause trouble 609 $submitActionScript =~ s/\r/ /g; # replace returns with spaces -- returns can cause trouble
610 my $base64_submitActionScript = encode_base64($submitActionScript);
611 my $base64_configuration = encode_base64($self->configuration);
612 my $base64_initialState = encode_base64($self->initialState);
613
614 $base64_submitActionScript =~s/\n//g;
615 $base64_initialState =~s/\n//g; # base64 encoded xml
616 $base64_configuration =~s/\n//g; # base64 encoded xml
499 617
500 $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook 618 $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook
501 619
502 return $headerText; 620 return $headerText;
503 621
549 //upload functions stored in /opt/webwork/webwork2/htdocs/js ... 667 //upload functions stored in /opt/webwork/webwork2/htdocs/js ...
550 668
551 </script> 669 </script>
552 <script language="JavaScript"> 670 <script language="JavaScript">
553 671
554 // set debug mode for this applet 672
555 set_debug($debugMode);
556 673
557 ////////////////////////////////////////////////////////// 674 //////////////////////////////////////////////////////////
558 //TEST code 675 //TEST code
559 // 676 //
560 // 677 //
562 679
563 ww_applet_list["$appletName"] = new ww_applet("$appletName"); 680 ww_applet_list["$appletName"] = new ww_applet("$appletName");
564 681
565 682
566 ww_applet_list["$appletName"].code = "$code"; 683 ww_applet_list["$appletName"].code = "$code";
567 ww_applet_list["$appletName"].codebase = "$codebase"; 684 ww_applet_list["$appletName"].codebase = "$codebase";
568 ww_applet_list["$appletName"].appletID = "$appletID"; 685 ww_applet_list["$appletName"].appletID = "$appletID";
569 ww_applet_list["$appletName"].base64_state = "$base64_initializationState"; 686 ww_applet_list["$appletName"].base64_state = "$base64_initializationState";
570 ww_applet_list["$appletName"].base64_config = "$base64_config"; 687 ww_applet_list["$appletName"].initialState = Base64.decode("$base64_initialState");
688 ww_applet_list["$appletName"].configuration = Base64.decode("$base64_configuration");;
571 ww_applet_list["$appletName"].getStateAlias = "$getStateAlias"; 689 ww_applet_list["$appletName"].getStateAlias = "$getStateAlias";
572 ww_applet_list["$appletName"].setStateAlias = "$setStateAlias"; 690 ww_applet_list["$appletName"].setStateAlias = "$setStateAlias";
573 ww_applet_list["$appletName"].setConfigAlias = "$setConfigAlias"; 691 ww_applet_list["$appletName"].setConfigAlias = "$setConfigAlias";
574 ww_applet_list["$appletName"].getConfigAlias = "$getConfigAlias"; 692 ww_applet_list["$appletName"].getConfigAlias = "$getConfigAlias";
575 ww_applet_list["$appletName"].initializeActionAlias = "$initializeAction"; 693 ww_applet_list["$appletName"].initializeActionAlias = "$initializeActionAlias";
576 ww_applet_list["$appletName"].submitActionAlias = "$submitActionAlias"; 694 ww_applet_list["$appletName"].submitActionAlias = "$submitActionAlias";
577 ww_applet_list["$appletName"].submitActionScript = "$submitActionScript"; 695 ww_applet_list["$appletName"].submitActionScript = Base64.decode("$base64_submitActionScript");
578 ww_applet_list["$appletName"].answerBox = "$answerBox"; 696 ww_applet_list["$appletName"].answerBoxAlias = "$answerBoxAlias";
697 ww_applet_list["$appletName"].maxInitializationAttempts = $maxInitializationAttempts;
579 ww_applet_list["$appletName"].debug = "$debugMode"; 698 ww_applet_list["$appletName"].debugMode = "$debugMode";
580 699
581 </script> 700 </script>
582 701
583END_HEADER_SCRIPT 702END_HEADER_SCRIPT
584 703

Legend:
Removed from v.6023  
changed lines
  Added in v.6030

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9