
On Wed, 26 Apr 2017 10:41:54 +0100 Mark Crutch <markc@...2744...> wrote:
On Wed, Apr 26, 2017 at 4:44 AM, Steve Litt <slitt@...2357...> wrote:
File->Document_properties->Scripting_tab
I've looked all over the web and all through my help->user manual and can't find anything about this. For one thing, I need to know how to give an embedded script a human-friendly name. I also need to know what to put in the content: Is it Javascript, and how does it differ from html based Javascript.
Anyone know of any documentation on this? Theoretically, I could creat a very simple clickable map exclusively in <svg>, without the containing <html>.
I don't know of any documentation on this, but it is something I plan to eventually cover in my tutorial series in Full Circle Magazine (see inkscapeforum.com for links to the previous 60 instalments!).
I have put a file up on my website to show you the basics, though: http://peppertop.com/interactive.svg
If anybody is *at all* interested in interactive SVG, they should download, use, and completely examine the preceding link, both in Inkscape and in an editor. The preceding link is one of the best pieces of teaching content I've ever seen, and it's my business to create teaching content.
[snip]
- You don't really need to give the embedded script itself a
user-friendly name - it's the functions within it that you'll want to name well.
Nice! I *never* would have figured that out.
[snip]
- As well as File > Document Properties > Scripting you'll also want
to use the Interactivity section of the Object Properties dialog (from the context menu on an object in your drawing).
:-)
I knew that already, because I opened a Vim-created .svg, with onclick and onmouseover events, within Inkscape, and saw where my handlers showed.
[snip mechanics of teachable image]
I hope that helps.
More than you can ever imagine. So now I have another question:
Have you done SVG work in which data is sent to an http back end and the http back end sends messages that directly or indirectly change the state of objects in the SVG?
My eventual project will require back end work: It can't be front end only. If it were front-end only, it's likely I could do the *entire* thing in SVG using the techniques you demonstrated.
Is there anything like AJAX in SVG?
By the way, I have embedded <svg> content that interacts with <html> based javascript here:
http://troubleshooters.com/codecorn/clickmap/hello1.htm
But the preceding doesn't do anything to communicate with the back end.
SteveT
Steve Litt April 2017 featured book: Troubleshooting Techniques of the Successful Technologist http://www.troubleshooters.com/techniques