[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 5944 Revision 5984
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.12 2008/05/22 19:15:59 gage Exp $ 4# $CVSHeader: pg/lib/Applet.pm,v 1.13 2008/11/19 04:39:43 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.
203 getStateAlias => 'getXML', 203 getStateAlias => 'getXML',
204 setStateAlias => 'setXML', 204 setStateAlias => 'setXML',
205 configAlias => 'config', 205 configAlias => 'config',
206 initializeActionAlias => 'setXML', 206 initializeActionAlias => 'setXML',
207 submitActionAlias => 'getXML', 207 submitActionAlias => 'getXML',
208 submitActionScript => '', # script executed on submitting the WW question
208 returnFieldName => 'receivedField', 209 returnFieldName => 'receivedField',
209 headerText => DEFAULT_HEADER_TEXT(), 210 headerText => DEFAULT_HEADER_TEXT(),
210 objectText => '', 211 objectText => '',
211 debug => 0, 212 debug => 0,
212 @_, 213 @_,
256sub submitActionAlias { 257sub submitActionAlias {
257 my $self = shift; 258 my $self = shift;
258 $self->{submitActionAlias} = shift ||$self->{submitActionAlias}; # replace the current contents if non-empty 259 $self->{submitActionAlias} = shift ||$self->{submitActionAlias}; # replace the current contents if non-empty
259 $self->{submitActionAlias}; 260 $self->{submitActionAlias};
260} 261}
262sub submitActionScript {
263 my $self = shift;
264 $self->{submitActionScript} = shift ||$self->{submitActionScript}; # replace the current contents if non-empty
265 $self->{submitActionScript};
266}
261sub getStateAlias { 267sub getStateAlias {
262 my $self = shift; 268 my $self = shift;
263 $self->{getStateAlias} = shift ||$self->{getStateAlias}; # replace the current contents if non-empty 269 $self->{getStateAlias} = shift ||$self->{getStateAlias}; # replace the current contents if non-empty
264 $self->{getStateAlias}; 270 $self->{getStateAlias};
265} 271}
353 my $appletId = $self->appletId; 359 my $appletId = $self->appletId;
354 my $appletName = $self->appletName; 360 my $appletName = $self->appletName;
355 my $base64_initialState = $self->base64_state; 361 my $base64_initialState = $self->base64_state;
356 my $initializeAction = $self->initializeActionAlias; 362 my $initializeAction = $self->initializeActionAlias;
357 my $submitAction = $self->submitActionAlias; 363 my $submitAction = $self->submitActionAlias;
364 my $submitActionScript = $self->submitActionScript;
358 my $setState = $self->setStateAlias; 365 my $setState = $self->setStateAlias;
359 my $getState = $self->getStateAlias; 366 my $getState = $self->getStateAlias;
360 my $config = $self->configAlias; 367 my $config = $self->configAlias;
361 my $base64_config = $self->base64_config; 368 my $base64_config = $self->base64_config;
362 my $debugMode = ($self->debug) ? "1": "0"; 369 my $debugMode = ($self->debug) ? "1": "0";
530 applet_submitAction_list["$appletName"] = function () { 537 applet_submitAction_list["$appletName"] = function () {
531 if (! applet_isReady_list["$appletName"] ) { 538 if (! applet_isReady_list["$appletName"] ) {
532 alert("$appletName is not ready"); 539 alert("$appletName is not ready");
533 } 540 }
534 applet_getState_list["$appletName"](); 541 applet_getState_list["$appletName"]();
542 $submitActionScript
535 //getQE("$returnFieldName").value = getApplet("$appletName").sendData(); //FIXME -- not needed in general? 543 //getQE("$returnFieldName").value = getApplet("$appletName").sendData(); //FIXME -- not needed in general?
536 }; 544 };
537 </script> 545 </script>
538 546
539END_HEADER_SCRIPT 547END_HEADER_SCRIPT

Legend:
Removed from v.5944  
changed lines
  Added in v.5984

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9