Subversion Repositories wimsdev

Rev

Rev 13351 | Blame | Compare with Previous | Last modification | View Log | RSS feed

!set ans_require=
!if $wims_read_parm=def
  !exit
!endif
!set layer_width=600
!set lenlimit=25
!set parm_name=reply$i
!set font_height=!item 1 of $(replygood$i)
!set imgs=!item 2 to -1 of $(replygood$i)
!set imgs=!translate internal | to , in $imgs
!set imgs=!rows2lines $imgs
!set atest=!line 1 of $imgs
!if ?analyze iswordof $atest
  !set imgs=!line 2 to -1 of $imgs
!endif
!set imgs=!lines2items $imgs
!set imgs=!words2items $imgs
!set imgs=!nonempty items $imgs
!set imgs=!listuniq $imgs
!set imgs=!shuffle $imgs
!set imgcnt=!itemcnt $imgs
!set imgs=!nospace $imgs
!set imgarr=!replace internal , by "," in "$imgs"
!set Imgs=!replace internal , by ,$imagedir/ in $imagedir/$imgs
!set Imgarr=!replace internal , by "," in "$Imgs"
!reset imgn,imgdest
!for i_=1 to $imgcnt
  !set imgn=!append item "i$i_" to $imgn
  !set imgdest=!append item "dest$i_" to $imgdest
!next i_

<script>
/*<![CDATA[*/
 var imgcnt=0;
 Imgs=new Array($Imgarr);
 imgs=new Array($imgarr);
 imgn=new Array($imgn);
 imgdest=new Array($imgdest);
 posis=new Array($lenlimit+1);
 strs=new Array($lenlimit+1);
 posis[0]=0;
 strs[0]="";

 function addone(t) {
  var w, h;
  w=document.images[imgn[t]].width;
  h=document.images[imgn[t]].height;
  if(t<0 || imgcnt>=$lenlimit) return;
  document.images[imgdest[imgcnt]].src=Imgs[t];
  document.images[imgdest[imgcnt]].width=w;
  document.images[imgdest[imgcnt]].height=h;
  if(imgcnt>0) strs[imgcnt+1]=strs[imgcnt]+","+imgs[t];
  else strs[imgcnt+1]=imgs[t];
  document.forms['replyform'].$parm_name.value=strs[imgcnt+1];
  imgcnt++;
 }

 function backone() {
  if(imgcnt<1) return;
  imgcnt--;
  document.images[imgdest[imgcnt]].src="gifs/zero.gif";
  document.images[imgdest[imgcnt]].width=0;
  document.images[imgdest[imgcnt]].height=0;
  document.forms['replyform'].$parm_name.value=strs[imgcnt];
 }

 function cleanall() {
  var i;
  if(imgcnt<1) return;
  for(i=0; i<imgcnt; i++) {
   document.images[imgdest[i]].src="gifs/zero.gif";
   document.images[imgdest[i]].width=0;
   document.images[imgdest[i]].height=0;
  }
  document.forms['replyform'].$parm_name.value='';
  imgcnt=0;
 }
/*]]>*/
</script>

<p><input type="hidden" name="$parm_name">
!if $module_language=fr
  Composez votre réponse en cliquant sur les images ci-dessous.
  !goto cont
!endif

!if $module_language=nl
  Geef Uw antwoord door op de onderstaande plaatjes te klikken..
  !goto cont
!endif

  Compose your reply by clicking on the images below.
:cont
<p><table border="0" bgcolor="#C0C0F0"><tr><td nowrap>&nbsp;
!for i_=1 to $lenlimit
  <img border="0 "name="dest$i_" src="gifs/zero.gif" alt="zero" align="middle">
!next i_
<p>
!for i_=1 to $imgcnt
  !set src=!item $i_ of $Imgarr
  <a href="#" onclick="addone($i_-1)>"<img name="i$i_" align="middle"
   src="$src" alt="$src" border="1"></a>
!next i_
<a href="#" onclick="backone()"><img height=$font_height border=1 align="middle"
 src="gifs/arrows/left3.32.gif" alt="left"></a>
<a href="#" onclick="cleanall()"><img height=$font_height border=1 align="middle"
 src="gifs/reset.gif" alt="reset"></a>
</td></tr></table> <p>