'Highlight current line' & 'Display line numbers' options in admin editor
This commit is contained in:
@@ -136,6 +136,13 @@ function update_editor(preferences) {
|
||||
editor.setOption("indentUnit", parseInt(preferences.tabwidth));
|
||||
editor.setOption("tabSize", parseInt(preferences.tabwidth));
|
||||
editor.setOption("indentWithTabs", (preferences.indentwithtabs === 'true'));
|
||||
if (preferences.linenumbers === 'true') {
|
||||
gutters = editor.getOption("gutters");
|
||||
gutters.splice(0, 0, 'CodeMirror-linenumbers');
|
||||
editor.setOption("gutter", gutters);
|
||||
}
|
||||
editor.setOption("lineNumbers", (preferences.linenumbers === 'true'));
|
||||
editor.setOption("styleActiveLine", (preferences.highlightline === 'true'));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -47,11 +47,11 @@
|
||||
{{else:}}
|
||||
mode: { name: '{{=filetype}}'{{if filetype=='python':}},version: 2,singleLineStringErrors: false, {{pass}} },
|
||||
{{pass}}
|
||||
lineNumbers: true,
|
||||
lineNumbers: {{=editor_settings['linenumbers']}},
|
||||
indentUnit: {{=editor_settings['tabwidth']}},
|
||||
indentWithTabs: {{=editor_settings['indentwithtabs']}},
|
||||
tabSize: {{=editor_settings['tabwidth']}},
|
||||
styleActiveLine: true,
|
||||
styleActiveLine: {{=editor_settings['highlightline']}},
|
||||
autoCloseTags: {{=editor_settings['closetag']}},
|
||||
theme: "{{=editor_settings['theme']}}",
|
||||
lineWrapping: true,
|
||||
|
||||
@@ -26,13 +26,21 @@
|
||||
<div class="controls">{{=stateWidget("codefolding", value=editor_settings['codefolding'])}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="codefolding">{{=T('Tab width (# characters)')}}</label>
|
||||
<label class="control-label" for="tabwidth">{{=T('Tab width (# characters)')}}</label>
|
||||
<div class="controls">{{=SELECT(range(1,9, 1), value=editor_settings['tabwidth'], _name="tabwidth" )}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="codefolding">{{=T('Indent with tabs')}}</label>
|
||||
<label class="control-label" for="indentwithtabs">{{=T('Indent with tabs')}}</label>
|
||||
<div class="controls">{{=stateWidget("indentwithtabs", value=editor_settings['indentwithtabs'])}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="linenumbers">{{=T('Display line numbers')}}</label>
|
||||
<div class="controls">{{=stateWidget("linenumbers", value=editor_settings['linenumbers'])}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="highlightline">{{=T('Highlight current line')}}</label>
|
||||
<div class="controls">{{=stateWidget("highlightline", value=editor_settings['highlightline'])}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls"><button type="submit" class="disabled btn btn-primary">{{=T('Save')}}</button></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user