CodeMirror Themes


#1

Are there any plan to support CodeMirror themes besides eclipse in the future for the AE editor?

Any advice on where to start looking if I wanted to implement one?


#2

Hey,
I’m not aware of any such plans now (I assume by support, you mean an ability to switch between themes in the UI?).

However, in manageiq-ui-classic

app/assets/javascripts/miq_application.js
1320:    theme: 'eclipse',

app/assets/stylesheets/application.css
17: *= require codemirror/theme/eclipse

If the theme you’d like to use already lives in vendor/assets/bower_components/codemirror/theme/, switching the theme should really be as easy as changing those 2 strings :slight_smile: .

Hope it helps!


#3

Yes selectable themes is what I meant.
Thanks for pointing me in the right direction!

Sometimes it’s daunting to sift through all those includes.


#4

Aah, any time :slight_smile:

To add to that, if you’re working on a UI to switch the default theme, it should be available from My Settingsapp/views/configuration/_ui_1.html.haml would be the haml to add the select to. (And you should be able to find a way to save that to the user’s settings in that code…)


#5

Not having edited any of the application files before, I’m wondering if I would have to rebuild or recompile anything after making changes to any of these files.


#6

If you’re running in development mode, no need to do anything :).

If you’re running on an appliance however, you would need to do rake evm:compile:assets and rake evm:restart after every change…


#7

Great, thanks for the info. I’m working with a CloudForms Appliance.


#8

Worked like a charm :grinning:

The command is actually rake evm:assets:compile if I recall correctly.
Had a slight issue when there wasn’t enough space on the logical volume to compile, but rake assets:clean[1] took care of that.