Revision a265235e
Added by Walden Raines over 8 years ago
app/assets/javascripts/editor.js | ||
---|---|---|
Editor.setKeyboardHandler(keybindings[$("#keybinding")[0].selectedIndex]);
|
||
}
|
||
|
||
function set_mode () {
|
||
function set_mode (mode) {
|
||
var session = Editor.getSession();
|
||
var modes = [
|
||
"ace/mode/text",
|
||
... | ... | |
"ace/mode/yaml"
|
||
];
|
||
|
||
session.setMode(modes[$("#mode")[0].selectedIndex]);
|
||
if (mode) {
|
||
if (modes.indexOf(mode) >= 0 ) {
|
||
$("#mode").val(mode.replace('ace/mode/', ''));
|
||
}
|
||
} else {
|
||
mode = modes[$("#mode")[0].selectedIndex];
|
||
}
|
||
|
||
session.setMode(mode);
|
||
}
|
||
|
||
function editor_file_source(evt){
|
||
... | ... | |
Editor = ace.edit(editorId);
|
||
Editor.setShowPrintMargin(false);
|
||
Editor.renderer.setShowGutter(false);
|
||
set_mode('ace/mode/ruby');
|
||
$(document).on('resize', editorId, function(){Editor.resize()});
|
||
if ($editorSource.is(':disabled')) {
|
||
Editor.setReadOnly(true);
|
Also available in: Unified diff
Fixes #11688: default text editor to ruby.
Instead of defaulting to text, default to ruby syntax highlighting.
http://projects.theforeman.org/issues/11688