[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 5994
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.14 2009/01/28 17:07:08 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.
35 ################################### 35 ###################################
36 # Configure applet 36 # Configure applet
37 ################################### 37 ###################################
38 38
39 #xml data to set up the problem-rac 39 #xml data to set up the problem-rac
40 $applet->state(qq{<XML> 40 $applet->config(qq{<XML>
41 <point xval='$xval_1' yval='$yval_1' /> 41 <point xval='$xval_1' yval='$yval_1' />
42 <point xval='$xval_2' yval='$yval_2' /> 42 <point xval='$xval_2' yval='$yval_2' />
43 </XML>}); 43 </XML>});
44 44
45 45
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
101 101
102=head2 Default javaScript functions placed in header 102=head2 Default javaScript functions placed in header
103
104=pod
103 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,
195 base64_state => '', 202 base64_state => undef, # this is an state to use for initializing the first occurence of the question.
196 base64_config => '', 203 base64_config => undef, # this is the initial (and final?) configuration
197 getStateAlias => 'getXML', 204 getStateAlias => 'getXML',
198 setStateAlias => 'setState', 205 setStateAlias => 'setXML',
199 configAlias => 'config', 206 configAlias => 'config',
200 initializeActionAlias => 'setXML', 207 initializeActionAlias => 'setXML',
201 submitActionAlias => 'getXML', 208 submitActionAlias => 'getXML',
202 returnFieldName => 'receivedField', 209 submitActionScript => '', # script executed on submitting the WW question
210 answerBox => 'answerBox',
203 headerText => DEFAULT_HEADER_TEXT(), 211 headerText => DEFAULT_HEADER_TEXT(),
204 objectText => '', 212 objectText => '',
205 debug => 0, 213 debug => 0,
206 @_, 214 @_,
207 }; 215 };
208 bless $self, $class; 216 bless $self, $class;
217 $self->state('<xml></xml>');
218 $self->config('<xml></xml>');
209 return $self; 219 return $self;
210} 220}
211 221
212sub header { 222sub header {
213 my $self = shift; 223 my $self = shift;
248sub submitActionAlias { 258sub submitActionAlias {
249 my $self = shift; 259 my $self = shift;
250 $self->{submitActionAlias} = shift ||$self->{submitActionAlias}; # replace the current contents if non-empty 260 $self->{submitActionAlias} = shift ||$self->{submitActionAlias}; # replace the current contents if non-empty
251 $self->{submitActionAlias}; 261 $self->{submitActionAlias};
252} 262}
263sub submitActionScript {
264 my $self = shift;
265 $self->{submitActionScript} = shift ||$self->{submitActionScript}; # replace the current contents if non-empty
266 $self->{submitActionScript};
267}
253sub getStateAlias { 268sub getStateAlias {
254 my $self = shift; 269 my $self = shift;
255 $self->{getStateAlias} = shift ||$self->{getStateAlias}; # replace the current contents if non-empty 270 $self->{getStateAlias} = shift ||$self->{getStateAlias}; # replace the current contents if non-empty
256 $self->{getStateAlias}; 271 $self->{getStateAlias};
257} 272}
266 $self->{configAlias} = shift ||$self->{configAlias}; # replace the current contents if non-empty 281 $self->{configAlias} = shift ||$self->{configAlias}; # replace the current contents if non-empty
267 $self->{configAlias}; 282 $self->{configAlias};
268} 283}
269sub returnFieldName { 284sub returnFieldName {
270 my $self = shift; 285 my $self = shift;
271 $self->{returnFieldName} = shift ||$self->{returnFieldName}; # replace the current contents if non-empty 286 $self->{answerBox} = shift ||$self->{answerBox}; # replace the current contents if non-empty
272 $self->{returnFieldName}; 287 $self->{answerBox};
288}
289sub answerBox {
290 my $self = shift;
291 $self->{answerBox} = shift ||$self->{answerBox}; # replace the current contents if non-empty
292 $self->{answerBox};
273} 293}
274sub codebase { 294sub codebase {
275 my $self = shift; 295 my $self = shift;
276 $self->{codebase} = shift ||$self->{codebase}; # replace the current codebase if non-empty 296 $self->{codebase} = shift ||$self->{codebase}; # replace the current codebase if non-empty
277 $self->{codebase}; 297 $self->{codebase};
345 my $appletId = $self->appletId; 365 my $appletId = $self->appletId;
346 my $appletName = $self->appletName; 366 my $appletName = $self->appletName;
347 my $base64_initialState = $self->base64_state; 367 my $base64_initialState = $self->base64_state;
348 my $initializeAction = $self->initializeActionAlias; 368 my $initializeAction = $self->initializeActionAlias;
349 my $submitAction = $self->submitActionAlias; 369 my $submitAction = $self->submitActionAlias;
370 my $submitActionScript = $self->submitActionScript;
350 my $setState = $self->setStateAlias; 371 my $setState = $self->setStateAlias;
351 my $getState = $self->getStateAlias; 372 my $getState = $self->getStateAlias;
352 my $config = $self->configAlias; 373 my $config = $self->configAlias;
353 my $base64_config = $self->base64_config; 374 my $base64_config = $self->base64_config;
354 my $debugMode = ($self->debug) ? "1": "0"; 375 my $debugMode = ($self->debug) ? "1": "0";
355 my $returnFieldName = $self->{returnFieldName}; 376 my $returnFieldName = $self->{returnFieldName};
356# my $encodeStateQ = ($self->debug)?'' : "state = Base64.encode(state);"; # in debug mode base64 encoding is not used. 377 my $answerBox = $self->{answerBox};
357# my $decodeStateQ = "if (!state.match(/<XML>*/i) ) {state = Base64.decode(state)}"; # decode if <XML> is not present
358 my $headerText = $self->header(); 378 my $headerText = $self->header();
359 379
360 $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook 380 $headerText =~ s/(\$\w+)/$1/gee; # interpolate variables p17 of Cookbook
361 381
362 return $headerText; 382 return $headerText;
371 my $appletId = $self->{appletName}; 391 my $appletId = $self->{appletName};
372 my $appletName = $self->{appletName}; 392 my $appletName = $self->{appletName};
373 my $archive = $self->{archive}; 393 my $archive = $self->{archive};
374 my $width = $self->{width}; 394 my $width = $self->{width};
375 my $height = $self->{height}; 395 my $height = $self->{height};
376 my $parameters = ''; 396 my $javaParameters = '';
377 my $parameters = ''; 397 my $flashParameters = '';
378 my %param_hash = %{$self->params()}; 398 my %param_hash = %{$self->params()};
379 foreach my $key (keys %param_hash) { 399 foreach my $key (keys %param_hash) {
380 $parameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n! 400 $javaParameters .= qq!<param name ="$key" value = "$param_hash{$key}">\n!;
401 $flashParameters .= uri_escape($key).'='.uri_escape($param_hash{$key}).'&';
381 } 402 }
403 $flashParameters =~ s/\&$//; # trim last &
382 404
405
383 $objectText = $self->{objectText}; 406 $objectText = $self->{objectText};
384 $objectText =~ s/(\$\w+)/$1/gee; 407 $objectText =~ s/(\$\w+)/$1/gee;
385 return $objectText; 408 return $objectText;
386} 409}
387sub initialize { 410# sub initialize {
388 my $self = shift; 411# my $self = shift;
389 return q{ 412# return q{
390 <script> 413# <script>
391 initializeAction(); 414# initializeAllApplets();
392 // this should really be done in the <body> tag 415# // this should really be done in the <body> tag
393 </script> 416# </script>
394 }; 417# };
395 418#
396} 419# }
397 420########################################################
421# HEADER material for one flash or java applet
422########################################################
398 423
399use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT'; 424use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT';
400 425 <script src="/webwork2_files/js/Base64.js" language="javascript">
426 </script>
427 <script src="/webwork2_files/js/ww_applet_support.js">
428 //upload functions stored in /opt/webwork/webwork2/htdocs/js ...
429 </script>
401 <script language="JavaScript"> 430 <script language="JavaScript">
402 var debug = $debugMode; 431
432 // set debug mode for this applet
433 set_debug($debugMode);
434
435 //////////////////////////////////////////////////////////
436 //TEST code
403 // 437 //
438 //
439 //////////////////////////////////////////////////////////
440
441 ww_applet_list["$appletName"] = new ww_applet("$appletName");
442
443
444 ww_applet_list["$appletName"].code = "$code";
445 ww_applet_list["$appletName"].codebase = "$codebase";
446 ww_applet_list["$appletName"].appletID = "$appletID";
447 ww_applet_list["$appletName"].base64_state = "$base64_initializationState";
448 ww_applet_list["$appletName"].base64_config = "$base64_config";
449 ww_applet_list["$appletName"].getStateAlias = "$getState";
450 ww_applet_list["$appletName"].setStateAlias = "$setState";
451 ww_applet_list["$appletName"].configAlias = "$config";
452 ww_applet_list["$appletName"].initializeActionAlias = "$initializeAction";
453 ww_applet_list["$appletName"].submitActionAlias = "$submitAction";
454 ww_applet_list["$appletName"].submitActionScript = "$submitActionScript";
455 ww_applet_list["$appletName"].answerBox = "$answerBox";
456 ww_applet_list["$appletName"].debug = "$debugMode";
457
458
459 //////////////////////////////////////////////////////////
404 //CONFIGURATIONS 460 //CONFIGURATIONS
405 // 461 //
406 // configurations are "permanent" 462 // configurations are "permanent"
463 //////////////////////////////////////////////////////////
464
407 applet_config_list["$appletName"] = function() { 465// applet_config_list["$appletName"] = function() {
408 if (debug) { alert("configure $appletName . $config ( $base64_config )");} 466// debug_add("applet_config_list:\n attempt to configure $appletName . $config ( $base64_config ) if config function is defined: "
467// );
409 try { 468// try {
410 if (debug || !( typeof(getApplet("$appletName").$config) == "undefined" ) ) { 469// if (( typeof(getApplet("$appletName").$config) == "function" ) ) {
411 470// debug_add("CONFIGURE $appletName");
412 getApplet("$appletName").$config(Base64.decode("$base64_config")); 471// getApplet("$appletName").$config(Base64.decode("$base64_config"));
413 } 472// }
414 } catch(e) { 473// } catch(e) {
415 alert("error executing configuration command $config for $appletName: " + e ); 474// alert("Error executing configuration command $config for $appletName: " + e );
416 } 475// }
417 } 476// }
418 // 477// ////////////////////////////////////////////////////////////
478// //
419 //STATE 479// //STATE:
420 // 480// // state can vary as the applet is manipulated -- it is reset from the questions _state values
421 // state can vary as the applet is manipulated. 481// //
482// //////////////////////////////////////////////////////////
483//
422 applet_setState_list["$appletName"] = function(state) { 484// applet_setState_list["$appletName"] = function(state) {
485// debug_add("Begin setState for applet $appletName");
486// debug_add("Obtain state from $appletName"+"_state");
423 state = state || getQE("$appletName"+"_state").value 487// state = state || getQE("$appletName"+"_state").value;
424 if (state.match("\S") ) { // if state is not all white space
425 if ( base64Q(state) ) { 488// if ( base64Q(state) ) {
426 state=Base64.decode(state); 489// state=Base64.decode(state);
427 } 490// }
428 if (debug) { alert("set state for $appletName to " + state);} 491// if (state.match(/<xml/i) || state.match(/<?xml/i) ) { // if state starts with <?xml
429 try { 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 {
430 if (debug || !( typeof(getApplet("$appletName").$setState) =="undefined" ) ) { 497// if (( typeof(getApplet("$appletName").$setState) =="function" ) ) {
498// debug_add("setState for $appletName");
431 getApplet("$appletName").$setState( state ); 499// getApplet("$appletName").$setState( state );
432 } 500// }
433 } catch(e) { 501// } catch(e) {
434 alert("Error in setting state of $appletName using command $setState : " + e ); 502// alert("Error in setting state of $appletName using command $setState : " + e );
435 } 503// }
436 } 504// } else if (debug) {
437 }; 505// alert("new state was empty string or did not begin with <xml-- state was not reset");
506// }
507// };
438 applet_getState_list["$appletName"] = function () { 508// applet_getState_list["$appletName"] = function () {
439 if (debug) { alert("getState for applet $appletName");} 509// debug_add("get current state for applet $appletName and store it in $appletName"+"_state");
440 try {
441 var applet = getApplet("$appletName"); 510// var applet = getApplet("$appletName");
442 var state; 511// try {
443 if (!( typeof(getApplet("$appletName").$getState) =="undefined" ) ) { 512// if (( typeof(applet.$getState) == "function" ) ) { // there may be no state function
444 state = applet.$getState(); // get state in xml format 513// state = applet.$getState(); // get state in xml format
445 } 514// debug_add("state has type " + typeof(state));
446 if (!debug) {state = Base64.encode(state) }; // replace state by encoded version 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
447 getQE("$appletName"+"_state").value = state; //place in state htmlItem (debug: textarea, otherwise hidden) 524// getQE("$appletName"+"_state").value = state; //place state in input item (debug: textarea, otherwise: hidden)
448 } catch (e) { 525// } catch (e) {
449 alert("Error in getting state for $appletName " + e ); 526// alert("Error in getting state for $appletName " + e );
450 } 527// }
451 }; 528// };
452 // 529//
530// ////////////////////////////////////////////////////////////
531// //
453 //INITIALIZE 532// //INITIALIZE
454 // 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//
455 applet_initializeAction_list["$appletName"] = function () { 566// applet_initializeAction_list["$appletName"] = function (state) {
456 applet_setState_list["$appletName"](); 567// applet_setState_list["$appletName"](state);
457 }; 568// };
458 569//
459 applet_submitAction_list["$appletName"] = function () { 570// applet_submitAction_list["$appletName"] = function () {
571// if (! applet_isReady_list["$appletName"] ) {
572// alert("$appletName is not ready");
573// }
460 applet_getState_list["$appletName"](); 574// applet_getState_list["$appletName"]();
461 getQE("$returnFieldName").value = getApplet("$appletName").sendData(); 575// $submitActionScript
576// //getQE("$answerBox").value = getApplet("$appletName").getAnswer(); //FIXME -- not needed in general?
462 }; 577// };
463 </script> 578 </script>
464 579
465END_HEADER_SCRIPT 580END_HEADER_SCRIPT
466 581
467package FlashApplet; 582package FlashApplet;
468@ISA = qw(Applet); 583@ISA = qw(Applet);
469 584
470 585
586=head2 Insertion HTML code for FlashApplet
471 587
472=pod 588=pod
473 589
474The secret to making this applet work with IE in addition to normal browsers 590The secret to making this applet work with IE in addition to normal browsers
475is the addition of the C(<form></form>) construct just before the object. 591is the addition of the C(<form></form>) construct just before the object.
512 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> 628 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
513 <param name="movie" value="$codebase/$appletName.swf" /> 629 <param name="movie" value="$codebase/$appletName.swf" />
514 <param name="quality" value="high" /> 630 <param name="quality" value="high" />
515 <param name="bgcolor" value="#869ca7" /> 631 <param name="bgcolor" value="#869ca7" />
516 <param name="allowScriptAccess" value="sameDomain" /> 632 <param name="allowScriptAccess" value="sameDomain" />
633 <param name="FlashVars" value="$flashParameters"/>
517 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7" 634 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="#869ca7"
518 width="$width" height="$height" name="$appletName" align="middle" id="$appletName" 635 width="$width" height="$height" name="$appletName" align="middle" id="$appletName"
519 play="true" loop="false" quality="high" allowScriptAccess="sameDomain" 636 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
520 type="application/x-shockwave-flash" 637 type="application/x-shockwave-flash"
521 pluginspage="http://www.macromedia.com/go/getflashplayer"> 638 pluginspage="http://www.macromedia.com/go/getflashplayer"
639 FlashVars="$flashParameters">
522 </embed> 640 </embed>
523 641
524 </object> 642 </object>
525END_OBJECT_TEXT 643END_OBJECT_TEXT
526 644
534 652
535 653
536package JavaApplet; 654package JavaApplet;
537@ISA = qw(Applet); 655@ISA = qw(Applet);
538 656
539 657=head2 Insertion HTML code for JavaApplet
540 658
541=pod 659=pod
542 660
543The secret to making this applet work with IE in addition to normal browsers 661The secret to making this applet work with IE in addition to normal browsers
544is the addition of the C(<form></form>) construct just before the object. 662is the addition of the C(<form></form>) construct just before the object.
562 id = "$appletName" 680 id = "$appletName"
563 width = "$width" 681 width = "$width"
564 height = "$height" 682 height = "$height"
565 MAYSCRIPT 683 MAYSCRIPT
566 > 684 >
567 $parameters 685 $javaParameters
568 </applet> 686 </applet>
569 END_OBJECT_TEXT 687 END_OBJECT_TEXT
570 688
571=cut 689=cut
572 690
580 id = "$appletName" 698 id = "$appletName"
581 width = "$width" 699 width = "$width"
582 height = "$height" 700 height = "$height"
583 MAYSCRIPT 701 MAYSCRIPT
584 > 702 >
585 $parameters 703 $javaParameters
704
705 Sorry, the Applet could not be started. Please make sure that
706Java 1.4.2 (or later) is installed and activated.
707(<a href="http://java.sun.com/getjava">click here to install Java now</a>)
586 </applet> 708 </applet>
587END_OBJECT_TEXT 709END_OBJECT_TEXT
588 710
589sub new { 711sub new {
590 my $class = shift; 712 my $class = shift;

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

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9