Enable CodeMirror
This is an open discussion with 39 replies, filed under Extensions.
Search
This seems like a cool extension - thanks oleae. However I can’t seem to get it to work (Safari and Firefox [OSX] tested). Aside form installing the extension, do I need to anything else?
Hmmm, same here. Something must be missing.
Enable CodeMirror
updated to version 1.1
on 1st of December 2009
With v1.1 I don’t see any code at all in the code textareas.
I disabled all extensions, and then it didn’t work for me as well.
I found out that i was only working when I had “Calendar Overlay” extension enabled. That extension enables jQuery, and enables the use of the $()-jQuery-function.
Now I I changed all “$()” to “jQuery()”. Installed it on a fresh Symphony installation now, and it seems to work.
Michael: Hm. Strange.. Witch browser are you using? I have tested in Chrome and Firefox.
An older release of the Calendar Overlay?
Yep, jQuery in the backend runs in noConflict
mode so the $
variable doesn’t represent the jQuery object in the global scope. Sounds like the Calendar Overlay is breaking the rule and adding the $
to the global scope itself.
If you want to use $
in your scripts you can define it within a closure and go from there:
jQuery(document).ready(function() { // now I'm out of the global scope $ = jQuery; $('body').addClass('kthxbi'); });
In version 1.1 I have used the jQyery object instead of $…
buzzomatic: Version 1.0.3 of the Calendar Overlay.
It was originally written before Symphony used jQuery, I released a new version yesterday that doesn’t include its own copy.
Synchronisation. Love it :)
The latest build works perfectly, thank you.
I am not sure why it doesn’t work for me. Maybe some incompatibilty with another extension. (I tried this on my test version of Symphony, which is rather “crowded”.)
I tried Safari and Firefox (latest versions) on the Mac.
I found the problem and will post it on the issue tracker.
Submitting issues seems to be broken, so I post it here:
The extension will break (and render textareas completely useless) if Symphony is running in a subdirectory (i.e. not in the webserver’s root directory).
The problem can be solved by replacing lines 11 and 12 of init.js
with the following:
stylesheet: Symphony.WEBSITE + "/extensions/codemirror/assets/css/xmlcolors.css", path: Symphony.WEBSITE + "/extensions/codemirror/assets/js/",
Sweet! Maybe you could combine it with my Enable Tabkey extension to, well, enable the tabkey in the editor. :-)
The tabkey works. It’s just different from what you might expect – it corrects line indendation to the “calculated value”. (I found this the codemirror docs. This behaviour may be changed, of course.)
As far as I see, codemirror’s indentation will always be “space”-based, not “tab”-based.
Enable CodeMirror
updated to version 1.2
on 1st of December 2009
Michael: Thanks for the solution. Uploaded a new release. I didn’t know about Symphony.WEBSITE. Is that documented?
Create an account or sign in to comment.
A new extension, “Enable CodeMirror” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.