[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 5675 Revision 5676
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.10 2008/05/05 17:24:31 gage Exp $ 4# $CVSHeader: pg/lib/Applet.pm,v 1.11 2008/05/12 00:50:23 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.
463 debug_add("get current state for applet $appletName and store it in $appletName"+"_state"); 463 debug_add("get current state for applet $appletName and store it in $appletName"+"_state");
464 var applet = getApplet("$appletName"); 464 var applet = getApplet("$appletName");
465 try { 465 try {
466 if (( typeof(applet.$getState) == "function" ) ) { // there may be no state function 466 if (( typeof(applet.$getState) == "function" ) ) { // there may be no state function
467 state = applet.$getState(); // get state in xml format 467 state = applet.$getState(); // get state in xml format
468 debug_add("state has type " + typeof(state));
469 state = String(state); // geogebra returned an object type instead of a string type
470 debug_add("state converted to type " + typeof(state));
468 } 471 }
469 472
473 if (!debug) {
474 state = Base64.encode(state);
470 if (!debug) {state = Base64.encode(state) }; // replace state by encoded version unless in debug mode 475 }; // replace state by encoded version unless in debug mode
476
471 debug_add("state is "+state); // this should still be in plain text 477 debug_add("state is "+state); // this should still be in plain text
472 getQE("$appletName"+"_state").value = state; //place state in input item (debug: textarea, otherwise: hidden) 478 getQE("$appletName"+"_state").value = state; //place state in input item (debug: textarea, otherwise: hidden)
473 } catch (e) { 479 } catch (e) {
474 alert("Error in getting state for $appletName " + e ); 480 alert("Error in getting state for $appletName " + e );
475 } 481 }

Legend:
Removed from v.5675  
changed lines
  Added in v.5676

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9