Subversion Repositories wimsdev

Rev

Rev 3647 | Rev 4895 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

!!compatible avec geogebra3.2

!if $wims_read_parm!=slib_header
 !goto proc
!endif
slib_title=Geogebra Applet
slib_author=Paul BYACHE et Bernadette PERRIN-RIOU

slib_example=Z=(-3,6.78);W=(0.2,5.8);a=Circle[Z,W];Ellipse[Z,W,5];u=Line[W,Z];showMenuBar=true;showToolBar=true;language=en;customToolBar="0|40@10||1|2";width=600;height=300;setCoordSystem(-9,7,1,11.5)\
A=(0,3.5);B=(0,5);a=Cercle[A,B];d:y=2x+1;number=2;width=600;language=fr;showToolBar=true;customToolBar="0|40"\
A=(0,3);B=(0,4);C=(2,3);s=Segment[A,C];Angle[C,A,B];a=Droite[C,B];D=Point[a];b=3;f(x)=b+sin(x);number=3;width=600;language=fr
!exit

:proc
!set name_clickgeogebra_fr=Initialiser

!default name_clickgeogebra_$lang=Init

!reset slib_out
!default slib_cnt=0
slib_cnt= $[$slib_cnt +1]
slib_data=!trim $wims_read_parm

slib_data= !items2lines $wims_read_parm
slib_data=!replace internal $   $ by $\
$ in $slib_data

slib_data = !rows2lines $slib_data
slib_data= !replace internal ; by $\
$ in $slib_data
slib_data=!nonempty lines $slib_data

slib_z2= $slib_data

slib_option= !item 2 to -1 of $wims_read_parm
slib_option= !replace internal , by @ in $slib_option
slib_option= !replace internal ; by $\
$ in $slib_option
!!only for compatibility, only one js method in js=[]
slib_extra= !getopt js in $slib_data
slib_extra=!declosing $slib_extra
slib_extra= !replace internal @ by , in $slib_extra
slib_extra=!words2lines $slib_extra
slib_extra = !rows2lines $slib_extra
slib_data=$slib_data\
$slib_extra

slib_list_ap = enableLabelDrags,enableShiftDragZoom,errorDialogsActive,file,showToolBar,showAlgebraView,showMenuBar,showResetIcon,showToolBarHelp,enableRightClick,showAlgebraInput,customToolBar,language,debug,number,ggbBase64
slib_list_ap1=!items2words $slib_list_ap

!for slib_a in width,height,language,$slib_list_ap
  slib_$slib_a=!getopt $slib_a in $slib_data
!next slib_a
slib_ggbBase64=$(slib_ggbBase64)
slib_customToolBar1= !nospace $slib_customToolBar
slib_customToolBar=$slib_customToolBar1
slib_customToolBar= !replace internal @ by , in $slib_customToolBar
slib_customToolBar= !replace internal || by % in $slib_customToolBar
slib_customToolBar= !replace internal | by ,|, in $slib_customToolBar
slib_customToolBar= !replace internal % by ,||, in $slib_customToolBar
slib_customToolBar= !items2words  $slib_customToolBar
!default slib_width=300
!default slib_height=300
!default slib_enableRightClick=true
!default slib_showToolBar=false
!default slib_showToolBarHelp=true
!default slib_showMenuBar=false
!default slib_showResetIcon=false
!default slib_showAlgebraInput=false
!default slib_language=$module_language
!default slib_enableLabelDrags=true
!default slib_enableShiftDragZoom=true
!default slib_errorDialogsActive=true
!default slib_debug=false
!default slib_customToolBar=
!default slib_number=1
slib_number=$[$slib_number-1]

!! ne trouve pas le fichier (? getXML ?)
!!slib_algebraview=<script type="text/javascript">\
!!function algebraview() {\
!! var myapplet = document.applet$slib_number; \
!! var ch=new String(myapplet.getXML());\
!! var f=new String('"false"'); var t=new String('"true"');\
!! var cmd=new String('cmdList');var alg=new String('algebraView');\
!! var i=ch.indexOf(alg + '=' + t) ;\
!! if (i>-1){ ch=ch.substr(0,i)+ alg +'='+ f+ch.substring(i+alg.length+1+t.length,ch.length);}\
!! var j=ch.indexOf(cmd +'=' + t) ;\
!! if (j>-1){ ch=ch.substr(0,j)+cmd+'='+f +ch.substring(i+cmd.length+1+t.length,ch.length);}\
!! myapplet.setXML(ch);\
!!}\
!!</script>
!!slib_out=$slib_algebraview

slib_js_parm=evalCommand setValue setCoords setColor setVisible \
  setLabelVisible setLabelStyle setFixed setTrace\
  setAxesVisible setGridVisible setCoordSystem setUndoPoint\
  deleteObject renameObject setLayer setLayerVisible\
  setLineStyle setThickness setPointStyle setPointSize\
  setFilling setAnimating setAnimationSpeed\
  startAnimation stopAnimation isAnimationRunning

slib_cnt=!linecnt $slib_data

slib_data1=!replace internal = by , in $slib_data
slib_data1=!replace internal ( by , in $slib_data1


slib_appletcommand=
slib_appletoption=
slib_geogebracommand=

slib_out=$slib_out\
<applet name="applet$slib_number" codebase="java/geogebra3" code="geogebra.GeoGebraApplet" archive="geogebra.jar" width="$slib_width" height="$slib_height" MAYSCRIPT>\
<param name="framePossible" value="false">\
<param name="language" value="$slib_language">\
<param name="showToolBar" value="$slib_showToolBar">\
<param name="showToolBarHelp" value="$slib_showToolBarHelp">\
<param name="showResetIcon" value="$slib_showResetIcon">\
<param name="enableRightClick" value="$slib_enableRightClick">\
<param name="showMenuBar" value="$slib_showMenuBar">\
<param name="showAlgebraInput" value="$slib_showAlgebraInput">\
<param name="showAlgebraView" value="false">
!for slib_u=1 to $slib_cnt
  slib_line=!line $slib_u of $slib_data
  slib_line=!nospace $slib_line
  slib_line1=!replace internal = by , in $slib_line
  slib_line1=!replace internal ( by , in $slib_line1
  slib_first=!item 1 of $slib_line1
  !if $slib_first iswordof width height $slib_list_ap1
    slib_out=!append line <param name="$slib_first" value="$(slib_$slib_first)"> to $slib_out
    !if $slib_first != customToolBar
      slib_appletoption=!append line $slib_first=$(slib_$slib_first) to $slib_appletoption
    !else
      slib_appletoption=!append line $slib_first=$(slib_$(slib_first)1) to $slib_appletoption
    !endif
  !else 
    !if $slib_first iswordof $slib_js_parm
      slib_appletcommand=!append line  myapplet.$slib_line; to $slib_appletcommand
      slib_geogebracommand=!append line $slib_line to $slib_geogebracommand
    !else
      !if $slib_first notwordof height width
        slib_appletcommand=!append line myapplet.evalCommand("$slib_line"); to $slib_appletcommand
        slib_geogebracommand=!append line $slib_line to $slib_geogebracommand
      !endif
    !endif
  !endif
!next
!if $slib_file!=$empty
  slib_mod = $module_category
  slib_mod = !items2words $slib_mod
  !if document iswordof $slib_mod
    slib_image_dir=$Docdir/$doc/files
  !endif
  !if oef iswordof $slib_mod
    slib_image_dir=$imagedir
  !endif
  !if adm iswordof $slib_mod
    slib_image_dir=$wims_ref_name?session=$wims_session&+cmd=getfile&+special_parm=doc
  !endif
  !default slib_image_dir=$module_dir

 slib_out=$slib_out\
<param name="filename" value="$slib_image_dir/$slib_file">
!endif

!if $slib_customToolBar!=$empty
  slib_out=$slib_out \
<param name="customToolBar" value="$slib_customToolBar">
!endif
slib_out=$slib_out\
Sorry - the GeoGebra Applet could not be started. Please make sure that Java 1.4.2 (or later) is installed and activated. (<a href="http://java.sun.com/getjava">click here to install Java now</a>)\
</applet>

!if $slib_appletcommand!=
 slib_out=<input type="button" style="background-color:$wims_ref_button_bgcolor;color:$wims_ref_button_color;" value="$(name_clickgeogebra_$lang)" onclick="Construction$slib_number();">\
 $slib_out\
 <script type="text/javascript">\
 function Construction$slib_number() {\
 var myapplet = document.applet$slib_number; \
 myapplet.setRepaintingActive(false); \
 $slib_appletcommand\
 myapplet.setRepaintingActive(true);\
}\
</script>

!endif
slib_z1=$wims_read_parm
!if $slib_debug=true
  slib_out=$slib_out \
<br><br>Parameters read by the applet : $slib_z1<br><br>The slib_data : $slib_z2 --> $slib_data
!endif