I want to embed small fragments of music notation on my web pages. I want to be able to update and edit these regularly, so I'd prefer to not create and upload images, so I found a Javascript library that does exactly what I need:

However...when I update the HTML with the above, and save it in the editor, the above HTML gets saved. I load the resulting page in a seperate browser and it works perfectly. However, the CMSimple editor loads the page HTML and tries to execute the js. Something goes wrong and some dummy/error text is written, and so I no longer have access to the code I originally wrote.

Is it possible to dissuade the editor from trying to run the library somehow?

For what it's worth, I do not need a WYSIWYG editor and would be quite happy with a textbox to just edit the HTML. I see it is possible to disable the tinymce plugin - is this safe to do or will it simply cause me more problems?

Interesting. I have not been aware that there is a standard textual musical notation (and there seem to be even several). Thanks.

Calum wrote:However, the CMSimple editor loads the page HTML and tries to execute the js. Something goes wrong and some dummy/error text is written, and so I no longer have access to the code I originally wrote.

Well, a simple solution might be to include the JavaScript library only in view mode, but not in edit mode:

Calum wrote:Firstly, when I edit the HTML the editor starts messing around with the code, so the above gets saved as this:
[...]
I can get round it using <pre> tags and including an HTML comment to get a new line (the X:0 must be on a newline):
[...]
This works, and I can live with this.

However, personally I would prefer a PHP based solution, because not everybody has JavaScript available/enabled. I couldn't find a readily available script, though.

PS:

Calum wrote:For what it's worth, I do not need a WYSIWYG editor and would be quite happy with a textbox to just edit the HTML. I see it is possible to disable the tinymce plugin - is this safe to do or will it simply cause me more problems?

No, that is supposed to work fine -- just leave Editor -> External blank in the CMS configuration. There is also Codeeditor_XH which offers some advanced features for editing the HTML directly (I'm using it myself), but it requires CMSimple_XH 1.6+.

Thank you VERY much. You have solved my problem(s) entirely, much appreciated. I had not even realised there was a distinction between CMSimple and CMSimple_XH...

cmb wrote:I have not been aware that there is a standard textual musical notation

Yes, there are a few. This one, abc, is very good for simple Western music, especially folk music (and, crucially, bagpipe music!), and is used by several different tools. Lilypond is another option for more complex scores and has very good output as well.

Well, a simple solution might be to include the JavaScript library only in view mode, but not in edit mode:

This solved my problem entirely. If I run into formatting problems I will disable TinyMCE and just work with the HTML but it all looks good Many thanks again.

Calum wrote:Thank you VERY much. You have solved my problem(s) entirely, much appreciated.

Fine.

Calum wrote:I had not even realised there was a distinction between CMSimple and CMSimple_XH...

Well, there is, and there's an even greater distinction between CMSimple >= 4.0.0 and < 4.0.0. It's a long story...

Calum wrote:Yes, there are a few. This one, abc, is very good for simple Western music, especially folk music (and, crucially, bagpipe music!), and is used by several different tools. Lilypond is another option for more complex scores and has very good output as well.