<div dir="ltr">Petko,<div style>Does the $HTMLHeadFmt go into config.php or skin.tmpl?</div><div style><br></div><div style>I haven't used forms before in pmwiki, and I haven't created the custom markup yet, but I did try out something that got this function working. I will need to do what you described to have a clean look and feel, but the following hack shows that the basic function works. Here is what I experimented with.</div>
<div style><br></div><div style>In my skin.tmpl file for the blix skin, I inserted the following at the top of the file:</div><div style>1. I had these already in the file...</div><div style><div><!--HTMLHeader--></div>
<div></head></div><div><br></div><div style>2. I changed it to this...</div><div><div><!--HTMLHeader--></div><div><br></div><div><script language="JavaScript"></div><div>function point_it(event){</div>
<div>pos_x = event.offsetX?(event.offsetX):event.pageX-document.getElementById("myCanvas").offsetLeft;</div><div>pos_y = event.offsetY?(event.offsetY):event.pageY-document.getElementById("myCanvas").offsetTop;</div>
<div><br></div><div>document.pointform.form_x.value = pos_x;</div><div>document.pointform.form_y.value = pos_y;</div><div><br></div><div>var c=document.getElementById("myCanvas");</div><div>var ctx=c.getContext("2d");</div>
<div>ctx.strokeStyle="#FF0000";</div><div>ctx.clearRect(0,0,100,100);</div><div><br></div><div>ctx.fillStyle = 'rgba(255,100,100,.4)'; </div><div>ctx.fillRect(document.pointform.form_x.value-20,document.pointform.form_y.value-20,40,40);</div>
<div>}</div><div></script></div><div></head></div><div><br></div></div><div style>3. I already had this farther down the file...</div><div style><div><!--PageText--></div><div><!--markup:</div></div><div style>
<br></div><div style>4. I changed it to this...</div><div style><div><!--PageText--></div><div><br></div><div><form name="pointform" method="post"></div><div>You pointed on x = <input type="text" name="form_x" size="4" /> , and y = <input type="text" name="form_y" size="4" /></div>
<div></form> </div><div><br></div><div><canvas id="myCanvas" onclick="point_it(event)" width="100" height="100" style="border:1px solid #c3c3c3; background-image:url('/local--files/test3:23/flemish2.jpg');"></div>
<div>Your browser does not support the canvas element.</div><div></canvas></div><div><!--markup:</div><div><br></div></div><div style>5. I uploaded this modified skin.tmpl file to my server.</div><div style>6. When I click on the "canvas" image, it places a transparent colored square at the cursor position and sets the form text to the x and y coordinates of that were clicked. It works.</div>
<div style><br></div><div style>Too easy! I'm glad that I got this script working. Now to do the other steps you suggested.</div><div style>-Mark</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Jun 7, 2013 at 8:48 AM, Petko Yotov <span dir="ltr"><<a href="mailto:5ko@5ko.fr" target="_blank">5ko@5ko.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Petko Yotov writes:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To insert stuff in the HTML <head>...</head> section, add the stuff as an element to the $HTMLHeaderFmt, something like:<br>
<br>
$HTMHHeaderFmt['my-recipe'] = <<<EOF<br>
<script type="text/javascript"><br>
// your javascript here<br>
</script><br>
EOF;<br>
<br>
-or-<br>
<br>
$HTMHHeaderFmt['my-recipe'] = '<script type="text/javascript" src="$PubDirUrl/your-script.<u></u>js"></script>';<br>
</blockquote>
<br></div>
I now see I made a typo: it should be $HTMLHeaderFmt and NOT $HTMHHeaderFmt, see <a href="http://www.pmwiki.org/wiki/PmWiki/LayoutVariables#HTMLHeaderFmt" target="_blank">http://www.pmwiki.org/wiki/<u></u>PmWiki/LayoutVariables#<u></u>HTMLHeaderFmt</a><br>

<br>
Sorry.<div class="HOEnZb"><div class="h5"><br>
<br>
Petko<br>
<br>
<br>
______________________________<u></u>_________________<br>
pmwiki-users mailing list<br>
<a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a><br>
<a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/<u></u>mailman/listinfo/pmwiki-users</a><br>
</div></div></blockquote></div><br></div>