2014-06-11 11:19:26 +00:00
|
|
|
$(document).ready(function(){
|
|
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
var editorEl = $('#editorpreferencesCodeeditor'),
|
2014-06-11 12:18:46 +00:00
|
|
|
editor = editorEl.codeEditor('getEditorObject'),
|
|
|
|
|
session = editor.getSession(),
|
|
|
|
|
renderer = editor.renderer
|
2014-06-11 11:19:26 +00:00
|
|
|
|
2014-06-11 12:18:46 +00:00
|
|
|
editorEl.height($('#editorSettingsForm').height() - 23)
|
2014-06-11 11:19:26 +00:00
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
$('#Form-field-EditorPreferences-theme').on('change', function(){
|
2014-06-11 12:18:46 +00:00
|
|
|
editorEl.codeEditor('setTheme', $(this).val())
|
2014-06-11 11:19:26 +00:00
|
|
|
})
|
2014-06-11 12:18:46 +00:00
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
$('#Form-field-EditorPreferences-font_size').on('change', function(){
|
2014-06-11 12:18:46 +00:00
|
|
|
editor.setFontSize(parseInt($(this).val()))
|
|
|
|
|
})
|
|
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
$('#Form-field-EditorPreferences-word_wrap').on('change', function(){
|
2014-06-12 08:29:12 +00:00
|
|
|
editorEl.codeEditor('setWordWrap', $(this).val())
|
2014-06-11 12:18:46 +00:00
|
|
|
})
|
|
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
$('#Form-field-EditorPreferences-code_folding').on('change', function(){
|
2014-06-11 12:18:46 +00:00
|
|
|
session.setFoldStyle($(this).val())
|
|
|
|
|
})
|
|
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
$('#Form-field-EditorPreferences-tab_size').on('change', function(){
|
2014-06-11 12:18:46 +00:00
|
|
|
session.setTabSize($(this).val())
|
|
|
|
|
})
|
|
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
$('#Form-field-EditorPreferences-show_invisibles').on('change', function(){
|
2014-06-11 12:18:46 +00:00
|
|
|
editor.setShowInvisibles($(this).is(':checked'))
|
|
|
|
|
})
|
|
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
$('#Form-field-EditorPreferences-highlight_active_line').on('change', function(){
|
2014-06-11 12:18:46 +00:00
|
|
|
editor.setHighlightActiveLine($(this).is(':checked'))
|
|
|
|
|
})
|
|
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
$('#Form-field-EditorPreferences-use_hard_tabs').on('change', function(){
|
2014-06-11 12:18:46 +00:00
|
|
|
session.setUseSoftTabs(!$(this).is(':checked'))
|
|
|
|
|
})
|
|
|
|
|
|
2014-07-01 07:17:53 +00:00
|
|
|
$('#Form-field-EditorPreferences-show_gutter').on('change', function(){
|
2014-06-11 12:18:46 +00:00
|
|
|
renderer.setShowGutter($(this).is(':checked'))
|
|
|
|
|
})
|
|
|
|
|
|
2014-06-11 11:19:26 +00:00
|
|
|
})
|
|
|
|
|
|