Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Ace mode svg results in error 404 #2

Open
bartbutenaers opened this issue Aug 17, 2019 · 2 comments
Open

Ace mode svg results in error 404 #2

bartbutenaers opened this issue Aug 17, 2019 · 2 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bartbutenaers
Copy link
Owner

bartbutenaers commented Aug 17, 2019

The SVG editor is an ACE editor, which is created similar like the Template-node does it:

this.editor = RED.editor.createEditor({
   id: 'node-input-svg-editor',
   mode: 'ace/mode/html',
   value: $("#node-input-svgString").val()
});

However the Template-node supports HTML mode, while my node should only support SVG mode.

I suppose it should be supported by looking at the language list, but when I use it I get an error 404. This indicates that the resource file doesn't exist in Node-RED...

image

@bartbutenaers bartbutenaers added bug Something isn't working help wanted Extra attention is needed labels Aug 17, 2019
@bartbutenaers bartbutenaers self-assigned this Aug 17, 2019
@bartbutenaers
Copy link
Owner Author

bartbutenaers commented Sep 6, 2019

So we should use 'svg' instead of 'html' here:

this.editor = RED.editor.createEditor({
    id: 'node-input-svg-source',
    mode: 'ace/mode/html',
    value: $("#node-input-svgString").val()
});

And I think we have to remove this code snippet (which currently gives the error):

RED.library.create({
    url:"uitemplates", // where to get the data from
    type:"ui_template", // the type of object the library is for
    editor:this.editor, // the field name the main text body goes to
    mode:"ace/mode/svg",
    fields:['name']
});

@bartbutenaers
Copy link
Owner Author

As you can see in this discussion, SVG should be supported starting from Node-RED 1.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant