[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 6315 Revision 6316
683 683
684 </script> 684 </script>
685 <script language="JavaScript"> 685 <script language="JavaScript">
686 686
687 function getApplet(appletName) { 687 function getApplet(appletName) {
688 var isIE = navigator.appName.indexOf("Microsoft") != -1; 688 var isIE = navigator.appName.indexOf("Microsoft") != -1; // ie8 uses this for java and firefox uses it for flash.
689 var obj = (isIE) ? window[appletName] : window.document[appletName]; 689 var obj = (isIE) ? window[appletName] : window.document[appletName];
690 //return window.document[appletName]; 690 //return window.document[appletName];
691 if (obj && (obj.name == appletName)) { //RECENT FIX to == 691 if (!obj) { obj = document.getElementById(appletName) }
692 if (obj ) { //RECENT FIX to ==
692 return( obj ); 693 return( obj );
693 } else { 694 } else {
694 alert ("can't find applet " + appletName); 695 alert ("can't find applet " + appletName);
695 } 696 }
696 } 697 }
800 801
801 802
802=cut 803=cut
803 804
804use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; 805use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT';
805 <form></form> 806
806 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 807 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
807 id="$appletName" width="500" height="375" 808 id="$appletName" width="500" height="375"
808 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> 809 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
809 <param name="movie" value="$codebase/$appletName.swf" /> 810 <param name="movie" value="$codebase/$appletName.swf" />
810 <param name="quality" value="high" /> 811 <param name="quality" value="high" />
811 <param name="bgcolor" value="$applet_bgcolor" /> 812 <param name="bgcolor" value="$applet_bgcolor" />
812 <param name="allowScriptAccess" value="sameDomain" /> 813 <param name="allowScriptAccess" value="sameDomain" />
813 <param name="FlashVars" value="$flashParameters"/> 814 <param name="FlashVars" value="$flashParameters"/>
814 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="$applet_bgcolor" 815 <embed src="$codebase/$appletName.swf" quality="high" bgcolor="$applet_bgcolor"
815 width="$width" height="$height" name="$appletName" align="middle" id="$appletName" 816 width="$width" height="$height" name="$appletName" align="middle" id="$appletName"
816 play="true" loop="false" quality="high" allowScriptAccess="sameDomain" 817 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
817 type="application/x-shockwave-flash" 818 type="application/x-shockwave-flash"
818 pluginspage="http://www.macromedia.com/go/getflashplayer" 819 pluginspage="http://www.macromedia.com/go/getflashplayer"
819 FlashVars="$flashParameters"> 820 FlashVars="$flashParameters">
820 </embed> 821 </embed>
872 END_OBJECT_TEXT 873 END_OBJECT_TEXT
873 874
874=cut 875=cut
875 876
876use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT'; 877use constant DEFAULT_OBJECT_TEXT =><<'END_OBJECT_TEXT';
877 <form></form> 878
878 <applet 879 <applet
879 code = "$code" 880 code = "$code"
880 codebase = "$codebase" 881 codebase = "$codebase"
881 archive = "$archive" 882 archive = "$archive"
882 name = "$appletName" 883 name = "$appletName"
981 982
982 function getApplet(appletName) { 983 function getApplet(appletName) {
983 //var isIE = navigator.appName.indexOf("Microsoft") != -1; 984 //var isIE = navigator.appName.indexOf("Microsoft") != -1;
984 //var obj = (isIE) ? window[appletName] : window.document[appletName]; 985 //var obj = (isIE) ? window[appletName] : window.document[appletName];
985 //return window.document[appletName]; 986 //return window.document[appletName];
986 var obj = ww_applet_list[appletName].object; 987 var obj = ww_applet_list[appletName].object; // define fake applet for this object
987 if (obj && (obj.name == appletName)) { //RECENT FIX to == 988 if (obj && (obj.name == appletName)) { //RECENT FIX to ==
988 //alert("getting fake applet " + obj.name); 989 //alert("getting fake applet " + obj.name);
989 return( obj ); 990 return( obj );
990 } else { 991 } else {
991 alert ("can't find fake applet " + appletName + " in object "+obj.name); 992 alert ("can't find fake applet " + appletName + " in object "+obj.name);
998 999
999#FIXME need to get rid of hardcoded url 1000#FIXME need to get rid of hardcoded url
1000 1001
1001 1002
1002use constant CANVAS_OBJECT_TEXT =><<'END_OBJECT_TEXT'; 1003use constant CANVAS_OBJECT_TEXT =><<'END_OBJECT_TEXT';
1003 <form></form> 1004
1004 <canvas name="cv" id="cv" data-src="/webwork2_files/js/sketchgraphhtml5b/SketchGraph.pjs" width="$width" height="$height"></canvas> 1005 <canvas name="cv" id="cv" data-src="/webwork2_files/js/sketchgraphhtml5b/SketchGraph.pjs" width="$width" height="$height"></canvas>
1005END_OBJECT_TEXT 1006END_OBJECT_TEXT
1006 1007
1007sub new { 1008sub new {
1008 my $class = shift; 1009 my $class = shift;

Legend:
Removed from v.6315  
changed lines
  Added in v.6316

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9