ghbore / flowchartjs

Flowchart Plugin for Dokuwiki
5 stars 4 forks source link

wrong url for style #10

Closed IngvarElmer closed 3 years ago

IngvarElmer commented 3 years ago

Thanks for a supernice plugin! I had to make a small edit to it to make it work for me though.

I installed the flowchartjs plugin on Synology Diskstation. Tried your example, and got no styles on diagram (no fills, uniform std font, all black lines). On inspection it turns out I have a 404: Failed to load resource: the server responded with a status of 404 (Not Found).

It tries to access http://mytestsite:9000/lib/plugins/flowchartjs/styles/default.json (9000 is a redirect port I'm using)

this requested URL does indeed not exist on my server.

So I go into your script.js and I find what loads the style:

function draw1style (style, callback){ jQuery.ajax('/lib/plugins/flowchartjs/styles/' + style + '.json', {dataType: 'json'}) .done(function(d){ callback(d); }) .fail(function(j, s, e){ callback(null); }); }

I remove the initial slash in the ajax call URL so I now have: ... jQuery.ajax('lib/plugins/flowchartjs/styles/' + style + '.json', {dataType: 'json'}) ...

And now it works like a charm.

I have no idea if or how the current script works on other platforms, but I am absolutely no expert.

Anyway, thought you should know.

regards

Ingvar

ghbore commented 3 years ago

Hi @IngvarElmer, thank you for your issue. I have fixed this bug and updated a new version. I tested and it works. Hope it works for you.