David's made the following suggestion:

This is untested so no guarantees, but you can try this:  In
AsvgHA.js
(or ASCIIsvgHA.js) drawPics, replace

var sscr = picture.getAttribute("sscr");
          if ((sscr != null) && (sscr != "")) {
                  try {
                          if (isIE) {
                                  parseShortScript(sscr);
                                  //names the SVG so it can identify
itself onclick
                                  picture.window.setname(picture.id);
                          }
                  } catch (e) {}
          }


with


var sscr = picture.getAttribute("sscr");
var src = picture.getAttribute("script");


          if ((sscr != null) && (sscr != "")) {
                  try {
                          if (isIE) {
                                  parseShortScript(sscr);
                                  //names the SVG so it can identify
itself onclick
                                  picture.window.setname(picture.id);
                          }
                  } catch (e) {}
          } else  if ((src!=null) && (src != "")) {
                          try {
                             if (isIE) {
                                  with (Math) eval(src);
                                  picture.window.setname(picture.id);
                             }
                          } catch(err) {alert(err+"\n"+src)}
                  }

Kevin



On Oct 28, 12:18 pm, kilucas <[EMAIL PROTECTED]> wrote:
> I posted some informatiuon about this in the ASCIIMath Google group
> where David Lippman and Peter Jipsen, who were both instrumental in
> producing the mathematical version of HTMLArea are posting. David got
> back to me to suggest there's a bug inASCIIsvgwhich is causing the
> problem.
>
> I've copied my posting and his reply here (my apologies if that breaks
> any form of etiquette) and will see if I can rectify the problem
> myself although I'm not that handy with code and this may defeat me.
> Maybe someone better skilled might know how to fix this without too
> much effort.
>
> Bram: Presumably it'd be good to incorporate any solution we find into
> your package.
>
> Here's my posting, then David's reply:
>
> Kevin
> I'm using ASCIIMathML andASCIIsvgwith HTMLArea in TiddlyWiki. The
> implementation I have 
> fromhttp://sourceforge.net/project/showfiles.php?group_id=150646&package_...
> invokes a window (called the Equation Grapher Control Panel) in which
> I can specifiy graph parameters to create SVG graphs. But theASCIIsvg
> home page suggests I might also be able to form my own drawings by
> embedding some material in web pages.
>
> By pasting examples similar those on theASCIIsvghome page into the
> raw html viewer of HTMLArea available via a toolbar button I've got
> my
> browser to recognise that an svg object is to be rendered (the right
> mouse menu is appropriate to SVG) but myASCIIsvgcode isn't
> generating a drawing.
>
> My latest simple example is the following which amounts to an entire
> Tiddlywiki tiddler:
>
> <p>Start text</p><embed src="HTMLArea\Plugins\AsciiSvg\d.svg"
> script="initPicture(-2,2,-2,2);axes();line([-2,-2],[2,2]);" /><p /
>
> ><p>End text</p>
>
> (The instructions on theASCIIsvghome page say that the script
> delimiters should be single quotes but the HTMLArea editor converts
> them to double quotes even when I manually change them back).
>
> When I display the resultant page I get an empty SVG area surrounded
> by my start and end text and sometimes get a dialog box saying only
> "undefined" though it doesn't make clear what is undefined.
>
> When I compare the html here with the html generated by the Equation
> Grapher Control Panel wiindow the latter uses an sscr attribute to
> specific the graph I think but I can't find out what the sscr element
> is. And in any case it doesn't seem to be part of theASCIIsvg
> vocabulary as far as I can tell.
>
> I tried the same material in an ASciencePad tiddler but had no
> further
> success there.
>
> So does anyone here know if I should be able to specify my own
> drawings in the TiddlyWiki/HTMLAea environment and if so how I'd
> speciify them so that they draw completely please?
>
> David:
> The sscr attribute is a "short script" that is the abbreviated format
> used by the Equation Grapher Control Panel.
>
> When I wrote theASCIIsvgplugin for HTMLArea, there were two files
> in
> addition toASCIIsvg.js:  AsvgHA.js (or ASCIIsvgHA.js) and
> ASCIIsvgAddon.js.  The former is used in the editor window itself;
> the
> latter is intended to be included in the output.
>
> Looking at it, it appears that I stripped the "script" attribute
> handling out of AsvgHA.js (in the drawPics function).  Not sure
> exactly why.  The handling is still in ASCIIsvgAddon.js, so it should
> be possible to add it in to AsvgHA.js.
>
> ----------------------------
>
> On 27 Oct, 18:17, kilucas <[EMAIL PROTECTED]> wrote:
>
>
>
> > I've made limited progress. My browser now recognmises that I'm trying
> > to display an SVG picture but doesn't actually draw the picture I
> > intend. Here's what I've done and what I'm thinking of trying next.
>
> > I've inserted the <embed statement while editing the html (an option
> > provided by the HTMLArea editor). This seems to recognise the "<" sign
> > much better than when I placed the <embed statement in the wysiwyg
> > editor itself. (A look at the genereated html for the whole TW when
> > the tiddler was on display showed "embed .. preceded by "lt" when I
> > pasted the <embed statement into the wysiwyg part of the editor rather
> > than "&lt" which was generated by theASCIISvggrapher.
>
> > Once I set HTMLArea to show me the html and pasted the <embed
> > statement there, I could no longer see that part of the statement when
> > viewing the tiddler instead of seeing all the code I'd pasted in.
> > Guessing this meant that the embed statement was being acted upon
> > instead of merely redisplayed as code, this seemed to be a little
> > progress.
>
> > I now also see an area in the displayed tiddler which my browser
> > clearly thinks is an SVG area because a right click in IE6 offers SVG
> > menu options.
>
> > The recomended code at theASCIISvgweb site includes a reference to a
> > file called "d.svg". In HTMLArea this is located at "HTMLArea\plugins
> > \AsciiSvg\d.svg" so I edited the HTML to reflect this longer relative
> > path. This made no practical difference that I can see so I'm simply
> > guessing it's correct.
>
> > I had a further problem with the raw html editor within HTMLArea. It
> > seems to change the script delimiters from the single quotes that I
> > pasted in to double quotes. As I was initially trialling anASCIISvg
> > script that contained parameters demarcated by double quotes I guessed
> > there'd be confusion about nested double quotes and therefore trialled
> > a script that contained no other double quotes to avoid confusion.
> > Currently I'm trying a tiddler for which HTMLArea shows the the
> > following html:
>
> > <p>Start text</p><embed src="HTMLArea\Plugins\AsciiSvg\d.svg"
> > script="initPicture(-2,2,-2,2);axes();line([-2,-2],[2,2]);" /><p /
>
> > ><p>End text</p>.
>
> > Although an SVG area is displayed by my browser now, I'm still not
> > seeing the desired drawing.
>
> > 1) I've tried placing width and height paramenetsr after the "embed"
> > word but these get stripped out by the editor - I'm not sure why.
>
> > 2) I don't see the line drawn as requested by the code or even the
> > axes that should appear. I do get a dialog box merely saying
> > "undefined" a few times before I clear it. I don't yet know how to fix
> > this and don't yet know if this is clue to the failed drawing or
> > whether it relates to something else.
>
> > I've compared the generated html for the whole TW to the code
> > generated by theASCIISvggraphing window available inside HTMLArea
> > and that contains an ssrc statement that I've not seen in anyASCIIsvg
> > coding. I'm currently guessing that the graphing window is therefore
> > generating SVG code rather thanASCIISvgcode and that my problem lies
> > in gettingASCIISVGcode recognised.
>
> > I'll explore how to insert SVG code in my html to see if that draws
> > lines correctly. If SVG code works butASCIISvgdoes not, this might
> > support the view that my problem lies inASCIIsvgcode recognition.
> > (I'd also be puzzled whyASCIISvgis present with this version of
> > HTMLArea since, to my limited understanding, it'd suggest that
> >ASCIISvgisn't actually used anywhere in the grapher).
>
> > But if anyone already spots why my graph still won't draw even though
> > I'm now at least invoking the SVG viewer, I'd be delighted to hear
> > from you as I admit that I feel I'm groping in the dark a little at
> > present.
>
> > Thanks
>
> > Kevin
>
> > On Oct 19, 1:13 pm, kilucas <[EMAIL PROTECTED]> wrote:
>
> > > Interesting. I tried the <embed etc material in Firefox too but still
> > > only saw the script. That's almost a relief anyway because my Firefox
> > > objectes to pasting into a tiddler because of security problem that I
> > > haven't been able to fix yet, but pasting example SVG code is much
> > > faster and less error prone than retyping it by hand.
>
> > > I tried placing d.svg adjacent to the TW and even an extra copy of the
> > > originalASCIIsvg.js there although the header markup wouldn't have
> > > known about the latter and neither made any difference.
>
> > > It's such a shame because the drawing facilities are so useful as well
> > > as the graphing facilities. And, presuming that the graphing
> > > facilities invoke the drawing facilities anyway, I feel drawing by
> > > providing theASCIIsvgcode must somehow be possible.
>
> > > For now I'm using a separate web page to draw my images and am using
> > > SnagIt to take a screenshot of the drawing which I then place in the
> > > tiddler as an image. This admittedly has the advantage that it can be
> > > viewed by anyone with IE but without the SVGViewer but my pages
> > > typically include mathematical notation via ASCIIMathML so they need
> > > the MathPlayer anyway. AQnd I couldn't reasonably expect any other
> > > user of my TW's to do this.
>
> > > And I can't render dynamic images using screenshots as I could
> > > theoretically withASCIIsvg.
>
> > > So I'll keep thinking about this to see if I can find some way to 
> > > getASCIIsvgcode invoked. And I didn't realise there's a plugin to store
> > > images in TWs - I'm holding mine in an Images folder alongside but
> > > this reduces portability I feel. So I'll explore that too - thanks for
> > > the tip.
>
> > > Kevin
>
> > > On Oct 19, 1:01 pm, okido <[EMAIL PROTECTED]> wrote:
>
> > > > Hi Kevin,
>
> > > > I had the same problems with IE and ACIIsvg and I abandoned graphics
> > > > for that reason.
> > > > However there is still a concept that I would like to try and that I
> > > > used long time ago when I was still working on my CP/m system.
> > > > At that time I constructed graphs directly in video memory, this
> > > > worked fine.
> > > > Something similar could be done by dynamically altering an image that
> > > > is stored in a tiddler.
> > > > There is a plugin for storing images in tiddlers available.
> > > > At least this would solve IE problems I think.
> > > > Maybe there are some programmers out there how would like to pick up
> > > > this concept.
>
> > > > Have a nice day, Okido
>
> > > > On 17 Oct, 20:32, kilucas <[EMAIL PROTECTED]> wrote:
>
> > > > > Okido
>
> > > > > Thanks for- Hide quoted text -
>
> - Show quoted text -...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to TiddlyWiki@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to