Rev 14009 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !if $wims_read_parm=$empty |
13384 | bpr | 2 | !exit |
20 | reyssat | 3 | !endif |
4 | !if $wims_read_parm=help |
||
3298 | bpr | 5 | !read help/$lang/special/imagefill.phtml |
6 | !exit |
||
150 | bpr | 7 | !endif |
3298 | bpr | 8 | |
6574 | bpr | 9 | !set parm=!replace internal $ $, by , in $wims_read_parm |
10 | !set parm=!replace internal $ $ by $ ; $ in $parm |
||
20 | reyssat | 11 | !set parm1=!row 1 of $parm |
6151 | bpr | 12 | |
20 | reyssat | 13 | !distribute items $parm1 into imgurl,bigsize,smallsize |
6574 | bpr | 14 | |
20 | reyssat | 15 | !set bigsize=!translate x, to $ $ in $bigsize |
6574 | bpr | 16 | |
20 | reyssat | 17 | !distribute words $bigsize into bigsizex,bigsizey |
18 | !set ssize=!translate x, to $ $ in $smallsize |
||
19 | !distribute words $ssize into ssizex,ssizey |
||
20 | !set parm2=!row 2 to -1 of $parm |
||
21 | !set parm2=!nonempty rows $parm2 |
||
22 | !set icnt=!rowcnt $parm2 |
||
23 | |||
24 | !if $printing=yes or $cmd=hint |
||
17176 | bpr | 25 | <img src="$imgurl" alt="$imgurl" style="width:$(bigsizex)px;height:$(bigsizey)px;vertical-align:text-top"> |
13884 | bpr | 26 | !set t__=!column 1 of $parm2 |
27 | !set t__=!text select 0123456789, in $t__ |
||
14009 | bpr | 28 | !set tmp=!lines2items $(Rg$iii) |
13884 | bpr | 29 | !set t__=!itemcnt $t__ |
30 | !set t__=!shuffle $t__ |
||
31 | !set tmp=$($tmp[$t__]) |
||
32 | !set tmp=!nonempty items $tmp |
||
33 | <div> |
||
34 | !replace internal , by </div>$ $<div class="drag_label" style="display:inline-block;"> \ |
||
35 | in <div class="drag_label" style="display:inline-block;">$tmp</div> |
||
36 | </div> |
||
37 | !reset tmp |
||
13384 | bpr | 38 | !exit |
20 | reyssat | 39 | !endif |
40 | |||
41 | !set fill_reposition=yes |
||
42 | !reset flist hlist |
||
43 | !default fillcnt=0 |
||
44 | !set oldfillcnt=$[$fillcnt+1] |
||
45 | !for t=1 to $icnt |
||
13384 | bpr | 46 | !set l=!row $t of $parm2 |
47 | !set l=!translate x to , in $l |
||
48 | !distribute item $l into n_,x_,y_,sizei |
||
49 | !default sizei=1 |
||
50 | !set n_=!text select 0123456789()+-*/ in $n_ |
||
51 | !set n_=$[$n_] |
||
52 | !bound n_ between integer 1 and 100 default $ |
||
53 | !if $n_!=$empty and r$n_ notitemof $embedded and\ |
||
54 | $(replytype$n_) iswordof clickfill dragfill |
||
55 | !default wims_fill_type=$(replytype$n_) |
||
56 | !set embedded=!append item r$n_ to $embedded |
||
57 | !set flist=!append item $n_ to $flist |
||
58 | !set i=$n_ |
||
59 | !set inputsize=$smallsize $sizei |
||
60 | !read anstype/fill.inc noshow |
||
17176 | bpr | 61 | !set hlist=$hlist<input type="hidden" name="reply$n_" value=""> |
13384 | bpr | 62 | !set fill_namelist=!append item $oldfillcnt to $fill_namelist |
63 | !increase fillcnt |
||
64 | !set serial_$fillcnt=$i |
||
65 | !set reposition_$fillcnt=$x_,$y_ |
||
66 | !endif |
||
20 | reyssat | 67 | !next t |
68 | |||
6262 | bpr | 69 | <a id="fill$oldfillcnt"><img src="gifs/transparent.gif" alt="transparent" |
17176 | bpr | 70 | style="width:$(bigsizex)px; height:$(bigsizey)px;vertical-align:text-top"></a> |
20 | reyssat | 71 | !set thisjs=var f_bigimage$oldfillcnt=new DynLayer();\ |
1157 | bpr | 72 | f_bigimage$oldfillcnt.setAnchor({topA:'fill$oldfillcnt',leftA:'fill$oldfillcnt',\ |
20 | reyssat | 73 | stretchH:$bigsizex,stretchV:$bigsizey});\ |
74 | dynapi.document.addChild(f_bigimage$oldfillcnt);\ |
||
17176 | bpr | 75 | f_bigimage$oldfillcnt.setHTML('<img src="$imgurl" style="width:$(bigsizex)px; height:$(bigsizey)px" alt="">'); |
20 | reyssat | 76 | !if $q_form=yes |
13384 | bpr | 77 | $hlist |
78 | !set fillafter_js=$fillafter_js\ |
||
20 | reyssat | 79 | $thisjs |
80 | !else |
||
13384 | bpr | 81 | !distribute item 40C040,FF4040 into colorr_good,colorr_bad |
82 | !set colorr_ana=C8C8E0 |
||
83 | !distribute item 20,15 into Sx,Sy |
||
84 | !set cc1='<table border="0" cellpadding="0" cellspacing="0" style="width:$(ssizex)px;height:$(ssizey)px"><tr><td align="center">' |
||
85 | !set cc2='<\/td><\/tr><\/table>' |
||
86 | !set wims_ins_alt=none |
||
87 | !read js/dynapi3.phtml |
||
88 | <script type="text/javascript"> |
||
89 | /*<![CDATA[*/ |
||
90 | dynapi.onLoad(function() { |
||
91 | $thisjs |
||
92 | !for c=$oldfillcnt to $fillcnt |
||
93 | !set i=$(serial_$c) |
||
94 | !set embcnt=!positionof item r$i in $embedded |
||
95 | !default reply_$i=$(reply$i) |
||
96 | !set p_=$(reply_$i) |
||
97 | !set tt=!word 1 of $(replygood$i) |
||
98 | !if $tt!=?analyze |
||
99 | !set cl=#$(colorr_$(diareply$i)) |
||
100 | !else |
||
101 | !if transparent iswordof $wims_fill_option |
||
102 | !set cl= |
||
103 | !else |
||
104 | !set cl=#$colorr_ana |
||
105 | !endif |
||
106 | !set embedded_analyze=!append item $i to $embedded_analyze |
||
107 | !!!set embedded_bracket=$embedded_bracket [$embcnt] |
||
108 | !endif |
||
109 | !set replyname$i=[$embcnt] |
||
110 | !distribute item $(reposition_$c) into rx,ry |
||
111 | var f_l$c=new DynLayer(); |
||
112 | var f_t$c=new DynLayer(); |
||
113 | f_l$c.setAnchor({topA:'fill$oldfillcnt',leftA:'fill$oldfillcnt', |
||
114 | left:$rx,top:$ry,stretchH:$sizei*$ssizex,stretchV:$ssizey}); |
||
115 | dynapi.document.addChild(f_l$c); |
||
116 | f_l$c.setBgColor('$cl'); |
||
117 | !set ss=!replace internal " by \" in $(reply$i) |
||
118 | !set ss=!replace internal , by in $(reply$i) |
||
119 | !set ss=!replace internal ' by \' in $ss |
||
120 | f_l$c.setHTML($cc1+'$ss'+$cc2); |
||
121 | !if $tt!=?analyze |
||
122 | f_t$c.setAnchor({topA:'fill$oldfillcnt',leftA:'fill$oldfillcnt', |
||
123 | left:$[$rx+$ssizex-4],top:$ry,stretchH:$Sx,stretchV:$Sy}); |
||
124 | dynapi.document.addChild(f_t$c); |
||
125 | f_t$c.setHTML('<small>[$embcnt]<\/small>'); |
||
126 | f_t$c.setZIndex(100); |
||
127 | !endif |
||
128 | !next c |
||
129 | }); |
||
130 | /*]]>*/ |
||
131 | </script> |
||
20 | reyssat | 132 | !endif |