| 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/PG.pl,v 1.34 2007/10/25 17:11:59 sh002i Exp $ |
4 | # $CVSHeader: pg/lib/Applet.pm,v 1.1 2007/10/30 15:57:04 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. |
| … | |
… | |
| 94 | |
94 | |
| 95 | use MIME::Base64 qw( encode_base64 decode_base64); |
95 | use MIME::Base64 qw( encode_base64 decode_base64); |
| 96 | |
96 | |
| 97 | use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT'; |
97 | use constant DEFAULT_HEADER_TEXT =><<'END_HEADER_SCRIPT'; |
| 98 | <script language="javascript">AC_FL_RunContent = 0;</script> |
98 | <script language="javascript">AC_FL_RunContent = 0;</script> |
| 99 | <script src="http://hosted2.webwork.rochester.edu/webwork2_files/applets/AC_RunActiveContent.js" language="javascript"></script> |
99 | <script src="http://hosted2.webwork.rochester.edu/webwork2_files/applets/AC_RunActiveContent.js" language="javascript"> |
| 100 | |
|
|
| 101 | <script type="text/javascript" src="http://hosted2.webwork.rochester.edu/webwork2_files/js/BrowserSniffer.js"> |
|
|
| 102 | </script> |
100 | </script> |
|
|
101 | |
|
|
102 | |
| 103 | <script language="JavaScript"> |
103 | <script language="JavaScript"> |
| 104 | |
104 | |
| 105 | var flash; |
105 | var flash; |
| 106 | function getFlashMovie(movieName) { |
106 | function getFlashMovie(movieName) { |
| 107 | var isIE = navigator.appName.indexOf("Microsoft") != -1; |
107 | var isIE = navigator.appName.indexOf("Microsoft") != -1; |
| 108 | return (isIE) ? window[movieName] : window.document[movieName]; |
108 | return (isIE) ? window[movieName] : window.document[movieName]; |
| 109 | //return window.document[movieName]; |
109 | //return window.document[movieName]; |
| 110 | } |
110 | } |
| 111 | function getBrowser() { |
111 | |
| 112 | return new BrowserSniffer(); |
|
|
| 113 | } |
|
|
| 114 | |
112 | |
| 115 | function initialize() { |
113 | function initialize() { |
| 116 | getFlashMovie("$appletId").$initializeAction("$base64_xmlString"); |
114 | getFlashMovie("$appletId").$initializeAction("$base64_xmlString"); |
| 117 | } |
115 | } |
| 118 | function submitAction() { |
116 | function submitAction() { |
| 119 | document.problemMainForm.$returnFieldName.value = getFlashMovie("$appletId").$submitAction(); |
117 | document.problemMainForm.$returnFieldName.value = getFlashMovie("$appletId").$submitAction(); |
| 120 | } |
118 | } |
| 121 | |
119 | |
| 122 | </script>, |
120 | </script> |
| 123 | |
121 | |
| 124 | END_HEADER_SCRIPT |
122 | END_HEADER_SCRIPT |
| 125 | |
123 | |
| 126 | |
124 | |
| 127 | # <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" |
125 | # <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" |
| … | |
… | |
| 138 | # type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> |
136 | # type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> |
| 139 | # <param name="quality" value="high" /><param name="bgcolor" value="#ffffcc" /> |
137 | # <param name="quality" value="high" /><param name="bgcolor" value="#ffffcc" /> |
| 140 | # </object> |
138 | # </object> |
| 141 | |
139 | |
| 142 | use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; |
140 | use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; |
|
|
141 | <form></form> |
| 143 | <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" |
142 | <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" |
| 144 | id="ExternalInterface" width="500" height="375" |
143 | id="ExternalInterface" width="500" height="375" |
| 145 | codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> |
144 | codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> |
| 146 | <param name="movie" value="$codebase/$appletName.swf" /> |
145 | <param name="movie" value="$codebase/$appletName.swf" /> |
| 147 | <param name="quality" value="high" /> |
146 | <param name="quality" value="high" /> |