Jump to content

draw.io javascript not fully functional


Recommended Posts

Hi all

I'm trying to integrate draw.io in to my solution via the web viewer. I have much to learn as I have new to javascript. I have managed to get it to execute a filemaker script though.

My first real issue is that it does not seem to work fully in the webviewer.

I've downloaded these files https://github.com/jgraph/drawio-integration

I can open localfile.html in my usual browser and it works fine. However within FileMaker's web viewer it does open (the url is "data:text/html," & [global field containing source code of localfile.html]), but functionality is limited. I can't add any shapes to the canvas for example.

Any help appreciated.

Thank you!

Link to post
Share on other sites
  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

I am still in v.18. According to the help for the Perform JavaScript in Web Viewer[] script step:   And here you will find similar constraints for the opposite direction:    

I've just realised that the problem occurs regardles of whether I integrate the modified html files.

So if I point the webviewer to www.draw.io (or https://app.diagrams.net/), I still get an unresponsive website.

Link to post
Share on other sites
2 hours ago, sal88 said:

if I point the webviewer to www.draw.io (or https://app.diagrams.net/), I still get an unresponsive website.

I cannot reproduce your problem. I set my web viewer to "https://app.diagrams.net" and it seems to function just fine. Perhaps it's a Windows issue (I am on a Mac)?

 

Link to post
Share on other sites

Hey comment

It also works on our (only) mac but none of our Windows PCs :(

Thanks

Link to post
Share on other sites

That would be because there is something in their implementation that is not compatible with IE <whatever version of IE that FM on Windows now uses for the web viewer>

Remember that the web viewer is not a full-featured browser.

Link to post
Share on other sites
Posted (edited)

Is there a way to isolate which element is causing the issue (I'm not sure what I'd do with that information tbh). I'm experiencing limited functionality from a search feature I'm trying to implement also (attached).

The Javascript developers i've approached have been reluctant to help as they are not familiar with FileMaker. If I could tell them exactly which browser it uses then that would help. I've implemented this script:

https://codepen.io/gapcode/pen/vEJNZN

Which tells me the FileMaker browser is IE 11. This make sense as my search script does not work if I load it in IE 11. However https://app.diagrams.net/ does work in IE 11.

To be exact though, my IE11 browser returns:
"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Zoom 3.6.0; rv:11.0) like Gecko"

and FM Web viewer returns:
"Mozilla/5.0 (Windows NT 6.2; Win64; x64; Trident/7.0; rv:11.0) like Gecko"

So it's possible FM Webviewer is a slightly different version of IE 11?

search.htm

Edited by sal88
Link to post
Share on other sites
17 minutes ago, sal88 said:

So it's possible FM Webviewer is a slightly different version of IE 11?

 

Not a different version, but a different implementation of the IE11 engine.  That's what I meant with the my statement that the web viewer is not a full browser.

Link to post
Share on other sites

My javascript developer managed to get the search feature working in IE11...and it works in FM too. I guess I'll have to wait for the anticipated updates to the web viewer (as per recent JS functions discussion on thecontextpodcast.com) for draw.io.

Link to post
Share on other sites
  • 3 weeks later...

I've just discovered that the webviewer in webdirect appears to have full (or at least more) javascript functionality :).

Link to post
Share on other sites
10 minutes ago, sal88 said:

the webviewer in webdirect appears to have full (or at least more) javascript functionality

There is no "web viewer" as such in WebDirect. The web viewer code is executed in an iframe - so naturally the functionality is dictated by the user's browser.

 

Link to post
Share on other sites

I see. As far as I can tell the Perform JavaScript in Web Viewer and FileMaker.PerformScript still work as they would in FM Pro. Is that correct?

Thanks

Link to post
Share on other sites

I am still in v.18. According to the help for the Perform JavaScript in Web Viewer[] script step:

 

Quote

 

In FileMaker WebDirect:

This script step works only if the web viewer’s webpage has the same origin as the FileMaker WebDirect webpage. See Scripting with JavaScript in web viewers.

The user can’t click a web viewer to give it the focus. Therefore, you must specify the Object Name option or use the Go to Object script step first; otherwise, this script step will return an error.

 

And here you will find similar constraints for the opposite direction:

 

Quote

 

Because FileMaker WebDirect is subject to a same-origin policy in web browsers for security, JavaScript in a web viewer and FileMaker scripts can call each other only if the web viewer’s webpage has the same origin as the FileMaker WebDirect webpage. (A webpage’s origin is its URL scheme, host name, and port.)

In FileMaker WebDirect, the HTML specified for the web viewer must begin with "data:text/html," as shown in the example above. Otherwise, the call to the FileMaker.PerformScript() function fails.

 

 

 

  • Thanks 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.