[system] / trunk / pg / macros / AppletObjects.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/AppletObjects.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5622 Revision 5623
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/macros/AppletObjects.pl,v 1.3 2008/01/03 15:17:40 gage Exp $ 4# $CVSHeader: pg/macros/AppletObjects.pl,v 1.4 2008/03/16 14:39:14 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.
50 var applet_getState_list = new Object; 50 var applet_getState_list = new Object;
51 var applet_config_list = new Object; 51 var applet_config_list = new Object;
52 52
53 53
54 function base64Q(str) { 54 function base64Q(str) {
55 return !str.match(/<XML>*/i); 55 return !str.match(/<XML/i && !str.match(/<?xml/i));
56 } 56 }
57 57
58 function submitAction() { 58 function submitAction() {
59 //alert("submit Action" ); 59 //alert("submit Action" );
60 for (var applet in applet_submitAction_list) { 60 for (var applet in applet_submitAction_list) {
221 ####### 221 #######
222 my $base_64_encoded_answer_value = ($answer_value =~/<XML>/i)? encode_base64($answer_value) : $answer_value; 222 my $base_64_encoded_answer_value = ($answer_value =~/<XML>/i)? encode_base64($answer_value) : $answer_value;
223 my $decoded_answer_value = ($answer_value =~/<XML>/i) ? $answer_value : decode_base64($answer_value); 223 my $decoded_answer_value = ($answer_value =~/<XML>/i) ? $answer_value : decode_base64($answer_value);
224 my $debug_input_element = qq!\n<textarea rows="4" cols="80" 224 my $debug_input_element = qq!\n<textarea rows="4" cols="80"
225 name = "$appletStateName">$decoded_answer_value</textarea><br/> 225 name = "$appletStateName">$decoded_answer_value</textarea><br/>
226 <input type="button" value="getState" 226 <input type="button" value="$getState"
227 onClick="applet_getState_list['$appletName']()"> 227 onClick="applet_getState_list['$appletName']()"
228 >
228 <input type="button" value="setState" 229 <input type="button" value="$setState"
229 onClick="applet_setState_list['$appletName']();
230 var tmp = getQE('$appletStateName').value;"> 230 onClick="var tmp = getQE('$appletStateName').value;
231 applet_setState_list['$appletName'](tmp);"
232 >
231 !; 233 !;
232 my $state_input_element = ($self->debug == 1) ? $debug_input_element : 234 my $state_input_element = ($self->debug == 1) ? $debug_input_element :
233 qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!; 235 qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!;
234 my $reset_button_str = ($reset_button) ? 236 my $reset_button_str = ($reset_button) ?
235 qq!<br/><input type='button' value='reset applet' onClick="applet_setState_list['$appletName']('<xml></xml>')">! 237 qq!<br/><input type='button' value='reset applet' onClick="applet_setState_list['$appletName']('<xml></xml>')">!

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

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9